/* Tashlumit — automation system for invoice collection
 * Palette: slate-blue + amber-gold + emerald (premium fintech)
 * © אופיר ברנס (Ofir Baranes) 2026 - כל הזכויות שמורות
 */

* { margin:0; padding:0; box-sizing:border-box; -webkit-tap-highlight-color: transparent; }

:root {
  /* Slate scale */
  --slate-50:  #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;
  --slate-950: #0a0e1a;

  /* Blue accent */
  --blue-300: #93c5fd;
  --blue-400: #60a5fa;
  --blue-500: #3b82f6;
  --blue-600: #2563eb;

  /* Amber gold */
  --amber-300: #fcd34d;
  --amber-400: #fbbf24;
  --amber-500: #f59e0b;
  --amber-600: #d97706;

  /* Semantic */
  --emerald-300: #6ee7b7;
  --emerald-400: #34d399;
  --emerald-500: #10b981;
  --rose-300: #fda4af;
  --rose-400: #fb7185;
  --rose-500: #f43f5e;
  --rose-600: #e11d48;

  /* Tokens */
  --bg-1: var(--slate-950);
  --bg-2: #0d1224;
  --bg-3: #131a2e;
  --text-primary: #f1f5f9;
  --text-secondary: rgba(241,245,249,0.74);
  --text-muted: rgba(241,245,249,0.46);
  --text-faint: rgba(241,245,249,0.30);
  --surface: rgba(241,245,249,0.04);
  --surface-strong: rgba(241,245,249,0.08);
  --surface-input: rgba(8,12,24,0.55);
  --border: rgba(148,163,184,0.14);
  --border-strong: rgba(148,163,184,0.26);
  --border-amber: rgba(251,191,36,0.32);
  --shadow-glass: 0 30px 60px -25px rgba(2,4,10,0.85);
  --shadow-amber: 0 10px 30px rgba(251,191,36,0.18);
  --shadow-card: 0 16px 38px -18px rgba(0,0,0,0.55);
  --bezier: cubic-bezier(.34,1.56,.64,1);
  --bezier-soft: cubic-bezier(.4,0,.2,1);
}

html, body {
  background: var(--bg-1);
  color: var(--text-primary);
  font-family: 'Heebo', system-ui, sans-serif;
  font-weight: 400;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
body {
  background:
    radial-gradient(ellipse 900px 800px at 80% -10%, rgba(96,165,250,0.10), transparent 60%),
    radial-gradient(ellipse 600px 700px at -10% 30%, rgba(251,191,36,0.06), transparent 65%),
    radial-gradient(ellipse 800px 1000px at 50% 110%, rgba(30,41,59,0.55), transparent 70%),
    linear-gradient(180deg, #0a0e1a 0%, #0d1326 60%, #131a2e 110%);
  background-attachment: fixed;
  position: relative;
}
.mono { font-family: 'IBM Plex Mono', monospace; font-variant-numeric: tabular-nums; }

/* ===== Ambient ===== */
.ambient {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.38;
}
.orb.o1 { width: 520px; height: 520px; top: -160px; right: -160px; background: radial-gradient(circle, #60a5fa 0%, transparent 70%); animation: drift1 32s ease-in-out infinite; }
.orb.o2 { width: 380px; height: 380px; bottom: 10%; left: -120px; background: radial-gradient(circle, #fbbf24 0%, transparent 70%); opacity: 0.22; animation: drift2 38s ease-in-out infinite; }
.orb.o3 { width: 300px; height: 300px; top: 38%; right: 30%; background: radial-gradient(circle, #34d399 0%, transparent 70%); opacity: 0.16; animation: drift3 44s ease-in-out infinite; }
@keyframes drift1 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-40px,50px) scale(1.10); } }
@keyframes drift2 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(50px,-40px) scale(1.08); } }
@keyframes drift3 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-30px,-40px) scale(1.12); } }
.grain {
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.95 0 0 0 0 0.95 0 0 0 0 1 0 0 0 0.6 0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.025;
  mix-blend-mode: overlay;
}

