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

:root {
  --bg:         #0a0e1a;
  --surface:    #111827;
  --surface2:   #1a2236;
  --surface3:   #162030;
  --border:     #1e2d45;
  --border2:    #253650;
  --green:      #00d48a;
  --green-dim:  rgba(0,212,138,.13);
  --yellow:     #f5a623;
  --yellow-dim: rgba(245,166,35,.13);
  --red:        #ff4d4d;
  --red-dim:    rgba(255,77,77,.13);
  --blue:       #4a9eff;
  --blue-dim:   rgba(74,158,255,.09);
  --orange:     #f07040;
  --text:       #e8edf5;
  --text-dim:   #6b7a99;
  --text-mid:   #9aa3b8;
  --mono:       'JetBrains Mono', monospace;
  --radius:     6px;
}

*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  line-height: 1.45;
  min-height: 100vh;
}

/* ─── TOPNAV ─── */
.topnav {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; gap: 0;
  height: 52px; padding: 0 24px;
  background: #080d14;
  border-bottom: 1px solid var(--border);
}
.brand { display:flex; align-items:center; gap:10px; margin-right:28px; flex-shrink:0; }
.brand-mark {
  width:32px; height:32px; border-radius:6px;
  background: var(--blue); display:grid; place-items:center;
  font-weight:800; font-size:15px; color:#fff;
}
.brand-name { font-size:15px; font-weight:700; }
.brand-sub  { font-size:10px; color:var(--text-dim); }

.tab-list { display:flex; }
.tab-btn {
  height:52px; padding:0 20px;
  border:none; border-bottom:2px solid transparent;
  background:transparent; color:var(--text-dim);
  font-size:13px; font-weight:500; cursor:pointer;
  font-family:inherit;
  transition: color .15s, border-color .15s;
  white-space:nowrap;
}
.tab-btn:hover { color:var(--text); }
.tab-btn.active { color:var(--blue); border-bottom-color:var(--blue); }

.topnav-right { margin-left:auto; display:flex; align-items:center; gap:12px; }
.nav-date { font-family:var(--mono); font-size:11px; color:var(--text-dim); }

/* ─── PAGES ─── */
.page { display:none; padding:20px; }
.page.active { display:block; }

/* ─── PAGE HEADER ─── */
.page-header {
  display:flex; justify-content:space-between; align-items:flex-start;
  margin-bottom:18px; padding-bottom:14px; border-bottom:1px solid var(--border);
}
.ph-label { font-size:10px; font-weight:600; letter-spacing:.2em; text-transform:uppercase; color:var(--blue); margin-bottom:3px; }
.ph-title { font-size:20px; font-weight:700; letter-spacing:-.02em; }
.ph-sub   { font-size:11px; color:var(--text-dim); margin-top:2px; font-family:var(--mono); }
.ph-right { display:flex; flex-direction:column; align-items:flex-end; gap:8px; }
.ph-controls { display:flex; gap:10px; align-items:center; }

.ctrl-label {
  display:flex; flex-direction:column; gap:3px;
  font-size:10px; color:var(--text-dim); font-weight:600; text-transform:uppercase; letter-spacing:.1em;
}
.ctrl-label select {
  background:var(--surface2); border:1px solid var(--border2);
  color:var(--text); border-radius:4px; padding:4px 8px;
  font-size:12px; font-family:inherit; cursor:pointer; outline:none;
}
.ctrl-label select:focus { border-color:var(--blue); }

/* ─── STATUS BADGE ─── */
.status-badge {
  display:inline-flex; align-items:center; gap:6px;
  padding:6px 14px; border-radius:4px;
  font-size:11px; font-weight:600; letter-spacing:.1em; text-transform:uppercase;
  border:1px solid;
}
.status-badge.green  { background:var(--green-dim);  border-color:var(--green);  color:var(--green); }
.status-badge.yellow { background:var(--yellow-dim); border-color:var(--yellow); color:var(--yellow); }
.status-badge.red    { background:var(--red-dim);    border-color:var(--red);    color:var(--red); }
.status-dot { width:6px; height:6px; border-radius:50%; background:currentColor; animation:pulse 2s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.3} }

