/* ==========================================================================
   DTS Taller - Estilos compartidos
   ========================================================================== */

/* ============ TOKENS DE DISEÑO ============ */
:root {
  --accent: #ff6a00;
  --accent-soft: #fff1e7;
  --accent-dark: #d95500;
  --bg: #fafafa;
  --surface: #ffffff;
  --surface-2: #f5f5f7;
  --border: #e8e8ec;
  --border-strong: #d4d4d9;
  --ink: #1a1a1f;
  --ink-2: #545459;
  --ink-3: #86868b;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.04), 0 1px 3px rgba(0,0,0,.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,.06), 0 1px 3px rgba(0,0,0,.04);
  --shadow-lg: 0 12px 32px rgba(0,0,0,.08);
  --green: #2ea043;
  --green-soft: #e6f4ea;
  --yellow: #c8901e;
  --yellow-soft: #fdf3d8;
  --red: #d8453a;
  --red-soft: #fce8e6;
  --blue: #0969da;
  --blue-soft: #ddf4ff;
  --purple: #8957e5;
  --purple-soft: #f0e6ff;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', monospace;
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
}
.dark {
  --bg: #0e0f10;
  --surface: #18191b;
  --surface-2: #1f2023;
  --border: #2a2b2f;
  --border-strong: #3a3b40;
  --ink: #f1f1f3;
  --ink-2: #b4b4ba;
  --ink-3: #818187;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,.4);
  --shadow-lg: 0 12px 32px rgba(0,0,0,.5);
  --green-soft: rgba(46,160,67,.15);
  --yellow-soft: rgba(200,144,30,.18);
  --red-soft: rgba(216,69,58,.15);
  --blue-soft: rgba(9,105,218,.15);
  --purple-soft: rgba(137,87,229,.15);
  --accent-soft: rgba(255,106,0,.14);
}

/* ============ BASE ============ */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; font-size: 15px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============ HEADER ============ */
.hdr {
  position: sticky; top: 0; z-index: 50;
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 12px 16px; display: flex; align-items: center; justify-content: space-between;
  backdrop-filter: saturate(180%) blur(20px);
}
.hdr-left { display: flex; align-items: center; gap: 10px; }
.logo {
  width: 36px; height: 36px;
  border-radius: 8px; overflow: hidden;
  background: #000;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.brand-sub { font-size: 15px; font-weight: 600; color: var(--ink); letter-spacing: -.3px; }
.brand-sub .accent { color: var(--accent); }

/* ============ SPLASH SCREEN (carga inicial) ============ */
.splash {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 24px;
  transition: opacity .4s ease, visibility .4s;
}
.splash.hide { opacity: 0; visibility: hidden; pointer-events: none; }
.splash-logo {
  width: 140px; height: 140px;
  border-radius: 28px;
  background: #000;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0,0,0,.18), 0 4px 12px rgba(0,0,0,.1);
  animation: splashPulse 1.8s ease-in-out infinite;
}
.splash-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.splash-text {
  font-size: 13px; color: var(--ink-3); font-weight: 500;
  display: flex; align-items: center; gap: 8px;
}
@keyframes splashPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 20px 50px rgba(0,0,0,.18), 0 4px 12px rgba(0,0,0,.1); }
  50%      { transform: scale(1.05); box-shadow: 0 28px 60px rgba(255,106,0,.25), 0 6px 18px rgba(255,106,0,.15); }
}
.hdr-right { display: flex; gap: 8px; align-items: center; }
.hdr-back {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 8px;
  font-size: 13px; font-weight: 600; color: var(--ink-2);
  transition: background .15s;
}
.hdr-back:hover { background: var(--surface-2); }
.icon-btn {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; font-size: 16px;
  background: var(--surface-2); border: 1px solid var(--border);
  transition: background .15s;
}
.icon-btn:hover { background: var(--border); }

/* ============ USER CHIP (header) ============ */
.user-chip {
  position: relative;
  display: flex; align-items: center; gap: 8px;
  padding: 4px 10px 4px 4px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border);
  cursor: pointer; transition: background .15s; user-select: none;
}
.user-chip:hover { background: var(--border); }
.user-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent); color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; flex-shrink: 0;
}
.user-info { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 120px; }
.user-role { font-size: 10px; color: var(--ink-3); font-weight: 500; white-space: nowrap; }
@media (max-width: 600px) { .user-info { display: none; } }
.user-menu {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-sm); box-shadow: var(--shadow-lg);
  padding: 4px; min-width: 200px;
  display: none; z-index: 100;
}
.user-menu.open { display: block; }
.user-menu-item {
  display: block; width: 100%; text-align: left;
  padding: 9px 12px; border-radius: 6px;
  font-size: 13px; font-weight: 500; color: var(--ink);
  text-decoration: none; background: transparent; border: none;
  cursor: pointer;
}
.user-menu-item:hover { background: var(--surface-2); text-decoration: none; }
.user-menu-item.logout { color: var(--red); }
.user-menu-item.logout:hover { background: var(--red-soft); }