/* ===== Topbar ===== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 26px;
  padding-top: max(14px, env(safe-area-inset-top));
  background: linear-gradient(180deg, rgba(10,14,26,0.92) 0%, rgba(10,14,26,0.55) 100%);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border-bottom: 1px solid var(--border);
}
.topbar-left { flex-shrink: 0; }
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-mark {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 12px;
  background:
    radial-gradient(circle at 30% 30%, rgba(251,191,36,0.20), transparent 60%),
    linear-gradient(135deg, var(--slate-800), var(--slate-700));
  border: 1px solid var(--border-strong);
  box-shadow: 0 0 24px rgba(251,191,36,0.18), inset 0 1px 0 rgba(255,255,255,0.06);
  overflow: hidden;
}
.brand-mark img { display: block; }
.brand-name { display: flex; flex-direction: column; line-height: 1.15; }
.brand-title {
  font-family: 'Frank Ruhl Libre', 'Heebo', serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--slate-100);
  letter-spacing: -0.01em;
}
.brand-sub {
  font-size: 10px;
  color: var(--slate-400);
  letter-spacing: 0.06em;
}

.topbar-nav {
  flex: 1;
  display: flex;
  gap: 4px;
  justify-content: center;
}
.nav-link {
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 10px;
  transition: all 0.2s var(--bezier-soft);
  position: relative;
}
.nav-link:hover { color: var(--text-primary); background: var(--surface); }
.nav-link.active {
  color: var(--amber-400);
  background: rgba(251,191,36,0.08);
}
.nav-link.active::after {
  content: '';
  position: absolute;
  inset: auto 12px 4px;
  height: 2px;
  background: var(--amber-400);
  border-radius: 2px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  font-size: 12px;
  border-radius: 100px;
  background: rgba(52,211,153,0.10);
  color: var(--emerald-400);
  border: 1px solid rgba(52,211,153,0.28);
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  font-weight: 500;
}
.status-pill:hover { background: rgba(52,211,153,0.16); }
.pulse-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--emerald-400);
  box-shadow: 0 0 0 0 rgba(52,211,153,0.6);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(52,211,153,0.6); }
  50% { box-shadow: 0 0 0 8px rgba(52,211,153,0); }
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 12px 5px 5px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s;
}
.user-chip:hover { background: var(--surface-strong); }
.user-avatar {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--amber-400), var(--amber-600));
  display: grid; place-items: center;
  font-family: 'Frank Ruhl Libre', serif;
  font-weight: 700;
  font-size: 14px;
  color: var(--slate-900);
}
.user-meta { display: flex; flex-direction: column; line-height: 1.2; }
.user-name { font-size: 12px; font-weight: 600; color: var(--slate-100); }
.user-role { font-size: 10px; color: var(--slate-400); letter-spacing: 0.04em; }

main {
  position: relative;
  z-index: 1;
  padding: 28px 26px 60px;
  max-width: 1320px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* ===== HERO ===== */
