/* ── Chic Seekers — Order Form Styles v5 ── */

:root {
  --gold: #B8975A;
  --gold-light: #E8D9BC;
  --gold-pale: #FAF5EC;
  --dark: #1A1612;
  --mid: #6B5F52;
  --light: #A09080;
  --bg: #F7F4F0;
  --surface: #FFFFFF;
  --border: rgba(184,151,90,0.22);
  --border-focus: rgba(184,151,90,0.7);
  --row-alt: #FAF8F4;
  --danger: #C97B7B;
  --success: #5EA86B;
  --radius: 12px;
  --radius-sm: 6px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--dark);
  min-height: 100vh;
  padding-bottom: 3rem;
}

/* ── Layout ── */
#app { max-width: 780px; margin: 0 auto; padding: 1.5rem 1.5rem; }

.view { display: block; }
.hidden { display: none !important; }

/* ── Header ── */
header {
  text-align: center;
  padding: 2.5rem 1rem 1.75rem;
}

.brand {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2.2rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  color: var(--dark);
  margin-bottom: 0.5rem;
  display: block;
}
.brand span { color: var(--gold); font-style: italic; }

.shop-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--gold-pale);
  border: 0.5px solid var(--border);
  color: var(--mid);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 0.4rem;
}
.closed-badge { background: #FAF0F0; border-color: rgba(201,123,123,0.3); }

.dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--success);
  display: inline-block;
  flex-shrink: 0;
}
.red-dot { background: var(--danger); }

.deadline {
  font-size: 0.72rem;
  color: var(--light);
  letter-spacing: 0.02em;
  margin-top: 2px;
}

/* ── User pill ── */
.user-pill {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.72rem;
  color: var(--mid);
  background: var(--gold-pale);
  border: 0.5px solid var(--border);
  border-radius: 20px;
  padding: 3px 14px;
}

/* ── Cards ── */
main { display: flex; flex-direction: column; gap: 1rem; }

.card {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.5rem 1.25rem;
}

.sec-title {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 500;
  margin-bottom: 1.1rem;
}

/* ── Member fields ── */
.fields-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 520px) {
  .fields-row { grid-template-columns: 1fr; }
}

.field { display: flex; flex-direction: column; gap: 5px; }

.field label {
  font-size: 0.72rem;
  color: var(--mid);
  letter-spacing: 0.04em;
}

.field input {
  border: 0.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  color: var(--dark);
  background: var(--bg);
  outline: none;
  transition: border-color 0.15s;
}
.field input:focus { border-color: var(--border-focus); background: white; }

.req { color: var(--gold); }

/* ── Order Table ── */
.table-scroll { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  min-width: 620px;
}

thead tr { border-bottom: 0.5px solid var(--border); }

th {
  text-align: left;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mid);
  padding: 6px 6px 10px;
  font-weight: 500;
  white-space: nowrap;
}

.col-img   { width: 52px; }
.col-desc  { width: auto; min-width: 160px; }
.col-qty   { width: 54px; }
.col-size  { width: 70px; }
.col-color { width: 70px; }
.col-cost  { width: 88px; }
.col-sub   { width: 80px; }
.col-del   { width: 32px; }

.item-row td {
  padding: 4px 2px;
  vertical-align: middle;
  border-bottom: 0.5px solid rgba(184,151,90,0.1);
}
.item-row:nth-child(even) td { background: var(--row-alt); }

.item-row td input,
.item-row td select {
  width: 100%;
  border: 0.5px solid transparent;
  border-radius: 4px;
  padding: 6px 6px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem;
  color: var(--dark);
  background: transparent;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}
.item-row td input:focus,
.item-row td select:focus {
  border-color: var(--border-focus);
  background: white;
}
.item-row td input[type="number"] { -moz-appearance: textfield; }
.item-row td input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; }

/* Image upload cell */
.img-cell { padding: 4px !important; }

