/* ==========================================================================
   LeGlamorous Jewels — Design System
   One palette, one type scale and one component set for the storefront,
   B2B Partner portal, customer account and admin panel.
   All text colours meet WCAG AA (4.5:1) against the surfaces they sit on.
   ========================================================================== */

:root {
  /* Text */
  --ink: #1C1814;            /* primary text            16.9:1 on white */
  --ink-2: #463D34;          /* secondary text          10.2:1 on white */
  --ink-3: #665C52;          /* muted text / captions    6.3:1 on white, 5.8:1 on ivory */
  --placeholder: #7A7066;    /* placeholders             4.9:1 on white */

  /* Surfaces */
  --bg: #FAF7F2;             /* page background (ivory) */
  --surface: #FFFFFF;
  --surface-2: #F5EFE6;      /* table headers, subtle panels */
  --surface-3: #ECE3D5;
  --line: #E3D9CA;
  --line-strong: #C9BBA5;

  /* Brand */
  --onyx: #1F1A15;           /* header accents, footer, sidebar, primary buttons */
  --onyx-2: #2E2720;
  --onyx-3: #3B332A;
  --on-dark: #F7F1E6;        /* text on onyx            15.9:1 */
  --on-dark-2: #D9CEBC;      /* secondary text on onyx  10.9:1 */
  --on-dark-3: #B3A68F;      /* labels on onyx           7.4:1 */
  --gold: #B08D3C;           /* ornaments, borders, icons (non-text) */
  --gold-bright: #D9B96E;    /* gold on dark surfaces    9.1:1 on onyx */
  --gold-fill: #C9A45C;      /* gold button background (ink text 7.6:1) */
  --gold-fill-hover: #B8923F;
  --gold-text: #7A5A12;      /* gold text on light       6.4:1 on white */
  --gold-tint: #F7EFDD;

  /* Status (text on its own tint always ≥ 6:1) */
  --success: #166534; --success-bg: #E5F4EA; --success-line: #A8D5B6;
  --warning: #854A06; --warning-bg: #FDF1D6; --warning-line: #EFCB84;
  --danger:  #A61B1B; --danger-bg:  #FCEBEB; --danger-line:  #EFB3B3;
  --info:    #1D4E96; --info-bg:    #E7EEFA; --info-line:    #AFC6EA;
  --purple:  #5B2BA0; --purple-bg:  #F0EAFB; --purple-line:  #CDB9EE;
  --neutral: #3F3831; --neutral-bg: #EEE9E2; --neutral-line: #D3C9BB;

  /* Type */
  --serif: 'Cormorant Garamond', 'Playfair Display', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;

  /* Shape & depth */
  --r-sm: 6px; --r-md: 10px; --r-lg: 16px; --r-full: 999px;
  --shadow-sm: 0 1px 2px rgba(31, 26, 21, .06), 0 1px 3px rgba(31, 26, 21, .05);
  --shadow-md: 0 4px 16px rgba(31, 26, 21, .08);
  --shadow-lg: 0 18px 48px rgba(31, 26, 21, .16);
  --focus-ring: 0 0 0 3px rgba(176, 141, 60, .35);

  --header-h: 76px;
  --container: 1240px;
  color-scheme: light;
}

