/* ══════════════════════════════════════════════════
   HTB PROTOCOL TRACKER  —  style.css
   Theme: slate + electric cyan  |  Outfit + Space Mono
════════════════════════════════════════════════════ */

/* ─── TOKENS ──────────────────────────────────────── */
:root {
  /* backgrounds */
  --bg0: #080b10;
  --bg1: #0d1117;
  --bg2: #111822;
  --bg3: #161e2c;
  --bg4: #1d2535;
  --bg5: #242e42;

  /* accent — electric cyan */
  --ac:    #00e5ff;
  --ac2:   #00b8d9;
  --ac-dim: rgba(0,229,255,0.10);
  --ac-glow: rgba(0,229,255,0.20);

  /* text */
  --t0: #e8edf5;
  --t1: #a8b4c8;
  --t2: #5e6e88;
  --t3: #334055;

  /* semantic */
  --ok:   #36d399;
  --warn: #f5a623;
  --err:  #ff5861;
  --info: #3b9eff;

  /* difficulty */
  --d-easy:   #36d399;
  --d-medium: #f5a623;
  --d-hard:   #ff5861;
  --d-insane: #b47bff;

  /* borders */
  --bd: rgba(255,255,255,0.06);
  --bd2: rgba(255,255,255,0.11);
  --bd3: rgba(0,229,255,0.22);

  /* type */
  --sans: 'Outfit', system-ui, sans-serif;
  --mono: 'Space Mono', 'Courier New', monospace;

  /* geometry */
  --r:  4px;
  --rl: 8px;
  --rx: 12px;

  /* motion */
  --ease: 0.16s ease;
}

/* ─── RESET ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; -webkit-font-smoothing: antialiased; }
body {
  background: var(--bg0);
  color: var(--t0);
  font-family: var(--sans);
  font-weight: 400;
  line-height: 1.55;
  height: 100vh;
  overflow: hidden;
}

/* scanline texture */
body::after {
  content: '';
  position: fixed; inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.03) 2px,
    rgba(0,0,0,0.03) 4px
  );
  pointer-events: none;
  z-index: 1000;
}

/* ─── SHELL ───────────────────────────────────────── */
.shell { display: flex; height: 100vh; }

/* ─── SIDEBAR ─────────────────────────────────────── */
.sidebar {
  width: 200px;
  flex-shrink: 0;
  background: var(--bg1);
  border-right: 1px solid var(--bd);
  display: flex;
  flex-direction: column;
  padding: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px 18px;
  border-bottom: 1px solid var(--bd);
}

.brand-icon {
  font-size: 22px;
  color: var(--ac);
  line-height: 1;
  flex-shrink: 0;
  text-shadow: 0 0 12px var(--ac-glow);
}

.brand-name {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--t0);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.brand-sub {
  font-size: 10px;
  color: var(--t2);
  letter-spacing: 0.04em;
  margin-top: 2px;
}

.sidenav {
  flex: 1;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.snav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 10px;
  border: none;
  border-radius: var(--r);
  background: transparent;
  color: var(--t2);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: color var(--ease), background var(--ease);
}

.snav-item svg { flex-shrink: 0; }
.snav-item:hover { color: var(--t0); background: var(--bg3); }
.snav-item.active {
  color: var(--ac);
  background: var(--ac-dim);
  box-shadow: inset 2px 0 0 var(--ac);
}

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--bd);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.streak-block { display: flex; align-items: baseline; gap: 5px; }
.streak-num {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 700;
  color: var(--ac);
  line-height: 1;
}
.streak-label { font-size: 10px; color: var(--t2); }

.settings-btn {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r);
  color: var(--t2);
  border: 1px solid var(--bd);
  transition: all var(--ease);
}
.settings-btn:hover { color: var(--ac); border-color: var(--bd3); background: var(--ac-dim); }

/* ─── MAIN ────────────────────────────────────────── */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg0);
}

