/* =========================================================
   TFF MASTER TABLES — NATIVE MOBILE SCROLLABLE & EMOJI FALLBACK
   ========================================================= */

/* Container Box & Title */
.tff-master-table-wrapper,
.tff-block-table-wrapper {
  margin: 32px 0;
  padding: 20px 24px;
  background: var(--color-surface, #ffffff);
  border: 1.5px solid var(--color-border, #E2EBE4);
  border-radius: var(--radius-lg, 16px);
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,.08));
}

.tff-master-table-title,
.tff-block-table-title {
  font-family: var(--font-display), -apple-system, sans-serif;
  font-size: var(--text-2xl, 1.5rem);
  font-weight: 800;
  color: var(--color-text, #1A1F1A);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--color-border, #E2EBE4);
}

/* Master Table Scroller (Horizontal Touch Scroll on Mobile) */
.tff-master-table-scroller {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  margin-bottom: 4px;
}

.tff-master-table,
.tff-block-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  min-width: 320px;
}

/* Table Headers (thead) */
.tff-master-table th,
.tff-block-table th {
  padding: 12px 14px;
  background: var(--color-bg-2, #F7F9F7);
  font-weight: 700;
  font-size: 12.5px;
  color: var(--color-text-2, #4A5C4E);
  text-transform: uppercase;
  letter-spacing: .05em;
  border-bottom: 2px solid var(--color-border, #E2EBE4);
  white-space: nowrap;
  text-align: left !important;
}

.tff-master-table th.th-image {
  width: 58px !important;
  min-width: 58px !important;
  padding-left: 8px !important;
  padding-right: 0 !important;
}

/* Table Body Cells (td) */
.tff-master-table td,
.tff-block-table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--color-border, #E2EBE4);
  color: var(--color-text, #1A1F1A);
  font-size: 14px;
  vertical-align: middle;
  text-align: left !important;
}

.tff-master-table tr:last-child td,
.tff-block-table tr:last-child td {
  border-bottom: none;
}

/* Column 0 (Item Name) */
.tff-master-table td.td-column-0,
.tff-block-table .tff-table-item-name {
  font-weight: 700;
  font-size: 14.5px;
  color: var(--color-text, #1a1a1a);
  line-height: 1.35;
}

/* Column 1 (Description / Type) */
.tff-master-table td.td-column-1,
.tff-block-table .tff-table-item-desc {
  font-size: 13px;
  color: var(--color-text-2, #4A5C4E);
  line-height: 1.4;
}

/* Column 2 (Price) */
.tff-master-table td.td-column-2,
.tff-block-table .tff-table-item-price {
  font-weight: 800;
  font-size: 14px;
  color: var(--color-primary, #1A7F4B);
  white-space: nowrap;
}

/* Square Image / Avatar Box (50x50px) - ZERO BLANK SPACE */
.tff-table-avatar-wrap {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-md, 10px);
  background: var(--color-bg-3, #EEF3EE);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid var(--color-border, #E2EBE4);
  flex-shrink: 0;
}

.tff-table-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-md, 10px);
}

/* Emoji Fallback Avatar (Soft Pastel Background + Auto Emoji) */
.tff-table-emoji-fallback {
  font-size: 24px;
  line-height: 1;
}

/* Plus Add Button in Table */
.tff-master-table .menu-item-add,
.tff-block-table .menu-item-add {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-primary, #1A7F4B);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: bold;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
  box-shadow: 0 2px 4px rgba(26, 127, 75, 0.2);
}

.tff-master-table .menu-item-add:hover,
.tff-block-table .menu-item-add:hover {
  transform: scale(1.1);
  background: var(--color-primary-dark, #145E38);
}

/* =========================================================
   MOBILE NATIVE RESPONSIVE RULES (NO CARDS, REAL TABLES)
   ========================================================= */
@media (max-width: 768px) {
  .tff-master-table-wrapper,
  .tff-block-table-wrapper {
    padding: 14px 10px !important;
    margin: 20px 0 !important;
    border-radius: var(--radius-md, 12px) !important;
  }

  .tff-master-table-title,
  .tff-block-table-title {
    font-size: 18px !important;
    margin-bottom: 12px !important;
    padding-bottom: 8px !important;
  }

  /* FORCE REAL NATIVE TABLE LAYOUT (OVERRIDE ALL OLD CARDS CSS) */
  .tff-master-table,
  .tff-master-table thead,
  .tff-master-table tbody,
  .tff-master-table tr,
  .tff-master-table th,
  .tff-master-table td,
  .tff-block-table,
  .tff-block-table thead,
  .tff-block-table tbody,
  .tff-block-table tr,
  .tff-block-table th,
  .tff-block-table td {
    display: table-cell !important;
  }

  .tff-master-table,
  .tff-block-table {
    display: table !important;
  }

  .tff-master-table thead,
  .tff-block-table thead {
    display: table-header-group !important;
  }

  .tff-master-table tbody,
  .tff-block-table tbody {
    display: table-row-group !important;
  }

  .tff-master-table tr,
  .tff-block-table tr {
    display: table-row !important;
  }

  /* Remove weird pseudo-element labels */
  .tff-master-table td::before,
  .tff-block-table td::before {
    content: none !important;
  }

  .tff-master-table td,
  .tff-block-table td {
    padding: 10px 6px !important;
    font-size: 13px !important;
  }

  .tff-table-avatar-wrap {
    width: 42px !important;
    height: 42px !important;
  }

  .tff-table-emoji-fallback {
    font-size: 20px !important;
  }

  .tff-master-table .menu-item-add,
  .tff-block-table .menu-item-add {
    width: 28px !important;
    height: 28px !important;
    font-size: 16px !important;
  }
}