/* ── Base ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 15px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; color: var(--ink); line-height: 1.15; margin: 0 0 .5em; letter-spacing: .005em; font-variant-numeric: lining-nums; font-feature-settings: "lnum" 1; }
h1 { font-size: clamp(2rem, 3.2vw, 2.75rem); }
h2 { font-size: clamp(1.6rem, 2.4vw, 2.1rem); }
h3 { font-size: 1.4rem; }
h4 { font-size: 1.15rem; }
h5, h6 { font-family: var(--sans); font-weight: 600; margin: 0 0 .4em; color: var(--ink); }
p { margin: 0 0 1em; }
a { color: var(--gold-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img { max-width: 100%; display: block; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.5rem 0; }
small, .small { font-size: .85rem; }
strong { font-weight: 600; }
::selection { background: var(--gold-tint); color: var(--ink); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--onyx); color: var(--on-dark); padding: .6rem 1rem; border-radius: var(--r-sm); z-index: 1000; }
.skip-link:focus { left: 8px; }

/* ── Utilities ────────────────────────────────────────────────────────── */
.hidden { display: none !important; }
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.muted { color: var(--ink-3); }
.secondary { color: var(--ink-2); }
.gold { color: var(--gold-text); }
.text-right { text-align: right; } .text-center { text-align: center; }
.nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, 'SFMono-Regular', Consolas, monospace; font-size: .9em; }
.flex { display: flex; } .items-center { align-items: center; } .justify-between { justify-content: space-between; }
.wrap { flex-wrap: wrap; } .grow { flex: 1 1 auto; }
.gap-1 { gap: .5rem; } .gap-2 { gap: 1rem; } .gap-3 { gap: 1.5rem; }
.mt-0 { margin-top: 0 !important; } .mt-1 { margin-top: .5rem !important; } .mt-2 { margin-top: 1rem !important; } .mt-3 { margin-top: 1.5rem !important; } .mt-4 { margin-top: 2rem !important; }
.mb-0 { margin-bottom: 0 !important; } .mb-1 { margin-bottom: .5rem !important; } .mb-2 { margin-bottom: 1rem !important; } .mb-3 { margin-bottom: 1.5rem !important; }
.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.eyebrow { display: inline-block; font-family: var(--sans); font-size: .74rem; letter-spacing: .22em; text-transform: uppercase; color: var(--gold-text); font-weight: 600; }
.divider-orn { display: flex; align-items: center; justify-content: center; gap: .75rem; color: var(--gold); }
.divider-orn::before, .divider-orn::after { content: ""; height: 1px; width: 48px; background: currentColor; opacity: .7; }

