/* ARBAMA reporting console. System fonts only; no outside requests. */
:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --line: #e2e5ea;
  --line-2: #cfd4dc;
  --ink: #0f172a;
  --ink-2: #4b5563;
  --ink-3: #8a93a1;
  --accent: #0b4a7d;
  --accent-ink: #ffffff;
  --series: #0b4a7d;
  --pos: #0a6b43;
  --neg: #b3261e;
  --warn: #8a5a00;
  --sans: Inter, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "SF Mono", "JetBrains Mono", "Roboto Mono", ui-monospace, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c1016;
    --surface: #131921;
    --surface-2: #171e27;
    --line: #232b37;
    --line-2: #323c4a;
    --ink: #e7eaee;
    --ink-2: #a3acb9;
    --ink-3: #6d7786;
    --accent: #6aa9de;
    --accent-ink: #0c1016;
    --series: #6aa9de;
    --pos: #4cc38a;
    --neg: #f0827a;
    --warn: #e0b354;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font: 13px/1.45 var(--sans); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }

/* Top bar */
.bar { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.bar-in { max-width: 1480px; margin: 0 auto; padding: 0 24px; height: 52px; display: flex; align-items: center; gap: 12px; }
.brand { font-weight: 700; font-size: 15px; letter-spacing: 0.06em; }
.env { font-size: 11.5px; color: var(--ink-2); padding: 2px 8px; border: 1px solid var(--line-2); border-radius: 3px; white-space: nowrap; }
.env.live { color: var(--neg); border-color: var(--neg); font-weight: 600; }
#nav { display: flex; align-self: stretch; gap: 0; margin-left: 4px; overflow-x: auto; scrollbar-width: none; min-width: 0; }
#nav a { display: flex; align-items: center; gap: 6px; padding: 0 9px; color: var(--ink-2); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
#nav a:hover { color: var(--ink); }
#nav a.on { color: var(--ink); border-bottom-color: var(--accent); }
.count { font-size: 11px; color: var(--ink-2); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 0 6px; }
.count:empty { display: none; }
.bar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: none; }
.status { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-2); white-space: nowrap; }
.status .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); }
.status.ok .dot { background: var(--pos); }
.status.bad { color: var(--neg); font-weight: 600; }
.status.bad .dot { background: var(--neg); }
.status.warn { color: var(--warn); }
.status.warn .dot { background: var(--warn); }
.btn {
  font: inherit; font-size: 12px; color: var(--ink); background: var(--surface); border: 1px solid var(--line-2);
  padding: 5px 10px; border-radius: 4px; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: var(--ink-3); }
.btn[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.small { padding: 2px 8px; font-size: 11.5px; }
.btn:disabled { opacity: 0.55; cursor: default; }
:is(a, button):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Page */
#content { max-width: 1480px; margin: 0 auto; padding: 20px 24px 8px; }
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
h1 { font-size: 20px; font-weight: 650; margin: 0; letter-spacing: -0.01em; }
.lede { margin: 2px 0 0; color: var(--ink-2); max-width: 90ch; }
.asof { color: var(--ink-2); font-size: 12px; text-align: right; white-space: nowrap; }
.banner { padding: 10px 14px; margin-bottom: 14px; border: 1px solid var(--neg); border-left-width: 3px; background: var(--surface); color: var(--neg); border-radius: 4px; font-weight: 600; }
.page { display: grid; gap: 14px; }
.page[hidden] { display: none; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; min-width: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 14px; border-bottom: 1px solid var(--line); min-height: 44px; }
h2 { font-size: 13px; font-weight: 650; margin: 0; }
.note { color: var(--ink-2); font-size: 12px; }
.panel > .note { display: block; padding: 0 14px 10px; }
.panel > .note:empty { display: none; }
.more { color: var(--accent); font-size: 12px; font-weight: 600; }
.more:hover { text-decoration: underline; }
.actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.split { display: grid; grid-template-columns: minmax(0, 2.1fr) minmax(300px, 1fr); gap: 14px; }
.stack { display: grid; gap: 14px; align-content: start; }
.cols-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.cols-2.tight { gap: 0; }
.cols-2.tight > dl + dl { border-left: 1px solid var(--line); }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 4px; overflow: hidden; }
.seg button { font: inherit; font-size: 12px; color: var(--ink-2); background: var(--surface); border: 0; border-left: 1px solid var(--line-2); padding: 4px 10px; cursor: pointer; }
.seg button:first-child { border-left: 0; }
.seg button.on { background: var(--ink); color: var(--surface); }