.hero {
  position: relative;
  border-radius: 28px;
  overflow: hidden;
  min-height: 280px;
  border: 1px solid var(--border-strong);
  background: linear-gradient(135deg, rgba(96,165,250,0.10) 0%, rgba(251,191,36,0.06) 100%);
  box-shadow: var(--shadow-glass);
  isolation: isolate;
}
.hero-bg {
  position: absolute; inset: 0;
  background-image: url('hero_bg.png');
  background-size: cover;
  background-position: center left;
  opacity: 0.45;
  z-index: 0;
}
.hero-overlay {
  position: absolute; inset: 0;
  background:
    linear-gradient(95deg, rgba(10,14,26,0.10) 0%, rgba(10,14,26,0.50) 45%, rgba(10,14,26,0.92) 100%),
    radial-gradient(ellipse 70% 60% at 100% 50%, rgba(251,191,36,0.10), transparent 60%);
  z-index: 1;
}
.hero-content {
  position: relative;
  z-index: 2;
  padding: 36px 38px;
  display: flex;
}
.hero-text { flex: 1; }
.hero-kicker {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--amber-300);
  margin-bottom: 14px;
}
.hero-title {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 22px;
}
.hero-amount {
  font-size: clamp(50px, 8vw, 78px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 0.95;
  background: linear-gradient(135deg, var(--slate-50) 0%, var(--amber-300) 70%, var(--amber-400) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 4px 30px rgba(251,191,36,0.18);
}
.hero-amount-meta {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 400;
  letter-spacing: 0;
}
.hero-amount-meta .mono { color: var(--slate-100); font-weight: 600; }

.hero-deltas {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.delta-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  background: rgba(52,211,153,0.12);
  border: 1px solid rgba(52,211,153,0.28);
  border-radius: 100px;
  color: var(--emerald-300);
  font-size: 12px;
}
.delta-chip.danger {
  background: rgba(244,63,94,0.12);
  border-color: rgba(244,63,94,0.28);
  color: var(--rose-400);
}
.delta-icon { font-size: 14px; line-height: 1; }
.delta-label { color: var(--text-secondary); font-weight: 500; }
.delta-value { font-weight: 600; color: inherit; }

.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s var(--bezier);
}
.btn svg { width: 16px; height: 16px; }
.btn-primary {
  background: linear-gradient(135deg, var(--amber-400), var(--amber-600));
  color: var(--slate-900);
  font-weight: 700;
  box-shadow: 0 10px 26px rgba(251,191,36,0.30);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(251,191,36,0.45); }
.btn-ghost {
  background: rgba(241,245,249,0.08);
  border: 1px solid var(--border-strong);
  color: var(--slate-100);
  backdrop-filter: blur(8px);
}
.btn-ghost:hover { background: rgba(241,245,249,0.14); }

/* ===== KPI grid ===== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.kpi-card {
  background: var(--surface);
  backdrop-filter: blur(20px) saturate(150%);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s var(--bezier-soft);
}
.kpi-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.kpi-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.kpi-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
  letter-spacing: 0.02em;
}
.kpi-info {
  font-size: 13px;
  color: var(--text-muted);
  cursor: help;
  width: 18px; height: 18px;
  display: grid; place-items: center;
  border-radius: 50%;
  transition: all 0.2s;
}
.kpi-info:hover { color: var(--text-primary); background: var(--surface); }
.kpi-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--slate-50);
  line-height: 1;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}
.kpi-unit {
  font-size: 18px;
  color: var(--text-muted);
  font-weight: 500;
  margin-right: 4px;
}
.kpi-trend {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  margin-top: 4px;
}
.kpi-trend.down { color: var(--emerald-400); }
.kpi-trend.up { color: var(--rose-400); }

.kpi-spark {
  height: 30px;
  margin: 4px 0;
}
.kpi-spark svg { width: 100%; height: 100%; overflow: visible; }
.spark-path { fill: none; stroke: var(--amber-400); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.spark-fill { fill: url(#sparkGrad); opacity: 0.4; }

.kpi-ring {
  position: absolute;
  bottom: 14px;
  left: 14px;
  width: 56px;
  height: 56px;
}
.ring-svg { width: 100%; height: 100%; }

.kpi-tier-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
}
.tier-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid;
}
.tier-pill.tier-1 { background: rgba(96,165,250,0.10); color: var(--blue-300); border-color: rgba(96,165,250,0.30); }
.tier-pill.tier-2 { background: rgba(251,191,36,0.10); color: var(--amber-300); border-color: rgba(251,191,36,0.30); }
.tier-pill.tier-3 { background: rgba(244,63,94,0.10); color: var(--rose-300); border-color: rgba(244,63,94,0.30); }
.tier-pill .mono { font-weight: 700; color: inherit; }

.kpi-actions-breakdown {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--text-muted);
}

/* ===== Chart card (DSO) ===== */
.chart-card {
  background: var(--surface);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 24px 26px;
  box-shadow: var(--shadow-card);
}
.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 18px;
  gap: 18px;
  flex-wrap: wrap;
}
.section-title {
  font-family: 'Frank Ruhl Libre', 'Heebo', serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--slate-50);
  letter-spacing: -0.015em;
  margin-bottom: 4px;
}
.section-sub {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
  max-width: 720px;
}
.chart-legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--text-secondary);
  font-family: 'IBM Plex Mono', monospace;
}
.leg-item { display: inline-flex; align-items: center; gap: 6px; }
.leg-bar { width: 12px; height: 10px; border-radius: 2px; background: linear-gradient(180deg, var(--amber-400), var(--amber-600)); }
.leg-line { width: 16px; height: 2px; background: var(--blue-400); border-radius: 2px; }
.leg-target { width: 16px; height: 0; border-top: 2px dashed var(--rose-400); }

