/* ============================================
   FORJA — Gym Management Prototype
   Athletic black + acid yellow energetic theme
   ============================================ */

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

:root {
  /* White-first surface, deep navy ink, electric blue accent */
  --bg: #FFFFFF;
  --bg-1: #FFFFFF;
  --bg-2: #F4F6FB;
  --bg-3: #ECF0F7;
  --line: #E3E8F1;
  --line-strong: #C9D2E0;
  --ink: #0B1220;
  --ink-2: #2A3447;
  --ink-3: #6B7790;
  --ink-4: #A6AFC2;

  --accent: #1E5BFF;
  --accent-2: #1746CC;
  --accent-soft: #E8EFFF;
  --accent-ink: #FFFFFF;

  --black: #0B1220;

  --ok: #1E5BFF;
  --warn: #B45309;
  --bad: #B91C1C;
  --ghost: #6B7790;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;

  --font-sans: 'Archivo', system-ui, sans-serif;
  --font-display: 'Archivo Narrow', 'Archivo', sans-serif;
  --font-mono: 'JetBrains Mono', 'Menlo', monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.45;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; }
input, select, textarea { font-family: inherit; }

::selection { background: var(--accent); color: var(--accent-ink); }

/* ============== APP SHELL ============== */
.app {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
}

/* ============== SIDEBAR ============== */
.sidebar {
  background: var(--black);
  color: #FFFFFF;
  border-right: 1px solid var(--black);
  display: flex;
  flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.sidebar .nav-section { color: rgba(255,255,255,0.45); }
.sidebar .nav-item { color: rgba(255,255,255,0.72); }
.sidebar .nav-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.sidebar .nav-item.active { background: rgba(255,255,255,0.08); color: #fff; }
.sidebar .nav-item.active::before { background: var(--accent); }
.sidebar .nav-item.active .ico { color: var(--accent); }
.sidebar .nav-item .badge { background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.85); }
.sidebar .nav-item.active .badge { background: var(--accent); color: var(--accent-ink); }
.brand {
  padding: 22px 22px 18px;
  display: flex;
  align-items: baseline;
  gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.brand-mark {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 18px;
  letter-spacing: -0.01em;
  color: #FFFFFF;
  line-height: 1.05;
  text-transform: uppercase;
}
.brand-mark .accent { color: var(--accent); }
.brand-tag {
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.15em;
  margin-left: auto;
  border: 1px solid rgba(255,255,255,0.12);
  padding: 3px 6px;
  border-radius: 3px;
}

.nav {
  flex: 1;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-section {
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-3);
  padding: 14px 12px 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  font-weight: 500;
  font-size: 13px;
  cursor: pointer;
  border: none;
  background: transparent;
  text-align: left;
  width: 100%;
  transition: background .12s, color .12s;
}
.nav-item:hover { background: var(--bg-2); color: var(--ink); }
.nav-item.active {
  background: var(--bg-2);
  color: var(--ink);
  position: relative;
}
.nav-item.active::before {
  content: '';
  position: absolute; left: 0; top: 8px; bottom: 8px;
  width: 3px;
  background: var(--accent);
  border-radius: 2px;
}
.nav-item .ico { width: 18px; height: 18px; flex: 0 0 18px; opacity: .8; }
.nav-item.active .ico { opacity: 1; color: var(--accent); }
.nav-item .badge {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10px;
  background: var(--bg-3);
  padding: 2px 6px;
  border-radius: 3px;
  color: var(--ink-2);
}
.nav-item.active .badge { background: var(--accent); color: var(--accent-ink); }

.sidebar-foot {
  padding: 14px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-chip {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  font-family: var(--font-display);
}
.user-meta { display: flex; flex-direction: column; line-height: 1.1; }
.user-meta .n { font-size: 12px; color: #FFFFFF; font-weight: 600; }
.user-meta .r { font-size: 10px; color: rgba(255,255,255,0.5); font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .12em; }

/* ============== MAIN ============== */
.main { display: flex; flex-direction: column; min-width: 0; }

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 28px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  position: sticky; top: 0; z-index: 10;
}
.topbar .title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}
.topbar .clock {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-2);
  display: flex; gap: 14px; align-items: center;
}
.clock .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); }

.checkin-quick {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px 8px 14px;
  background: var(--accent);
  color: var(--accent-ink);
  border: none;
  border-radius: var(--radius);
  font-weight: 800;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: transform .08s;
}
.checkin-quick:hover { transform: translateY(-1px); }
.checkin-quick:active { transform: translateY(0); }
.checkin-quick .ico { width: 16px; height: 16px; }