/* ─── NAV BADGES ─── */
.nav-badges { display:flex; gap:8px; }
.nav-badge {
  display:inline-flex; align-items:center; gap:5px;
  padding:4px 10px; border-radius:3px; font-size:10px; font-weight:600;
  letter-spacing:.08em; text-transform:uppercase; border:1px solid;
}
.nav-badge.green  { background:var(--green-dim);  border-color:var(--green);  color:var(--green); }
.nav-badge.yellow { background:var(--yellow-dim); border-color:var(--yellow); color:var(--yellow); }
.nav-badge.red    { background:var(--red-dim);    border-color:var(--red);    color:var(--red); }
.nav-dot { width:5px; height:5px; border-radius:50%; background:currentColor; animation:pulse 2s infinite; }

/* ─── FX RATES ─── */
.exchange-rates { display:flex; gap:16px; }
.rate-item { font-family:var(--mono); font-size:11px; color:var(--text-dim); }
.rate-item span { color:var(--text-mid); }
.rate-delta.up   { color:var(--green); }
.rate-delta.down { color:var(--red); }

/* ─── ALERTS ─── */
.alerts-bar { display:flex; gap:10px; margin-bottom:18px; flex-wrap:wrap; }
.alert-chip {
  display:flex; align-items:flex-start; gap:8px;
  padding:9px 14px; border-radius:4px; font-size:12px;
  border:1px solid; flex:1; min-width:200px;
}
.alert-chip.red    { background:var(--red-dim);    border-color:var(--red);    color:var(--red); }
.alert-chip.yellow { background:var(--yellow-dim); border-color:var(--yellow); color:var(--yellow); }
.alert-body { color:var(--text); }
.alert-body strong { color:inherit; }

/* ─── GRID ─── */
.grid { display:grid; grid-template-columns:1fr 1fr 1fr; gap:12px; }
.card {
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius); padding:16px;
}
.card-wide { grid-column:span 2; }
.card-full { grid-column:span 3; }

.card-title {
  font-size:10px; font-weight:600; letter-spacing:.15em; text-transform:uppercase;
  color:var(--text-dim); margin-bottom:14px;
  display:flex; align-items:center; gap:8px;
}
.card-title::after { content:''; flex:1; height:1px; background:var(--border); }
.card-title .ct-badge {
  font-size:9px; padding:1px 6px; border-radius:2px; border:1px solid; font-weight:600;
}
.ct-badge.green  { border-color:var(--green);  color:var(--green);  background:var(--green-dim); }
.ct-badge.yellow { border-color:var(--yellow); color:var(--yellow); background:var(--yellow-dim); }
.ct-badge.red    { border-color:var(--red);    color:var(--red);    background:var(--red-dim); }

/* ─── COLOURS ─── */
.c-green  { color:var(--green); }
.c-yellow { color:var(--yellow); }
.c-red    { color:var(--red); }
.c-blue   { color:var(--blue); }
.c-dim    { color:var(--text-dim); }
.c-mid    { color:var(--text-mid); }

/* ─── BALANCE ─── */
.balance-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:12px; }
.balance-label { font-size:11px; color:var(--text-dim); margin-bottom:4px; }
.balance-value { font-family:var(--mono); font-size:18px; font-weight:600; }
.balance-unit  { font-size:10px; color:var(--text-dim); margin-left:2px; }

/* ─── DATA ROWS ─── */
.data-row {
  display:flex; justify-content:space-between; align-items:flex-start;
  padding:8px 0; border-bottom:1px solid var(--border);
}
.data-row:last-child { border-bottom:none; }
.data-row-label { font-size:12px; color:var(--text-mid); padding-top:2px; }
.data-row-right { text-align:right; }
.data-row-val   { font-family:var(--mono); font-size:13px; font-weight:600; }
.data-meta      { font-size:10px; font-family:var(--mono); color:var(--text-dim); margin-top:2px; }
.ytd-up   { color:var(--green); }
.ytd-warn { color:var(--yellow); }
.ytd-down { color:var(--red); }
.ytd-dim  { color:var(--text-dim); }