.img-upload-label {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border: 0.5px dashed var(--gold-light);
  border-radius: 6px;
  cursor: pointer;
  background: var(--gold-pale);
  overflow: hidden;
  flex-shrink: 0;
}
.img-upload-label:hover { border-color: var(--gold); }
.img-upload-label span { font-size: 18px; color: var(--gold); line-height: 1; }
.img-upload-label img {
  width: 40px; height: 40px;
  object-fit: cover;
  border-radius: 5px;
  display: none;
}
.img-upload-label input[type="file"] { display: none; }

.subtotal-cell {
  font-weight: 500;
  color: var(--dark);
  padding: 6px 8px !important;
  white-space: nowrap;
}

.del-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #C9A0A0;
  font-size: 0.75rem;
  padding: 4px 6px;
  border-radius: 4px;
  line-height: 1;
  transition: background 0.15s, color 0.15s;
}
.del-btn:hover { background: #FCEAEA; color: var(--danger); }

.add-row-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  margin-top: 10px;
  background: none;
  border: 0.5px dashed var(--gold-light);
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  color: var(--gold);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.add-row-btn:hover { background: var(--gold-pale); border-color: var(--gold); }

/* Totals bar */
.totals-bar {
  display: flex;
  justify-content: flex-end;
  padding: 14px 8px 4px;
  border-top: 0.5px solid var(--border);
  margin-top: 8px;
}
.total-block { text-align: right; min-width: 260px; }
.t-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  padding: 3px 0;
}
.t-label { font-size: 0.75rem; color: var(--light); }
.t-amt { font-size: 0.875rem; color: var(--dark); }
.t-bold { font-weight: 500; color: var(--dark) !important; font-size: 1rem !important; }
.t-muted { color: var(--light) !important; font-style: italic; }
.t-divider { border-top: 0.5px solid var(--border); margin: 5px 0; }
.t-note { font-size: 0.68rem; color: var(--light); margin-top: 6px; text-align: right; line-height: 1.5; }

/* Readonly totals */
.ro-totals {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 0.5px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  min-width: 260px;
  margin-left: auto;
}
.ro-totals .t-row { width: 260px; }

/* ── Submit area ── */
.actions { text-align: center; padding: 0.25rem 0; }

.submit-btn {
  width: 100%;
  max-width: 400px;
  background: var(--dark);
  color: var(--gold-light);
  border: none;
  border-radius: 8px;
  padding: 15px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.15rem;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.submit-btn:hover { background: var(--gold); color: white; }
.submit-btn:disabled { background: #ccc; color: #999; cursor: not-allowed; }

.save-note {
  font-size: 0.72rem;
  color: var(--light);
  margin-top: 8px;
}

/* ── Message box ── */
.msg {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  text-align: center;
  margin-top: 0.75rem;
}
.msg.success { background: #EAF6EC; color: #2E7D3A; border: 0.5px solid #A8D9AD; }
.msg.error   { background: #FAEAEA; color: #8B2929; border: 0.5px solid #E0AAAA; }

/* ── Center card (lookup, closed) ── */
.center-card {
  max-width: 460px;
  margin: 5rem auto 0;
  text-align: center;
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
  padding: 3rem 2.5rem 2.5rem;
}
.center-card .brand { margin-bottom: 0.25rem; }
.closed-icon { font-size: 2.5rem; margin: 1.25rem 0 0.75rem; }
.center-card h2 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 400;
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
  color: var(--dark);
}
.center-card p { font-size: 0.85rem; color: var(--mid); line-height: 1.7; }

/* ── Email lookup ── */
.lookup-sub {
  font-size: 0.85rem;
  color: var(--mid);
  margin-top: 0.75rem;
  line-height: 1.6;
}

/* ── History view ── */
#view-history header { padding-bottom: 0.5rem; }

#view-history main {
  max-width: 580px;
  margin: 0 auto;
}

.history-section-title {
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--light);
  margin: 1.5rem 0 0.75rem;
  font-weight: 500;
}

.history-card {
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 0.75rem;
  background: var(--surface);
}

.active-shop-card {
  background: var(--gold-pale);
  border-color: rgba(184,151,90,0.45);
}

.hc-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.85rem;
}