.dso-wrap {
  position: relative;
  overflow: visible;
}
#dsoSvg {
  width: 100%;
  height: 280px;
  overflow: visible;
}

/* SVG dso styles */
.dso-bar { transition: opacity 0.3s; cursor: pointer; }
.dso-bar:hover { opacity: 0.85; }
.dso-grid { stroke: rgba(148,163,184,0.10); stroke-width: 1; }
.dso-axis-label { font-family: 'IBM Plex Mono', monospace; font-size: 10px; fill: var(--text-muted); }
.dso-trend { fill: none; stroke: var(--blue-400); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.dso-target {
  stroke: var(--rose-400);
  stroke-width: 1.5;
  stroke-dasharray: 4 4;
  opacity: 0.7;
}

/* ===== 2-column grid ===== */
.grid-2col {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 22px;
}

/* ===== Card base ===== */
.card {
  background: var(--surface);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 22px 24px;
  box-shadow: var(--shadow-card);
}
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.link-btn {
  background: none;
  border: none;
  color: var(--amber-400);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  cursor: pointer;
  transition: color 0.2s;
  font-weight: 500;
}
.link-btn:hover { color: var(--amber-300); }

/* ===== Invoices ===== */
.filter-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  padding: 6px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s var(--bezier-soft);
}
.chip:hover { background: var(--surface-strong); color: var(--slate-100); }
.chip.active {
  background: rgba(251,191,36,0.12);
  border-color: var(--border-amber);
  color: var(--amber-300);
}

.invoice-list { display: flex; flex-direction: column; gap: 8px; max-height: 460px; overflow-y: auto; }
.invoice-list::-webkit-scrollbar { width: 6px; }
.invoice-list::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 6px; }

.invoice-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: rgba(241,245,249,0.025);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: all 0.2s;
  cursor: pointer;
}
.invoice-row:hover { background: rgba(241,245,249,0.05); border-color: var(--border-strong); }
.invoice-row.tier-3 { border-color: rgba(244,63,94,0.25); }
.invoice-row.tier-2 { border-color: rgba(251,191,36,0.20); }
.invoice-row.tier-1 { border-color: rgba(96,165,250,0.20); }

.inv-tier {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 700;
  font-size: 12px;
  color: var(--slate-900);
}
.inv-tier.t0 { background: var(--slate-500); color: var(--slate-100); }
.inv-tier.t1 { background: linear-gradient(135deg, var(--blue-300), var(--blue-500)); }
.inv-tier.t2 { background: linear-gradient(135deg, var(--amber-300), var(--amber-500)); }
.inv-tier.t3 { background: linear-gradient(135deg, var(--rose-300), var(--rose-500)); }

.inv-info { min-width: 0; }
.inv-client {
  font-size: 14px;
  font-weight: 600;
  color: var(--slate-50);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.inv-meta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--text-muted);
}
.inv-meta .overdue { color: var(--rose-400); font-weight: 500; }
.inv-meta .ontime { color: var(--emerald-400); }