/* ─── RATIOS ─── */
.ratios-grid { display:grid; grid-template-columns:repeat(9,1fr); gap:8px; }
.ratio-item {
  background:var(--surface2); border-radius:5px; padding:12px 10px;
  border:1px solid var(--border); position:relative; overflow:hidden;
}
.ratio-item::before { content:''; position:absolute; top:0; left:0; right:0; height:3px; }
.ratio-item.green::before  { background:var(--green); }
.ratio-item.yellow::before { background:var(--yellow); }
.ratio-item.red::before    { background:var(--red); }
.ratio-name { font-size:10px; color:var(--text-dim); margin-bottom:5px; font-weight:500; }
.ratio-main { font-family:var(--mono); font-size:17px; font-weight:700; margin-bottom:4px; line-height:1; }
.ratio-item.green  .ratio-main { color:var(--green); }
.ratio-item.yellow .ratio-main { color:var(--yellow); }
.ratio-item.red    .ratio-main { color:var(--red); }
.ratio-meta { font-size:9px; color:var(--text-dim); font-family:var(--mono); line-height:1.5; }
.ratio-meta .lim      { color:var(--text-dim); }
.ratio-meta .m-up     { color:var(--green); }
.ratio-meta .m-warn   { color:var(--yellow); }
.ratio-meta .m-down   { color:var(--red); }

/* ─── LIQUIDITY BARS ─── */
.liq-row { margin-bottom:13px; }
.liq-row:last-child { margin-bottom:0; }
.liq-header { display:flex; justify-content:space-between; margin-bottom:4px; align-items:baseline; }
.liq-name   { font-size:11px; color:var(--text-mid); }
.liq-right  { text-align:right; }
.liq-val    { font-family:var(--mono); font-size:13px; font-weight:600; }
.liq-meta   { font-family:var(--mono); font-size:9px; color:var(--text-dim); }
.liq-bar-bg   { height:6px; background:var(--border); border-radius:3px; overflow:hidden; }
.liq-bar-fill { height:100%; border-radius:3px; }

/* ─── STRESS TABLE (chairman) ─── */
.stress-table { width:100%; border-collapse:collapse; }
.stress-table th {
  font-size:9px; color:var(--text-dim); font-weight:600;
  text-align:right; padding:0 0 8px; border-bottom:1px solid var(--border);
}
.stress-table th:first-child { text-align:left; }
.stress-table td {
  padding:7px 0; border-bottom:1px solid var(--border);
  font-family:var(--mono); font-size:11px; text-align:right;
}
.stress-table td:first-child { text-align:left; font-family:'Inter',sans-serif; font-size:11px; color:var(--text-mid); }
.stress-table tr:last-child td { border-bottom:none; }
.s-base  { color:var(--text); }
.s-mild  { color:var(--yellow); }
.s-severe{ color:var(--red); }
.stress-note { font-size:10px; color:var(--text-dim); margin-top:10px; font-family:var(--mono); }

/* ─── DEPOSITS ─── */
.dep-row { margin-bottom:12px; }
.dep-header { display:flex; justify-content:space-between; margin-bottom:4px; align-items:baseline; }
.dep-name { font-size:11px; color:var(--text-mid); }
.dep-right { text-align:right; }
.dep-pct   { font-family:var(--mono); font-size:13px; font-weight:600; }
.dep-meta  { font-family:var(--mono); font-size:9px; color:var(--text-dim); }
.dep-bar-bg   { height:8px; background:var(--border); border-radius:4px; overflow:hidden; }
.dep-bar-fill { height:100%; border-radius:4px; }
.dep-warning  {
  background:var(--yellow-dim); border:1px solid var(--yellow);
  border-radius:4px; padding:8px 10px; font-size:11px; color:var(--yellow); margin-top:6px;
}

/* ─── PROFIT TREND ─── */
.profit-number { font-family:var(--mono); font-size:30px; font-weight:700; color:var(--green); line-height:1; margin-bottom:3px; }
.profit-sub    { font-size:11px; color:var(--text-dim); margin-bottom:14px; }
.profit-trend  { display:flex; gap:4px; align-items:flex-end; height:48px; margin-bottom:6px; }
.trend-bar { flex:1; border-radius:2px 2px 0 0; position:relative; cursor:pointer; }
.trend-bar .tip {
  position:absolute; bottom:100%; left:50%; transform:translateX(-50%);
  background:var(--surface2); border:1px solid var(--border);
  padding:3px 6px; border-radius:3px; font-size:10px;
  font-family:var(--mono); white-space:nowrap;
  display:none; color:var(--text); z-index:10; margin-bottom:4px;
}
.trend-bar:hover .tip { display:block; }
.trend-dates { display:flex; justify-content:space-between; font-size:9px; color:var(--text-dim); font-family:var(--mono); }