.hc-shop {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 500;
  font-size: 1.2rem;
  color: var(--dark);
  letter-spacing: 0.02em;
}
.hc-date { font-size: 0.72rem; color: var(--light); margin-top: 3px; }

.hc-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: var(--mid);
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 0.5px solid var(--border);
}
.hc-summary.no-order {
  color: var(--light);
  font-style: italic;
  justify-content: center;
  border-bottom: none;
  margin-bottom: 0.5rem;
}
.hc-total {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--dark);
}

.hc-btn {
  width: 100%;
  background: var(--dark);
  color: var(--gold-light);
  border: none;
  border-radius: 7px;
  padding: 11px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1rem;
  letter-spacing: 0.07em;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.hc-btn:hover { background: var(--gold); color: white; }
.hc-btn.ghost {
  background: none;
  color: var(--mid);
  border: 0.5px solid var(--border);
}
.hc-btn.ghost:hover { background: var(--gold-pale); color: var(--dark); border-color: var(--gold); }

/* ── Status badges ── */
.status-badge {
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: 500;
  flex-shrink: 0;
}
.status-badge.open   { background: #EAF6EC; color: #2A7035; border: 0.5px solid #A8D9AD; }
.status-badge.closed { background: #F5F0EC; color: var(--mid); border: 0.5px solid var(--border); }

/* ── Ghost button ── */
.ghost-btn {
  background: none;
  border: 0.5px solid var(--border);
  color: var(--light);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.78rem;
  cursor: pointer;
  padding: 7px 16px;
  border-radius: 20px;
  transition: all 0.15s;
}
.ghost-btn:hover { color: var(--mid); background: var(--gold-pale); border-color: var(--gold); }

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--light);
  font-size: 0.85rem;
  line-height: 1.7;
}

/* ── Readonly summary ── */
.ro-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.ro-table th {
  text-align: left;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mid);
  padding: 6px 8px 10px;
  border-bottom: 0.5px solid var(--border);
  font-weight: 500;
}
.ro-table td {
  padding: 9px 8px;
  border-bottom: 0.5px solid rgba(184,151,90,0.1);
  color: var(--dark);
}
.ro-total {
  text-align: right;
  padding: 14px 8px 4px;
  font-size: 0.82rem;
  color: var(--mid);
}
.ro-total strong {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.3rem;
  color: var(--dark);
  margin-left: 8px;
}

/* ── Spinner ── */
.spinner {
  display: inline-block;
  width: 15px; height: 15px;
  border: 2px solid var(--gold-light);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Loading dots ── */
.loading-dots {
  display: flex;
  justify-content: center;
  gap: 7px;
  margin-top: 2rem;
}
.loading-dots span {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--gold-light);
  animation: pulse 1.2s ease-in-out infinite;
}
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes pulse {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50%       { opacity: 1;   transform: scale(1); }
}

