/* =========================================================================
   BrickStore Design System
   A small-batch 3D-printing storefront. The visual language borrows from
   the print bed itself: things are built up in layers. Section dividers,
   card edges and the hero animation all reference a layer-height ridge —
   a literal cross-section of how everything on this site actually gets made.
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* ---- Color tokens ---- */
  --bg: #EDEEE9;
  --bg-raised: #F5F5F1;
  --surface: #FFFFFF;
  --ink: #1E2023;
  --ink-soft: #5B5E64;
  --ink-faint: #8B8E93;
  --line: #DBD7CC;
  --line-strong: #C6C1B3;

  --accent: #FF6B35;          /* filament orange — primary action */
  --accent-ink: #7A2E0A;
  --accent-soft: #FFE3D4;
  --accent-2: #1F6F78;        /* blueprint teal — secondary / links */
  --accent-2-soft: #DCEFF0;

  --success: #2E7D4F;
  --success-soft: #DEF0E4;
  --warning: #9A6B00;
  --warning-soft: #FCF0D2;
  --danger: #C2402E;
  --danger-soft: #FBE1DC;
  --info: #3A5AA6;
  --info-soft: #E1E7F7;

  --admin-bg: #15181B;
  --admin-surface: #1E2226;
  --admin-line: #2C3136;
  --admin-ink: #ECEDEE;
  --admin-ink-soft: #9BA1A7;

  /* ---- Type ---- */
  --font-display: 'Space Grotesk', 'Inter', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;

  /* ---- Layout ---- */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(30,32,35,0.06), 0 1px 1px rgba(30,32,35,0.04);
  --shadow-md: 0 6px 20px rgba(30,32,35,0.09), 0 2px 6px rgba(30,32,35,0.06);
  --shadow-lg: 0 20px 48px rgba(30,32,35,0.16), 0 6px 16px rgba(30,32,35,0.08);
  --container: 1120px;
  --nav-h: 68px;
}

/* ---------------------------------------------------------------------- */
/* Reset / base                                                           */
/* ---------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 .5em;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2.1rem, 4vw, 3.2rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; color: var(--ink-soft); }
ul { padding-left: 1.2em; }
code, .mono { font-family: var(--font-mono); }

:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
  border-radius: 4px;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -48px;
  background: var(--ink); color: #fff; padding: 10px 16px;
  border-radius: var(--radius-sm); z-index: 200; transition: top .15s ease;
}
.skip-link:focus { top: 12px; }

/* ---------------------------------------------------------------------- */
/* Layer-line divider — the site's signature motif                        */
/* ---------------------------------------------------------------------- */
.layer-divider {
  height: 10px;
  background-image: repeating-linear-gradient(
    to right,
    var(--line-strong) 0px, var(--line-strong) 10px,
    transparent 10px, transparent 22px
  );
  background-position: center;
  background-repeat: repeat-x;
  background-size: 22px 2px;
  opacity: .8;
}
.layer-divider.tight { height: 6px; }