/* ─── RISK: TIMELINE GRID ─── */
.risk-timeline { display:grid; grid-template-columns:180px repeat(5,1fr); gap:1px; background:var(--border); border:1px solid var(--border); border-radius:6px; overflow:hidden; }
.tl-head  { background:var(--surface2); padding:8px 10px; font-size:9px; font-weight:700; color:var(--text-dim); text-transform:uppercase; letter-spacing:.1em; text-align:center; }
.tl-head:first-child { text-align:left; }
.tl-label { background:var(--surface); padding:8px 10px; font-size:11px; color:var(--text-mid); display:flex; align-items:center; }
.tl-cell  { background:var(--surface); padding:5px 6px; display:flex; align-items:center; justify-content:center; }
.tl-chip  { display:inline-flex; align-items:center; justify-content:center; width:100%; padding:4px 4px; border-radius:3px; border:1px solid; font-size:10px; font-weight:700; text-align:center; font-family:var(--mono); }
.tl-chip.g { background:var(--green-dim);  border-color:var(--green);  color:var(--green); }
.tl-chip.y { background:var(--yellow-dim); border-color:var(--yellow); color:var(--yellow); }
.tl-chip.r { background:var(--red-dim);    border-color:var(--red);    color:var(--red); }

/* ─── RISK: NPL GRID ─── */
.npl-grid { display:grid; grid-template-columns:1fr 1fr; gap:20px; }
.npl-block-title { font-size:10px; font-weight:700; text-transform:uppercase; color:var(--text-dim); letter-spacing:.1em; margin-bottom:10px; }
.npl-bar-row { margin-bottom:12px; }
.npl-bar-header { display:flex; justify-content:space-between; margin-bottom:4px; font-size:11px; }
.npl-bar-label  { color:var(--text-mid); }
.npl-bar-val    { font-family:var(--mono); font-weight:600; }
.bar-bg   { height:6px; background:var(--border); border-radius:3px; overflow:hidden; }
.bar-fill { height:100%; border-radius:3px; }
.npl-sub  { font-size:9px; color:var(--text-dim); margin-top:3px; font-family:var(--mono); }
.npl-row  { display:flex; justify-content:space-between; align-items:flex-start; padding:6px 0; border-bottom:1px solid var(--border); }
.npl-row:last-child { border-bottom:none; }
.npl-row-label { font-size:11px; color:var(--text-mid); }
.npl-row-right { text-align:right; }
.npl-val  { font-family:var(--mono); font-size:12px; font-weight:600; }
.npl-sub2 { font-size:9px; color:var(--text-dim); font-family:var(--mono); }

/* ─── RISK: FX TABLE ─── */
.risk-fx-table { width:100%; border-collapse:collapse; }
.risk-fx-table th { font-size:9px; color:var(--text-dim); font-weight:600; text-align:right; padding:0 0 8px; border-bottom:1px solid var(--border); letter-spacing:.08em; text-transform:uppercase; }
.risk-fx-table th:first-child { text-align:left; }
.risk-fx-table td { padding:7px 0; border-bottom:1px solid var(--border); font-family:var(--mono); font-size:11px; text-align:right; }
.risk-fx-table td:first-child { text-align:left; font-family:'Inter',sans-serif; font-size:11px; color:var(--text-mid); }
.risk-fx-table tr:last-child td { border-bottom:none; }
.risk-table-note { font-size:9px; color:var(--text-dim); margin-top:8px; font-family:var(--mono); }

/* ─── RISK: CORR TABLE ─── */
.corr-table { width:100%; border-collapse:collapse; }
.corr-table th { font-size:9px; color:var(--text-dim); font-weight:600; text-align:right; padding:0 0 8px; border-bottom:1px solid var(--border); letter-spacing:.08em; text-transform:uppercase; }
.corr-table th:first-child { text-align:left; }
.corr-table td { padding:6px 0; border-bottom:1px solid var(--border); font-family:var(--mono); font-size:11px; text-align:right; }
.corr-table td:first-child { text-align:left; font-family:'Inter',sans-serif; color:var(--text-mid); font-size:11px; }
.corr-table tr:last-child td { border-bottom:none; }
.corr-ok     { color:var(--green);  font-size:9px; font-weight:600; }
.corr-warn   { color:var(--yellow); font-size:9px; font-weight:600; }