/* ── Mobile: card-per-item layout ── */
@media (max-width: 600px) {
  .table-scroll { overflow-x: visible; }

  table { min-width: unset; width: 100%; }
  table, thead, tbody, th, td, tr { display: block; width: 100%; }

  thead { display: none; }

  .item-row {
    background: var(--surface);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    padding: 10px 12px 8px;
    position: relative;
    width: 100%;
    box-sizing: border-box;
  }
  .item-row:nth-child(even) td { background: transparent; }
  .item-row td {
    padding: 4px 0;
    border-bottom: none;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
  }
  .item-row td::before {
    content: attr(data-label);
    font-size: 0.65rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--light);
    width: 72px;
    min-width: 72px;
    flex-shrink: 0;
  }
  .item-row td input {
    border: 0.5px solid var(--border);
    border-radius: 4px;
    background: var(--bg);
    padding: 7px 8px;
    flex: 1;
    min-width: 0;
    width: 0;
    box-sizing: border-box;
  }
  .item-row td input:focus {
    border-color: var(--border-focus);
    background: white;
  }

  /* Image cell */
  .img-cell { justify-content: flex-start; }
  .img-cell::before { content: 'Image'; }
  .img-upload-label { width: 44px; height: 44px; flex-shrink: 0; }
  .img-upload-label img { width: 44px; height: 44px; }

  /* Subtotal cell */
  .subtotal-cell {
    justify-content: space-between;
    font-size: 0.9rem;
    padding: 6px 0 2px !important;
    border-top: 0.5px solid var(--border) !important;
    margin-top: 4px;
  }
  .subtotal-cell::before { content: 'Subtotal'; }

  /* Delete button — top right corner */
  .item-row td:last-child {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 0;
    width: auto;
  }
  .item-row td:last-child::before { display: none; }

  .col-img, .col-desc, .col-qty, .col-size,
  .col-color, .col-cost, .col-sub, .col-del { width: auto; }
}

/* ── Select dropdown ── */
.field select {
  border: 0.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  color: var(--dark);
  background: var(--bg);
  outline: none;
  transition: border-color 0.15s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23A09080' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}
.field select:focus { border-color: var(--border-focus); background-color: white; }

/* ── Item image thumbnail (readonly view) ── */
.img-thumb-link { display: block; width: 40px; height: 40px; }
.img-thumb {
  width: 40px; height: 40px;
  object-fit: cover;
  border-radius: 5px;
  border: 0.5px solid var(--border);
}
.img-link-fallback { font-size: 20px; }

/* ── Received badge ── */
.received-badge {
  display: inline-block;
  font-size: 0.65rem;
  letter-spacing: 0.05em;
  background: #EAF6EC;
  color: #2A7035;
  border: 0.5px solid #A8D9AD;
  border-radius: 20px;
  padding: 2px 8px;
  margin-left: 6px;
  vertical-align: middle;
  font-weight: 500;
}

/* ── Received row highlight (readonly table) ── */
.ro-table tr.row-received td {
  background: #F0FAF1;
  color: #2A7035;
}

/* ── Ready count on history cards ── */
.ready-count {
  color: #2A7035;
  font-weight: 500;
}

/* ── Comments textarea ── */
#order-comments {
  width: 100%;
  border: 0.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  color: var(--dark);
  background: var(--bg);
  outline: none;
  resize: vertical;
  transition: border-color 0.15s;
  line-height: 1.6;
}
#order-comments:focus { border-color: var(--border-focus); background: white; }

/* ── Terms block ── */
.terms-block {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
}
.terms-text {
  font-size: 0.78rem;
  color: var(--mid);
  line-height: 1.7;
  max-height: 180px;
  overflow-y: auto;
  padding-right: 6px;
  margin-bottom: 1rem;
  border-bottom: 0.5px solid var(--border);
  padding-bottom: 1rem;
}
.terms-text ul {
  margin: 0.5rem 0 0.5rem 1.25rem;
}
.terms-text ul li { margin-bottom: 3px; }
.terms-check-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--dark);
  font-weight: 500;
}
.terms-check-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--gold);
  flex-shrink: 0;
  cursor: pointer;
}

/* ── Paid badge ── */
.paid-badge {
  display: inline-block;
  font-size: 0.65rem;
  letter-spacing: 0.05em;
  background: #EAF1FB;
  color: #1A5BA6;
  border: 0.5px solid #9DBFE8;
  border-radius: 20px;
  padding: 2px 8px;
  margin-left: 6px;
  vertical-align: middle;
  font-weight: 500;
}

/* ── Button spinner ── */
.btn-spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid rgba(232,217,188,0.4);
  border-top-color: var(--gold-light);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 7px;
}

