/* ============================================================
   SIONBOX — Sistema visual
   3 estilos premium controlados por [data-theme]
   ============================================================ */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; }
a { color: inherit; text-decoration: none; }
::selection { background: color-mix(in oklch, var(--accent) 30%, transparent); }

/* ============================================================
   THEME TOKENS
   ============================================================ */

/* — Estilo 1 · Marino & Cobre (editorial, serif) — */
[data-theme="1"] {
  --font-display: "Spectral", Georgia, serif;
  --font-body: "Manrope", system-ui, sans-serif;
  --bg: oklch(0.975 0.005 250);
  --surface: #ffffff;
  --surface-2: oklch(0.972 0.006 250);
  --ink: oklch(0.24 0.035 260);
  --ink-soft: oklch(0.40 0.03 260);
  --muted: oklch(0.56 0.02 260);
  --line: oklch(0.90 0.012 260);
  --line-strong: oklch(0.84 0.018 260);
  --primary: oklch(0.32 0.075 262);
  --primary-ink: #ffffff;
  --primary-soft: oklch(0.95 0.02 262);
  --brand: oklch(0.32 0.075 262);
  --accent: oklch(0.62 0.115 52);
  --accent-ink: #ffffff;
  --accent-soft: oklch(0.93 0.04 60);
  --ok: oklch(0.58 0.11 155);
  --warn: oklch(0.66 0.13 70);
  --danger: oklch(0.58 0.16 25);
  --radius: 10px;
  --radius-lg: 14px;
  --radius-sm: 7px;
  --shadow-sm: 0 1px 2px oklch(0.3 0.05 262 / 0.06), 0 1px 1px oklch(0.3 0.05 262 / 0.04);
  --shadow: 0 2px 6px oklch(0.3 0.05 262 / 0.05), 0 14px 34px -18px oklch(0.3 0.05 262 / 0.30);
  --shadow-lg: 0 30px 70px -28px oklch(0.3 0.05 262 / 0.40);
  --display-weight: 600;
  --display-tracking: -0.01em;
}

/* — Estilo 2 · Medianoche & Aqua (corporativo, aqua vivo) — */
[data-theme="2"] {
  --font-display: "IBM Plex Sans", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", system-ui, sans-serif;
  --bg: oklch(0.986 0.0015 230);
  --surface: #ffffff;
  --surface-2: oklch(0.975 0.0025 230);
  --ink: oklch(0.22 0.022 250);
  --ink-soft: oklch(0.40 0.022 250);
  --muted: oklch(0.55 0.016 245);
  --line: oklch(0.912 0.005 235);
  --line-strong: oklch(0.852 0.009 235);
  --primary: oklch(0.27 0.06 256);
  --primary-ink: #ffffff;
  --primary-soft: oklch(0.95 0.025 230);
  --brand: oklch(0.27 0.06 256);
  --accent: oklch(0.745 0.152 197);
  --accent-ink: oklch(0.19 0.045 220);
  --accent-soft: oklch(0.95 0.06 197);
  --ok: oklch(0.66 0.12 175);
  --warn: oklch(0.70 0.13 75);
  --danger: oklch(0.60 0.16 22);
  --radius: 18px;
  --radius-lg: 24px;
  --radius-sm: 12px;
  --shadow-sm: 0 2px 6px oklch(0.25 0.04 250 / 0.05);
  --shadow: 0 4px 12px oklch(0.25 0.04 250 / 0.05), 0 20px 50px -26px oklch(0.25 0.04 250 / 0.28);
  --shadow-lg: 0 40px 90px -34px oklch(0.25 0.04 250 / 0.36);
  --display-weight: 600;
  --display-tracking: -0.018em;
}

/* — Estilo 3 · Índigo & Cítrico (cálido, amistoso premium) — */
[data-theme="3"] {
  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-body: "Manrope", system-ui, sans-serif;
  --bg: oklch(0.978 0.006 90);
  --surface: #ffffff;
  --surface-2: oklch(0.974 0.008 85);
  --ink: oklch(0.24 0.035 285);
  --ink-soft: oklch(0.40 0.035 285);
  --muted: oklch(0.56 0.025 285);
  --line: oklch(0.91 0.012 285);
  --line-strong: oklch(0.85 0.02 285);
  --primary: oklch(0.42 0.135 280);
  --primary-ink: #ffffff;
  --primary-soft: oklch(0.95 0.03 285);
  --brand: oklch(0.42 0.135 280);
  --accent: oklch(0.70 0.155 55);
  --accent-ink: #ffffff;
  --accent-soft: oklch(0.95 0.05 65);
  --ok: oklch(0.62 0.13 150);
  --warn: oklch(0.72 0.14 70);
  --danger: oklch(0.60 0.17 25);
  --radius: 14px;
  --radius-lg: 20px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 3px oklch(0.3 0.06 285 / 0.06);
  --shadow: 0 3px 8px oklch(0.3 0.06 285 / 0.05), 0 16px 40px -20px oklch(0.3 0.06 285 / 0.30);
  --shadow-lg: 0 34px 80px -30px oklch(0.3 0.06 285 / 0.38);
  --display-weight: 700;
  --display-tracking: -0.02em;
}

/* ============================================================
   ICON
   ============================================================ */
/* El color/fondo se fija en el div del tema (donde viven las variables),
   no en body (que no las ve). Indispensable para el modo oscuro. */