/* ─── RISK: CONCENTRATION ─── */
.conc-row { margin-bottom:12px; }
.conc-head { display:flex; justify-content:space-between; align-items:baseline; margin-bottom:4px; gap:8px; }
.conc-name  { font-size:11px; color:var(--text-mid); }
.conc-right { text-align:right; flex-shrink:0; }
.conc-val   { font-family:var(--mono); font-size:12px; font-weight:600; }
.conc-note  { font-size:9px; color:var(--text-dim); font-family:var(--mono); }
.conc-bar-bg   { height:7px; background:var(--border); border-radius:3px; overflow:hidden; }
.conc-bar-fill { height:100%; border-radius:3px; }

/* ─── RISK: STRESS TABS ─── */
.stress-tabs { display:flex; gap:6px; margin-bottom:12px; flex-wrap:wrap; }
.stress-tab {
  padding:5px 12px; border-radius:3px; font-size:10px; font-weight:600;
  border:1px solid var(--border); color:var(--text-dim); cursor:pointer;
  background:transparent; font-family:inherit; transition:all .15s;
}
.stress-tab:hover { color:var(--text); border-color:var(--border2); }
.stress-tab.active { background:var(--blue-dim); border-color:var(--blue); color:var(--blue); }
.stress-scenario { display:none; }
.stress-scenario.active { display:block; }
.risk-stress-table { width:100%; border-collapse:collapse; }
.risk-stress-table th { font-size:9px; color:var(--text-dim); font-weight:600; text-align:right; padding:0 0 8px; border-bottom:1px solid var(--border); }
.risk-stress-table th:first-child { text-align:left; }
.risk-stress-table td { padding:6px 0; border-bottom:1px solid var(--border); font-family:var(--mono); font-size:11px; text-align:right; }
.risk-stress-table td:first-child { text-align:left; font-family:'Inter',sans-serif; color:var(--text-mid); font-size:11px; }
.risk-stress-table tr:last-child td { border-bottom:none; }
.sv-base { color:var(--text); }
.sv-ok   { color:var(--green); }
.sv-warn { color:var(--yellow); }
.sv-bad  { color:var(--red); }
.stress-note-box { font-size:10px; margin-top:8px; padding:7px 10px; border-radius:4px; font-family:var(--mono); }
.stress-note-box.green  { background:var(--green-dim);  color:var(--green); }
.stress-note-box.yellow { background:var(--yellow-dim); color:var(--yellow); }
.stress-note-box.red    { background:var(--red-dim);    color:var(--red); }

/* ─── RISK: CAPITAL ROWS ─── */
.cap-row { display:flex; justify-content:space-between; align-items:flex-start; padding:7px 0; border-bottom:1px solid var(--border); }
.cap-row:last-child { border-bottom:none; }
.cap-label { font-size:11px; color:var(--text-mid); }
.cap-right { text-align:right; }
.cap-val   { font-family:var(--mono); font-size:12px; font-weight:600; }
.cap-meta  { font-size:9px; color:var(--text-dim); font-family:var(--mono); }

/* ─── FOOTER ─── */
.footer {
  margin-top:16px; padding:12px 20px;
  border-top:1px solid var(--border);
  display:flex; justify-content:space-between;
  font-size:10px; color:var(--text-dim); font-family:var(--mono);
}

/* ─── RESPONSIVE ─── */
@media (max-width:1200px) {
  .ratios-grid { grid-template-columns:repeat(5,1fr); }
  .balance-grid { grid-template-columns:repeat(2,1fr); }
}
@media (max-width:900px) {
  .grid { grid-template-columns:1fr; }
  .card-wide, .card-full { grid-column:span 1; }
  .npl-grid { grid-template-columns:1fr; }
  .risk-timeline { grid-template-columns:140px repeat(5,1fr); }
  .ratios-grid { grid-template-columns:repeat(3,1fr); }
}

/* ─── RISK PAGE: DAY STATS MINI-SCOREBOARD ─── */
.risk-day-stats {
  display: flex;
  gap: 6px;
}
.risk-day-stat {
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 5px;
  padding: 6px 12px;
  text-align: right;
  min-width: 140px;
}
.risk-day-label {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-dim);
  margin-bottom: 3px;
}
.risk-day-val {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 3px;
}
.risk-day-delta {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-dim);
}