/* ── Brand identity ───────────────────────────────────────────────────── */
.brand { display: inline-flex; align-items: center; gap: .7rem; color: var(--ink); text-decoration: none !important; line-height: 1; }
.brand-mark { width: 30px; height: 24px; color: var(--gold); flex: 0 0 auto; }
.brand-text { display: flex; flex-direction: column; gap: 3px; }
.brand-name { font-family: var(--serif); font-weight: 600; font-size: 1.55rem; letter-spacing: .01em; white-space: nowrap; font-feature-settings: "lnum" 1; }
.brand-name em { font-style: italic; font-weight: 500; }
.brand-tag { font-family: var(--sans); font-size: .6rem; letter-spacing: .32em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
.brand--dark { color: var(--on-dark); }
.brand--dark .brand-mark { color: var(--gold-bright); }
.brand--dark .brand-tag { color: var(--on-dark-3); }
.brand--stacked { flex-direction: column; gap: .55rem; text-align: center; }
.brand--stacked .brand-name { font-size: 2.2rem; }
.brand--stacked .brand-mark { width: 40px; height: 32px; order: 2; }
.brand--stacked .brand-orn { order: 2; }
.brand--stacked .brand-tag { order: 3; }
.brand-orn { display: flex; align-items: center; gap: .6rem; color: var(--gold); }
.brand-orn::before, .brand-orn::after { content: ""; width: 44px; height: 1px; background: currentColor; }
.brand-orn svg { width: 22px; height: 18px; }
.brand--dark .brand-orn { color: var(--gold-bright); }

/* ── Buttons ──────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 42px; padding: .55rem 1.15rem; border-radius: var(--r-sm);
  font-family: var(--sans); font-size: .9rem; font-weight: 600; line-height: 1.2; letter-spacing: .01em;
  border: 1.5px solid transparent; cursor: pointer; text-decoration: none !important;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s; white-space: nowrap;
  background: var(--surface); color: var(--ink);
}
.btn svg { width: 18px; height: 18px; flex: 0 0 auto; }
.btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.btn[disabled], .btn.is-loading { opacity: .6; cursor: not-allowed; }
.btn.is-loading::after { content: ""; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
.btn-primary { background: var(--onyx); color: var(--on-dark); border-color: var(--onyx); }
.btn-primary:hover { background: var(--onyx-3); border-color: var(--onyx-3); }
.btn-gold { background: var(--gold-fill); color: var(--ink); border-color: var(--gold-fill); }
.btn-gold:hover { background: var(--gold-fill-hover); border-color: var(--gold-fill-hover); }
.btn-outline { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-outline:hover { border-color: var(--ink); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: #8A1515; }
.btn-danger-outline { background: var(--surface); color: var(--danger); border-color: var(--danger-line); }
.btn-danger-outline:hover { background: var(--danger-bg); border-color: var(--danger); }
.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-sm { min-height: 34px; padding: .35rem .75rem; font-size: .82rem; }
.btn-sm svg { width: 16px; height: 16px; }
.btn-lg { min-height: 50px; padding: .75rem 1.6rem; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-icon { min-height: 36px; width: 36px; padding: 0; }
.btn-group { display: inline-flex; gap: .5rem; flex-wrap: wrap; }
.link-btn { background: none; border: 0; padding: 0; color: var(--gold-text); font: inherit; font-weight: 600; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }

/* ── Forms ────────────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: .35rem; margin-bottom: 1rem; min-width: 0; }
.field > label, .label { font-size: .84rem; font-weight: 600; color: var(--ink); }
.field .req { color: var(--danger); margin-left: 2px; }
.help { font-size: .8rem; color: var(--ink-3); }
.field-error { font-size: .8rem; color: var(--danger); font-weight: 500; }
input:not([type]), input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="tel"],
input[type="search"], input[type="date"], input[type="url"], select, textarea, .input {
  width: 100%; min-height: 42px; padding: .55rem .8rem; border: 1.5px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink); font-family: var(--sans); font-size: .93rem; line-height: 1.4;
  transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 96px; resize: vertical; }
select { appearance: none; padding-right: 2.2rem; 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' fill='none' stroke='%23463D34' stroke-width='1.8'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .85rem center; }
input:hover, select:hover, textarea:hover { border-color: var(--ink-3); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: var(--focus-ring); }
input::placeholder, textarea::placeholder { color: var(--placeholder); opacity: 1; }
input[disabled], select[disabled], textarea[disabled], input[readonly] { background: var(--surface-2); color: var(--ink-2); }
input.is-invalid, select.is-invalid, textarea.is-invalid { border-color: var(--danger); }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; accent-color: var(--onyx); margin: 0; }
.check { display: inline-flex; align-items: center; gap: .55rem; font-size: .92rem; color: var(--ink); cursor: pointer; }
.input-affix { position: relative; display: flex; align-items: stretch; }
.input-affix > span { display: flex; align-items: center; padding: 0 .75rem; background: var(--surface-2); border: 1.5px solid var(--line-strong); border-right: 0; border-radius: var(--r-sm) 0 0 var(--r-sm); color: var(--ink-2); font-weight: 600; }
.input-affix > input { border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.input-icon { position: relative; }
.input-icon svg { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--ink-3); pointer-events: none; }
.input-icon input { padding-left: 2.4rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 1rem; }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-section { border-top: 1px solid var(--line); padding-top: 1.25rem; margin-top: .5rem; }
.form-section h4 { font-family: var(--sans); font-size: .95rem; font-weight: 700; margin-bottom: .9rem; }
.form-actions { display: flex; justify-content: flex-end; gap: .75rem; flex-wrap: wrap; margin-top: 1rem; }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 4.5rem; }
.password-wrap button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--gold-text); font-weight: 600; font-size: .82rem; cursor: pointer; padding: .4rem .5rem; }

/* ── Cards ────────────────────────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-sm); }
.card-pad { padding: 1.4rem; }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.05rem 1.4rem; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card-header h3, .card-header h4 { margin: 0; }
.card-title { font-family: var(--sans); font-size: 1rem; font-weight: 700; color: var(--ink); margin: 0; }
.card-sub { font-size: .82rem; color: var(--ink-3); margin: .15rem 0 0; }
.card-body { padding: 1.4rem; }
.card-footer { padding: 1rem 1.4rem; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--r-md) var(--r-md); }
.stat-list { display: grid; gap: .6rem; }
.stat-row { display: flex; justify-content: space-between; gap: 1rem; font-size: .92rem; }
.stat-row > span:first-child { color: var(--ink-2); }
.stat-row > span:last-child { font-weight: 600; color: var(--ink); text-align: right; }
.stat-row.total { border-top: 1px solid var(--line); padding-top: .75rem; margin-top: .25rem; font-size: 1.05rem; }
.stat-row.total > span { font-weight: 700; color: var(--ink); }
.dl { display: grid; grid-template-columns: minmax(120px, auto) 1fr; gap: .45rem 1rem; margin: 0; font-size: .92rem; }
.dl dt { color: var(--ink-3); } .dl dd { margin: 0; color: var(--ink); font-weight: 500; word-break: break-word; }

/* ── Badges ───────────────────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: .35rem; padding: .22rem .6rem; border-radius: var(--r-full); font-size: .74rem; font-weight: 700; letter-spacing: .02em; border: 1px solid transparent; white-space: nowrap; line-height: 1.3; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.no-dot::before { display: none; }
.badge-success, .badge-delivered, .badge-paid, .badge-active, .badge-in_stock, .badge-approved, .badge-completed, .badge-fulfilled { color: var(--success); background: var(--success-bg); border-color: var(--success-line); }
.badge-warning, .badge-pending, .badge-low_stock, .badge-countered { color: var(--warning); background: var(--warning-bg); border-color: var(--warning-line); }
.badge-danger, .badge-cancelled, .badge-failed, .badge-out_of_stock, .badge-inactive, .badge-rejected { color: var(--danger); background: var(--danger-bg); border-color: var(--danger-line); }
.badge-info, .badge-confirmed, .badge-processing { color: var(--info); background: var(--info-bg); border-color: var(--info-line); }
.badge-purple, .badge-packed, .badge-shipped, .badge-out_for_delivery { color: var(--purple); background: var(--purple-bg); border-color: var(--purple-line); }
.badge-neutral, .badge-returned, .badge-refunded, .badge-guest { color: var(--neutral); background: var(--neutral-bg); border-color: var(--neutral-line); }
.badge-gold, .badge-b2b_client, .badge-super_admin { color: var(--gold-text); background: var(--gold-tint); border-color: #E5D3A6; }
.badge-admin, .badge-customer { color: var(--ink-2); background: var(--surface-2); border-color: var(--line-strong); }

/* ── Tables ───────────────────────────────────────────────────────────── */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { background: var(--surface-2); color: var(--ink); font-weight: 700; font-size: .76rem; letter-spacing: .05em; text-transform: uppercase; text-align: left; padding: .75rem 1rem; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
.table td { padding: .8rem 1rem; border-bottom: 1px solid var(--line); color: var(--ink); vertical-align: middle; }
.table tbody tr:hover td { background: #FCFAF6; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table td.mono, .table .cell-sub.mono { white-space: nowrap; }
.table td:first-child > strong, .table td:first-child > a > strong { white-space: nowrap; }
.table th.sortable { cursor: pointer; user-select: none; }
.table th.sortable:hover { color: var(--gold-text); }
.table th.sorted-asc::after { content: " ▲"; font-size: .65rem; }
.table th.sorted-desc::after { content: " ▼"; font-size: .65rem; }
.table .cell-sub { display: block; font-size: .8rem; color: var(--ink-3); margin-top: 2px; }
.table .thumb { width: 44px; height: 44px; border-radius: var(--r-sm); object-fit: cover; background: var(--surface-2); border: 1px solid var(--line); }
.table .actions { display: flex; gap: .35rem; justify-content: flex-end; flex-wrap: nowrap; }
.table tfoot td { font-weight: 700; background: var(--surface-2); border-top: 1px solid var(--line-strong); }
.table-compact td, .table-compact th { padding: .55rem .75rem; }

/* ── Alerts, toasts, empty & loading states ───────────────────────────── */
.alert { display: flex; gap: .7rem; align-items: flex-start; padding: .85rem 1rem; border-radius: var(--r-sm); border: 1px solid; font-size: .9rem; margin-bottom: 1rem; }
.alert svg { width: 20px; height: 20px; flex: 0 0 auto; margin-top: 1px; }
.alert-success { color: var(--success); background: var(--success-bg); border-color: var(--success-line); }
.alert-error { color: var(--danger); background: var(--danger-bg); border-color: var(--danger-line); }
.alert-warning { color: var(--warning); background: var(--warning-bg); border-color: var(--warning-line); }
.alert-info { color: var(--info); background: var(--info-bg); border-color: var(--info-line); }
.toast-stack { position: fixed; top: 18px; right: 18px; z-index: 3000; display: flex; flex-direction: column; gap: .6rem; max-width: min(420px, calc(100vw - 36px)); }
.toast { display: flex; gap: .7rem; align-items: flex-start; padding: .85rem 1rem; border-radius: var(--r-sm); background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-left: 4px solid var(--info); box-shadow: var(--shadow-lg); font-size: .9rem; animation: toast-in .2s ease-out; }
.toast svg { width: 20px; height: 20px; flex: 0 0 auto; }
.toast.success { border-left-color: var(--success); } .toast.success svg { color: var(--success); }
.toast.error { border-left-color: var(--danger); } .toast.error svg { color: var(--danger); }
.toast.warning { border-left-color: var(--warning); } .toast.warning svg { color: var(--warning); }
.toast.info svg { color: var(--info); }
.toast button { margin-left: auto; background: none; border: 0; color: var(--ink-3); cursor: pointer; font-size: 1.1rem; line-height: 1; padding: 0 0 0 .5rem; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.empty-state { text-align: center; padding: 3rem 1.5rem; color: var(--ink-2); }
.empty-state svg { width: 44px; height: 44px; color: var(--gold); margin-bottom: .75rem; }
.empty-state h4 { font-family: var(--serif); font-size: 1.35rem; margin-bottom: .35rem; }
.empty-state p { color: var(--ink-3); max-width: 420px; margin: 0 auto 1rem; }
.loading { display: flex; align-items: center; justify-content: center; gap: .75rem; padding: 2.5rem; color: var(--ink-3); font-size: .9rem; }
.spinner { width: 22px; height: 22px; border: 2.5px solid var(--line-strong); border-top-color: var(--gold); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: var(--r-sm); }
@keyframes shimmer { to { background-position: -200% 0; } }

.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--onyx); color: var(--gold-bright); display: grid; place-items: center; font-weight: 800; font-size: .85rem; flex: 0 0 auto; }

/* ── File drop zone ───────────────────────────────────────────────────── */
.dropzone { display: block; border: 2px dashed var(--line-strong); border-radius: var(--r-md); padding: 1.6rem; text-align: center; background: var(--surface-2); color: var(--ink-2); cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.over { border-color: var(--gold); background: var(--gold-tint); }
.dropzone svg { display: block; width: 30px; height: 30px; color: var(--gold); margin: 0 auto .4rem; }
.dropzone strong { color: var(--ink); }

/* ── Modal / dialog ───────────────────────────────────────────────────── */
.modal-backdrop { position: fixed; inset: 0; background: rgba(28, 24, 20, .55); display: flex; align-items: center; justify-content: center; padding: 1rem; z-index: 2000; animation: fade .15s ease-out; }
.modal { background: var(--surface); border-radius: var(--r-lg); width: 100%; max-width: 560px; max-height: calc(100vh - 2rem); display: flex; flex-direction: column; box-shadow: var(--shadow-lg); }
.modal-lg { max-width: 820px; } .modal-sm { max-width: 420px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.4rem; border-bottom: 1px solid var(--line); }
.modal-header h3 { margin: 0; font-size: 1.45rem; }
.modal-close { background: none; border: 0; width: 36px; height: 36px; border-radius: 50%; color: var(--ink-2); cursor: pointer; display: grid; place-items: center; }
.modal-close:hover { background: var(--surface-2); color: var(--ink); }
.modal-body { padding: 1.3rem 1.4rem; overflow-y: auto; }
.modal-footer { display: flex; justify-content: flex-end; gap: .6rem; padding: 1rem 1.4rem; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg); flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ── Tabs, chips, pagination ──────────────────────────────────────────── */
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin-bottom: 1.25rem; overflow-x: auto; }
.tab { padding: .7rem 1rem; border: 0; background: none; font: inherit; font-weight: 600; font-size: .9rem; color: var(--ink-2); border-bottom: 2.5px solid transparent; cursor: pointer; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink); border-bottom-color: var(--gold); }
.tab .count { display: inline-block; margin-left: .35rem; padding: 0 .45rem; border-radius: var(--r-full); background: var(--surface-2); font-size: .75rem; color: var(--ink-2); }
.chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.chip { display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .8rem; border-radius: var(--r-full); border: 1.5px solid var(--line-strong); background: var(--surface); color: var(--ink-2); font-size: .84rem; font-weight: 600; cursor: pointer; }
.chip:hover { border-color: var(--ink-3); color: var(--ink); }
.chip.active { background: var(--onyx); border-color: var(--onyx); color: var(--on-dark); }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.4rem; flex-wrap: wrap; font-size: .88rem; color: var(--ink-2); }
.pagination .pages { display: flex; gap: .3rem; flex-wrap: wrap; }
.page-btn { min-width: 36px; height: 36px; padding: 0 .6rem; border: 1.5px solid var(--line-strong); background: var(--surface); color: var(--ink); border-radius: var(--r-sm); font-weight: 600; cursor: pointer; }
.page-btn:hover:not([disabled]) { border-color: var(--ink); }
.page-btn.active { background: var(--onyx); border-color: var(--onyx); color: var(--on-dark); }
.page-btn[disabled] { opacity: .45; cursor: not-allowed; }

