/* BT-System · flat, dense, single-accent UI. Solid surfaces, no gradient backgrounds, restrained motion. */

:root {
  --bg: #0F1419;
  --surface: #151B23;
  --surface-2: #1B232E;
  --surface-3: #212B38;
  --border: #263041;
  --border-strong: #34405A;

  --text: #E6EAF0;
  --text-2: #9AA6B8;
  --text-3: #6B788C;

  --accent: #E87722;
  --accent-ink: #1A0D02;
  --ok: #2FB380;
  --warn: #D9A441;
  --err: #E05A5A;
  --info: #7C8AA5;

  --ok-bg: rgba(47,179,128,.12);
  --warn-bg: rgba(217,164,65,.14);
  --err-bg: rgba(224,90,90,.14);
  --info-bg: rgba(124,138,165,.14);
  --accent-bg: rgba(232,119,34,.14);

  --r: 2px;
  --nav-h: 52px;
  --maxw: 1240px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { color-scheme: dark; }
body {
  font-family: var(--font); font-size: 14px; line-height: 1.5; color: var(--text);
  background: var(--bg); min-height: 100vh; -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1 { font-size: 24px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; }
h2 { font-size: 17px; font-weight: 600; letter-spacing: -0.005em; }
h3 { font-size: 14px; font-weight: 600; }
p { color: var(--text-2); }
.muted { color: var(--text-2); } .faint { color: var(--text-3); }
.small { font-size: 12.5px; }
.id { font-family: var(--mono); font-size: 12.5px; letter-spacing: 0; }
.num { text-align: right; white-space: nowrap; }
.pos { color: var(--ok); } .neg { color: var(--err); } .zero { color: var(--text-3); }
.hidden { display: none !important; }

/* Nav */
.topnav {
  height: var(--nav-h); border-bottom: 1px solid var(--border); background: var(--surface);
  display: flex; align-items: center; gap: 28px; padding: 0 24px; position: sticky; top: 0; z-index: 50;
}
.nav-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.nav-brand .wordmark { font-weight: 600; font-size: 14px; letter-spacing: .06em; }
.nav-brand img { height: 26px; width: auto; opacity: .95; }
.nav-brand .sep { width: 1px; height: 18px; background: var(--border-strong); }
.nav-links { display: flex; gap: 4px; margin-left: 8px; }
.nav-link {
  color: var(--text-2); text-decoration: none; font-size: 13.5px; font-weight: 500;
  padding: 6px 10px; border-radius: var(--r);
}
.nav-link:hover { color: var(--text); background: var(--surface-2); }
.nav-link.active { color: var(--text); background: var(--surface-3); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 12px; color: var(--text-3); font-size: 12.5px; }

/* Page */
.page { max-width: var(--maxw); margin: 0 auto; padding: 28px 24px 120px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.page-head p { margin-top: 4px; }
.eyebrow { font-size: 12px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }

/* Cards, grid */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); }
.card-pad { padding: 18px 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.card-head h2 { font-size: 15px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.sticky { position: sticky; top: calc(var(--nav-h) + 20px); }
@media (max-width: 960px) { .split, .grid-4, .grid-3 { grid-template-columns: 1fr; } .grid-2 { grid-template-columns: 1fr; } }

/* Stat tiles */
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 14px 16px; }
.stat .lbl { font-size: 12px; color: var(--text-2); margin-bottom: 6px; }
.stat .val { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.1; }
.stat .sub { font-size: 12px; color: var(--text-3); margin-top: 6px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px; border-radius: var(--r); border: 1px solid var(--border-strong);
  background: var(--surface-2); color: var(--text); font-weight: 500; font-size: 13.5px; cursor: pointer;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--surface-3); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn-primary:hover { background: #F08A3A; }
.btn-danger { background: transparent; border-color: var(--err); color: var(--err); }
.btn-danger:hover { background: var(--err-bg); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn-lg { height: 40px; padding: 0 18px; font-size: 14px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-block { width: 100%; }

/* Forms */
label { display: block; font-size: 12.5px; color: var(--text-2); margin-bottom: 6px; }
.input, input[type=text], input[type=email], input[type=password], input[type=number], select, textarea {
  width: 100%; height: 34px; padding: 0 10px; background: var(--surface-2); border: 1px solid var(--border-strong);
  border-radius: var(--r); color: var(--text); outline: none;
}
textarea { height: auto; padding: 8px 10px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
select { appearance: none; -webkit-appearance: none; padding-right: 28px;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%);
  background-position: calc(100% - 15px) 15px, calc(100% - 10px) 15px; background-size: 5px 5px; background-repeat: no-repeat; }
.field { margin-bottom: 14px; }
.row { display: flex; gap: 12px; align-items: center; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Status dot + tag */
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--info); vertical-align: middle; margin-right: 7px; }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); } .dot.err { background: var(--err); } .dot.accent { background: var(--accent); }
.tag { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 7px; border-radius: var(--r); border: 1px solid transparent; white-space: nowrap; }
.tag.ok { color: var(--ok); background: var(--ok-bg); }
.tag.warn { color: var(--warn); background: var(--warn-bg); }
.tag.err { color: var(--err); background: var(--err-bg); }
.tag.info { color: var(--text-2); background: var(--info-bg); }
.tag.accent { color: var(--accent); background: var(--accent-bg); }

/* Tables */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-size: 11.5px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em;
  padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface); white-space: nowrap; }