/* KPI strip */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.kpi { padding: 11px 14px 12px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 0 -1px -1px 0; min-width: 0; }
.kpi .k { color: var(--ink-2); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .v { font-size: 19px; font-weight: 650; margin-top: 3px; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .s { color: var(--ink-2); font-size: 11.5px; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Tables */
.scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; white-space: nowrap; }
th { text-align: right; font-weight: 600; font-size: 11.5px; color: var(--ink-2); padding: 7px 10px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
td { text-align: right; padding: 7px 10px; border-bottom: 1px solid var(--line); }
th.l, td.l { text-align: left; }
th:first-child, td:first-child { padding-left: 14px; }
th:last-child, td:last-child { padding-right: 14px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-2); }
tr.dim td { color: var(--ink-3); }
td.empty { text-align: center; color: var(--ink-2); padding: 22px 10px; white-space: normal; }
td.wrap { white-space: normal; min-width: 320px; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.warn { color: var(--warn); }
.dimtext { color: var(--ink-3); }
.id { font-family: var(--mono); font-size: 11.5px; color: var(--ink-2); }
.flag { display: inline-flex; align-items: center; gap: 6px; }
.flag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); }
.flag.ok::before { background: var(--pos); }
.flag.bad::before { background: var(--neg); }
.flag.wait::before { background: var(--warn); }
.side-long, .side-buy { color: var(--pos); font-weight: 600; }
.side-short, .side-sell { color: var(--neg); font-weight: 600; }
table.expandable tbody tr.row { cursor: pointer; }
tr.detail td { background: var(--surface-2); white-space: normal; text-align: left; padding: 12px 14px 14px; }
tr.detail:hover td { background: var(--surface-2); }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 8px 28px; }
.detail-grid h3 { font-size: 11.5px; color: var(--ink-2); font-weight: 600; margin: 0 0 4px; }
.detail-grid p { margin: 0 0 8px; }
.caret { display: inline-block; width: 10px; color: var(--ink-3); }

/* Key-value lists */
.kv { margin: 0; display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr); }
.kv dt, .kv dd { padding: 7px 14px; border-bottom: 1px solid var(--line); }
.kv dt { color: var(--ink-2); }
.kv dd { margin: 0; text-align: right; }
.kv dt:nth-last-of-type(1), .kv dd:nth-last-of-type(1) { border-bottom: 0; }

/* Engines list, meters */
.engine { padding: 10px 14px; border-bottom: 1px solid var(--line); }
.engine:last-child { border-bottom: 0; }
.engine .top { display: flex; justify-content: space-between; gap: 10px; font-weight: 600; }
.engine .sub { color: var(--ink-2); font-size: 12px; margin-top: 2px; }
.limit { padding: 9px 14px; border-bottom: 1px solid var(--line); }
.limit:last-child { border-bottom: 0; }
.limit .row { display: flex; justify-content: space-between; gap: 10px; }
.limit .row span:last-child { color: var(--ink-2); }
.track { height: 4px; background: var(--line); border-radius: 2px; margin-top: 6px; overflow: hidden; }
.fill { height: 100%; background: var(--accent); }
.fill.warn { background: var(--warn); }
.fill.bad { background: var(--neg); }
.meter { display: inline-grid; grid-template-columns: 90px auto; align-items: center; gap: 10px; }
.meter .track { margin-top: 0; }