/* ---------------------------------------------------------------------- */
/* Navigation                                                              */
/* ---------------------------------------------------------------------- */
.site-nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(237,238,233,0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-nav__row {
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-weight: 700; font-size: 1.2rem;
  color: var(--ink); text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand__mark {
  width: 30px; height: 30px; flex: none; position: relative;
}
.brand__mark svg { width: 100%; height: 100%; }

.nav-links {
  display: flex; align-items: center; gap: 4px;
  list-style: none; margin: 0; padding: 0;
}
.nav-links a {
  color: var(--ink-soft); font-weight: 500; font-size: .95rem;
  padding: 9px 12px; border-radius: var(--radius-sm);
}
.nav-links a:hover { color: var(--ink); background: var(--bg-raised); text-decoration: none; }
.nav-links a.active { color: var(--ink); background: var(--accent-soft); }
.nav-links a.is-admin { color: var(--accent-2); }

.nav-actions { display: flex; align-items: center; gap: 10px; }
.nav-toggle {
  display: none; background: none; border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); width: 40px; height: 40px; cursor: pointer;
  align-items: center; justify-content: center;
}
.nav-toggle span, .nav-toggle::before, .nav-toggle::after {
  content: ''; display: block; width: 18px; height: 2px; background: var(--ink);
  transition: transform .2s ease;
}
.nav-toggle span { margin: 4px 0; }

@media (max-width: 860px) {
  .nav-links {
    position: fixed; inset: var(--nav-h) 0 auto 0;
    flex-direction: column; align-items: stretch;
    background: var(--surface); border-bottom: 1px solid var(--line);
    padding: 8px; box-shadow: var(--shadow-md);
    transform: translateY(-8px); opacity: 0; pointer-events: none;
    transition: transform .18s ease, opacity .18s ease;
  }
  .nav-links.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .nav-links a { padding: 12px 14px; }
  .nav-toggle { display: flex; }
}

/* ---------------------------------------------------------------------- */
/* Buttons                                                                 */
/* ---------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-body); font-weight: 600; font-size: .95rem;
  padding: 11px 20px; border-radius: var(--radius-sm);
  border: 1px solid transparent; cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease, border-color .12s ease;
  text-decoration: none; line-height: 1;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.btn-primary { background: var(--accent); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { box-shadow: var(--shadow-md); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-secondary:hover { border-color: var(--ink); }
.btn-ghost { background: transparent; color: var(--ink-soft); }
.btn-ghost:hover { background: var(--bg-raised); color: var(--ink); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 7px 14px; font-size: .85rem; }
.btn-block { width: 100%; }
.btn .spinner { margin-right: 2px; }

/* ---------------------------------------------------------------------- */
/* Hero                                                                    */
/* ---------------------------------------------------------------------- */
.hero {
  padding: 64px 0 40px;
  display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center;
}
.hero__eyebrow {
  font-family: var(--font-mono); font-size: .78rem; letter-spacing: .06em;
  text-transform: uppercase; color: var(--accent-2); font-weight: 600;
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 14px;
}
.hero__eyebrow::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.hero p.lead { font-size: 1.1rem; max-width: 46ch; }
.hero__cta { display: flex; gap: 12px; margin-top: 26px; flex-wrap: wrap; }

/* Print-bed hero visual: layers stack up on load */
.print-visual {
  aspect-ratio: 1 / 1; max-width: 420px; margin: 0 auto; position: relative;
}
.print-visual svg { width: 100%; height: 100%; }
.print-layer {
  transform-origin: center;
  animation: layer-rise .5s cubic-bezier(.2,.8,.2,1) both;
}
.print-layer:nth-child(1) { animation-delay: .05s; }
.print-layer:nth-child(2) { animation-delay: .17s; }
.print-layer:nth-child(3) { animation-delay: .29s; }
.print-layer:nth-child(4) { animation-delay: .41s; }
.print-layer:nth-child(5) { animation-delay: .53s; }
.print-layer:nth-child(6) { animation-delay: .65s; }
.print-layer:nth-child(7) { animation-delay: .77s; }
@keyframes layer-rise {
  from { opacity: 0; transform: translateY(10px) scaleX(.9); }
  to { opacity: 1; transform: translateY(0) scaleX(1); }
}
.print-nozzle { animation: nozzle-travel 2.6s ease-in-out .9s infinite; }
@keyframes nozzle-travel {
  0%, 100% { transform: translateX(-46px); }
  50% { transform: translateX(46px); }
}
@media (prefers-reduced-motion: reduce) {
  .print-layer, .print-nozzle { animation: none !important; opacity: 1 !important; transform: none !important; }
}

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 40px; text-align: left; }
  .print-visual { max-width: 300px; }
}

/* ---------------------------------------------------------------------- */
/* Sections / cards                                                       */
/* ---------------------------------------------------------------------- */
section.section { padding: 56px 0; }
.section__head { max-width: 640px; margin-bottom: 32px; }
.section__head .kicker {
  font-family: var(--font-mono); text-transform: uppercase; font-size: .75rem;
  letter-spacing: .06em; color: var(--ink-faint); font-weight: 600; display: block; margin-bottom: 8px;
}

.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 900px) { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .card-grid { grid-template-columns: 1fr; } }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .15s ease, transform .15s ease, border-color .15s ease;
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--line-strong); }
.card--flush { padding: 0; overflow: hidden; }

