/* ══════════════════════════════════════════════
   GlamBags — Admin Panel
   Theme tokens: light (default) + dark mode
   ══════════════════════════════════════════════ */

:root {
  --bg:            #F5F5F4;
  --surface:       #FFFFFF;
  --surface-2:     #FAFAF9;
  --surface-hover: #F5F5F4;
  --border:        #E7E5E4;
  --border-2:      #D6D3D1;
  --text:          #18181B;
  --text-muted:    #52525B;
  --text-dim:      #A1A1AA;
  /* Legacy --admin-* aliases used inline in a few blades. Map them to the
     theme vars so their hardcoded fallbacks don't show dark text in dark mode. */
  --admin-ink:     var(--text);
  --admin-muted:   var(--text-muted);
  --admin-ok:      #3c9a5f;

  --sidebar-bg:           #0B0B0D;
  --sidebar-bg-2:         #1F1F23;
  --sidebar-bg-hover:     #17171A;
  --sidebar-text:         #D4D4D8;
  --sidebar-text-active:  #FFFFFF;
  --sidebar-section:      #8B8B92;
  --sidebar-muted:        #71717A;
  --sidebar-border:       #1F1F23;

  --accent:        #B8912A;
  --accent-hover:  #D4AC4E;
  --accent-text:   #18181B;

  --success:       #15803D;
  --success-bg:    #F0FDF4;
  --warning:       #B45309;
  --warning-bg:    #FFFBEB;
  --danger:        #B91C1C;
  --danger-bg:     #FEF2F2;
  --info:          #1D4ED8;
  --info-bg:       #EFF6FF;
  --new-bg:        #FEF7DA;
  --new-text:      #713F12;

  --input-bg:      #FFFFFF;
  --input-border:  #D6D3D1;
  --input-focus:   #B8912A;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 2px 8px rgba(0,0,0,.05), 0 8px 24px rgba(0,0,0,.04);

  --font-ui:   'Inter', 'Raleway', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-num:  'Inter', ui-monospace, 'SF Mono', Consolas, monospace;
}

[data-theme="dark"] {
  --bg:            #09090B;
  --surface:       #17171A;
  --surface-2:     #1F1F23;
  --surface-hover: #232327;
  --border:        #27272A;
  --border-2:      #3F3F46;
  --text:          #FAFAFA;
  --text-muted:    #A1A1AA;
  --text-dim:      #71717A;

  --sidebar-bg:           #000000;
  --sidebar-bg-2:         #17171A;
  --sidebar-bg-hover:     #0F0F11;
  --sidebar-text:         #D4D4D8;
  --sidebar-text-active:  #FFFFFF;
  --sidebar-section:      #8B8B92;
  --sidebar-muted:        #71717A;
  --sidebar-border:       #1A1A1D;

  --accent:        #D4AC4E;
  --accent-hover:  #EDD89A;
  --accent-text:   #09090B;

  --success:       #4ADE80;
  --success-bg:    rgba(34, 197, 94, .1);
  --warning:       #FBBF24;
  --warning-bg:    rgba(251, 191, 36, .1);
  --danger:        #F87171;
  --danger-bg:     rgba(248, 113, 113, .1);
  --info:          #60A5FA;
  --info-bg:       rgba(96, 165, 250, .1);
  --new-bg:        rgba(212, 172, 78, .15);
  --new-text:      #EDD89A;

  --input-bg:      #0F0F11;
  --input-border:  #27272A;
  --input-focus:   #D4AC4E;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
  --shadow-md: 0 2px 8px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.25);
}

/* ── Global admin reset ── */
body.admin-body,
body.auth-body {
  margin: 0;
  font-family: var(--font-ui);
  font-weight: 400;
  color: var(--text);
  background: var(--bg);
  cursor: auto;
  overflow-x: visible;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body.admin-body a { cursor: pointer; }
body.admin-body button { cursor: pointer; font-family: inherit; }

/* ══════════════════════════════════════════════
   AUTH (login)
   ══════════════════════════════════════════════ */

.auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: var(--bg);
}
.auth-wrap { width: 100%; max-width: 420px; }
.auth-card {
  background: var(--surface);
  padding: 48px 40px;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
}
/* Light/dark toggle — matches the master login pill (fixed top-right, icon + label). */
.auth-theme-toggle {
  position: fixed; top: 20px; right: 20px; z-index: 10;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 99px;
  color: var(--text-muted, #6b5e48);
  font: inherit; font-size: 11px; font-weight: 600;
  letter-spacing: 1.5px; text-transform: uppercase;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: color .2s, border-color .2s, background .2s;
}
.auth-theme-toggle:hover { color: var(--accent, #B8912A); border-color: var(--accent, #B8912A); }
.auth-theme-toggle svg { width: 14px; height: 14px; }
@media (max-width: 480px) { .auth-theme-toggle { top: 12px; right: 12px; padding: 6px 12px; font-size: 10px; } }
.auth-brand {
  font-family: 'Cormorant Garamond', serif;
  font-size: 24px;
  font-weight: 300;
  letter-spacing: 4px;
  color: var(--text);
  text-decoration: none;
  display: block;
  text-align: center;
  margin-bottom: 28px;
}
.auth-eyebrow {
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--text-muted);
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 6px;
}
.auth-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 38px;
  font-weight: 300;
  text-align: center;
  margin: 0 0 32px;
  color: var(--text);
}
.auth-title em { font-style: italic; color: var(--accent); }

.auth-alert {
  padding: 10px 14px;
  margin-bottom: 18px;
  font-size: 13px;
  border-radius: 6px;
  border: 1px solid transparent;
}
.auth-alert-error   { background: var(--danger-bg); border-color: var(--danger); color: var(--danger); }
.auth-alert-success { background: var(--success-bg); border-color: var(--success); color: var(--success); }

.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-field label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
}
.auth-field input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  border-radius: 6px;
  box-sizing: border-box;
  transition: border-color .15s, box-shadow .15s;
}
.auth-field input:focus {
  outline: none;
  border-color: var(--input-focus);
  box-shadow: 0 0 0 3px rgba(184, 145, 42, .15);
}
.auth-error { display: block; font-size: 12px; color: var(--danger); margin-top: 4px; }

.auth-submit {
  margin-top: 6px;
  padding: 12px;
  background: var(--text);
  color: var(--bg);
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .5px;
  cursor: pointer;
  transition: opacity .15s;
}
.auth-submit:hover { opacity: .85; }
.auth-back {
  display: block;
  text-align: center;
  margin-top: 22px;
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
}
.auth-back:hover { color: var(--accent); }

.auth-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 20px;
  line-height: 1.55;
}
.auth-field-link {
  float: right;
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
  text-decoration: none;
}
.auth-field-link:hover { color: var(--accent); }
.auth-field-opt {
  font-weight: 400;
  font-size: 11px;
  color: var(--text-muted);
  margin-left: 6px;
}

.auth-alt {
  text-align: center;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
}
.auth-alt a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  margin-left: 4px;
}
.auth-alt a:hover { text-decoration: underline; }
.auth-field-opt {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
  text-transform: none;
  margin-left: 4px;
}

/* ══════════════════════════════════════════════
   ADMIN SHELL
   ══════════════════════════════════════════════ */

.admin-body {
  min-height: 100vh;
  display: flex;
}

/* ── Sidebar ── */
.admin-sidebar {
  width: 240px;
  min-height: 100vh;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  padding: 24px 16px 20px;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  border-right: 1px solid var(--sidebar-border);
}
.admin-logo {
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px;
  font-weight: 300;
  letter-spacing: 4px;
  color: var(--sidebar-text-active);
  text-decoration: none;
  padding: 0 14px;
}
.admin-logo-sub {
  font-size: 10px;
  letter-spacing: 2px;
  font-weight: 500;
  color: var(--sidebar-muted);
  text-transform: uppercase;
  padding: 4px 14px 0;
  margin-bottom: 28px;
}

.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  scrollbar-width: thin;
}
.admin-nav::-webkit-scrollbar { width: 6px; }
.admin-nav::-webkit-scrollbar-thumb { background: var(--sidebar-bg-hover); border-radius: 3px; }
.admin-nav::-webkit-scrollbar-track { background: transparent; }

.admin-sidebar-foot { flex-shrink: 0; }
.admin-nav-link {
  position: relative;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 400;
  border-radius: 6px;
  transition: background .15s, color .15s;
}
.admin-nav-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.78;
  transition: opacity .15s;
}
.admin-nav-link > span:not(.admin-nav-badge) {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-nav-link .admin-nav-badge { margin-left: auto; }
.admin-nav-link:hover .admin-nav-icon,
.admin-nav-link.active .admin-nav-icon { opacity: 1; }
.admin-nav-link:hover {
  color: var(--sidebar-text-active);
  background: var(--sidebar-bg-hover);
}
.admin-nav-link.active {
  color: var(--sidebar-text-active);
  background: var(--sidebar-bg-2);
  font-weight: 500;
}
.admin-nav-link.active::before {
  content: '';
  position: absolute;
  left: -16px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 22px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}
.admin-nav-section {
  font-size: 10px;
  letter-spacing: 2px;
  font-weight: 600;
  color: var(--sidebar-section);
  text-transform: uppercase;
  padding: 18px 14px 6px;
}
.admin-nav-badge {
  background: var(--accent);
  color: var(--accent-text);
  padding: 1px 7px;
  font-size: 10px;
  font-weight: 600;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.admin-sidebar-foot {
  padding-top: 16px;
  border-top: 1px solid var(--sidebar-border);
}
.admin-user {
  padding: 0 14px 12px;
}
.admin-user-name { font-size: 13px; font-weight: 500; color: var(--sidebar-text-active); }
.admin-user-email { font-size: 11px; color: var(--sidebar-muted); margin-top: 2px; }
.admin-logout {
  width: 100%;
  padding: 9px 14px;
  background: transparent;
  color: var(--sidebar-text);
  border: 1px solid var(--sidebar-border);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
}
.admin-logout:hover {
  background: var(--sidebar-bg-hover);
  color: var(--sidebar-text-active);
  border-color: var(--sidebar-muted);
}

/* ── Main ── */
.admin-main {
  flex: 1;
  min-width: 0; /* flex child: allow shrink so wide tables scroll inside their wrap */
  box-sizing: border-box; /* width:100% (mobile) includes padding — no page overflow */
  margin-left: 240px;
  padding: 28px 36px 48px;
  min-height: 100vh;
}
.admin-topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
}
.admin-topbar-label {
  font-size: 11px;
  letter-spacing: 1.5px;
  font-weight: 500;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.admin-topbar-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 32px;
  font-weight: 300;
  margin: 0;
  color: var(--text);
  letter-spacing: -.5px;
}
.admin-topbar-actions { display: flex; gap: 8px; align-items: center; }

/* Theme toggle */
.admin-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 8px;
  cursor: pointer;
  transition: all .15s;
}
.admin-theme-toggle:hover { background: var(--surface-hover); border-color: var(--border-2); }
.admin-theme-toggle svg { width: 16px; height: 16px; }
.admin-theme-toggle .icon-moon { display: block; }
.admin-theme-toggle .icon-sun  { display: none; }
[data-theme="dark"] .admin-theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .admin-theme-toggle .icon-sun  { display: block; }