.tbl td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl th.num, .tbl td.num { text-align: right; }
.tbl tbody tr:hover td { background: var(--surface-2); }
.tbl tr.group td { background: var(--surface-2); font-weight: 600; color: var(--text); }
.tbl tr.total td { font-weight: 600; border-top: 1px solid var(--border-strong); }
.tbl .name { max-width: 380px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
tr.expandable { cursor: pointer; }
tr.expandable td:first-child::before { content: ""; display: inline-block; width: 0; height: 0; border-left: 5px solid var(--text-3);
  border-top: 4px solid transparent; border-bottom: 4px solid transparent; margin-right: 8px; vertical-align: middle; }
tr.expandable.open td:first-child::before { transform: rotate(90deg); }
tr.detail { display: none; } tr.detail.open { display: table-row; }
tr.detail > td { background: var(--bg); padding: 12px 20px 16px; }
.detail-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.detail-cols h4 { font-size: 12px; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 8px; }
.emp { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; border-bottom: 1px dashed var(--border); font-size: 13px; }
.emp span:last-child { color: var(--text-2); }

/* Inline bars */
.bars { display: grid; gap: 3px; min-width: 120px; }
.bar { height: 5px; background: var(--surface-3); position: relative; }
.bar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--text-3); }
.bar.a i { background: var(--accent); } .bar.b i { background: var(--info); }

/* Tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin: 22px 0 18px; overflow-x: auto; }
.tab { padding: 10px 14px; font-size: 13.5px; font-weight: 500; color: var(--text-2); background: none; border: 0; border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; margin-bottom: -1px; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--accent); }
.tab .cnt { color: var(--text-3); margin-left: 6px; font-weight: 500; }
.tab-panel { display: none; } .tab-panel.active { display: block; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.filter { height: 28px; padding: 0 10px; font-size: 12.5px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text-2); border-radius: var(--r); cursor: pointer; }
.filter.active { color: var(--text); border-color: var(--text-2); background: var(--surface-3); }

/* Checklist */
.check { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.check:last-child { border-bottom: 0; }
.check .dot { margin-top: 6px; flex-shrink: 0; }
.check .txt { flex: 1; }
.check .txt small { display: block; color: var(--text-3); font-size: 12px; margin-top: 2px; }
.check a { color: var(--text-2); font-size: 12.5px; text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; }
.check a:hover { color: var(--text); }

/* Notices */
.notice { border: 1px solid var(--border); border-left: 3px solid var(--info); background: var(--surface); padding: 12px 14px; border-radius: var(--r); font-size: 13.5px; color: var(--text-2); }
.notice.ok { border-left-color: var(--ok); } .notice.warn { border-left-color: var(--warn); } .notice.err { border-left-color: var(--err); }
.notice strong { color: var(--text); }

/* Upload */
.drop { border: 1px dashed var(--border-strong); border-radius: var(--r); background: var(--surface); padding: 14px 16px; position: relative; }
.drop.over { border-color: var(--accent); background: var(--accent-bg); }
.drop.ok { border-style: solid; border-color: var(--ok); }
.drop-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.drop-head h3 { font-size: 13.5px; }
.drop-head .hint { font-size: 12.5px; color: var(--text-3); }
.drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop .btn { position: relative; z-index: 1; }
.file-list { margin-top: 10px; display: grid; gap: 4px; position: relative; z-index: 1; }
.file-list:empty { display: none; }
.file { display: flex; align-items: center; gap: 10px; font-size: 13px; padding: 6px 10px; background: var(--surface-2); border-radius: var(--r); }
.file .fname { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file .fsize { color: var(--text-3); font-size: 12px; }
.file .rm { background: none; border: 0; color: var(--text-3); cursor: pointer; font-size: 16px; line-height: 1; padding: 0 4px; }
.file .rm:hover { color: var(--err); }

/* Run log */
.log { border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); padding: 6px 0; font-size: 13px; }
.log .line { display: flex; gap: 10px; align-items: flex-start; padding: 5px 16px; }
.log .line .dot { margin-top: 6px; }
.log .line.money { color: var(--text); font-weight: 500; }
.log .line.warn { color: var(--warn); } .log .line.error { color: var(--err); }
.log:empty { display: none; }

/* Action bar */
.action-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; height: 60px; padding: 0 24px;
  background: var(--surface); border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
}
.action-bar .inner { max-width: var(--maxw); margin: 0 auto; width: 100%; display: flex; align-items: center; gap: 12px; }
.action-bar .summary { color: var(--text-2); font-size: 13px; }
.action-bar .summary strong { color: var(--text); }
.action-bar .spacer { flex: 1; }
.action-bar .why { font-size: 12.5px; color: var(--warn); }

