/* Панель «Ферзиковская СШ». Тема: data-theme на <html> (ставится до отрисовки, см. base.html). */
:root {
  color-scheme: light;
  --bg: #f3f5f8;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --surface-3: #eef1f5;
  --border: #e3e7ed;
  --hairline: #edf0f4;
  --text: #0f172a;
  --text-2: #475467;
  --muted: #8a94a6;
  --primary: #2a78d6;
  --primary-strong: #1c5cab;
  --primary-soft: #e9f2fd;
  --ring: rgba(42, 120, 214, .28);
  --side-bg: linear-gradient(180deg, #0c1a2c 0%, #10243d 100%);
  --side-text: #a7b4c8;
  --side-strong: #ffffff;
  --side-hover: rgba(255, 255, 255, .06);
  --side-active: rgba(255, 255, 255, .11);
  --good: #0ca30c; --good-soft: #e6f6e6; --good-ink: #006300;
  --warn: #fab219; --warn-soft: #fff4dc; --warn-ink: #855400;
  --serious: #ec835a; --serious-soft: #fdeee7; --serious-ink: #a4441c;
  --critical: #d03b3b; --critical-soft: #fbeaea; --critical-ink: #a32727;
  --neutral: #98a2b3; --neutral-soft: #eef1f5; --neutral-ink: #5b6576;
  --series-1: #2a78d6;
  --grid: #e8ebf0;
  --axis: #cdd3dc;
  --heat-1: #cde2fb; --heat-2: #9ec5f4; --heat-3: #6da7ec; --heat-4: #3987e5; --heat-5: #1c5cab;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-md: 0 6px 16px -4px rgba(16, 24, 40, .12), 0 2px 6px -2px rgba(16, 24, 40, .06);
  --radius: 16px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0c0e12;
  --surface: #15181d;
  --surface-2: #1a1e24;
  --surface-3: #222730;
  --border: #2a3039;
  --hairline: #20252d;
  --text: #f2f4f7;
  --text-2: #c3c9d4;
  --muted: #8a93a3;
  --primary: #3987e5;
  --primary-strong: #6da7ec;
  --primary-soft: rgba(57, 135, 229, .16);
  --ring: rgba(57, 135, 229, .4);
  --side-bg: linear-gradient(180deg, #090b0f 0%, #0d1118 100%);
  --good-soft: rgba(12, 163, 12, .16); --good-ink: #5ad25a;
  --warn-soft: rgba(250, 178, 25, .15); --warn-ink: #fcc75a;
  --serious-soft: rgba(236, 131, 90, .17); --serious-ink: #f3a786;
  --critical-soft: rgba(208, 59, 59, .2); --critical-ink: #f08f8f;
  --neutral-soft: #232831; --neutral-ink: #aab3c2;
  --series-1: #3987e5;
  --grid: #252a33;
  --axis: #3a414c;
  --heat-1: #104281; --heat-2: #1c5cab; --heat-3: #2a78d6; --heat-4: #5598e7; --heat-5: #9ec5f4;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-md: 0 8px 20px -6px rgba(0, 0, 0, .55);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text); font: 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-strong); }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
.icon { flex: none; display: block; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* --- каркас --- */
.app { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--side-bg);
  color: var(--side-text); display: flex; flex-direction: column; padding: 20px 14px;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 22px; color: var(--side-strong); }
.brand-mark {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none;
  background: linear-gradient(135deg, #3987e5, #1c5cab); color: #fff; box-shadow: 0 6px 16px -4px rgba(57, 135, 229, .6);
}
.brand b { display: block; font-size: 14.5px; line-height: 1.2; }
.brand span { font-size: 12px; color: var(--side-text); }
.nav-group { margin: 14px 8px 6px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #6f7f96; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; margin: 2px 0; border-radius: 10px;
  color: var(--side-text); font-weight: 500; transition: background .15s, color .15s;
}
.nav a:hover { background: var(--side-hover); color: var(--side-strong); }
.nav a.active { background: var(--side-active); color: var(--side-strong); }
.nav a.active .icon { color: #86b6ef; }
.nav .count {
  margin-left: auto; min-width: 22px; height: 20px; padding: 0 7px; border-radius: 99px; display: grid; place-items: center;
  background: var(--serious); color: #fff; font-size: 11.5px; font-weight: 700;
}
.side-foot { margin-top: auto; padding: 14px 8px 0; border-top: 1px solid rgba(255, 255, 255, .08); display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: rgba(255, 255, 255, .1); color: #fff; font-weight: 700; font-size: 13px;
}
.side-foot .who { min-width: 0; flex: 1; line-height: 1.25; }
.side-foot .who b { display: block; color: var(--side-strong); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-foot .who span { font-size: 12px; }
.side-btn { background: none; border: 0; color: var(--side-text); padding: 7px; border-radius: 8px; cursor: pointer; }
.side-btn:hover { background: var(--side-hover); color: #fff; }

.main { padding: 28px 32px 48px; min-width: 0; max-width: 1480px; width: 100%; }
.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.topbar h1 { font-size: 26px; font-weight: 700; }
.topbar .sub { color: var(--muted); margin-top: 2px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.topbar .menu-btn { display: none; }

/* --- карточки и сетки --- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--hairline); }
.card-head h2 { font-size: 15px; font-weight: 650; }
.card-head .sub { color: var(--muted); font-size: 13px; }
.card-body { padding: 20px; }
.card-body.flush { padding: 0; }
.stack { display: grid; gap: 20px; }
.grid { display: grid; gap: 20px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.split { display: grid; gap: 20px; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }

/* --- показатели --- */
.stat { padding: 18px 20px; }
.stat .label { color: var(--text-2); font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.stat .label .icon { color: var(--muted); }
.stat .value { font-size: 28px; font-weight: 700; letter-spacing: -.02em; margin: 6px 0 2px; line-height: 1.15; }
.stat .foot { font-size: 12.5px; color: var(--muted); }
.stat a.value { color: var(--text); display: block; }
.hero { padding: 22px 24px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 20px; align-items: end; }
.hero .value { font-size: 48px; font-weight: 750; letter-spacing: -.03em; line-height: 1; margin: 10px 0 8px; }
.hero .spark { height: 96px; position: relative; }
.delta { font-size: 12.5px; font-weight: 600; }
.delta.up { color: var(--good-ink); }
.delta.down { color: var(--critical-ink); }

/* --- статусы (цвет + точка + подпись, никогда только цвет) --- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 99px;
  font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--neutral-soft); color: var(--neutral-ink);
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--neutral); }
.st-paid, .st-approved { background: var(--good-soft); color: var(--good-ink); }
.st-paid::before, .st-approved::before { background: var(--good); }
.st-awaiting, .st-new { background: var(--warn-soft); color: var(--warn-ink); }
.st-awaiting::before, .st-new::before { background: var(--warn); }
.st-reported { background: var(--serious-soft); color: var(--serious-ink); }
.st-reported::before { background: var(--serious); }
.st-hold { background: var(--primary-soft); color: var(--primary-strong); }
.st-hold::before { background: var(--primary); }
.st-rejected { background: var(--critical-soft); color: var(--critical-ink); }
.st-rejected::before { background: var(--critical); }

/* --- кнопки и поля --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px;
  border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font: 600 13.5px/1 var(--font); cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, box-shadow .15s, transform .05s;
}
.btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--axis); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 4px 12px -4px var(--ring); }
.btn-primary:hover { background: var(--primary-strong); border-color: var(--primary-strong); color: #fff; }
.btn-good { background: var(--good); border-color: var(--good); color: #fff; }
.btn-good:hover { background: #0a8f0a; border-color: #0a8f0a; color: #fff; }
.btn-danger { color: var(--critical-ink); }
.btn-danger:hover { background: var(--critical-soft); border-color: var(--critical); color: var(--critical-ink); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: 9px; }
.btn-icon { width: 38px; padding: 0; }
.btn-sm.btn-icon { width: 32px; }
.btn-ghost { background: transparent; border-color: transparent; }
form.inline { display: inline; }

input, select, textarea {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 0 12px; height: 38px; min-width: 0; transition: border-color .15s, box-shadow .15s;
}
textarea { height: auto; padding: 10px 12px; width: 100%; resize: vertical; line-height: 1.5; }
input[type="file"] { padding: 7px 10px; height: auto; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--ring); }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--primary); padding: 0; }
.search { position: relative; }
.search .icon { position: absolute; left: 11px; top: 10px; color: var(--muted); pointer-events: none; }
.search input { padding-left: 36px; width: 280px; }

.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }
.tabs { display: inline-flex; background: var(--surface-3); padding: 4px; border-radius: 12px; gap: 2px; flex-wrap: wrap; }
.tabs a { padding: 7px 14px; border-radius: 9px; color: var(--text-2); font-weight: 600; font-size: 13px; display: inline-flex; gap: 8px; align-items: center; }
.tabs a:hover { color: var(--text); }
.tabs a.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.tabs .pill { background: var(--surface-3); color: var(--text-2); border-radius: 99px; padding: 0 8px; font-size: 11.5px; line-height: 18px; }
.tabs a.active .pill { background: var(--primary-soft); color: var(--primary-strong); }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.field { display: grid; gap: 6px; align-content: start; }
.field.wide { grid-column: 1 / -1; }
.field > label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field input:not([type="checkbox"]), .field select { width: 100%; }
.field .help { font-size: 12px; color: var(--muted); }
.field .errors, .form-errors { color: var(--critical-ink); font-size: 12.5px; }
.form-errors { background: var(--critical-soft); padding: 10px 14px; border-radius: 10px; margin-bottom: 16px; }
.field.check { grid-auto-flow: column; justify-content: start; align-items: center; gap: 10px; }
.form-foot { display: flex; gap: 10px; justify-content: flex-end; padding-top: 20px; margin-top: 20px; border-top: 1px solid var(--hairline); }
.hint { background: var(--primary-soft); color: var(--text-2); border-radius: 12px; padding: 12px 16px; font-size: 13px; margin-bottom: 18px; display: flex; gap: 10px; }
.hint .icon { color: var(--primary); margin-top: 2px; }

/* --- таблицы --- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); background: var(--surface-2); padding: 10px 16px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table td { padding: 12px 16px; border-bottom: 1px solid var(--hairline); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .1s; }
.table tbody tr:hover { background: var(--surface-2); }
.table .strong { font-weight: 600; color: var(--text); }
.table .sub { color: var(--muted); font-size: 12.5px; }
.table td.actions { justify-content: flex-end; }
.row-link { color: var(--text); font-weight: 600; }
.row-link:hover { color: var(--primary); }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; border-top: 1px solid var(--hairline); color: var(--muted); font-size: 13px; }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty .icon { margin: 0 auto 10px; color: var(--axis); }

/* --- списки «требуют действия» --- */
.list { display: grid; }
.item { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--hairline); }
.item:last-child { border-bottom: 0; }
.item .grow { flex: 1; min-width: 0; }
.item .title { font-weight: 600; }
.item .meta { color: var(--muted); font-size: 12.5px; }
.dot-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--primary-soft); color: var(--primary); }
.dot-ico.serious { background: var(--serious-soft); color: var(--serious-ink); }
.dot-ico.warn { background: var(--warn-soft); color: var(--warn-ink); }

/* --- шкалы загрузки --- */
.meter { height: 8px; background: var(--primary-soft); border-radius: 99px; overflow: hidden; }
.meter > i { display: block; height: 100%; background: var(--series-1); border-radius: 99px; }
.meter-row { display: grid; grid-template-columns: minmax(0, 1fr) 52px; gap: 6px 12px; align-items: center; margin-bottom: 14px; }
.meter-row .name { grid-column: 1 / -1; display: flex; justify-content: space-between; font-size: 13px; font-weight: 500; }
.meter-row .pct { text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; }

/* --- расписание --- */
.sched-wrap { overflow-x: auto; }
.sched { display: grid; grid-template-columns: 60px repeat(var(--cols), minmax(230px, 1fr)); min-width: max-content; }
.sched-head { position: sticky; top: 0; z-index: 3; background: var(--surface); padding: 14px 14px 12px; border-bottom: 1px solid var(--border); border-left: 1px solid var(--hairline); }
.sched-head b { display: block; font-size: 14px; }
.sched-head .meta { color: var(--muted); font-size: 12px; display: flex; justify-content: space-between; gap: 10px; margin: 2px 0 8px; }
.sched-corner { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 3; }
.sched-times { position: relative; }
.sched-times span { position: absolute; right: 10px; transform: translateY(-50%); font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.sched-times span:first-child { transform: none; }
.sched-col {
  position: relative; border-left: 1px solid var(--hairline); cursor: default;
  background-color: var(--surface-3);
  background-image: repeating-linear-gradient(135deg, transparent 0 7px, rgba(127, 127, 127, .06) 7px 8px);
}
.sched-col.can-add { cursor: copy; }
.sched-open { position: absolute; left: 0; right: 0; background: var(--surface); }
.sched-col::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(to bottom, var(--border) 1px, transparent 1px); background-size: 100% var(--hour); opacity: .7; }
.blk {
  position: absolute; left: 6px; right: 6px; border-radius: 10px; padding: 6px 10px; overflow: hidden;
  font-size: 12.5px; line-height: 1.35; color: var(--text); background: var(--neutral-soft);
  border-left: 3px solid var(--neutral); box-shadow: var(--shadow-sm); transition: transform .12s, box-shadow .12s; z-index: 1;
}
a.blk:hover, .blk:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); z-index: 2; color: var(--text); }
.blk .t { font-weight: 700; font-variant-numeric: tabular-nums; display: flex; justify-content: space-between; gap: 6px; }
.blk .n { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.blk .s { color: var(--text-2); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.blk.st-paid { background: var(--good-soft); border-color: var(--good); }
.blk.st-awaiting { background: var(--warn-soft); border-color: var(--warn); }
.blk.st-reported { background: var(--serious-soft); border-color: var(--serious); }
.blk.st-hold { background: var(--primary-soft); border-color: var(--primary); border-style: dashed; opacity: .85; }
.blk.st-paid::before, .blk.st-awaiting::before, .blk.st-reported::before, .blk.st-hold::before { display: none; }
.blk-group { background: var(--primary-soft); border-color: var(--primary); }
.blk-group .meter { height: 5px; margin-top: 5px; background: rgba(42, 120, 214, .15); }
.blk-group .names { margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.blk-group .names a { color: var(--text-2); font-size: 11.5px; margin-right: 8px; white-space: nowrap; }
.blk-group .t a { color: var(--text); }
.blk-group .t a:hover { color: var(--primary); }
.blk-group .names a:hover { color: var(--primary); }
.blk-closed {
  background: repeating-linear-gradient(135deg, var(--surface-2) 0 6px, var(--surface-3) 6px 12px);
  border-left-color: var(--critical); color: var(--text-2);
}
.blk-closed form { position: absolute; right: 6px; top: 5px; }
.now-line { position: absolute; left: 0; right: 0; height: 2px; background: var(--critical); z-index: 4; pointer-events: none; }
.now-line::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--critical); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; color: var(--text-2); font-size: 12.5px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.date-nav { display: flex; align-items: center; gap: 6px; }
.date-nav input { width: 150px; }

.names a::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 4px; vertical-align: 1px; background: var(--neutral); }
.names a.d-paid::before { background: var(--good); }
.names a.d-awaiting::before { background: var(--warn); }
.names a.d-reported::before { background: var(--serious); }
.names a.d-hold::before { background: var(--primary); }

/* --- календарь --- */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-wd { padding: 10px 14px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--border); }
.cal-day {
  min-height: 116px; padding: 10px 12px 12px; border-right: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline);
  display: flex; flex-direction: column; gap: 4px; color: var(--text); transition: background .12s;
}
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day:hover { background: var(--surface-2); color: var(--text); }
.cal-day.out { background: var(--surface-2); color: var(--muted); }
.cal-day.out .cal-n { opacity: .6; }
.cal-date { display: flex; justify-content: space-between; align-items: center; font-weight: 650; font-variant-numeric: tabular-nums; }
.cal-day.today .cal-date b { background: var(--primary); color: #fff; border-radius: 99px; padding: 1px 8px; }
.cal-flags { display: flex; gap: 4px; color: var(--muted); }
.cal-flags .p { width: 8px; height: 8px; border-radius: 50%; background: var(--serious); margin-top: 4px; }
.cal-n { font-size: 13px; font-weight: 600; margin-top: auto; }
.cal-sum { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cal-day .meter { height: 5px; margin-top: 6px; }
.cal-short { display: none; }

/* --- аналитика --- */
.chart-box { position: relative; height: 280px; }
.chart-box.sm { height: 220px; }
.heat { display: grid; grid-template-columns: 34px repeat(var(--cols), minmax(18px, 1fr)); gap: 3px; }
.heat .hl { font-size: 11px; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
.heat .dl { font-size: 12px; color: var(--text-2); display: flex; align-items: center; }
.heat .c { height: 26px; border-radius: 4px; background: var(--surface-3); transition: outline-color .1s; outline: 2px solid transparent; }
.heat .c:hover { outline-color: var(--text); }
.heat .l1 { background: var(--heat-1); } .heat .l2 { background: var(--heat-2); } .heat .l3 { background: var(--heat-3); }
.heat .l4 { background: var(--heat-4); } .heat .l5 { background: var(--heat-5); }
.scale { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.scale i { width: 18px; height: 10px; border-radius: 3px; display: inline-block; }
.funnel-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; margin-bottom: 16px; }
.funnel-row .bar { grid-column: 1 / -1; height: 12px; background: var(--surface-3); border-radius: 0 4px 4px 0; }
.funnel-row .bar i { display: block; height: 100%; background: var(--series-1); border-radius: 0 4px 4px 0; }
.funnel-row b { font-variant-numeric: tabular-nums; }
details.table-view { border-top: 1px solid var(--hairline); }
details.table-view summary { cursor: pointer; padding: 12px 20px; color: var(--text-2); font-size: 13px; font-weight: 600; list-style: none; }
details.table-view summary::before { content: "▸ "; }
details.table-view[open] summary::before { content: "▾ "; }
details.table-view .table-wrap { max-height: 320px; overflow: auto; }
.period { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.period form { display: flex; gap: 8px; align-items: center; }

/* --- всплывающие подсказки и уведомления --- */
.tip {
  position: fixed; z-index: 50; pointer-events: none; background: var(--text); color: var(--surface);
  padding: 7px 10px; border-radius: 8px; font-size: 12.5px; box-shadow: var(--shadow-md); max-width: 260px; display: none;
}
.toasts { position: fixed; top: 18px; right: 18px; z-index: 60; display: grid; gap: 10px; width: min(380px, calc(100vw - 36px)); }
.toast {
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--primary); border-radius: 12px;
  padding: 12px 16px; box-shadow: var(--shadow-md); font-size: 13.5px; animation: slide .25s ease-out; transition: opacity .3s, transform .3s;
}
.toast.success { border-left-color: var(--good); }
.toast.warning { border-left-color: var(--warn); }
.toast.error { border-left-color: var(--critical); }
.toast.hide { opacity: 0; transform: translateX(16px); }
@keyframes slide { from { opacity: 0; transform: translateX(16px); } }

/* --- вход --- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(1200px 600px at 10% -10%, rgba(57, 135, 229, .25), transparent), var(--side-bg); }
.login .card { width: min(400px, 100%); padding: 32px; }
.login .brand { color: var(--text); padding: 0 0 24px; }
.login .brand span { color: var(--muted); }
.login .field { margin-bottom: 14px; }
.login .btn { width: 100%; height: 42px; margin-top: 6px; }

/* --- адаптив --- */
@media (max-width: 1200px) {
  .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 960px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; z-index: 40; left: 0; width: 264px; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; box-shadow: var(--shadow-md); }
  .topbar .menu-btn { display: inline-flex; }
  .main { padding: 18px 16px 40px; }
  .cols-2, .cols-3, .form-grid, .hero { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
  .search input { width: 100%; }
  .cal-day { min-height: 84px; padding: 6px; }
  .cal-sum, .cal-day .meter, .cal-n { display: none; }
  .cal-n.cal-short { display: block; }
  .topbar h1 { font-size: 22px; }
}
@media (max-width: 560px) {
  .cols-4 { grid-template-columns: minmax(0, 1fr); }
  .hero .value { font-size: 40px; }
}
@media print {
  .side, .actions, .filters, .menu-btn { display: none !important; }
  .app { display: block; }
}

/* --- детали, шаги, разное --- */
.narrow { max-width: 880px; }
.hero .label { color: var(--text-2); font-weight: 500; }
.theme-dark-ico { display: none; }
:root[data-theme="dark"] .theme-dark-ico { display: block; }
:root[data-theme="dark"] .theme-light-ico { display: none; }
.dl { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 12px 16px; margin: 0; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; font-weight: 500; }
.steps { display: flex; gap: 0; margin: 4px 0 2px; }
.steps div { flex: 1; position: relative; padding-top: 22px; font-size: 12.5px; color: var(--muted); text-align: center; }
.steps div::before { content: ""; position: absolute; top: 4px; left: calc(50% - 7px); width: 14px; height: 14px; border-radius: 50%; background: var(--surface-3); border: 2px solid var(--border); z-index: 1; }
.steps div::after { content: ""; position: absolute; top: 10px; left: -50%; width: 100%; height: 2px; background: var(--border); }
.steps div:first-child::after { display: none; }
.steps div.on { color: var(--text); font-weight: 600; }
.steps div.on::before { background: var(--good); border-color: var(--good); }
.steps div.on::after { background: var(--good); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: var(--surface-3); color: var(--text-2); border-radius: 8px; padding: 3px 9px; font-size: 12px; font-variant-numeric: tabular-nums; }
.price-form { display: inline-flex; gap: 6px; align-items: center; }
.price-form input { width: 96px; height: 32px; text-align: right; font-variant-numeric: tabular-nums; }
.req { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; padding: 18px 20px; border-bottom: 1px solid var(--hairline); }
.req:last-child { border-bottom: 0; }
.req .title { font-weight: 650; font-size: 15px; }
.req .meta { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--text-2); font-size: 13px; margin-top: 6px; }
.req .meta span { display: inline-flex; gap: 6px; align-items: center; }
.req .comment { margin-top: 8px; color: var(--text-2); background: var(--surface-2); border-radius: 10px; padding: 8px 12px; font-size: 13px; }
.qr-preview { width: 140px; height: 140px; object-fit: contain; border: 1px solid var(--border); border-radius: 12px; background: #fff; padding: 6px; }
.section-title { font-size: 13px; font-weight: 650; color: var(--text-2); text-transform: uppercase; letter-spacing: .06em; margin: 8px 0 14px; }
.receipt-preview { display: block; max-width: 100%; max-height: 520px; border-radius: 12px; border: 1px solid var(--border); background: #fff; }
.thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 10px; flex: none; border: 1px solid var(--border); }
