:root {
  --bg: #151515;
  --panel: #1d1d1b;
  --panel-2: #222220;
  --line: #373735;
  --text: #f1eee8;
  --muted: #9d9b94;
  --orange: #e7813b;
  --teal: #2aa89a;
  --danger: #ef8b80;
  --serif: Georgia, "Times New Roman", serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 14px; }
button, a { font: inherit; }
button { cursor: pointer; }
a { color: var(--orange); text-decoration: none; }
a:hover { text-decoration: underline; }
[hidden] { display: none !important; }

.login-shell { min-height: 100vh; max-width: 980px; margin: 0 auto; padding: 42px 56px; display: flex; flex-direction: column; }
.login-mark { color: var(--orange); font-weight: 750; letter-spacing: .08em; font-size: 13px; }
.login-copy { margin: auto 0; max-width: 560px; padding: 96px 0; }
.eyebrow { margin: 0 0 12px; color: var(--orange); font-size: 10px; letter-spacing: .16em; font-weight: 750; }
.login-copy h1 { margin: 0; font: 500 clamp(48px, 8vw, 86px)/.93 var(--serif); letter-spacing: -.055em; max-width: 620px; }
.login-copy > p:not(.eyebrow) { color: var(--muted); font-size: 17px; line-height: 1.55; max-width: 450px; margin: 28px 0 34px; }
.telegram-widget { min-height: 44px; }
.error { color: var(--danger); margin-top: 18px; }
.login-shell footer { color: #6e6d68; font-size: 12px; border-top: 1px solid var(--line); padding-top: 18px; }

#dashboardView { min-height: 100vh; display: grid; grid-template-columns: 232px minmax(0, 1fr); }
.sidebar { border-right: 1px solid var(--line); padding: 28px 22px; display: flex; flex-direction: column; min-height: 100vh; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; gap: 10px; align-items: center; letter-spacing: .12em; font-size: 12px; }
.brand span { color: var(--orange); font-weight: 800; }
.brand strong { font-weight: 700; }
.sidebar nav { display: grid; gap: 2px; margin-top: 66px; }
.sidebar nav a { padding: 10px 0; color: var(--muted); border-bottom: 1px solid transparent; }
.sidebar nav a:hover { color: var(--text); text-decoration: none; border-bottom-color: var(--line); }
.sidebar-bottom { margin-top: auto; display: grid; gap: 12px; }
.quiet-button, .text-button, .primary-button { border: 1px solid var(--line); background: transparent; color: var(--text); padding: 9px 12px; border-radius: 8px; }
.quiet-button:hover, .text-button:hover { border-color: #686761; }
.text-button { border: 0; text-align: left; padding-left: 0; color: var(--muted); }
.primary-button { background: var(--orange); border-color: var(--orange); color: #1d150e; font-weight: 700; }
.primary-button:hover { background: #f19a58; }
.primary-button:disabled, .quiet-button:disabled { opacity: .45; cursor: not-allowed; }

.content { max-width: 1320px; width: 100%; padding: 38px clamp(24px, 5vw, 72px) 56px; }
.topbar { display: flex; justify-content: space-between; gap: 24px; align-items: end; padding-bottom: 42px; border-bottom: 1px solid var(--line); }
.topbar h1 { margin: 0; font: 500 36px/1 var(--serif); letter-spacing: -.04em; }
.top-actions { display: flex; align-items: center; gap: 16px; }
.freshness, .section-note { color: var(--muted); font-size: 12px; }

.overview-grid { display: grid; grid-template-columns: 1.7fr 1fr 1fr; border-bottom: 1px solid var(--line); }
.block-panel, .signal-panel { min-height: 190px; padding: 26px 24px; border-right: 1px solid var(--line); }
.block-panel { padding-left: 0; }
.signal-panel:last-child { border-right: 0; }
.panel-kicker { color: var(--muted); font-size: 10px; letter-spacing: .14em; font-weight: 750; }
.block-title { margin-top: 17px; font: 500 32px/1 var(--serif); text-transform: capitalize; }
.signal-value { margin-top: 24px; font: 500 25px/1.05 var(--serif); }
.muted { color: var(--muted); line-height: 1.45; }
.block-panel .muted { max-width: 400px; }
.set-list { display: flex; gap: 7px 14px; flex-wrap: wrap; margin-top: 19px; color: var(--muted); font-size: 12px; }
.set-list b { color: var(--orange); font-size: 15px; }

.section { padding: 62px 0 0; }
.section-heading { display: flex; justify-content: space-between; gap: 24px; align-items: end; margin-bottom: 19px; }
.section-heading h2 { margin: 0; font: 500 31px/1 var(--serif); letter-spacing: -.035em; }
.chart-panel { background: var(--panel); border: 1px solid var(--line); padding: 20px; min-width: 0; }
.compact-panel { margin-top: 14px; }
.chart-head { display: flex; justify-content: space-between; gap: 16px; color: var(--text); font-size: 12px; }
.legend { color: var(--muted); }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; margin: 0 5px 1px 11px; }
.dot.orange { background: var(--orange); }
.dot.teal { background: var(--teal); }
.chart { display: block; width: 100%; height: auto; margin-top: 16px; overflow: visible; }
.grid-line { stroke: #30302e; stroke-width: 1; }
.axis-label { fill: #797872; font-size: 10px; }
.bar-label { font-size: 9px; text-transform: capitalize; }
.series-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.series-dot { stroke: var(--panel); stroke-width: 2; }
.bar { rx: 2; }
.actual-bar { fill: var(--orange); }
.target-bar { fill: var(--teal); opacity: .72; }
.svg-empty { fill: #77766f; font: 13px var(--sans); }
.split-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.data-table { overflow-x: auto; margin-top: 14px; }
table { border-collapse: collapse; width: 100%; min-width: 510px; font-size: 12px; }
th { color: var(--muted); font-weight: 500; text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { color: #d9d6cf; padding: 10px; border-bottom: 1px solid #2c2c2a; white-space: nowrap; }
tr:hover td { background: #242422; }
.empty { color: var(--muted); margin: 22px 0 5px; }
.content-footer { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-top: 62px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }

@media (max-width: 900px) {
  #dashboardView { display: block; }
  .sidebar { min-height: auto; height: auto; position: static; border-right: 0; border-bottom: 1px solid var(--line); padding: 18px 20px; }
  .sidebar nav { display: flex; gap: 18px; margin-top: 18px; overflow-x: auto; }
  .sidebar nav a { padding: 5px 0; }
  .sidebar-bottom { display: flex; gap: 16px; margin-top: 18px; }
  .content { padding: 28px 20px 42px; }
  .overview-grid { grid-template-columns: 1fr 1fr; }
  .block-panel { grid-column: span 2; border-right: 0; border-bottom: 1px solid var(--line); }
  .signal-panel { min-height: 150px; }
}

@media (max-width: 640px) {
  .login-shell { padding: 28px 22px; }
  .login-copy { padding: 74px 0; }
  .topbar { display: block; }
  .topbar h1 { font-size: 30px; }
  .top-actions { margin-top: 22px; justify-content: space-between; }
  .overview-grid, .split-grid { display: block; }
  .block-panel, .signal-panel { border-right: 0; border-bottom: 1px solid var(--line); }
  .signal-panel:last-child { border-bottom: 0; }
  .section { padding-top: 48px; }
  .section-heading { display: block; }
  .section-note { display: block; margin-top: 8px; }
  .content-footer { display: block; }
  .content-footer button { margin-top: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