/* ── Price display ────────────────────────────────────────────────────── */
.price { display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: .1rem .55rem; }
.price-final { font-weight: 700; color: var(--ink); font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.price-original { color: var(--ink-3); text-decoration: line-through; font-size: .9rem; }
.price-off { color: var(--success); font-weight: 700; font-size: .82rem; }
.price-lg .price-final { font-size: 1.9rem; font-family: var(--sans); }
.price-lg .price-original { font-size: 1.1rem; }
.price-lg .price-off { font-size: .95rem; background: var(--success-bg); border: 1px solid var(--success-line); padding: .15rem .55rem; border-radius: var(--r-full); }

/* ── Order timeline ───────────────────────────────────────────────────── */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline li { position: relative; padding: 0 0 1.35rem 2.2rem; }
.timeline li::before { content: ""; position: absolute; left: 11px; top: 24px; bottom: -2px; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline .dot { position: absolute; left: 0; top: 0; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--surface); display: grid; place-items: center; }
.timeline .dot svg { width: 13px; height: 13px; }
.timeline li.done .dot { background: var(--success); border-color: var(--success); color: #fff; }
.timeline li.done::before { background: var(--success-line); }
.timeline li.current .dot { background: var(--gold-fill); border-color: var(--gold); color: var(--ink); box-shadow: 0 0 0 4px var(--gold-tint); }
.timeline li.stop .dot { background: var(--danger); border-color: var(--danger); color: #fff; }
.timeline .t-title { font-weight: 700; color: var(--ink); font-size: .93rem; }
.timeline li.todo .t-title { color: var(--ink-3); font-weight: 600; }
.timeline .t-meta { font-size: .8rem; color: var(--ink-3); }
.timeline .t-note { font-size: .85rem; color: var(--ink-2); margin-top: .15rem; }
.stepper { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0; margin: .5rem 0 1rem; }
.step { position: relative; text-align: center; font-size: .74rem; font-weight: 600; color: var(--ink-3); padding-top: 30px; }
.step::before { content: ""; position: absolute; top: 11px; left: -50%; right: 50%; height: 3px; background: var(--line); }
.step:first-child::before { display: none; }
.step .s-dot { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 24px; height: 24px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line-strong); z-index: 1; display: grid; place-items: center; }
.step .s-dot svg { width: 13px; height: 13px; }
.step.done { color: var(--ink); } .step.done::before { background: var(--success); }
.step.done .s-dot { background: var(--success); border-color: var(--success); color: #fff; }
.step.current { color: var(--ink); } .step.current::before { background: var(--success); }
.step.current .s-dot { background: var(--gold-fill); border-color: var(--gold); color: var(--ink); box-shadow: 0 0 0 4px var(--gold-tint); }

/* ── KPI cards (shared by admin + account dashboards) ─────────────────── */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 1.05rem 1.15rem; display: flex; flex-direction: column; gap: .35rem; box-shadow: var(--shadow-sm); position: relative; min-height: 118px; text-decoration: none !important; color: inherit; transition: border-color .15s, box-shadow .15s; }
a.kpi:hover { border-color: var(--gold); box-shadow: var(--shadow-md); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.kpi-label { font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2); }
.kpi-icon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--gold-tint); color: var(--gold-text); }
.kpi-icon svg { width: 18px; height: 18px; }
.kpi-value { font-size: 1.7rem; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.15; letter-spacing: -.01em; }
.kpi-meta { font-size: .8rem; color: var(--ink-3); }
.kpi-change { font-weight: 700; }
.kpi-change.up { color: var(--success); } .kpi-change.down { color: var(--danger); }
.kpi.tone-success .kpi-icon { background: var(--success-bg); color: var(--success); }
.kpi.tone-warning .kpi-icon { background: var(--warning-bg); color: var(--warning); }
.kpi.tone-danger .kpi-icon { background: var(--danger-bg); color: var(--danger); }
.kpi.tone-info .kpi-icon { background: var(--info-bg); color: var(--info); }
.kpi.tone-purple .kpi-icon { background: var(--purple-bg); color: var(--purple); }
.kpi.tone-neutral .kpi-icon { background: var(--neutral-bg); color: var(--neutral); }