/* ─── TOPBAR ──────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  border-bottom: 1px solid var(--bd);
  flex-shrink: 0;
  background: var(--bg1);
}

.page-title {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--t0);
  letter-spacing: -0.01em;
  line-height: 1;
}

.page-sub {
  font-size: 11px;
  color: var(--t2);
  margin-top: 3px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-family: var(--mono);
}

.topbar-right { display: flex; align-items: center; gap: 10px; }

.date-badge {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--t2);
  padding: 5px 10px;
  border: 1px solid var(--bd);
  border-radius: var(--r);
  background: var(--bg2);
}

/* ─── BUTTONS ─────────────────────────────────────── */
.btn {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: var(--r);
  cursor: pointer;
  border: 1px solid var(--bd2);
  background: var(--bg3);
  color: var(--t1);
  transition: all var(--ease);
  line-height: 1;
  white-space: nowrap;
}
.btn:hover { background: var(--bg4); color: var(--t0); border-color: var(--bd2); }
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--ac);
  color: var(--bg0);
  border-color: var(--ac);
  font-weight: 700;
}
.btn-primary:hover { background: #33ecff; border-color: #33ecff; color: var(--bg0); }

.btn-danger {
  background: transparent;
  color: var(--err);
  border-color: rgba(255,88,97,0.35);
}
.btn-danger:hover { background: rgba(255,88,97,0.12); border-color: var(--err); }

.btn-sm { padding: 5px 11px; font-size: 11px; }

.icon-btn {
  background: none;
  border: none;
  color: var(--t2);
  cursor: pointer;
  font-size: 13px;
  padding: 4px 6px;
  border-radius: var(--r);
  transition: color var(--ease), background var(--ease);
}
.icon-btn:hover { color: var(--t0); background: var(--bg3); }

/* ─── CONTENT ─────────────────────────────────────── */
.content {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
}
.content::-webkit-scrollbar { width: 4px; }
.content::-webkit-scrollbar-thumb { background: var(--bg5); border-radius: 2px; }

/* ─── VIEWS ───────────────────────────────────────── */
.view { display: none; }
.view.active { display: block; animation: fadeIn 0.18s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* ─── FOCUS BAR ───────────────────────────────────── */
.focus-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg2);
  border: 1px solid var(--bd3);
  border-left: 3px solid var(--ac);
  border-radius: var(--rl);
  padding: 13px 18px;
  margin-bottom: 20px;
}
.focus-phase-tag {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ac);
  background: var(--ac-dim);
  padding: 3px 8px;
  border-radius: 3px;
  white-space: nowrap;
  flex-shrink: 0;
}
.focus-text {
  font-size: 13px;
  color: var(--t1);
  flex: 1;
  line-height: 1.4;
}

/* ─── STAT GRID ───────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.stat-card {
  background: var(--bg2);
  border: 1px solid var(--bd);
  border-radius: var(--rl);
  padding: 16px 18px;
  transition: border-color var(--ease);
  position: relative;
  overflow: hidden;
}
.stat-card:hover { border-color: var(--bd2); }
.stat-card.accent { border-color: rgba(0,229,255,0.2); }
.stat-card.accent::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--ac), transparent);
}

.stat-label {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--t2);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 8px;
}
.stat-val {
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 700;
  color: var(--t0);
  line-height: 1;
}
.stat-card.accent .stat-val { color: var(--ac); }
.stat-sub { font-size: 10px; color: var(--t2); margin-top: 5px; }
.stat-bar {
  height: 2px;
  background: var(--bg5);
  border-radius: 1px;
  margin-top: 12px;
  overflow: hidden;
}
.stat-bar-fill {
  height: 100%;
  background: var(--ac);
  border-radius: 1px;
  width: 0%;
  transition: width 0.7s cubic-bezier(0.22,1,0.36,1);
}

/* ─── PANELS ──────────────────────────────────────── */
.dash-row {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 10px;
  margin-bottom: 10px;
}