[data-theme] { background: var(--bg); color: var(--ink); min-height: 100vh; --brand-ink: #ffffff; }
.icon { display: inline-flex; align-items: center; justify-content: center; flex: none; }
.icon svg { width: 100%; height: 100%; display: block; }

/* ============================================================
   APP SHELL
   ============================================================ */
.app-shell {
  display: grid;
  grid-template-columns: 264px 1fr;
  min-height: 100vh;
  background: var(--bg);
}

/* ---------- Sidebar ---------- */
.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--brand);
  color: var(--brand-ink);
  padding: 26px 18px 20px;
  gap: 6px;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 22px; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 11px;
  background: color-mix(in oklch, #fff 14%, transparent);
  display: grid; place-items: center;
  border: 1px solid color-mix(in oklch, #fff 18%, transparent);
}
.brand-mark .icon { color: var(--accent); }
[data-theme="2"] .brand-mark .icon { color: oklch(0.78 0.12 196); }
.brand-word { font-family: var(--font-display); font-weight: var(--display-weight); font-size: 20px; letter-spacing: 0.01em; line-height: 1; }
.brand-word b { color: var(--accent); font-weight: inherit; }
[data-theme="2"] .brand-word b { color: oklch(0.80 0.12 196); }
.brand-sub { font-size: 10.5px; letter-spacing: 0.18em; text-transform: uppercase; color: color-mix(in oklch, #fff 60%, transparent); margin-top: 4px; }

.nav { display: flex; flex-direction: column; gap: 3px; margin-top: 4px; }
.nav-section { font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: color-mix(in oklch, #fff 45%, transparent); padding: 14px 12px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 13px; border-radius: var(--radius-sm);
  color: color-mix(in oklch, #fff 78%, transparent);
  font-size: 14.5px; font-weight: 500; white-space: nowrap;
  transition: background .18s ease, color .18s ease;
  position: relative;
}
.nav-item:hover { background: color-mix(in oklch, #fff 8%, transparent); color: #fff; }
.nav-item.active { background: color-mix(in oklch, #fff 13%, transparent); color: #fff; }
.nav-item.active::before {
  content: ""; position: absolute; left: -18px; top: 50%; transform: translateY(-50%);
  width: 4px; height: 22px; border-radius: 0 4px 4px 0; background: var(--accent);
}
[data-theme="2"] .nav-item.active::before { background: oklch(0.80 0.12 196); }
.nav-item .badge-count {
  margin-left: auto; font-size: 11px; font-weight: 700;
  background: var(--accent); color: var(--accent-ink);
  border-radius: 20px; padding: 1px 8px; min-width: 20px; text-align: center;
}
.sidebar-foot { margin-top: auto; padding: 14px 12px 4px; border-top: 1px solid color-mix(in oklch, #fff 12%, transparent); }
.sidebar-user { display: flex; align-items: center; gap: 11px; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; font-weight: 700; font-size: 14px;
  font-family: var(--font-display);
}
.sidebar-user .who { font-size: 13.5px; font-weight: 600; line-height: 1.2; }
.sidebar-user .role { font-size: 11.5px; color: color-mix(in oklch, #fff 60%, transparent); }

/* ---------- Main / Topbar ---------- */
.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  display: flex; align-items: center; gap: 18px;
  padding: 18px 38px; background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 30;
}
.topbar .crumb { font-size: 13px; color: var(--muted); }
.topbar .crumb b { color: var(--ink); font-weight: 600; }
.topbar-spacer { flex: 1; }
.searchbox {
  display: flex; align-items: center; gap: 9px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 999px; padding: 8px 15px; min-width: 240px; color: var(--muted);
}
.searchbox input { border: none; background: none; outline: none; font-size: 13.5px; color: var(--ink); width: 100%; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; color: var(--ink-soft);
  border: 1px solid var(--line); background: var(--surface);
  transition: background .15s, border-color .15s; position: relative;
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--line-strong); }
.icon-btn .dot { position: absolute; top: 9px; right: 10px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); border: 1.5px solid var(--surface); }

/* Theme switch */
.theme-switch { display: flex; align-items: center; gap: 8px; }
.theme-switch .ts-label { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.theme-seg { display: flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px; gap: 2px; }
.theme-seg button {
  font-size: 12px; font-weight: 600; color: var(--muted);
  padding: 6px 12px; border-radius: 999px; transition: all .16s ease;
  display: flex; align-items: center; gap: 7px;
}
.theme-seg button .sw { width: 11px; height: 11px; border-radius: 50%; }
.theme-seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

.page { padding: 34px 38px 70px; max-width: 1180px; width: 100%; margin: 0 auto; }

/* ---------- Page head ---------- */
.page-head { margin-bottom: 26px; }
.page-head h1 {
  font-family: var(--font-display); font-weight: var(--display-weight);
  letter-spacing: var(--display-tracking); font-size: 30px; margin: 0; line-height: 1.1;
}
.page-head .sub { color: var(--muted); font-size: 14px; margin-top: 7px; }
.page-head .sub b { color: var(--ink-soft); font-weight: 600; }

/* ============================================================
   PRIMITIVES
   ============================================================ */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
}
.card-pad { padding: 22px 24px; }
.card-head { display: flex; align-items: center; gap: 12px; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.card-head h3 { font-family: var(--font-display); font-weight: var(--display-weight); font-size: 17px; margin: 0; letter-spacing: -0.01em; white-space: nowrap; }
.card-head .ch-icon { width: 34px; height: 34px; border-radius: var(--radius-sm); background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; flex: none; }
.card-head .ch-action { margin-left: auto; flex: none; }

.eyebrow { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); font-weight: 600; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 9px; justify-content: center;
  padding: 11px 18px; border-radius: var(--radius); font-size: 14px; font-weight: 600;
  transition: transform .12s ease, box-shadow .15s ease, background .15s ease, border-color .15s;
  border: 1px solid transparent; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: var(--primary-ink); box-shadow: var(--shadow-sm); }
.btn-primary:hover { box-shadow: var(--shadow); }
.btn-accent { background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow-sm); }
.btn-accent:hover { box-shadow: var(--shadow); }
.btn-ghost { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-soft { background: var(--primary-soft); color: var(--primary); }
.btn-soft:hover { background: color-mix(in oklch, var(--primary) 14%, var(--surface)); }
.btn-sm { padding: 8px 13px; font-size: 13px; border-radius: var(--radius-sm); }
.btn-block { width: 100%; }

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; padding: 4px 11px; border-radius: 999px;
  border: 1px solid transparent; white-space: nowrap;
}
.badge .icon { width: 13px; height: 13px; }
.badge-neutral { background: var(--surface-2); color: var(--ink-soft); border-color: var(--line); }
.badge-primary { background: var(--primary-soft); color: var(--primary); }
.badge-accent { background: var(--accent-soft); color: color-mix(in oklch, var(--accent) 75%, black 25%); }
.badge-ok { background: color-mix(in oklch, var(--ok) 14%, var(--surface)); color: color-mix(in oklch, var(--ok) 80%, black); }
.badge-warn { background: color-mix(in oklch, var(--warn) 16%, var(--surface)); color: color-mix(in oklch, var(--warn) 70%, black 35%); }
.badge-danger { background: color-mix(in oklch, var(--danger) 12%, var(--surface)); color: var(--danger); }
.dot-led { width: 7px; height: 7px; border-radius: 50%; }

/* ============================================================
   STAT CARDS (Dirección / Casillero / Paquetes …)
   ============================================================ */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
.stat-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 18px 20px; box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--line-strong); }
.stat-card .sc-top { display: flex; align-items: center; gap: 9px; margin-bottom: 13px; }
.stat-card .sc-icon { width: 30px; height: 30px; border-radius: var(--radius-sm); display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.stat-card .sc-label { font-size: 10.5px; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-card .sc-value { font-family: var(--font-display); font-weight: var(--display-weight); font-size: 22px; line-height: 1.15; letter-spacing: -0.01em; }
.stat-card .sc-value small { font-size: 14px; color: var(--muted); font-family: var(--font-body); font-weight: 500; }
.stat-card .sc-foot { font-size: 12.5px; color: var(--muted); margin-top: 6px; display: flex; align-items: center; gap: 6px; }
.stat-card.accent .sc-icon { background: var(--accent-soft); color: color-mix(in oklch, var(--accent) 78%, black); }
.copy-btn { color: var(--muted); display: inline-flex; padding: 3px; border-radius: 6px; transition: color .15s, background .15s; }
.copy-btn:hover { color: var(--primary); background: var(--primary-soft); }

/* ============================================================
   LOCKER CARD (cómo direccionar tus compras)
   ============================================================ */
.locker {
  display: grid; grid-template-columns: 1.15fr 1fr; gap: 0;
  border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--line);
  box-shadow: var(--shadow); background: var(--surface);
}
.locker-info { padding: 26px 28px; background: var(--brand); color: var(--brand-ink); position: relative; overflow: hidden; }
.locker-info::after {
  content: ""; position: absolute; right: -40px; bottom: -40px; width: 180px; height: 180px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in oklch, var(--accent) 55%, transparent), transparent 70%);
}
.locker-info .eyebrow { color: color-mix(in oklch, #fff 65%, transparent); }
.locker-info h3 { font-family: var(--font-display); font-weight: var(--display-weight); font-size: 21px; margin: 10px 0 6px; position: relative; }
.locker-info p { font-size: 13.5px; color: color-mix(in oklch, #fff 78%, transparent); line-height: 1.55; position: relative; max-width: 320px; }
.locker-info .ship-pill {
  position: relative; display: inline-flex; align-items: center; gap: 8px; margin-top: 16px;
  background: color-mix(in oklch, #fff 14%, transparent); border: 1px solid color-mix(in oklch, #fff 20%, transparent);
  padding: 7px 13px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
}
.locker-addr { padding: 24px 28px; }
.addr-row { display: flex; justify-content: space-between; align-items: flex-start; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.addr-row:last-child { border-bottom: none; }
.addr-row .k { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.addr-row .v { font-size: 15px; font-weight: 600; text-align: right; }
.addr-row .v.mono { font-family: var(--font-display); letter-spacing: 0.02em; }

/* ============================================================
   GRID HELPERS / TIMELINE
   ============================================================ */
.grid-2 { display: grid; grid-template-columns: 1.5fr 1fr; gap: 22px; align-items: start; }
.section-title { display: flex; align-items: center; gap: 10px; margin: 30px 0 16px; }
.section-title h2 { font-family: var(--font-display); font-weight: var(--display-weight); font-size: 19px; margin: 0; letter-spacing: -0.01em; }
.section-title .st-line { flex: 1; height: 1px; background: var(--line); }

.timeline { display: flex; flex-direction: column; }
.tl-item { display: grid; grid-template-columns: 28px 1fr; gap: 14px; padding-bottom: 18px; position: relative; }
.tl-item:not(:last-child)::before { content: ""; position: absolute; left: 13px; top: 26px; bottom: -2px; width: 2px; background: var(--line); }
.tl-dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); z-index: 1; }
.tl-dot.accent { background: var(--accent-soft); color: color-mix(in oklch, var(--accent) 78%, black); }
.tl-body .tl-title { font-size: 14px; font-weight: 600; }
.tl-body .tl-meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

/* ============================================================
   TABS
   ============================================================ */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 22px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: flex; align-items: center; gap: 8px; padding: 12px 16px;
  font-size: 14px; font-weight: 600; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
  transition: color .15s;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--primary); border-bottom-color: var(--accent); }
.tab .tcount { font-size: 11.5px; font-weight: 700; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); border-radius: 20px; padding: 0px 7px; }
.tab.active .tcount { background: var(--accent-soft); color: color-mix(in oklch, var(--accent) 78%, black); border-color: transparent; }

/* ============================================================
   PACKAGE / LIST ROWS
   ============================================================ */
.list { display: flex; flex-direction: column; gap: 12px; }
.pkg {
  display: grid; grid-template-columns: 48px 1fr auto; gap: 16px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow-sm);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s;
}
.pkg:hover { transform: translateY(-1px); box-shadow: var(--shadow); border-color: var(--line-strong); }
.pkg-icon { width: 48px; height: 48px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--primary); display: grid; place-items: center; border: 1px solid var(--line); }
.pkg-main .pkg-store { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.pkg-main .pkg-meta { font-size: 12.5px; color: var(--muted); margin-top: 4px; display: flex; gap: 14px; flex-wrap: wrap; }
.pkg-main .pkg-meta span { display: inline-flex; align-items: center; gap: 5px; }
.pkg-track { font-family: var(--font-display); letter-spacing: 0.02em; white-space: nowrap; }
.pkg-main .pkg-store { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pkg-right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.pkg-amt { font-family: var(--font-display); font-weight: var(--display-weight); font-size: 16px; }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty { text-align: center; padding: 56px 24px; }
.empty .em-ic { width: 64px; height: 64px; border-radius: 50%; background: var(--surface-2); color: var(--muted); display: grid; place-items: center; margin: 0 auto 16px; border: 1px solid var(--line); }
.empty h4 { font-family: var(--font-display); font-weight: var(--display-weight); font-size: 18px; margin: 0 0 6px; }
.empty p { color: var(--muted); font-size: 14px; margin: 0 auto 18px; max-width: 360px; line-height: 1.55; }

/* ============================================================
   FORMS
   ============================================================ */
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.field label .req { color: var(--danger); }
.field input, .field select, .field textarea {
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  padding: 12px 14px; font-size: 14px; background: var(--surface); color: var(--ink);
  outline: none; transition: border-color .15s, box-shadow .15s; width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--primary) 16%, transparent);
}
.field .hint { font-size: 12px; color: var(--muted); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.input-icon { position: relative; }
.input-icon .icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.input-icon input { padding-left: 40px; }

/* ============================================================
   MODAL / DRAWER
   ============================================================ */
.overlay {
  position: fixed; inset: 0; background: oklch(0.2 0.03 260 / 0.42);
  backdrop-filter: blur(3px); z-index: 100; display: flex; justify-content: flex-end;
  animation: fade .2s ease both;
}
.overlay.center { align-items: center; justify-content: center; padding: 24px; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.drawer {
  width: 460px; max-width: 100%; height: 100%; background: var(--surface);
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column;
  animation: slideIn .28s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes slideIn { from { transform: translateX(30px); opacity: .6; } to { transform: none; opacity: 1; } }
.modal {
  width: 520px; max-width: 100%; background: var(--surface); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); animation: popIn .26s cubic-bezier(.2,.8,.2,1) both; overflow: hidden;
}
@keyframes popIn { from { transform: scale(.96) translateY(10px); opacity: .5; } to { transform: none; opacity: 1; } }
.drawer-head, .modal-head { display: flex; align-items: center; gap: 12px; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.drawer-head h3, .modal-head h3 { font-family: var(--font-display); font-weight: var(--display-weight); font-size: 18px; margin: 0; flex: 1; }
.drawer-body { padding: 22px 24px; overflow-y: auto; flex: 1; }
.drawer-foot, .modal-foot { display: flex; gap: 10px; padding: 18px 24px; border-top: 1px solid var(--line); }
.modal-body { padding: 22px 24px; }

/* ============================================================
   AUTH (Login / Registro)
   ============================================================ */
.auth { display: grid; grid-template-columns: 1.05fr 1fr; min-height: 100vh; background: var(--bg); }
.auth-brand {
  background: var(--brand); color: var(--brand-ink); padding: 54px 60px;
  display: flex; flex-direction: column; position: relative; overflow: hidden;
}
.auth-brand::before {
  content: ""; position: absolute; right: -120px; top: -80px; width: 420px; height: 420px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in oklch, var(--accent) 42%, transparent), transparent 68%);
}
.auth-brand::after {
  content: ""; position: absolute; left: -100px; bottom: -120px; width: 360px; height: 360px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in oklch, #fff 12%, transparent), transparent 70%);
}
.auth-brand .ab-top { position: relative; display: flex; align-items: center; gap: 12px; }
.auth-brand .ab-mid { position: relative; margin-top: auto; }
.auth-brand .ab-mid h2 { font-family: var(--font-display); font-weight: var(--display-weight); font-size: 37px; line-height: 1.16; letter-spacing: -0.02em; margin: 0 0 18px; max-width: 460px; text-wrap: balance; }
.auth-brand .ab-mid p { font-size: 15.5px; line-height: 1.6; color: color-mix(in oklch, #fff 80%, transparent); max-width: 400px; }
.auth-feats { position: relative; display: flex; flex-direction: column; gap: 14px; margin-top: 28px; }
.auth-feat { display: flex; align-items: center; gap: 13px; font-size: 14.5px; }
.auth-feat .af-ic { width: 36px; height: 36px; border-radius: 10px; background: color-mix(in oklch, #fff 13%, transparent); border: 1px solid color-mix(in oklch, #fff 18%, transparent); display: grid; place-items: center; color: var(--accent); }
[data-theme="2"] .auth-feat .af-ic { color: oklch(0.82 0.11 196); }
.auth-brand .ab-foot { position: relative; margin-top: 36px; font-size: 12.5px; color: color-mix(in oklch, #fff 55%, transparent); }

.auth-panel { display: flex; align-items: center; justify-content: center; padding: 40px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card .ac-eyebrow { color: var(--accent); }
.auth-card h1 { font-family: var(--font-display); font-weight: var(--display-weight); font-size: 28px; margin: 8px 0 6px; letter-spacing: -0.01em; }
.auth-card .ac-sub { color: var(--muted); font-size: 14px; margin-bottom: 26px; }
.auth-toggle { display: flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px; margin-bottom: 24px; }
.auth-toggle button { flex: 1; padding: 9px; font-size: 13.5px; font-weight: 600; color: var(--muted); border-radius: var(--radius-sm); transition: all .16s; }
.auth-toggle button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.auth-meta { display: flex; justify-content: space-between; align-items: center; font-size: 13px; margin: -4px 0 20px; }
.auth-meta a { color: var(--primary); font-weight: 600; }
.auth-or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; margin: 18px 0; }
.auth-or .st-line { flex: 1; height: 1px; background: var(--line); }

/* ============================================================
   CONTACT
   ============================================================ */
.contact-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 22px; align-items: start; }
.contact-line { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.contact-line:last-child { border-bottom: none; }
.contact-line .cl-ic { width: 42px; height: 42px; border-radius: var(--radius-sm); background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; flex: none; }
.contact-line .cl-k { font-size: 12px; color: var(--muted); }
.contact-line .cl-v { font-size: 15px; font-weight: 600; }
.ticket-row { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 15px 0; border-bottom: 1px solid var(--line); }
.ticket-row:last-child { border-bottom: none; }
.ticket-id { font-family: var(--font-display); font-weight: var(--display-weight); font-size: 13px; color: var(--muted); }
.ticket-subj { font-size: 14.5px; font-weight: 600; }
.ticket-meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

/* ============================================================
   PROFILE
   ============================================================ */
.profile-head { display: flex; align-items: center; gap: 20px; margin-bottom: 26px; }
.profile-av { width: 76px; height: 76px; border-radius: 22px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-family: var(--font-display); font-weight: var(--display-weight); font-size: 30px; flex: none; box-shadow: var(--shadow); }
.profile-head .ph-name { font-family: var(--font-display); font-weight: var(--display-weight); font-size: 24px; }
.profile-head .ph-meta { color: var(--muted); font-size: 14px; margin-top: 4px; display: flex; gap: 16px; flex-wrap: wrap; }
.profile-head .ph-meta span { display: inline-flex; align-items: center; gap: 6px; }

/* ============================================================
   MOBILE NAV (oculto en desktop)
   ============================================================ */
.mobile-nav { display: none; }
.menu-btn { display: none; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1080px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .locker { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .menu-btn { display: grid; }
  .topbar { padding: 14px 18px; }
  .searchbox { display: none; }
  .theme-switch .ts-label { display: none; }
  .page { padding: 22px 18px 100px; }
  .page-head h1 { font-size: 25px; }
  .auth { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .field-row { grid-template-columns: 1fr; }
  .mobile-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
    background: var(--surface); border-top: 1px solid var(--line);
    padding: 8px 6px calc(8px + env(safe-area-inset-bottom)); justify-content: space-around;
    box-shadow: 0 -8px 30px -18px oklch(0.3 0.05 262 / 0.4);
  }
  .mobile-nav .mn-item { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 12px; color: var(--muted); font-size: 10.5px; font-weight: 600; border-radius: var(--radius-sm); }
  .mobile-nav .mn-item.active { color: var(--primary); }
  .mobile-nav .mn-item.active .icon { color: var(--accent); }
  .drawer { width: 100%; }
}
@media (max-width: 560px) {
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .profile-head { flex-direction: column; text-align: center; align-items: center; }
}

/* Drawer slide-out for mobile sidebar */
.sidebar-overlay { display: none; }
@media (max-width: 860px) {
  .sidebar-overlay.open { display: block; position: fixed; inset: 0; z-index: 60; background: oklch(0.2 0.03 260 / 0.45); animation: fade .2s ease; }
  .sidebar.as-drawer { display: flex; position: fixed; left: 0; top: 0; bottom: 0; width: 264px; z-index: 61; animation: slideLeft .26s ease both; }
  @keyframes slideLeft { from { transform: translateX(-100%); } to { transform: none; } }
}

/* ============================================================
   MODO OSCURO  ·  [data-mode="dark"]
   Conserva el --accent del estilo activo
   ============================================================ */
[data-mode="dark"] {
  --bg: oklch(0.168 0.012 252);
  --surface: oklch(0.224 0.014 252);
  --surface-2: oklch(0.268 0.016 252);
  --ink: oklch(0.965 0.004 250);
  --ink-soft: oklch(0.80 0.012 250);
  --muted: oklch(0.64 0.016 250);
  --line: oklch(0.34 0.014 252);
  --line-strong: oklch(0.43 0.018 252);
  --brand: oklch(0.205 0.018 255);
  --primary: oklch(0.74 0.10 212);
  --primary-ink: oklch(0.17 0.02 250);
  --primary-soft: oklch(0.32 0.05 235);
  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.45);
  --shadow: 0 4px 14px oklch(0 0 0 / 0.40), 0 22px 52px -26px oklch(0 0 0 / 0.62);
  --shadow-lg: 0 44px 96px -30px oklch(0 0 0 / 0.72);
}
/* Superficies destacadas que mezclaban con #fff: bajamos su luz en oscuro */
[data-mode="dark"] .topbar { background: var(--surface); }
[data-mode="dark"] .auth-panel { background: var(--bg); }
/* Badges de estado legibles sobre fondo oscuro */
[data-mode="dark"] .badge-neutral { background: var(--surface-2); color: var(--ink-soft); border-color: var(--line-strong); }
[data-mode="dark"] .badge-primary { background: oklch(0.32 0.05 235); color: oklch(0.82 0.09 212); }
[data-mode="dark"] .badge-accent { background: color-mix(in oklch, var(--accent) 22%, transparent); color: color-mix(in oklch, var(--accent) 72%, white); }
[data-mode="dark"] .badge-ok { background: color-mix(in oklch, var(--ok) 20%, transparent); color: color-mix(in oklch, var(--ok) 62%, white); }
[data-mode="dark"] .badge-warn { background: color-mix(in oklch, var(--warn) 20%, transparent); color: color-mix(in oklch, var(--warn) 66%, white); }
[data-mode="dark"] .badge-danger { background: color-mix(in oklch, var(--danger) 22%, transparent); color: color-mix(in oklch, var(--danger) 70%, white); }
[data-mode="dark"] .tab.active .tcount { color: oklch(0.82 0.09 212); }
[data-mode="dark"] input, [data-mode="dark"] select, [data-mode="dark"] textarea { background: var(--surface-2); }
[data-mode="dark"] .overlay { background: oklch(0 0 0 / 0.6); }

/* ============================================================
   DJANGO — input / select widgets
   ============================================================ */
.field-input, .field-select {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 14px;
  background: var(--surface);
  color: var(--ink);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
  font-family: var(--font-body);
}
.field-input:focus, .field-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--primary) 16%, transparent);
}
[data-mode="dark"] .field-input,
[data-mode="dark"] .field-select { background: var(--surface-2); }

/* ============================================================
   ADMIN PANEL — Componentes exclusivos del panel admin
   Tokens compartidos con el design system Estilo 2
   ============================================================ */

/* ---------- Admin floating toasts ---------- */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 340px;
  max-width: calc(100vw - 48px);
  pointer-events: none;
}
.toast-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  pointer-events: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  animation: toastSlideIn .3s cubic-bezier(.2,.8,.2,1) both;
  position: relative;
}
.toast-item .toast-message {
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.4;
  flex: 1;
}
.toast-item .toast-close {
  background: none;
  border: none;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.5;
  padding: 0;
  margin-top: -2px;
  color: inherit;
  transition: opacity 0.15s;
}
.toast-item .toast-close:hover {
  opacity: 1;
}
.toast-success {
  background: color-mix(in oklch, var(--ok) 8%, var(--surface));
  border-color: color-mix(in oklch, var(--ok) 25%, transparent);
  color: color-mix(in oklch, var(--ok) 80%, black);
}
[data-theme="2"] .toast-success {
  color: color-mix(in oklch, var(--ok) 80%, white);
}
.toast-error {
  background: color-mix(in oklch, var(--danger) 8%, var(--surface));
  border-color: color-mix(in oklch, var(--danger) 25%, transparent);
  color: var(--danger);
}
.toast-info {
  background: var(--surface-2);
  border-color: var(--line);
  color: var(--ink-soft);
}

@keyframes toastSlideIn {
  from {
    transform: translateX(40px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}
@keyframes toastSlideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(40px);
    opacity: 0;
  }
}

/* ---------- Admin filter bar ---------- */
.admin-filter-bar {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 8px 12px; margin-bottom: 18px; box-shadow: var(--shadow-sm);
}
.admin-filter-form {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.admin-search {
  display: flex; align-items: center; gap: 8px; flex: 1; min-width: 200px;
}
.admin-filter-form .field-select {
  border-radius: var(--radius-sm); padding: 8px 12px; font-size: 13px;
}

/* ---------- Admin table ---------- */
.admin-table-wrap { overflow-x: auto; }
.admin-table {
  width: 100%; border-collapse: collapse; font-size: 14px;
}
.admin-table thead { position: sticky; top: 0; z-index: 2; }
.admin-table th {
  text-align: left; padding: 13px 18px; font-size: 11.5px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted);
  background: var(--surface-2); border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.admin-table td {
  padding: 14px 18px; border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.admin-table tbody tr { transition: background .12s ease; }
.admin-table tbody tr:hover { background: color-mix(in oklch, var(--accent) 4%, var(--surface)); }
.admin-table tbody tr:last-child td { border-bottom: none; }

/* ---------- Inline state select ---------- */
.admin-inline-select {
  appearance: none; -webkit-appearance: none;
  border: 1px solid transparent; border-radius: 999px;
  padding: 4px 12px; font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all .15s ease;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center;
  padding-right: 26px;
}
.admin-inline-select.badge-warn { background-color: color-mix(in oklch, var(--warn) 16%, var(--surface)); color: color-mix(in oklch, var(--warn) 70%, black 35%); }
.admin-inline-select.badge-accent { background-color: var(--accent-soft); color: color-mix(in oklch, var(--accent) 75%, black 25%); }
.admin-inline-select.badge-ok { background-color: color-mix(in oklch, var(--ok) 14%, var(--surface)); color: color-mix(in oklch, var(--ok) 80%, black); }
.admin-inline-select.badge-danger { background-color: color-mix(in oklch, var(--danger) 12%, var(--surface)); color: var(--danger); }
.admin-inline-select:hover { box-shadow: 0 0 0 2px color-mix(in oklch, var(--accent) 20%, transparent); }
.admin-inline-select:focus { outline: none; box-shadow: 0 0 0 3px color-mix(in oklch, var(--accent) 28%, transparent); }

/* ---------- Admin pagination ---------- */
.admin-pagination {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  padding: 22px 0 8px;
}
.pg-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; height: 36px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; color: var(--muted);
  border: 1px solid var(--line); background: var(--surface);
  transition: all .15s ease; text-decoration: none;
}
.pg-btn:hover { background: var(--surface-2); border-color: var(--line-strong); color: var(--ink); }
.pg-active { background: var(--primary) !important; color: var(--primary-ink) !important; border-color: var(--primary) !important; }
.pg-dots { font-size: 13px; color: var(--muted); padding: 0 4px; }

/* ---------- Admin bar chart ---------- */
.admin-bars { display: flex; flex-direction: column; gap: 14px; }
.admin-bar-row { display: grid; grid-template-columns: 120px 1fr 40px; gap: 14px; align-items: center; }
.admin-bar-track {
  height: 10px; border-radius: 999px; background: var(--surface-2);
  overflow: hidden; border: 1px solid var(--line);
}
.admin-bar-fill {
  height: 100%; border-radius: 999px;
  transition: width .6s cubic-bezier(.2,.8,.2,1);
}
.fill-danger { background: var(--danger); }
.fill-warn { background: var(--warn); }
.fill-accent { background: var(--accent); }
.fill-ok { background: var(--ok); }
.admin-bar-count { font-family: var(--font-display); font-weight: 600; font-size: 15px; text-align: right; }

/* ---------- Admin detail grid ---------- */
.admin-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.admin-detail-item { padding: 12px 0; border-bottom: 1px dashed var(--line); }
.admin-detail-item:nth-last-child(-n+2) { border-bottom: none; }
.admin-detail-label { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.admin-detail-value { font-size: 15px; font-weight: 500; }

/* ---------- Admin user row ---------- */
.admin-user-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.admin-user-row:last-child { border-bottom: none; }

/* ---------- Admin stepper (4-step envio) ---------- */
.admin-stepper { display: flex; align-items: flex-start; gap: 0; width: 100%; }
.admin-step {
  display: flex; flex-direction: column; align-items: center; flex: 1;
  position: relative; text-align: center;
}
.step-dot {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; font-size: 13px; font-weight: 700;
  background: var(--surface-2); color: var(--muted);
  border: 2px solid var(--line);
  position: relative; z-index: 1;
  transition: all .3s ease;
}
.step-done .step-dot {
  background: var(--accent); color: var(--accent-ink);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in oklch, var(--accent) 18%, transparent);
}
.step-current .step-dot {
  box-shadow: 0 0 0 6px color-mix(in oklch, var(--accent) 24%, transparent);
  transform: scale(1.1);
}
.step-label {
  margin-top: 10px; font-size: 12.5px; font-weight: 600; color: var(--muted);
}
.step-done .step-label { color: var(--ink); }
.step-line {
  position: absolute; top: 18px; left: calc(50% + 18px); right: calc(-50% + 18px);
  height: 3px; background: var(--line); border-radius: 2px;
}
.step-done .step-line { background: var(--accent); }

/* ---------- Responsive admin ---------- */
@media (max-width: 1080px) {
  .admin-detail-grid { grid-template-columns: 1fr; }
  .admin-bar-row { grid-template-columns: 100px 1fr 36px; }
}
@media (max-width: 860px) {
  .admin-filter-form { flex-direction: column; align-items: stretch; }
  .admin-search { width: 100%; }
  .admin-filter-form .field-select { width: 100% !important; }
  .admin-stepper { flex-direction: column; gap: 8px; align-items: flex-start; }
  .step-line { display: none; }
  .admin-step { flex-direction: row; gap: 12px; }
  .step-label { margin-top: 0; }
}
/* Dark mode admin overrides */
[data-mode="dark"] .admin-table tbody tr:hover { background: color-mix(in oklch, var(--accent) 6%, var(--surface)); }
[data-mode="dark"] .admin-inline-select.badge-warn { background-color: color-mix(in oklch, var(--warn) 20%, transparent); color: color-mix(in oklch, var(--warn) 66%, white); }
[data-mode="dark"] .admin-inline-select.badge-accent { background-color: color-mix(in oklch, var(--accent) 22%, transparent); color: color-mix(in oklch, var(--accent) 72%, white); }
[data-mode="dark"] .admin-inline-select.badge-ok { background-color: color-mix(in oklch, var(--ok) 20%, transparent); color: color-mix(in oklch, var(--ok) 62%, white); }
[data-mode="dark"] .admin-inline-select.badge-danger { background-color: color-mix(in oklch, var(--danger) 22%, transparent); color: color-mix(in oklch, var(--danger) 70%, white); }
[data-mode="dark"] .toast-success { background: color-mix(in oklch, var(--ok) 18%, var(--surface)); color: color-mix(in oklch, var(--ok) 62%, white); }
[data-mode="dark"] .toast-error { background: color-mix(in oklch, var(--danger) 18%, var(--surface)); color: color-mix(in oklch, var(--danger) 70%, white); }

/* ---------- Notifications Dropdown System ---------- */
.notif-dropdown-wrap {
  position: relative;
  display: inline-block;
}
.notif-badge-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  background-color: var(--danger);
  border-radius: 50%;
  border: 2px solid var(--surface);
}
.notif-dropdown-menu {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 320px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 1001;
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: notifIn .2s ease-out;
}
.notif-dropdown-menu.open {
  display: flex;
}
@keyframes notifIn {
  from { transform: translateY(8px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.notif-dropdown-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
  font-size: 14px;
  background: var(--surface-2);
}
.notif-badge-pill {
  font-size: 11px;
  background: color-mix(in oklch, var(--danger) 12%, var(--surface));
  color: var(--danger);
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 500;
}
.notif-dropdown-body {
  max-height: 280px;
  overflow-y: auto;
  scrollbar-width: none;
}
.notif-dropdown-item {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  transition: background-color .15s;
}
.notif-dropdown-item:hover {
  background-color: var(--surface-2);
}
.notif-dropdown-item.unread {
  background-color: color-mix(in oklch, var(--primary) 4%, var(--surface));
}
.notif-dropdown-item.unread:hover {
  background-color: color-mix(in oklch, var(--primary) 8%, var(--surface));
}
.notif-item-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface-3);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: var(--primary);
}
.notif-item-icon.success {
  background: color-mix(in oklch, var(--ok) 12%, var(--surface-2));
  color: var(--ok);
}
.notif-item-icon.warning {
  background: color-mix(in oklch, var(--warning) 12%, var(--surface-2));
  color: var(--warning);
}
.notif-item-icon.danger {
  background: color-mix(in oklch, var(--danger) 12%, var(--surface-2));
  color: var(--danger);
}
.notif-item-content {
  flex: 1;
}
.notif-item-title {
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 2px;
}
.notif-item-desc {
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.3;
  margin-bottom: 4px;
}
.notif-item-time {
  font-size: 10px;
  color: var(--muted);
}
.notif-dropdown-empty {
  padding: 24px;
  text-align: center;
  color: var(--muted);
}
.notif-dropdown-empty p {
  font-size: 13px;
  margin-top: 8px;
  font-weight: 500;
}
.notif-dropdown-foot {
  padding: 10px;
  text-align: center;
  background: var(--surface-2);
  border-top: 1px solid var(--line);
  font-size: 12px;
  font-weight: 600;
}
.notif-dropdown-foot a {
  text-decoration: none;
  color: var(--primary);
}
.notif-dropdown-foot a:hover {
  color: color-mix(in oklch, var(--primary) 80%, black);
}

/* ==================== AVATAR PRESET GRADIENTS ==================== */
.avatar.preset-1 { background: linear-gradient(135deg, #00c6ff, #0072ff) !important; color: #ffffff !important; text-shadow: 0 1px 2px rgba(0,0,0,0.15); }
.avatar.preset-2 { background: linear-gradient(135deg, #7028e4, #e5b2ca) !important; color: #ffffff !important; text-shadow: 0 1px 2px rgba(0,0,0,0.15); }
.avatar.preset-3 { background: linear-gradient(135deg, #f12711, #f5af19) !important; color: #ffffff !important; text-shadow: 0 1px 2px rgba(0,0,0,0.15); }
.avatar.preset-4 { background: linear-gradient(135deg, #11998e, #38ef7d) !important; color: #ffffff !important; text-shadow: 0 1px 2px rgba(0,0,0,0.15); }
.avatar.preset-5 { background: linear-gradient(135deg, #ff416c, #ff4b2b) !important; color: #ffffff !important; text-shadow: 0 1px 2px rgba(0,0,0,0.15); }
.avatar.preset-6 { background: linear-gradient(135deg, #f857a6, #ff5858) !important; color: #ffffff !important; text-shadow: 0 1px 2px rgba(0,0,0,0.15); }
.avatar.preset-7 { background: linear-gradient(135deg, #606c88, #3f4c6b) !important; color: #ffffff !important; text-shadow: 0 1px 2px rgba(0,0,0,0.15); }
.avatar.preset-8 { background: linear-gradient(135deg, #ff7e5f, #feb47b) !important; color: #ffffff !important; text-shadow: 0 1px 2px rgba(0,0,0,0.15); }

/* ==================== AVATAR INTERACTIVE PICKER ==================== */
.avatar-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
  gap: 12px;
  margin-top: 8px;
}
.avatar-picker-option {
  position: relative;
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}
.avatar-picker-option:hover {
  background: var(--surface-3);
  border-color: var(--ink-soft);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.avatar-picker-input-wrapper input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.avatar-picker-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
}
.avatar-picker-option:has(input[type="radio"]:checked) {
  background: var(--surface);
  border-color: var(--primary);
  box-shadow: 0 0 0 2px color-mix(in oklch, var(--primary) 25%, transparent), var(--shadow-md);
  transform: scale(1.05);
}
.avatar-picker-option:has(input[type="radio"]:checked) .avatar {
  transform: scale(1.15);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}
.avatar-picker-option:has(input[type="radio"]:checked) .avatar-picker-name {
  color: var(--primary) !important;
  font-weight: 700 !important;
}

/* Breadcrumb Hover Effects */
.topbar .crumb a {
  text-decoration: none;
  color: inherit;
  transition: color 0.15s ease;
}
.topbar .crumb a:hover {
  color: var(--primary);
}

/* ==================== PREMIUM TABLES & PAGINATION ==================== */
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 10px;
}
.table th {
  background: var(--surface-2);
  color: var(--ink-soft);
  font-weight: 700;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 14px 18px;
  border-bottom: 2px solid var(--line);
  text-align: left;
}
.table td {
  padding: 14px 18px;
  font-size: 13.5px;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  background: var(--surface);
  transition: all 0.15s ease;
}
.table tr {
  transition: all 0.15s ease;
}
.table tbody tr:hover td {
  background: var(--surface-2);
  color: var(--primary);
}
.table tbody tr:hover td:first-child {
  box-shadow: inset 3px 0 0 var(--accent);
}
.table td code {
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-display);
  font-size: 12px;
}

/* Pagination styles */
.admin-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 20px;
}
.pg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 600;
  transition: all 0.2s ease;
  cursor: pointer;
  text-decoration: none;
}
.pg-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-ink);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.pg-btn.pg-active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-ink);
  box-shadow: var(--shadow-sm);
  cursor: default;
}
.pg-dots {
  color: var(--muted);
  font-size: 15px;
  padding: 0 4px;
}

/* ==================== PREMIUM CUSTOM SCROLLBARS ==================== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 99px;
  border: 1px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

/* Support for Firefox standard thin scrollbars */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

/* Premium Pagination Footer Styles */
.admin-pagination-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  flex-wrap: wrap;
  gap: 16px;
}
.admin-pagination-info {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}
.admin-pagination-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.admin-pagination-pages {
  display: flex;
  align-items: center;
  gap: 6px;
}
.admin-pagination-size {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ==================== HEADER TABLE FILTERS (Premium) ==================== */
.table-filter-row td {
  padding: 6px 10px !important;
  background: color-mix(in oklch, var(--accent) 2%, var(--surface)) !important;
  border-bottom: 2px solid color-mix(in oklch, var(--accent) 18%, var(--line)) !important;
  border-top: 1px solid var(--line) !important;
  vertical-align: middle;
}

/* Ghost-style text inputs — borderless until hover/focus */
.header-filter-input {
  width: 100%;
  padding: 7px 10px;
  font-size: 12.5px;
  font-weight: 500;
  font-family: inherit;
  color: var(--ink);
  background: transparent;
  border: none;
  border-bottom: 1.5px solid var(--line);
  border-radius: 0;
  transition: border-color 0.2s ease, background 0.2s ease;
  min-width: 50px;
}
.header-filter-input::placeholder {
  color: color-mix(in oklch, var(--muted) 60%, transparent);
  font-weight: 400;
  font-style: italic;
}
.header-filter-input:hover {
  border-color: var(--line-strong);
  background: color-mix(in oklch, var(--accent) 3%, transparent);
}
.header-filter-input:focus {
  outline: none;
  border-color: var(--accent);
  background: color-mix(in oklch, var(--accent) 4%, transparent);
}

/* Compact date input pair */
.filter-date-pair {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 110px;
}
.filter-date-pair .header-filter-input {
  padding: 4px 6px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

/* Ghost-style select */
.header-filter-select {
  width: 100%;
  padding: 6px 22px 6px 8px;
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  color: var(--ink);
  background: transparent;
  border: none;
  border-bottom: 1.5px solid var(--line);
  border-radius: 0;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
  min-width: 75px;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2399a1af' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
}
.header-filter-select:hover {
  border-color: var(--line-strong);
  background: color-mix(in oklch, var(--accent) 3%, transparent);
}
.header-filter-select:focus {
  outline: none;
  border-color: var(--accent);
}

/* Filter action buttons */
.filter-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: center;
}
.btn-filter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn-filter-primary {
  background: var(--accent);
  color: white;
}
.btn-filter-primary:hover {
  background: color-mix(in oklch, var(--accent) 85%, black 15%);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px color-mix(in oklch, var(--accent) 25%, transparent);
}
.btn-filter-clear {
  background: transparent;
  color: var(--muted);
  padding: 5px 6px;
}
.btn-filter-clear:hover {
  color: var(--danger);
  background: color-mix(in oklch, var(--danger) 8%, transparent);
}

.btn-xs {
  padding: 4px 8px;
  font-size: 11px;
  border-radius: var(--radius-xs);
}