/* ── Out of Stock ── */
.oos-badge {
  display: inline-block;
  font-size: 0.65rem;
  letter-spacing: 0.05em;
  background: #FFEEE6;
  color: #8B3A00;
  border: 0.5px solid #FFBB99;
  border-radius: 20px;
  padding: 2px 8px;
  margin-left: 6px;
  vertical-align: middle;
  font-weight: 500;
}
.oos-count {
  color: #8B3A00;
  font-weight: 500;
}
.ro-table tr.row-oos td {
  background: #FFF4EE;
  color: #8B3A00;
  opacity: 0.8;
}

/* ── OOS warning message ── */
.msg.oos-warning {
  background: #FFF4EE;
  color: #8B3A00;
  border: 0.5px solid #FFBB99;
  text-align: left;
  padding: 12px 16px;
}

/* ── Shipped badge ── */
.shipped-badge {
  display: inline-block;
  font-size: 0.65rem;
  letter-spacing: 0.05em;
  background: #D6EAF8;
  color: #154360;
  border: 0.5px solid #85C1E9;
  border-radius: 20px;
  padding: 2px 8px;
  margin-left: 6px;
  vertical-align: middle;
  font-weight: 500;
}
.ro-table tr.row-shipped td {
  background: #EBF5FB;
  color: #154360;
  opacity: 0.8;
}

/* ── Help link ── */
.help-link {
  background: none;
  border: none;
  color: var(--gold);
  font-size: 0.82rem;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 4px 0;
  font-family: inherit;
}
.help-link:hover { color: var(--gold-light); }

/* ── Help modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-overlay.hidden { display: none; }
.modal-box {
  background: #fff;
  border-radius: 16px;
  max-width: 520px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 2rem;
  position: relative;
}
.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  color: var(--mid);
  padding: 4px 8px;
}
.modal-close:hover { color: var(--dark); }
.modal-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.5rem;
  color: var(--dark);
  margin-bottom: 1.25rem;
}
.modal-section {
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 0.5px solid var(--border);
}
.modal-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}
.modal-heading {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.6rem;
}
.modal-section ul {
  margin: 0;
  padding-left: 1.2rem;
}
.modal-section ul li {
  font-size: 0.88rem;
  color: var(--dark);
  margin-bottom: 0.35rem;
  line-height: 1.5;
}
.modal-section p {
  font-size: 0.88rem;
  color: var(--dark);
  margin: 0;
  line-height: 1.5;
}
.badge-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  color: var(--dark);
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

/* ── Readonly table desktop ── */
.ro-table .ro-qty-cell  { text-align: center; }
.ro-table .ro-cost-cell { text-align: right; }
.ro-table .ro-sub-cell  { text-align: right; }

