:root {
  --brand: #1a365d; --brand2: #2c5282; --bg: #f4f6f9; --card: #fff;
  --border: #d7dee8; --text: #1a202c; --muted: #5a6b80; --ok: #1f8a4c; --warn: #b7791f; --crit: #c0392b;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: 'Segoe UI', Arial, sans-serif; color: var(--text); background: var(--bg); font-size: 14px; }
a { color: var(--brand2); text-decoration: none; }
a:hover { text-decoration: underline; }

header.topbar { background: var(--brand); color: #fff; padding: 0 16px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
header.topbar .brand { font-weight: 700; font-size: 16px; padding: 12px 0; }
header.topbar nav { display: flex; gap: 14px; flex-wrap: wrap; }
header.topbar nav a { color: #cfe0f5; padding: 12px 2px; }
header.topbar nav a:hover, header.topbar nav a.active { color: #fff; text-decoration: none; border-bottom: 2px solid #fff; }
header.topbar .spacer { flex: 1; }
header.topbar form.company { margin: 0; }
header.topbar .user { color: #cfe0f5; font-size: 13px; }

main { max-width: 1200px; margin: 22px auto; padding: 0 18px; }
h1 { font-size: 22px; color: var(--brand); margin: 0 0 16px; }
h2 { font-size: 16px; color: var(--brand2); margin: 22px 0 10px; }

.card { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 16px; margin-bottom: 18px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.kpi { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; }
.kpi .label { color: var(--muted); font-size: 12px; }
.kpi .value { font-size: 20px; font-weight: 700; color: var(--brand); margin-top: 4px; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { border: 1px solid var(--border); padding: 7px 9px; text-align: left; vertical-align: top; }
th { background: var(--brand2); color: #fff; font-weight: 600; }
tr:nth-child(even) td { background: #f8fafc; }

label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 3px; }
input, select, textarea { width: 100%; padding: 8px; border: 1px solid var(--border); border-radius: 5px; font: inherit; background: #fff; }
.inline { display: inline-block; width: auto; }
textarea { min-height: 90px; }

.btn { display: inline-block; background: var(--brand2); color: #fff; border: none; padding: 8px 14px; border-radius: 5px; cursor: pointer; font: inherit; }
.btn:hover { background: var(--brand); text-decoration: none; }
.btn.secondary { background: #e2e8f0; color: var(--text); }
.btn.danger { background: var(--crit); }
.btn.small { padding: 4px 9px; font-size: 12px; }

.msg { padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; }
.msg.error { background: #fdecea; color: var(--crit); border: 1px solid #f5c6cb; }
.msg.ok { background: #e7f6ec; color: var(--ok); border: 1px solid #b6e2c6; }
.field-error { color: var(--crit); font-size: 12px; margin-top: 3px; }

.badge { padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.badge.ok { background: #e7f6ec; color: var(--ok); }
.badge.warn { background: #fdf2e2; color: var(--warn); }
.badge.crit { background: #fdecea; color: var(--crit); }
.muted { color: var(--muted); }
.right { text-align: right; }
.row { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; }
.row > div { flex: 1; min-width: 160px; }
.actions { display: flex; gap: 8px; }
form.inlineform { display: inline; margin: 0; }

/* ============================ Executive Dashboard ============================ */
main { max-width: 1280px; }

/* Hero */
.dash-hero {
  background: linear-gradient(120deg, #1a365d 0%, #2c5282 60%, #2b6cb0 100%);
  color: #fff; border-radius: 14px; padding: 26px 28px; margin-bottom: 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  box-shadow: 0 10px 30px -12px rgba(26, 54, 93, 0.5);
}
.hero-eyebrow { text-transform: uppercase; letter-spacing: 1.5px; font-size: 11px; color: #a9c7ec; font-weight: 600; }
.hero-title { color: #fff; font-size: 28px; margin: 4px 0 12px; line-height: 1.15; }
.hero-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { background: rgba(255,255,255,0.14); border: 1px solid rgba(255,255,255,0.22); color: #eaf2fb;
  padding: 4px 11px; border-radius: 20px; font-size: 12px; font-weight: 500; }
.chip-live { background: rgba(56, 178, 109, 0.22); border-color: rgba(104, 211, 145, 0.5); color: #c6f6d5; }
.hero-aside { text-align: right; }
.hero-stat-val { font-size: 40px; font-weight: 800; line-height: 1; }
.hero-stat-lbl { font-size: 12px; color: #a9c7ec; margin-top: 6px; }

/* KPI strip */
.kpi-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 20px; }
.metric { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px;
  position: relative; overflow: hidden; transition: transform .12s ease, box-shadow .12s ease; }
.metric::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--brand2); }
.metric:hover { transform: translateY(-2px); box-shadow: 0 8px 22px -14px rgba(26,54,93,0.45); }
.metric-top { display: flex; align-items: center; gap: 8px; }
.metric-ico { font-size: 16px; }
.metric-lbl { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.metric-val { font-size: 30px; font-weight: 800; color: var(--brand); margin: 8px 0 4px; line-height: 1; }
.metric-unit { font-size: 14px; font-weight: 600; color: var(--muted); margin-left: 4px; }
.metric-sub { display: flex; gap: 10px; align-items: center; font-size: 12px; flex-wrap: wrap; }
.delta { font-weight: 700; font-size: 12px; }
.delta.up { color: var(--ok); }
.delta.down { color: var(--crit); }

/* Panels & grids */
.dash-grid { display: grid; gap: 18px; margin-bottom: 18px; }
.g-2-1 { grid-template-columns: 2fr 1fr; }
.g-1-1 { grid-template-columns: 1fr 1fr; }
.panel { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px; margin-bottom: 18px; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.panel-head h2 { margin: 0; font-size: 15px; color: var(--brand); }
.panel-head .muted { font-size: 12px; }
.pad { padding: 18px 4px; }

/* Trend chart */
.chart-trend { width: 100%; height: 190px; display: block; }
.trend-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 6px; }

/* Donut */
.donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.donut { width: 160px; height: 160px; flex-shrink: 0; }
.donut-big { font-size: 26px; font-weight: 800; fill: var(--brand); }
.donut-small { font-size: 11px; fill: var(--muted); }
.legend { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 130px; }
.legend li { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 13px; border-bottom: 1px dashed var(--border); }
.legend li:last-child { border-bottom: none; }
.legend .dot { width: 11px; height: 11px; border-radius: 3px; flex-shrink: 0; }
.legend-val { margin-left: auto; font-weight: 700; color: var(--brand); }

/* Movement tiles */
.movement { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
.mv-tile { border-radius: 10px; padding: 14px; text-align: center; border: 1px solid var(--border); }
.mv-val { font-size: 24px; font-weight: 800; }
.mv-lbl { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; margin-top: 3px; }
.mv-new { background: #e7f6ec; } .mv-new .mv-val { color: #1f8a4c; }
.mv-exit { background: #fdecea; } .mv-exit .mv-val { color: #c0392b; }
.mv-inc { background: #e6f6f4; } .mv-inc .mv-val { color: #2c7a7b; }
.mv-dec { background: #fdf2e2; } .mv-dec .mv-val { color: #b7791f; }
.mv-flat { background: #f1f5f9; } .mv-flat .mv-val { color: #5a6b80; }
.mv-net { background: #ebf2fb; } .mv-net .mv-val.pos { color: #1f8a4c; } .mv-net .mv-val.neg { color: #c0392b; }

/* Bar lists */
.barlist { display: flex; flex-direction: column; gap: 9px; }
.barrow { display: grid; grid-template-columns: 70px 1fr 56px; align-items: center; gap: 10px; font-size: 13px; }
.barlbl { color: var(--text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.barlbl.wide { font-weight: 500; }
.bartrack { background: #edf2f7; border-radius: 6px; height: 14px; overflow: hidden; }
.barfill { display: block; height: 100%; background: linear-gradient(90deg, #2c5282, #3182ce); border-radius: 6px; min-width: 2px; }
.barfill.teal { background: linear-gradient(90deg, #285e61, #38a89d); }
.barfill.purple { background: linear-gradient(90deg, #553c9a, #805ad5); }
.barpct { text-align: right; font-weight: 700; color: var(--brand); font-variant-numeric: tabular-nums; }

/* Top holders */
.tophold td { vertical-align: middle; }
.tophold .rank { font-weight: 800; color: var(--brand2); text-align: center; width: 34px; }
.hname { font-weight: 600; }
.small { font-size: 11px; }
.strong { font-weight: 700; }
.cat { font-size: 11px; color: var(--muted); }
.pctcell { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.minitrack { background: #edf2f7; border-radius: 5px; height: 8px; flex: 1; overflow: hidden; }
.minifill { display: block; height: 100%; background: linear-gradient(90deg, #2c5282, #3182ce); }

/* Gauges */
.gauges { display: flex; gap: 18px; justify-content: space-around; flex-wrap: wrap; }
.gauge { text-align: center; }
.gauge svg { width: 120px; height: 120px; }
.gauge-val { font-size: 20px; font-weight: 800; fill: var(--brand); }
.gauge-lbl { font-size: 13px; color: var(--muted); margin-top: 4px; font-weight: 600; }

/* Data quality */
.dq-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.dq-tile { border-radius: 10px; padding: 14px 16px; border: 1px solid var(--border); }
.dq-val { font-size: 26px; font-weight: 800; }
.dq-lbl { font-size: 12px; font-weight: 600; margin-top: 2px; }
.dq-sub { font-size: 11px; color: var(--muted); margin-top: 4px; }
.dq-tile.ok { background: #e7f6ec; border-color: #b6e2c6; } .dq-tile.ok .dq-val { color: #1f8a4c; }
.dq-tile.warn { background: #fdf2e2; border-color: #f3d9a8; } .dq-tile.warn .dq-val { color: #b7791f; }
.dq-tile.crit { background: #fdecea; border-color: #f5c6cb; } .dq-tile.crit .dq-val { color: #c0392b; }

.dash-foot { font-size: 11px; text-align: center; margin: 8px 0 24px; }

/* Empty states */
.empty-state { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 48px 24px; text-align: center; margin-top: 20px; }
.empty-icon { font-size: 44px; margin-bottom: 8px; }
.empty-state h2 { color: var(--brand); margin: 6px 0; }

/* Responsive */
@media (max-width: 900px) {
  .g-2-1, .g-1-1 { grid-template-columns: 1fr; }
  .hero-aside { text-align: left; }
  .hero-title { font-size: 23px; }
}
