/* ============================================================
   Betul Dashboard  -  "Control Tower / Departures Board"
   Midnight navy, luminous gold + teal, mono numerals.
   Type: Bricolage Grotesque + Manrope + JetBrains Mono
   ============================================================ */

:root {
  --bg: #0a101d;
  --bg-2: #0e1626;
  --panel: #111b2e;
  --panel-2: #16233a;
  --line: rgba(255, 255, 255, 0.08);
  --line-soft: rgba(255, 255, 255, 0.05);
  --ink: #eef2fb;
  --muted: #8b98b8;
  --muted-2: #5f6d8c;
  --gold: #f4b62c;
  --teal: #34d1bf;
  --coral: #ff7a5c;
  --shadow: 0 30px 70px -40px rgba(0, 0, 0, 0.9);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background-color: var(--bg);
  background-image:
    radial-gradient(900px 480px at 88% -8%, rgba(244, 182, 44, 0.10), transparent 60%),
    radial-gradient(800px 480px at -6% 8%, rgba(52, 209, 191, 0.10), transparent 55%);
  color: var(--ink);
  font-family: "Manrope", system-ui, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
/* faint dot grid */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 30px 30px;
  opacity: 0.5;
}

.mono { font-family: "JetBrains Mono", ui-monospace, monospace; }
.display { font-family: "Bricolage Grotesque", "Manrope", sans-serif; font-weight: 700; letter-spacing: -0.01em; }

.kicker {
  display: inline-block;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px; font-weight: 500;
  letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--teal);
}

.error-line { color: var(--coral); font-size: 14px; min-height: 20px; margin-top: 10px; font-weight: 600; }
.error-line.center { text-align: center; }

/* ---------------- LOGIN ---------------- */
.login-wrap { position: relative; z-index: 1; min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: 100%; max-width: 420px;
  background: linear-gradient(180deg, var(--panel) 0%, var(--bg-2) 100%);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 40px 36px 34px;
  box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.login-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--teal), var(--gold), var(--coral));
}
.login-mark { display: block; border-radius: 12px; margin-bottom: 18px; box-shadow: 0 10px 24px -8px rgba(0,0,0,0.8); }
.login-title { font-family: "Bricolage Grotesque", sans-serif; font-weight: 800; font-size: 34px; line-height: 1.05; margin: 14px 0 10px; }
.login-sub { color: var(--muted); font-size: 15px; margin: 0 0 22px; }

.field {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 15px; font-family: inherit;
  color: var(--ink);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field::placeholder { color: var(--muted-2); }
.field:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 4px rgba(52, 209, 191, 0.14); }

.btn-primary {
  width: 100%; margin-top: 12px; border: none; border-radius: 12px;
  padding: 15px;
  font-family: "Bricolage Grotesque", sans-serif; font-size: 15px; font-weight: 800;
  color: #06231f;
  background: linear-gradient(100deg, var(--teal), var(--gold));
  cursor: pointer; transition: transform 0.12s, filter 0.2s;
}
.btn-primary:hover { filter: brightness(1.06); }
.btn-primary:active { transform: translateY(1px); }
.back-link { display: inline-block; margin-top: 20px; color: var(--muted); text-decoration: none; font-size: 14px; }
.back-link:hover { color: var(--ink); }

/* ---------------- MASTHEAD ---------------- */
.masthead { position: relative; z-index: 1; border-bottom: 1px solid var(--line); background: rgba(10, 16, 29, 0.7); backdrop-filter: blur(10px); }
.masthead-inner { max-width: 1120px; margin: 0 auto; padding: 22px 28px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.mast-brand { display: flex; align-items: center; gap: 14px; }
.mast-mark { border-radius: 11px; flex: none; box-shadow: 0 10px 24px -10px rgba(0,0,0,0.9); }
.mast-title { font-family: "Bricolage Grotesque", sans-serif; font-weight: 800; font-size: 24px; margin: 0; line-height: 1; }
.mast-title .sub { display: block; font-family: "JetBrains Mono", monospace; font-size: 10.5px; letter-spacing: 0.22em; color: var(--teal); font-weight: 500; margin-top: 6px; }
.mast-right { display: flex; align-items: center; gap: 16px; white-space: nowrap; }
.mast-clock { font-family: "JetBrains Mono", monospace; font-size: 13px; color: var(--muted); }
.btn-ghost {
  background: rgba(255,255,255,0.06); border: 1px solid var(--line); color: var(--ink);
  border-radius: 999px; padding: 8px 18px; font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background 0.2s;
}
.btn-ghost:hover { background: rgba(255,255,255,0.12); }

/* ---------------- PAGE ---------------- */
.page { position: relative; z-index: 1; max-width: 1120px; margin: 0 auto; padding: 40px 28px 20px; }
.dash-loading { text-align: center; padding: 90px 0; color: var(--muted); font-family: "JetBrains Mono", monospace; letter-spacing: 0.1em; }

/* ---------------- STAT BAND ---------------- */
.stat-band { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 46px; }
.stat {
  background: linear-gradient(180deg, var(--panel) 0%, var(--bg-2) 100%);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px 22px 20px;
  position: relative; overflow: hidden;
  opacity: 0; transform: translateY(14px);
  animation: rise 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
  transition: transform 0.2s, border-color 0.2s;
}
.stat:hover { transform: translateY(-3px); border-color: rgba(244,182,44,0.4); }
.stat::before { content: ""; position: absolute; top: 0; left: 22px; right: 22px; height: 2px; background: linear-gradient(90deg, var(--teal), var(--gold)); opacity: 0.7; }
.stat .stat-num { font-family: "JetBrains Mono", monospace; font-weight: 700; font-size: 44px; line-height: 1; color: var(--gold); text-shadow: 0 0 24px rgba(244,182,44,0.35); }
.stat .stat-num .suffix { font-size: 22px; color: var(--teal); }
.stat .stat-label { margin-top: 12px; font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink); }
.stat .stat-foot { font-size: 12.5px; color: var(--muted); margin-top: 3px; }