/* ============ LOGIN PAGE ============ */
.login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 20px; background: var(--bg);
}
.login-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 36px 32px;
  max-width: 380px; width: 100%;
  box-shadow: var(--shadow-lg);
}
.login-logo {
  width: 90px; height: 90px;
  margin: 0 auto 20px;
  border-radius: 22px; background: #000;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,.12);
}
.login-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.login-title {
  text-align: center; font-size: 22px; font-weight: 700;
  letter-spacing: -.5px; margin-bottom: 4px;
}
.login-subtitle {
  text-align: center; color: var(--ink-3); font-size: 13px;
  margin-bottom: 28px;
}
.login-error {
  background: var(--red-soft); color: var(--red);
  padding: 10px 12px; border-radius: var(--r-sm);
  font-size: 13px; font-weight: 500;
  margin-bottom: 14px;
  display: none;
}
.login-error.show { display: block; }
.login-footer {
  margin-top: 20px; text-align: center;
  font-size: 11px; color: var(--ink-3);
}

/* ============ LAYOUT ============ */
main { max-width: 720px; margin: 0 auto; padding: 16px; padding-bottom: 100px; }
main.wide { max-width: 1200px; }
@media (min-width: 768px) { main { padding: 24px; } }

/* ============ SETUP (Supabase config) ============ */
.setup {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: 14px; margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.setup-hdr { display: flex; justify-content: space-between; align-items: center; cursor: pointer; }
.setup-hdr h3 { margin: 0; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.setup-status { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); }
.status-dot.ok { background: var(--green); }
.status-dot.err { background: var(--red); }
.setup-body { display: none; padding-top: 12px; gap: 8px; }
.setup.open .setup-body { display: flex; flex-direction: column; }

/* ============ CARDS ============ */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 18px; margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.card h2 {
  margin: 0 0 4px; font-size: 18px; font-weight: 700; letter-spacing: -.3px;
}
.card .subtitle {
  color: var(--ink-3); font-size: 13px; margin-bottom: 16px;
}

/* ============ FORM ============ */
.field { margin-bottom: 14px; }
.field label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--ink-2); margin-bottom: 6px; letter-spacing: -.1px;
}
.field label .req { color: var(--red); margin-left: 2px; }
.inp, select.inp, textarea.inp {
  width: 100%; padding: 11px 12px; font-size: 15px;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none; appearance: none;
}
.inp:focus, select.inp:focus, textarea.inp:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
textarea.inp { resize: vertical; min-height: 70px; }
select.inp {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%23545459' d='M6 8L0 2l1.5-1.5L6 5l4.5-4.5L12 2z'/></svg>");
  background-repeat: no-repeat; background-position: right 12px center;
  padding-right: 36px;
}
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.row-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 600px) {
  .row, .row-3, .row-4 { grid-template-columns: 1fr; }
}

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: var(--r-sm); font-weight: 600; font-size: 14px;
  transition: all .15s; min-height: 42px;
  letter-spacing: -.1px;
}
.btn-primary {
  background: var(--accent); color: white;
  box-shadow: 0 1px 2px rgba(255,106,0,.3);
}
.btn-primary:hover { background: var(--accent-dark); }
.btn-primary:disabled { background: var(--ink-3); cursor: not-allowed; box-shadow: none; }
.btn-secondary {
  background: var(--surface); color: var(--ink); border: 1px solid var(--border-strong);
}
.btn-secondary:hover { background: var(--surface-2); }
.btn-ghost { color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--red); color: white; }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 12px; font-size: 13px; min-height: 32px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.actions.between { justify-content: space-between; }

