/* Фирменный шрифт Oñpai (из брендбука) — для заголовков. */
@font-face { font-family: "Roboto Slab"; src: url("../fonts/RobotoSlab-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Roboto Slab"; src: url("../fonts/RobotoSlab-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

/* Balapan by KAZLAB — дизайн-система.
   Цвет бренда сада (--accent) переопределяется в /brand.css из настроек. */
:root {
  --navy: #28428c;
  --navy-2: #324f9e;
  --navy-ink: #d6def2;
  --onpai-orange: #ff7900;
  --onpai-pink: #ffacd6;
  --onpai-teal: #70c3cb;
  --serif: "Roboto Slab", Georgia, serif;
  --accent: #017bbe;
  --accent-strong: #016094;
  --accent-soft: #e1eff7;
  --accent-rgb: 1, 123, 190;
  --gold: #b8954f;

  --bg: #f3f5f8;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --ink: #102035;
  --ink-2: #33445a;
  --muted: #5e6e82;
  --line: #e2e7ee;
  --line-strong: #cfd7e2;

  --green: #15803d;
  --green-soft: #e7f6ec;
  --amber: #b45309;
  --amber-soft: #fdf3e2;
  --red: #b42318;
  --red-soft: #fdecea;
  --blue: #1d5fbf;
  --blue-soft: #e8f0fc;
  --violet: #6b4fa0;
  --violet-soft: #f0ebf8;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 32, 53, 0.05), 0 4px 16px rgba(16, 32, 53, 0.05);
  --shadow-lg: 0 12px 40px rgba(16, 32, 53, 0.14);
  --sidebar: 264px;
  --font: Manrope, "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--ink); background: var(--bg);
  font-family: var(--font); font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -0.01em; font-weight: 700; font-family: var(--serif); }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.08rem; }
h3 { font-size: 0.98rem; }
p { margin: 0 0 0.6em; }
a { color: var(--accent-strong); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
code { font-family: var(--mono); font-size: 0.85em; background: var(--surface-2); border: 1px solid var(--line); padding: 0.08em 0.4em; border-radius: 6px; word-break: break-all; }
small { font-size: 0.8rem; }
:focus-visible { outline: 3px solid rgba(var(--accent-rgb), 0.35); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.icon-sm { width: 15px; height: 15px; }
.icon-lg { width: 22px; height: 22px; }

/* ——— Кнопки и поля ——— */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 38px; padding: 0 14px; border-radius: 10px; border: 1px solid transparent;
  background: transparent; cursor: pointer; text-decoration: none; font-weight: 650; font-size: 0.92rem;
  white-space: nowrap; transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 1px 2px rgba(var(--accent-rgb), 0.3); }
.btn-primary:hover { background: var(--accent-strong); color: #fff; }
.btn-ghost { background: var(--surface); border-color: var(--line-strong); color: var(--ink-2); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-strong); }
.btn-soft { background: var(--accent-soft); color: var(--accent-strong); }
.btn-soft:hover { background: rgba(var(--accent-rgb), 0.18); color: var(--accent-strong); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #8f1c13; color: #fff; }
.btn-danger-ghost { background: var(--surface); border-color: #f1c4bf; color: var(--red); }
.btn-small { min-height: 30px; padding: 0 10px; font-size: 0.84rem; border-radius: 8px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.link-btn { border: 0; background: none; padding: 0; color: var(--accent-strong); cursor: pointer; font-weight: 600; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; border: 0; background: transparent; color: inherit; cursor: pointer; }
.icon-btn:hover { background: rgba(255, 255, 255, 0.1); }

.control {
  width: 100%; min-height: 40px; border: 1px solid var(--line-strong); background: var(--surface);
  border-radius: 10px; padding: 8px 11px; outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
textarea.control { min-height: 70px; resize: vertical; }
.control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.16); }
.control[readonly] { background: var(--surface-2); color: var(--muted); }
.control-sm { min-height: 32px; padding: 4px 8px; font-size: 0.88rem; }
.control-num { width: 120px; text-align: right; font-variant-numeric: tabular-nums; }
input[type="color"].control { padding: 3px; width: 64px; }
.field { display: flex; flex-direction: column; gap: 5px; font-size: 0.9rem; min-width: 0; }
.field > span { color: var(--ink-2); font-weight: 650; font-size: 0.84rem; }
.field .hint { color: var(--muted); font-size: 0.78rem; font-weight: 500; }
.field-error { color: var(--red); font-size: 0.8rem; }
.has-error .control { border-color: var(--red); }
.field-wide { grid-column: 1 / -1; }
.align-end { align-self: end; }
.check { display: inline-flex; gap: 8px; align-items: center; font-weight: 600; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--accent); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.form-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; grid-column: 1 / -1; padding-top: 4px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-sm { display: flex; flex-direction: column; gap: 6px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.narrow { max-width: 520px; }
.hp { position: absolute; left: -9999px; }
.is-hidden { display: none !important; }

/* ——— Карточки и блоки ——— */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.content > .card + .card, .content > .card + .grid-2, .content > .card + .grid-main, .content > .grid-2 + .card, .content > .grid-main + .card, .content > .card + .bill-list { margin-top: 16px; }
.card-flush { padding: 0; overflow: hidden; }
.card-head { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 12px; }
.card-head p { margin: 2px 0 0; }
.card-foot { border-top: 1px solid var(--line); padding: 12px 18px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: space-between; background: var(--surface-2); }
.section { margin-bottom: 16px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 22px 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 0.84rem; }
.strong { font-weight: 750; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.right { text-align: right; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.mt { margin-top: 16px; }
.mb { margin-bottom: 16px; }

.notice { display: flex; gap: 10px; align-items: flex-start; border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; background: var(--blue-soft); color: #173d73; border: 1px solid #cfdcf3; }
.notice .icon { margin-top: 2px; }
.notice > div { flex: 1; }
.notice p:last-child { margin-bottom: 0; }
.notice-warn { background: var(--amber-soft); color: #7a3d06; border-color: #f2dcb5; }
.notice-danger { background: var(--red-soft); color: #7d1a12; border-color: #f4c9c4; }
.notice-ok { background: var(--green-soft); color: #105c2c; border-color: #c6e8d1; }
.flash-stack { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.flash { display: flex; gap: 10px; align-items: center; border-radius: 12px; padding: 11px 14px; background: var(--green-soft); color: #105c2c; border: 1px solid #c6e8d1; font-weight: 600; }
.flash-err { background: var(--red-soft); color: #7d1a12; border-color: #f4c9c4; }
.flash code { background: #fff; }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.empty .icon { width: 36px; height: 36px; color: var(--line-strong); margin-bottom: 8px; }
.empty h2 { color: var(--ink); margin-bottom: 6px; }
.back { display: inline-flex; gap: 6px; align-items: center; margin-bottom: 12px; text-decoration: none; font-weight: 600; }

/* ——— Метрики ——— */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); display: flex; gap: 12px; align-items: flex-start; text-decoration: none; color: inherit; }
.stat-icon, .stat .stat-icon { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-strong); flex: none; }
.stat span { display: block; color: var(--muted); font-size: 0.82rem; font-weight: 600; }
.stat strong { display: block; font-size: 1.55rem; line-height: 1.2; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat small { display: block; color: var(--muted); }
.stat.is-alert .stat-icon { background: var(--red-soft); color: var(--red); }
.stat.is-alert strong { color: var(--red); }
.stat.is-warn .stat-icon { background: var(--amber-soft); color: var(--amber); }
.stat.is-ok .stat-icon { background: var(--green-soft); color: var(--green); }

/* ——— Бейджи, полосы ——— */
.badge { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 2px 9px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); font-size: 0.76rem; font-weight: 700; text-decoration: none; white-space: nowrap; line-height: 1.5; }
.badge-green { background: var(--green-soft); border-color: #c6e8d1; color: var(--green); }
.badge-amber { background: var(--amber-soft); border-color: #f2dcb5; color: var(--amber); }
.badge-red { background: var(--red-soft); border-color: #f4c9c4; color: var(--red); }
.badge-blue { background: var(--blue-soft); border-color: #cfdcf3; color: var(--blue); }
.badge-violet { background: var(--violet-soft); border-color: #ddd2ef; color: var(--violet); }
.badge-accent { background: var(--accent-soft); border-color: rgba(var(--accent-rgb), 0.25); color: var(--accent-strong); }
.badge-muted { color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: currentColor; }
.meter { height: 8px; background: #edf1f5; border-radius: 99px; overflow: hidden; position: relative; }
.meter > span { display: block; height: 100%; width: 0; background: var(--green); border-radius: 99px; transition: width 0.4s ease; }
.meter.amber > span { background: #d98a1c; }
.meter.red > span { background: var(--red); }
.meter.muted > span { background: var(--line-strong); }
.meter.ghost > span { background: repeating-linear-gradient(45deg, rgba(var(--accent-rgb), 0.55) 0 6px, rgba(var(--accent-rgb), 0.3) 6px 12px); }
.meter-stack { position: relative; }
.meter-stack .meter + .meter { margin-top: 6px; }
.money-bad { color: var(--red); font-weight: 750; }
.money-ok { color: var(--green); font-weight: 700; }

/* ——— Таблицы ——— */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.9rem; }
.table th { text-align: left; font-size: 0.72rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); font-weight: 700; background: var(--surface-2); position: sticky; top: 0; z-index: 1; white-space: nowrap; }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:hover td { background: #fafcfe; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tfoot td { background: var(--surface-2); font-weight: 750; border-top: 1px solid var(--line-strong); border-bottom: 0; }
.table td small, .table td .sub { display: block; color: var(--muted); font-size: 0.78rem; }
.table .num, .table .right { text-align: right; }
.table .cell-check { width: 36px; }
.table .cell-check input { width: 17px; height: 17px; accent-color: var(--accent); }
.table tr.is-zero td { background: #f4fbf6; }
.table tr.is-locked td { background: #fbfcfd; }
.table-compact th, .table-compact td { padding: 7px 10px; }

.person { display: flex; gap: 10px; align-items: center; text-decoration: none; color: inherit; min-width: 0; }
.person strong { display: block; color: var(--ink); }
.person small { display: block; color: var(--muted); }
a.person:hover strong { color: var(--accent-strong); }
.avatar { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-weight: 750; font-size: 0.85rem; flex: none; background: var(--navy-2); }
.avatar-lg { width: 60px; height: 60px; border-radius: 16px; font-size: 1.2rem; }
.tone-0 { background: #138a9e; } .tone-1 { background: #c2702a; } .tone-2 { background: #1d5fbf; } .tone-3 { background: #6b4fa0; }
.tone-4 { background: #15803d; } .tone-5 { background: #a83a63; } .tone-6 { background: #0f2a4a; } .tone-7 { background: #8a6d2f; }

/* ——— Панель инструментов и фильтры ——— */
.toolbar { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar-group { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.filters .control { width: auto; min-width: 140px; }
.filters input[type="search"].control { min-width: 220px; }
.segmented { display: inline-flex; background: #e9edf2; border-radius: 11px; padding: 3px; gap: 2px; }
.segmented a, .segmented button { border: 0; background: transparent; padding: 6px 14px; border-radius: 8px; text-decoration: none; color: var(--ink-2); font-weight: 650; cursor: pointer; font-size: 0.9rem; display: inline-flex; gap: 6px; align-items: center; }
.segmented .is-active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(16, 32, 53, 0.12); }
.tabs-line { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs-line a { padding: 10px 14px; text-decoration: none; color: var(--muted); font-weight: 650; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs-line a.is-active { color: var(--accent-strong); border-bottom-color: var(--accent); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 0.84rem; align-items: center; }
.legend span { display: inline-flex; gap: 6px; align-items: center; }

/* ——— Оболочка приложения ——— */
.app { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar); background: var(--navy); color: var(--navy-ink);
  display: flex; flex-direction: column; z-index: 30;
}
.side-brand { display: flex; gap: 11px; align-items: center; padding: 18px 18px 14px; text-decoration: none; color: #fff; }
.side-brand img { width: 40px; height: 40px; object-fit: contain; border-radius: 10px; background: #fff; padding: 3px; flex: none; }
.brand-mark { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: linear-gradient(135deg, var(--accent), #1f6fb2); color: #fff; flex: none; }
.brand-mark svg { width: 24px; height: 24px; }
.side-brand strong { display: block; font-size: 1.02rem; line-height: 1.2; }
.side-brand small { display: block; color: #8fa6c2; font-size: 0.76rem; }
.side-nav { flex: 1; overflow-y: auto; padding: 4px 10px 12px; scrollbar-width: thin; scrollbar-color: #2a4a72 transparent; }
.nav-section { margin: 16px 10px 6px; color: #7690b0; font-size: 0.68rem; letter-spacing: 0.09em; text-transform: uppercase; font-weight: 700; }
.nav-link { display: flex; gap: 11px; align-items: center; text-decoration: none; color: var(--navy-ink); border-radius: 9px; padding: 8px 10px; font-weight: 600; font-size: 0.9rem; position: relative; }
.nav-link:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.nav-link.is-active { background: rgba(var(--accent-rgb), 0.22); color: #fff; }
.nav-link.is-active::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--accent); }
.nav-link .icon { opacity: 0.85; }
.nav-link em { margin-left: auto; font-style: normal; font-size: 0.66rem; color: #e7c98d; border: 1px solid rgba(231, 201, 141, 0.4); border-radius: 999px; padding: 0 6px; }
.nav-link .count { margin-left: auto; background: var(--accent); color: #fff; border-radius: 999px; font-size: 0.7rem; padding: 0 7px; font-weight: 750; }
.side-foot { border-top: 1px solid rgba(255, 255, 255, 0.08); padding: 12px 14px; display: flex; gap: 10px; align-items: center; }
.side-foot .who { flex: 1; min-width: 0; }
.side-foot strong, .side-foot small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-foot strong { color: #fff; font-size: 0.88rem; }
.side-foot small { color: #8fa6c2; font-size: 0.75rem; }
.side-foot form { margin: 0; }
.side-foot .icon-btn { color: #8fa6c2; }
.side-foot .icon-btn:hover { color: #fff; }
.side-credit { display: flex; gap: 8px; align-items: center; padding: 0 18px 14px; color: #6f88a8; font-size: 0.7rem; text-decoration: none; }
.side-credit img { width: 22px; height: 22px; border-radius: 6px; background: #fff; object-fit: cover; }

.main { margin-left: var(--sidebar); min-height: 100vh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(243, 245, 248, 0.9); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); padding: 14px 28px; display: flex; gap: 14px; align-items: center; }
.topbar .eyebrow { margin: 0 0 2px; color: var(--muted); font-size: 0.78rem; font-weight: 650; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.topbar h1 { font-size: 1.35rem; }
.topbar-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.menu-btn { display: none; }
.content { padding: 22px 28px 48px; width: 100%; max-width: 1280px; }
.app-foot { margin-top: auto; padding: 14px 28px 22px; color: var(--muted); font-size: 0.78rem; display: flex; gap: 8px; align-items: center; }
.app-foot img { width: 20px; height: 20px; border-radius: 5px; object-fit: cover; }
.app-foot a { color: inherit; }
.scrim { display: none; }
.bottom-nav { display: none; }
.lang-form { display: flex; gap: 4px; }
.lang-form button { border: 1px solid rgba(255, 255, 255, 0.16); background: transparent; color: #8fa6c2; border-radius: 6px; font-size: 0.7rem; padding: 1px 6px; cursor: pointer; font-weight: 700; }
.lang-form button.is-active { color: #fff; border-color: var(--accent); }

/* ——— Посещаемость ——— */
.att-head { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.att-progress { display: flex; gap: 10px; align-items: center; font-weight: 650; }
.att-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; }
.att-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow); transition: border-color 0.15s; }
.att-card:has(input[value="sick"]:checked) { border-color: #f2dcb5; }
.att-card:has(input[value="absent"]:checked) { border-color: #f4c9c4; }
.att-card.is-locked { opacity: 0.65; }
.att-person { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.att-person .badge { margin-top: 3px; }
.seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; }
.seg span { display: grid; place-items: center; min-height: 40px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line); font-weight: 650; font-size: 0.86rem; cursor: pointer; user-select: none; }
.seg input:focus-visible + span { outline: 3px solid rgba(var(--accent-rgb), 0.35); }
.seg-present input:checked + span { background: var(--green); border-color: var(--green); color: #fff; }
.seg-sick input:checked + span { background: #d98a1c; border-color: #d98a1c; color: #fff; }
.seg-vacation input:checked + span { background: var(--blue); border-color: var(--blue); color: #fff; }
.seg-absent input:checked + span { background: var(--red); border-color: var(--red); color: #fff; }
.att-extra { display: grid; grid-template-columns: 130px 1fr; gap: 6px; margin-top: 8px; }
.att-card:has(input[value="present"]:checked) .att-extra { display: none; }
.att-bar { position: sticky; bottom: 14px; display: flex; justify-content: flex-end; margin-top: 14px; }
.att-bar .btn { box-shadow: var(--shadow-lg); }

/* ——— Табель ——— */
.timesheet { font-size: 0.82rem; }
.timesheet th, .timesheet td { text-align: center; padding: 6px 5px; }
.timesheet td:first-child, .timesheet th:first-child { text-align: left; position: sticky; left: 0; background: var(--surface); z-index: 2; min-width: 190px; }
.timesheet th:first-child { background: var(--surface-2); z-index: 3; }
.timesheet th small { display: block; font-weight: 600; text-transform: none; letter-spacing: 0; }
.timesheet .is-off { background: #f6f8fa; }
.mark { font-weight: 750; }
.mark-present { color: var(--green); }
.mark-sick { color: #b8690c; }
.mark-vacation { color: var(--blue); }
.mark-absent { color: var(--red); }

/* ——— Оплаты ——— */
.bill-list { display: flex; flex-direction: column; gap: 10px; }
.bill { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--line-strong); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; align-items: start; }
.bill.state-debt { border-left-color: var(--red); }
.bill.state-wait, .bill.state-partial { border-left-color: var(--red); }
.bill.state-wait .bill-sum strong, .bill.state-partial .bill-sum strong { color: var(--red); }
.bill.state-free { border-left-color: var(--line-strong); }
.bill-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.bulk-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; }
.bulk-bar .field { min-width: 200px; }
.bulk-bar .hint { flex-basis: 100%; margin: 0; color: var(--muted); font-size: 0.8rem; }
form.bulk-bar.card { align-items: center; margin-bottom: 12px; }
.bulk-sticky { position: sticky; top: 8px; z-index: 5; }
form.bulk-bar.card > .control { width: auto; flex: 0 1 auto; }
.bill.state-paid { border-left-color: var(--green); }
.bill-sum { text-align: right; }
.bill-sum strong { display: block; font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.bill .formula { grid-column: 1 / -1; color: var(--muted); font-size: 0.85rem; margin: 0; }
.bill .row-actions { grid-column: 1 / -1; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.pay-form { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.pay-form .control { width: auto; min-height: 34px; padding: 4px 8px; }
.pay-form .control-num { width: 110px; }
.payments { list-style: none; margin: 0; padding: 0; grid-column: 1 / -1; display: flex; gap: 6px; flex-wrap: wrap; }

/* ——— Списки ——— */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; gap: 12px; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.list > li:last-child { border-bottom: 0; }
.list small { display: block; color: var(--muted); }
.list-actions { display: flex; gap: 6px; align-items: center; flex: none; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; }
.kv dt { color: var(--muted); font-size: 0.86rem; }
.kv dd { margin: 0; font-weight: 600; }

/* ——— Профиль ребёнка ——— */
.profile-head { display: flex; gap: 14px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.profile-head h2 { font-size: 1.35rem; }
.profile-head .row { margin-top: 4px; }
.guardian-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; margin-bottom: 14px; }
.guardian { display: flex; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.guardian img { width: 48px; height: 48px; object-fit: cover; border-radius: 10px; }
.guardian > div { flex: 1; min-width: 0; }
.guardian small { display: block; color: var(--muted); }
details.disclosure { border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
details.disclosure > summary { cursor: pointer; padding: 10px 14px; font-weight: 650; list-style: none; display: flex; gap: 8px; align-items: center; }
details.disclosure > summary::-webkit-details-marker { display: none; }
details.disclosure > summary::before { content: "+"; width: 18px; height: 18px; display: grid; place-items: center; border-radius: 5px; background: var(--accent-soft); color: var(--accent-strong); font-weight: 800; }
details.disclosure[open] > summary::before { content: "–"; }
details.disclosure > .disclosure-body { padding: 4px 14px 14px; }

/* ——— Смены, задачи, меню, фото ——— */
.schedule td { vertical-align: top; min-width: 110px; }
.schedule th small { display: block; text-transform: none; letter-spacing: 0; }
.schedule .is-today { background: var(--accent-soft); }
.shift { display: flex; gap: 4px; align-items: center; justify-content: space-between; background: var(--accent-soft); color: var(--accent-strong); border-radius: 8px; padding: 3px 4px 3px 8px; margin: 2px 0; font-size: 0.8rem; font-weight: 650; }
.shift form { margin: 0; }
.shift button { border: 0; background: transparent; cursor: pointer; color: inherit; opacity: 0.6; width: 20px; height: 20px; border-radius: 5px; }
.shift button:hover { opacity: 1; background: rgba(255, 255, 255, 0.6); }
.task-list { display: flex; flex-direction: column; gap: 8px; }
.task { display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.task.is-done { opacity: 0.6; }
.task.is-done h3 { text-decoration: line-through; }
.task > div { flex: 1; }
.task.is-overdue { border-left: 3px solid var(--red); }
.menu-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.menu-day.is-today { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.12); }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.photo-card { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.photo-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: var(--surface-2); }
.photo-card figcaption { padding: 10px 12px 12px; font-size: 0.86rem; }
.photo-card figcaption strong { display: block; }

/* ——— Заявки ——— */
.kanban { display: grid; grid-template-columns: repeat(4, minmax(230px, 1fr)); gap: 12px; overflow-x: auto; align-items: start; }
.kanban-col { background: #e9edf2; border-radius: var(--radius); padding: 10px; min-height: 260px; }
.kanban-col.is-over { outline: 2px dashed var(--accent); outline-offset: -4px; }
.kanban-col h2 { font-size: 0.86rem; display: flex; justify-content: space-between; align-items: center; margin: 2px 4px 10px; color: var(--ink-2); }
.kanban-col h2 span { background: var(--surface); border-radius: 999px; padding: 0 8px; font-size: 0.76rem; }
.kanban-list { display: flex; flex-direction: column; gap: 8px; min-height: 40px; }
.lead-card { background: var(--surface); border: 1px solid var(--line); border-radius: 11px; padding: 11px; box-shadow: var(--shadow); cursor: grab; }
.lead-card.is-converted { opacity: 0.75; cursor: default; }
.lead-card p { margin: 3px 0; font-size: 0.86rem; }
.lead-card .row { gap: 6px; margin-top: 6px; }
.lead-card form { margin-top: 8px; display: grid; gap: 6px; }
.lead-card .control { min-height: 32px; padding: 4px 8px; font-size: 0.84rem; }

/* ——— Сообщения ——— */
.inbox { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 0; min-height: 560px; }
.inbox-list { border-right: 1px solid var(--line); overflow-y: auto; max-height: 72vh; }
.inbox-item { display: flex; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.inbox-item:hover { background: var(--surface-2); }
.inbox-item.is-active { background: var(--accent-soft); }
.inbox-item > div { flex: 1; min-width: 0; }
.inbox-item strong { display: flex; justify-content: space-between; gap: 6px; }
.inbox-item p { margin: 2px 0 0; color: var(--muted); font-size: 0.84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.channel-ico { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; color: #fff; flex: none; font-weight: 800; font-size: 0.75rem; }
.channel-whatsapp { background: #1fa855; }
.channel-instagram { background: linear-gradient(135deg, #f58529, #dd2a7b 55%, #8134af); }
.channel-site { background: var(--navy-2); }
.channel-bot { background: var(--violet); }
.thread { display: flex; flex-direction: column; min-width: 0; }
.thread-head { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.thread-body { flex: 1; padding: 18px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; max-height: 52vh; background: var(--surface-2); }
.bubble { max-width: 76%; padding: 9px 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); align-self: flex-start; }
.bubble.out { align-self: flex-end; background: var(--accent-soft); border-color: rgba(var(--accent-rgb), 0.25); }
.bubble small { display: block; color: var(--muted); font-size: 0.72rem; margin-top: 3px; }
.thread-foot { padding: 12px 18px; border-top: 1px solid var(--line); }
.label-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; font-size: 0.8rem; cursor: pointer; }
.label-chip input { accent-color: var(--accent); }

/* ——— Заполняемость ——— */
.occ-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.occ-card h3 { font-size: 1.05rem; }
.occ-num { font-size: 1.9rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.occ-split { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 12px; }
.occ-split div { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 7px 9px; }
.occ-split span { display: block; font-size: 0.72rem; color: var(--muted); font-weight: 650; }
.occ-split strong { font-size: 1.05rem; }
.occ-forecast { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line-strong); }

/* ——— Страницы входа и публичные ——— */
.auth-body { min-height: 100vh; background: radial-gradient(1200px 600px at 100% -10%, rgba(var(--accent-rgb), 0.16), transparent 60%), radial-gradient(900px 500px at -10% 110%, rgba(15, 42, 74, 0.14), transparent 60%), var(--bg); }
.auth-layout { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(380px, 0.9fr); }
.auth-story { padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between; background: var(--navy); color: var(--navy-ink); position: relative; overflow: hidden; }
.auth-story::after { content: ""; position: absolute; right: -180px; bottom: -180px; width: 460px; height: 460px; border-radius: 50%; border: 60px solid rgba(var(--accent-rgb), 0.18); }
.auth-story h1 { color: #fff; font-size: clamp(2rem, 3.4vw, 2.9rem); line-height: 1.12; margin: 18px 0 14px; max-width: 34rem; }
.auth-story p { max-width: 32rem; font-size: 1.02rem; }
.auth-points { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 10px; max-width: 30rem; }
.auth-points li { display: flex; gap: 10px; align-items: flex-start; }
.auth-points .icon { color: #5fd0dd; margin-top: 2px; }
.brand-line { display: flex; gap: 12px; align-items: center; color: #fff; text-decoration: none; position: relative; z-index: 1; }
.brand-line strong { font-size: 1.2rem; }
.kazlab-credit { display: flex; gap: 10px; align-items: center; color: #8fa6c2; font-size: 0.82rem; position: relative; z-index: 1; text-decoration: none; }
.kazlab-credit img { width: 42px; height: 42px; border-radius: 10px; background: #fff; object-fit: cover; }
.kazlab-credit strong { color: #fff; display: block; letter-spacing: 0.04em; }
.auth-panel { display: grid; place-items: center; padding: 32px 24px; }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 28px; box-shadow: var(--shadow-lg); }
.auth-card h2 { font-size: 1.35rem; margin-bottom: 4px; }
.tabs { display: flex; gap: 4px; background: #e9edf2; padding: 4px; border-radius: 11px; margin: 16px 0; }
.tabs button { flex: 1; border: 0; background: transparent; border-radius: 8px; padding: 8px; cursor: pointer; font-weight: 650; color: var(--ink-2); }
.tabs button.is-active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(16, 32, 53, 0.12); }
.demo-box { margin-top: 20px; padding-top: 16px; border-top: 1px dashed var(--line-strong); }
.demo-box p { color: var(--muted); font-size: 0.82rem; }
.demo-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.demo-grid form { margin: 0; }
.code-input { font-size: 1.6rem; letter-spacing: 0.4em; text-align: center; font-family: var(--mono); }
.lock-screen { max-width: 560px; margin: 12vh auto; }

.land-top { display: flex; justify-content: space-between; align-items: center; padding: 18px 6vw; position: sticky; top: 0; background: rgba(255, 255, 255, 0.86); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); z-index: 10; }
.land-top nav { display: flex; gap: 18px; align-items: center; }
.land-top nav a:not(.btn) { color: var(--ink-2); text-decoration: none; font-weight: 600; }
.land { padding: 0 6vw 60px; }
.land-body { background: #fff; }
.hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: 48px; align-items: center; padding: 64px 0 56px; }
.hero h1 { font-size: clamp(2.3rem, 4.6vw, 3.8rem); line-height: 1.06; letter-spacing: -0.03em; }
.hero h1 em { font-style: normal; color: var(--accent); }
.lede { font-size: 1.12rem; color: var(--ink-2); max-width: 36rem; margin: 18px 0 24px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-actions .btn { min-height: 46px; padding: 0 20px; font-size: 1rem; }
.pill { display: inline-flex; gap: 8px; align-items: center; background: var(--accent-soft); color: var(--accent-strong); border-radius: 999px; padding: 4px 12px; font-weight: 700; font-size: 0.82rem; }
.mock { background: var(--navy); color: #e8eef6; border-radius: 18px; padding: 16px; box-shadow: var(--shadow-lg); }
.mock-bar { display: flex; gap: 6px; align-items: center; margin-bottom: 12px; color: #8fa6c2; font-size: 0.82rem; }
.mock-bar span { width: 9px; height: 9px; border-radius: 99px; background: #31507a; }
.mock-bar em { margin-left: auto; font-style: normal; }
.mock-row { display: grid; grid-template-columns: 36px 1fr auto; gap: 10px; align-items: center; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.06); border-radius: 12px; padding: 10px; margin-bottom: 8px; }
.mock-row b { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--accent); color: #fff; }
.mock-row small { display: block; color: #8fa6c2; }
.mock-row i { font-style: normal; font-weight: 750; font-size: 0.85rem; }
.mock-row.is-sick i { color: #f3c776; }
.mock-row.is-here i { color: #7fe0a6; }
.mock-foot { margin: 10px 4px 0; color: #8fa6c2; font-size: 0.86rem; }
.band { padding: 56px 0; border-top: 1px solid var(--line); }
.section-head { max-width: 44rem; margin-bottom: 24px; }
.section-head h2 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); margin: 8px 0; }
.feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.feature { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; background: var(--surface); }
.feature .stat-icon { margin-bottom: 12px; }
.feature h3 { margin-bottom: 6px; }
.feature p { color: var(--muted); margin: 0; }
.price-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.price-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; background: var(--surface); display: flex; flex-direction: column; }
.price-card.is-featured { background: var(--navy); color: var(--navy-ink); border-color: var(--navy); }
.price-card.is-featured h3, .price-card.is-featured .price { color: #fff; }
.price { font-size: 2rem; font-weight: 800; margin: 10px 0; }
.price small { font-size: 0.95rem; color: var(--muted); font-weight: 600; }
.price-card ul { padding-left: 0; list-style: none; display: grid; gap: 8px; margin: 10px 0 0; }
.price-card li { display: flex; gap: 8px; }
.price-card li .icon { color: var(--accent); margin-top: 2px; }
.request { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: 28px; align-items: start; }
.land-foot { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 22px 6vw; border-top: 1px solid var(--line); color: var(--muted); flex-wrap: wrap; }

.receipt-body { background: #fff; }
.receipt { max-width: 720px; margin: 24px auto; padding: 32px; border: 1px solid var(--line); border-radius: 16px; }
.receipt header { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; border-bottom: 2px solid var(--ink); padding-bottom: 14px; margin-bottom: 16px; }
.receipt header img { max-height: 56px; max-width: 160px; object-fit: contain; }
.receipt table { width: 100%; border-collapse: collapse; margin: 16px 0; }
.receipt th, .receipt td { text-align: left; padding: 9px 0; border-bottom: 1px solid var(--line); }
.receipt td { text-align: right; font-variant-numeric: tabular-nums; }
.receipt tr.total th, .receipt tr.total td { font-weight: 800; font-size: 1.05rem; border-bottom: 2px solid var(--ink); }
.sign-row { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin-top: 36px; }
.sign-row div { border-top: 1px solid var(--ink); padding-top: 6px; color: var(--muted); font-size: 0.82rem; }
.print-sheet { max-width: 1100px; margin: 0 auto; padding: 24px; background: #fff; }
.print-sheet .table th { position: static; }
.print-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; margin-bottom: 18px; }
.print-head img { max-height: 54px; max-width: 160px; object-fit: contain; }
.sign-cell { min-width: 140px; border-bottom: 1px solid var(--ink-2); }

/* ——— Адаптивность ——— */
@media (max-width: 1100px) {
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-main { grid-template-columns: 1fr; }
  .feature-grid, .price-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inbox { grid-template-columns: 280px minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(-105%); transition: transform 0.22s ease; box-shadow: var(--shadow-lg); }
  .sidebar.is-open { transform: none; }
  .scrim { display: block; position: fixed; inset: 0; background: rgba(15, 42, 74, 0.45); opacity: 0; pointer-events: none; z-index: 25; transition: opacity 0.2s; }
  .scrim.is-open { opacity: 1; pointer-events: auto; }
  .main { margin-left: 0; }
  .menu-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--line-strong); background: var(--surface); border-radius: 10px; flex: none; }
  .topbar { padding: 10px 16px; }
  .topbar h1 { font-size: 1.12rem; }
  .content { padding: 16px 16px 96px; }
  .app-foot { padding: 0 16px 90px; }
  .grid-2, .grid-3, .form-grid.cols-2, .request, .hero, .auth-layout { grid-template-columns: 1fr; }
  .feature-grid, .price-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 12px; }
  .stat .stat-icon { display: none; }
  .stat strong { font-size: 1.3rem; }
  .filters .control, .filters input[type="search"].control { min-width: 0; flex: 1 1 140px; }
  .bottom-nav { display: flex; position: fixed; left: 8px; right: 8px; bottom: 8px; z-index: 22; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 5px; }
  .bottom-nav a, .bottom-nav button { flex: 1; display: flex; flex-direction: column; gap: 2px; align-items: center; text-decoration: none; color: var(--muted); background: transparent; border: 0; padding: 6px 2px; border-radius: 10px; font-weight: 650; font-size: 0.7rem; }
  .bottom-nav .is-active { background: var(--accent-soft); color: var(--accent-strong); }
  .att-list { grid-template-columns: 1fr; }
  .seg span { min-height: 46px; }
  .inbox { grid-template-columns: 1fr; }
  .inbox-list { max-height: 260px; border-right: 0; border-bottom: 1px solid var(--line); }
  .auth-story { padding: 28px 22px; }
  .auth-story h1 { font-size: 1.7rem; }
  .auth-points, .auth-story::after { display: none; }
  .hero { padding: 32px 0; gap: 28px; }
  .land-top nav a:not(.btn) { display: none; }
  .bill { grid-template-columns: 1fr; }
  .bill-sum { text-align: left; }
  .kanban { grid-template-columns: repeat(4, 82vw); }
}
@media (max-width: 480px) {
  .seg { grid-template-columns: repeat(2, 1fr); }
  .att-extra { grid-template-columns: 1fr; }
  .occ-split { grid-template-columns: 1fr 1fr; }
}

/* ——— Кабинет родителя ——— */
.shell-parent { background: var(--bg); }
.parent-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 6vw; background: var(--surface); border-bottom: 1px solid var(--line); }
.parent-bar .side-brand { padding: 0; color: var(--ink); }
.parent-bar .side-brand small { color: var(--muted); }
.parent-user { display: flex; gap: 10px; align-items: center; font-size: 0.88rem; }
.parent-main { max-width: 880px; margin: 0 auto; padding: 20px 16px 100px; }
.parent-main > h1 { margin-bottom: 14px; }
.parent-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; margin-bottom: 14px; }
.child-tile { display: flex; gap: 12px; align-items: center; }
.big-sum { font-size: 2rem; font-weight: 800; margin: 4px 0 12px; font-variant-numeric: tabular-nums; }
.shell-parent .bottom-nav { display: flex; position: fixed; left: 50%; transform: translateX(-50%); bottom: 12px; width: min(520px, calc(100% - 16px)); z-index: 22; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 5px; }
.shell-parent .bottom-nav a { flex: 1; display: flex; flex-direction: column; gap: 2px; align-items: center; text-decoration: none; color: var(--muted); padding: 6px 2px; border-radius: 10px; font-weight: 650; font-size: 0.74rem; }
.shell-parent .bottom-nav .is-active { background: var(--accent-soft); color: var(--accent-strong); }

@media print {
  .sidebar, .topbar, .bottom-nav, .no-print, .toolbar, .menu-btn, .app-foot, .flash-stack { display: none !important; }
  .main { margin: 0; }
  .content { padding: 0; max-width: none; }
  body { background: #fff; font-size: 11pt; }
  .card { box-shadow: none; border: 0; padding: 0; }
  .table th { background: #fff; }
  .table th, .table td { border-bottom: 1px solid #999; }
  a { color: inherit; text-decoration: none; }
  @page { margin: 12mm; }
}
.auth-solo { min-height: 100vh; }
.grow { flex: 1; min-width: 0; }
.thread-foot .row textarea { flex: 1 1 280px; width: auto; }
.thread-foot .row { align-items: flex-end; }
.settings-logo { width: 56px; height: 56px; object-fit: contain; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.card-pad { padding: 16px 18px 0; }
.land-top .brand-line, .land-foot .brand-mark { color: var(--ink); }
.land-foot .brand-mark { color: #fff; width: 30px; height: 30px; }
.land .kazlab-credit { color: var(--muted); }
.foot-logo { width: 28px; height: 28px; border-radius: 6px; object-fit: cover; }
.inset { border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 12px; background: var(--surface-2); }

/* ——— Oñpai ——— */
.side-brand img { background: transparent; padding: 0; border-radius: 0; width: auto; height: 34px; max-width: 150px; }
.side-brand.has-logo strong { display: none; }
.nav-section { color: #9fb0dd; }
.side-foot small, .side-brand small, .side-credit { color: #a9b8e3; }
.auth-story { background: var(--navy); }
.auth-story .onpai-logo { height: 54px; width: auto; }
.auth-story::after { border-color: rgba(255, 121, 0, 0.22); }
.auth-points .icon { color: var(--onpai-pink); }
.foot-site { margin-left: auto; display: inline-flex; gap: 4px; align-items: center; text-decoration: none; }
.balapan-credit { display: flex; gap: 10px; align-items: center; color: #c3cdec; font-size: 0.82rem; text-decoration: none; position: relative; z-index: 1; }
.balapan-credit img { width: 40px; height: 40px; border-radius: 10px; background: #fff; object-fit: cover; }
.balapan-credit strong { color: #fff; }
.setup-steps { margin: 0 0 14px; padding-left: 18px; color: var(--muted); font-size: 0.88rem; }
.enr-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--surface); }
.enr-card.is-ended { opacity: .6; background: var(--surface-2); }
.enr-card strong { margin-right: 6px; }
.mt-xs { margin-top: 6px; }
.alert-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.alert-row:last-child { border-bottom: 0; }
.alert-row > div { flex: 1; min-width: 0; }
.alert-row .icon { margin-top: 2px; }
.alert-danger .icon { color: var(--red); }
.alert-warn .icon { color: var(--amber); }
.alert-info .icon { color: var(--blue); }
.inv-rule { font-size: .8rem; color: var(--muted); }
.inv-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
.att-bar { gap: 8px; } .att-reason { max-width: 340px; background: var(--surface); box-shadow: var(--shadow-lg); }

/* Дашборд руководителя: KPI, графики (серверный SVG), подсказки */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 4px; color: inherit; text-decoration: none; min-width: 0; }
.kpi > span { color: var(--muted); font-size: 0.82rem; font-weight: 650; }
.kpi > strong { font-size: 1.6rem; line-height: 1.15; font-variant-numeric: tabular-nums; color: var(--ink); }
.kpi > small { color: var(--muted); font-size: 0.8rem; }
.kpi .meter { margin-top: 6px; }
.kpi-hero { grid-column: span 2; background: linear-gradient(135deg, var(--surface) 55%, var(--accent-soft)); }
.kpi-hero > strong { font-size: 2.1rem; }
.kpi-of { font-style: normal; font-size: 0.95rem; color: var(--muted); font-weight: 600; }
.kpi-split { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 6px; font-size: 0.82rem; color: var(--ink-2); }
.kpi-split span { display: inline-flex; align-items: center; gap: 6px; }
a.kpi:hover { border-color: var(--line-strong); }
.kpi.is-alert > strong { color: var(--red); }
.kpi.is-ok > strong { color: var(--green); }
.delta { font-style: normal; font-weight: 700; }
.delta-up { color: var(--green); }
.delta-down { color: var(--red); }
.delta-flat { color: var(--muted); }
.dash-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.dash-wide { grid-column: 1 / -1; }
.chart-card { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.chart-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.chart-head h3 { margin: 0; font-size: 1rem; }
.chart-head p { margin: 2px 0 0; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { stroke: var(--line-strong); stroke-width: 1; }
.chart .tick { fill: var(--muted); font-size: 11px; font-family: inherit; }
.chart .value { fill: var(--ink); font-size: 12px; font-weight: 700; font-family: inherit; }
.chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .dot { stroke: var(--surface); stroke-width: 2; }
.chart .hit-area { fill: transparent; }
.chart .hit:hover .hit-area { fill: rgba(16, 32, 53, 0.04); }
.chart .hit:hover .dot { r: 6; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 0.82rem; color: var(--ink-2); }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--line-strong); flex: none; }
.hbars { display: flex; flex-direction: column; gap: 10px; }
.hbar { display: grid; grid-template-columns: 1fr auto; grid-template-areas: 'label value' 'track track'; align-items: center; gap: 4px 10px; font-size: 0.86rem; }
.hbar-label { grid-area: label; }
.hbar-value { grid-area: value; }
.hbar-track { grid-area: track; }
.hbar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.hbar-track { display: flex; gap: 2px; height: 14px; }
.hbar-seg { display: block; height: 100%; width: 0; transition: width 0.5s ease; }
.hbar-seg:last-child { border-radius: 0 4px 4px 0; }
.hbar-value { font-variant-numeric: tabular-nums; font-weight: 650; min-width: 64px; text-align: right; }
.share-bar { display: flex; gap: 2px; height: 22px; border-radius: 6px; overflow: hidden; background: var(--surface-2); }
.share-bar > span { display: block; height: 100%; width: 0; transition: width 0.5s ease; }
.share-legend { display: grid; gap: 8px; }
.share-legend > div { display: grid; grid-template-columns: auto 1fr auto 44px; align-items: center; gap: 8px; font-size: 0.86rem; }
.share-legend strong { font-variant-numeric: tabular-nums; }
.share-legend small { color: var(--muted); text-align: right; }
.occ-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.occ-list li { display: grid; grid-template-columns: minmax(110px, 38%) 1fr 64px; align-items: center; gap: 10px; font-size: 0.86rem; }
.occ-name small { display: block; color: var(--muted); font-size: 0.74rem; }
.occ-list .meter { display: block; }
.occ-num { font-size: 0.9rem; line-height: 1.2; text-align: right; font-variant-numeric: tabular-nums; font-weight: 650; }
.occ-num small { color: var(--muted); font-weight: 500; }
.debt-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.chart-table summary { cursor: pointer; color: var(--accent-strong); font-size: 0.84rem; font-weight: 600; }
.chart-table table { margin-top: 8px; }
.chart-tip { position: fixed; z-index: 50; pointer-events: none; background: var(--ink); color: #fff; padding: 7px 10px; border-radius: 8px; font-size: 0.8rem; line-height: 1.35; max-width: 280px; box-shadow: 0 6px 18px rgba(16, 32, 53, 0.25); }
@media (max-width: 860px) {
  .dash-grid { grid-template-columns: 1fr; }
  .kpi-hero { grid-column: 1 / -1; }
}
@media print {
  .dash-grid { grid-template-columns: 1fr 1fr; }
  .chart-card, .kpi { break-inside: avoid; box-shadow: none; }
  .chart-table, .chart-tip { display: none; }
}

/* Дети: направления с занятиями за месяц, итоги */
.block { display: block; }
.nowrap { white-space: nowrap; }
.enr-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.enr-chip { display: inline-flex; align-items: stretch; border-radius: 999px; overflow: hidden; font-size: 0.78rem; font-weight: 650; border: 1px solid var(--line-strong); background: var(--surface); }
.enr-chip-name { padding: 3px 9px; }
.enr-chip-count { padding: 3px 8px; background: var(--surface-2); border-left: 1px solid var(--line-strong); color: var(--muted); font-variant-numeric: tabular-nums; }
.enr-chip-count b { color: var(--ink); }
.enr-chip.is-paid { border-color: #b9d8ee; }
.enr-chip.is-paid .enr-chip-name { background: var(--accent-soft); color: var(--accent-strong); }
.enr-chip.is-voucher { border-color: #d9cdf0; }
.enr-chip.is-voucher .enr-chip-name { background: #f1ecfb; color: #5b3fa0; }
.children-table tfoot td { background: var(--surface-2); border-top: 1px solid var(--line-strong); vertical-align: top; }
/* Итоги списка детей — сразу под заголовком таблицы. */
.children-table .table-total td { background: var(--surface-2); font-weight: 750; border-bottom: 1px solid var(--line-strong); vertical-align: top; }
.enr-lessons { display: grid; gap: 6px; margin-top: 8px; }
.enr-lesson { display: grid; grid-template-columns: 110px minmax(80px, 200px) 1fr; gap: 10px; align-items: center; }
.enr-lesson .meter { display: block; }

/* Персонал: выбор нескольких направлений */
.check-grid { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px 16px; margin: 0; }
.check-grid .check small { color: var(--muted); font-weight: 500; }
.check-grid legend { font-weight: 650; font-size: 0.84rem; color: var(--ink-2); padding: 0 4px; }
.check-grid .check { display: inline-flex; gap: 6px; align-items: center; font-size: 0.88rem; }
.check-grid .hint { grid-column: 1 / -1; }

/* Дашборд: филиалы */
.dash-title { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.dash-title h2 { margin: 0; }
.segmented-sm a { padding: 5px 12px; font-size: 0.84rem; }
.kpi-more { font-style: normal; font-weight: 600; color: var(--accent-strong); font-size: 0.74rem; margin-left: 4px; }
a.kpi { cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s; }
a.kpi:hover { box-shadow: 0 6px 18px rgba(16, 32, 53, 0.10); }
.dash-grid-tight { gap: 24px; }
#branches { scroll-margin-top: 90px; }
@media (max-width: 640px) {
  .enr-lesson { grid-template-columns: 1fr; gap: 2px; }
}

/* Подытоги в реестрах (например, реестр «Индиго» по возрасту) */
.table tr.row-subtotal td { background: var(--surface-2); font-weight: 700; }
.contrib-table input.control-sm { width: 86px; min-width: 86px; }
.contrib-table input.control-sm[data-wide] { width: 110px; min-width: 110px; }
.contrib-table td:last-child input.control-sm { width: 120px; }

/* Рассылки родителям */
.inline-form { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; }
.inline-form .field { min-width: 220px; }
form.inline { display: inline; }
.pre-line { white-space: pre-line; }

/* Подготовка к запуску: отмеченные к удалению строки */
.table tr.row-warn td { background: var(--amber-soft); }
