/* Shared dark console: typography, surfaces and controls for all web roles. */
@font-face {
  font-family: 'Source Sans 3'; font-style: normal; font-weight: 200 900;
  font-display: swap; src: url('/static/fonts/source-sans-3-cyrillic.woff2') format('woff2');
  unicode-range: U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}
@font-face {
  font-family: 'Source Sans 3'; font-style: normal; font-weight: 200 900;
  font-display: swap; src: url('/static/fonts/source-sans-3-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
:root {
  color-scheme: dark;
  --bg: #0f1722;
  --surface: #172333;
  --surface-2: #1d2b3e;
  --sidebar: #131e2c;
  --control: #111d2c;
  --line: #2b3b50;
  --line-strong: #4a5d76;
  --text: #edf3fb;
  --muted: #aab9cc;
  --accent: #568cff;
  --accent-strong: #83aaff;
  --accent-soft: #1c3359;
  --action: #3566b0;
  --info: #70b8f7;
  --info-strong: #9bd0ff;
  --info-soft: #193550;
  --danger: #ff8b86;
  --danger-soft: #3b242b;
  --warning: #f4bf69;
  --warning-soft: #392e24;
  --success: #72d5a2;
  --success-soft: #1a382f;
  --success-line: #376b59;
  --shadow: none;
  --radius: 12px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --control-height: 42px;
}

html,
body { background: var(--bg); color: var(--text); }
body { font-family: 'Source Sans 3', sans-serif; font-size: 15px; font-weight: 400; line-height: 1.5; font-variant-numeric: tabular-nums; }
::selection { background: #3c66ad; color: #fff; }
a { color: var(--info); text-underline-offset: 3px; }
a:hover { color: var(--info-strong); }

.app-shell { grid-template-columns: 224px minmax(0, 1fr); }
.sidebar {
  gap: 28px;
  padding: 24px 12px 20px;
  border-color: var(--line);
  background: var(--sidebar);
  overflow-y: auto;
  scrollbar-color: var(--line-strong) var(--sidebar);
}
.brand { gap: 12px; padding: 0 8px 8px; color: var(--text); }
.brand-mark {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--action);
  box-shadow: none;
  font-size: 13px;
}
.brand-title { font-size: 18px; font-weight: 600; letter-spacing: -0.015em; }
.brand-subtitle { color: var(--muted); }
.nav-list { gap: 3px; }
.nav-section {
  margin: 20px 12px 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}
.nav-section:first-child { margin-top: 0; }
.nav-item {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #c3d1e3;
  font-size: 15px;
  font-weight: 400;
  padding: 10px 12px;
}
.nav-item:hover { background: var(--surface-2); color: #fff; }
.nav-item.active {
  border-color: transparent;
  background: var(--accent-soft);
  color: #f4f8ff;
  font-weight: 600;
}
.nav-warn-badge { background: var(--warning); color: #192235; }
.sidebar-footer { border-color: var(--line); }
.user-pill { color: #c1cfe0; }
.main-content { width: 100%; max-width: 1540px; margin-inline: auto; padding: 24px clamp(24px, 3vw, 40px) 64px; }

.page-header { align-items: center; margin: 0 0 22px; }
.page-header > div > .eyebrow { display: none; }
h1 { margin: 0; font-size: 32px; font-weight: 600; line-height: 1.2; letter-spacing: -0.02em; }
h2 { margin: 28px 0 12px; font-size: 22px; font-weight: 600; letter-spacing: -0.015em; }
h3 { font-size: 17px; font-weight: 600; }
.page-note { max-width: 70ch; margin-bottom: 24px; color: var(--muted); }
.muted, .page-note { color: var(--muted); }
.surface, .table-wrap { border-color: var(--line); background: var(--surface); box-shadow: none; }
.panel { padding: 22px; }
.panel > h2:first-child, .chart-panel > h2:first-child { margin-top: 0; }

.network-status {
  min-height: 28px;
  margin-bottom: 22px;
  padding: 4px 9px;
  border-color: var(--success-line);
  background: var(--success-soft);
  color: var(--success);
  font-size: 11px;
}
.network-dot { width: 7px; height: 7px; background: var(--success); box-shadow: none; }
.network-status.is-offline { border-color: #8d5258; background: var(--danger-soft); color: var(--danger); }
.network-status.is-offline .network-dot { background: var(--danger); box-shadow: none; }

.metrics-grid { gap: 10px; margin-bottom: 20px; }
.metric-card { min-height: 116px; padding: 18px 20px; }
.metric-label, .kpi-label { color: var(--muted); font-size: 11px; letter-spacing: 0.06em; }
.metric-value { margin-top: 10px; color: var(--text); font-size: 30px; letter-spacing: -0.025em; }
.metric-card:first-child .metric-value { color: #a9c5ff; }
.metric-hint { color: var(--muted); }
.manager-grid { grid-template-columns: minmax(0, 1.65fr) minmax(275px, .8fr); gap: 16px; }
.manager-grid > *, .panel, .table-wrap { min-width: 0; }
.analytics-kpi strong, .kpi-value { color: var(--text); }
.analytics-kpi.is-warning strong { color: var(--warning); }
.progress-bar, .block-progress { border: 0; background: #26374e; }
.progress-fill, .block-progress span { background: var(--accent); }
.block-progress.is-complete span { background: var(--success); }

.toolbar { padding: 14px 16px; }
label { color: #c8d5e5; }
input[type="text"], input[type="number"], input[type="password"],
input[type="date"], input[type="file"], select, textarea {
  border-color: var(--line-strong);
  background: var(--control);
  color: var(--text);
}
input::placeholder, textarea::placeholder { color: #9cabc0; opacity: 1; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: 2px solid #568cff66; outline-offset: 1px; }
button, .button, .button-link { border-radius: 6px; background: var(--action); color: #fff; }
button:hover, .button:hover, .button-link:hover { background: #3b6acb; color: #fff; }
button:disabled, .button:disabled { cursor: not-allowed; opacity: .5; }
.button-secondary, button.secondary, .btn-secondary {
  border-color: var(--line-strong);
  background: #1b2b43;
  color: var(--text);
}
.button-secondary:hover, button.secondary:hover, .btn-secondary:hover,
.btn-link:hover { background: #294163; color: #fff; }
.btn-link { border-color: #3a5989; background: var(--accent-soft); color: #b8d0ff; }
.button-ghost, button.ghost { background: transparent; color: var(--muted); }
.button-ghost:hover, button.ghost:hover { background: var(--surface-2); color: var(--text); }
.button-danger, button.danger, .btn-danger-sm { background: #a84c52; color: #fff; }
.button-danger:hover, button.danger:hover, .btn-danger-sm:hover { background: #bc5c62; }

.table-wrap { scrollbar-color: #496485 #142238; }
th { background: #1c2d46; color: #c9d8eb; font-size: 12px; }
th, td { border-color: var(--line); }
tbody tr:hover td { background: #20334e; }
tr.inactive td { background: #101d30; color: var(--muted); }
.analytics-matrix th:first-child { background: #1c2d46; }
.analytics-matrix td:first-child { background: var(--surface); }
.analytics-employee-table tr.row-attention td { background: var(--warning-soft); }
.analytics-block-card,
.evening-block,
.esum-people-block { border-left-width: 1px; }
.analytics-block-card:nth-child(n),
.evening-blocks .evening-block:nth-child(n) { border-left-color: var(--line); }
.esum-people-block.is-reported { border-left-color: var(--success-line); }
.esum-h-ok { color: var(--success); }
.evening-block { background: #182840; box-shadow: none; }
.evening-block h3 { background: #20334e; color: var(--text); }

.badge, .chip, .slot-pill { border-color: var(--line-strong); background: var(--surface-2); color: #d7e5f8; }
.flash, .alert { border-color: #375a8a; background: var(--accent-soft); color: #bed5ff; }
.flash-warn, .alert-warning { border-color: #836744; background: var(--warning-soft); color: var(--warning); }
.alert-error, .save-status.is-error { border-color: #92555b; background: var(--danger-soft); color: var(--danger); }
.save-status.is-success { border-color: var(--success-line); background: var(--success-soft); color: var(--success); }
.save-status.is-pending { border-color: var(--line-strong); background: var(--surface-2); color: var(--muted); }
.settings-card:hover { background: #20334e; }
.settings-kicker { color: #b2cbff; }
code { border-color: var(--line); background: #0c192b; color: #bdd7ff; }

.product-row { border-color: var(--line); background: #111e31; }
.product-info strong { color: var(--text); }
.stepper { border-color: var(--line-strong); }
.step-btn { background: #1b2c47; color: #92b6ff; }
.step-btn:hover { background: #2d4e7e; color: #fff; }
.step-btn:active { background: #315fc0; color: #fff; }
.stepper input.step-input { background: #101d30; color: var(--text); }
.score-card { border-color: #35527b; }
.score-total { color: #a9c5ff; }
.score-fab { border-color: #35527b; background: #142238; }
.score-fab-total { color: #a9c5ff; }
.score-fab-details { background: #192a42; }
.score-fab-list li { background: #122138; }

.login-body { background: #0b1423; }
.login-panel { border-color: #35527b; padding: 32px; }
.login-panel h1 { margin: 26px 0 18px; }

a:focus-visible, button:focus-visible, .button:focus-visible,
.nav-item:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid #9fc1ff;
  outline-offset: 2px;
}

@media (max-width: 860px) {
  .app-shell { display: block; }
  .sidebar {
    position: sticky;
    top: 0;
    z-index: 30;
    height: auto;
    gap: 10px;
    padding: 10px 14px 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    overflow-y: visible;
  }
  .brand { padding: 0 2px; }
  .brand-mark { width: 30px; height: 30px; }
  .brand-subtitle, .nav-section, .user-pill { display: none; }
  .sidebar-footer {
    display: block;
    position: absolute;
    top: 9px;
    right: 14px;
    margin: 0;
    padding: 0;
    border: 0;
  }
  .sidebar-footer button { min-height: 30px; padding: 4px 8px; font-size: 12px; }
  .nav-list {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    margin: 0 -14px;
    padding: 3px 14px 8px;
    scrollbar-width: none;
  }
  .nav-list::-webkit-scrollbar { display: none; }
  .nav-item { flex: none; min-height: 35px; padding: 7px 10px; white-space: nowrap; }
  .main-content { padding: 20px 16px 64px; }
  .manager-grid { grid-template-columns: minmax(0, 1fr); }
  .score-fab { left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); }
  .score-fab-main { padding: 7px 12px; }
  .score-fab-topline { justify-content: space-between; }
  .score-fab-total { font-size: 18px; }
  .score-fab-preview { text-align: left; }
  #rform { padding-bottom: 95px; }
}

@media (max-width: 520px) {
  h1 { font-size: 25px; }
  .page-header { gap: 10px; }
  .metric-card { min-height: 92px; }
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panel { padding: 16px; }
  .report-form .panel h2 { margin: 0 0 12px; font-size: 18px; }
  .product-row { gap: 8px; }
  .score-fab-preview { font-size: 11px; }
}

@media print {
  :root { color-scheme: light; --bg: #fff; --surface: #fff; --surface-2: #fff;
    --line: #bbb; --line-strong: #999; --text: #111; --muted: #555; }
  html, body, .surface, .table-wrap { background: #fff; color: #111; }
  th, td { background: #fff; color: #111; }
}

/* Work surfaces: one clear result, one operational queue, then detail. */
.section-kicker { display: block; color: #93acd0; font-size: 11px; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.section-heading h2 { margin: 4px 0 0; }
.section-count { color: var(--muted); font-size: 12px; white-space: nowrap; }
.main-content > .network-status { display: flex; width: max-content; min-height: 24px; margin: 0 0 16px auto; padding: 0; border: 0; background: transparent; font-size: 12px; }
.page-header { padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.page-header > div > .eyebrow { display: none; }
.toolbar { margin-bottom: 24px; border-radius: 8px; background: #101d30; }
.toolbar form { width: 100%; gap: 10px 14px; }
.toolbar form button { margin-left: auto; }

.command-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .85fr); gap: 16px; margin-bottom: 16px; }
.command-score { display: flex; flex-direction: column; min-height: 312px; padding: 26px 30px 24px; border: 1px solid #3a63ab; border-radius: 12px; background: #173363; color: #fff; }
.command-score .section-kicker { color: #b9d3ff; }
.command-score-top, .command-progress-copy { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.command-period { color: #d1e0fc; font-size: 12px; }
.command-score-main { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 16px; margin: 16px 0 auto; }
.command-score-main strong { font-size: clamp(64px, 7vw, 104px); font-weight: 720; line-height: 1; letter-spacing: -.065em; font-variant-numeric: tabular-nums; }
.command-score-main > span { color: #ccdcfa; font-size: 15px; }
.command-progress-copy { margin: 18px 0 8px; color: #dce8ff; font-size: 12px; }
.command-progress-copy b { color: #fff; font-size: 15px; }
.command-progress { height: 7px; overflow: hidden; border-radius: 4px; background: #35548a; }
.command-progress span { display: block; height: 100%; border-radius: inherit; background: #a8caff; }
.command-score-breakdown { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 24px; padding-top: 18px; border-top: 1px solid #4b6ba1; }
.command-score-breakdown div { display: grid; gap: 4px; padding-left: 18px; border-left: 1px solid #4b6ba1; }
.command-score-breakdown div:first-child { padding-left: 0; border-left: 0; }
.command-score-breakdown span { color: #c2d5f6; font-size: 12px; }
.command-score-breakdown strong { font-size: 24px; font-weight: 680; line-height: 1.1; }
.command-attendance { min-width: 0; padding: 24px; }
.command-attendance-head { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.command-attendance h2 { margin: 5px 0 0; font-size: 20px; }
.command-attendance-head > strong { font-size: 35px; line-height: 1; letter-spacing: -.04em; }
.command-attendance-head small { color: var(--muted); font-size: 17px; font-weight: 500; }
.command-attendance-note { margin: 8px 0 18px; color: var(--muted); font-size: 12px; }
.attendance-list { border-top: 1px solid var(--line); }
.attendance-group { padding: 13px 0; border-bottom: 1px solid var(--line); }
.attendance-group h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 13px; }
.attendance-group h3 b { margin-left: auto; color: var(--muted); }
.attendance-dot { width: 7px; height: 7px; border-radius: 50%; }
.attendance-dot.is-missing { background: var(--warning); }
.attendance-dot.is-submitted { background: var(--success); }
.attendance-group .person-list { display: flex; flex-wrap: wrap; gap: 5px 12px; padding: 0; list-style: none; color: var(--muted); font-size: 12px; }
.attendance-group .muted { margin: 0; font-size: 12px; }
.manager-grid { grid-template-columns: minmax(0, 1.45fr) minmax(300px, .85fr); align-items: stretch; margin: 0 0 24px; }
.manager-grid > .panel, .manager-chart-panel { padding: 22px; }
.manager-chart-panel { display: flex; flex-direction: column; }
.manager-chart-panel canvas { margin: auto 0; }
.manager-grid .table-wrap { border: 0; border-radius: 0; }
.manager-grid th { background: transparent; }
.manager-grid td { padding-top: 13px; padding-bottom: 13px; }

.personal-summary { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(270px, .7fr); gap: 16px; margin: 0 0 20px; }
.dashboard-summary { display: grid; grid-template-columns: minmax(0, 1.5fr) repeat(2, minmax(180px, .6fr)); gap: 16px; margin-bottom: 20px; }
.dashboard-primary { display: flex; flex-direction: column; min-height: 260px; padding: 26px 30px; border: 1px solid #3a63ab; border-radius: 12px; background: #173363; }
.dashboard-primary .section-kicker { color: #b9d3ff; }
.dashboard-primary-value { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; margin: 14px 0 auto; }
.dashboard-primary-value strong { font-size: clamp(66px, 7vw, 104px); font-weight: 720; line-height: 1; letter-spacing: -.06em; }
.dashboard-primary-value span { color: #d1e0fc; }
.dashboard-primary a { align-self: flex-start; color: #fff; font-weight: 700; }
.dashboard-secondary { display: flex; flex-direction: column; padding: 25px; }
.dashboard-secondary > span:nth-child(2) { margin-top: auto; color: var(--muted); }
.dashboard-secondary strong { font-size: 38px; font-weight: 700; line-height: 1.1; letter-spacing: -.03em; }
.sales-home { display: grid; gap: 18px; }
.sales-home-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 4px 0 16px; border-bottom: 1px solid var(--line); }
.sales-home-header h1 { font-size: clamp(27px, 3vw, 36px); }
.sales-home-header p { margin: 8px 0 0; color: var(--muted); }
.sales-home-primary { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 42px; padding: 9px 15px; border: 1px solid #4777cc; border-radius: 9px; background: #244c8d; color: #fff; font-weight: 700; text-decoration: none; white-space: nowrap; }
.sales-home-primary:hover { background: #2d5ba2; color: #fff; }
.sales-home-source { display: flex; align-items: center; gap: 10px 12px; flex-wrap: wrap; padding: 12px 15px; border: 1px solid #3b5b82; border-radius: 10px; background: #14283f; }
.sales-home-source p { flex: 1 1 420px; margin: 0; color: #c2d2e6; }
.sales-home-source strong { color: #fff; }
.sales-home-source a { font-weight: 650; }
.source-mark { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: #8ec7fa; }
.sales-home-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-block: 1px solid var(--line); }
.sales-home-metrics > div { display: grid; align-content: start; gap: 3px; min-height: 126px; padding: 18px 22px; border-right: 1px solid var(--line); }
.sales-home-metrics > div:first-child { padding-left: 4px; }
.sales-home-metrics > div:last-child { border-right: 0; }
.sales-home-metrics span { color: #c4d0e0; font-size: 13px; font-weight: 620; }
.sales-home-metrics strong { font-size: clamp(29px, 3.8vw, 43px); line-height: 1.1; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.sales-home-metrics small { max-width: 38ch; color: var(--muted); font-size: 12px; }
.sales-home-coverage { display: grid; grid-template-columns: minmax(190px, .7fr) minmax(260px, 1fr) minmax(280px, 1.5fr); align-items: center; gap: 12px 20px; padding: 13px 16px; border-radius: 9px; background: #111e30; }
.sales-home-coverage div { display: grid; gap: 3px; }
.sales-home-coverage strong { color: #dce7f5; font-size: 12px; }
.sales-home-coverage span, .sales-home-coverage p { margin: 0; color: var(--muted); font-size: 12px; }
.sales-home-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr); gap: 16px; }
.sales-home-section { min-width: 0; padding: 19px 21px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
.sales-home-section h2 { margin: 0; font-size: 18px; }
.sales-home-section-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 17px; }
.sales-home-section-head p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.sales-home-section-head > a { flex: 0 0 auto; font-size: 12px; font-weight: 650; }
.product-bars, .heavy-list { margin: 0; padding: 0; list-style: none; }
.product-bars { display: grid; gap: 13px; }
.product-bar-label { display: flex; justify-content: space-between; gap: 15px; margin-bottom: 5px; font-size: 13px; }
.product-bar-label span { min-width: 0; overflow-wrap: anywhere; }
.product-bar-label strong { flex: 0 0 auto; color: #dce8fa; font-size: 12px; font-variant-numeric: tabular-nums; }
.product-bar-track { height: 6px; overflow: hidden; border-radius: 5px; background: #263850; }
.product-bar-track span { display: block; height: 100%; border-radius: inherit; background: #6e9ff2; }
.heavy-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.heavy-list li:first-child { padding-top: 0; }
.heavy-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.heavy-list li > span { align-self: center; font-weight: 650; }
.heavy-list li > strong { text-align: right; font-size: 12px; }
.heavy-list li > small { grid-column: 1 / -1; color: var(--muted); font-size: 12px; }
.trend-section { padding-bottom: 12px; }
.trend-head { justify-content: flex-start; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.trend-head > div { flex: 1 1 440px; }
.trend-head label { color: #c4d0e0; font-size: 12px; font-weight: 650; }
.trend-head select { min-width: min(280px, 100%); min-height: 38px; padding: 7px 32px 7px 10px; border: 1px solid var(--line-strong); border-radius: 7px; background: #101d30; color: var(--text); font: inherit; }
.trend-chart-wrap { position: relative; height: 275px; }
.sales-chart-note { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.sales-home-shortcuts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-block: 1px solid var(--line); }
.sales-home-shortcuts > a { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 16px; border-right: 1px solid var(--line); color: var(--text); text-decoration: none; }
.sales-home-shortcuts > a:first-child { padding-left: 4px; }
.sales-home-shortcuts > a:last-child { border-right: 0; }
.sales-home-shortcuts > a:hover strong, .sales-home-shortcuts > a:hover b { color: var(--info-strong); }
.sales-home-shortcuts span { display: grid; gap: 2px; }
.sales-home-shortcuts strong { font-size: 13px; }
.sales-home-shortcuts small { color: var(--muted); font-size: 11px; }
.sales-home-shortcuts b { color: #94a9c5; }
.sales-home-empty, .sales-home-empty-state { color: var(--muted); }
.sales-home-empty-state { padding: 25px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
.sales-home-empty-state h2 { margin: 0 0 7px; color: var(--text); font-size: 19px; }
.sales-home-empty-state p { max-width: 64ch; }

@media (max-width: 1000px) {
  .sales-home-coverage { grid-template-columns: 1fr 1fr; }
  .sales-home-coverage p { grid-column: 1 / -1; }
  .sales-home-grid { grid-template-columns: 1fr; }
}
@media (max-width: 650px) {
  .sales-home-header { align-items: start; flex-direction: column; gap: 13px; }
  .sales-home-metrics { grid-template-columns: 1fr; }
  .sales-home-metrics > div, .sales-home-metrics > div:first-child { min-height: auto; padding: 13px 2px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sales-home-metrics > div:last-child { border-bottom: 0; }
  .sales-home-metrics strong { font-size: 32px; }
  .sales-home-coverage { grid-template-columns: 1fr; }
  .sales-home-coverage p { grid-column: auto; }
  .sales-home-section { padding: 16px; }
  .sales-home-section-head { align-items: start; }
  .sales-home-section-head > a { padding-top: 3px; }
  .trend-head { align-items: start; }
  .trend-head select { width: 100%; }
  .trend-chart-wrap { height: 235px; }
  .sales-home-shortcuts { grid-template-columns: 1fr; }
  .sales-home-shortcuts > a, .sales-home-shortcuts > a:first-child { padding: 12px 2px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sales-home-shortcuts > a:last-child { border-bottom: 0; }
}
.personal-score { min-height: 265px; display: flex; flex-direction: column; padding: 26px 30px; border: 1px solid #3a63ab; border-radius: 12px; background: #173363; }
.personal-score.no-plan { min-height: 230px; }
.personal-score .section-kicker { color: #b9d3ff; }
.personal-score-value { display: flex; align-items: baseline; gap: 12px; margin: 10px 0 auto; }
.personal-score-value strong { font-size: clamp(70px, 8vw, 112px); font-weight: 720; line-height: 1; letter-spacing: -.06em; }
.personal-score-value > span { color: #d1e0fc; font-size: 16px; }
.personal-next { display: flex; flex-direction: column; align-items: start; padding: 26px; }
.personal-next h2 { margin: 11px 0 5px; font-size: 26px; }
.personal-next p { max-width: 32ch; margin: 0 0 auto; color: var(--muted); }
.personal-next .button-link { margin-top: 20px; }

.analytics-overview { display: grid; grid-template-columns: minmax(0, 1.35fr) repeat(2, minmax(160px, .55fr)); gap: 0; margin-bottom: 12px; border: 1px solid #3a63ab; border-radius: 12px; background: #173363; }
.analytics-overview > * { min-width: 0; padding: 22px 26px; }
.analytics-overview-title h2 { margin: 5px 0 6px; font-size: 23px; }
.analytics-overview-title p { margin: 0; color: #c9dafa; font-size: 12px; }
.analytics-overview .section-kicker, .analytics-overview-main > span { color: #bdd3f5; }
.analytics-overview-main { display: grid; align-content: center; gap: 6px; border-left: 1px solid #4b6ba1; }
.analytics-overview-main > span { font-size: 12px; }
.analytics-overview-main strong { font-size: 38px; font-weight: 700; line-height: 1; letter-spacing: -.04em; }
.analytics-overview-main small { font-size: 18px; font-weight: 500; color: #bdd3f5; }
.analytics-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.analytics-kpi { padding: 18px 22px; }

.report-intro { display: flex; align-items: baseline; gap: 16px; margin: 0 0 20px; padding: 0 0 17px; border-bottom: 1px solid var(--line); }
.report-intro .section-kicker { flex: none; }
.report-intro .page-note { margin: 0; }
.report-form { gap: 0; }
.report-form .panel.surface { padding: 0 0 5px; border: 0; border-radius: 0; border-bottom: 1px solid var(--line); background: transparent; }
.report-form .panel + .panel { margin-top: 24px; }
.report-form .panel h2 { margin: 0 0 11px; font-size: 20px; }
.report-form .product-list { gap: 0; }
.report-form .product-row { min-height: 60px; padding: 9px 2px; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent; }
.report-form .product-row:first-child { border-top: 0; }
.report-form .product-row:hover { background: #14243a; }
.report-actions { margin-top: 20px; }
.report-actions button { min-height: 44px; }
.score-card { border: 1px solid #35527b; background: #173363; }
.score-card .score-total { color: #fff; }

@media (max-width: 1100px) {
  .command-grid, .manager-grid, .personal-summary { grid-template-columns: 1fr; }
  .dashboard-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-primary { grid-column: 1 / -1; }
  .analytics-overview { grid-template-columns: 1fr 1fr; }
  .analytics-overview-title { grid-column: 1 / -1; border-bottom: 1px solid #4b6ba1; }
}
@media (max-width: 700px) {
  .command-score { min-height: 280px; padding: 22px; }
  .command-score-main strong { font-size: 76px; }
  .command-attendance { padding: 20px; }
  .analytics-overview-main { padding: 16px; }
  .analytics-kpis { grid-template-columns: 1fr 1fr; }
  .report-intro { display: block; }
  .report-intro .page-note { margin-top: 7px; }
  .report-form .panel.surface { padding: 0 0 5px; }
  .report-form .product-row { padding: 10px 0; }
}
@media (max-width: 480px) {
  .dashboard-summary { grid-template-columns: 1fr 1fr; }
  .dashboard-primary { min-height: 230px; padding: 22px; }
  .dashboard-primary-value strong { font-size: 72px; }
  .dashboard-secondary { padding: 17px; }
  .dashboard-secondary strong { font-size: 27px; }
  .command-score-main strong { font-size: 64px; }
  .command-score-breakdown strong { font-size: 20px; }
  .analytics-overview { grid-template-columns: 1fr 1fr; }
  .analytics-overview-main strong { font-size: 30px; }
  .analytics-kpis { grid-template-columns: 1fr; }
  .personal-score { min-height: 235px; padding: 22px; }
  .personal-score-value strong { font-size: 76px; }
}

/* Console rhythm: shared control geometry and quieter, readable data surfaces. */
html { scrollbar-color: var(--line-strong) var(--bg); scrollbar-width: thin; }
b, strong { font-weight: 600; }
input, textarea { caret-color: var(--accent); }
input[type="search"], input[type="month"],
input[type="text"], input[type="number"], input[type="password"],
input[type="date"], input[type="file"], select, textarea {
  min-height: var(--control-height);
  padding: 9px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--control);
  color: var(--text);
  font: inherit;
  line-height: 1.4;
}
input[type="search"], input[type="month"] { width: 100%; }
button, .button, .btn-secondary, .btn-link, .button-link {
  min-height: var(--control-height);
  padding: 9px 16px;
  font-weight: 600;
  line-height: 1.4;
}
.button, .btn-secondary, .btn-link, .button-link {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
button:disabled { opacity: .5; }
.page-header { gap: 24px; padding-bottom: 20px; }
.page-header p { margin-top: 8px; margin-bottom: 0; }
.eyebrow, .section-kicker { display: none; }
.page-note, .page-lead, .muted { line-height: 1.5; }
.toolbar { padding: 20px; background: var(--surface); }
.toolbar form { gap: 16px; }
.toolbar form > label { display: grid; gap: 7px; flex: 1 1 150px; min-width: 0; font-size: 14px; font-weight: 400; }
.toolbar form > label:has(input[name="year"]),
.toolbar form > label:has(input[name="group_number"]) { flex: 0 0 80px; }
.toolbar form > label:has(input[type="checkbox"]) { display: flex; flex: none; align-items: center; }
.form-grid label { display: grid; gap: 7px; }
th, td { padding: 14px 16px; }
th { font-size: 13px; font-weight: 600; line-height: 1.4; background: var(--surface-2); }
.table-wrap { scrollbar-color: var(--line-strong) var(--surface); }
.badge, .chip, .slot-pill { padding: 5px 10px; font-weight: 500; line-height: 1.35; }
.section-heading { align-items: center; }
.team-member { padding: 20px; gap: 24px; }
.team-member-settings { gap: 12px; }
.team-member-settings label { gap: 7px; }
.team-member-settings label span { font-size: 13px; font-weight: 400; text-transform: none; }
.team-directory-head { align-items: center; margin-bottom: 18px; }
.team-role-card h3, .team-role-card > span,
.metric-label, .kpi-label, .analytics-kpi span, .slice-overview-kpis span {
  text-transform: none; letter-spacing: 0; font-weight: 400; font-size: 14px;
}
.settings-kicker { font-weight: 400; text-transform: none; letter-spacing: 0; }
.settings-card { padding: 24px; gap: 10px; }
.settings-card strong { font-size: 22px; font-weight: 600; }

/* Year view: overview strip, compact table and aligned disclosure columns. */
.yearly-page { gap: 24px; }
.yearly-hero { align-items: center; gap: 32px; padding: 0 0 8px; }
.yearly-hero h1 { font-size: 34px; font-weight: 600; margin: 0; letter-spacing: -.02em; }
.yearly-meta { color: var(--muted); margin: 8px 0 4px; font-size: 14px; }
.yearly-hero-copy { max-width: 65ch; font-size: 15px; line-height: 1.5; }
.yearly-period-form { gap: 12px; }
.yearly-period-form label { font-weight: 400; font-size: 14px; }
.yearly-period-form input { width: 80px; }
.yearly-kpis { gap: 0; border-block: 1px solid var(--line); }
.yearly-kpi { min-height: 130px; padding: 20px 24px; border: 0; border-right: 1px solid var(--line); border-radius: 0; background: transparent; }
.yearly-kpi:first-child { padding-left: 0; }
.yearly-kpi:last-child { border-right: 0; }
.yearly-kpi span { font-size: 14px; font-weight: 400; text-transform: none; letter-spacing: 0; }
.yearly-kpi strong { margin: 8px 0 6px; font-size: 34px; font-weight: 600; letter-spacing: -.02em; }
.yearly-kpi small { font-size: 13px; line-height: 1.4; }
.yearly-leaders { gap: 0; }
.yearly-leader { padding: 4px 24px; border: 0; border-right: 1px solid var(--line); border-radius: 0; background: transparent; }
.yearly-leader:first-child { padding-left: 0; }
.yearly-leader:last-child { border-right: 0; }
.yearly-leader:hover { background: transparent; transform: none; text-decoration: underline; text-underline-offset: 4px; }
.yearly-leader-icon { display: none; }
.yearly-leader > span:last-child { gap: 4px; }
.yearly-leader small { font-size: 13px; }
.yearly-leader b { font-size: 15px; }
.yearly-leader em { color: var(--muted); }
.yearly-coverage { border-radius: 12px; }
.yearly-coverage summary { padding: 18px 24px; }
.yearly-results { border-radius: 12px; }
.yearly-results-header { padding: 24px; align-items: center; gap: 24px; }
.yearly-results-header h2 { font-size: 23px; font-weight: 600; }
.yearly-results-header p { max-width: 65ch; font-size: 14px; }
.yearly-results-tools { gap: 12px; flex-wrap: wrap; justify-content: end; }
.yearly-results-tools input { width: 190px; }
.yearly-table { min-width: 960px; }
.yearly-table th { height: auto; padding: 14px 12px; white-space: normal; text-transform: none; letter-spacing: 0; font-size: 13px; background: var(--surface-2); }
.yearly-column-sort { min-height: 0; padding: 0; border: 0; background: transparent; font-weight: 500; line-height: 1.35; white-space: normal; }
.yearly-column-sort:hover { background: transparent; }
.yearly-table td { padding: 16px 12px; height: auto; font-size: 14px; }
.yearly-table th:nth-child(n+3):nth-child(-n+8),
.yearly-table td:nth-child(n+3):nth-child(-n+8) { text-align: right; }
.yearly-table th:nth-child(n+3):nth-child(-n+8) .yearly-column-sort { text-align: right; }
.yearly-rank-col, .yearly-rank { width: 42px; }
.yearly-rank span { width: auto; height: auto; border-radius: 0; background: transparent; font-weight: 400; }
.yearly-person { min-width: 156px; }
.yearly-person small { font-size: 12px; }
.yearly-potential-izp { max-width: 140px; white-space: normal; font-weight: 400; line-height: 1.35; }
.yearly-detail-button { min-height: 36px; padding: 7px 12px; background: transparent; font-weight: 500; }
.yearly-table .yearly-detail-row > td { padding: 0; background: var(--surface); }
.yearly-detail-grid { grid-template-columns: minmax(220px, .85fr) minmax(0, 1.8fr); padding: 0 24px; }
.yearly-detail-grid h3 { color: var(--text); font-size: 16px; font-weight: 600; text-transform: none; letter-spacing: 0; margin-bottom: 14px; }
.yearly-detail-summary { padding: 24px 24px 24px 0; }
.yearly-product-section { padding: 24px 0 24px 24px; }
.yearly-product-heading { gap: 16px; margin-bottom: 12px; }
.yearly-product-hint { margin: 0; font-size: 13px; line-height: 1.5; }
.yearly-product-list { gap: 0 24px; }
.yearly-product summary { gap: 12px; min-height: 48px; padding: 12px 4px; }
.yearly-product summary > span { gap: 10px; }
.yearly-product summary small { white-space: nowrap; font-size: 12px; }
.yearly-product ul { padding: 0 4px 4px; }
.yearly-product li { padding: 10px 12px; border-left-width: 1px; }
.yearly-product li small { margin-top: 3px; font-size: 12px; }
.yearly-day-link { display: inline-block; padding: 3px 0; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 4px; }
.yearly-day-link:hover { text-decoration-color: currentColor; }
.yearly-detail-action { padding: 20px 0; }

/* Review a day: give labels space; align source and result headers. */
.daily-review-grid { gap: 24px; align-items: stretch; }
.daily-review-source, .daily-review-saved { padding: 24px; }
.daily-review-source header, .daily-review-saved header { top: -24px; padding: 0 0 16px; min-height: 84px; }
.daily-review-source header h2, .daily-review-saved header h2 { font-size: 22px; font-weight: 600; margin-bottom: 6px; }
.daily-review-nav { gap: 16px; margin-bottom: 16px; }
.daily-review-view-switch { gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.daily-review-overview { gap: 12px 24px; margin: 24px 0 20px; }
.daily-review-queue { padding: 24px; }
.daily-review-queue-item { padding: 14px 12px; gap: 16px; }
.daily-review-queue-status { padding: 8px 12px; border-radius: 6px; font-size: 14px; }
.daily-review-values dl div, .daily-review-reference-list div { gap: 20px; padding: 10px 0; }

@media (min-width: 861px) and (max-width: 1250px) {
  .app-shell { grid-template-columns: 200px minmax(0, 1fr); }
  .main-content { padding-inline: 24px; }
  .yearly-results-header { align-items: start; flex-direction: column; }
  .yearly-results-tools { justify-content: start; }
}
@media (max-width: 1200px) {
  .yearly-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .yearly-kpi { padding: 20px; }
  .yearly-kpi:first-child { padding-left: 20px; }
  .yearly-kpi:nth-child(2) { border-right: 0; }
  .yearly-kpi:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .yearly-leaders { grid-template-columns: 1fr; gap: 16px; }
  .yearly-leader { border-right: 0; padding: 0; }
  .yearly-detail-grid { grid-template-columns: 1fr; }
  .yearly-detail-summary { padding-right: 0; }
  .yearly-product-section { padding-left: 0; border-left: 0; }
}
@media (max-width: 860px) {
  .app-shell { display: block; }
  .main-content { padding: 20px 16px 48px; }
  .sidebar { padding: 12px 16px 0; gap: 12px; }
  .nav-list { margin-inline: -16px; padding-inline: 16px; }
  .nav-item { padding: 8px 12px; min-height: 40px; font-size: 14px; }
  .page-header { align-items: start; gap: 16px; }
  .yearly-hero { flex-direction: column; align-items: stretch; gap: 20px; }
  .yearly-hero h1 { font-size: 30px; }
  .yearly-period-form { flex-wrap: wrap; }
  .yearly-period-form label { flex: 1; }
  .yearly-period-form input { width: 100%; }
  .yearly-period-form button { width: auto; }
  .yearly-results-header { padding: 20px; align-items: stretch; }
  .yearly-results-tools { width: 100%; }
  .yearly-results-tools input, .yearly-results-tools select { width: 100%; }
  .yearly-results-tools > * { flex: 1 1 170px; }
  .team-member { gap: 16px; }
  .team-directory-head > p { text-align: left; }
}
@media (max-width: 600px) {
  .toolbar form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; }
  .toolbar form > label, .toolbar form > button { min-width: 0; margin: 0; width: 100%; }
  .toolbar form > label:has(select[name="employee"]) { grid-column: 1 / -1; }
  .toolbar { padding: 16px; }
  .yearly-kpi { min-height: 124px; padding: 16px; }
  .yearly-kpi:first-child { padding-left: 16px; }
  .yearly-kpi strong { font-size: 30px; }
  .yearly-kpi span { font-size: 13px; }
  .yearly-leader > span:last-child { grid-template-columns: 1fr auto; width: 100%; gap: 4px 16px; }
  .yearly-leader small { grid-column: 1 / -1; }
  .yearly-leader b { white-space: normal; }
  .yearly-coverage summary { padding: 16px; }
  .yearly-coverage-body { grid-template-columns: 1fr; padding: 0 16px 16px; }
  .daily-review-source, .daily-review-saved { max-height: none; padding: 20px; overflow: visible; }
  .daily-review-source header, .daily-review-saved header { position: static; min-height: 0; }
  .daily-review-message .report-text { max-height: 400px; overflow-y: auto; }
  .daily-review-nav > span { width: 100%; }
  .daily-review-queue { padding: 20px 16px; }
  .daily-review-queue-item { gap: 8px; padding: 14px 4px; }
  .daily-review-queue-record { gap: 4px; }
  .daily-review-queue-status { min-height: 42px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto; transition-duration: 0s; animation-duration: 0s; }
}
.team-role-overview { gap: 0; border-block: 1px solid var(--line); margin-bottom: 24px; }
.team-role-stat { border-radius: 0; padding: 18px 24px; background: transparent; border-right: 1px solid var(--line); }
.team-role-stat:first-child { padding-left: 0; }
.team-role-stat:last-child { border-right: 0; }
.team-role-stat span { font-size: 14px; font-weight: 400; text-transform: none; letter-spacing: 0; }
.team-role-stat strong { font-size: 30px; font-weight: 600; }
.team-toolbar { padding: 20px; }
.settings-grid { grid-template-columns: 1fr; gap: 0; max-width: 960px; }
.settings-grid .settings-card { display: grid; grid-template-columns: 200px minmax(0,1fr); align-items: center; padding: 24px 12px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; }
.settings-grid .settings-card:hover { background: var(--surface); }
.settings-grid .settings-kicker { display: none; }
.settings-grid .settings-card strong { font-size: 20px; }
.sales-home-header h1 { font-size: 32px; font-weight: 600; }
.sales-home-primary { min-height: 42px; background: var(--action); border-color: transparent; border-radius: 6px; padding: 10px 16px; font-weight: 600; }
.sales-home-primary:hover { background: #3b6acb; }
.sales-home-metrics strong { font-size: 36px; font-weight: 600; }
.sales-home-section { padding: 24px; }
.sales-home-section h2 { font-size: 22px; font-weight: 600; }
@media (max-width: 600px) {
  .team-role-overview { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .team-role-stat, .team-role-stat:first-child { padding: 16px; }
  .team-role-stat:nth-child(2) { border-right: 0; }
  .team-role-stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .team-bulk-form { flex-wrap: wrap; }
  .settings-grid .settings-card { grid-template-columns: 1fr; gap: 6px; }
  .sales-home-header h1 { font-size: 30px; }
  .sales-home-section { padding: 20px 16px; }
}
.settings-grid .settings-card { min-height: 88px; }
.daily-review-source header, .daily-review-saved header { min-height: 104px; }
@media (max-width: 600px) {
  .daily-review-source header, .daily-review-saved header { min-height: 0; }
}
/* Keep action links intrinsic: long Russian labels must not shrink into columns. */
.toolbar form > a { flex: 0 0 auto; white-space: nowrap; }
@media (max-width: 860px) {
  .yearly-results-tools { display: grid; grid-template-columns: 1fr; }
  .yearly-results-tools > * { flex: none; min-height: 0; }
  .yearly-results-tools input, .yearly-results-tools select { height: 42px; }
  .team-directory-head { align-items: stretch; }
}
@media (max-width: 600px) {
  .yearly-period-form { display: grid; grid-template-columns: repeat(auto-fit,minmax(88px,1fr)); align-items: end; }
  .toolbar form > a { min-width: 0; white-space: normal; }
}
.toolbar { flex-wrap: wrap; justify-content: start; }
.toolbar > form { width: auto; flex: 1 1 220px; }
.toolbar > form:only-child { flex-basis: 100%; }
.toolbar > a { flex: 0 0 auto; white-space: nowrap; }
.toolbar > form:last-child:not(:first-child) { flex: 0 0 auto; margin-left: auto; }
@media (max-width: 600px) {
  .toolbar > form:not(:only-child) { width: 100%; flex-basis: 100%; }
  .toolbar > form:last-child:not(:first-child) { display: block; margin-left: 0; }
}

/* Keep the analytics navigation identical across the laboratory and history pages. */
.analytics-sidebar .nav-item{display:flex;align-items:center;gap:12px}.analytics-sidebar .nav-item>svg{flex:0 0 20px}.analytics-sidebar .analytics-brand-icon{color:var(--accent);flex:0 0 26px}.analytics-sidebar .brand-title{font-size:21px}.analytics-sidebar .brand{gap:12px}