/* ============ TABLES ============ */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-sm); }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.tbl th { background: var(--surface-2); font-weight: 600; font-size: 12px; color: var(--ink-2); text-transform: uppercase; letter-spacing: .5px; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr { cursor: pointer; transition: background .1s; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl tbody tr.selected { background: var(--accent-soft); }
.tbl .empty { padding: 24px; text-align: center; color: var(--ink-3); }

/* ============ BADGES / PILLS ============ */
.pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 600;
}
.pill-accent { background: var(--accent-soft); color: var(--accent-dark); }
.dark .pill-accent { color: var(--accent); }
.pill-green { background: var(--green-soft); color: var(--green); }
.pill-green-light { background: #c8f0d0; color: #1b6e2b; }
.dark .pill-green-light { background: rgba(46,160,67,.25); color: #4ed366; }
.pill-yellow { background: var(--yellow-soft); color: var(--yellow); }
.pill-red { background: var(--red-soft); color: var(--red); }
.pill-blue { background: var(--blue-soft); color: var(--blue); }
.pill-purple { background: var(--purple-soft); color: var(--purple); }
.pill-neutral { background: var(--surface-2); color: var(--ink-2); }

/* ============ SWITCH GROUP (diagnóstico) ============ */
.switches { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
@media (max-width: 480px) { .switches { grid-template-columns: 1fr; } }
.switch-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--r-sm);
  cursor: pointer; transition: all .15s; user-select: none;
}
.switch-item:hover { border-color: var(--border-strong); }
.switch-item.on { background: var(--accent-soft); border-color: var(--accent); }
.dark .switch-item.on { color: var(--accent); }
.switch-item .knob {
  width: 36px; height: 20px; border-radius: 999px; background: var(--border-strong);
  position: relative; transition: background .15s; flex-shrink: 0;
}
.switch-item .knob::after {
  content: ''; position: absolute; left: 2px; top: 2px;
  width: 16px; height: 16px; border-radius: 50%; background: white;
  transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.switch-item.on .knob { background: var(--accent); }
.switch-item.on .knob::after { transform: translateX(16px); }
.switch-item span { font-size: 13px; font-weight: 500; }

/* ============ DIVIDER ============ */
.divider {
  display: flex; align-items: center; gap: 12px; margin: 20px 0 14px;
  color: var(--ink-3); font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .8px;
}
.divider::before, .divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* ============ FILE PICKER ============ */
.file-picker-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (max-width: 380px) {
  .file-picker-row { grid-template-columns: 1fr; }
}
.file-picker {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  min-height: 110px;
  padding: 20px;
  border: 2px dashed var(--border-strong);
  border-radius: var(--r);
  background: var(--surface-2);
  cursor: pointer;
  transition: all .15s;
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
}
.file-picker:hover { border-color: var(--accent); background: var(--accent-soft); }
.file-picker input[type="file"] {
  position: absolute !important;
  width: 1px !important; height: 1px !important;
  padding: 0 !important; margin: -1px !important;
  overflow: hidden !important; clip: rect(0,0,0,0) !important;
  white-space: nowrap !important; border: 0 !important;
  opacity: 0 !important; pointer-events: none !important;
}
.file-picker > .icon { font-size: 28px; line-height: 1; margin-bottom: 6px; }
.file-picker > .label { font-size: 14px; font-weight: 600; color: var(--ink); }
.file-picker > .hint { font-size: 12px; color: var(--ink-3); margin-top: 4px; }

/* ============ PHOTO GRID ============ */
.photo-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px; margin-top: 12px;
}
.photo-grid:empty { display: none; }
.photo-item {
  position: relative; aspect-ratio: 1; border-radius: var(--r-sm); overflow: hidden;
  background: var(--surface-2); border: 1px solid var(--border);
}
.photo-item img { width: 100%; height: 100%; object-fit: cover; }
.photo-item .cat {
  position: absolute; bottom: 4px; left: 4px;
  background: rgba(0,0,0,.7); color: white; font-size: 10px;
  padding: 2px 6px; border-radius: 4px; font-weight: 600;
}
.photo-item .del {
  position: absolute; top: 4px; right: 4px;
  background: rgba(0,0,0,.7); color: white;
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; cursor: pointer;
}

/* ============ MODAL ============ */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  display: none; align-items: flex-start; justify-content: center;
  z-index: 100; padding: 20px; overflow-y: auto;
  backdrop-filter: blur(8px);
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--surface); border-radius: var(--r-lg);
  max-width: 540px; width: 100%; padding: 22px;
  box-shadow: var(--shadow-lg); margin: auto;
}
.modal h3 { margin: 0 0 16px; font-size: 18px; font-weight: 700; }

/* ============ TOASTS ============ */
.toasts {
  position: fixed; top: 70px; left: 50%; transform: translateX(-50%);
  z-index: 200; display: flex; flex-direction: column; gap: 8px;
  pointer-events: none; max-width: 90vw;
}
.toast {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; padding: 8px 16px; font-size: 13px; font-weight: 500;
  box-shadow: var(--shadow-lg); animation: slideIn .25s ease;
  display: flex; align-items: center; gap: 8px;
}
.toast.success { border-color: var(--green); color: var(--green); }
.toast.error { border-color: var(--red); color: var(--red); }
.toast.warn { border-color: var(--yellow); color: var(--yellow); }
@keyframes slideIn { from { transform: translateY(-10px); opacity: 0; } }

