:root {
  --bg: #0b1625;
  --surface: #122338;
  --surface-2: #172b42;
  --surface-3: #1c334d;
  --text: #eef4fb;
  --muted: #a8b7c8;
  --line: #29425e;
  --cm-green: #29b7a9;
  --cm-green-2: #5eead4;
  --primary-soft: rgba(41, 183, 169, .16);
  --danger: #e6473b;
  --warning: #e0c92f;
  --success: #2fb86a;
  --shadow: 0 14px 36px rgba(0, 0, 0, .3);
  --radius: 14px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); }
body { min-height: 100dvh; overflow-x: hidden; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: var(--cm-green-2); }
h1, h2, h3 { line-height: 1.2; }
.muted { color: var(--muted); }

/* Shell */
html, body { height: 100%; overflow: hidden; }
.app-shell { height: 100dvh; display: grid; grid-template-columns: 248px 1fr; }
.app-nav { height: 100%; overflow: hidden; background: linear-gradient(180deg, #07111e, #10243a); border-right: 1px solid var(--line); padding: 20px 14px; display: flex; flex-direction: column; gap: 6px; }
.nav-scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding-right: 2px; }
.nav-scroll::-webkit-scrollbar { width: 6px; }
.nav-scroll::-webkit-scrollbar-thumb { background: var(--line); border-radius: 999px; }
.nav-group { margin-bottom: 4px; }
.nav-group-label { display: flex; align-items: center; gap: 8px; padding: 14px 10px 6px 12px; margin-bottom: 2px; font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; border-left: 3px solid transparent; cursor: default; user-select: none; }
.nav-group-label .cat-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
/* Each category gets a distinct accent color so it's immediately clear these are section headers (plain text), not clickable screens like the items below them. */
.nav-group:nth-of-type(1) .nav-group-label { color: #7fa8f0; border-left-color: #3b7de6; }
.nav-group:nth-of-type(1) .cat-dot { background: #3b7de6; }
.nav-group:nth-of-type(2) .nav-group-label { color: #7fd6a8; border-left-color: #2fb86a; }
.nav-group:nth-of-type(2) .cat-dot { background: #2fb86a; }
.nav-group:nth-of-type(3) .nav-group-label { color: #f0b199; border-left-color: #e6832f; }
.nav-group:nth-of-type(3) .cat-dot { background: #e6832f; }
.nav-group:nth-of-type(4) .nav-group-label { color: #f0e08c; border-left-color: #e0c92f; }
.nav-group:nth-of-type(4) .cat-dot { background: #e0c92f; }
.nav-group:nth-of-type(5) .nav-group-label { color: #90e3da; border-left-color: #29b7a9; }
.nav-group:nth-of-type(5) .cat-dot { background: #29b7a9; }
.nav-group:nth-of-type(6) .nav-group-label { color: #d9a8f0; border-left-color: #9a5be0; }
.nav-group:nth-of-type(6) .cat-dot { background: #9a5be0; }
.nav-group:nth-of-type(7) .nav-group-label { color: #f0a1c4; border-left-color: #e64791; }
.nav-group:nth-of-type(7) .cat-dot { background: #e64791; }
.nav-group:nth-of-type(8) .nav-group-label { color: #f09999; border-left-color: #e6473b; }
.nav-group:nth-of-type(8) .cat-dot { background: #e6473b; }
.nav-link-pending { opacity: .55; }
.pending-badge { margin-left: auto; font-size: 9px; font-weight: 800; padding: 2px 6px; border-radius: 999px; background: var(--surface-3); color: var(--muted); }
.app-brand { display: flex; align-items: center; gap: 12px; padding: 8px 8px 22px; }
.brand-mark { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: #06231f; font-weight: 900; font-size: 18px; background: linear-gradient(145deg, var(--cm-green), var(--cm-green-2)); box-shadow: 0 8px 18px rgba(41,183,169,.3); }
.brand-name { font-size: 16px; font-weight: 800; letter-spacing: .02em; }
.brand-sub { color: var(--muted); font-size: 11px; }
.nav-link { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 10px; color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 600; transition: background .15s, color .15s; }
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link.active { background: var(--primary-soft); color: var(--cm-green-2); }
.nav-footer { margin-top: auto; padding: 12px 8px; color: var(--muted); font-size: 11px; }
.app-main { height: 100%; overflow-y: auto; padding: 26px 32px 60px; max-width: 1680px; }
.app-main::-webkit-scrollbar { width: 8px; }
.app-main::-webkit-scrollbar-thumb { background: var(--line); border-radius: 999px; }
.app-topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; gap: 12px; flex-wrap: wrap; }
.conn-pill { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; padding: 6px 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); }
.conn-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
.conn-pill.live .conn-dot { background: var(--success); box-shadow: 0 0 0 3px rgba(47,184,106,.25); }
.conn-pill.live { color: var(--success); }

/* Cards & layout */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-body { padding: 20px 22px; }
.card-header { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card-header h2 { margin: 0; font-size: 16px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

/* Forms */
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .04em; }
.input { width: 100%; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; color: var(--text); }
.input:focus { outline: 2px solid var(--cm-green); outline-offset: 1px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 10px; border: 1px solid transparent; font-weight: 700; font-size: 14px; transition: transform .1s, filter .15s; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(135deg, var(--cm-green), var(--cm-green-2)); color: #06231f; }
.btn-primary:hover { filter: brightness(1.06); }
.btn-secondary { background: var(--surface-2); border-color: var(--line); color: var(--text); }
.btn-secondary:hover { background: var(--surface-3); }
.btn-danger { background: rgba(230,71,59,.14); color: #ff9a8f; border-color: rgba(230,71,59,.4); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-block { width: 100%; }

.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; }
.badge-draft { background: var(--surface-3); color: var(--muted); }
.badge-generated { background: rgba(224,201,47,.16); color: var(--warning); }
.badge-processed { background: rgba(47,184,106,.16); color: var(--success); }

/* Results table (generated preview) */
.results-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.results-table th, .results-table td { padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--line); }
.results-table th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.party-swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; margin-right: 8px; vertical-align: -1px; }
.totals-strip { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 10px; }
.totals-strip .stat { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 16px; }
.totals-strip .stat .n { font-size: 18px; font-weight: 800; }
.totals-strip .stat .l { font-size: 11px; color: var(--muted); text-transform: uppercase; }

/* Upload / dropzone */
.dropzone { border: 2px dashed var(--line); border-radius: var(--radius); padding: 34px 20px; text-align: center; color: var(--muted); transition: border-color .15s, background .15s; cursor: pointer; }
.dropzone.drag { border-color: var(--cm-green); background: var(--primary-soft); color: var(--text); }
.dropzone input { display: none; }

/* Validation alerts */
.alert { border-radius: 12px; padding: 16px 18px; border: 1px solid; margin-top: 16px; }
.alert h3 { margin: 0 0 6px; font-size: 15px; }
.alert p { margin: 0; font-size: 13px; line-height: 1.55; }
.alert-success { background: rgba(47,184,106,.1); border-color: rgba(47,184,106,.35); color: #a9f0c6; }
.alert-error { background: rgba(230,71,59,.1); border-color: rgba(230,71,59,.35); color: #ffb4ab; }
.alert-warning { background: rgba(224,201,47,.1); border-color: rgba(224,201,47,.35); color: #f2e59a; }

/* PDF viewer */
.pdf-frame { width: 100%; height: 560px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }

/* Ranking bars */
.bar-row { margin-bottom: 14px; }
.bar-row .bar-label { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.bar-track { height: 14px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; transition: width .5s ease; }

/* Ranking cards */
.rank-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.rank-card { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 16px; position: relative; overflow: hidden; transition: transform .2s; }
.rank-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--party-color, var(--cm-green)); }
.rank-card .medal { font-size: 12px; color: var(--muted); font-weight: 800; }
.rank-card .party { font-weight: 800; margin: 6px 0 10px; display: flex; align-items: center; gap: 8px; }
.rank-card .votes { font-size: 24px; font-weight: 900; font-variant-numeric: tabular-nums; }
.rank-card .pct { color: var(--muted); font-size: 13px; margin-top: 2px; }

/* Guide */
.modal-backdrop { position: fixed; inset: 0; background: rgba(3,10,20,.65); display: flex; align-items: center; justify-content: center; padding: 24px; z-index: 60; }
.modal { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); max-width: 720px; width: 100%; max-height: 84vh; overflow: auto; box-shadow: var(--shadow); }
.modal-header { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; background: var(--surface); }
.modal-body { padding: 20px 22px; }
.scenario { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin-bottom: 12px; }
.scenario h4 { margin: 0 0 8px; font-size: 14px; color: var(--cm-green-2); }
.scenario ol { margin: 0; padding-left: 18px; font-size: 13px; color: var(--muted); line-height: 1.7; }
.scenario .expect { margin-top: 8px; font-size: 12px; font-weight: 700; }
.icon-btn { background: transparent; border: none; color: var(--muted); font-size: 20px; }

/* Toasts */
#toast-root { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 80; }
.toast { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--cm-green); border-radius: 10px; padding: 12px 16px; box-shadow: var(--shadow); font-size: 13px; min-width: 240px; animation: toast-in .18s ease; }
.toast.error { border-left-color: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.btn-sm { padding: 6px 12px; font-size: 12px; }
.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 12px; }
.pagination-status { font-size: 12px; color: var(--muted); }

/* Page grid: main content + simulated ops sidebar */
.page-grid { display: grid; grid-template-columns: minmax(0, 3.6fr) minmax(260px, 1fr); gap: 20px; align-items: start; }
.page-aside { position: sticky; top: 18px; display: flex; flex-direction: column; gap: 16px; }
.widget-card .card-header h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .03em; }
.widget-badge { font-size: 10px; padding: 2px 8px; }

/* Telemetry widget */
.telemetry-row { display: grid; grid-template-columns: 64px 1fr 52px; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); }
.telemetry-track { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.telemetry-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--cm-green), var(--cm-green-2)); transition: width .6s ease; }
.telemetry-fill.warn { background: linear-gradient(90deg, var(--warning), #f2b90a); }
.telemetry-fill.hot { background: linear-gradient(90deg, var(--danger), #ff8a7a); }
.container-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.container-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); }
.container-chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 2px rgba(47,184,106,.2); }
.container-chip.enter { animation: chip-in .35s ease; }
@keyframes chip-in { from { opacity: 0; transform: scale(.7); } to { opacity: 1; transform: scale(1); } }

/* Storage latency sparkline */
.spark-line { fill: none; stroke: var(--cm-green-2); stroke-width: 2; }
.spark-fill { fill: rgba(41,183,169,.14); stroke: none; }

/* Live hash chain */
.chain-list { display: flex; flex-direction: column; gap: 8px; max-height: 300px; overflow: hidden; }
.chain-block { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; animation: block-in .3s ease; }
.chain-block-top { display: flex; justify-content: space-between; font-size: 11px; margin-bottom: 4px; }
.chain-block-top strong { color: var(--cm-green-2); }
@keyframes block-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }

/* Network / voting centers */
.center-row { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.center-row .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line); flex-shrink: 0; transition: background .3s, box-shadow .3s; }
.center-row .dot.active { background: var(--success); box-shadow: 0 0 0 3px rgba(47,184,106,.2); }
.center-row .name { flex: 1; color: var(--text); }

/* Worker nodes */
.node-row { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.node-row .name { flex: 1; color: var(--text); font-weight: 600; }
.node-badge { font-size: 9px; padding: 2px 7px; border-radius: 999px; font-weight: 800; letter-spacing: .03em; }
.node-badge.running { background: rgba(47,184,106,.16); color: var(--success); }
.node-badge.scaling { background: rgba(224,201,47,.16); color: var(--warning); }
.node-mini-track { width: 50px; height: 5px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.node-mini-fill { height: 100%; background: var(--cm-green-2); transition: width .5s ease; }
.node-row.enter { animation: chip-in .3s ease; }

@media (max-width: 880px) {
  .page-grid { grid-template-columns: 1fr; }
  .page-aside { position: static; }
}

table.audit-table { width: 100%; font-size: 12px; border-collapse: collapse; }
table.audit-table th, table.audit-table td { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: left; }
code.hash { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11px; color: var(--muted); word-break: break-all; }

/* Mobile public page */
.mobile-shell { min-height: 100dvh; padding: 22px 16px 60px; max-width: 480px; margin: 0 auto; }
.mobile-header { text-align: center; margin-bottom: 18px; }
.mobile-header .eyebrow { color: var(--cm-green-2); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.mobile-header h1 { font-size: 20px; margin: 6px 0 0; }
.mobile-updated { text-align: center; color: var(--muted); font-size: 12px; margin-top: 16px; }

@media (max-width: 880px) {
  html, body { overflow: auto; }
  .app-shell { grid-template-columns: 1fr; height: auto; }
  .app-nav { flex-direction: row; height: auto; overflow-x: auto; overflow-y: hidden; padding: 10px; }
  .app-brand { display: none; }
  .nav-footer { display: none; }
  .app-main { height: auto; overflow-y: visible; padding: 18px 16px 48px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* --- Process placeholder (coming soon) --- */
.placeholder-card { text-align: center; padding: 60px 24px; }
.placeholder-icon { font-size: 42px; margin-bottom: 14px; }
.placeholder-badge { display: inline-block; margin-top: 14px; padding: 6px 14px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); font-size: 12px; font-weight: 700; }

/* --- Industry tabs (Multi-Industry Dashboards) --- */
.industry-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.industry-tab { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); font-size: 13px; font-weight: 700; cursor: pointer; }
.industry-tab.active { background: var(--primary-soft); border-color: var(--cm-green); color: var(--cm-green-2); }
.metric-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.metric-card { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.metric-card .label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.metric-card .value { font-size: 22px; font-weight: 800; margin-top: 4px; }
.metric-card .delta { font-size: 12px; font-weight: 700; margin-top: 2px; }
.metric-card .delta.up { color: var(--success); }
.metric-card .delta.down { color: var(--danger); }
.trend-bars { display: flex; align-items: flex-end; gap: 4px; height: 90px; margin-top: 10px; }
.trend-bars .bar { flex: 1; background: linear-gradient(180deg, var(--cm-green-2), var(--cm-green)); border-radius: 3px 3px 0 0; min-height: 3px; transition: height .4s ease; }

/* --- Geo Heatmap --- */
.heatmap-grid { display: grid; gap: 3px; }
.heatmap-cell { border-radius: 3px; background: var(--surface-2); transition: background .3s ease; }
.geo-legend { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--muted); margin-top: 10px; }
.geo-legend .swatch { width: 14px; height: 14px; border-radius: 3px; }
.event-feed { display: flex; flex-direction: column; gap: 6px; font-size: 12px; max-height: 220px; overflow-y: auto; }
.event-feed .event-row { display: flex; justify-content: space-between; padding: 6px 10px; background: var(--surface-2); border-radius: 8px; border: 1px solid var(--line); }

/* --- BI Explorer --- */
.pivot-bars { display: flex; flex-direction: column; gap: 10px; }
.pivot-bar-row .pivot-label { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 4px; }
.pivot-track { height: 12px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.pivot-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--cm-green), var(--cm-green-2)); transition: width .5s ease; }

/* --- Executive Scorecard --- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.kpi-card { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.kpi-card .kpi-name { font-weight: 700; font-size: 14px; }
.kpi-card .kpi-category { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; margin-bottom: 8px; }
.kpi-card .kpi-values { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 8px; }
.kpi-status { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 10px; font-weight: 800; letter-spacing: .03em; }
.kpi-status.on-target { background: rgba(47,184,106,.16); color: var(--success); }
.kpi-status.at-risk { background: rgba(224,201,47,.16); color: var(--warning); }
.kpi-status.off-target { background: rgba(230,71,59,.16); color: var(--danger); }
.kpi-track { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin-top: 10px; }
.kpi-fill { height: 100%; border-radius: 999px; transition: width .5s ease; }
.kpi-fill.on-target { background: var(--success); }
.kpi-fill.at-risk { background: var(--warning); }
.kpi-fill.off-target { background: var(--danger); }

/* --- Package Tracking --- */
.package-timeline { display: flex; align-items: center; gap: 4px; margin: 14px 0; flex-wrap: wrap; }
.timeline-step { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 1; min-width: 90px; }
.timeline-dot { width: 22px; height: 22px; border-radius: 50%; background: var(--surface-3); border: 2px solid var(--line); display: flex; align-items: center; justify-content: center; font-size: 11px; }
.timeline-step.done .timeline-dot { background: var(--cm-green); border-color: var(--cm-green); color: #06231f; }
.timeline-step.current .timeline-dot { background: var(--primary-soft); border-color: var(--cm-green); color: var(--cm-green-2); }
.timeline-label { font-size: 11px; color: var(--muted); text-align: center; }
.timeline-step.done .timeline-label, .timeline-step.current .timeline-label { color: var(--text); font-weight: 700; }
.timeline-line { flex: 1; height: 2px; background: var(--line); margin-top: -20px; }
.timeline-line.done { background: var(--cm-green); }

/* --- Fleet Tracking --- */
.fleet-map {
  position: relative; overflow: hidden; border-radius: 10px; border: 1px solid #1c4d3a;
  background:
    radial-gradient(circle at 50% 50%, rgba(47,184,106,.08), transparent 65%),
    repeating-linear-gradient(0deg, rgba(47,184,106,.07) 0px, rgba(47,184,106,.07) 1px, transparent 1px, transparent 32px),
    repeating-linear-gradient(90deg, rgba(47,184,106,.07) 0px, rgba(47,184,106,.07) 1px, transparent 1px, transparent 32px),
    linear-gradient(180deg, #030a06, #06140d);
}
.fleet-map::before {
  content: ''; position: absolute; inset: -20%; pointer-events: none;
  background: conic-gradient(from 0deg, rgba(47,184,106,.35), transparent 25%, transparent 100%);
  animation: radar-sweep 4s linear infinite;
  mix-blend-mode: screen;
}
.fleet-map::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; border-radius: 10px;
  box-shadow: inset 0 0 60px rgba(0,0,0,.6);
}
@keyframes radar-sweep { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.fleet-marker { position: absolute; width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; transform: translate(-50%, -50%); transition: left .6s ease, top .6s ease; background: rgba(6,20,13,.9); border: 2px solid var(--cm-green-2); box-shadow: 0 0 10px rgba(47,184,106,.7), 0 0 2px #fff; z-index: 1; }
.fleet-marker.low-battery { border-color: var(--danger); box-shadow: 0 0 10px rgba(230,71,59,.8); }
.vehicle-list { display: flex; flex-direction: column; gap: 8px; }
.vehicle-row { display: flex; align-items: center; gap: 10px; font-size: 12px; padding: 8px 10px; background: var(--surface-2); border-radius: 8px; border: 1px solid var(--line); }
.vehicle-row .name { flex: 1; font-weight: 700; }
.battery-track { width: 60px; height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.battery-fill { height: 100%; background: var(--success); }
.battery-fill.low { background: var(--danger); }

/* --- Warehouse Inventory --- */
.inventory-table td.below-reorder { color: var(--danger); font-weight: 700; }

/* --- Traceability Ledger --- */
.ledger-chain { display: flex; flex-direction: column; gap: 8px; }
.ledger-block { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.ledger-block-top { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 4px; }
.ledger-block-top strong { color: var(--cm-green-2); }
.asset-list-item { padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; margin-bottom: 8px; }
.asset-list-item.active { border-color: var(--cm-green); background: var(--primary-soft); }

/* --- Customs Manifest --- */
.manifest-status { padding: 2px 10px; border-radius: 999px; font-size: 10px; font-weight: 800; }
.manifest-status.filed { background: var(--surface-3); color: var(--muted); }
.manifest-status.under_review { background: rgba(224,201,47,.16); color: var(--warning); }
.manifest-status.cleared { background: rgba(47,184,106,.16); color: var(--success); }
.manifest-status.held { background: rgba(230,71,59,.16); color: var(--danger); }
#pkg-table tr.active, .results-table tr.active { background: var(--primary-soft); }

/* --- Dashboard widget grid & cards (Multi-Industry Dashboards) --- */
.dashwidget-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.dashwidget-card { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.dashwidget-card .dw-title { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 12px; font-weight: 700; }

/* Gauge */
.gauge-ring { width: 120px; height: 120px; border-radius: 50%; margin: 0 auto 10px; display: flex; align-items: center; justify-content: center; position: relative; }
.gauge-ring::before { content: ''; position: absolute; inset: 10px; border-radius: 50%; background: var(--surface-2); }
.gauge-value { position: relative; z-index: 1; font-size: 20px; font-weight: 800; }
.gauge-unit { font-size: 11px; color: var(--muted); position: relative; z-index: 1; }
.gauge-label { text-align: center; font-size: 12px; color: var(--muted); margin-top: 4px; }

/* Donut */
.donut-wrap { display: flex; align-items: center; gap: 16px; }
.donut-ring { width: 100px; height: 100px; border-radius: 50%; flex-shrink: 0; }
.donut-legend { display: flex; flex-direction: column; gap: 6px; font-size: 12px; flex: 1; }
.donut-legend-row { display: flex; align-items: center; gap: 8px; }
.donut-legend-row .sw { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.donut-legend-row .name { flex: 1; color: var(--muted); }
.donut-legend-row .val { font-weight: 700; }

/* Sparkline (colorful, reused shape from sidebar widget but bigger) */
.dw-spark { width: 100%; height: 70px; }

/* Funnel */
.funnel-rows { display: flex; flex-direction: column; gap: 8px; }
.funnel-row .funnel-label { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 4px; }
.funnel-track { height: 14px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.funnel-fill { height: 100%; border-radius: 6px; transition: width .4s ease; }

/* Blockchain ticker (colorful action chips) */
.dw-chain { display: flex; flex-direction: column; gap: 6px; max-height: 200px; overflow-y: auto; }
.dw-chain-block { display: flex; align-items: center; gap: 8px; padding: 7px 10px; background: var(--surface-3); border-radius: 8px; font-size: 11px; }
.dw-chain-badge { padding: 2px 8px; border-radius: 999px; font-size: 10px; font-weight: 800; color: #06231f; flex-shrink: 0; }
.dw-chain-hash { color: var(--muted); font-family: ui-monospace, monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }

/* Heat strip */
.heatstrip-grid { display: grid; gap: 3px; }
.heatstrip-cell { border-radius: 3px; aspect-ratio: 1; }

/* Categorical bars (colorful, replaces the old uniform-green pivot bars) */
.color-bars { display: flex; flex-direction: column; gap: 10px; }
.color-bar-row .cb-label { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 4px; }
.color-bar-row .cb-label .sw { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; }
.color-bar-track { height: 12px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.color-bar-fill { height: 100%; border-radius: 999px; transition: width .5s ease; }

/* --- E-Signature Workflow --- */
.signer-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--surface-2); border-radius: 8px; border: 1px solid var(--line); margin-bottom: 8px; }
.signer-row .name { flex: 1; font-weight: 700; }
.signer-badge { padding: 2px 9px; border-radius: 999px; font-size: 10px; font-weight: 800; }
.signer-badge.pending { background: var(--surface-3); color: var(--muted); }
.signer-badge.signed { background: rgba(47,184,106,.16); color: var(--success); }

/* --- Kanban board --- */
.kanban-board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.kanban-col { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px; min-height: 200px; }
.kanban-col-title { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 800; margin-bottom: 10px; display: flex; justify-content: space-between; }
.kanban-card { background: var(--surface-3); border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin-bottom: 8px; font-size: 12px; }
.kanban-card .title { font-weight: 700; margin-bottom: 6px; }
.priority-badge { padding: 1px 7px; border-radius: 999px; font-size: 9px; font-weight: 800; }
.priority-badge.low { background: rgba(47,184,106,.16); color: var(--success); }
.priority-badge.medium { background: rgba(224,201,47,.16); color: var(--warning); }
.priority-badge.high { background: rgba(230,71,59,.16); color: var(--danger); }
.kanban-card .actions { display: flex; gap: 6px; margin-top: 8px; }

/* --- Digital Case File --- */
.casefile-doc-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--surface-2); border-radius: 8px; border: 1px solid var(--line); margin-bottom: 6px; font-size: 12px; }
.casefile-doc-row .cat { padding: 1px 8px; border-radius: 999px; background: var(--surface-3); color: var(--muted); font-size: 10px; font-weight: 700; }

@media (max-width: 880px) {
  .kanban-board { grid-template-columns: 1fr; }
}

/* --- Bank Transaction Simulator --- */
.account-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.account-card { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.account-card .holder { font-size: 12px; color: var(--muted); }
.account-card .balance { font-size: 20px; font-weight: 800; margin-top: 4px; }
.txn-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--surface-2); border-radius: 8px; border: 1px solid var(--line); margin-bottom: 6px; font-size: 12px; }
.txn-type { padding: 1px 8px; border-radius: 999px; font-size: 10px; font-weight: 800; }
.txn-type.deposit { background: rgba(47,184,106,.16); color: var(--success); }
.txn-type.withdrawal { background: rgba(230,71,59,.16); color: var(--danger); }
.txn-type.transfer { background: rgba(59,125,230,.16); color: #7fa8f0; }
.txn-status { padding: 1px 8px; border-radius: 999px; font-size: 10px; font-weight: 800; }
.txn-status.completed { background: var(--surface-3); color: var(--muted); }
.txn-status.flagged_for_review { background: rgba(224,201,47,.16); color: var(--warning); }

/* --- Grants / Budget Tracker --- */
.program-card { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin-bottom: 10px; }
.program-card .top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.budget-track { height: 10px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.budget-fill { height: 100%; border-radius: 999px; }
.budget-fill.on_track { background: var(--success); }
.budget-fill.near_limit { background: var(--warning); }
.budget-fill.over_budget { background: var(--danger); }
.program-status { padding: 1px 9px; border-radius: 999px; font-size: 10px; font-weight: 800; }
.program-status.on_track { background: rgba(47,184,106,.16); color: var(--success); }
.program-status.near_limit { background: rgba(224,201,47,.16); color: var(--warning); }
.program-status.over_budget { background: rgba(230,71,59,.16); color: var(--danger); }

/* --- Payroll / Timesheet --- */
.timesheet-status { padding: 1px 9px; border-radius: 999px; font-size: 10px; font-weight: 800; }
.timesheet-status.submitted { background: var(--surface-3); color: var(--muted); }
.timesheet-status.approved { background: rgba(224,201,47,.16); color: var(--warning); }
.timesheet-status.paid { background: rgba(47,184,106,.16); color: var(--success); }

/* --- 3D Asset Viewer --- */
.asset-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.asset-tab { padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); font-size: 13px; font-weight: 700; cursor: pointer; }
.asset-tab.active { background: var(--primary-soft); border-color: var(--cm-green); color: var(--cm-green-2); }
.asset-status { padding: 2px 10px; border-radius: 999px; font-size: 10px; font-weight: 800; }
.asset-status.normal { background: rgba(47,184,106,.16); color: var(--success); }
.asset-status.warning { background: rgba(224,201,47,.16); color: var(--warning); }
.asset-status.critical { background: rgba(230,71,59,.16); color: var(--danger); }

/* --- Camera Grid --- */
.camera-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.camera-tile { background: #05090f; border: 1px solid var(--line); border-radius: 10px; padding: 12px; aspect-ratio: 4/3; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.camera-tile.motion { border-color: var(--danger); box-shadow: 0 0 0 2px rgba(230,71,59,.25); }
.camera-tile .cam-name { font-size: 11px; font-weight: 700; color: var(--text); }
.camera-tile .cam-zone { font-size: 10px; color: var(--muted); }
.camera-tile .cam-badge { align-self: flex-start; padding: 1px 8px; border-radius: 999px; font-size: 9px; font-weight: 800; background: var(--surface-3); color: var(--muted); }
.camera-tile.motion .cam-badge { background: rgba(230,71,59,.2); color: #ff9a8f; }
.camera-tile::before { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgba(255,255,255,.02) 0px, rgba(255,255,255,.02) 1px, transparent 1px, transparent 3px); pointer-events: none; }

/* --- IoT Sensor Fleet --- */
.sensor-card { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.sensor-card.breached { border-color: var(--danger); }
.sensor-card .top { display: flex; justify-content: space-between; margin-bottom: 6px; }
.sensor-card .value { font-size: 22px; font-weight: 800; }
.sensor-card .threshold-track { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin-top: 8px; }
.sensor-card .threshold-fill { height: 100%; border-radius: 999px; }
.sensor-card .threshold-fill.ok { background: var(--success); }
.sensor-card .threshold-fill.breach { background: var(--danger); }

/* --- Power Grid Monitor --- */
.power-node-status { padding: 1px 9px; border-radius: 999px; font-size: 10px; font-weight: 800; }
.power-node-status.normal { background: rgba(47,184,106,.16); color: var(--success); }
.power-node-status.high_load { background: rgba(224,201,47,.16); color: var(--warning); }
.power-node-status.overload { background: rgba(230,71,59,.16); color: var(--danger); }
.power-node-status.outage { background: rgba(230,71,59,.3); color: #ff9a8f; }

/* --- Plant / Infrastructure Simulator --- */
.plant-gauges { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.plant-gauge { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 14px; text-align: center; }
.plant-gauge .val { font-size: 24px; font-weight: 800; }
.plant-gauge .lbl { font-size: 11px; color: var(--muted); text-transform: uppercase; margin-top: 4px; }

/* --- Training Simulator --- */
.scenario-card { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 14px; cursor: pointer; margin-bottom: 10px; }
.scenario-card:hover { border-color: var(--cm-green); }
.scenario-card .title { font-weight: 700; margin-bottom: 4px; }
.training-option { display: block; width: 100%; text-align: left; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; margin-bottom: 8px; color: var(--text); cursor: pointer; }
.training-option:hover { border-color: var(--cm-green); }
.training-option.correct { border-color: var(--success); background: rgba(47,184,106,.12); }
.training-option.chosen { border-color: var(--cm-green); }
.score-badge { font-size: 22px; font-weight: 800; color: var(--cm-green-2); }

/* --- Emergency Dispatch --- */
.incident-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--surface-2); border-radius: 8px; border: 1px solid var(--line); margin-bottom: 8px; font-size: 12px; }
.priority-chip { padding: 1px 8px; border-radius: 999px; font-size: 9px; font-weight: 800; }
.priority-chip.low { background: rgba(47,184,106,.16); color: var(--success); }
.priority-chip.medium { background: rgba(224,201,47,.16); color: var(--warning); }
.priority-chip.high { background: rgba(230,71,59,.16); color: var(--danger); }
.dispatch-status { padding: 1px 8px; border-radius: 999px; font-size: 9px; font-weight: 800; }
.dispatch-status.pending { background: var(--surface-3); color: var(--muted); }
.dispatch-status.dispatched { background: rgba(59,125,230,.16); color: #7fa8f0; }
.unit-chip { padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; border: 1px solid var(--line); }
.unit-chip.available { background: rgba(47,184,106,.14); color: var(--success); }
.unit-chip.en_route { background: rgba(224,201,47,.14); color: var(--warning); }

/* --- SOC / Cyber Threat Dashboard --- */
.threat-score-panel { display: flex; align-items: center; gap: 20px; padding: 18px; background: var(--surface-2); border-radius: 12px; border: 1px solid var(--line); }
.threat-score-value { font-size: 36px; font-weight: 800; }
.threat-level-badge { padding: 4px 14px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.threat-level-badge.low { background: rgba(47,184,106,.16); color: var(--success); }
.threat-level-badge.guarded { background: rgba(59,125,230,.16); color: #7fa8f0; }
.threat-level-badge.elevated { background: rgba(224,201,47,.16); color: var(--warning); }
.threat-level-badge.critical { background: rgba(230,71,59,.16); color: var(--danger); }
.threat-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--surface-2); border-radius: 8px; border: 1px solid var(--line); margin-bottom: 6px; font-size: 12px; }
.severity-chip { padding: 1px 8px; border-radius: 999px; font-size: 9px; font-weight: 800; }
.severity-chip.low { background: rgba(47,184,106,.16); color: var(--success); }
.severity-chip.medium { background: rgba(224,201,47,.16); color: var(--warning); }
.severity-chip.high { background: rgba(230,71,59,.16); color: var(--danger); }
.severity-chip.critical { background: rgba(230,71,59,.3); color: #ff9a8f; }

/* --- Biometric Verification --- */
.match-result { text-align: center; padding: 24px; border-radius: 12px; margin-top: 14px; }
.match-result.matched { background: rgba(47,184,106,.1); border: 1px solid var(--success); }
.match-result.no-match { background: rgba(230,71,59,.1); border: 1px solid var(--danger); }
.match-confidence { font-size: 40px; font-weight: 800; }
.attempt-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--surface-2); border-radius: 8px; border: 1px solid var(--line); margin-bottom: 6px; font-size: 12px; }

/* --- Identity / Access Audit Trail --- */
.access-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--surface-2); border-radius: 8px; border: 1px solid var(--line); margin-bottom: 6px; font-size: 12px; }
.access-row.anomalous { border-color: var(--danger); }
.access-type-badge { padding: 1px 8px; border-radius: 999px; font-size: 9px; font-weight: 800; background: var(--surface-3); color: var(--muted); }
.access-type-badge.failed_login { background: rgba(230,71,59,.16); color: var(--danger); }
.access-type-badge.permission_change { background: rgba(224,201,47,.16); color: var(--warning); }

/* --- Ledger timeline visualization --- */
.ledger-timeline { display: flex; align-items: flex-end; gap: 2px; padding: 16px 8px; overflow-x: auto; }
.ledger-timeline-point { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 70px; }
.ledger-timeline-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--cm-green); border: 2px solid var(--cm-green-2); }
.ledger-timeline-line { width: 100%; height: 2px; background: var(--line); }
.ledger-timeline-label { font-size: 10px; color: var(--muted); text-align: center; max-width: 80px; }

/* --- Customs Manifest: simulated X-ray scan --- */
.xray-viewer { background: #05070a; border: 1px solid var(--line); border-radius: 10px; padding: 10px; text-align: center; }
.xray-viewer svg { max-width: 100%; height: auto; }
.xray-caption { font-size: 11px; color: var(--muted); margin-top: 6px; }

/* --- JSONL log console --- */
.jsonl-console { background: #05070a; border: 1px solid var(--line); border-radius: 10px; padding: 12px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11px; color: #7fd6a8; max-height: 240px; overflow-y: auto; white-space: pre-wrap; word-break: break-all; }
.jsonl-console .jsonl-line { padding: 2px 0; border-bottom: 1px solid rgba(255,255,255,.04); }
.jsonl-console .jsonl-line:last-child { color: #e8edf5; }

/* --- AI behavior analysis widget --- */
.ai-widget-verdict { text-align: center; padding: 10px; border-radius: 8px; margin-top: 8px; }
.ai-widget-verdict.normal { background: rgba(47,184,106,.12); color: var(--success); }
.ai-widget-verdict.anomalous { background: rgba(230,71,59,.12); color: var(--danger); }

/* --- OCR Document Extractor --- */
.ocr-field-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--surface-2); border-radius: 8px; border: 1px solid var(--line); margin-bottom: 6px; }
.ocr-field-row .lbl { min-width: 130px; font-size: 12px; color: var(--muted); }
.ocr-field-row .val { flex: 1; font-weight: 700; }
.ocr-confidence-track { width: 70px; height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.ocr-confidence-fill { height: 100%; border-radius: 999px; }

/* --- Citizen Services Chatbot --- */
.chat-window { display: flex; flex-direction: column; gap: 10px; max-height: 420px; overflow-y: auto; padding: 6px; }
.chat-bubble { max-width: 75%; padding: 10px 14px; border-radius: 14px; font-size: 13px; line-height: 1.4; }
.chat-bubble.citizen { align-self: flex-end; background: var(--primary-soft); border: 1px solid var(--cm-green); border-bottom-right-radius: 4px; }
.chat-bubble.bot { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.chat-bubble .chat-meta { display: block; margin-top: 6px; font-size: 10px; color: var(--muted); }

/* --- Mass Alerts / Notifications --- */
.alert-severity-chip { padding: 2px 10px; border-radius: 999px; font-size: 10px; font-weight: 800; }
.alert-severity-chip.info { background: rgba(59,125,230,.16); color: #7fa8f0; }
.alert-severity-chip.warning { background: rgba(224,201,47,.16); color: var(--warning); }
.alert-severity-chip.emergency { background: rgba(230,71,59,.2); color: var(--danger); }
.channel-result-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--surface-2); border-radius: 8px; border: 1px solid var(--line); margin-bottom: 6px; font-size: 12px; }