.dash-row.equal { grid-template-columns: 1fr 1fr; }

.panel {
  background: var(--bg2);
  border: 1px solid var(--bd);
  border-radius: var(--rl);
  padding: 16px 18px;
  transition: border-color var(--ease);
}
.panel:hover { border-color: var(--bd2); }
.panel-wide { grid-column: span 1; }

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--t2);
}
.panel-hint { font-size: 9px; color: var(--t3); }

/* ─── HEATMAP ─────────────────────────────────────── */
.hm-wrap { overflow: hidden; }
.hm-months { display: flex; gap: 2px; padding-left: 24px; margin-bottom: 3px; }
.hm-mo { flex: 1; font-family: var(--mono); font-size: 8px; color: var(--t3); }
.hm-row { display: flex; align-items: center; gap: 2px; margin-bottom: 2px; }
.hm-day { font-family: var(--mono); font-size: 8px; color: var(--t3); width: 20px; text-align: right; flex-shrink: 0; }
.hm-cells { display: flex; gap: 2px; flex: 1; }
.hm-cell {
  flex: 1; height: 10px; border-radius: 2px;
  background: var(--bg4);
  cursor: pointer; transition: opacity 0.1s;
}
.hm-cell:hover { opacity: 0.7; }
.hm-cell[data-v="1"] { background: rgba(0,229,255,0.18); }
.hm-cell[data-v="2"] { background: rgba(0,229,255,0.40); }
.hm-cell[data-v="3"] { background: rgba(0,229,255,0.65); }
.hm-cell[data-v="4"] { background: var(--ac); }

/* ─── PHASE BARS ──────────────────────────────────── */
.ph-row { display: flex; align-items: center; gap: 10px; padding: 5px 0; }
.ph-lbl { font-size: 11px; color: var(--t1); flex: 0 0 120px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-track { flex: 1; height: 3px; background: var(--bg5); border-radius: 2px; overflow: hidden; }
.ph-fill { height: 100%; background: var(--ac); border-radius: 2px; transition: width 0.7s cubic-bezier(0.22,1,0.36,1); }
.ph-pct { font-family: var(--mono); font-size: 10px; color: var(--t2); width: 32px; text-align: right; }

/* ─── ROADMAP ─────────────────────────────────────── */
.rm-item {
  background: var(--bg2);
  border: 1px solid var(--bd);
  border-radius: var(--rl);
  overflow: hidden;
  margin-bottom: 8px;
  transition: border-color var(--ease);
}
.rm-item.active-phase { border-color: rgba(0,229,255,0.25); }
.rm-item:hover { border-color: var(--bd2); }

.rm-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  transition: background var(--ease);
}
.rm-header:hover { background: var(--bg3); }

.rm-num {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--t3);
  width: 26px;
  flex-shrink: 0;
}
.active-phase .rm-num { color: var(--ac); }

.rm-title { font-size: 13px; font-weight: 600; color: var(--t0); flex: 1; }
.rm-meta { font-family: var(--mono); font-size: 9.5px; color: var(--t2); white-space: nowrap; }
.rm-badge {
  font-family: var(--mono); font-size: 9px;
  color: var(--ac); background: var(--ac-dim);
  padding: 2px 7px; border-radius: 3px;
  white-space: nowrap; flex-shrink: 0;
}
.rm-mini-bar { width: 56px; height: 2px; background: var(--bg5); border-radius: 1px; overflow: hidden; flex-shrink: 0; }
.rm-mini-fill { height: 100%; background: var(--ac); border-radius: 1px; }
.rm-pct { font-family: var(--mono); font-size: 10px; color: var(--t2); width: 28px; text-align: right; flex-shrink: 0; }
.rm-chevron { color: var(--t2); transition: transform 0.2s; flex-shrink: 0; }
.rm-chevron.open { transform: rotate(180deg); }

.rm-body { display: none; border-top: 1px solid var(--bd); padding: 16px 16px 20px; }
.rm-body.open { display: block; }