.inv-amount {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 15px;
  font-weight: 600;
  color: var(--amber-300);
  white-space: nowrap;
}

.inv-status {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  padding: 4px 10px;
  border-radius: 100px;
  white-space: nowrap;
  font-weight: 500;
  letter-spacing: 0.03em;
}
.inv-status.pending { background: rgba(148,163,184,0.14); color: var(--slate-300); }
.inv-status.reminded { background: rgba(96,165,250,0.14); color: var(--blue-300); }
.inv-status.assertive { background: rgba(251,191,36,0.14); color: var(--amber-300); }
.inv-status.enforcement { background: rgba(244,63,94,0.14); color: var(--rose-300); }
.inv-status.paid { background: rgba(52,211,153,0.14); color: var(--emerald-400); }

/* ===== Action log ===== */
.log-feed {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  padding-right: 18px;
  max-height: 460px;
  overflow-y: auto;
}
.log-feed::-webkit-scrollbar { width: 6px; }
.log-feed::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 6px; }

.log-feed::before {
  content: '';
  position: absolute;
  top: 0; bottom: 0; right: 6px;
  width: 1px;
  background: var(--border);
}
.log-item {
  position: relative;
  padding: 12px 0 12px 0;
  border-bottom: 1px dashed var(--border);
}
.log-item:last-child { border-bottom: none; }
.log-item::before {
  content: '';
  position: absolute;
  top: 19px; right: -16px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--slate-500);
  box-shadow: 0 0 0 3px var(--bg-1);
}
.log-item.tier-1::before { background: var(--blue-400); }
.log-item.tier-2::before { background: var(--amber-400); }
.log-item.tier-3::before { background: var(--rose-400); }
.log-item.paid::before { background: var(--emerald-400); }
.log-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 4px;
}
.log-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--slate-100);
}
.log-time {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}
.log-body {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.log-body .mono { color: var(--amber-300); font-weight: 500; }

/* ===== Templates ===== */
.template-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.template-card {
  background: rgba(241,245,249,0.025);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px 18px;
  transition: all 0.25s var(--bezier);
  position: relative;
  overflow: hidden;
}
.template-card:hover { transform: translateY(-3px); border-color: var(--border-strong); }
.template-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent, var(--blue-400));
}
.tc-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.tc-icon {
  font-size: 18px;
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 8px;
  background: var(--surface);
}
.tc-title { font-size: 13px; font-weight: 600; color: var(--slate-100); }
.tc-tag {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.tc-snippet {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 12px;
  font-style: italic;
  opacity: 0.85;
}
.tc-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}
.tc-stat { text-align: center; }
.tc-stat-num {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 16px;
  font-weight: 700;
  color: var(--slate-100);
}
.tc-stat-num.accent { color: var(--amber-300); }
.tc-stat-label {
  font-size: 9px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ===== Escalation flow ===== */
.escalation-flow {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 14px;
  align-items: center;
}
.esc-step {
  background: rgba(241,245,249,0.025);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
}
.esc-step[data-tier="1"] { border-color: rgba(96,165,250,0.30); background: linear-gradient(135deg, rgba(96,165,250,0.05) 0%, transparent 100%); }
.esc-step[data-tier="2"] { border-color: rgba(251,191,36,0.30); background: linear-gradient(135deg, rgba(251,191,36,0.05) 0%, transparent 100%); }
.esc-step[data-tier="3"] { border-color: rgba(244,63,94,0.30); background: linear-gradient(135deg, rgba(244,63,94,0.05) 0%, transparent 100%); }
.esc-tier {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.esc-emoji { font-size: 32px; margin-bottom: 8px; line-height: 1; }
.esc-title {
  font-family: 'Frank Ruhl Libre', serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--slate-50);
  margin-bottom: 8px;
}
.esc-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 14px;
}
.esc-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  border-top: 1px dashed var(--border);
  padding-top: 10px;
}
.esc-meta strong { color: var(--slate-100); font-weight: 600; }
.esc-step[data-tier="1"] .esc-meta strong { color: var(--blue-300); }
.esc-step[data-tier="2"] .esc-meta strong { color: var(--amber-300); }
.esc-step[data-tier="3"] .esc-meta strong { color: var(--rose-300); }
.esc-arrow {
  width: 50px;
  height: 24px;
}