/* ── Readonly table mobile ── */
@media (max-width: 600px) {
  .ro-table thead { display: none; }
  .ro-table tbody { display: block; }
  .ro-table tr {
    display: grid;
    grid-template-columns: 52px 1fr auto;
    grid-template-rows: auto auto auto auto;
    gap: 2px 8px;
    padding: 10px 4px;
    border-bottom: 0.5px solid var(--border);
    align-items: start;
    border-radius: 6px;
    margin-bottom: 4px;
  }

  /* Row highlight — apply to tr directly on mobile */
  .ro-table tr.row-received { background: #F0FAF1; }
  .ro-table tr.row-oos      { background: #FFF4EE; opacity: 0.9; }
  .ro-table tr.row-shipped  { background: #EBF5FB; opacity: 0.9; }
  .ro-table tr.row-received td,
  .ro-table tr.row-oos td,
  .ro-table tr.row-shipped td { background: transparent !important; }

  .ro-table td { padding: 0; border: none; font-size: 0.84rem; }

  .ro-img-cell  { grid-row: 1 / 5; grid-column: 1; align-self: start; }
  .ro-img-cell img { width: 48px !important; height: 48px !important; object-fit: cover; }

  .ro-desc-cell { grid-row: 1; grid-column: 2; font-weight: 600; line-height: 1.3; }

  .ro-qty-cell  { grid-row: 2; grid-column: 2; color: var(--light); font-size: 0.75rem; text-align: left !important; }
  .ro-qty-cell::before { content: 'Qty: '; }

  .ro-size-cell  { grid-row: 3; grid-column: 2; color: var(--light); font-size: 0.75rem; }
  .ro-size-cell:not(:empty)::before { content: 'Size: '; }
  .ro-size-cell:empty { display: none; }

  .ro-color-cell { grid-row: 4; grid-column: 2; color: var(--light); font-size: 0.75rem; }
  .ro-color-cell:not(:empty)::before { content: 'Color: '; }
  .ro-color-cell:empty { display: none; }

  .ro-cost-cell  { grid-row: 2; grid-column: 3; text-align: right; font-size: 0.82rem; }
  .ro-sub-cell   { display: none; }
}

/* ═══════════════════════════════════════════════════════
   TAB NAVIGATION
═══════════════════════════════════════════════════════ */
.member-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1.5px solid var(--border);
  margin-top: 0.75rem;
}
.member-tab {
  flex: 1;
  padding: 10px 8px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1.5px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--light);
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: color 0.15s, border-color 0.15s;
  text-align: center;
}
.member-tab:hover { color: var(--dark); }
.member-tab.active {
  color: var(--dark);
  border-bottom-color: var(--gold);
  font-weight: 600;
}

.tab-content { padding-top: 1rem; }

/* ═══════════════════════════════════════════════════════
   SHOP FORM HEADER
═══════════════════════════════════════════════════════ */
.shop-form-header {
  text-align: center;
  margin-bottom: 1rem;
}

/* ═══════════════════════════════════════════════════════
   DASHBOARD FOOTER
═══════════════════════════════════════════════════════ */
.dashboard-footer {
  text-align: center;
  padding: 1rem 0 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.footer-divider {
  color: var(--border);
  font-size: 0.85rem;
}

/* ═══════════════════════════════════════════════════════
   WISHLIST
═══════════════════════════════════════════════════════ */
.wishlist-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.wishlist-intro {
  font-size: 0.82rem;
  color: var(--mid);
  line-height: 1.5;
  flex: 1;
  min-width: 200px;
}

.wishlist-card {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
}
.wl-card-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}
.wl-thumb {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}
.wl-thumb-empty {
  width: 52px;
  height: 52px;
  background: var(--bg);
  border: 0.5px solid var(--border);
  border-radius: 6px;
  flex-shrink: 0;
}
.wl-card-info { flex: 1; min-width: 0; }
.wl-card-desc {
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--dark);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wl-card-details {
  font-size: 0.75rem;
  color: var(--light);
  line-height: 1.4;
}
.wl-card-actions {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: flex-end;
  flex-shrink: 0;
}
.wl-add-btn {
  padding: 5px 12px;
  background: var(--dark);
  color: var(--gold-light);
  border: none;
  border-radius: 6px;
  font-size: 0.75rem;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}
.wl-add-btn:hover { background: #2D2520; }
.wl-edit-btn, .wl-del-btn {
  padding: 4px 10px;
  background: none;
  border: 0.5px solid var(--border);
  border-radius: 6px;
  font-size: 0.73rem;
  font-family: inherit;
  cursor: pointer;
  color: var(--mid);
}
.wl-edit-btn:hover { border-color: var(--gold); color: var(--dark); }
.wl-del-btn:hover  { border-color: #E57373; color: #C62828; }

/* Wishlist modal image */
.wl-img-label {
  width: 80px !important;
  height: 80px !important;
}
.opt-label {
  font-size: 0.72rem;
  color: var(--light);
}

/* ═══════════════════════════════════════════════════════
   MOBILE OVERRIDES FOR TABS + WISHLIST
═══════════════════════════════════════════════════════ */
@media (max-width: 520px) {
  .member-tab { font-size: 0.75rem; padding: 9px 4px; }
  .wishlist-toolbar { flex-direction: column; }
  .wishlist-card { flex-wrap: wrap; }
  .wl-card-actions { flex-direction: row; width: 100%; justify-content: flex-end; }
}

.help-bar {
  text-align: center;
  padding: 6px 0 2px;
  border-bottom: 0.5px solid var(--border);
  margin-bottom: 4px;
}

/* ── CATALOG ─────────────────────────────────────────────────────────────── */
.catalog-toolbar {
  padding: 12px 0 8px;
}
.catalog-search-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.88rem;
  font-family: inherit;
  background: #fff;
  color: var(--dark);
  outline: none;
}
.catalog-search-input:focus { border-color: var(--gold); }

.catalog-section {
  background: #fff;
  border: 0.5px solid var(--border);
  border-radius: 12px;
  margin-bottom: 10px;
  overflow: hidden;
}
.cat-section-header {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  cursor: pointer;
  user-select: none;
  gap: 8px;
}
.cat-section-header:hover { background: var(--bg); }
.cat-section-title {
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dark);
  flex: 1;
}
.cat-section-count {
  font-size: 0.75rem;
  color: var(--light);
  background: var(--bg);
  padding: 2px 8px;
  border-radius: 10px;
}
.cat-chevron {
  color: var(--gold);
  font-size: 0.9rem;
  transition: transform 0.2s;
}
.cat-section-body { padding: 0 12px 12px; }
.cat-section-body.hidden { display: none; }

.cat-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  padding-top: 12px;
}
.cat-item-card {
  border: 0.5px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}