/* ── Site header (storefront + account) ───────────────────────────────── */
.announcement { background: var(--onyx); color: var(--on-dark-2); font-size: .8rem; text-align: center; padding: .45rem 1rem; letter-spacing: .03em; }
.announcement strong { color: var(--gold-bright); font-weight: 600; }
.site-header { position: sticky; top: 0; z-index: 900; background: rgba(255, 253, 249, .97); backdrop-filter: saturate(160%) blur(8px); border-bottom: 1px solid var(--line); }
.site-header::after { content: ""; display: block; height: 2px; background: linear-gradient(90deg, transparent, var(--gold) 20%, var(--gold) 80%, transparent); opacity: .55; }
.header-inner { height: var(--header-h); display: flex; align-items: center; gap: 1.5rem; }
.main-nav { display: flex; align-items: center; gap: .25rem; margin-left: auto; }
.main-nav a { color: var(--ink); font-weight: 600; font-size: .9rem; padding: .55rem .8rem; border-radius: var(--r-sm); text-decoration: none; }
.main-nav a:hover { background: var(--surface-2); }
.main-nav a.active { color: var(--gold-text); box-shadow: inset 0 -2px 0 var(--gold); border-radius: 0; }
.header-actions { display: flex; align-items: center; gap: .35rem; }
.icon-btn { position: relative; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; color: var(--ink); background: none; border: 0; cursor: pointer; text-decoration: none !important; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 21px; height: 21px; }
.count-badge { position: absolute; top: 3px; right: 1px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--gold-fill); color: var(--ink); font-size: .68rem; font-weight: 800; display: grid; place-items: center; border: 2px solid #FFFDF9; }
.partner-link { font-size: .82rem; font-weight: 700; color: var(--ink) !important; border: 1.5px solid var(--line-strong); padding: .45rem .8rem; border-radius: var(--r-full); text-decoration: none !important; white-space: nowrap; }
.partner-link:hover { border-color: var(--gold); background: var(--gold-tint); }
.menu-toggle { display: none; }
.dropdown { position: relative; }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-lg); padding: .4rem; z-index: 950; }
.dropdown-menu a, .dropdown-menu button { display: flex; align-items: center; gap: .6rem; width: 100%; padding: .6rem .75rem; border-radius: var(--r-sm); color: var(--ink); font: inherit; font-size: .9rem; font-weight: 500; background: none; border: 0; cursor: pointer; text-decoration: none; text-align: left; }
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--surface-2); }
.dropdown-menu svg { width: 18px; height: 18px; color: var(--ink-2); }
.dropdown-head { padding: .6rem .75rem .7rem; border-bottom: 1px solid var(--line); margin-bottom: .3rem; }
.dropdown-head strong { display: block; color: var(--ink); }
.dropdown-head span { font-size: .8rem; color: var(--ink-3); }
.header-search { position: relative; width: 240px; }
.header-search input { min-height: 40px; border-radius: var(--r-full); padding-left: 2.4rem; background: var(--surface); }
.header-search svg { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--ink-3); }