/* ---------------- SECTION HEADINGS ---------------- */
.section-head { display: flex; align-items: center; gap: 16px; margin: 0 0 20px; }
.section-head h2 { font-family: "Bricolage Grotesque", sans-serif; font-weight: 700; font-size: 24px; margin: 0; white-space: nowrap; }
.section-head .rule { flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), transparent); }

/* ---------------- CHARTS ---------------- */
.donut-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 50px; }
.charts-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-bottom: 50px; }
.chart-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px 22px 20px;
  opacity: 0; transform: translateY(14px);
  animation: rise 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}
.chart-card h3 { font-family: "Bricolage Grotesque", sans-serif; font-weight: 700; font-size: 17px; margin: 0 0 3px; }
.chart-card .chart-total { font-family: "JetBrains Mono", monospace; font-size: 10.5px; color: var(--muted-2); letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 14px; }
.chart-card .cwrap { position: relative; width: 100%; }
.chart-card canvas { display: block; }
.empty-note { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 40px 20px; background: var(--panel); border: 1px dashed var(--line); border-radius: 16px; font-family: "JetBrains Mono", monospace; font-size: 13px; }

/* ---------------- LEDGER TABLE ---------------- */
.ledger { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); margin-bottom: 30px; }
.table-scroll { overflow-x: auto; }
.resp-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 960px; }
.resp-table thead th {
  background: var(--panel-2); text-align: left; padding: 14px 14px;
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
  white-space: nowrap; border-bottom: 1px solid var(--line); position: sticky; top: 0;
}
.resp-table tbody td { padding: 13px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: top; color: var(--ink); }
.resp-table tbody tr:last-child td { border-bottom: none; }
.resp-table tbody tr:nth-child(even) td { background: rgba(255,255,255,0.018); }
.resp-table tbody tr:hover td { background: rgba(52,209,191,0.07); }
.resp-table td.name { font-family: "Bricolage Grotesque", sans-serif; font-weight: 700; font-size: 15px; color: var(--gold); white-space: nowrap; }
.resp-table td.muted { color: var(--muted-2); }

.chip { display: inline-block; background: rgba(255,255,255,0.05); border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; font-size: 11.5px; margin: 1px 3px 1px 0; white-space: nowrap; color: var(--ink); }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.pill.great { background: rgba(52,209,191,0.16); color: var(--teal); }
.pill.good  { background: rgba(244,182,44,0.16); color: var(--gold); }
.pill.okay  { background: rgba(255,255,255,0.08); color: var(--muted); }
.pill.bad   { background: rgba(255,122,92,0.16); color: var(--coral); }

.dash-foot { position: relative; z-index: 1; text-align: center; color: var(--muted-2); font-size: 12.5px; padding: 26px 20px 44px; font-family: "JetBrains Mono", monospace; letter-spacing: 0.06em; }

@keyframes rise { to { opacity: 1; transform: none; } }

/* ---------------- RESPONSIVE ---------------- */
@media (max-width: 900px) {
  .stat-band { grid-template-columns: repeat(2, 1fr); }
  .charts-grid { grid-template-columns: 1fr; }
}
@media (max-width: 540px) {
  .stat-band { grid-template-columns: 1fr 1fr; }
  .stat .stat-num { font-size: 36px; }
  .masthead-inner { flex-wrap: wrap; }
}