/* Prose panels */
.prose { padding: 12px 14px; }
.prose h2 { margin-bottom: 6px; }
.prose p { margin: 0 0 8px; max-width: 110ch; color: var(--ink-2); }
.prose p:last-child { margin-bottom: 0; }
.prose ol, .prose ul { margin: 0 0 8px; padding-left: 20px; color: var(--ink-2); max-width: 110ch; }
.prose li { margin-bottom: 3px; }
.prose code { font-family: var(--mono); font-size: 11.5px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 3px; padding: 0 4px; color: var(--ink); }
.prose strong { color: var(--ink); font-weight: 600; }

/* Sorting, export, checks, legend */
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--ink); }
th .arrow { display: inline-block; width: 10px; color: var(--accent); font-size: 9px; }
.panel-head.bare { padding: 0; border: 0; min-height: 0; }
.check { display: flex; justify-content: space-between; gap: 12px; padding: 8px 14px; border-bottom: 1px solid var(--line); }
.check:last-child { border-bottom: 0; }
.check span:last-child { color: var(--ink-2); text-align: right; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 4px 14px 12px; color: var(--ink-2); font-size: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { display: inline-block; width: 18px; height: 0; border-top: 2px solid var(--ink-3); }
.legend i.dash { border-top-style: dashed; }
.legend i.ema { border-top-color: var(--accent); }
.legend i.stop { border-top-color: var(--neg); border-top-style: dashed; }
.legend i.entry { border-top-color: var(--ink); border-top-style: dashed; }
.legend i.up { width: 8px; height: 10px; border: 1.5px solid var(--pos); }
.legend i.down { width: 8px; height: 10px; border: 0; background: var(--neg); }
.rbar { display: inline-block; vertical-align: middle; }
.rbar .t { stroke: var(--line-2); stroke-width: 4; }
.rbar .z { stroke: var(--ink-3); stroke-width: 1; }
.rbar .g { stroke: var(--pos); stroke-width: 4; }
.rbar .b { stroke: var(--neg); stroke-width: 4; }
.rbar .k { fill: var(--ink); }
.figs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 14px; }
.figs img { width: 100%; height: auto; border: 1px solid var(--line); border-radius: 4px; background: #fcfcfb; }

/* Chart */
.chart { position: relative; height: 290px; padding: 6px 4px 0 14px; }
.chart.tall { height: 430px; }
.split .chart { height: 470px; }
.chart.short { height: 220px; }
.chart svg { display: block; width: 100%; height: 100%; }
.wick { stroke-width: 1; }
.wick.up, .body.up { stroke: var(--pos); }
.wick.down { stroke: var(--neg); }
.body.up { fill: var(--surface); stroke-width: 1.2; }
.body.down { fill: var(--neg); stroke: var(--neg); stroke-width: 1.2; }
.lvl { fill: none; stroke: var(--ink-3); stroke-width: 1.2; }
.lvl.dash { stroke-dasharray: 4 3; }
.lvl.ema { stroke: var(--accent); stroke-width: 1.5; }
.lvl.stop { stroke: var(--neg); stroke-dasharray: 5 3; }
.lvl.entry { stroke: var(--ink); stroke-dasharray: 2 3; }
.mark-fill { fill: var(--ink); stroke: var(--surface); stroke-width: 1.5; }
.tagtext { fill: var(--ink); font-size: 10.5px; font-weight: 600; }
.bar-pos { fill: var(--pos); }
.bar-neg { fill: var(--neg); }
.area { fill: var(--neg); opacity: 0.12; }
.chart .msg { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink-2); text-align: center; padding: 0 20px; }
.axis text { fill: var(--ink-2); font-size: 11px; }
.grid line { stroke: var(--line); stroke-width: 1; }
.series { fill: none; stroke: var(--series); stroke-width: 1.75; stroke-linejoin: round; stroke-linecap: round; }
.base { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 3 3; }
.cross { stroke: var(--ink-3); stroke-width: 1; }
.marker { fill: var(--series); stroke: var(--surface); stroke-width: 2; }
.tip { position: fixed; z-index: 20; pointer-events: none; padding: 7px 10px; border-radius: 4px; background: var(--ink); color: var(--surface); font-size: 12px; line-height: 1.4; white-space: nowrap; }
.tip b { font-weight: 650; font-size: 13px; }