.content {
  padding: 28px;
  max-width: 1500px;
  width: 100%;
}

/* ============== HEADLINE ROW ============== */
.headline {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
.hero {
  background: var(--black);
  color: #FFFFFF;
  border: 1px solid var(--black);
  border-radius: var(--radius-lg);
  padding: 28px 28px 24px;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: '';
  position: absolute; right: -60px; top: -60px;
  width: 260px; height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(30,91,255,0.55) 0%, transparent 70%);
  pointer-events: none;
}
.hero p { color: rgba(255,255,255,0.7) !important; }
.hero .hero-meta { border-top-color: rgba(255,255,255,0.1) !important; }
.hero .hero-meta .item .l { color: rgba(255,255,255,0.5) !important; }
.hero .hero-meta .item .v { color: #FFFFFF; }
.hero .eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent);
  margin-bottom: 10px;
}
.hero h1 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
  text-transform: uppercase;
  text-wrap: balance;
}
.hero h1 .accent { color: var(--accent); }
.hero p { color: var(--ink-2); font-size: 13px; margin: 0; max-width: 420px; }

.hero-meta {
  display: flex; gap: 24px; margin-top: 20px;
  padding-top: 18px; border-top: 1px solid var(--line);
}
.hero-meta .item .l { font-family: var(--font-mono); font-size: 9px; text-transform: uppercase; letter-spacing: .15em; color: var(--ink-3); }
.hero-meta .item .v { font-family: var(--font-display); font-size: 22px; font-weight: 800; line-height: 1.1; }
.hero-meta .item .v.accent { color: var(--accent); }

/* ============== KPI CARDS ============== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.kpi {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
  transition: border-color .15s;
}
.kpi:hover { border-color: var(--line-strong); }
.kpi .label {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--ink-3);
  display: flex; align-items: center; gap: 6px;
}
.kpi .label .ico { width: 12px; height: 12px; }
.kpi .value {
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 900;
  line-height: 1;
  margin-top: 6px;
  letter-spacing: -0.02em;
}
.kpi .delta {
  font-family: var(--font-mono);
  font-size: 11px;
  margin-top: 4px;
  color: var(--ink-3);
}
.kpi.accent .value { color: var(--accent); }
.kpi.warn .value { color: var(--warn); }
.kpi.bad .value { color: var(--bad); }
.kpi.ghost .value { color: var(--ghost); }

.kpi .bar {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--ink-4);
}
.kpi.accent .bar { background: var(--accent); }
.kpi.warn .bar { background: var(--warn); }
.kpi.bad .bar { background: var(--bad); }
.kpi.ghost .bar { background: var(--ghost); }

/* ============== PANELS ============== */
.panels {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
}
.panel {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.panel-head {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.panel-head h3 {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.04em;
  margin: 0;
}
.panel-head .count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
}
.panel-head .actions { margin-left: auto; display: flex; gap: 6px; }

.panel-body { padding: 6px 0; }

/* ============== STATUS PILLS ============== */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 1px solid;
  white-space: nowrap;
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; }
.pill.activo      { color: var(--accent); border-color: rgba(30,91,255,0.35); background: rgba(30,91,255,0.08); }
.pill.activo .dot { background: var(--accent); box-shadow: 0 0 6px var(--accent); }
.pill.por_renovar { color: var(--warn); border-color: rgba(180,83,9,0.4); background: rgba(180,83,9,0.08); }
.pill.por_renovar .dot { background: var(--warn); }
.pill.vencido     { color: var(--bad); border-color: rgba(185,28,28,0.4); background: rgba(185,28,28,0.08); }
.pill.vencido .dot { background: var(--bad); }
.pill.ausente     { color: var(--ghost); border-color: rgba(107,119,144,0.4); background: rgba(107,119,144,0.08); }
.pill.ausente .dot { background: var(--ghost); }

/* ============== TABLE ============== */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  text-align: left;
  padding: 10px 20px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--ink-3);
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  position: sticky; top: 0;
}
.tbl td {
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  font-size: 13px;
}
.tbl tbody tr { transition: background .1s; cursor: pointer; }
.tbl tbody tr:hover { background: var(--bg-2); }
.tbl tbody tr:last-child td { border-bottom: none; }