.cat-thumb {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
}
.cat-thumb-empty {
  width: 100%;
  height: 140px;
  background: var(--border);
}
.cat-item-info {
  padding: 8px 10px 4px;
  flex: 1;
}
.cat-item-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 2px;
}
.cat-item-desc {
  font-size: 0.75rem;
  color: var(--light);
  margin-bottom: 4px;
  line-height: 1.4;
}
.cat-item-price {
  font-size: 0.82rem;
  color: var(--gold);
  font-weight: 500;
}
.cat-item-actions {
  padding: 8px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cat-shop-btn {
  background: var(--dark);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 0.75rem;
  font-family: inherit;
  cursor: pointer;
  font-weight: 500;
  letter-spacing: 0.03em;
}
.cat-shop-btn:hover { background: #333; }
.cat-shop-btn.disabled {
  background: #ccc;
  color: #888;
  cursor: not-allowed;
}
.cat-wl-btn {
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--gold);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 0.75rem;
  font-family: inherit;
  cursor: pointer;
  font-weight: 500;
}
.cat-wl-btn:hover { background: var(--gold); color: #fff; }

.cat-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding-top: 12px;
}
.cat-page-btn {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 0.8rem;
  font-family: inherit;
  cursor: pointer;
  color: var(--dark);
}
.cat-page-btn:hover { border-color: var(--gold); color: var(--gold); }
.cat-page-info {
  font-size: 0.8rem;
  color: var(--light);
}

@media (max-width: 480px) {
  .cat-items-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── CATALOG FILTER PILLS ────────────────────────────────────────────────── */
.cat-filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 0 6px;
}
.cat-pill {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 0.78rem;
  font-family: inherit;
  cursor: pointer;
  color: var(--dark);
  transition: all 0.15s;
}
.cat-pill:hover { border-color: var(--gold); color: var(--gold); }
.cat-pill.active { background: var(--gold); border-color: var(--gold); color: #fff; }

/* Featured header */
.featured-header { background: linear-gradient(135deg, #fdf8f0, #fff); }

/* Sub-category label on item card */
.cat-item-sub {
  font-size: 0.68rem;
  color: var(--light);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 3px;
}

/* Sub-category row in admin sidebar */
.cat-subcat-row {
  padding-left: 18px !important;
  font-size: 0.82rem;
}

/* Sub-sub-category pills */
.cat-filter-subpills {
  padding-top: 4px;
  padding-left: 12px;
  border-left: 2px solid var(--border);
  margin-left: 8px;
}