footer { max-width: 1480px; margin: 0 auto; padding: 12px 24px 26px; display: flex; justify-content: space-between; gap: 6px 24px; flex-wrap: wrap; color: var(--ink-3); font-size: 11.5px; }

/* Hide figures: masks every number for onlookers. Not access control. */
body.discreet td:not(.l), body.discreet .kpi .v, body.discreet .kpi .s, body.discreet .kv dd, body.discreet .axis text,
body.discreet .series, body.discreet .marker, body.discreet .id, body.discreet .limit .row span:last-child,
body.discreet .meter, body.discreet .engine .sub, body.discreet .num, body.discreet .check span:last-child,
body.discreet .chart svg, body.discreet .rbar, body.discreet .figs img, body.discreet #price-last { filter: blur(6px); user-select: none; }
body.discreet .tip { display: none; }

@media (max-width: 1100px) {
  .split, .cols-2, .figs { grid-template-columns: minmax(0, 1fr); }
  .cols-2.tight > dl + dl { border-left: 0; border-top: 1px solid var(--line); }
  .detail-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .bar-in { height: auto; flex-wrap: wrap; padding: 8px 14px 0; gap: 8px 12px; }
  #nav { order: 3; width: 100%; margin-left: 0; height: 38px; }
  .bar-right .btn#print { display: none; }
  #content { padding: 14px 14px 6px; }
  footer { padding: 10px 14px 22px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media print {
  .bar, .btn, .seg, .more, #banner[hidden] { display: none !important; }
  body { background: #fff; font-size: 11px; }
  #content { padding: 0; max-width: none; }
  .panel { break-inside: avoid; border-color: #bbb; }
  .scroll { overflow: visible; }
  table { white-space: normal; }
}

/* Sign-in page and account forms */
body.signin { display: grid; place-items: center; min-height: 100vh; padding: 20px; }
.signin-box { width: 100%; max-width: 360px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 28px 28px 22px; }
.signin-box .brand { font-size: 16px; }
.signin-box h1 { margin: 18px 0 16px; font-size: 18px; }
.signin-note { margin: 16px 0 0; color: var(--ink-3); font-size: 11.5px; }
form label, .field label { display: block; font-size: 12px; color: var(--ink-2); margin: 12px 0 4px; }
input[type="text"], input[type="password"], select {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line-2); border-radius: 4px; padding: 7px 9px;
}
input:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.btn.wide { width: 100%; margin-top: 16px; padding: 8px 10px; }
.btn.danger { color: var(--neg); border-color: var(--neg); }
.form-error { color: var(--neg); font-weight: 600; margin: 10px 0 0; }
.form-ok { color: var(--pos); font-weight: 600; margin: 10px 0 0; }
.formgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 14px; padding: 2px 14px 14px; align-items: end; }
.formgrid .btn { margin-top: 12px; padding: 7px 10px; }
.formgrid p { grid-column: 1 / -1; }
.who { color: var(--ink-2); white-space: nowrap; }
.who b { color: var(--ink); font-weight: 600; }
.series.neg-line { stroke: var(--neg); }
.dialog { border: 1px solid var(--line-2); border-radius: 6px; background: var(--surface); color: var(--ink); padding: 20px 22px; width: min(420px, 92vw); }
.dialog::backdrop { background: rgba(15, 23, 42, 0.45); }
.dialog h2 { font-size: 15px; }
.dialog .note { margin: 6px 0 4px; }
.actions.end { justify-content: flex-end; margin-top: 16px; }