/* ===== Tech stack ===== */
.tech-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.tech-item {
  padding: 18px 20px;
  background: rgba(241,245,249,0.025);
  border: 1px solid var(--border);
  border-radius: 16px;
  transition: all 0.25s var(--bezier);
}
.tech-item:hover { transform: translateY(-3px); border-color: var(--border-strong); }
.tech-icon {
  display: inline-block;
  font-size: 11px;
  color: var(--amber-400);
  letter-spacing: 0.14em;
  margin-bottom: 8px;
  padding: 3px 8px;
  background: rgba(251,191,36,0.10);
  border: 1px solid var(--border-amber);
  border-radius: 6px;
}
.tech-item h4 {
  font-family: 'Frank Ruhl Libre', serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--slate-50);
  margin-bottom: 6px;
}
.tech-item p {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
}
.tech-item code {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--amber-300);
  background: rgba(251,191,36,0.08);
  padding: 1px 5px;
  border-radius: 4px;
}

/* ===== Footer ===== */
.footer {
  margin-top: 30px;
  padding: 22px 26px;
  border-top: 1px solid var(--border);
}
.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.footer-brand {
  font-family: 'Frank Ruhl Libre', serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--slate-100);
  margin-bottom: 2px;
}
.footer-tag {
  font-size: 11px;
  color: var(--text-muted);
}
.footer-links {
  display: flex;
  gap: 10px;
  font-size: 12px;
  color: var(--text-muted);
}
.footer-links a {
  color: var(--amber-400);
  text-decoration: none;
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--amber-300); }

/* ===== Toast ===== */
.toast-container {
  position: fixed;
  bottom: 22px;
  left: 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 200;
  pointer-events: none;
}
.toast {
  background: linear-gradient(135deg, rgba(30,41,59,0.95), rgba(15,23,42,0.95));
  border: 1px solid var(--border-strong);
  border-right: 3px solid var(--amber-400);
  border-radius: 12px;
  padding: 12px 18px;
  color: var(--slate-100);
  font-size: 13px;
  box-shadow: 0 14px 32px rgba(0,0,0,0.5);
  pointer-events: auto;
  backdrop-filter: blur(20px);
  animation: toast-in 0.4s var(--bezier);
  display: flex;
  align-items: center;
  gap: 10px;
}
.toast.success { border-right-color: var(--emerald-400); }
.toast.danger { border-right-color: var(--rose-400); }
@keyframes toast-in {
  from { transform: translateX(-100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ===== Responsive ===== */
@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2col { grid-template-columns: 1fr; }
  .template-grid { grid-template-columns: repeat(2, 1fr); }
  .tech-grid { grid-template-columns: repeat(2, 1fr); }
  .escalation-flow { grid-template-columns: 1fr; }
  .esc-arrow { display: none; }
  .topbar-nav { display: none; }
}
@media (max-width: 640px) {
  main { padding: 20px 16px 40px; gap: 20px; }
  .topbar { padding: 12px 16px; gap: 14px; }
  .user-meta { display: none; }
  .kpi-grid { grid-template-columns: 1fr; }
  .template-grid { grid-template-columns: 1fr; }
  .tech-grid { grid-template-columns: 1fr; }
  .hero-content { padding: 24px 22px; }
  .hero-amount { font-size: clamp(40px, 13vw, 60px); }
  .brand-name { display: none; }
}