.service-card {
  position: relative; display: flex; flex-direction: column; gap: 10px; height: 100%;
}
.service-card__icon {
  width: 44px; height: 44px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent-ink); margin-bottom: 4px;
}
.service-card--primary {
  border-color: var(--accent); background: linear-gradient(180deg, #FFF7F2, var(--surface) 60%);
}
.service-card--primary .service-card__icon { background: var(--accent); color: #fff; }
.service-card__tag {
  position: absolute; top: 18px; right: 18px;
  font-family: var(--font-mono); font-size: .68rem; text-transform: uppercase;
  letter-spacing: .05em; font-weight: 600; color: var(--accent-ink);
  background: var(--accent-soft); padding: 4px 9px; border-radius: 999px;
}

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 8px; }
.stat { text-align: left; }
.stat b { display: block; font-family: var(--font-display); font-size: 1.8rem; }
.stat span { font-size: .85rem; color: var(--ink-faint); }
@media (max-width: 620px) { .stat-row { grid-template-columns: 1fr 1fr; } }

/* ---------------------------------------------------------------------- */
/* Forms                                                                   */
/* ---------------------------------------------------------------------- */
.form-shell {
  max-width: 460px; margin: 0 auto; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 36px; box-shadow: var(--shadow-sm);
}
.form-shell--wide { max-width: 720px; }
.field { margin-bottom: 18px; }
.field label {
  display: block; font-weight: 600; font-size: .88rem; margin-bottom: 6px; color: var(--ink);
}
.field .hint { font-size: .8rem; color: var(--ink-faint); margin-top: 5px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 13px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); background: var(--surface);
  font-family: var(--font-body); font-size: .95rem; color: var(--ink);
  transition: border-color .12s ease, box-shadow .12s ease;
}
.field textarea { resize: vertical; min-height: 96px; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--accent-2); box-shadow: 0 0 0 3px var(--accent-2-soft); outline: none;
}
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] {
  border-color: var(--danger);
}
.field-error {
  color: var(--danger); font-size: .82rem; margin-top: 6px; display: none;
}
.field-error.show { display: block; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }
fieldset { border: 0; padding: 0; margin: 0 0 18px; }
legend { font-weight: 600; margin-bottom: 8px; padding: 0; font-size: .95rem; }

/* ---------------------------------------------------------------------- */
/* Alerts / toasts / states                                               */
/* ---------------------------------------------------------------------- */
.alert {
  border-radius: var(--radius-sm); padding: 12px 14px; font-size: .9rem;
  border: 1px solid transparent; margin-bottom: 16px; display: none;
}
.alert.show { display: flex; align-items: flex-start; gap: 8px; }
.alert-error { background: var(--danger-soft); color: #7A1D10; border-color: #F0B7AA; }
.alert-success { background: var(--success-soft); color: #17512F; border-color: #A9DABB; }
.alert-info { background: var(--info-soft); color: #223A73; border-color: #B6C4EE; }

.toast-stack {
  position: fixed; bottom: 20px; right: 20px; z-index: 300;
  display: flex; flex-direction: column; gap: 10px; max-width: 340px;
}
.toast {
  background: var(--ink); color: #fff; padding: 13px 16px; border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg); font-size: .88rem; display: flex; gap: 10px; align-items: flex-start;
  animation: toast-in .18s ease both;
}
.toast.error { background: var(--danger); }
.toast.success { background: var(--success); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 480px) { .toast-stack { left: 16px; right: 16px; max-width: none; } }

.empty-state {
  text-align: center; padding: 56px 24px; color: var(--ink-faint);
  border: 1px dashed var(--line-strong); border-radius: var(--radius-lg);
}
.empty-state h3 { color: var(--ink-soft); }

.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid rgba(255,255,255,.4); border-top-color: #fff;
  animation: spin .7s linear infinite; display: inline-block;
}
.spinner.dark { border-color: rgba(30,32,35,.18); border-top-color: var(--ink); }
@keyframes spin { to { transform: rotate(360deg); } }
.page-loader {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 80px 0; color: var(--ink-faint); font-size: .9rem;
}

/* ---------------------------------------------------------------------- */
/* Status badges                                                          */
/* ---------------------------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: .75rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .03em;
  padding: 5px 10px; border-radius: 999px; white-space: nowrap;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-pending   { background: var(--warning-soft); color: var(--warning); }
.badge-reviewing { background: var(--info-soft); color: var(--info); }
.badge-quoted    { background: var(--accent-2-soft); color: var(--accent-2); }
.badge-accepted  { background: var(--success-soft); color: var(--success); }
.badge-printing  { background: var(--accent-soft); color: var(--accent-ink); }
.badge-ready     { background: var(--success-soft); color: var(--success); }
.badge-completed { background: #E4E4E4; color: #444; }
.badge-cancelled { background: var(--danger-soft); color: var(--danger); }

/* ---------------------------------------------------------------------- */
/* Request / list items                                                   */
/* ---------------------------------------------------------------------- */
.list-item {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius-md);
  background: var(--surface); margin-bottom: 12px; cursor: pointer;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.list-item:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.list-item__main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.list-item__title { font-weight: 600; }
.list-item__meta { font-size: .82rem; color: var(--ink-faint); font-family: var(--font-mono); }
.list-item__side { display: flex; align-items: center; gap: 14px; flex: none; }
@media (max-width: 620px) {
  .list-item { flex-direction: column; align-items: flex-start; }
  .list-item__side { width: 100%; justify-content: space-between; }
}

.detail-panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 28px; box-shadow: var(--shadow-sm);
}
.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 24px; margin: 18px 0; }
@media (max-width: 620px) { .detail-grid { grid-template-columns: 1fr; } }
.detail-grid dt { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-faint); font-family: var(--font-mono); margin-bottom: 2px; }
.detail-grid dd { margin: 0 0 8px; font-weight: 500; }