/* Toasts */
#toasts { position: fixed; right: 20px; bottom: 76px; z-index: 100; display: grid; gap: 8px; }
.toast { background: var(--surface-3); border: 1px solid var(--border-strong); border-left: 3px solid var(--info); border-radius: var(--r); padding: 10px 14px; font-size: 13px; max-width: 360px; }
.toast.ok { border-left-color: var(--ok); } .toast.err { border-left-color: var(--err); } .toast.warn { border-left-color: var(--warn); }

/* Modal */
.modal-bg { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; }
.modal { width: min(460px, 92vw); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r); padding: 20px; }
.modal h3 { font-size: 15px; margin-bottom: 8px; }
.modal .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }

/* Empty */
.empty { padding: 28px 20px; text-align: center; color: var(--text-3); font-size: 13.5px; }

/* Login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login { width: 380px; padding: 28px; }
.login img { height: 44px; display: block; margin: 0 auto 10px; }
.login .wordmark { text-align: center; font-weight: 600; letter-spacing: .08em; font-size: 13px; color: var(--text-2); margin-bottom: 22px; }

details > summary { cursor: pointer; color: var(--text-2); font-size: 13px; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: "+ "; color: var(--text-3); }
details[open] > summary::before { content: "\2013  "; }
hr { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }

/* ═══ Flare: hero, motion, charts (flat colors, no gradients) ═══ */
.hero {
  position: relative; min-height: calc(78vh - var(--nav-h)); display: flex; align-items: center;
  border-bottom: 1px solid var(--border); background: var(--bg); overflow: hidden;
}
.hero-grid {
  position: absolute; inset: 0; pointer-events: none; opacity: .32;
  background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 55% 60% at 30% 50%, #000 25%, transparent 70%);
  mask-image: radial-gradient(ellipse 55% 60% at 30% 50%, #000 25%, transparent 70%);
}
.hero-inner { position: relative; max-width: var(--maxw); margin: 0 auto; padding: 48px 24px; width: 100%; }
.hero-brand { display: flex; align-items: center; gap: 36px; flex-wrap: wrap; }
.hero-logo { height: clamp(92px, 12vw, 150px); width: auto; }
.hero-rule { width: 1px; align-self: stretch; background: var(--border-strong); margin: 8px 0; }
.hero-title { font-size: clamp(44px, 6.5vw, 76px); font-weight: 700; letter-spacing: -0.035em; line-height: 1; margin: 0; }
.hero-title .word-a, .hero-title .word-b { display: inline-block; will-change: transform; }
.hero-title .word-b { color: var(--accent); }
.hero-sub { color: var(--text-2); font-size: clamp(15px, 1.5vw, 18px); max-width: 560px; margin-top: 40px; }
.hero-meta { display: flex; gap: 40px; margin-top: 40px; }
.hero-meta .k { display: block; font-size: 28px; font-weight: 600; letter-spacing: -0.02em; }
.hero-meta .l { display: block; font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.hero-anim { opacity: 0; }
.no-anim .hero-anim, .no-anim .reveal { opacity: 1 !important; transform: none !important; }
.scroll-cue { position: absolute; left: 24px; bottom: -8px; width: 22px; height: 36px; border: 1px solid var(--border-strong); border-radius: 11px; display: block; }
.scroll-cue span { position: absolute; left: 50%; top: 7px; width: 3px; height: 7px; margin-left: -1.5px; background: var(--accent); border-radius: 2px; animation: cue 1.8s ease-in-out infinite; }
@keyframes cue { 0%, 100% { transform: translateY(0); opacity: 1 } 60% { transform: translateY(12px); opacity: .2 } }

.reveal { will-change: transform, opacity; }
.card, .stat, .drop, .btn, .filter, .tab, .nav-link, tr td { transition: background-color .18s ease, border-color .18s ease, color .18s ease; }
.card:hover, .stat:hover { border-color: var(--border-strong); }

.chart-wrap { position: relative; }
.chart-wrap canvas { width: 100% !important; }
.legend { display: grid; gap: 10px; }
.legend .li { display: grid; grid-template-columns: 10px 1fr auto 80px; gap: 10px; align-items: center; font-size: 13px; white-space: nowrap; }
.legend .sw { width: 10px; height: 10px; border-radius: 2px; }
.legend .li .v { color: var(--text-2); font-variant-numeric: tabular-nums; }
.legend .li .bar { height: 5px; }
.viz { display: grid; grid-template-columns: 260px 1fr; gap: 28px; align-items: center; }
@media (max-width: 960px) { .viz { grid-template-columns: 1fr; } .hero-meta { gap: 22px; flex-wrap: wrap; } }
.progress { height: 8px; background: var(--surface-3); border-radius: 2px; overflow: hidden; display: flex; }
.progress i { display: block; height: 100%; }
.pkey { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 10px; font-size: 12.5px; color: var(--text-2); }
.pkey .sw { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