/* ============ AUTOCOMPLETE ============ */
.ac-list {
  position: absolute; top: 100%; left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--r-sm); margin-top: 4px;
  box-shadow: var(--shadow-lg); z-index: 30;
  max-height: 280px; overflow-y: auto;
}
.ac-item {
  padding: 10px 12px; cursor: pointer; border-bottom: 1px solid var(--border);
  transition: background .1s;
}
.ac-item:last-child { border-bottom: none; }
.ac-item:hover, .ac-item.highlight { background: var(--accent-soft); }
.dark .ac-item:hover, .dark .ac-item.highlight { color: var(--accent); }
.ac-item .ac-name { font-weight: 600; font-size: 14px; }
.ac-item .ac-rfc { font-family: var(--mono); font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.ac-item mark {
  background: var(--accent-soft); color: var(--accent-dark); padding: 0 2px;
  border-radius: 3px; font-weight: 700;
}
.dark .ac-item mark { color: var(--accent); }
.ac-empty { padding: 14px; text-align: center; color: var(--ink-3); font-size: 13px; }

/* ============ MENU CARDS (para index.html) ============ */
.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 20px;
}
.menu-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 22px;
  text-decoration: none; color: var(--ink);
  transition: all .15s; cursor: pointer;
  display: flex; flex-direction: column; gap: 8px;
  box-shadow: var(--shadow-sm);
}
.menu-card:hover {
  transform: translateY(-2px); border-color: var(--accent);
  box-shadow: var(--shadow-md); text-decoration: none;
}
.menu-card .mc-icon {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--accent-soft); color: var(--accent-dark);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; margin-bottom: 8px;
}
.dark .menu-card .mc-icon { color: var(--accent); }
.menu-card .mc-title {
  font-size: 16px; font-weight: 700; letter-spacing: -.2px;
}
.menu-card .mc-desc {
  font-size: 13px; color: var(--ink-3); line-height: 1.4;
}

/* ============ STEPPER (wizard) ============ */
.stepper {
  display: flex; gap: 4px; margin-bottom: 24px;
  background: var(--surface); padding: 6px; border-radius: var(--r);
  border: 1px solid var(--border); overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.step-pill {
  flex: 1; min-width: 90px; padding: 10px 12px; border-radius: 8px;
  font-size: 12px; font-weight: 600; color: var(--ink-3);
  display: flex; align-items: center; gap: 8px;
  white-space: nowrap;
  transition: all .15s;
}
.step-pill .n {
  width: 22px; height: 22px; border-radius: 50%; background: var(--surface-2);
  color: var(--ink-3); display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; border: 1px solid var(--border);
}
.step-pill.active { background: var(--accent-soft); color: var(--accent-dark); }
.dark .step-pill.active { color: var(--accent); }
.step-pill.active .n { background: var(--accent); color: white; border-color: var(--accent); }
.step-pill.done { color: var(--green); }
.step-pill.done .n { background: var(--green); color: white; border-color: var(--green); }

/* ============ SUCCESS / FOLIO DISPLAY ============ */
.success-card { text-align: center; padding: 40px 20px; }
.success-icon {
  width: 64px; height: 64px; margin: 0 auto 16px;
  background: var(--green-soft); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; color: var(--green);
}
.folio-display {
  font-family: var(--mono); font-size: 28px; font-weight: 700;
  color: var(--accent); letter-spacing: 1px; margin: 12px 0 20px;
}

/* ============ FILTERS BAR (para dashboard) ============ */
.filters {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  background: var(--surface); padding: 12px; border-radius: var(--r);
  border: 1px solid var(--border); margin-bottom: 16px;
}
.filter-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 500;
  background: var(--surface-2); border: 1px solid var(--border);
  cursor: pointer; transition: all .15s; user-select: none;
}
.filter-chip:hover { border-color: var(--border-strong); }
.filter-chip.active {
  background: var(--accent-soft); color: var(--accent-dark);
  border-color: var(--accent);
}
.dark .filter-chip.active { color: var(--accent); }
.filter-chip .count {
  background: rgba(0,0,0,.1); padding: 1px 6px; border-radius: 999px;
  font-size: 11px; font-weight: 700;
}
.dark .filter-chip .count { background: rgba(255,255,255,.1); }

/* ============ STATS ============ */
.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px; margin-bottom: 16px;
}
.stat {
  background: var(--surface); border: 1px solid var(--border);
  padding: 14px; border-radius: var(--r); box-shadow: var(--shadow-sm);
}
.stat .label { font-size: 12px; color: var(--ink-3); font-weight: 600;
  text-transform: uppercase; letter-spacing: .5px; margin-bottom: 4px; }
.stat .value { font-size: 24px; font-weight: 700; letter-spacing: -.5px; }
.stat .value.accent { color: var(--accent); }
.stat .value.green { color: var(--green); }
.stat .value.yellow { color: var(--yellow); }
.stat .value.red { color: var(--red); }

/* ============ UTILITY ============ */
.hidden { display: none !important; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.text-muted { color: var(--ink-3); font-size: 13px; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.flex { display: flex; }
.flex-1 { flex: 1; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.mono { font-family: var(--mono); }
.spinner {
  display: inline-block; width: 14px; height: 14px;
  border: 2px solid var(--border-strong); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