.message-thread { display: flex; flex-direction: column; gap: 12px; margin: 16px 0; }
.message {
  padding: 12px 14px; border-radius: var(--radius-md); max-width: 80%;
  background: var(--bg-raised); border: 1px solid var(--line);
}
.message.from-admin { align-self: flex-start; border-left: 3px solid var(--accent-2); }
.message.from-customer { align-self: flex-end; border-right: 3px solid var(--accent); text-align: right; }
.message__meta { font-family: var(--font-mono); font-size: .72rem; color: var(--ink-faint); margin-bottom: 4px; }

/* ---------------------------------------------------------------------- */
/* Loyalty                                                                 */
/* ---------------------------------------------------------------------- */
.points-banner {
  background: var(--ink); color: #fff; border-radius: var(--radius-lg);
  padding: 32px; display: flex; align-items: center; justify-content: space-between;
  gap: 20px; flex-wrap: wrap; position: relative; overflow: hidden;
}
.points-banner::after {
  content: ''; position: absolute; inset: 0;
  background-image: repeating-linear-gradient(to right, rgba(255,255,255,.06) 0 10px, transparent 10px 22px);
}
.points-banner__value { font-family: var(--font-display); font-size: 2.6rem; position: relative; }
.points-banner__label { font-family: var(--font-mono); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; opacity: .7; position: relative; }

.reward-card { display: flex; flex-direction: column; height: 100%; }
.reward-card__cost {
  font-family: var(--font-mono); font-weight: 600; color: var(--accent-2);
  margin: 6px 0 12px; font-size: 1rem;
}
.reward-card--locked { opacity: .55; }

.history-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 13px 0; border-bottom: 1px solid var(--line); gap: 12px;
}
.history-row:last-child { border-bottom: none; }
.history-row__amount { font-family: var(--font-mono); font-weight: 600; }
.history-row__amount.positive { color: var(--success); }
.history-row__amount.negative { color: var(--danger); }

/* ---------------------------------------------------------------------- */
/* Footer                                                                  */
/* ---------------------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--line); margin-top: 40px; padding: 40px 0 32px; }
.site-footer__row { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 20px; align-items: center; }
.site-footer p { margin: 0; font-size: .85rem; }
.footer-links { display: flex; gap: 18px; list-style: none; padding: 0; margin: 0; }
.footer-links a { color: var(--ink-soft); font-size: .85rem; }

/* ---------------------------------------------------------------------- */
/* Auth / account pages                                                    */
/* ---------------------------------------------------------------------- */
.auth-page { padding: 64px 0 80px; }
.auth-head { text-align: center; margin-bottom: 28px; }
.auth-switch { text-align: center; margin-top: 18px; font-size: .9rem; color: var(--ink-soft); }

.account-grid { display: grid; grid-template-columns: 280px 1fr; gap: 28px; align-items: start; }
@media (max-width: 800px) { .account-grid { grid-template-columns: 1fr; } }
.profile-card { text-align: center; }
.avatar {
  width: 72px; height: 72px; border-radius: 50%; background: var(--accent);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 1.6rem; font-weight: 700;
  margin: 0 auto 14px;
}
.kv-list { list-style: none; padding: 0; margin: 18px 0 0; text-align: left; }
.kv-list li { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: .88rem; }
.kv-list li:last-child { border-bottom: none; }
.kv-list span:first-child { color: var(--ink-faint); }
.kv-list span:last-child { font-weight: 600; font-family: var(--font-mono); }