.cell-name { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.02em;
  flex: 0 0 34px;
  border: 1px solid rgba(30,91,255,0.15);
}
.avatar.lg { width: 64px; height: 64px; font-size: 22px; flex: 0 0 64px; border-radius: var(--radius); }
.avatar.xl { width: 96px; height: 96px; font-size: 32px; flex: 0 0 96px; border-radius: var(--radius); }
.cell-name .meta .n { font-weight: 600; color: var(--ink); }
.cell-name .meta .s { font-size: 11px; color: var(--ink-3); font-family: var(--font-mono); }

.streak-cell { display: flex; align-items: center; gap: 8px; font-family: var(--font-mono); }
.streak-cell .flame { color: var(--accent); font-size: 14px; }
.streak-cell.zero { color: var(--ink-3); }

/* ============== BUTTONS ============== */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--bg-2);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all .12s;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-family: var(--font-sans);
}
.btn:hover { background: var(--bg-3); border-color: var(--ink-4); }
.btn.primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
  font-weight: 800;
}
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.ghost { background: transparent; border-color: var(--line); }
.btn.ghost:hover { background: var(--bg-2); }
.btn.danger { color: var(--bad); border-color: rgba(185,28,28,0.3); }
.btn.danger:hover { background: rgba(185,28,28,0.08); border-color: var(--bad); }
.btn.lg { padding: 12px 18px; font-size: 13px; }
.btn .ico { width: 14px; height: 14px; }

/* ============== INPUTS ============== */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--ink-3);
}
.input, .select {
  background: var(--bg);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  outline: none;
  transition: border-color .12s;
}
.input:focus, .select:focus { border-color: var(--accent); }
.input::placeholder { color: var(--ink-4); }

.search {
  position: relative;
  display: flex; align-items: center;
}
.search .ico {
  position: absolute; left: 12px; width: 14px; height: 14px;
  color: var(--ink-3); pointer-events: none;
}
.search .input { padding-left: 34px; width: 100%; }

/* ============== ALERTS LIST ============== */
.alert-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background .1s;
}
.alert-row:hover { background: var(--bg-2); }
.alert-row:last-child { border-bottom: none; }
.alert-row .meta { flex: 1; min-width: 0; }
.alert-row .n { font-weight: 600; }
.alert-row .s { font-size: 11px; color: var(--ink-3); font-family: var(--font-mono); }
.alert-row .act { display: flex; gap: 6px; }

/* ============== LEADERBOARD ============== */
.lb-row {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--line);
}
.lb-row:last-child { border-bottom: none; }
.lb-row .rank {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 18px;
  color: var(--ink-3);
  text-align: center;
}
.lb-row.top1 .rank { color: var(--accent); font-size: 22px; }
.lb-row.top2 .rank { color: var(--ink); }
.lb-row.top3 .rank { color: var(--ink-2); }
.lb-row .meta { display: flex; flex-direction: column; }
.lb-row .meta .n { font-weight: 600; font-size: 13px; }
.lb-row .meta .s { font-size: 11px; color: var(--ink-3); font-family: var(--font-mono); }
.lb-row .streak {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  color: var(--accent);
  display: flex; align-items: center; gap: 4px;
}

/* ============== CHECK-IN MODAL ============== */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(11,18,32,0.55);
  backdrop-filter: blur(6px);
  z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(11,18,32,0.18);
}
.modal.lg { max-width: 720px; }
.modal-head {
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px;
}
.modal-head h2 {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.01em;
  margin: 0;
}
.modal-head .close {
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-2);
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.modal-head .close:hover { background: var(--bg-2); color: var(--ink); }
.modal-body { padding: 24px; overflow-y: auto; }
.modal-foot {
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  display: flex; gap: 10px; justify-content: flex-end;
  background: var(--bg);
}

/* ============== FORM GRID ============== */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.form-grid .full { grid-column: 1 / -1; }

.plan-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.plan-card {
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
  transition: all .12s;
  position: relative;
}
.plan-card:hover { border-color: var(--ink-4); }
.plan-card.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.plan-card.selected::after {
  content: '✓';
  position: absolute; top: 8px; right: 10px;
  width: 18px; height: 18px;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800;
}
.plan-card .name {
  font-family: var(--font-display);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 14px;
}
.plan-card .duration { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); margin-top: 2px; }
.plan-card .price {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 26px;
  color: var(--accent);
  margin-top: 6px;
  line-height: 1;
}
.plan-card .price small { font-size: 11px; color: var(--ink-3); font-weight: 500; }