/* Manual payment box on order detail */
.admin-manual-pay-box {
  padding: 14px 16px; border: 1px solid var(--border-2);
  background: var(--bg); border-radius: 8px;
  margin-top: 12px;
}
.admin-manual-pay-title {
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.06em; color: var(--text); margin-bottom: 6px;
}
.admin-manual-pay-state {
  font-size: 12px; color: var(--text-muted); margin-bottom: 10px;
}
.admin-manual-pay-state-pending { color: #d97706; font-weight: 500; }
.admin-manual-pay-state-ok { color: #16a34a; font-weight: 500; }
.admin-manual-pay-state-bad { color: #dc2626; font-weight: 500; }
.admin-manual-pay-table {
  width: 100%; font-size: 12px; margin: 8px 0; border-collapse: collapse;
}
.admin-manual-pay-table th {
  text-align: left; padding: 4px 12px 4px 0;
  color: var(--text-muted); font-weight: 500;
  letter-spacing: 0.04em; white-space: nowrap; vertical-align: top;
}
.admin-manual-pay-table td { padding: 4px 0; color: var(--text); }
.admin-manual-pay-screenshot { margin: 10px 0; }
.admin-manual-pay-screenshot img {
  max-width: 240px; max-height: 240px; border: 1px solid var(--border);
}
.admin-manual-pay-actions {
  display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap;
}

/* Brand picker (admin product form) */
.admin-brand-pick {
  display: flex; gap: 8px; align-items: center;
}
.admin-brand-pick select { flex: 1; }
.admin-brand-inline {
  display: flex; gap: 6px; align-items: center; flex-wrap: wrap;
  margin-top: 8px; padding: 10px; background: var(--bg);
  border: 0.5px solid var(--border); border-radius: 6px;
}
.admin-brand-inline input { flex: 1; min-width: 180px; }
.admin-brand-inline-err {
  color: #dc2626; font-size: 11px; flex-basis: 100%;
}

/* Collapsible advanced section */
.admin-details {
  border: 0.5px solid var(--border); border-radius: 6px;
  padding: 0; margin-top: 8px;
}
.admin-details-summary {
  cursor: pointer; padding: 12px 16px;
  font-size: 13px; font-weight: 500; color: var(--text);
  list-style: none; user-select: none;
}
.admin-details-summary::-webkit-details-marker { display: none; }
.admin-details-summary::before {
  content: '▸'; display: inline-block; margin-right: 8px;
  transition: transform 0.15s ease; color: var(--text-muted);
}
.admin-details[open] > .admin-details-summary::before { transform: rotate(90deg); }
.admin-details > *:not(summary) { padding: 0 16px 16px; }

.admin-field-help {
  font-size: 11px; color: var(--text-muted); margin-top: 4px;
}

/* Size preset buttons (admin product form) */
.admin-size-presets {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  margin-top: 8px;
}
.admin-size-presets-label {
  font-size: 11px; letter-spacing: 0.04em; color: var(--text-muted);
  margin-right: 4px;
}

.admin-list-meta-soft { color: var(--text-dim); font-size: 11px; margin-top: 2px; }

/* Back button — sits in own row above the topbar */
.admin-back-bar { margin-bottom: 14px; }
.admin-back-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 12px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px; cursor: pointer;
  font-family: inherit;
  font-size: 11px; font-weight: 500; letter-spacing: 0.08em;
  transition: all .15s;
}
.admin-back-btn:hover {
  background: var(--surface-hover);
  border-color: var(--border-2);
  transform: translateX(-2px);
}
.admin-back-btn svg { flex-shrink: 0; }

/* Topbar logout */
.admin-topbar-logout { margin: 0; }
.admin-topbar-logout-btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 14px;
  border: 1px solid var(--border);
  background: var(--surface); color: var(--text);
  border-radius: 8px; cursor: pointer;
  font-size: 12px; font-weight: 500; letter-spacing: 0.04em;
  transition: all .15s;
}
.admin-topbar-logout-btn:hover {
  background: var(--surface-hover); border-color: var(--border-2);
  color: var(--text);
}
.admin-topbar-logout-btn svg { flex-shrink: 0; }
@media (max-width: 640px) {
  .admin-topbar-logout-btn span { display: none; }
  .admin-topbar-logout-btn { padding: 0 10px; }
}

/* Flash messages */
.admin-flash {
  padding: 10px 14px;
  margin-bottom: 20px;
  font-size: 13px;
  border-radius: 6px;
  border: 1px solid transparent;
}
.admin-flash-success { background: var(--success-bg); border-color: var(--success); color: var(--success); }
.admin-flash-error   { background: var(--danger-bg); border-color: var(--danger); color: var(--danger); }

/* ── Buttons ── */
.admin-btn {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  color: var(--text);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all .15s;
}
.admin-btn:hover { background: var(--surface-hover); border-color: var(--text-dim); }
.admin-btn-primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.admin-btn-primary:hover { opacity: .85; background: var(--text); color: var(--bg); }
.admin-btn-ghost { background: transparent; }
.admin-btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.admin-btn-danger:hover { opacity: .9; background: var(--danger); color: #fff; }

/* ── Dashboard clock ── */
.admin-clock {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2, var(--surface)) 100%);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.admin-clock-greeting { display: flex; flex-direction: column; gap: 4px; }
.admin-clock-hello {
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text);
}
.admin-clock-zone {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}
.admin-clock-meta { text-align: right; }
.admin-clock-date {
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}
.admin-clock-time {
  font-size: 26px;
  font-weight: 300;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  margin-top: 2px;
}
@media (max-width: 720px) {
  .admin-clock { padding: 14px 18px; }
  .admin-clock-meta { text-align: left; width: 100%; }
  .admin-clock-time { font-size: 22px; }
}

/* ── Stats ── */
.admin-revenue-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.admin-ops-row {
  grid-template-columns: repeat(6, 1fr);
}
/* F14: dashboard sections grouped into collapsible accordions (native <details>).
   Top revenue strip stays outside — always visible. */
.admin-acc {
  margin-bottom: 20px;
  border-top: 1px solid var(--border);
}
/* Keep normal spacing between stacked rows inside a section; only trim the
   last row so the section doesn't add double space before the next one. */