.rm-goal {
  font-size: 13px;
  color: var(--t1);
  line-height: 1.65;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--bd);
  font-style: italic;
}

.rm-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

.rm-section-lbl {
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--t2);
  margin-bottom: 10px;
}

.rm-skill {
  display: flex; align-items: flex-start; gap: 7px;
  font-size: 12px; color: var(--t2); padding: 3px 0; line-height: 1.45;
}
.rm-skill::before { content: '›'; color: var(--ac); flex-shrink: 0; margin-top: -1px; }

.rm-daily {
  display: flex; gap: 10px;
  padding: 6px 0; border-bottom: 1px solid var(--bd);
  font-size: 12px;
}
.rm-daily:last-of-type { border-bottom: none; }
.rm-daily-t { font-family: var(--mono); font-size: 9.5px; color: var(--ac); width: 84px; flex-shrink: 0; margin-top: 1px; }
.rm-daily-d { color: var(--t2); line-height: 1.45; }

/* Milestones inside roadmap */
.ms-list { margin-top: 14px; display: flex; flex-direction: column; gap: 5px; }
.ms-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 8px 12px; border-radius: var(--r);
  background: var(--bg3); cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--ease);
}
.ms-row:hover { background: var(--bg4); border-color: var(--bd); }
.ms-row.done { border-color: rgba(0,229,255,0.1); }
.ms-chk {
  width: 14px; height: 14px; border-radius: 3px;
  border: 1px solid var(--bd2); flex-shrink: 0; margin-top: 1px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.18s;
}
.ms-chk.on { background: var(--ac); border-color: var(--ac); }
.ms-chk.on::after {
  content: ''; width: 5px; height: 3px;
  border-left: 1.5px solid var(--bg0); border-bottom: 1.5px solid var(--bg0);
  transform: rotate(-45deg) translate(0.5px,-0.5px);
}
.ms-text { font-size: 12px; color: var(--t2); line-height: 1.45; }
.ms-text.done { color: var(--t3); text-decoration: line-through; }

/* ─── VIEW TOOLBAR ────────────────────────────────── */
.view-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.search-wrap {
  display: flex; align-items: center; gap: 7px;
  background: var(--bg2); border: 1px solid var(--bd2);
  border-radius: var(--r); padding: 6px 10px;
  min-width: 180px; flex: 1;
  color: var(--t2);
}
.search-wrap input {
  background: none; border: none; outline: none;
  color: var(--t0); font-family: var(--sans); font-size: 12px;
  width: 100%;
}
.search-wrap input::placeholder { color: var(--t3); }

.filter-pills { display: flex; gap: 4px; }
.pill {
  font-family: var(--mono);
  font-size: 10px; font-weight: 700;
  padding: 4px 9px; border-radius: 3px;
  background: var(--bg3); border: 1px solid var(--bd);
  color: var(--t2); cursor: pointer; transition: all var(--ease);
}
.pill:hover { border-color: var(--bd2); color: var(--t1); }
.pill.active { background: var(--ac-dim); border-color: var(--bd3); color: var(--ac); }

/* ─── DATA TABLES ─────────────────────────────────── */
.table-wrap {
  background: var(--bg2);
  border: 1px solid var(--bd);
  border-radius: var(--rl);
  overflow: hidden;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.data-table th {
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--t2);
  text-align: left;
  padding: 9px 14px;
  border-bottom: 1px solid var(--bd);
  background: var(--bg2);
  white-space: nowrap;
}

.data-table th.sortable { cursor: pointer; user-select: none; }
.data-table th.sortable:hover { color: var(--t1); }

.data-table td {
  padding: 10px 14px;
  color: var(--t1);
  border-bottom: 1px solid var(--bd);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg3); }

.table-footer {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--t2);
  padding: 10px 4px;
  text-align: right;
}