/* ── Site footer ──────────────────────────────────────────────────────── */
.site-footer { background: var(--onyx); color: var(--on-dark-2); margin-top: 4rem; }
.site-footer::before { content: ""; display: block; height: 3px; background: linear-gradient(90deg, var(--gold) 0%, var(--gold-bright) 50%, var(--gold) 100%); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 2.5rem; padding: 3.5rem 0 2.5rem; }
.footer-grid h5 { color: var(--on-dark); font-size: .78rem; letter-spacing: .18em; text-transform: uppercase; margin-bottom: 1rem; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.footer-grid a { color: var(--on-dark-2); font-size: .9rem; }
.footer-grid a:hover { color: var(--gold-bright); }
.footer-about { font-size: .9rem; color: var(--on-dark-2); margin-top: 1rem; max-width: 330px; }
.footer-contact { display: grid; gap: .45rem; font-size: .9rem; }
.footer-contact span { display: flex; align-items: center; gap: .5rem; }
.footer-contact svg { width: 16px; height: 16px; color: var(--gold-bright); }
.footer-bottom { border-top: 1px solid var(--onyx-3); padding: 1.1rem 0; font-size: .82rem; color: var(--on-dark-3); display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* ── Page head (title + breadcrumb) ───────────────────────────────────── */
.page-head { padding: 2.25rem 0 1.5rem; }
.page-head h1 { margin: .35rem 0 .25rem; }
.page-head p { color: var(--ink-2); margin: 0; }
.breadcrumb { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; font-size: .82rem; color: var(--ink-3); }
.breadcrumb a { color: var(--ink-2); }
.breadcrumb a:hover { color: var(--gold-text); }
.breadcrumb .sep { color: var(--line-strong); }

/* ── Account area layout ──────────────────────────────────────────────── */
.account-shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 2rem; padding-top: 2rem; align-items: start; }
.account-nav { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: .6rem; position: sticky; top: calc(var(--header-h) + 16px); }
.account-user { padding: .9rem .8rem 1rem; border-bottom: 1px solid var(--line); margin-bottom: .4rem; }
.account-user strong { display: block; font-size: .98rem; color: var(--ink); }
.account-user span { font-size: .8rem; color: var(--ink-3); }
.account-nav a { display: flex; align-items: center; gap: .7rem; padding: .62rem .8rem; border-radius: var(--r-sm); color: var(--ink-2); font-weight: 600; font-size: .9rem; text-decoration: none; }
.account-nav a svg { width: 18px; height: 18px; color: var(--ink-3); }
.account-nav a:hover { background: var(--surface-2); color: var(--ink); }
.account-nav a.active { background: var(--onyx); color: var(--on-dark); }
.account-nav a.active svg { color: var(--gold-bright); }
.account-nav .nav-sep { height: 1px; background: var(--line); margin: .4rem .5rem; }
.account-nav .nav-label { font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; padding: .6rem .8rem .2rem; }
.account-content { min-width: 0; }
.account-content > .page-title { margin: 0 0 1.25rem; }

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .header-search { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .menu-toggle { display: grid; }
  .main-nav { position: fixed; inset: calc(var(--header-h) + 2px) 0 auto 0; flex-direction: column; align-items: stretch; background: var(--surface); border-bottom: 1px solid var(--line); padding: .75rem 16px 1rem; gap: 0; box-shadow: var(--shadow-md); display: none; margin: 0; }
  .main-nav.open { display: flex; }
  .main-nav a { padding: .8rem .5rem; border-bottom: 1px solid var(--line); border-radius: 0; }
  .main-nav a.active { box-shadow: none; }
  .header-inner { gap: .75rem; }
  .header-actions { margin-left: auto; }
  .partner-link { display: none; }
  .account-shell { grid-template-columns: minmax(0, 1fr); gap: 1.25rem; padding-top: 1.25rem; }
  .account-nav { position: static; display: flex; overflow-x: auto; gap: .25rem; padding: .4rem; }
  .account-nav .account-user, .account-nav .nav-sep, .account-nav .nav-label { display: none; }
  .account-nav a { white-space: nowrap; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  :root { --header-h: 64px; }
  body { font-size: 15px; }
  .container { padding: 0 16px; }
  .brand-name { font-size: 1.25rem; }
  .brand-tag { display: none; }
  .brand-mark { width: 24px; height: 20px; }
  .header-inner { gap: .35rem; }
  .header-actions { gap: 0; }
  .header-actions .icon-btn, .menu-toggle { width: 38px; height: 38px; }
  .header-actions a[aria-label="Wishlist"] { display: none; }
  .header-actions .avatar { width: 30px !important; height: 30px !important; }
  .grid-2, .grid-3, .grid-4, .form-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.75rem; padding-top: 2.5rem; }
  .card-body, .card-pad { padding: 1.1rem; }
  .card-header { padding: .9rem 1.1rem; }
  .modal-body { padding: 1.1rem; }
  .stepper { grid-template-columns: repeat(7, minmax(44px, 1fr)); overflow-x: auto; }
  .step { font-size: .66rem; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
  .kpi { padding: .85rem; min-height: 0; }
  .kpi-value { font-size: 1.2rem; word-break: break-word; }
  .kpi-icon { width: 28px; height: 28px; }
  .kpi-label { font-size: .7rem; }
  .dl { grid-template-columns: 1fr; gap: .1rem; } .dl dd { margin-bottom: .5rem; }
}
@media (max-width: 400px) {
  .brand-name { font-size: 1.1rem; }
  .brand { gap: .4rem; }
  .brand-mark { width: 20px; height: 16px; }
}
@media print {
  .site-header, .site-footer, .announcement, .no-print, .toast-stack, .admin-sidebar, .admin-topbar, .account-nav { display: none !important; }
  body { background: #fff; }
}