.admin-acc > .admin-revenue-row { margin-top: 4px; }
.admin-acc > .admin-revenue-row:last-child { margin-bottom: 0; }
.admin-acc-sum {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 2px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 19px;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.admin-acc-sum::-webkit-details-marker { display: none; }
.admin-acc-chev {
  font-size: 22px;
  line-height: 1;
  color: var(--text-muted);
  transition: transform .18s ease;
}
.admin-acc[open] > .admin-acc-sum .admin-acc-chev { transform: rotate(90deg); }
.admin-acc-sum:hover .admin-acc-chev { color: var(--accent, #b8912a); }
.admin-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
}
/* Category governance warning box — master-flagged categories the admin should review. */
.admin-flag-alert {
  background: #fbeceb;
  border: 1px solid #e3b4ad;
  border-left: 4px solid #c0472f;
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 16px;
}
.admin-flag-alert-head { font-weight: 700; color: #a3392a; font-size: 14px; margin-bottom: 8px; }
.admin-flag-alert-list { margin: 0; padding-left: 18px; font-size: 13px; color: #5a3a34; }
.admin-flag-alert-list li { margin: 4px 0; }
.admin-flag-alert-note { display: block; font-size: 12px; color: #8a6b64; margin-top: 2px; }
html[data-theme="dark"] .admin-flag-alert { background: #2a1815; border-color: #6b3229; }
html[data-theme="dark"] .admin-flag-alert-head { color: #e8a99f; }
html[data-theme="dark"] .admin-flag-alert-list { color: #d8b8b1; }
html[data-theme="dark"] .admin-flag-alert-note { color: #b08d85; }

/* U1: cards rendered as links are clickable — give them a clear hover cue
   (lift + gold edge) so they're visibly distinct from static stat cards. */
a.admin-stat, a.admin-approve-card, a.admin-list-link {
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
a.admin-stat:hover, a.admin-approve-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.10);
  border-color: var(--accent, #B8912A);
}
.admin-stat-revenue {
  position: relative;
  overflow: hidden;
}
.admin-stat-revenue::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px;
  height: 36px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}
.admin-stat-total {
  /* Fixed dark gradient (NOT var(--text)) — in dark mode --text is near-white,
     which turned this tile white-on-white. This is a dark highlight tile in
     both themes, so its bg must stay dark regardless of --text. */
  background: linear-gradient(135deg, #26262B 0%, #3F3F46 100%);
  color: #FAFAFA;
  border-color: transparent;
}
.admin-stat-total .admin-stat-label,
.admin-stat-total .admin-stat-sub { color: rgba(250,250,250,.7); }
.admin-stat-total::before { background: var(--accent); }

.admin-stat-label {
  font-size: 11px;
  letter-spacing: 1px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.admin-stat-num {
  font-family: var(--font-num);
  font-size: 28px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.1;
  letter-spacing: -.5px;
}
.admin-stat-total .admin-stat-num { color: #FAFAFA; }
.admin-stat-sub { font-size: 12px; color: var(--text-muted); margin-top: 6px; }

.admin-stat-mini {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.admin-stat-mini-label {
  font-size: 10px;
  letter-spacing: 1px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
}
.admin-stat-mini-num {
  font-family: var(--font-num);
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
}
.admin-stat-mini-alert { border-color: var(--accent); background: var(--new-bg); }

/* ── Panels ── */
.admin-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}
.admin-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
}
.admin-panel-wide { padding: 28px 32px; margin-bottom: 24px; }
.admin-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.admin-panel-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px;
  font-weight: 400;
  margin: 0;
  color: var(--text);
}
.admin-panel-link {
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
}
.admin-panel-link:hover { color: var(--accent); }

/* ── Lists ── */
.admin-list { list-style: none; padding: 0; margin: 0; }
.admin-list-item { border-bottom: 1px solid var(--border); }
.admin-list-item:last-child { border-bottom: none; }
.admin-list-link {
  display: block;
  padding: 11px 0;
  text-decoration: none;
  color: var(--text);
}
.admin-list-link:hover { color: var(--accent); }
.admin-list-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 2px;
}
.admin-list-name { font-size: 14px; font-weight: 500; display: inline-flex; align-items: center; gap: 8px; }
.admin-list-price {
  font-family: var(--font-num);
  font-size: 13px;
  color: var(--accent);
  font-weight: 500;
}
.admin-list-meta { font-size: 12px; color: var(--text-muted); }
/* Mobile: Recent Orders row packs order# + payment + shipping tags + price.
   Let it wrap so the two status tags + price don't overflow the card. */
@media (max-width: 600px) {
  .admin-list-top { flex-wrap: wrap; align-items: flex-start; }
  .admin-list-name { flex-wrap: wrap; }
}
.admin-list-action { display: inline-flex; margin-top: 8px; }

/* Shared page-content editor (also used under /master) renders here with the
   admin chrome; master.css isn't loaded on admin pages, so alias the master
   CSS vars + control classes the shared view relies on. */
.admin-body {
  --m-card: var(--surface);
  --m-ink: var(--text);
  --m-muted: var(--text-muted);
  --m-gold: var(--accent, #B8912A);
  --m-line-dim: var(--border);
  --m-danger: var(--danger, #d3553e);
}
.admin-body .master-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.admin-body .master-card-head { margin-bottom: 14px; }
.admin-body .master-card-title { font-size: 15px; font-weight: 600; color: var(--text); }
.admin-body .master-input, .admin-body .master-select, .admin-body .master-textarea { width: 100%; padding: 8px 11px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); color: var(--text); font: inherit; }
.admin-body .master-textarea { resize: vertical; }
.admin-body .master-btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 8px; background: var(--espresso, #1E1610); color: #fff; border: 0; font-weight: 600; font-size: 13px; cursor: pointer; text-decoration: none; }
.admin-body .master-btn.is-ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.admin-body .master-btn.is-sm { padding: 7px 13px; font-size: 12.5px; }
/* Dark mode: the solid master-btn (Create coupon / Save changes) is espresso-on-dark = invisible.
   Flip it to the same light-on-dark treatment as .admin-btn-primary. Ghost buttons already theme. */
html[data-theme="dark"] .admin-body .master-btn:not(.is-ghost) { background: var(--text); color: var(--bg); }
html[data-theme="dark"] .admin-body .master-btn:not(.is-ghost):hover { opacity: .85; }
.admin-body .master-label, .admin-body .cl-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }

/* Owner → client billing / dues banner */
.admin-billing-banner { display: flex; align-items: flex-start; gap: 12px; padding: 14px 18px; border-radius: 10px; margin-bottom: 20px; border: 1px solid; }
.admin-billing-banner svg { flex: 0 0 auto; margin-top: 1px; }
.admin-billing-body { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.admin-billing-body strong { font-size: 13.5px; }
.admin-billing-reminder { background: #fbf6e8; border-color: #e8d89a; color: #7a5f16; }
.admin-billing-warning { background: #fdf0e8; border-color: #f0c9a8; color: #9a5a1e; }
.admin-billing-overdue { background: #fbeae6; border-color: #eab3a6; color: #a2321c; }

/* Notification bell + dropdown (admin topbar) */
.admin-notif { position: relative; }
.admin-notif-bell { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border: 1px solid var(--border); background: var(--surface); border-radius: 8px; color: var(--text); cursor: pointer; }
.admin-notif-bell:hover { background: var(--surface-2); }
.admin-notif-badge { position: absolute; top: -5px; right: -5px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: #d3553e; color: #fff; font-size: 10px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
.admin-notif-menu { position: absolute; top: calc(100% + 8px); right: 0; width: 400px; max-width: 94vw; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 18px 44px rgba(0,0,0,0.18); z-index: 300; overflow: hidden; }
.admin-notif-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); }
.admin-notif-head-actions { display: flex; gap: 14px; flex-shrink: 0; }
.admin-notif-readall { border: 0; background: none; color: var(--accent, #B8912A); font-size: 11.5px; font-weight: 600; cursor: pointer; text-transform: none; letter-spacing: 0; white-space: nowrap; }
.admin-notif-list { max-height: 380px; overflow-y: auto; }
.admin-notif-item { display: flex; align-items: flex-start; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); color: var(--text); }
.admin-notif-item:last-child { border-bottom: 0; }
.admin-notif-item:hover { background: var(--surface-2); }
.admin-notif-item.is-unread { background: rgba(184,145,42,0.06); }
.admin-notif-item-main { flex: 1; min-width: 0; text-decoration: none; color: inherit; }
.admin-notif-item.is-unread .admin-notif-item-title::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent, #B8912A); margin-right: 7px; vertical-align: middle; }
.admin-notif-item-title { font-size: 13px; font-weight: 600; }
.admin-notif-item-body { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.admin-notif-item-time { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.admin-notif-item-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.admin-notif-act { display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border); background: var(--surface); color: var(--text-muted); font-size: 10.5px; font-weight: 600; padding: 3px 8px; border-radius: 5px; cursor: pointer; line-height: 1.4; }
.admin-notif-act:hover { border-color: var(--text-muted); color: var(--text); }
.admin-notif-act-del { padding: 4px 7px; }
.admin-notif-act-del:hover { border-color: var(--danger, #d3553e); color: var(--danger, #d3553e); }
.admin-notif-act-del svg { display: block; }
.admin-notif-empty { padding: 28px 14px; text-align: center; color: var(--text-muted); font-size: 12.5px; }

/* Mobile: the notification dropdown anchored right:0 to the bell can sit
   off-screen / cramped. Make it a fixed, near-full-width, scrollable panel. */
@media (max-width: 600px) {
  .admin-notif-menu {
    position: fixed;
    top: 62px;
    left: 12px;
    right: 12px;
    width: auto;
    max-width: none;
    max-height: 76vh;
    overflow-y: auto;
  }
  .admin-notif-list { max-height: none; }
}

/* Read-only changelog (admin) */
.admin-changelog-list { list-style: none; margin: 0; padding: 0; }
.admin-changelog-item { display: flex; gap: 14px; align-items: flex-start; padding: 14px 0; border-bottom: 1px solid var(--border); }
.admin-changelog-item:last-child { border-bottom: 0; }
.admin-changelog-badge { flex: 0 0 auto; font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; border: 1px solid; white-space: nowrap; }
.admin-changelog-good { color: #2F6E3A; border-color: #b7dcb6; background: #f1f7ed; }
.admin-changelog-gold { color: #8a6d18; border-color: #e8d89a; background: #fbf6e8; }
.admin-changelog-warn { color: #a23b28; border-color: #eec3b8; background: #fbeee9; }
.admin-changelog-title { font-size: 14px; font-weight: 600; color: var(--text); }
.admin-changelog-desc { font-size: 12.5px; line-height: 1.5; color: var(--text-muted); margin-top: 3px; }
.admin-changelog-date { font-size: 11.5px; color: var(--text-muted); margin-top: 4px; }

/* Read-only nice-to-have board (admin) */
.admin-nth-card { margin-bottom: 16px; }
.admin-nth-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 8px; }
.admin-nth-badge { font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; border: 1px solid; }
.admin-nth-good { color: #2F6E3A; border-color: #b7dcb6; background: #f1f7ed; }
.admin-nth-gold { color: #8a6d18; border-color: #e8d89a; background: #fbf6e8; }
.admin-nth-warn { color: #a23b28; border-color: #eec3b8; background: #fbeee9; }
.admin-nth-impact { font-size: 12.5px; color: var(--text-muted); }
.admin-nth-title { font-size: 15px; font-weight: 600; color: var(--text); }
.admin-nth-info { font-size: 13px; line-height: 1.55; color: var(--text-muted); margin-top: 6px; }

/* Product quick-view modal (admin order detail) */
.admin-peek-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 24px; }
.admin-peek-modal[hidden] { display: none; }
.admin-peek-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.45); }
.admin-peek-card { position: relative; width: 420px; max-width: 100%; background: var(--surface, #fff); border-radius: 12px; padding: 20px; box-shadow: 0 18px 50px rgba(0, 0, 0, 0.3); animation: adminPeekIn .18s ease; }
@keyframes adminPeekIn { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.admin-peek-x { position: absolute; top: 8px; right: 12px; border: 0; background: none; color: var(--text-muted); font-size: 22px; line-height: 1; cursor: pointer; }
.admin-peek-body { display: flex; gap: 16px; }
.admin-peek-img { width: 120px; height: 120px; object-fit: cover; border-radius: 8px; flex: 0 0 auto; }
.admin-peek-img[hidden] { display: none; }
.admin-peek-info { min-width: 0; }
.admin-peek-name { font-weight: 600; font-size: 15px; }
.admin-peek-price { color: var(--text-muted); font-size: 13px; margin-top: 2px; }
.admin-peek-meta { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.admin-peek-meta:empty { display: none; }
.admin-peek-desc { font-size: 12.5px; margin-top: 10px; line-height: 1.5; }
.admin-peek-desc:empty { display: none; }
@media (max-width: 560px) { .admin-peek-body { flex-direction: column; } .admin-peek-img { width: 100%; height: 160px; } }

/* ── Tables ── */
.admin-table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow-x: auto;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.admin-table th {
  text-align: left;
  padding: 12px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
}
.admin-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  color: var(--text);
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--surface-2); }
.admin-table-right { text-align: right; }
.admin-table-right a, .admin-table-right button { margin-left: 10px; }
.admin-row-unread td { background: var(--new-bg); }

.admin-cell-title { font-weight: 500; color: var(--text); display: inline-flex; align-items: center; gap: 8px; }
.admin-cell-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.admin-cell-strike { text-decoration: line-through; color: var(--text-dim); margin-left: 6px; font-size: 11px; }
.admin-cell-preview { color: var(--text-muted); max-width: 280px; }

.admin-code {
  font-family: var(--font-num);
  font-size: 11px;
  color: var(--text-muted);
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: 4px;
}

/* ── Tags / Badges ── */
.admin-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .5px;
  text-transform: uppercase;
  margin-right: 4px;
  border-radius: 4px;
}
.admin-tag-new      { background: var(--new-bg); color: var(--new-text); }
.admin-tag-featured { background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border); }
.admin-tag-ok       { background: var(--success-bg); color: var(--success); }
.admin-tag-off      { background: var(--danger-bg); color: var(--danger); }
.admin-tag-warning  { background: var(--warning-bg); color: var(--warning); }
.admin-tag-info     { background: var(--info-bg); color: var(--info); }
.admin-tag-processing { background: var(--info-bg); color: var(--info); }

/* ── Inline links in tables ── */
.admin-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 12px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
}
.admin-link:hover { color: var(--accent); }
.admin-link-danger { color: var(--danger); }
.admin-link-danger:hover { color: var(--danger); opacity: .75; }
.admin-inline-form { display: inline; }

/* ── Empty states ── */
.admin-empty {
  font-size: 13px;
  color: var(--text-muted);
  padding: 14px 0;
}
.admin-empty a { color: var(--accent); }
.admin-empty-lg {
  background: var(--surface);
  border: 1px dashed var(--border-2);
  padding: 56px 20px;
  text-align: center;
  font-size: 14px;
  border-radius: 10px;
}

/* ── Filter bar / tabs ── */
.admin-filter-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.admin-input, .admin-select {
  padding: 8px 12px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  border-radius: 6px;
}
.admin-input { min-width: 260px; }
.admin-input:focus, .admin-select:focus {
  outline: none;
  border-color: var(--input-focus);
  box-shadow: 0 0 0 3px rgba(184, 145, 42, .15);
}
.admin-tab {
  padding: 6px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  color: var(--text-muted);
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all .15s;
}
.admin-tab:hover { border-color: var(--border-2); color: var(--text); }
.admin-tab.active {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}
.admin-tab-count {
  font-size: 11px;
  padding: 1px 6px;
  background: rgba(0,0,0,.08);
  border-radius: 10px;
}
.admin-tab.active .admin-tab-count { background: rgba(255,255,255,.15); }

/* ── Pagination ── */
.admin-pagination {
  margin-top: 18px;
  display: flex;
  justify-content: center;
}
.admin-pagination-list {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.admin-pagination-list li > a,
.admin-pagination-list li > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 12px;
  font-size: 12px;
  text-decoration: none;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: background 160ms, color 160ms, border-color 160ms;
}
.admin-pagination-list li > a:hover {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--text-muted);
}
.admin-pagination-num.active > span {
  background: var(--accent);
  color: var(--accent-text);
  border-color: var(--accent);
}
.admin-pagination-list li.disabled > span {
  color: var(--text-muted);
  opacity: 0.55;
  cursor: not-allowed;
}
.admin-pagination-prev > a,
.admin-pagination-next > a,
.admin-pagination-prev > span,
.admin-pagination-next > span {
  font-size: 11px;
}

/* Per-page selector */
.admin-per-page-form {
  display: inline-flex;
  align-items: center;
  margin: 0;
}
.admin-per-page-form .per-page-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}
.admin-per-page-select {
  padding: 6px 28px 6px 10px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%239A8B7A' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.admin-per-page-select:focus {
  outline: none;
  border-color: var(--accent);
}
.admin-list-toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 16px;
  margin: 12px 0 8px;
}
.admin-pagination-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 18px;
  flex-wrap: wrap;
}
.admin-pagination-bar .admin-pagination { margin: 0; }

/* Email previews — card grid with iframe per template */
.admin-page-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 24px;
  line-height: 1.55;
}
.admin-mail-grid {
  display: grid;
  /* min(320px, 100%) keeps the column from exceeding a narrow viewport
     (e.g. 360px phones) — the 320px floor alone forced horizontal overflow. */
  grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
  gap: 18px;
}
.admin-mail-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  font: inherit;
  text-align: left;
  padding: 0;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.admin-mail-card:hover {
  transform: translateY(-2px);
  border-color: var(--text-muted);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}
.admin-mail-card:focus-visible {
  outline: 2px solid var(--accent, #B8912A);
  outline-offset: 2px;
}
.admin-mail-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.admin-mail-audience {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.admin-mail-audience-customer { color: #2F6E3A; border-color: #B7DCB6; background: #F1F7ED; }
.admin-mail-audience-admin { color: #7A4E18; border-color: #E8D89A; background: #FBF6E8; }
.admin-mail-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
  flex: 1;
}
.admin-mail-frame-wrap {
  position: relative;
  background: #F2EDE4;
  height: 360px;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}
.admin-mail-frame {
  width: 200%;
  height: 720px;
  border: 0;
  transform: scale(0.5);
  transform-origin: top left;
  pointer-events: none;
}
.admin-mail-frame-hint {
  position: absolute;
  inset: auto 0 0 0;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(0deg, rgba(0,0,0,0.55), rgba(0,0,0,0));
  padding: 18px 8px 10px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s ease;
}
.admin-mail-card:hover .admin-mail-frame-hint,
.admin-mail-card:focus-visible .admin-mail-frame-hint { opacity: 1; }

/* Email preview modal */
body.admin-modal-open { overflow: hidden; }
.admin-mail-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: stretch;
  justify-content: center;
}
.admin-mail-modal.is-open { display: flex; }
.admin-mail-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 13, 10, 0.62);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.admin-mail-modal-panel {
  position: relative;
  margin: auto;
  width: min(880px, 96vw);
  height: min(88vh, 920px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,0.35);
}
.admin-mail-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.admin-mail-modal-title-wrap { display: flex; align-items: center; gap: 10px; min-width: 0; }
.admin-mail-modal-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-mail-modal-actions { display: flex; gap: 8px; align-items: center; }
.admin-mail-scheme { display: inline-flex; border: 1px solid var(--border, rgba(0,0,0,0.12)); border-radius: 7px; overflow: hidden; }
.admin-mail-scheme-btn { border: 0; background: transparent; padding: 6px 12px; font-size: 12px; font-weight: 600; color: var(--text-muted); cursor: pointer; }
.admin-mail-scheme-btn.is-active { background: var(--espresso, #1E1610); color: #fff; }
.admin-mail-modal-body { flex: 1; background: #F2EDE4; }
.admin-mail-modal.is-dark .admin-mail-modal-body { background: #1b1712; }
.admin-mail-modal-frame { width: 100%; height: 100%; border: 0; display: block; }
@media (max-width: 720px) {
  .admin-mail-modal-panel { width: 100vw; height: 100vh; border-radius: 0; }
  /* Header wraps so the scheme toggle + actions never overflow the narrow bar. */
  .admin-mail-modal-head { flex-wrap: wrap; row-gap: 8px; padding: 12px 14px; }
  .admin-mail-modal-title-wrap { flex: 1 1 100%; }
  .admin-mail-modal-actions { flex: 1 1 100%; flex-wrap: wrap; }
  .admin-mail-modal-actions .admin-btn { flex: 1; text-align: center; justify-content: center; }
}
@media (max-width: 600px) {
  /* Single-column cards with shorter preview windows so more fit per screen. */
  .admin-mail-grid { grid-template-columns: 1fr; gap: 14px; }
  .admin-mail-frame-wrap { height: 240px; }
}

/* =========================================================
   Settings page — minimalist, modern, card-based
   ========================================================= */
.settings-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 8px 0 80px;
}
.settings-page-head {
  margin-bottom: 28px;
}
.settings-page-title {
  font-size: 20px; font-weight: 600;
  color: var(--text);
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}
.settings-page-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.55;
}

.settings-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 18px;
  overflow: hidden;
  transition: border-color 200ms;
}
.settings-card:hover {
  border-color: color-mix(in srgb, var(--text-muted) 30%, var(--border));
}
.settings-card-head {
  padding: 20px 24px 14px;
  border-bottom: 1px solid var(--border);
}
.settings-card-title {
  font-size: 14px; font-weight: 600;
  color: var(--text);
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}
.settings-card-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
}
/* Inline text links inside settings copy — themed gold, not default blue.
   Excludes button-style links (.admin-btn, .settings-cancel). */
.settings-card-desc a, .settings-card-note a, .settings-card p a {
  color: var(--accent, #B8912A);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 600;
}
.settings-card-desc a:hover, .settings-card-note a:hover, .settings-card p a:hover { opacity: .82; }
.settings-field-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin: 6px 0 0;
}
.pay-mode-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pay-mode-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.pay-mode-option:hover {
  border-color: var(--acc-border);
}
.pay-mode-option input {
  flex: none;
  margin: 2px 0 0;
  accent-color: var(--accent);
}
.pay-mode-option:has(input:checked) {
  border-color: var(--accent);
  background: var(--surface-hover);
}
.pay-mode-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pay-mode-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.pay-mode-desc {
  font-size: 12px;
  color: var(--text-muted);
}
.settings-card-note {
  font-size: 12px;
  color: var(--danger, #b91c1c);
  margin: 8px 0 0;
}
.settings-card-body {
  padding: 4px 24px;
}

.settings-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 32px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}
.settings-row:last-child {
  border-bottom: none;
}
.settings-row-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 10px;
  font-size: 13px; font-weight: 500;
  color: var(--text);
  cursor: default;
}
.settings-row-help {
  font-size: 11px; font-weight: 400;
  color: var(--text-muted);
  line-height: 1.5;
}
.settings-row-control {
  min-width: 0;
}

.settings-input {
  width: 100%;
  padding: 10px 14px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
  transition: border-color 160ms, box-shadow 160ms;
}
.settings-input::placeholder {
  color: var(--text-muted);
  opacity: 0.6;
}
.settings-input:hover {
  border-color: color-mix(in srgb, var(--text-muted) 40%, var(--border));
}
.settings-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
.settings-error {
  display: block;
  font-size: 12px;
  color: #DC5050;
  margin-top: 6px;
}

/* Favicon control */
.settings-favicon {
  display: flex;
  align-items: center;
  gap: 16px;
}
.settings-favicon-preview {
  flex: 0 0 auto;
  width: 56px; height: 56px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.settings-favicon-preview img {
  width: 100%; height: 100%;
  object-fit: contain;
  padding: 8px;
}
.settings-favicon-placeholder {
  font-family: 'Cormorant Garamond', serif;
  font-size: 26px;
  color: var(--text-muted);
}
.settings-favicon-controls {
  display: flex; flex-direction: column; gap: 8px;
  align-items: flex-start;
}
.settings-file-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  font-size: 12px; font-weight: 500;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: background 160ms, border-color 160ms;
}
.settings-file-button:hover {
  background: var(--surface-2);
  border-color: var(--text-muted);
}
.settings-file-button-secondary {
  background: transparent;
}
.settings-favicon-source {
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.settings-favicon-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.settings-favicon-modal-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: center;
}
.settings-favicon-modal-tile {
  width: 160px; height: 160px;
  border-radius: 16px;
  background: #F2EDE4;
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  padding: 12px;
}
.settings-favicon-modal-tile img { max-width: 100%; max-height: 100%; }
.settings-favicon-modal-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  text-align: center;
}
.settings-favicon-modal-cell {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-size: 11px; color: var(--text-muted);
}
.settings-favicon-modal-tab { width: 16px; height: 16px; }
.settings-favicon-modal-tab-32 { width: 32px; height: 32px; }
.settings-favicon-modal-tab-180 { width: 64px; height: 64px; }
.settings-file-name {
  font-size: 11px;
  color: var(--text-muted);
}
.settings-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  margin-top: 2px;
}
.settings-checkbox input { accent-color: var(--accent); }

.settings-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  padding-top: 8px;
  margin-top: 4px;
}
.settings-cancel {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  padding: 10px 14px;
}
.settings-cancel:hover { color: var(--text); }
.settings-save {
  padding: 11px 22px;
  font-size: 13px; font-weight: 600;
  color: var(--accent-text);
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 8px;
  cursor: pointer;
  letter-spacing: 0.01em;
  transition: background 160ms, transform 100ms;
}
.settings-save:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.settings-save:active { transform: translateY(1px); }

@media (max-width: 720px) {
  .settings-row {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 18px 0;
  }
  .settings-row-label { padding-top: 0; }
  .settings-card-head { padding: 18px 18px 12px; }
  .settings-card-body { padding: 0 18px; }
  .settings-favicon { flex-wrap: wrap; }
}

/* Reusable confirm modal — used by delete/destructive forms */
.gb-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}
.gb-modal-backdrop.is-open { opacity: 1; pointer-events: auto; }
.gb-modal-card {
  position: relative;
  background: var(--surface);
  color: var(--text);
  width: 100%;
  max-width: 440px;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 24px 80px -20px rgba(0,0,0,0.6);
  transform: translateY(12px);
  transition: transform 220ms ease;
}
.gb-modal-backdrop.is-open .gb-modal-card { transform: translateY(0); }
.gb-modal-close {
  position: absolute; top: 10px; right: 10px;
  width: 32px; height: 32px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  border-radius: 50%;
  cursor: pointer; font-size: 17px; line-height: 1;
  z-index: 2;
  /* Stay visible when it overlaps a product image at the card top. */
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}
.gb-modal-close:hover { color: var(--text); border-color: var(--text-muted); }
/* Bigger, easier tap target on phones. */
@media (max-width: 600px) {
  .gb-modal-close { width: 40px; height: 40px; top: 8px; right: 8px; font-size: 20px; }
}

.gb-confirm-card { padding: 28px 28px 22px; }
.gb-confirm-icon {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(220, 80, 80, 0.12);
  color: #DC5050;
  margin-bottom: 16px;
  font-weight: 700; font-size: 18px;
}
.gb-confirm-title {
  font-size: 17px; font-weight: 600;
  margin: 0 0 6px;
  color: var(--text);
}
.gb-confirm-message {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0 0 22px;
  line-height: 1.5;
}
.gb-confirm-actions {
  display: flex; gap: 10px; justify-content: flex-end;
}
.gb-confirm-btn {
  padding: 9px 18px;
  font-size: 13px; font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}
.gb-confirm-btn:hover { background: var(--surface-2); }
.gb-confirm-btn-danger {
  background: #DC5050;
  border-color: #DC5050;
  color: #FFF;
}
.gb-confirm-btn-danger:hover { background: #B83838; border-color: #B83838; }
body.gb-modal-open { overflow: hidden; }

/* ── Forms ── */
.admin-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 28px 32px;
  box-shadow: var(--shadow-sm);
}
.admin-form-narrow { max-width: 520px; }
.admin-form-inline { padding-top: 10px; }
.admin-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}
.admin-form-col { display: flex; flex-direction: column; gap: 18px; }
.admin-field label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
}
.admin-field input[type="text"],
.admin-field input[type="email"],
.admin-field input[type="number"],
.admin-field input[type="password"],
.admin-field input[type="url"],
.admin-field input[type="tel"],
.admin-field input[type="date"],
.admin-field input[type="time"],
.admin-field input[type="datetime-local"],
.admin-field select,
.admin-field textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  border-radius: 6px;
  box-sizing: border-box;
  transition: border-color .15s, box-shadow .15s;
}
.admin-field textarea { resize: vertical; min-height: 80px; font-family: inherit; }
.admin-field input:focus, .admin-field select:focus, .admin-field textarea:focus {
  outline: none;
  border-color: var(--input-focus);
  box-shadow: 0 0 0 3px rgba(184, 145, 42, .15);
}
.admin-field-help {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 5px;
}
.admin-field-opt { color: var(--text-dim); font-weight: 400; text-transform: none; letter-spacing: 0; font-size: 11px; font-style: italic; }
.admin-field-req { color: var(--danger); font-weight: 600; margin-left: 2px; }

/* Native calendar / time picker buttons — custom SVG icon, guaranteed visible in both themes */
.admin-field input[type="date"],
.admin-field input[type="datetime-local"],
.admin-field input[type="time"] {
  font-family: inherit;
  color-scheme: light;
  min-height: 38px;
  cursor: pointer;
  position: relative;
  padding-right: 40px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2352525B' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='5' width='18' height='16' rx='2'/><path d='M3 10h18M8 3v4M16 3v4'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px 16px;
  transition: background-image .15s;
}
.admin-field input[type="date"]:hover,
.admin-field input[type="datetime-local"]:hover,
.admin-field input[type="time"]:hover {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23B8912A' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='5' width='18' height='16' rx='2'/><path d='M3 10h18M8 3v4M16 3v4'/></svg>");
}
.admin-field input[type="date"]::-webkit-calendar-picker-indicator,
.admin-field input[type="datetime-local"]::-webkit-calendar-picker-indicator,
.admin-field input[type="time"]::-webkit-calendar-picker-indicator {
  position: absolute;
  right: 0;
  top: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
  background: transparent;
}
html[data-theme="dark"] .admin-field input[type="date"],
html[data-theme="dark"] .admin-field input[type="datetime-local"],
html[data-theme="dark"] .admin-field input[type="time"] {
  color-scheme: dark;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FAFAFA' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='5' width='18' height='16' rx='2'/><path d='M3 10h18M8 3v4M16 3v4'/></svg>");
}
html[data-theme="dark"] .admin-field input[type="date"]:hover,
html[data-theme="dark"] .admin-field input[type="datetime-local"]:hover,
html[data-theme="dark"] .admin-field input[type="time"]:hover {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23D4AC4E' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='5' width='18' height='16' rx='2'/><path d='M3 10h18M8 3v4M16 3v4'/></svg>");
}
.admin-field-error {
  display: block;
  font-size: 12px;
  color: var(--danger);
  margin-top: 4px;
}
.admin-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.admin-detail-row {
  display: grid;
  grid-template-columns: 1fr 2fr auto;
  gap: 6px;
  margin-bottom: 6px;
}
.admin-detail-row input {
  padding: 7px 10px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  border-radius: 6px;
}
.admin-detail-remove { padding: 6px 10px; font-size: 14px; line-height: 1; }

.admin-checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.admin-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text);
}
.admin-checkbox input { width: 15px; height: 15px; accent-color: var(--accent); }

.admin-form-actions {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ── Image upload ── */
.admin-field input[type="file"] {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: 1px dashed var(--input-border);
  background: var(--surface-2);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  border-radius: 6px;
  cursor: pointer;
}
.admin-field input[type="file"]:hover { border-color: var(--accent); background: var(--surface-hover); }
.admin-field input[type="file"]::file-selector-button {
  margin-right: 12px;
  padding: 6px 12px;
  border: 1px solid var(--border-2);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  border-radius: 4px;
  cursor: pointer;
}
.admin-image-preview {
  margin-bottom: 12px;
  padding: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}
.admin-image-preview img {
  max-width: 240px;
  max-height: 240px;
  width: auto;
  height: auto;
  display: block;
  border-radius: 4px;
  background: #fff;
}
.admin-image-preview-new {
  border-color: var(--accent);
  margin-top: 10px;
  margin-bottom: 0;
}
.admin-image-remove { font-size: 12px; color: var(--text-muted); }

/* ── Customer form sections (create + edit) ── */
.admin-form-stacked { max-width: 720px; padding: 0; background: transparent; border: none; box-shadow: none; }

.admin-form-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px 28px 28px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}
.admin-form-section-head {
  margin: 0 0 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.admin-form-section-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px;
  font-weight: 500;
  color: var(--text);
  margin: 0 0 4px;
  letter-spacing: .3px;
}
.admin-form-section-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0;
}
.admin-form-section-desc strong { color: var(--text); font-weight: 600; }

/* Generate-password field on customer form */
.admin-password-field {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.admin-password-field input {
  flex: 1;
  font-family: var(--font-num);
  letter-spacing: 1px;
}
.admin-password-field .admin-btn { white-space: nowrap; }

#customerPasswordHelp.is-flash { color: var(--accent); font-weight: 500; }

/* ── Customer overview card (edit page header) ── */
.admin-customer-overview {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}
.admin-customer-avatar {
  width: 56px; height: 56px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--text);
  color: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Cormorant Garamond', serif;
  font-size: 26px;
  font-weight: 500;
}
.admin-customer-overview-main { flex: 1; min-width: 0; }
.admin-customer-overview-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 24px;
  font-weight: 500;
  color: var(--text);
  margin: 0 0 4px;
  letter-spacing: .3px;
}
.admin-customer-overview-stats {
  display: flex;
  gap: 28px;
  margin: 0;
  padding-left: 20px;
  border-left: 1px solid var(--border);
}
.admin-customer-overview-stats > div { margin: 0; }
.admin-customer-overview-stats dt {
  font-size: 10px;
  letter-spacing: 1.5px;
  font-weight: 500;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.admin-customer-overview-stats dd {
  font-family: var(--font-num);
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

@media (max-width: 700px) {
  .admin-customer-overview { flex-direction: column; align-items: flex-start; }
  .admin-customer-overview-stats { padding-left: 0; border-left: none; padding-top: 16px; border-top: 1px solid var(--border); width: 100%; flex-wrap: wrap; gap: 20px; }
  .admin-password-field { flex-wrap: wrap; }
  .admin-password-field input { min-width: 100%; }
  .admin-form-section { padding: 20px 20px 22px; }
}

.admin-product-thumb {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.admin-product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.admin-product-thumb-empty { color: var(--text-dim); font-size: 14px; }

.admin-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.admin-gallery-item {
  position: relative;
  aspect-ratio: 1;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface-2);
}
.admin-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.admin-gallery-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(0,0,0,.6);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.admin-gallery-remove:hover { background: var(--danger); }

/* Gallery remove — checkbox overlay (replaces the old nested delete form) */
.admin-gallery-item { cursor: pointer; display: block; }
.admin-gallery-remove-check {
  position: absolute;
  top: 4px;
  left: 4px;
  right: 4px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 7px;
  border-radius: 5px;
  background: rgba(0,0,0,.55);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
}
.admin-gallery-remove-check input { accent-color: var(--danger, #d3553e); cursor: pointer; margin: 0; }
.admin-gallery-item:has(.admin-gallery-remove-check input:checked) { outline: 2px solid var(--danger, #d3553e); outline-offset: -2px; }
.admin-gallery-item:has(.admin-gallery-remove-check input:checked) img { opacity: .5; }

/* ── Sidebar section labels + Permission groups ── */
.admin-perm-groups {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}
.admin-perm-group {
  border: 1px solid var(--border);
  padding: 12px 16px;
  background: var(--surface-2);
  border-radius: 8px;
}
.admin-perm-group-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.admin-perm-group-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}
.admin-perm-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
}
.admin-perm-toggle input { accent-color: var(--accent); }
.admin-perm-item { padding: 3px 0; font-size: 13px; }
.admin-perm-item code { margin-left: 6px; font-size: 11px; }

/* ── Message detail page ── */
.admin-message-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.admin-msg-label {
  font-size: 10px;
  letter-spacing: 1.5px;
  font-weight: 500;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.admin-msg-value { font-size: 14px; color: var(--text); }
.admin-msg-email { font-size: 12px; color: var(--accent); text-decoration: none; }
.admin-msg-email:hover { text-decoration: underline; }
.admin-msg-body {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
  padding: 16px 0;
  white-space: pre-wrap;
}
.admin-msg-actions {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ── Order detail ── */
.admin-order-top {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.admin-order-total {
  font-family: var(--font-num);
  font-size: 30px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.1;
  letter-spacing: -.5px;
}
.admin-order-status-current { margin: 6px 0 10px; }
.admin-status-form select {
  padding: 7px 10px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text);
  font-family: inherit;
  font-size: 12px;
  border-radius: 6px;
}
.admin-order-meta { font-size: 13px; line-height: 1.6; color: var(--text); }
.admin-order-meta strong { font-weight: 500; }
.admin-order-divider {
  height: 1px;
  background: var(--border);
  margin: 10px 0;
}

/* ══════════════════════════════════════════════
   CUSTOMER ACCOUNT PAGES (in storefront layout)
   Uses account-scoped tokens from app.css
   ══════════════════════════════════════════════ */

.account-hero-eyebrow {
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--acc-text-dim);
}
.account-hero-desc { font-size: 14px; color: var(--acc-text-muted); }

.account-empty { text-align: center; padding: 80px 20px; }
.account-empty-text { color: var(--acc-text-muted); font-size: 16px; margin-bottom: 24px; }

/* Orders list */
.account-orders-list { display: flex; flex-direction: column; gap: 16px; }
.account-order-card {
  display: block;
  padding: 24px 28px;
  background: var(--acc-surface);
  border: 1px solid var(--acc-border);
  text-decoration: none;
  color: var(--acc-text);
  transition: border-color .2s, background .3s;
}
.account-order-card:hover { border-color: var(--acc-accent); }
.account-order-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--acc-border);
  margin-bottom: 14px;
}
.account-order-number {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 400;
  color: var(--acc-text);
}
.account-order-date { font-size: 12px; color: var(--acc-text-dim); margin-top: 4px; }
.account-order-total {
  font-family: 'Cormorant Garamond', serif;
  font-size: 26px;
  color: var(--acc-accent);
  font-weight: 400;
}
.account-order-body {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.account-order-tracking { font-size: 12px; color: var(--acc-text-muted); }
.account-order-tracking span { color: var(--acc-text); }

.account-status {
  display: inline-block;
  padding: 4px 12px;
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  border-radius: 0;
}
.account-status-lg { padding: 8px 18px; font-size: 11px; }
.account-status-ok { background: #F1F7ED; color: #3F6B28; border: 1px solid #CEDFC0; }
.account-status-off { background: #FDF1F0; color: #7A2E28; border: 1px solid #E8CBC7; }
.account-status-warning { background: #FEF7DA; color: #7C5A12; border: 1px solid #E8DBA5; }
.account-status-info { background: #EFF6FF; color: #1D4ED8; border: 1px solid #BFDBFE; }

html[data-theme="dark"] .account-status-ok { background: rgba(74, 222, 128, .1); color: #6EE7A0; border-color: rgba(110, 231, 160, .3); }
html[data-theme="dark"] .account-status-off { background: rgba(248, 113, 113, .1); color: #F8AFA8; border-color: rgba(248, 175, 168, .3); }
html[data-theme="dark"] .account-status-warning { background: rgba(251, 191, 36, .1); color: #F5D891; border-color: rgba(245, 216, 145, .3); }
html[data-theme="dark"] .account-status-info { background: rgba(96, 165, 250, .1); color: #9BC1F9; border-color: rgba(155, 193, 249, .3); }

.account-pagination { display: flex; justify-content: center; margin-top: 40px; }

/* Order detail */
.account-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}
.account-detail-col { display: flex; flex-direction: column; gap: 28px; }

.account-shipping-block {
  background: var(--acc-surface-2);
  padding: 20px 24px;
  border: 1px solid var(--acc-border);
}
.account-shipping-note { font-size: 13px; color: var(--acc-text-muted); line-height: 1.6; margin: 12px 0 0; }
.account-shipping-note strong { color: var(--acc-text); }
.account-shipping-meta {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--acc-border);
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--acc-text);
}
.account-shipping-meta span {
  display: inline-block;
  min-width: 110px;
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--acc-text-dim);
}
.account-tracking-link {
  color: var(--acc-accent);
  text-decoration: none;
  border-bottom: 0.5px solid var(--acc-accent);
  font-size: 13px;
}
.account-tracking-link:hover { color: var(--acc-text); border-bottom-color: var(--acc-text); }
.account-address-block {
  font-size: 13px;
  line-height: 1.6;
  color: var(--acc-text);
  padding: 20px 24px;
  background: var(--acc-surface-2);
  border: 1px solid var(--acc-border);
}

.account-items-list { list-style: none; padding: 0; margin: 0 0 20px; }
.account-item-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--acc-border);
}
.account-item-name { font-size: 14px; color: var(--acc-text); }
.account-item-qty { font-size: 12px; color: var(--acc-text-dim); margin-top: 4px; }
.account-item-total { font-size: 14px; color: var(--acc-accent); }

.account-summary {
  background: var(--acc-surface-2);
  padding: 20px 24px;
  border: 1px solid var(--acc-border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.account-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--acc-text-muted);
}
.account-summary-total {
  padding-top: 10px;
  border-top: 1px solid var(--acc-border);
  font-size: 16px;
  color: var(--acc-text);
  font-weight: 500;
}

/* ══════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════ */
.admin-mobile-hamburger { display: none; }
.admin-sidebar-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(18, 14, 9, 0.5);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  z-index: 90;
  opacity: 0;
  transition: opacity .2s ease;
}
.admin-sidebar-backdrop.is-open { opacity: 1; }

@media (max-width: 900px) {
  .admin-sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: min(82vw, 320px);
    transform: translateX(-100%);
    transition: transform .25s ease;
    z-index: 100;
    overflow-y: auto;
    padding: 24px 20px;
    /* Override base min-height:100vh — on mobile 100vh exceeds the visible
       viewport (address bar), pushing the foot (Sign out) below the fold.
       Fit the fixed top-to-bottom box so the footer stays reachable. */
    min-height: 0;
  }
  .admin-sidebar.is-open { transform: translateX(0); }
  .admin-sidebar-backdrop { display: block; pointer-events: none; }
  .admin-sidebar-backdrop.is-open { pointer-events: auto; }
  .admin-body { flex-direction: row; }
  .admin-main { margin-left: 0; padding: 20px 16px 40px; width: 100%; }
  .admin-nav { flex-direction: column; gap: 2px; overflow-x: visible; margin: 12px 0; }
  .admin-nav-link { padding: 10px 14px; font-size: 13px; white-space: normal; }
  /* !important so mobile beats the inline grid-template-columns:repeat(N,1fr)
     set per-row in the blades (dashboard, promo, coupons, instagram) — inline
     styles otherwise override the class rule and force 3-4 cols on phones. */
  .admin-revenue-row { grid-template-columns: 1fr 1fr !important; }
  .admin-ops-row { grid-template-columns: 1fr 1fr 1fr; }
  .admin-grid-2 { grid-template-columns: 1fr; }
  .admin-form-grid { grid-template-columns: 1fr; gap: 20px; }
  .admin-message-meta { grid-template-columns: 1fr; }
  .admin-order-top { grid-template-columns: 1fr; }
  .admin-topbar { flex-direction: row; align-items: center; gap: 14px; }

  .admin-mobile-hamburger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px; height: 44px;
    margin-right: 6px;
    border: 1px solid var(--border, #e5e0d8);
    background: var(--surface, #fff);
    border-radius: 8px;
    cursor: pointer;
    color: var(--text, #1b1410);
    flex-shrink: 0;
  }
  .admin-mobile-hamburger:hover { background: var(--surface-2, #f1ebdf); }
  .admin-mobile-hamburger svg { width: 20px; height: 20px; }

  .account-hero { padding: 160px 20px 32px; }
  .account-hero-title { font-size: 52px; }
  .account-section { padding: 40px 20px 80px; }
  .account-detail-grid { grid-template-columns: 1fr; gap: 40px; }
}
@media (max-width: 600px) {
  .admin-revenue-row, .admin-ops-row { grid-template-columns: 1fr !important; }
  .admin-order-top { padding: 16px; }
  .admin-field-row { grid-template-columns: 1fr; }
  /* Accent-colour picker is a desktop personalisation nicety; drop it on
     phones so the utility row (hamburger, back, theme, sign-out) never overflows.
     Extra specificity so it beats the later base .admin-accent-picker rule. */
  .admin-topbar-actions .admin-accent-picker { display: none; }
  .admin-topbar-actions { gap: 8px; }
}

/* ── Shipping queue ── */
.admin-shipping-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.admin-ship-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: border-color .2s;
}
.admin-ship-card:hover { border-color: var(--border-2); }
.admin-ship-card.is-shipped { opacity: .82; }
.admin-ship-card.is-shipped:hover { opacity: 1; }

.admin-ship-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.admin-ship-identity {
  display: flex;
  align-items: center;
  gap: 10px;
}
.admin-ship-num {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  letter-spacing: .5px;
}
.admin-ship-num:hover { color: var(--accent); }
.admin-ship-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}
.admin-ship-meta strong { color: var(--text); font-family: var(--font-num); font-size: 14px; font-weight: 600; }
.admin-ship-dot { color: var(--text-dim); }

.admin-ship-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
.admin-ship-info {
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  border-right: 1px solid var(--border);
}
.admin-ship-section {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text);
}
.admin-ship-section .admin-msg-label { margin-bottom: 6px; }
.admin-ship-customer-name {
  font-weight: 500;
  color: var(--text);
  font-size: 14px;
}
.admin-ship-link {
  display: inline-block;
  margin-top: 6px;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
}
.admin-ship-link:hover { text-decoration: underline; }
.admin-ship-guest {
  display: inline-block;
  margin-top: 6px;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-dim);
}

.admin-ship-items {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.admin-ship-items li {
  display: flex;
  gap: 10px;
  align-items: baseline;
}
.admin-ship-qty {
  color: var(--accent);
  font-family: var(--font-num);
  font-weight: 600;
  font-size: 13px;
  min-width: 28px;
}

.admin-ship-form-panel {
  padding: 22px 24px;
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.admin-ship-card.is-shipped .admin-ship-form-panel { background: var(--success-bg); }
.admin-ship-form-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.admin-ship-form-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 18px;
  font-weight: 500;
  color: var(--text);
}
.admin-ship-submit {
  align-self: flex-end;
  margin-top: 4px;
}

@media (max-width: 900px) {
  .admin-ship-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 14px 18px;
  }
  .admin-ship-body { grid-template-columns: 1fr; }
  .admin-ship-info { border-right: none; border-bottom: 1px solid var(--border); padding: 18px; }
  .admin-ship-form-panel { padding: 18px; }
}

/* ============================================================
   Order tracking events (admin)
   ============================================================ */

.admin-tracking-form {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
}
.admin-tracking-form select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
}
.admin-tracking-form select:focus {
  outline: none;
  border-color: var(--text);
}

.admin-tracking-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.admin-tracking-item {
  display: flex;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.admin-tracking-item:last-child { border-bottom: none; }

.admin-tracking-dot {
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 6px;
  position: relative;
}
.admin-tracking-dot::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 12px;
  width: 1px;
  height: calc(100% + 14px);
  background: var(--border);
}
.admin-tracking-item:last-child .admin-tracking-dot::after { display: none; }

.admin-tracking-dot-ok { background: var(--success); }
.admin-tracking-dot-info { background: var(--info); }
.admin-tracking-dot-warning { background: var(--warning); }
.admin-tracking-dot-off { background: var(--danger); }

.admin-tracking-body { flex: 1; min-width: 0; }
.admin-tracking-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.admin-tracking-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.admin-tracking-time {
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
}
.admin-tracking-loc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}
.admin-tracking-note {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 6px;
  padding: 8px 10px;
  background: var(--surface-2);
  border-radius: 4px;
  border-left: 2px solid var(--border-2);
}
.admin-tracking-meta {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Shipping queue: tracking summary + split actions */
.admin-ship-form-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 4px;
  flex-wrap: wrap;
}
.admin-ship-form-actions .admin-ship-submit { flex: 0 0 auto; margin: 0; }

.admin-ship-tracking-summary {
  margin-top: 16px;
  padding: 12px 14px;
  background: var(--info-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
}
.admin-ship-tracking-summary .admin-msg-label { margin-bottom: 8px; }
.admin-ship-tracking-line {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13px;
  color: var(--text);
}
.admin-ship-tracking-line .admin-tracking-dot::after { display: none; }
.admin-ship-tracking-line .admin-cell-sub {
  display: block;
  margin-top: 2px;
  font-size: 11px;
}

/* =========================================================
   Shared admin loaders + skeletons
   ========================================================= */

#nav-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-hover), var(--accent), var(--accent-hover));
  z-index: 99999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 180ms ease, width 120ms linear;
  box-shadow: 0 0 8px rgba(212, 172, 78, 0.55);
}
#nav-progress.is-active { opacity: 1; }
#nav-progress.is-done   { transition: opacity 180ms ease 80ms, width 180ms ease; opacity: 0; }

.gb-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  vertical-align: -2px;
  animation: gb-spin 600ms linear infinite;
}
@keyframes gb-spin { to { transform: rotate(360deg); } }

button.is-loading,
.admin-btn.is-loading {
  position: relative;
  pointer-events: none;
  color: transparent !important;
}
button.is-loading::after,
.admin-btn.is-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border: 2px solid var(--accent-text, #18181B);
  border-right-color: transparent;
  border-radius: 50%;
  animation: gb-spin 600ms linear infinite;
}

.gb-skel {
  display: block;
  background: linear-gradient(90deg, var(--surface-2, rgba(0,0,0,0.06)) 0%, var(--border, rgba(0,0,0,0.12)) 50%, var(--surface-2, rgba(0,0,0,0.06)) 100%);
  background-size: 200% 100%;
  animation: gb-skel-shimmer 1200ms linear infinite;
  border-radius: 4px;
}
@keyframes gb-skel-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.gb-skel-row {
  height: 14px;
  margin: 6px 0;
}
.gb-skel-row.gb-skel-row-thumb {
  width: 40px;
  height: 40px;
  border-radius: 4px;
}

/* ── Stripe payments additions (clickable rows + refund placeholder) ── */
.admin-row-clickable { cursor: pointer; }

.admin-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  white-space: nowrap;
}

.admin-btn.admin-btn-sm {
  padding: 5px 11px;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 500;
}

/* Destructive admin button — used by Refund (real) + Delete actions.
   Theme-aware via admin tokens; reads correctly in both light + dark. */
.admin-btn.admin-btn-danger {
  background: transparent;
  color: #DC5050;
  border: 1px solid color-mix(in srgb, #DC5050 40%, var(--border));
}
.admin-btn.admin-btn-danger:hover {
  background: #DC5050;
  color: #FFF;
  border-color: #DC5050;
}
.admin-btn.admin-btn-danger:active { transform: translateY(1px); }

/* Disabled button — used when an action is gated by data the row hasn't earned yet. */
.admin-btn.admin-btn-disabled,
.admin-btn[disabled] {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
  cursor: not-allowed;
  opacity: 0.7;
}
.admin-btn.admin-btn-disabled:hover,
.admin-btn[disabled]:hover {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
  opacity: 0.7;
}

/* Password show/hide toggle + strength meter */
.pw-wrap { position: relative; display: block; }
.pw-wrap > input { width: 100%; padding-right: 44px; }
.pw-toggle {
  position: absolute; top: 50%; right: 10px; transform: translateY(-50%);
  background: none; border: 0; padding: 4px; cursor: pointer;
  color: var(--text-muted); display: inline-flex; align-items: center;
}
.pw-toggle:hover { color: var(--text); }
.pw-toggle:focus { outline: 1px dashed var(--border-2); outline-offset: 2px; }

.pw-meter { margin-top: 10px; }
.pw-meter-bar {
  height: 4px; background: var(--border);
  border-radius: 2px; overflow: hidden;
}
.pw-meter-bar span {
  display: block; height: 100%; width: 0;
  transition: width 0.18s ease, background 0.18s ease;
}
.pw-meter-bar span.is-empty  { background: transparent; }
.pw-meter-bar span.is-weak   { background: #dc2626; }
.pw-meter-bar span.is-fair   { background: #ea580c; }
.pw-meter-bar span.is-good   { background: #ca8a04; }
.pw-meter-bar span.is-strong { background: #16a34a; }

.pw-meter-rules {
  list-style: none; padding: 0; margin: 10px 0 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px;
  font-size: 11px; color: var(--text-muted); letter-spacing: 0.02em;
}
.pw-meter-rules li { display: flex; align-items: center; gap: 8px; }
.pw-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--border-2); flex-shrink: 0;
  transition: background 0.18s ease;
}
.pw-meter-rules li.is-ok { color: #16a34a; }
.pw-meter-rules li.is-ok .pw-dot { background: #16a34a; }

.pw-match {
  margin-top: 8px; font-size: 11px; letter-spacing: 0.02em; color: var(--text-muted);
  min-height: 14px; display: inline-flex; align-items: center; gap: 6px;
}
.pw-match.is-ok  { color: #16a34a; }
.pw-match.is-bad { color: #dc2626; }
.pw-match svg { flex-shrink: 0; }

/* ── Landing Collection admin: muted tag + inline price-range card + meta line ── */
.admin-tag-muted    { background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border); }

.admin-inline-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 18px 20px;
    margin: 0 0 20px;
}
.admin-inline-card-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.admin-inline-card-help {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}
.admin-inline-card-fields {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.admin-inline-card-fields input[type="number"] {
    width: 80px;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--surface-2);
    color: var(--text);
}
.admin-inline-card-fields label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    color: var(--text-muted);
}

.admin-meta-line {
    margin-top: 14px;
    font-size: 12px;
    color: var(--text-muted);
}
.admin-meta-line a { color: var(--accent); }

/* ── Context banner above admin index/forms ── */
.admin-context-banner {
    background: #FDF8E9;
    border-left: 3px solid #B89968;
    padding: 12px 18px;
    margin: 0 0 20px;
    font-size: 13px;
    color: #5C4A3C;
    line-height: 1.5;
}
.admin-context-banner strong { display: inline-block; margin-right: 6px; color: #1E1610; }
.admin-context-banner a { color: #B89968; }

/* ── Read-only settings value display ── */
.settings-readonly-value {
    display: inline-block;
    padding: 8px 14px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-weight: 500;
    color: var(--text);
    font-size: 14px;
}

/* ════════════════════════════════════════════════
   ACCENT PALETTES — switchable from topbar
   Applied via [data-accent="<name>"] on <html>.
   "gold" is the default (no override needed).
   ════════════════════════════════════════════════ */
[data-accent="slate"]    { --accent: #475569; --accent-hover: #64748B; --input-focus: #475569; }
[data-accent="emerald"]  { --accent: #059669; --accent-hover: #10B981; --input-focus: #059669; }
[data-accent="rose"]     { --accent: #E11D48; --accent-hover: #F43F5E; --input-focus: #E11D48; }
[data-accent="violet"]   { --accent: #7C3AED; --accent-hover: #A78BFA; --input-focus: #7C3AED; }
[data-accent="ocean"]    { --accent: #0284C7; --accent-hover: #38BDF8; --input-focus: #0284C7; }

[data-theme="dark"][data-accent="slate"]    { --accent: #94A3B8; --accent-hover: #CBD5E1; }
[data-theme="dark"][data-accent="emerald"]  { --accent: #34D399; --accent-hover: #6EE7B7; }
[data-theme="dark"][data-accent="rose"]     { --accent: #FB7185; --accent-hover: #FDA4AF; }
[data-theme="dark"][data-accent="violet"]   { --accent: #A78BFA; --accent-hover: #C4B5FD; }
[data-theme="dark"][data-accent="ocean"]    { --accent: #38BDF8; --accent-hover: #7DD3FC; }

/* ────────────────────────────────────────────────
   Topbar accent picker — polished pill of swatches
   ──────────────────────────────────────────────── */
.admin-accent-picker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    box-shadow: var(--shadow-sm);
    height: 36px;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.admin-accent-picker:hover {
    border-color: var(--border-2);
    box-shadow: var(--shadow-md);
}

.admin-accent-swatch {
    position: relative;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 0;
    padding: 0;
    cursor: pointer;
    background-clip: padding-box;
    box-shadow:
        0 0 0 2px var(--surface),
        0 0 0 2px var(--surface);
    transition: transform .15s ease, box-shadow .15s ease;
    outline: none;
}
.admin-accent-swatch::before {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
}
.admin-accent-swatch:hover {
    transform: scale(1.18);
    box-shadow:
        0 0 0 2px var(--surface),
        0 0 0 3px currentColor;
    color: rgba(0,0,0,0.12);
}
[data-theme="dark"] .admin-accent-swatch:hover { color: rgba(255,255,255,0.18); }

.admin-accent-swatch:focus-visible {
    outline: 2px solid var(--text);
    outline-offset: 3px;
}

.admin-accent-swatch[data-active="true"] {
    transform: scale(1.05);
}
.admin-accent-swatch[data-active="true"]::after {
    content: '';
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    border: 2px solid var(--text);
    pointer-events: none;
    animation: gbAccentPulse .35s ease-out;
}
@keyframes gbAccentPulse {
    0%   { transform: scale(.7); opacity: 0; }
    60%  { transform: scale(1.15); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

/* Tooltip label on hover (capitalised name) */
.admin-accent-swatch[title]:hover::before {
    content: attr(title);
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 8px;
    background: var(--text);
    color: var(--bg);
    font-family: var(--font-ui);
    font-size: 10px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-radius: 4px;
    white-space: nowrap;
    pointer-events: none;
    box-shadow: var(--shadow-sm);
    z-index: 200;
    inset: auto;
}

/* Swatch colours */
.admin-accent-swatch[data-accent-key="gold"]    { background: #B8912A; }
.admin-accent-swatch[data-accent-key="slate"]   { background: #475569; }
.admin-accent-swatch[data-accent-key="emerald"] { background: #059669; }
.admin-accent-swatch[data-accent-key="rose"]    { background: #E11D48; }
.admin-accent-swatch[data-accent-key="violet"]  { background: #7C3AED; }
.admin-accent-swatch[data-accent-key="ocean"]   { background: #0284C7; }

/* Tiny "Theme" label inside the pill on wider screens */
.admin-accent-picker::before {
    content: '';
    width: 14px; height: 14px;
    margin-right: 2px;
    background: currentColor;
    color: var(--text-muted);
    -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><circle cx='13.5' cy='6.5' r='.5'/><circle cx='17.5' cy='10.5' r='.5'/><circle cx='8.5' cy='7.5' r='.5'/><circle cx='6.5' cy='12.5' r='.5'/><path d='M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z'/></svg>") center / contain no-repeat;
            mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><circle cx='13.5' cy='6.5' r='.5'/><circle cx='17.5' cy='10.5' r='.5'/><circle cx='8.5' cy='7.5' r='.5'/><circle cx='6.5' cy='12.5' r='.5'/><path d='M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z'/></svg>") center / contain no-repeat;
    flex-shrink: 0;
    opacity: 0.55;
}

@media (max-width: 720px) {
    .admin-accent-picker {
        padding: 4px 7px;
        gap: 6px;
        height: 32px;
    }
    .admin-accent-picker::before { display: none; }
    .admin-accent-swatch { width: 16px; height: 16px; }
    .admin-accent-swatch[title]:hover::before { display: none; }
}
@media (max-width: 480px) {
    .admin-accent-picker { gap: 5px; padding: 3px 6px; }
    .admin-accent-swatch { width: 14px; height: 14px; }
}

/* ════════════════════════════════════════════════
   SPACING POLISH PASS (2026-06-07)
   Consistent breathing room across every admin page.
   Override block — sits last so it wins specificity ties.
   ════════════════════════════════════════════════ */

/* Outer canvas + topbar */
.admin-main {
    padding: 32px 40px 56px;
}
.admin-back-bar {
    margin-bottom: 18px;
}
.admin-topbar {
    align-items: center;
    padding-bottom: 22px;
    margin-bottom: 32px;
}
.admin-topbar-actions {
    gap: 10px;
}
.admin-topbar-title {
    font-size: 30px;
    line-height: 1.15;
}
.admin-topbar-label {
    margin-bottom: 4px;
}

/* Flash + context banners */
.admin-flash {
    padding: 12px 18px;
    margin-bottom: 24px;
    border-radius: 8px;
    font-size: 13.5px;
    line-height: 1.5;
}
.admin-context-banner {
    padding: 14px 20px;
    margin: 0 0 24px;
    border-radius: 8px;
    line-height: 1.6;
}

/* Cards (settings-style — used across Settings, Tax, Payment Methods, etc.) */
.settings-card {
    margin-bottom: 24px;
    border-radius: 12px;
}
.settings-card-head {
    padding: 22px 28px 16px;
}
.settings-card-title {
    font-size: 15px;
    margin-bottom: 6px;
}
.settings-card-desc {
    font-size: 12.5px;
    line-height: 1.55;
}
.settings-card-body {
    padding: 8px 28px 12px;
}
.settings-card-body > .settings-row:last-child {
    border-bottom: 0;
    padding-bottom: 22px;
}

/* Rows inside cards */
.settings-row {
    grid-template-columns: 240px 1fr;
    gap: 36px;
    padding: 22px 0;
}
.settings-row-label > span:first-child {
    font-weight: 500;
}
.settings-row-help {
    margin-top: 6px;
    line-height: 1.55;
}

/* Forms */
.admin-form {
    padding: 32px 36px;
    border-radius: 12px;
    margin-bottom: 24px;
}
.admin-form-grid {
    gap: 48px;
}
.admin-form-col {
    gap: 22px;
}
.admin-field label {
    margin-bottom: 7px;
}
.admin-field input[type="text"],
.admin-field input[type="email"],
.admin-field input[type="number"],
.admin-field input[type="password"],
.admin-field input[type="url"],
.admin-field input[type="tel"],
.admin-field input[type="date"],
.admin-field input[type="time"],
.admin-field input[type="datetime-local"],
.admin-field select,
.admin-field textarea {
    padding: 10px 13px;
    border-radius: 7px;
}
.admin-field textarea {
    min-height: 96px;
}
.admin-field-help {
    margin-top: 6px;
    line-height: 1.55;
}
.admin-form-actions,
.admin-page-actions {
    display: flex;
    gap: 10px;
    margin-top: 28px;
    padding-top: 22px;
    border-top: 1px solid var(--border);
}

/* Tables */
.admin-table-wrap {
    border-radius: 12px;
    margin-bottom: 24px;
}
.admin-table th {
    padding: 14px 20px;
    font-size: 11px;
    letter-spacing: 1.2px;
}
.admin-table td {
    padding: 16px 20px;
}
.admin-row-clickable { cursor: pointer; }

/* Empty states */
.admin-empty {
    padding: 22px 0;
}
.admin-empty-lg {
    padding: 64px 24px;
    border-radius: 12px;
}

/* Filter bars (above index tables) */
.admin-filter-bar {
    gap: 12px;
    margin-bottom: 20px;
}

/* Grid widgets — extra room between rows */
.admin-revenue-row,
.admin-ops-row,
.admin-grid-2 {
    gap: 20px;
    margin-bottom: 28px;
}

/* Topbar accent picker / theme toggle vertical alignment */
.admin-topbar-actions > * { align-self: center; }

/* Responsive trims so the polish doesn't bloat mobile */
@media (max-width: 1100px) {
    .admin-main { padding: 28px 32px 48px; }
    .admin-form { padding: 28px 30px; }
    .admin-form-grid { gap: 36px; }
    .settings-row { grid-template-columns: 200px 1fr; gap: 28px; }
}
@media (max-width: 900px) {
    .admin-main { padding: 24px 20px 40px; }
    .admin-topbar { padding-bottom: 18px; margin-bottom: 24px; }
    .admin-topbar-title { font-size: 24px; }
    .settings-card { margin-bottom: 18px; border-radius: 10px; }
    .settings-card-head { padding: 18px 20px 12px; }
    .settings-card-body { padding: 6px 20px 10px; }
    .settings-row { grid-template-columns: 1fr; gap: 8px; padding: 18px 0; }
    .admin-form { padding: 22px 20px; border-radius: 10px; }
    .admin-form-grid { grid-template-columns: 1fr; gap: 24px; }
    .admin-form-actions, .admin-page-actions { margin-top: 22px; padding-top: 18px; }
    .admin-table th, .admin-table td { padding: 12px 14px; }
    .admin-context-banner { padding: 12px 16px; }
    .admin-flash { padding: 11px 16px; }
}
@media (max-width: 600px) {
    .admin-main { padding: 20px 16px 32px; }
    .admin-topbar-title { font-size: 22px; }
    .admin-topbar-actions { gap: 6px; }
}

/* ════════════════════════════════════════════════
   FINAL POLISH — topbar + page header + cards
   (2026-06-07 v2: Back button merged into topbar)
   ════════════════════════════════════════════════ */

/* Topbar layout — left cluster (back btn + heading) / right cluster (actions) */
.admin-topbar {
    align-items: center;
    gap: 16px;
    padding-bottom: 24px;
    margin-bottom: 36px;
    border-bottom: 1px solid var(--border);
}
.admin-topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
    flex: 1;
}
.admin-topbar-left > div { min-width: 0; }
.admin-topbar-title {
    font-size: 32px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.admin-topbar-actions { flex-shrink: 0; gap: 10px; }

/* Back button — refined size to sit on heading baseline */
.admin-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 14px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    flex-shrink: 0;
    transition: all .15s;
}
.admin-back-btn:hover {
    background: var(--surface-hover);
    border-color: var(--border-2);
}
.admin-back-bar { display: none; }   /* deprecated, replaced by inline back btn */

/* Page intro head (Settings/SEO pages with .settings-page wrapper) */
.settings-page {
    max-width: 960px;
    padding: 0 0 80px;
}
.settings-page-head {
    margin-bottom: 36px;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--border);
}
.settings-page-title {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 400;
    font-size: 26px;
    letter-spacing: -0.005em;
    margin-bottom: 8px;
}
.settings-page-desc {
    font-size: 13.5px;
    line-height: 1.6;
}

/* Section heading inside content (h2 not inside a card) */
.admin-section-head {
    display: flex; flex-direction: column; gap: 4px;
    margin: 28px 0 18px;
}
.admin-section-head h2 {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 400; font-size: 22px;
    margin: 0; color: var(--text);
}
.admin-section-head p {
    margin: 0; font-size: 12.5px; color: var(--text-muted);
}

/* Card hover refinement (subtler) */
.settings-card { transition: box-shadow .18s, border-color .18s; }
.settings-card:hover {
    border-color: var(--border-2);
    box-shadow: var(--shadow-sm);
}

/* Mobile — back button on its own line so heading isn't squeezed */
@media (max-width: 720px) {
    .admin-topbar {
        flex-wrap: wrap;
        gap: 12px;
        padding-bottom: 18px;
        margin-bottom: 24px;
    }
    .admin-topbar-left {
        order: 2;
        width: 100%;
        gap: 12px;
    }
    .admin-topbar-actions {
        order: 1;
        margin-left: auto;
    }
    .admin-back-btn {
        height: 32px;
        padding: 0 12px;
        font-size: 11px;
    }
    .admin-topbar-title { font-size: 22px; }
    .settings-page-title { font-size: 22px; }
    .settings-page-head { margin-bottom: 24px; padding-bottom: 20px; }
}

/* ════════════════════════════════════════════════
   TOPBAR v3 — split into utility row + heading row
   Utility row: back btn (left) + accent/theme/signout (right)
   Heading row: eyebrow + serif title (left) + page actions (right)
   ════════════════════════════════════════════════ */
.admin-topbar { display: none; }   /* legacy single-row dropped */

.admin-topbar-utility {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}
.admin-topbar-utility-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.admin-topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.admin-topbar-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    padding-bottom: 24px;
    margin-bottom: 36px;
    border-bottom: 1px solid var(--border);
}
.admin-topbar-heading > div:first-child { min-width: 0; flex: 1; }
.admin-topbar-page-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-shrink: 0;
}

.admin-topbar-label {
    font-size: 11px;
    letter-spacing: 1.5px;
    font-weight: 500;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.admin-topbar-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 34px;
    font-weight: 300;
    line-height: 1.05;
    margin: 0;
    color: var(--text);
    letter-spacing: -0.005em;
    word-break: break-word;
    overflow-wrap: anywhere;
}

@media (max-width: 720px) {
    .admin-topbar-utility { margin-bottom: 14px; }
    .admin-topbar-heading {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
        padding-bottom: 18px;
        margin-bottom: 24px;
    }
    .admin-topbar-page-actions { justify-content: flex-start; }
    .admin-topbar-title { font-size: 26px; }
}
@media (max-width: 480px) {
    .admin-topbar-title { font-size: 23px; }
    .admin-topbar-utility-left { gap: 8px; }
    .admin-topbar-actions { gap: 6px; }
    .admin-back-btn { padding: 0 10px; font-size: 11px; height: 32px; }
}

/* ============================================================
   Master-mode banner — rendered at the top of /admin/* whenever
   the master account is signed in (impersonating the super-admin).
   Distinct dark+gold band so it can never be confused with normal
   admin chrome.
============================================================ */
.admin-master-banner {
    background: linear-gradient(90deg, #15110a 0%, #1d160c 100%);
    color: #f5efe2;
    padding: 11px 22px;
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 12.5px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.32);
    flex-wrap: wrap;
}
.admin-master-banner strong { color: #d4af37; letter-spacing: 1.5px; text-transform: uppercase; font-size: 11px; font-weight: 700; }
.admin-master-banner-msg { color: rgba(245, 239, 226, 0.7); flex: 1 1 220px; min-width: 0; }
.admin-master-banner-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: #d4af37;
    box-shadow: 0 0 10px #d4af37;
    animation: adminMasterPulse 1.8s ease-in-out infinite;
}
.admin-master-banner-cta {
    color: #d4af37; text-decoration: none;
    border: 1px solid rgba(212, 175, 55, 0.45);
    padding: 6px 13px; border-radius: 5px;
    font-weight: 600; font-size: 11px; letter-spacing: 1.6px; text-transform: uppercase;
    transition: background .15s, color .15s;
}
.admin-master-banner-cta:hover { background: #d4af37; color: #15110a; }
@keyframes adminMasterPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

/* ============================================================
   Dashboard tag pair — two tags per row, each prefixed with the
   category ("Payment:" / "Shipping:") so the row is never
   ambiguous. Prefix is dimmer than the value.
============================================================ */
.admin-tag-prefix {
    font-weight: 600;
    opacity: 0.62;
    margin-right: 4px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}
.admin-tag-icon {
    width: 12px;
    height: 12px;
    margin-right: 5px;
    vertical-align: -1px;
    flex-shrink: 0;
    opacity: 0.8;
}
.admin-tag {
    display: inline-flex;
    align-items: center;
    gap: 0;
    white-space: nowrap;
}

/* Customer approval badges (final-revisions) */
.cust-badge { display:inline-block; padding:3px 9px; border-radius:99px; font-size:10.5px; font-weight:700; letter-spacing:0.6px; text-transform:uppercase; }
.cust-badge-ok { background:rgba(79,141,58,0.12); color:#3c6e2c; }
.cust-badge-warn { background:rgba(212,175,55,0.16); color:#8a6d18; }
.cust-badge-danger { background:rgba(192,57,43,0.12); color:#b53322; }

/* ── Sidebar drag-to-reorder (per-admin) ──────────────────── */
.admin-nav-group { display: contents; }
.admin-nav-edit {
  display: flex; align-items: center; gap: 9px;
  margin: 0 0 10px; padding: 8px 12px; width: 100%;
  border: 1px solid var(--sidebar-border); border-radius: 8px;
  background: rgba(255,255,255,0.04); color: var(--sidebar-text);
  font-family: inherit; font-size: 11.5px; font-weight: 600; letter-spacing: 0.5px;
  cursor: pointer; opacity: 0.85; transition: opacity .15s, background .15s, border-color .15s;
}
.admin-nav-edit:hover { opacity: 1; background: rgba(255,255,255,0.08); }
.admin-nav-edit .admin-nav-icon { width: 15px; height: 15px; }
body.nav-edit .admin-nav-edit { opacity: 1; border-color: var(--gold, #c8a24a); color: var(--gold, #c8a24a); background: rgba(200,162,74,0.12); }
/* in edit mode the group shows as a list of draggable cards */
body.nav-edit .admin-nav-group { display: block; }
body.nav-edit .admin-nav-group .admin-nav-link {
  cursor: grab; border-radius: 8px; margin-bottom: 4px;
  outline: 1px dashed var(--sidebar-border); background: rgba(255,255,255,0.03);
}
body.nav-edit .admin-nav-group .admin-nav-link:active { cursor: grabbing; }
.admin-nav-link.nav-dragging { opacity: 0.45; outline-style: solid !important; }

/* Reset-to-default button — only visible in arrange (edit) mode */
.admin-nav-reset {
  display: none;
  margin: -4px 0 10px; padding: 7px 12px; width: 100%;
  border: 1px solid rgba(211,85,62,0.45); border-radius: 8px;
  background: transparent; color: #d3553e;
  font-family: inherit; font-size: 11px; font-weight: 600; letter-spacing: 0.5px;
  cursor: pointer; transition: background .15s, color .15s;
}
.admin-nav-reset:hover { background: rgba(211,85,62,0.1); }
.admin-nav-reset.is-armed { background: #d3553e; color: #fff; }
body.nav-edit .admin-nav-reset { display: block; }

.admin-nav-reset-form { display: contents; }

/* Compact arrange toggle: small icon normally, expands to "Done" in edit mode */
.admin-nav-edit { display: inline-flex; width: auto; margin: 0 0 10px; padding: 7px 9px; }
.admin-nav-edit [data-nav-edit-label] { display: none; }
body.nav-edit .admin-nav-edit { display: flex; width: 100%; margin: 0 0 10px; padding: 8px 12px; }
body.nav-edit .admin-nav-edit [data-nav-edit-label] { display: inline; }

/* Instagram handle badge (customer list + detail) */
.admin-ig-badge {
  display: inline-flex; align-items: center; gap: 5px;
  margin-top: 6px; padding: 3px 9px; border-radius: 99px;
  background: linear-gradient(45deg, rgba(240,148,51,0.14), rgba(193,53,132,0.14), rgba(131,58,180,0.14));
  color: #c13584; font-size: 12px; font-weight: 600; text-decoration: none;
  border: 1px solid rgba(193,53,132,0.28);
}
.admin-ig-badge:hover { background: linear-gradient(45deg, rgba(240,148,51,0.22), rgba(193,53,132,0.22), rgba(131,58,180,0.22)); }
.admin-ig-badge-sm { font-size: 11px; padding: 2px 7px; }

/* Clickable revenue stat cards -> filtered orders */
a.admin-stat { text-decoration: none; color: inherit; transition: transform .12s, box-shadow .12s; }
a.admin-stat:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.10); }

/* Sidebar menu search (inherits sidebar text color so it works light + dark) */
.admin-nav-search {
  margin: 4px 16px 8px; width: calc(100% - 32px);
  padding: 8px 12px; border-radius: 7px;
  background: rgba(127,127,127,0.08); border: 1px solid rgba(127,127,127,0.22);
  color: inherit; font-family: inherit; font-size: 12.5px; outline: none;
}
.admin-nav-search::placeholder { color: currentColor; opacity: 0.5; }
.admin-nav-search:focus { border-color: var(--accent, #B8912A); }
.admin-nav-search-empty { margin: 2px 20px 8px; font-size: 11.5px; opacity: 0.55; }

/* Message conversation bubbles (admin) — theme-safe */
.gb-chat { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.gb-chat-msg { padding: 10px 14px; border-radius: 10px; max-width: 85%; font-size: 13.5px; line-height: 1.5; }
.gb-chat-msg--in { align-self: flex-start; background: rgba(127,127,127,0.16); color: var(--text); border: 1px solid var(--border); }
.gb-chat-msg--out { align-self: flex-end; background: var(--accent, #B8912A); color: #fff; }
.gb-chat-meta { font-size: 10.5px; opacity: 0.75; margin-bottom: 3px; }

/* Coupons page — tabs, tickets, modals (theme vars aliased in admin.css) */
.coupon-tabs { display:flex; align-items:center; gap:8px; margin-bottom:16px; flex-wrap:wrap; }
.coupon-tab { padding:8px 16px; border:1px solid var(--m-line-dim); background:var(--m-card); color:var(--m-muted); border-radius:999px; font-size:13px; font-weight:600; cursor:pointer; font-family:inherit; transition:all .15s; }
.coupon-tab:hover { border-color:var(--m-gold); }
.coupon-tab.is-active { background:var(--m-gold); color:#1E1610; border-color:var(--m-gold); }
.coupon-tab-n { opacity:.7; margin-left:4px; }
.coupon-modal { position:fixed; inset:0; z-index:9800; display:flex; align-items:center; justify-content:center; padding:24px; }
.coupon-modal[hidden] { display:none; }
.coupon-modal-bg { position:absolute; inset:0; background:rgba(18,14,9,.55); -webkit-backdrop-filter:blur(3px); backdrop-filter:blur(3px); }
.coupon-modal-card { position:relative; width:min(680px,96vw); max-height:86vh; overflow-y:auto; background:var(--m-card); border:1px solid var(--m-gold); border-radius:16px; box-shadow:0 30px 80px rgba(0,0,0,.45); padding:24px; animation:gbCouponIn .18s ease; }
@keyframes gbCouponIn { from { opacity:0; transform:translateY(10px) scale(.98);} to { opacity:1; transform:none; } }
.coupon-modal-x { position:absolute; top:12px; right:14px; border:0; background:transparent; color:var(--m-muted); font-size:24px; line-height:1; cursor:pointer; }
.coupon-modal-x:hover { color:var(--m-ink); }
.coupon-modal-title { font-size:16px; font-weight:700; color:var(--m-ink); margin-bottom:16px; padding-right:28px; }

.coupon-cust-suggest { position:absolute; left:0; right:0; top:100%; z-index:30; background:var(--m-card); border:1px solid var(--m-line); border-radius:8px; box-shadow:0 12px 28px rgba(0,0,0,0.18); max-height:220px; overflow-y:auto; margin-top:4px; }
.coupon-cust-opt { padding:8px 12px; cursor:pointer; font-size:13px; display:flex; flex-direction:column; gap:1px; }
.coupon-cust-opt:hover { background:rgba(184,145,42,0.10); }
.coupon-cust-opt span { font-size:11.5px; color:var(--m-muted); }
/* Promo email composer — live side-by-side preview */
.promo-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}
.promo-split-single { grid-template-columns: minmax(0, 640px); }
.promo-preview-pane { position: sticky; top: 20px; }
.promo-preview-label {
    font-size: 11px; letter-spacing: 1px; text-transform: uppercase;
    color: var(--text-muted); margin-bottom: 8px; font-weight: 500;
}
.promo-preview-frame {
    width: 100%; height: 72vh; border: 1px solid var(--border);
    border-radius: 12px; background: #fff; display: block;
}
@media (max-width: 1000px) {
    .promo-split { grid-template-columns: 1fr; }
    .promo-preview-pane { position: static; }
    .promo-preview-frame { height: 60vh; }
}
/* R8: on small screens the 600px email is unreadable squeezed into a narrow
   pane. Show it inside an iPhone mockup — the email renders at its true 600px
   width, scaled to fit the phone screen (how a customer actually sees it).
   On desktop the wrapper is transparent (display:contents) so the wide preview
   is unchanged. */
.promo-phone { display: contents; }
@media (max-width: 1000px) {
    .promo-preview-pane { display: flex; flex-direction: column; align-items: center; }
    .promo-phone {
        display: block; position: relative;
        width: 324px; max-width: 100%; margin: 6px auto 0;
        padding: 12px; background: #0f0f10; border-radius: 44px;
        box-shadow: 0 18px 44px rgba(0,0,0,0.30), inset 0 0 0 2px #2a2a2a;
    }
    /* notch, sits over the top of the white screen */
    .promo-phone::before {
        content: ""; position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
        width: 126px; height: 22px; background: #0f0f10; border-radius: 0 0 15px 15px; z-index: 2;
    }
    .promo-phone-screen {
        width: 300px; max-width: 100%; height: 620px; margin: 0 auto;
        overflow: hidden; border-radius: 32px; background: #fff;
    }
    /* Fit-to-width: the 600px email is scaled to the phone screen so the whole
       layout fits inside (no horizontal cutoff) — how a phone shows a non-fluid
       email zoomed to fit. */
    .promo-phone-screen .promo-preview-frame {
        width: 600px; height: 1240px; border: 0; border-radius: 0;
        transform: scale(0.5); transform-origin: top left;
    }
}

/* ── Promo: iPhone mockup for the unsubscribe-page preview ─────────── */
.promo-iphone { position: relative; width: 300px; max-width: 100%; height: 600px; margin: 0 auto; background: #111; border-radius: 44px; padding: 12px; box-shadow: 0 12px 40px rgba(0,0,0,.28); }
.promo-iphone-notch { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); width: 130px; height: 26px; background: #111; border-bottom-left-radius: 16px; border-bottom-right-radius: 16px; z-index: 2; }
.promo-iphone-screen { width: 100%; height: 100%; border: 0; border-radius: 34px; background: #fff; }

/* ── Promo: lightweight rich-text editor ──────────────────────────── */
.rte { border: 1px solid #D9D2C7; border-radius: 8px; overflow: hidden; background: #fff; }
.rte-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 6px 8px; background: #F7F4EF; border-bottom: 1px solid #E5DFD5; }
.rte-btn { min-width: 30px; height: 28px; padding: 0 8px; font-size: 12.5px; line-height: 1; color: #3B3226; background: #fff; border: 1px solid #D9D2C7; border-radius: 5px; cursor: pointer; }
.rte-btn:hover { background: #efe9df; }
.rte-sep { width: 1px; height: 18px; margin: 0 4px; background: #D9D2C7; }
.rte-area { min-height: 220px; max-height: 460px; overflow-y: auto; padding: 12px 14px; font-size: 14px; line-height: 1.6; color: #1E1610; outline: none; }
.rte-area:focus { background: #fffdf9; }
.rte-area ul { list-style: disc; padding-left: 22px; }
.rte-area ol { list-style: decimal; padding-left: 22px; }
html[data-theme="dark"] .rte { background: #201b14; border-color: #3a3126; }
html[data-theme="dark"] .rte-toolbar { background: #2a2318; border-color: #3a3126; }
html[data-theme="dark"] .rte-btn { color: #e8dcc5; background: #201b14; border-color: #3a3126; }
html[data-theme="dark"] .rte-btn:hover { background: #33291b; }
html[data-theme="dark"] .rte-area { color: #f0e6d2; }
/* ── Promo RTE: in-page link modal ────────────────────────────────── */
.rte-modal-overlay { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; background: rgba(20,16,10,.55); padding: 20px; }
.rte-modal { width: 100%; max-width: 420px; background: #fff; border-radius: 12px; padding: 20px 22px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.rte-modal-title { font-size: 15px; font-weight: 600; color: #1E1610; margin-bottom: 12px; }
.rte-modal-input { width: 100%; padding: 10px 12px; font-size: 14px; border: 1px solid #D9D2C7; border-radius: 8px; outline: none; }
.rte-modal-input:focus { border-color: #B89968; }
.rte-modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.rte-modal-btn { padding: 8px 16px; font-size: 13px; border-radius: 8px; border: 1px solid #D9D2C7; background: #fff; color: #3B3226; cursor: pointer; }
.rte-modal-ok { background: #1E1610; color: #fff; border-color: #1E1610; }
.rte-modal-btn:hover { opacity: .9; }
/* Promo RTE modal — field labels (two-field link dialog) */
.rte-modal-label { display: block; font-size: 12px; font-weight: 600; color: #3B3226; margin: 0 0 4px; }
.rte-modal-opt { font-weight: 400; color: #8A7A66; }
.rte-modal .rte-modal-input { margin-bottom: 0; }

/* R13: coupon ticket stacks on small screens (was a 3-col flex that squished) */
@media (max-width: 600px) {
  .coupon-ticket { flex-wrap: wrap; gap: 12px; }
  .coupon-ticket > div:first-child { border-right: 0 !important; padding-right: 0 !important; min-width: 0 !important; text-align: left !important; }
  .coupon-ticket > div:last-child { flex-basis: 100% !important; justify-content: flex-start !important; flex-wrap: wrap; }
}

/* F27: light entrance animations for dashboard cards + panels. Respects
   prefers-reduced-motion (no motion for users who opt out). */
@media (prefers-reduced-motion: no-preference) {
  @keyframes gbFadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
  .admin-content .admin-stat,
  .admin-content .admin-panel,
  .admin-content .admin-acc,
  .admin-content .admin-approve-card,
  .admin-content .admin-stat-mini { animation: gbFadeUp .38s cubic-bezier(.22,.61,.36,1) both; }
  /* Gentle stagger across the stat rows. */
  .admin-revenue-row .admin-stat:nth-child(2) { animation-delay: .04s; }
  .admin-revenue-row .admin-stat:nth-child(3) { animation-delay: .08s; }
  .admin-revenue-row .admin-stat:nth-child(4) { animation-delay: .12s; }
}

/* F23: growth-ideas upsell card on the admin dashboard */
.admin-growth-card { display:flex; align-items:center; gap:18px; padding:16px 22px; margin-bottom:20px;
  background:linear-gradient(135deg, rgba(60,154,95,0.12), rgba(60,154,95,0.03)); border:1px solid rgba(60,154,95,0.40);
  border-radius:10px; text-decoration:none; color:#1d2a20; transition:transform .15s ease, box-shadow .15s ease; }
.admin-growth-card:hover { transform:translateY(-1px); box-shadow:0 8px 22px rgba(60,154,95,0.16); }
.admin-growth-card-icon { font-size:30px; line-height:1; }
.admin-growth-card-title { font-family:'Cormorant Garamond',serif; font-size:20px; }
.admin-growth-card-sub { font-size:12.5px; color:#4c6152; margin-top:2px; }
html[data-theme="dark"] .admin-growth-card { color:#dfeee5; }
html[data-theme="dark"] .admin-growth-card-sub { color:rgba(223,238,229,0.7); }
