/* Hallmark · v2.0.0 · redesign: full · scope: app · theme: DUNDER brand · shape: app screen */
/* Critique: prioritise the monthly outcome and preserve real workflows. */
:root {
  --paper: #f5f4f1; --surface: #fffefc; --side: #f0f0eb; --ink: #1c2925;
  --soft: #3e5049; --muted: #53645b; --line: #dce1d9; --line-strong: #c7cfc6;
  --accent: #245b48; --accent-hover: #1c493a; --accent-light: #e4ede7;
  --focus: #22785b; --warm: #f8efe2; --danger: #864727; --danger-light: #faece7;
  --white: #fffefc; --font-body: Inter, "Segoe UI", Arial, sans-serif;
  color-scheme: light; font-family: var(--font-body); color: var(--ink); background: var(--paper); line-height: 1.5;
}
* { box-sizing: border-box; }
html, body { margin: 0; overflow-x: clip; }
body { min-width: 320px; }
button, input, select { font: inherit; }
button, a, input, select, summary { outline-offset: 3px; }
:focus-visible { outline: 3px solid var(--focus); }
button { min-height: 40px; border: 1px solid transparent; border-radius: 8px; background: var(--accent); color: var(--white); padding: 8px 16px; font-weight: 650; cursor: pointer; }
button:hover { background: var(--accent-hover); }
button:active { transform: translateY(1px); }
button:disabled { opacity: .55; cursor: not-allowed; background: var(--line-strong); color: var(--ink); }
.quiet { color: var(--accent); background: var(--accent-light); }
.quiet:hover { background: var(--line); color: var(--ink); }
input, select { width: 100%; min-height: 40px; border: 1px solid var(--muted); border-radius: 8px; background: var(--surface); color: var(--ink); padding: 8px 12px; }
label { display: grid; gap: 4px; color: var(--soft); font-size: .875rem; font-weight: 600; margin: 12px 0; }
header { min-height: 72px; padding: 0 32px; display: flex; align-items: center; justify-content: space-between; gap: 24px; background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { color: var(--ink); text-decoration: none; font-weight: 800; letter-spacing: .06em; }
.brand span { color: var(--muted); font-size: .875rem; font-weight: 500; letter-spacing: 0; }
header div { display: flex; align-items: center; gap: 16px; }
header div[hidden] { display: none; }
header label { display: flex; align-items: center; gap: 8px; }
main { max-width: 1600px; margin: 0 auto; padding: 32px; }
footer { padding: 24px 32px; color: var(--muted); font-size: .875rem; border-top: 1px solid var(--line); }
h1, h2, h3 { color: var(--ink); min-width: 0; overflow-wrap: break-word; text-wrap: balance; }
h1 { font-size: 2rem; line-height: 1.2; letter-spacing: -.03em; margin: 0 0 8px; }
h2 { font-size: 1.125rem; margin: 0 0 12px; }
h3 { font-size: 1rem; }
p { color: var(--soft); }
.intro { max-width: 700px; margin-bottom: 32px; }
.intro h1 { font-size: 2.5rem; }
.auth-modes { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.auth-modes button { background: transparent; border-color: var(--line-strong); color: var(--soft); }
.auth-modes button[aria-pressed="true"] { background: var(--accent-light); color: var(--accent); }
.auth-grid, .grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 16px; align-items: start; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 24px; margin-bottom: 16px; min-width: 0; }
.hint { font-size: .875rem; }
/* Sidebar and content are one shared workspace surface, not floating panels. */
.workspace-shell {
  display: grid; grid-template-columns: 244px minmax(0, 1fr);
  gap: 0; align-items: stretch;
  min-height: min(760px, calc(100vh - 170px));
  background: linear-gradient(to right, var(--side) 244px, var(--surface) 244px);
  border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 8px 28px rgba(28, 41, 37, .035);
}
.side-rail {
  position: sticky; top: 0; align-self: start;
  width: 100%; max-height: 100vh; overflow-y: auto;
  background: var(--side); border: 0; border-right: 1px solid var(--line);
  border-radius: 14px 0 0 14px; padding: 24px 16px;
}
.rail-title, .nav-label { color: var(--muted); font-size: .875rem; font-weight: 600; padding: 8px; }
.nav-label { margin-top: 16px; }
.nav-group { display: grid; gap: 4px; }
.nav-disclosure > summary { display: none; }
nav button { width: 100%; text-align: left; background: transparent; color: var(--soft); font-weight: 550; white-space: nowrap; }
nav button:hover { background: var(--surface); color: var(--ink); }
nav button.active { background: var(--accent-light); color: var(--accent); font-weight: 700; }
.workspace-content { min-width: 0; padding: 28px 30px 36px; }
.page-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 24px; }
.page-head p { margin: 0; }
.page-head > label { min-width: min(280px, 100%); }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 16px; margin-bottom: 16px; }
.metric { border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 20px; }
.metric p { margin: 0; font-size: .875rem; }
.metric strong, .forecast-total { display: block; color: var(--ink); font-size: 1.5rem; margin-top: 8px; font-variant-numeric: tabular-nums; }
.forecast-hero { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 24px; margin-bottom: 16px; }
.forecast-total { font-size: 2.5rem; line-height: 1.15; letter-spacing: -.04em; overflow-wrap: anywhere; }
.forecast-context { display: flex; gap: 24px; flex-wrap: wrap; margin-top: 16px; }
.forecast-context p { margin: 0; }
.period-switch { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.period-switch button[aria-pressed="true"] { background: var(--accent); color: var(--white); }
.attention { margin: 16px 0; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.attention summary { cursor: pointer; color: var(--ink); font-weight: 650; }
[data-panel][aria-busy="true"]::before { content: "Загрузка данных…"; display: block; color: var(--muted); padding: 8px 0; }
.history-chart { display: grid; gap: 8px; margin: 16px 0; }
.history-row { display: grid; grid-template-columns: 80px minmax(0, 1fr) auto; align-items: center; gap: 12px; color: var(--soft); font-size: .875rem; font-variant-numeric: tabular-nums; }
.history-row progress { width: 100%; height: 12px; accent-color: var(--accent); }
.message { padding: 12px 16px; border-radius: 8px; background: var(--accent-light); color: var(--accent); margin-bottom: 16px; }
.message.error { background: var(--danger-light); color: var(--danger); }
.warning { background: var(--warm); color: var(--danger); padding: 12px; border-radius: 8px; }
.customer-tools { display: grid; grid-template-columns: minmax(0, 2fr) repeat(2, minmax(0, 1fr)); gap: 16px; }
.pagination { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.table-hint { display: none; color: var(--muted); font-size: .875rem; font-variant-numeric: tabular-nums; }
.check { display: flex; align-items: center; gap: 8px; }
.check input { width: auto; min-height: 0; }
table { border-collapse: collapse; width: 100%; font-size: .875rem; font-variant-numeric: tabular-nums; }
th, td { padding: 12px; text-align: left; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; white-space: nowrap; }
td button { font-size: .875rem; padding: 8px 12px; }
.table-wrap { overflow-x: auto; }
.link { color: var(--accent); }
.compact { max-width: 560px; }
/* The synthetic-only banner precedes the app header. Keep toasts below it. */
body:has(> .message.error) #notice { top: auto; }
#notice:empty { display: none; }
[hidden] { display: none !important; }
@media (max-width: 60rem) {
  .workspace-shell { grid-template-columns: minmax(0, 1fr); background: var(--surface); }
  .side-rail { position: static; overflow: visible; max-height: none; border-radius: 14px 14px 0 0; border-right: 0; border-bottom: 1px solid var(--line); padding: 14px 20px; }
  .rail-title { display: none; }
  .nav-disclosure > summary { display: list-item; cursor: pointer; color: var(--ink); font-weight: 650; }
  .nav-group { display: flex; flex-wrap: wrap; }
  nav button { width: auto; }
  .nav-label { margin-top: 8px; }
  .workspace-content { padding: 24px 20px 28px; }
  .customer-tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 40rem) { .workspace-content { padding: 20px 16px 24px; } .side-rail { padding: 12px 16px; } header { padding: 12px 16px; flex-wrap: wrap; } header div { width: 100%; justify-content: space-between; } main { padding: 24px 16px 48px; } footer { padding: 24px 16px; } .page-head { display: block; } .page-head > label { min-width: 0; } .card, .forecast-hero { padding: 16px; } .customer-tools { grid-template-columns: minmax(0, 1fr); gap: 0; } .table-hint { display: block; } .forecast-total { font-size: 2rem; } #customer-list th:first-child, #customer-list td:first-child { position: sticky; left: 0; background: var(--surface); z-index: 1; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; } }

/* The signed-in workspace fills the viewport with modest, fluid gutters.
   The navigation and content remain columns of one bordered surface. */
@media (min-width: 60.01rem) {
  body:has(#workspace:not([hidden])) main {
    width: 100%;
    max-width: none;
    padding: 24px clamp(20px, 2vw, 36px) 40px;
  }
  #workspace { width: 100%; min-width: 0; }
  .workspace-shell { width: 100%; max-width: none; }
}
.range-controls { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; margin-bottom: 10px; }
.range-controls label { margin: 0; }
.range-control { min-width: min(220px, 100%); flex: 0 1 240px; }
.range-quick { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.range-quick button { background: var(--accent-light); color: var(--accent); }
.range-quick button:hover { background: var(--line); color: var(--ink); }
.customer-link { background: none; padding: 2px 0; border: 0; min-height: 0; font-weight: 700; text-align: left; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.customer-link:hover { background: none; color: var(--ink); }
.client-name-cell { display: grid; justify-items: start; gap: 5px; }
.customer-status { color: var(--muted); font-size: .75rem; border-left: 3px solid var(--line-strong); padding-left: 6px; }
.status-warning { border-left-color: #bb8b39; color: #785520; }
.status-danger { border-left-color: #b4513b; color: #893d2e; }
.status-neutral { border-left-color: var(--line-strong); }
.drawer-open { overflow: hidden; }
#customer-drawer-overlay:not([hidden]) { position: fixed; inset: 0; background: rgba(18,32,26,.3); z-index: 30; }
#customer-detail { display: none; }
#customer-detail.drawer-visible {
  display: block; position: fixed; top: 0; right: 0; bottom: 0;
  width: min(580px, 100%); z-index: 31; padding: 30px;
  overflow-y: auto; background: var(--surface);
  border-left: 1px solid var(--line-strong);
  box-shadow: -16px 0 35px rgba(16,30,22,.1);
}
#customer-detail.drawer-visible h3 { font-size: 1.5rem; padding-right: 36px; }
#customer-detail.drawer-visible .warning { margin: 12px 0; }
@media (max-width: 40rem) {
  #customer-detail.drawer-visible { padding: 20px 16px 36px; }
  .range-controls { display: grid; }
  .range-control { min-width: 0; }
}


/* Product information hierarchy. All chromatic values are inherited from DUNDER tokens. */
.ui-kicker,.ui-stat-label { font-size:.78rem; color:var(--muted); font-weight:600; }
.drawer-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:20px; padding-bottom:20px; border-bottom:1px solid var(--line); }
.drawer-title h2 { font-size:1.6rem; line-height:1.24; margin:6px 0 0; }
.drawer-close { flex:none; }
.client-metrics { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin:20px 0 14px; }
.ui-stat { display:grid; gap:7px; align-content:center; min-width:0; padding:14px 16px; border:1px solid var(--line); border-radius:10px; }
.ui-stat-value { color:var(--ink); font-size:1.07rem; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; line-height:1.35; }
.ui-stat.featured { background:var(--accent-light); border-color:var(--line-strong); grid-column:1/-1; padding:18px; }
.ui-stat.featured .ui-stat-value { font-size:1.8rem; letter-spacing:-.025em; }
.client-cycle-line { display:flex; flex-wrap:wrap; align-items:center; gap:9px; margin-bottom:24px; }
.ui-secondary { color:var(--muted); font-size:.86rem; line-height:1.55; margin:0; }
.ui-status { display:inline-flex; width:max-content; max-width:100%; align-items:center; font-size:.75rem; font-weight:700; padding:4px 9px; border-radius:6px; border:1px solid var(--line); background:var(--side); color:var(--soft); }
.ui-status.positive { color:var(--accent); background:var(--accent-light); }
.ui-status.warning { color:var(--danger); background:var(--warm); }
.ui-status.danger { color:var(--danger); background:var(--danger-light); }
.client-block { margin:20px 0; }
.client-block h3 { margin:0 0 12px; font-size:1.05rem; }
.client-signals { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.signal-panel { border:1px solid var(--line); border-radius:10px; padding:14px; min-width:0; }
.signal-head { display:grid; gap:9px; justify-items:start; margin-bottom:9px; }
.signal-head strong { font-size:.88rem; }
.client-notices:empty { display:none; }
.ui-note { border-left:3px solid var(--line-strong); background:var(--side); padding:11px 14px; margin:9px 0; font-size:.87rem; }
.ui-note.warning { border-left-color:var(--danger); background:var(--warm); color:var(--danger); }
.ui-note.danger { border-left-color:var(--danger); background:var(--danger-light); color:var(--danger); }
.client-method { border-top:1px solid var(--line); border-bottom:1px solid var(--line); padding:15px 0; margin:20px 0; }
.client-method summary { cursor:pointer; font-weight:700; color:var(--accent); }
.method-body { display:grid; gap:16px; padding:18px 0 5px; }
.method-values { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.method-values .ui-stat { padding:12px; }
.method-values .ui-stat-value { font-size:.85rem; font-weight:650; }
.method-part h4 { margin:0 0 10px; }
.client-operations table { font-size:.82rem; }
.client-operations th,.client-operations td { padding:9px 6px; }
@media(max-width:40rem) {
  .client-metrics,.client-signals,.method-values { grid-template-columns:minmax(0,1fr); }
  .ui-stat.featured { grid-column:1; }
  .drawer-heading { gap:8px; }
  .drawer-title h2 { font-size:1.3rem; }
}


/* Client registry: consistent table rhythm and semantically reserved emphasis. */
#customer-list .registry-table { overflow-x:auto; }
#customer-list .registry-table table { table-layout:fixed; min-width:880px; width:100%; border-collapse:collapse; }
#customer-list .registry-table th { font-size:.76rem; letter-spacing:.015em; vertical-align:bottom; padding:13px 18px; background:var(--surface); color:var(--muted); }
#customer-list .registry-table td { padding:15px 18px; vertical-align:middle; font-size:.86rem; height:74px; }
#customer-list .registry-table td:nth-child(2) { font-weight:700; white-space:nowrap; text-align:right; font-variant-numeric:tabular-nums; }
#customer-list .registry-table th:nth-child(2) { text-align:right; }
#customer-list .registry-table td:nth-child(5),#customer-list .registry-table th:nth-child(5) { white-space:nowrap; }
#customer-list .registry-table tbody tr:hover { background:var(--paper); }
#customer-list .registry-table td:first-child { padding-left:18px; }
.registry-client { min-width:0; }
.registry-client-link { display:inline; color:var(--ink); background:transparent; border:0; border-radius:3px; padding:0; font-size:.9rem; line-height:1.4; font-weight:700; min-height:0; text-align:left; white-space:normal; text-decoration:none; text-underline-offset:3px; }
.registry-client-link:hover { color:var(--accent); background:transparent; text-decoration:underline; }
.registry-amount { text-align:right; font-variant-numeric:tabular-nums; white-space:nowrap; }
.registry-amount.missing { color:var(--muted); font-weight:500; }
.registry-cycle { display:flex; flex-direction:column; gap:5px; align-items:flex-start; }
.registry-date { font-size:.88rem; font-weight:650; font-variant-numeric:tabular-nums; white-space:nowrap; }
.registry-cycle-note { font-size:.75rem; line-height:1.4; padding-left:8px; border-left:2px solid var(--line-strong); }
.registry-cycle-note.warning { color:var(--danger); border-color:#b7823d; }
.registry-cycle-note.danger { color:var(--danger); border-color:var(--danger); font-weight:650; }
.registry-signals { display:grid; gap:5px; }
.registry-signal { display:grid; grid-template-columns:55px minmax(0,1fr); gap:5px; font-size:.79rem; line-height:1.3; }
.registry-signal-label { color:var(--muted); }
.registry-signal-value { color:var(--soft); }
.registry-signal.alert .registry-signal-value { color:var(--danger); font-weight:650; }
.registry-signal.unknown .registry-signal-value { color:var(--muted); }
.registry-count { margin:16px 0; font-size:.83rem; color:var(--muted); }
#customer-list .pagination { margin-top:14px; }
@media(max-width:40rem){
  #customer-list .registry-table table { min-width:780px; }
  #customer-list .registry-table td { padding:12px; }
  #customer-list .registry-table th { padding:12px; }
  #customer-list .registry-table td:first-child,#customer-list .registry-table th:first-child { position:sticky; left:0; background:var(--surface); z-index:1; box-shadow:1px 0 0 var(--line); }
  #customer-list .registry-table tbody tr:hover td:first-child { background:var(--paper); }
}


/* Compact, accessible secondary controls — not full-width action buttons. */
#customer-detail.drawer-visible .drawer-close {
  flex:0 0 36px; width:36px; height:36px; min-height:36px;
  display:inline-flex; align-items:center; justify-content:center;
  padding:0; border:1px solid transparent; border-radius:50%;
  background:transparent; color:var(--soft); font-size:1.65rem;
  font-weight:400; line-height:1;
}
#customer-detail.drawer-visible .drawer-close:hover { background:var(--side); color:var(--ink); }
.registry-footer { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center; gap:12px; margin-top:15px; }
.registry-footer .registry-count { margin:0; font-size:.82rem; }
#customer-list .registry-footer .pagination {
  display:inline-flex; width:auto; max-width:100%; flex:0 0 auto;
  justify-content:flex-end; align-items:center; flex-wrap:nowrap;
  gap:8px; margin:0;
}
#customer-list .registry-footer .pagination-arrow {
  display:inline-flex; align-items:center; justify-content:center;
  width:36px; height:36px; min-height:36px; padding:0; flex:0 0 36px;
  background:var(--surface); color:var(--accent); border:1px solid var(--line);
  border-radius:8px; font-size:1.55rem; line-height:1; font-weight:400;
}
#customer-list .registry-footer .pagination-arrow:hover:not(:disabled) { background:var(--accent-light); border-color:var(--line-strong); }
#customer-list .registry-footer .pagination-arrow:disabled { opacity:.35; color:var(--muted); background:var(--surface); }
#customer-list .registry-footer .pagination-count { font-size:.85rem; color:var(--soft); white-space:nowrap; min-width:54px; text-align:center; font-variant-numeric:tabular-nums; }
@media(max-width:40rem){
  .registry-footer { justify-content:space-between; }
  #customer-detail.drawer-visible .drawer-close { flex-basis:40px; width:40px; height:40px; }
}


/* DUNDER application visual system — a focused, consistent editorial layout. */
:root {
  --paper: #f5f6f3;
  --surface: #ffffff;
  --side: #f0f3ef;
  --ink: #182820;
  --soft: #405149;
  --muted: #66766e;
  --line: #e2e8e1;
  --line-strong: #cdd9d0;
  --accent: #176044;
  --accent-hover: #104c35;
  --accent-light: #e7f1ea;
  --focus: #176b4f;
  --danger: #905138;
  --danger-light: #fbefe9;
  --warm: #fcf5e9;
  font-feature-settings: "tnum";
}
body { letter-spacing: -.008em; }
header {
  min-height: 68px;
  padding: 0 clamp(20px, 2vw, 36px);
  box-shadow: 0 1px 0 rgba(15,45,30,.025);
}
.brand { font-size: .97rem; letter-spacing: .055em; }
.brand span { letter-spacing: -.01em; }
header label { margin: 0; font-weight: 550; }
header select { min-width: 150px; max-width: 260px; }
button { transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease; }
button:active { transform: none; }
button, .quiet { box-shadow: none; }
input, select {
  border-color: var(--line-strong);
  border-radius: 9px;
  background: var(--surface);
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:hover, select:hover { border-color: #879f90; }
input:focus, select:focus { border-color: var(--focus); }
label { color: var(--soft); font-weight: 570; }
h1 { font-size: clamp(1.65rem, 1.5vw + .9rem, 2.1rem); font-weight: 760; letter-spacing: -.04em; }
h2 { font-size: 1.12rem; font-weight: 730; letter-spacing: -.023em; }
h3 { font-weight: 690; letter-spacing: -.016em; }
.workspace-shell { border-radius: 16px; box-shadow: 0 12px 36px rgba(20,45,32,.035); }
.side-rail { padding: 32px 18px; }
.rail-title, .nav-label {
  font-size: .7rem; letter-spacing: .075em;
  font-weight: 760; text-transform: uppercase;
  padding: 6px 13px;
}
.rail-title { margin-bottom: 13px; }
.nav-label { margin-top: 26px; margin-bottom: 7px; }
.nav-group { gap: 5px; }
nav button {
  min-height: 42px;
  padding: 9px 13px;
  border-radius: 9px;
  font-size: .91rem;
  font-weight: 560;
  transition: background-color .15s ease, color .15s ease;
}
nav button.active { color: var(--accent); background: #dfece3; font-weight: 720; }
nav button:hover { background: #e8eee8; }
.workspace-content { padding: clamp(25px, 2.5vw, 44px); }
.page-head { align-items: center; gap: 28px; margin: 0 0 34px; padding: 0 0 24px; border-bottom: 1px solid var(--line); }
.page-head h1 { margin-bottom: 7px; }
.page-head p { font-size: .91rem; color: var(--muted); }
.page-head > label { margin: 0; min-width: 235px; font-size: .81rem; }
.card {
  border-radius: 13px;
  border: 1px solid var(--line);
  box-shadow: 0 2px 12px rgba(20,45,32,.018);
  padding: 26px;
  margin-bottom: 20px;
}
.card > h2 { margin-bottom: 17px; }
.card > h3 { margin-bottom: 14px; }
.grid { gap: 18px; }
.grid .card { min-width: 0; }
.card p { line-height: 1.65; }
.card form + form { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 20px; }
.message { font-size: .88rem; border: 1px solid var(--line); border-radius: 10px; padding: 11px 16px; }
.message.error { border-color: #ecd6c9; }
.page-head + .card { margin-top: 0; }
.range-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(155px, 225px)) max-content;
  align-items: end;
  gap: 12px;
  margin-bottom: 10px;
}
.range-controls label { font-size: .78rem; }
.range-controls button { white-space: nowrap; }
.range-control { width: auto; min-width: 0; }
.range-quick { margin-bottom: 24px; gap: 8px; }
.range-quick button {
  min-height: 34px;
  padding: 7px 13px;
  border: 1px solid transparent;
  font-size: .81rem;
  font-weight: 680;
}
.range-quick button:hover { border-color: var(--line-strong); }
.section-kicker {
  display: inline-block;
  color: var(--accent);
  font-size: .67rem;
  font-weight: 800;
  letter-spacing: .09em;
  margin-bottom: 8px;
}
.section-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 23px; }
.section-head h2 { font-size: 1.23rem; margin: 0; }
.forecast-hero {
  background: linear-gradient(125deg,#f2f8f3 0%,#ffffff 76%);
  border: 1px solid #d5e5d9;
  border-radius: 15px;
  box-shadow: 0 5px 20px rgba(17,76,50,.025);
  padding: clamp(24px, 3vw, 40px);
  margin-bottom: 16px;
}
.forecast-hero .hero-label { margin: 2px 0 6px; color: var(--soft); font-size: .91rem; font-weight: 590; }
.forecast-hero .forecast-total { color: var(--ink); font-size: clamp(1.8rem, 3.1vw, 3rem); letter-spacing: -.055em; margin: 10px 0 17px; }
.forecast-hero .hero-support { font-size: .95rem; font-weight: 720; color: var(--ink); margin: 12px 0 0; }
.forecast-hero .hero-period { display: inline-flex; font-size: .78rem; color: var(--muted); background: #eef4ef; border: 1px solid #dbe6dd; border-radius: 6px; padding: 6px 10px; margin-top: 17px; }
.forecast-hero .hint { font-size: .8rem; color: var(--muted); margin: 8px 0; }
.forecast-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.metric { border: 1px solid var(--line); border-radius: 12px; padding: 21px 24px; }
.metric p { font-size: .78rem; font-weight: 580; color: var(--muted); }
.metric strong { font-size: clamp(1.18rem, 1.6vw, 1.5rem); line-height: 1.2; margin-top: 8px; }
.attention { padding: 0; border: 1px solid var(--line); border-radius: 10px; margin: 16px 0 22px; }
.attention summary { padding: 14px 18px; font-size: .88rem; }
.attention > p { margin: 2px 18px 16px; font-size: .85rem; line-height: 1.65; }
.historical-card { padding: clamp(19px, 2vw, 30px); }
.chart-legend { display: flex; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: .76rem; }
.legend-fact,.legend-projection { display: inline-flex; gap: 7px; align-items: center; }
.legend-fact::before,.legend-projection::before { content: ""; display: inline-block; width: 18px; border-top: 3px solid var(--accent); border-radius: 8px; }
.legend-projection::before { border-top: 2px dashed #7e9b8a; }
.trend-chart-wrap { position: relative; width: 100%; padding: 8px 0 2px; }
.trend-svg { display: block; width: 100%; height: auto; overflow: visible; }
.trend-gridline { stroke: #e7ebe7; stroke-width: 1; }
.trend-axis-label { font: 12px Inter, "Segoe UI", Arial, sans-serif; fill: var(--muted); }
.trend-area { fill: #e8f2ea; opacity: .75; }
.trend-fact-line { fill: none; stroke: var(--accent); stroke-width: 3.2; stroke-linejoin: round; stroke-linecap: round; }
.trend-projection-line { stroke: #7b9b87; fill: none; stroke-width: 3; stroke-dasharray: 7 7; stroke-linecap: round; }
.trend-point-hit { fill: transparent; }
.trend-point { fill: var(--surface); stroke: var(--accent); stroke-width: 3; }
.trend-point.forecast { stroke: #7b9b87; }
.trend-point-group:focus-visible { outline: none; }
.trend-point-group:focus-visible .trend-point { stroke: #0b3426; stroke-width: 5; }
.trend-tooltip { position: absolute; transform: translate(-50%,-125%); z-index: 2; display: grid; gap: 1px; padding: 9px 12px; pointer-events: none; white-space: nowrap; background: var(--ink); color: white; border-radius: 8px; font-size: .78rem; box-shadow: 0 8px 20px rgba(0,0,0,.12); }
.trend-tooltip[hidden] { display: none; }
.trend-tooltip span { color: #e7f0e8; }
.chart-details { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 15px; }
.chart-details summary { font-size: .83rem; font-weight: 660; color: var(--accent); cursor: pointer; }
.chart-details .table-wrap { margin-top: 16px; }
.accuracy-stat-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; margin-bottom: 20px; }
.accuracy-stat { padding: 19px; background: var(--paper); border: 1px solid var(--line); border-radius: 11px; display: grid; gap: 7px; }
.accuracy-stat strong { font-size: clamp(1.2rem, 2vw, 1.75rem); font-variant-numeric: tabular-nums; letter-spacing: -.04em; }
.accuracy-stat small { font-size: .75rem; color: var(--muted); }
.insight-note { color: var(--soft); background: #f7f8f5; border-left: 3px solid var(--line-strong); padding: 12px 15px; font-size: .82rem; margin: 14px 0 23px; }
.table-wrap,.registry-table { scrollbar-color: #cbd7ce transparent; }
table { font-size: .83rem; }
th { color: var(--muted); background: #f7f9f6; font-size: .73rem; font-weight: 720; letter-spacing: .01em; }
th,td { padding: 13px 14px; }
tbody tr { transition: background .14s ease; }
tbody tr:hover { background: #f8faf8; }
td { color: var(--soft); }
#customer-list .registry-table th { background: #f7f9f6; }
#customer-list .registry-table td { height: auto; min-height: 68px; }
#customer-list .registry-table tbody tr:hover { background: #f8faf8; }
.customer-tools { gap: 12px; margin-bottom: 15px; }
.customer-tools label { font-size: .77rem; margin: 0; }
#customer-list .registry-footer { margin-top: 20px; }
#customer-detail.drawer-visible { box-shadow: -14px 0 50px rgba(13,35,23,.12); padding: 30px; }
#customer-detail.drawer-visible .ui-stat.featured { background: #edf5ef; }
.client-block { padding-top: 4px; }
.signal-panel { background: #fcfdfb; }
.ui-note.warning { background: #fff8ed; }
#dataset-form,#invite-form,#organization-form,#transfer-form { max-width: none; }
#inspect-form h3,#preview-form h3,#commit-form h3 { color: var(--ink); }
#company .card,.grid .card { overflow-wrap: anywhere; }
#sessions .table-wrap,#audit-log .table-wrap { max-width: 100%; }
footer { font-size: .78rem; }
@media (max-width: 75rem) {
  .workspace-shell { grid-template-columns: 210px minmax(0,1fr); background: linear-gradient(to right,var(--side) 210px,var(--surface) 210px); }
  .workspace-content { padding: 28px; }
}
@media (max-width: 60rem) {
  .workspace-shell { grid-template-columns: minmax(0,1fr); background: var(--surface); }
  .workspace-content { padding: 22px; }
  .side-rail { padding: 14px 20px; }
  .page-head { margin-bottom: 24px; }
  .range-controls { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .range-controls > button { grid-column: 1/-1; justify-self: start; }
}
@media (max-width: 40rem) {
  .page-head { padding-bottom: 14px; }
  .workspace-content { padding: 18px 15px; }
  .forecast-metrics,.accuracy-stat-grid { grid-template-columns: minmax(0,1fr); }
  .range-controls { grid-template-columns: minmax(0,1fr); }
  .range-controls > button { grid-column: 1; width: 100%; }
  .forecast-hero { padding: 22px 18px; }
  .forecast-hero .forecast-total { font-size: clamp(1.7rem,7vw,2.25rem); }
  .card { padding: 18px; }
  .trend-axis-label { font-size: 14px; }
  .chart-legend { gap: 11px; }
  #customer-detail.drawer-visible { padding: 20px 16px 32px; }
}


/* Commercial-oriented secondary screens, visual grouping without new workflows. */
.plan-snapshot {
  display: flex; align-items: stretch; gap: 12px; flex-wrap: wrap;
  margin-top: 23px; padding-top: 20px; border-top: 1px solid #d9e8dd;
}
.plan-snapshot-item { display: grid; align-content: center; gap: 5px; min-width: 170px; padding-right: 26px; }
.plan-snapshot-item + .plan-snapshot-item { border-left: 1px solid #d8e7db; padding-left: 26px; }
.plan-snapshot-item span { color: var(--muted); font-size: .79rem; font-weight: 600; }
.plan-snapshot-item strong { font-size: 1.23rem; font-weight: 760; color: var(--ink); letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
[data-panel="data"] > .grid { grid-template-columns: minmax(300px, .8fr) minmax(420px, 1.2fr); }
[data-panel="team"] > .grid { grid-template-columns: minmax(320px, .95fr) minmax(360px, 1.05fr); }
[data-panel="company"] > .grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
[data-panel="company"] #subscription { grid-column: 1 / -1; background: linear-gradient(112deg, #f6faf6, #ffffff 75%); }
[data-panel="company"] #subscription p { max-width: 780px; }
#dataset-form, #invite-form, #organization-form, #accept-invitation-form {
  padding: 26px;
}
#dataset-form h2, #invite-form h2, #organization-form h2,
#accept-invitation-form h2 { padding-bottom: 16px; border-bottom: 1px solid var(--line); }
#inspect-form h3 { margin-top: 2px; }
#inspect-form label, #preview-form label { margin-top: 16px; }
#inspect-form button { margin-top: 6px; }
#accuracy-content > .table-wrap { border: 1px solid var(--line); border-radius: 9px; }
#accuracy-content > .table-wrap table { min-width: 700px; }
#customer-list .registry-table { border-radius: 9px; border: 1px solid var(--line); }
#customer-list .registry-table th { border-bottom: 1px solid var(--line-strong); }
#customer-list .registry-table tbody tr:last-child td { border-bottom: 0; }
#customer-detail.drawer-visible .drawer-heading { margin-bottom: 22px; }
#customer-detail.drawer-visible .client-metrics { gap: 12px; }
#customer-detail.drawer-visible .ui-stat { background: #fbfcfa; }
#customer-detail.drawer-visible .ui-stat.featured { background: #edf5ef; }
#customer-detail.drawer-visible .signal-panel { border-color: var(--line); }
[data-panel="team"] .table-wrap td,
[data-panel="company"] .table-wrap td { vertical-align: middle; }
[data-panel="team"] .table-wrap td button,
[data-panel="company"] .table-wrap td button { min-height: 34px; }
@media (max-width: 78rem) {
  [data-panel="data"] > .grid, [data-panel="team"] > .grid,
  [data-panel="company"] > .grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 68rem) {
  [data-panel="data"] > .grid,[data-panel="team"] > .grid,[data-panel="company"] > .grid {
    grid-template-columns: minmax(0,1fr);
  }
  [data-panel="company"] #subscription { grid-column: 1; }
}
@media (max-width: 40rem) {
  .plan-snapshot-item + .plan-snapshot-item { padding-left: 0; border-left: 0; }
  .plan-snapshot-item { padding: 0; min-width: min(100%, 200px); }
  .plan-snapshot { gap: 18px; }
  #dataset-form,#invite-form,#organization-form,#accept-invitation-form { padding: 18px; }
}


/* Interaction polish: unobtrusive notifications, chart captions and dense client registry. */
#notice {
  position: fixed;
  top: auto;
  bottom: clamp(16px, 2vw, 32px);
  right: clamp(16px, 2vw, 32px);
  left: auto;
  width: min(390px, calc(100vw - 32px));
  z-index: 120;
  pointer-events: none;
}
#notice:empty { display: none; }
.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 15px 14px;
  background: #ffffff;
  border: 1px solid #dbe6de;
  border-left: 3px solid var(--accent);
  border-radius: 12px;
  box-shadow: 0 12px 35px rgba(20,45,32,.14);
  pointer-events: auto;
  animation: toast-enter .18s ease-out both;
}
.toast-error { border-left-color: var(--danger); border-color: #efdcd2; }
.toast-symbol {
  display: grid;
  place-items: center;
  flex: 0 0 26px;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: #e2f0e7;
  color: var(--accent);
  font-size: .85rem;
  font-weight: 800;
}
.toast-error .toast-symbol { background: #f9e9e3; color: var(--danger); }
.toast-copy { display: grid; gap: 3px; min-width: 0; flex: 1; }
.toast-eyebrow { font-size: .73rem; font-weight: 750; color: var(--ink); }
.toast-message { color: var(--soft); font-size: .83rem; line-height: 1.45; margin: 0; overflow-wrap: anywhere; }
.toast-close {
  width: 28px; height: 28px; min-height: 28px;
  padding: 0; flex: 0 0 28px;
  background: transparent; color: var(--muted);
  border-radius: 8px; font-weight: 400; font-size: 1.3rem; line-height: 1;
}
.toast-close:hover { background: var(--side); color: var(--ink); }
@keyframes toast-enter {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
[data-panel][aria-busy="true"]::before { display: none; content: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.loading-panel {
  display: grid; gap: 14px; padding: 27px;
  border: 1px solid var(--line); background: var(--surface);
  border-radius: 13px; margin: 0 0 18px;
}
.loading-skeleton {
  height: 13px; width: 65%; border-radius: 7px;
  background: linear-gradient(100deg,#ebf0ed 20%,#f7f9f7 45%,#ebf0ed 70%);
  background-size: 230% 100%;
  animation: loading-shimmer 1.4s ease-in-out infinite;
}
.loading-head { width: 29%; height: 21px; margin-bottom: 9px; }
.loading-line.wide { width: 95%; }
.loading-line.short { width: 42%; }
@keyframes loading-shimmer {
  0% { background-position: 140% 0; }
  100% { background-position: -70% 0; }
}
.trend-tooltip {
  min-width: 150px; gap: 5px;
  padding: 12px 15px; border-radius: 10px;
  transform: translate(-50%, calc(-100% - 15px));
  text-align: left;
}
.trend-tooltip-below { transform: translate(-50%, 16px); }
.trend-tooltip-month { font-size: .76rem; color: #c8dbcf; }
.trend-tooltip-value { font-size: 1.07rem; color: #fff; font-weight: 760; font-variant-numeric: tabular-nums; }
.trend-tooltip-type { color: #c8dbcf; font-size: .72rem; }
#customer-list .registry-table table { min-width: 820px; }
#customer-list .registry-table th { padding: 11px 14px; }
#customer-list .registry-table td {
  padding: 10px 14px; height: auto;
  min-height: 56px; font-size: .84rem;
}
#customer-list .registry-table td:first-child { padding-left: 14px; }
#customer-list .registry-table tbody tr { height: 62px; }
.registry-client-link { font-weight: 700; font-size: .86rem; line-height: 1.35; }
.registry-date { font-size: .82rem; font-weight: 680; }
.registry-cycle { gap: 2px; }
.registry-cycle-note {
  display: inline-flex; align-items: center; width: fit-content;
  padding: 2px 7px; margin-top: 2px;
  border: none; border-radius: 5px;
  font-size: .68rem; font-weight: 650; line-height: 1.4;
  background: #faf1e5;
}
.registry-cycle-note.danger { background: #f9e9e3; }
.registry-signals { display: flex; gap: 5px 12px; align-items: center; flex-wrap: wrap; }
.registry-signal {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .72rem; line-height: 1.25;
  white-space: nowrap;
}
.registry-signal-label { font-size: .69rem; color: var(--muted); }
.registry-signal-value { font-size: .7rem; color: var(--accent); font-weight: 680; }
.registry-signal.alert .registry-signal-value { color: var(--danger); }
.registry-signal.unknown .registry-signal-value { color: var(--muted); font-weight: 560; }
.registry-last { font-size: .78rem; color: var(--soft); font-variant-numeric: tabular-nums; }
@media (max-width: 40rem) {
  #notice { top: auto; bottom: max(12px, env(safe-area-inset-bottom)); right: 12px; width: min(380px, calc(100vw - 24px)); }
  body:has(> .message.error) #notice { top: auto; }
  .toast { padding: 12px; }
  #customer-list .registry-table table { min-width: 790px; }
  #customer-list .registry-table td { padding: 10px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .toast, .loading-skeleton { animation: none; }
}

/* Compact, independently legible stability indicators (date / amount). */
.registry-signals { display: flex; flex-wrap: nowrap; gap: 14px; align-items: center; width: fit-content; border-radius: 6px; }
.registry-signals:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
.registry-signal { display: inline-flex; align-items: center; gap: 5px; font-size: .75rem; line-height: 1.35; }
.registry-signal-label { font-size: .75rem; color: var(--soft); font-weight: 570; }
.registry-signal-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 17px; height: 17px; flex: 0 0 17px;
  border-radius: 50%; border: 1px solid var(--line-strong);
  background: #f2f4f1; color: var(--soft);
  font-size: .72rem; line-height: 1; font-weight: 760;
}
.registry-signal.alert .registry-signal-icon { border-color: #e2b98d; color: #935322; background: #fff5e8; }
.registry-signal.unknown .registry-signal-icon { border-color: #cfd5d0; color: #68756d; background: #f7f7f5; }
.registry-signal.alert .registry-signal-label { color: var(--danger); font-weight: 660; }
.registry-signal.unknown .registry-signal-label { color: var(--muted); }
@media (max-width: 40rem) { .registry-signals { gap: 10px; } }