/* ---------------------------------------------------------------------- */
/* Admin dashboard                                                        */
/* ---------------------------------------------------------------------- */
.admin-shell { background: var(--admin-bg); color: var(--admin-ink); min-height: 100vh; }
.admin-shell .site-nav { background: rgba(21,24,27,.92); border-bottom: 1px solid var(--admin-line); }
.admin-shell .brand, .admin-shell .nav-links a { color: var(--admin-ink); }
.admin-shell .nav-links a:hover { background: var(--admin-surface); color: #fff; }
.admin-shell .nav-links a.active { background: rgba(255,107,53,.16); color: var(--accent); }
@media (max-width: 860px) { .admin-shell .nav-links { background: var(--admin-surface); border-color: var(--admin-line); } }

.admin-header { padding: 32px 0 8px; }
.admin-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--admin-line); margin-bottom: 28px; overflow-x: auto; }
.admin-tab {
  padding: 12px 16px; font-weight: 600; font-size: .9rem; color: var(--admin-ink-soft);
  border-bottom: 2px solid transparent; cursor: pointer; background: none; border-top: none; border-left: none; border-right: none;
  white-space: nowrap;
}
.admin-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.admin-panel { display: none; }
.admin-panel.active { display: block; }

.admin-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.admin-toolbar select, .admin-toolbar input {
  background: var(--admin-surface); border: 1px solid var(--admin-line); color: var(--admin-ink);
  padding: 9px 12px; border-radius: var(--radius-sm); font-size: .88rem;
}

.admin-stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 28px; }
@media (max-width: 760px) { .admin-stat-row { grid-template-columns: 1fr 1fr; } }
.admin-stat {
  background: var(--admin-surface); border: 1px solid var(--admin-line); border-radius: var(--radius-md);
  padding: 18px;
}
.admin-stat b { display: block; font-family: var(--font-display); font-size: 1.7rem; }
.admin-stat span { font-size: .78rem; color: var(--admin-ink-soft); font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .04em; }

.admin-table-wrap { background: var(--admin-surface); border: 1px solid var(--admin-line); border-radius: var(--radius-md); overflow: hidden; overflow-x: auto; }
table.admin-table { width: 100%; border-collapse: collapse; min-width: 640px; }
.admin-table th, .admin-table td { text-align: left; padding: 13px 16px; border-bottom: 1px solid var(--admin-line); font-size: .88rem; }
.admin-table th { font-family: var(--font-mono); text-transform: uppercase; font-size: .72rem; letter-spacing: .04em; color: var(--admin-ink-soft); font-weight: 600; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr.clickable { cursor: pointer; transition: background .1s ease; }
.admin-table tr.clickable:hover { background: rgba(255,255,255,.03); }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15,17,19,.6); z-index: 400;
  display: none; align-items: flex-start; justify-content: center; padding: 40px 20px; overflow-y: auto;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--surface); color: var(--ink); border-radius: var(--radius-lg);
  max-width: 640px; width: 100%; padding: 28px; box-shadow: var(--shadow-lg);
  animation: modal-in .16s ease both;
}
.admin-shell .modal { background: var(--admin-surface); color: var(--admin-ink); }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.modal__head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 6px; gap: 12px; }
.modal__close { background: none; border: none; font-size: 1.4rem; cursor: pointer; color: var(--ink-faint); line-height: 1; padding: 4px; }

.admin-login-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--admin-bg); }
.admin-login-shell .form-shell { background: var(--admin-surface); border-color: var(--admin-line); color: var(--admin-ink); }
.admin-login-shell .form-shell h1, .admin-login-shell .form-shell p { color: var(--admin-ink); }
.admin-login-shell .field label { color: var(--admin-ink); }
.admin-login-shell .field input { background: #12151798; border-color: var(--admin-line); color: var(--admin-ink); }

/* ---------------------------------------------------------------------- */
/* Utility                                                                 */
/* ---------------------------------------------------------------------- */
.flex { display: flex; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; }
.mb-0 { margin-bottom: 0; }
.text-faint { color: var(--ink-faint); }
.text-center { text-align: center; }
.w-full { width: 100%; }
.hidden { display: none !important; }