/* tags / badges */
.tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 9.5px; font-weight: 700;
  padding: 2px 7px; border-radius: 3px;
}
.tag-easy   { background: rgba(54,211,153,0.12); color: var(--d-easy); }
.tag-medium { background: rgba(245,166,35,0.14); color: var(--d-medium); }
.tag-hard   { background: rgba(255,88,97,0.14);  color: var(--d-hard); }
.tag-insane { background: rgba(180,123,255,0.16); color: var(--d-insane); }
.tag-os { background: var(--bg4); color: var(--t2); }
.tag-note {
  font-family: var(--mono); font-size: 9.5px;
  padding: 2px 7px; border-radius: 3px;
  background: var(--bg4); color: var(--t2);
}
.tag-writeup   { background: rgba(0,229,255,0.1); color: var(--ac); }
.tag-technique { background: rgba(54,211,153,0.1); color: var(--ok); }
.tag-command   { background: rgba(180,123,255,0.12); color: var(--d-insane); }
.tag-resource  { background: rgba(245,166,35,0.12); color: var(--warn); }

.row-actions { display: flex; gap: 4px; }
.act-btn {
  font-size: 11px; padding: 3px 7px;
  background: none; border: 1px solid var(--bd);
  border-radius: var(--r); color: var(--t2);
  cursor: pointer; transition: all var(--ease);
}
.act-btn:hover { border-color: var(--bd2); color: var(--t0); background: var(--bg3); }
.act-btn.danger:hover { border-color: var(--err); color: var(--err); background: rgba(255,88,97,0.08); }

/* ─── NOTES GRID ──────────────────────────────────── */
.notes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}

.note-card-add {
  border: 1px dashed var(--bd2);
  border-radius: var(--rl);
  display: flex; align-items: center; justify-content: center;
  gap: 8px; font-size: 13px; color: var(--t3);
  cursor: pointer; min-height: 120px;
  transition: all var(--ease);
}
.note-card-add:hover { border-color: var(--ac); color: var(--ac); background: var(--ac-dim); }

.note-card {
  background: var(--bg2); border: 1px solid var(--bd);
  border-radius: var(--rl); padding: 14px;
  cursor: pointer; transition: border-color var(--ease);
  display: flex; flex-direction: column; gap: 8px;
}
.note-card:hover { border-color: var(--bd2); }
.note-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.note-card-title { font-size: 13px; font-weight: 600; color: var(--t0); line-height: 1.3; }
.note-card-body {
  font-family: var(--mono); font-size: 10.5px; color: var(--t2);
  line-height: 1.6; white-space: pre-wrap;
  overflow: hidden; max-height: 72px;
}
.note-card-footer { display: flex; justify-content: space-between; align-items: center; }
.note-card-date { font-family: var(--mono); font-size: 9.5px; color: var(--t3); }

/* ─── SKILLS ──────────────────────────────────────── */
.sk-row { display: flex; align-items: center; gap: 12px; padding: 7px 0; }
.sk-label { font-size: 12.5px; color: var(--t1); flex: 1; font-weight: 500; }
.sk-track {
  flex: 0 0 140px; height: 4px; background: var(--bg5);
  border-radius: 2px; cursor: pointer; position: relative;
}
.sk-fill { height: 100%; background: var(--ac); border-radius: 2px; transition: width 0.25s ease; }
.sk-val { font-family: var(--mono); font-size: 10px; color: var(--t2); width: 28px; text-align: right; }