/* ============== CHECK-IN BIG SUCCESS ============== */
.checkin-success {
  text-align: center;
  padding: 30px 10px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.checkin-success .badge {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  display: flex; align-items: center; justify-content: center;
  font-size: 38px;
  animation: pop .35s cubic-bezier(.34,1.56,.64,1);
}
@keyframes pop { 0% { transform: scale(.4); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.checkin-success h3 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 32px;
  text-transform: uppercase;
  margin: 0;
  letter-spacing: -0.01em;
}
.checkin-success .name { color: var(--accent); }
.checkin-success .streak-big {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 56px;
  line-height: 1;
  color: var(--ink);
}
.checkin-success .streak-big small {
  font-size: 13px;
  color: var(--ink-3);
  font-weight: 500;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  display: block;
  margin-top: 4px;
}

/* ============== CLIENT DETAIL ============== */
.detail-head {
  display: flex; align-items: flex-start; gap: 20px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
}
.detail-head .info { flex: 1; }
.detail-head h1 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 36px;
  line-height: 1;
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: -0.01em;
}
.detail-head .sub {
  display: flex; gap: 16px; flex-wrap: wrap;
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 12px;
}
.detail-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

.detail-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.stat-mini {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.stat-mini .l {
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--ink-3);
}
.stat-mini .v {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 26px;
  margin-top: 4px;
  line-height: 1;
}
.stat-mini.accent .v { color: var(--accent); }

/* ============== ATTENDANCE GRID ============== */
.att-grid {
  display: grid;
  grid-template-columns: repeat(15, 1fr);
  gap: 4px;
  padding: 16px 20px 4px;
}
.att-cell {
  aspect-ratio: 1;
  border-radius: 3px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  position: relative;
}
.att-cell.has { background: var(--accent); border-color: var(--accent); }
.att-cell.today {
  outline: 2px solid var(--black);
  outline-offset: 1px;
}
.att-legend {
  display: flex; gap: 14px;
  padding: 10px 20px 16px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.att-legend .swatch { display: inline-flex; align-items: center; gap: 6px; }
.att-legend .sq { width: 10px; height: 10px; border-radius: 2px; border: 1px solid var(--line); }
.att-legend .sq.has { background: var(--accent); border-color: var(--accent); }
.att-legend .sq.empty { background: var(--bg-3); }

.history-list {
  max-height: 320px;
  overflow-y: auto;
}
.history-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--line);
  align-items: center;
}
.history-row:last-child { border-bottom: none; }
.history-row .day {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 14px;
  text-transform: uppercase;
}
.history-row .time {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-2);
}
.history-row .badge-mini {
  font-family: var(--font-mono);
  font-size: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 2px 7px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ============== EMPTY STATE ============== */
.empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--ink-3);
}
.empty h4 {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: 16px;
  margin: 0 0 6px;
  color: var(--ink);
}
.empty p { margin: 0; font-size: 12px; }

/* ============== FILTER CHIPS ============== */
.chips {
  display: flex; gap: 6px; flex-wrap: wrap;
}
.chip {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--bg);
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: all .12s;
}
.chip:hover { color: var(--ink); border-color: var(--ink-4); }
.chip.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* Toolbar above tables */
.toolbar {
  display: flex;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  align-items: center;
  flex-wrap: wrap;
}
.toolbar .search { flex: 1; min-width: 220px; }

/* ============== UTILITY ============== */
.muted { color: var(--ink-3); }
.mono { font-family: var(--font-mono); }
.sp-y > * + * { margin-top: 14px; }
.row { display: flex; gap: 12px; align-items: center; }
.row.between { justify-content: space-between; }

/* progress bar (plan progress) */
.progress {
  height: 6px;
  background: var(--bg-3);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.progress > i {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
}
.progress.warn > i { background: var(--warn); }
.progress.bad > i { background: var(--bad); }

/* sparkline / mini chart */
.spark {
  display: flex; align-items: flex-end; gap: 3px;
  height: 36px;
  margin-top: 8px;
}
.spark .b {
  flex: 1;
  background: var(--ink-4);
  border-radius: 2px;
  min-width: 0;
}
.spark .b.has { background: var(--accent); }

/* Toast */
.toast {
  position: fixed;
  bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--black);
  color: #FFFFFF;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 13px;
  box-shadow: 0 12px 30px rgba(11,18,32,0.25);
  display: flex; align-items: center; gap: 8px;
  z-index: 200;
  animation: toastIn .25s;
}
.toast.bad { background: var(--bad); color: white; }
.toast.ok { background: var(--accent); color: var(--accent-ink); }
@keyframes toastIn { from { transform: translate(-50%, 12px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }

/* ===== Tweaks panel overrides (force light) ===== */
[data-tweaks-panel] { background: #FFFFFF !important; border-color: var(--line) !important; color: var(--ink) !important; }