/* ─── TIMELINE ────────────────────────────────────── */
.timeline-wrap { padding-left: 22px; position: relative; }
.timeline-wrap::before {
  content: ''; position: absolute; left: 5px;
  top: 5px; bottom: 5px; width: 1px; background: var(--bd2);
}
.tl-item { position: relative; margin-bottom: 18px; }
.tl-dot {
  position: absolute; left: -19px; top: 4px;
  width: 8px; height: 8px; border-radius: 50%;
  border: 1px solid var(--bd2); background: var(--bg3);
  transition: all 0.2s;
}
.tl-dot.done { background: var(--t3); border-color: var(--t3); }
.tl-dot.live {
  background: var(--ac); border-color: var(--ac);
  box-shadow: 0 0 0 3px rgba(0,229,255,0.18);
  animation: pulse 2.5s ease-in-out infinite;
}
@keyframes pulse {
  0%,100% { box-shadow: 0 0 0 3px rgba(0,229,255,0.18); }
  50%      { box-shadow: 0 0 0 6px rgba(0,229,255,0.06); }
}
.tl-mono { font-family: var(--mono); font-size: 9px; color: var(--t2); margin-bottom: 2px; }
.tl-name { font-size: 12.5px; font-weight: 500; }

/* ─── MODALS ──────────────────────────────────────── */
.overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(4,7,12,0.82);
  backdrop-filter: blur(6px);
  z-index: 500;
  align-items: center; justify-content: center;
}
.overlay.open { display: flex; }

.modal {
  background: var(--bg2);
  border: 1px solid var(--bd2);
  border-radius: var(--rx);
  width: 420px; max-width: 96vw;
  max-height: 92vh; overflow-y: auto;
  padding: 22px;
  animation: fadeIn 0.18s ease;
  display: flex; flex-direction: column; gap: 14px;
}
.modal::-webkit-scrollbar { width: 4px; }
.modal::-webkit-scrollbar-thumb { background: var(--bg5); }

.modal-wide { width: 560px; }
.modal-sm   { width: 360px; }

.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 2px;
}
.modal-title {
  font-family: var(--mono);
  font-size: 14px; font-weight: 700;
  color: var(--t0); letter-spacing: -0.01em;
}

.field-row { display: flex; flex-direction: column; gap: 5px; }
.field-row label {
  font-family: var(--mono); font-size: 9.5px;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--t2);
}
.field-row.two-col { flex-direction: row; gap: 10px; }
.field-row.two-col > div { flex: 1; display: flex; flex-direction: column; gap: 5px; }
.opt { font-size: 9px; color: var(--t3); text-transform: none; letter-spacing: 0; }

input[type="text"], input[type="number"], input[type="date"], select, textarea {
  background: var(--bg3);
  border: 1px solid var(--bd2);
  color: var(--t0);
  font-family: var(--sans);
  font-size: 13px;
  padding: 8px 11px;
  border-radius: var(--r);
  outline: none;
  width: 100%;
  transition: border-color var(--ease);
  -webkit-appearance: none;
}
input:focus, select:focus, textarea:focus { border-color: rgba(0,229,255,0.4); }
input::placeholder, textarea::placeholder { color: var(--t3); }
select option { background: var(--bg3); }
textarea { min-height: 160px; resize: vertical; line-height: 1.65; font-family: var(--mono); font-size: 12px; }

.modal-foot {
  display: flex; gap: 8px; justify-content: flex-end;
  padding-top: 4px;
}

/* ─── TOAST ───────────────────────────────────────── */
.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: var(--bg4); border: 1px solid var(--bd2);
  border-radius: var(--r); padding: 9px 18px;
  font-family: var(--mono); font-size: 12px; color: var(--t0);
  z-index: 900; opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
  white-space: nowrap;
}
.toast.show { opacity: 1; }

/* ─── EMPTY STATE ─────────────────────────────────── */
.empty-state {
  padding: 40px; text-align: center;
  font-family: var(--mono); font-size: 11px; color: var(--t3);
}

/* ─── STAGGER ─────────────────────────────────────── */
.stagger > * { animation: fadeIn 0.22s ease both; }
.stagger > *:nth-child(1) { animation-delay: 0.03s; }
.stagger > *:nth-child(2) { animation-delay: 0.06s; }
.stagger > *:nth-child(3) { animation-delay: 0.09s; }
.stagger > *:nth-child(4) { animation-delay: 0.12s; }
