/* Layout: одна колонка на телефоне с плавающей нижней навигацией; на компьютере — боковая навигация слева. */
/* Монохром: чёрный глянец, белый свет, матовое стекло. Одна тёмная тема намеренно. */
:root {
  --bg: #000000;
  --surface: #0c0c0d;
  --surface-2: #17171a;
  --ink: #f4f4f5;
  --muted: #8b8b92;
  --line: rgba(255, 255, 255, .08);
  --accent: #ffffff;
  --accent-ink: #000000;
  --accent-soft: rgba(255, 255, 255, .10);
  --chalk: #ffffff;
  --glow: 0 0 28px rgba(255, 255, 255, .28), 0 0 2px rgba(255, 255, 255, .6);
  --gloss: linear-gradient(180deg, #19191c 0%, #0a0a0b 46%, #050505 100%);
  --rim: inset 0 1px 0 rgba(255, 255, 255, .16), inset 0 0 0 1px rgba(255, 255, 255, .06);

  --ok: #8ff0b4;   --ok-bg: rgba(143, 240, 180, .10);
  --warn: #ffd978; --warn-bg: rgba(255, 217, 120, .10);
  --due: #ffb27a;  --due-bg: rgba(255, 178, 122, .11);
  --bad: #ff8a80;  --bad-bg: rgba(255, 138, 128, .12);
  --info: #a9c4ff; --info-bg: rgba(169, 196, 255, .10);
  --mutedc: #a0a0a7; --muted-bg: rgba(255, 255, 255, .06);

  --display: 'Unbounded', 'Arial Black', system-ui, sans-serif;
  --body: 'Onest', -apple-system, 'Segoe UI', Roboto, system-ui, sans-serif;
  --radius: 26px;
  --shadow: var(--rim), 0 24px 48px rgba(0, 0, 0, .55);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink); font: 15px/1.45 var(--body);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  min-height: 100vh; min-height: 100dvh;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

/* ---------- каркас ---------- */
.app { display: grid; grid-template-columns: 1fr; min-height: 100vh; min-height: 100dvh; }
.topbar {
  position: sticky; top: 0; z-index: 20; background: var(--accent); color: var(--accent-ink);
  padding: calc(10px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px));
  display: flex; align-items: center; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark { width: 34px; height: 34px; flex: none; }
.brand-name { font: 700 15px/1.1 var(--display); letter-spacing: .01em; white-space: nowrap; }
.brand-city { font-size: 12px; opacity: .85; }
.topbar .spacer { flex: 1; }
.role-pill {
  font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 999px;
  background: rgba(255, 255, 255, .18); color: inherit; border: 0;
}
:root[data-theme="dark"] .role-pill { background: rgba(0, 0, 0, .18); }

.main {
  padding: 16px max(16px, env(safe-area-inset-right, 0px)) calc(96px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  width: 100%; max-width: 860px; margin: 0 auto; display: grid; gap: 14px; align-content: start; min-width: 0;
}

.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--line);
  display: flex; justify-content: space-around;
  padding: 6px max(8px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px));
}
.nav button {
  flex: 1; border: 0; background: none; color: var(--muted); display: grid; justify-items: center; gap: 2px;
  font-size: 11px; font-weight: 600; padding: 6px 2px; border-radius: 10px; max-width: 110px;
}
.nav button svg { width: 24px; height: 24px; }
.nav button[aria-current="page"] { color: var(--accent); }
.nav button[aria-current="page"] svg { stroke-width: 2.4; }

@media (min-width: 900px) {
  .app { grid-template-columns: 220px 1fr; grid-template-rows: auto 1fr; }
  .topbar { grid-column: 1 / -1; }
  .nav {
    position: sticky; top: 58px; align-self: start; flex-direction: column; justify-content: flex-start; gap: 4px;
    border: 0; background: none; padding: 16px 12px; height: calc(100vh - 58px);
  }
  .nav button { grid-template-columns: 24px 1fr; justify-items: start; align-items: center; font-size: 14px; padding: 10px 12px; max-width: none; gap: 10px; flex: none; }
  .nav button[aria-current="page"] { background: var(--accent-soft); }
  .main { padding-bottom: 40px; padding-top: 24px; }
}

/* ---------- общие элементы ---------- */
h1, h2, h3 { margin: 0; text-wrap: balance; }
.h1 { font: 700 20px/1.2 var(--display); letter-spacing: -.01em; }
.h2 { font: 700 15px/1.25 var(--display); }
.label { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.stack { display: grid; gap: 10px; }

.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.card.pad { padding: 16px; }

.btn {
  border: 0; border-radius: 12px; padding: 12px 16px; font-weight: 600; background: var(--surface-2); color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px;
}
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.danger { background: var(--bad-bg); color: var(--bad); }
.btn.ghost { background: none; color: var(--accent); padding: 8px 10px; min-height: 36px; }
.btn.block { width: 100%; }
.btn.sm { padding: 8px 12px; min-height: 36px; font-size: 14px; border-radius: 10px; }
.btn:disabled { opacity: .5; cursor: default; }
.btn svg { width: 18px; height: 18px; flex: none; }
.icon-btn { border: 0; background: var(--surface-2); width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--ink); flex: none; }
.icon-btn svg { width: 20px; height: 20px; }

.seg { display: flex; background: var(--surface-2); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { flex: 1; border: 0; background: none; padding: 9px 8px; border-radius: 9px; font-weight: 600; color: var(--muted); font-size: 14px; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.seg .count { font-weight: 500; opacity: .7; margin-left: 4px; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 7px 12px; font-size: 13px; font-weight: 600; white-space: nowrap; color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.st { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.st::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st.ok { color: var(--ok); background: var(--ok-bg); }
.st.warn { color: var(--warn); background: var(--warn-bg); }
.st.due { color: var(--due); background: var(--due-bg); }
.st.bad { color: var(--bad); background: var(--bad-bg); }
.st.info { color: var(--info); background: var(--info-bg); }
.st.muted { color: var(--mutedc); background: var(--muted-bg); }
.tag { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px; background: var(--surface-2); color: var(--muted); }

.field { display: grid; gap: 6px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 11px 12px; min-height: 44px; font-size: 16px;
}
textarea.input { min-height: 72px; resize: vertical; }
.input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 420px) { .grid2.collapse { grid-template-columns: 1fr; } }

.check { display: flex; align-items: center; gap: 10px; padding: 10px 0; }
.check input { width: 22px; height: 22px; accent-color: var(--accent); flex: none; }

.empty { text-align: center; padding: 28px 16px; color: var(--muted); }
.notice { border-radius: 12px; padding: 12px 14px; font-size: 14px; background: var(--surface-2); color: var(--ink); display: flex; gap: 10px; align-items: flex-start; }
.notice.warn { background: var(--warn-bg); color: var(--warn); }
.notice.bad { background: var(--bad-bg); color: var(--bad); }
.notice.info { background: var(--info-bg); color: var(--info); }
.notice svg { width: 18px; height: 18px; flex: none; margin-top: 2px; }

/* ---------- тренировка ---------- */
.board {
  background: var(--accent); color: var(--accent-ink); border-radius: var(--radius); padding: 14px 12px;
  display: flex; align-items: center; gap: 8px; position: relative; overflow: hidden;
}
.board::after { /* разметка поля */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .14;
  background:
    radial-gradient(circle at 50% 50%, transparent 38px, currentColor 39px, currentColor 40px, transparent 41px),
    linear-gradient(currentColor, currentColor) 50% 0 / 2px 100% no-repeat;
}
.board .nav-arrow { position: relative; z-index: 1; border: 0; width: 40px; height: 40px; border-radius: 12px; background: rgba(255, 255, 255, .16); color: inherit; display: grid; place-items: center; }
:root[data-theme="dark"] .board .nav-arrow { background: rgba(0, 0, 0, .16); }
.board .nav-arrow:disabled { opacity: .35; }
.board .nav-arrow svg { width: 20px; height: 20px; }
.board .when { flex: 1; text-align: center; position: relative; z-index: 1; min-width: 0; }
.board .wd { font-size: 12px; font-weight: 600; opacity: .85; text-transform: uppercase; letter-spacing: .08em; }
.board .date { font: 700 22px/1.15 var(--display); }
.board .today-link { font-size: 12px; font-weight: 600; background: none; border: 0; color: inherit; text-decoration: underline; opacity: .9; padding: 2px; }

.tally { display: flex; align-items: baseline; gap: 8px; }
.tally b { font: 700 26px/1 var(--display); }

.list { display: grid; }
.list > * + * { border-top: 1px solid var(--line); }
.krow { display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 14px; min-height: 60px; background: none; border: 0; width: 100%; text-align: left; }
.krow .name { font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.krow .meta { display: flex; align-items: center; gap: 6px; margin-top: 3px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.mark {
  width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; flex: none; background: var(--surface);
  transition: background .12s, border-color .12s, transform .12s;
}
.mark svg { width: 18px; height: 18px; opacity: 0; color: var(--accent-ink); }
.krow[aria-pressed="true"] .mark { background: var(--accent); border-color: var(--accent); }
.krow[aria-pressed="true"] .mark svg { opacity: 1; }
.krow[aria-pressed="true"] { background: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
.krow:active .mark { transform: scale(.92); }
.krow.locked { cursor: default; }
.krow-wrap { display: flex; align-items: center; }
.krow-wrap .krow { flex: 1; min-width: 0; }
.krow-wrap .more { margin-right: 10px; }
.pay-dot { border: 0; background: var(--due-bg); color: var(--due); font-weight: 800; width: 40px; height: 40px; border-radius: 12px; margin-right: 6px; flex: none; }
.pay-dot.bad { background: var(--bad-bg); color: var(--bad); }

/* ---------- ученики ---------- */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tile { border: 0; text-align: left; background: var(--surface); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow); display: grid; gap: 2px; color: var(--ink); }
.tile b { font: 700 24px/1.1 var(--display); }
.tile span { font-size: 12px; font-weight: 600; color: var(--muted); }
.tile.bad b { color: var(--bad); } .tile.due b { color: var(--due); } .tile.warn b { color: var(--warn); }
.tile[aria-pressed="true"] { outline: 2px solid var(--ink); }
.search { position: relative; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); }
.search .input { padding-left: 38px; }
.group-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 6px; }
.fab {
  position: fixed; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(80px + env(safe-area-inset-bottom, 0px)); z-index: 25;
  border: 0; border-radius: 16px; background: var(--accent); color: var(--accent-ink); font-weight: 700; padding: 14px 18px;
  display: flex; align-items: center; gap: 8px; box-shadow: 0 8px 24px rgba(13, 122, 62, .35);
}
.fab svg { width: 20px; height: 20px; }
@media (min-width: 900px) { .fab { bottom: 28px; right: 28px; } }

/* ---------- окно (лист) ---------- */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(8, 14, 11, .45); display: flex; align-items: flex-end; justify-content: center; }
.sheet {
  background: var(--bg); width: 100%; max-width: 620px; max-height: 94vh; max-height: 94dvh; border-radius: 20px 20px 0 0; overflow: auto;
  display: flex; flex-direction: column; animation: up .18s ease-out;
}
@media (min-width: 700px) { .overlay { align-items: center; } .sheet { border-radius: 20px; max-height: 88vh; } }
@keyframes up { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .sheet { animation: none; } .mark { transition: none; } }
.sheet-head {
  position: sticky; top: 0; z-index: 2; background: var(--bg); display: flex; align-items: center; gap: 10px;
  padding: 14px max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px));
}
.sheet-body { padding: 4px max(16px, env(safe-area-inset-right, 0px)) calc(20px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); display: grid; gap: 14px; }
.sheet-foot {
  position: sticky; bottom: 0; background: var(--bg); border-top: 1px solid var(--line);
  padding: 12px max(16px, env(safe-area-inset-right, 0px)) calc(12px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
}

.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.plan { border: 2px solid var(--line); background: var(--surface); border-radius: 14px; padding: 12px; text-align: left; display: grid; gap: 2px; }
.plan b { font: 700 15px/1.2 var(--display); }
.plan span { font-size: 13px; color: var(--muted); }
.plan[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }

.meter { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; display: flex; gap: 2px; }
.meter i { flex: 1; background: var(--line); }
.meter i.on { background: var(--accent); }

.hist { display: grid; }
.hist > div { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.hist .d { width: 48px; flex: none; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13px; }
.hist .by { font-size: 11px; color: var(--muted); }
.hist .x { border: 0; background: none; color: var(--muted); padding: 6px; border-radius: 8px; }
.hist .x svg { width: 18px; height: 18px; }

.stepper { display: flex; align-items: center; gap: 8px; }
.stepper button { width: 44px; height: 44px; border-radius: 12px; border: 0; background: var(--surface-2); font-size: 20px; font-weight: 700; }
.stepper output { min-width: 44px; text-align: center; font: 700 20px var(--display); }

/* ---------- деньги ---------- */
.money { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.money .card { padding: 14px; display: grid; gap: 4px; }
.money .big { grid-column: 1 / -1; }
.money b { font: 700 22px/1.1 var(--display); font-variant-numeric: tabular-nums; }
.money .big b { font-size: 32px; }
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--line); }
table.t td { padding: 10px 12px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
table.t td.r, table.t th.r { text-align: right; }

/* ---------- журнал ---------- */
.log-day { padding: 12px 14px 4px; }
.log-item { padding: 10px 14px; display: grid; gap: 2px; }
.log-item .top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.log-item .txt { font-size: 14px; overflow-wrap: anywhere; }
.who { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px; }
.who.admin { background: var(--warn-bg); color: var(--warn); }
.who.director { background: var(--info-bg); color: var(--info); }
.who.import { background: var(--muted-bg); color: var(--mutedc); }

/* ---------- настройки ---------- */
.perm { display: grid; gap: 6px; padding: 12px 0; border-top: 1px solid var(--line); }
.perm:first-child { border-top: 0; }
.switch { display: flex; align-items: center; gap: 12px; justify-content: space-between; font-weight: 600; }
.switch input { appearance: none; -webkit-appearance: none; width: 48px; height: 28px; border-radius: 99px; background: var(--line); position: relative; flex: none; transition: background .15s; cursor: pointer; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(20px); }
.warn-text { font-size: 13px; color: var(--warn); display: flex; gap: 6px; }

/* ---------- вход ---------- */
.login { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px max(16px, env(safe-area-inset-right, 0px)) 24px max(16px, env(safe-area-inset-left, 0px)); background: var(--accent); }
.login .card { width: 100%; max-width: 400px; padding: 24px; display: grid; gap: 16px; }
.login .brand-mark { width: 52px; height: 52px; }
.login .title { font: 700 22px/1.15 var(--display); }

/* ---------- уведомления ---------- */
.toast-wrap { position: fixed; left: 0; right: 0; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); z-index: 60; display: grid; justify-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
@media (min-width: 900px) { .toast-wrap { bottom: 24px; } }
.toast { pointer-events: auto; background: var(--ink); color: var(--bg); border-radius: 14px; padding: 10px 10px 10px 16px; display: flex; align-items: center; gap: 12px; font-size: 14px; font-weight: 500; max-width: 520px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }
.toast.error { background: var(--bad); color: #fff; }
.toast button { border: 0; background: rgba(255, 255, 255, .16); color: inherit; font-weight: 700; padding: 8px 12px; border-radius: 10px; }
.sync { width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, .5); flex: none; }
.sync.busy { background: #ffd34d; animation: pulse 1s infinite; }
.sync.err { background: #ff6b5e; }
@keyframes pulse { 50% { opacity: .35; } }
.demo-bar { background: var(--warn-bg); color: var(--warn); font-size: 13px; font-weight: 600; text-align: center; padding: 6px 16px; }

/* ---------- табель ---------- */
table.grid { font-size: 13px; }
table.grid th, table.grid td { padding: 8px 6px; }
table.grid .sticky { position: sticky; left: 0; background: var(--surface); z-index: 1; min-width: 132px; max-width: 160px; padding-left: 14px; }
table.grid th.c, table.grid td.c { text-align: center; min-width: 34px; }
table.grid th.c { text-transform: none; letter-spacing: 0; line-height: 1.15; }
table.grid td.yes svg { width: 16px; height: 16px; color: var(--accent); vertical-align: middle; }
table.grid td.debt { color: var(--bad); font-weight: 800; background: var(--bad-bg); }
table.grid .off { color: var(--muted); background: var(--surface-2); }
table.grid tfoot td { border-bottom: 0; font-weight: 600; }
.linkish { border: 0; background: none; padding: 0; text-align: left; font-weight: 600; color: inherit; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; display: block; }

/* ================= Монохромный глянец ================= */
body { background: #000 radial-gradient(120% 60% at 50% -10%, #1a1a1d 0%, #000 60%) no-repeat; background-attachment: fixed; letter-spacing: -.005em; }
.h1, .board .date, .tile b, .money b, .tally b, .login .title, .plan b { font-family: var(--body); font-weight: 600; letter-spacing: -.035em; }
.h1 { font-size: 26px; }
.h2 { font-family: var(--body); font-weight: 600; font-size: 17px; letter-spacing: -.02em; }
.label, .brand-city, .board .wd { font-family: var(--display); font-weight: 600; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; }

/* карточки: глянец с бликом по верхней кромке */
.card, .tile, .money .card { background: var(--gloss); box-shadow: var(--shadow); border-radius: var(--radius); }

/* шапка и навигация — матовое стекло */
.topbar { background: rgba(0, 0, 0, .55); color: var(--ink); -webkit-backdrop-filter: blur(22px) saturate(140%); backdrop-filter: blur(22px) saturate(140%); border-bottom: 1px solid var(--line); }
.brand-name { font-family: var(--body); font-weight: 700; font-size: 16px; letter-spacing: -.02em; }
.brand-city { opacity: 1; color: var(--muted); margin-top: 2px; }
.brand-mark { color: #fff; filter: drop-shadow(0 0 10px rgba(255, 255, 255, .35)); }
.role-pill { background: rgba(255, 255, 255, .06); box-shadow: var(--rim); border-radius: 999px; font-family: var(--display); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; padding: 8px 12px; }
.sync { background: rgba(255, 255, 255, .35); }
.sync:not(.busy):not(.err) { box-shadow: 0 0 8px rgba(255, 255, 255, .4); }

.nav {
  left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); border: 0; border-radius: 28px;
  background: rgba(20, 20, 22, .62); -webkit-backdrop-filter: blur(24px) saturate(150%); backdrop-filter: blur(24px) saturate(150%);
  box-shadow: var(--rim), 0 20px 40px rgba(0, 0, 0, .6); padding: 6px;
}
.nav button { border-radius: 22px; padding: 8px 2px; }
.nav button[aria-current="page"] { color: #fff; background: rgba(255, 255, 255, .09); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12); }
.nav button[aria-current="page"] svg { filter: drop-shadow(0 0 8px rgba(255, 255, 255, .55)); }
.main { padding-bottom: calc(118px + env(safe-area-inset-bottom, 0px)); }
@media (min-width: 900px) {
  .nav { left: auto; right: auto; bottom: auto; background: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; border-radius: 0; padding: 18px 12px; }
  .nav button[aria-current="page"] { background: rgba(255, 255, 255, .08); }
}

/* кнопки: белый свет */
.btn { border-radius: 999px; background: rgba(255, 255, 255, .07); box-shadow: var(--rim); }
.btn.primary { background: linear-gradient(180deg, #ffffff, #dcdcdf); color: #000; box-shadow: var(--glow), inset 0 -2px 6px rgba(0, 0, 0, .12); }
.btn.danger { background: rgba(255, 138, 128, .10); box-shadow: inset 0 0 0 1px rgba(255, 138, 128, .18); }
.btn.ghost { background: none; box-shadow: none; color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.icon-btn { border-radius: 50%; background: rgba(255, 255, 255, .06); box-shadow: var(--rim); }
.fab { background: linear-gradient(180deg, #fff, #dcdcdf); color: #000; border-radius: 999px; box-shadow: var(--glow), 0 12px 30px rgba(0, 0, 0, .6); bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }

/* сегменты и чипы — стекло */
.seg { background: rgba(255, 255, 255, .05); box-shadow: var(--rim); border-radius: 999px; padding: 5px; }
.seg button { border-radius: 999px; }
.seg button[aria-pressed="true"] { background: #fff; color: #000; box-shadow: var(--glow); }
.chip { background: rgba(255, 255, 255, .05); border: 0; box-shadow: var(--rim); color: var(--ink); }
.chip[aria-pressed="true"] { background: #fff; color: #000; box-shadow: var(--glow); }

/* статусы: монохромная плашка, цвет только у точки и текста */
.st { background: rgba(255, 255, 255, .06) !important; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); font-weight: 600; }
.st::before { box-shadow: 0 0 8px currentColor; }
.tag { background: rgba(255, 255, 255, .07); color: var(--muted); border-radius: 999px; }

.input, select.input, textarea.input { background: rgba(255, 255, 255, .04); border: 0; box-shadow: var(--rim); border-radius: 18px; }
.input:focus { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .5), 0 0 0 4px rgba(255, 255, 255, .08); }
.check input { accent-color: #fff; }

.notice { background: rgba(255, 255, 255, .05); box-shadow: var(--rim); border-radius: 20px; }
.notice.warn, .notice.bad, .notice.info { background: rgba(255, 255, 255, .05); }

/* табло тренировки: чёрное стекло с белым светом, как на референсе */
.board { background: var(--gloss); color: #fff; box-shadow: var(--shadow); border-radius: 30px; padding: 22px 14px; isolation: isolate; }
.board::before {
  content: ""; position: absolute; z-index: -1; left: 50%; top: 50%; width: 170px; height: 78px; transform: translate(-50%, -50%);
  background: #fff; border-radius: 40px; filter: blur(34px); opacity: .22;
}
.board::after { opacity: .07; }
.board .date { font-size: 30px; }
.board .wd { color: var(--muted); }
.board .nav-arrow { border-radius: 50%; background: rgba(255, 255, 255, .07); box-shadow: var(--rim); }
.board .today-link { color: var(--muted); }

.tally b { font-size: 38px; text-shadow: 0 0 22px rgba(255, 255, 255, .35); }

/* отметка: белый светящийся круг */
.mark { border: 0; background: rgba(255, 255, 255, .06); box-shadow: var(--rim); width: 36px; height: 36px; }
.mark svg { color: #000; }
.krow[aria-pressed="true"] .mark { background: #fff; box-shadow: var(--glow); }
.krow[aria-pressed="true"] { background: linear-gradient(90deg, rgba(255, 255, 255, .07), transparent 70%); }
.krow .name { font-weight: 500; letter-spacing: -.01em; }
.list > * + * { border-top-color: rgba(255, 255, 255, .06); }
.pay-dot, .pay-dot.bad { border-radius: 50%; background: rgba(255, 255, 255, .07); box-shadow: var(--rim); color: #fff; }
.pay-dot.bad { color: var(--bad); }

.tile { padding: 16px; }
.tile b { font-size: 30px; }
.tile.bad b, .tile.due b, .tile.warn b { text-shadow: 0 0 18px currentColor; }
.tile[aria-pressed="true"] { outline: 0; box-shadow: inset 0 0 0 1.5px #fff, var(--glow); }

/* окна: стекло поверх размытого фона */
.overlay { background: rgba(0, 0, 0, .5); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.sheet { background: linear-gradient(180deg, #121214, #050505 40%); box-shadow: var(--rim), 0 -20px 60px rgba(0, 0, 0, .7); border-radius: 32px 32px 0 0; }
@media (min-width: 700px) { .sheet { border-radius: 32px; } }
.sheet-head, .sheet-foot { background: rgba(8, 8, 9, .7); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); }
.sheet-foot { border-top-color: var(--line); }
.plan { background: rgba(255, 255, 255, .04); border: 0; box-shadow: var(--rim); border-radius: 22px; padding: 14px; }
.plan[aria-pressed="true"] { background: #fff; color: #000; box-shadow: var(--glow); }
.plan[aria-pressed="true"] span { color: #333; }
.meter { background: rgba(255, 255, 255, .06); height: 10px; }
.meter i { background: rgba(255, 255, 255, .08); border-radius: 4px; }
.meter i.on { background: #fff; box-shadow: 0 0 10px rgba(255, 255, 255, .6); }
.stepper button { border-radius: 50%; background: rgba(255, 255, 255, .07); box-shadow: var(--rim); }
.stepper output { font-family: var(--body); font-weight: 600; }

.switch input { background: rgba(255, 255, 255, .12); }
.switch input:checked { background: #fff; box-shadow: var(--glow); }
.switch input:checked::after { background: #000; }
.warn-text { color: var(--muted); }
.warn-text svg { color: var(--warn); }

table.grid .sticky { background: #0b0b0c; }
table.grid td.yes svg { color: #fff; filter: drop-shadow(0 0 5px rgba(255, 255, 255, .7)); }
table.grid .off { background: rgba(255, 255, 255, .03); }
.who.admin, .who.director, .who.import { background: rgba(255, 255, 255, .07); border-radius: 999px; }
.who.admin { color: var(--warn); } .who.director { color: var(--info); }

/* вход: белый силуэт под стеклом */
.login { background: #000 radial-gradient(60% 40% at 50% 35%, #1b1b1e, #000 70%); }
.login .card { border-radius: 34px; padding: 28px; position: relative; overflow: hidden; isolation: isolate; }
.login .card::before {
  content: ""; position: absolute; z-index: -1; top: -40px; left: 50%; width: 140px; height: 140px; transform: translateX(-50%);
  background: #fff; border-radius: 50%; filter: blur(46px); opacity: .18;
}
.login .brand-mark { color: #fff !important; }
.login .title { font-size: 26px; }

.toast { background: rgba(244, 244, 245, .92); color: #000; -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border-radius: 999px; padding: 8px 8px 8px 18px; box-shadow: var(--glow); }
.toast button { background: #000; color: #fff; border-radius: 999px; }
.toast.error { background: rgba(255, 138, 128, .95); color: #000; }
.toast-wrap { bottom: calc(100px + env(safe-area-inset-bottom, 0px)); }
.demo-bar { background: #111; color: var(--muted); font-family: var(--display); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }

.main > *, .sheet-body > * { min-width: 0; }
.table-wrap { max-width: 100%; }


/* ================= Светлая тема: белый глянец, чёрные акценты ================= */
:root[data-theme="light"] {
  --bg: #ececef; --surface: #ffffff; --surface-2: #f1f1f3; --ink: #0d0d0f; --muted: #6b6b73; --line: rgba(0, 0, 0, .08);
  --accent: #4a4a51; --accent-ink: #ffffff; --accent-soft: rgba(0, 0, 0, .06); --chalk: #0d0d0f;
  --glow: 0 6px 18px rgba(0, 0, 0, .12), 0 1px 2px rgba(0, 0, 0, .14);
  --gloss: linear-gradient(180deg, #ffffff 0%, #f8f8f9 55%, #f0f0f2 100%);
  --rim: inset 0 1px 0 rgba(255, 255, 255, .95), inset 0 0 0 1px rgba(0, 0, 0, .06);
  --shadow: var(--rim), 0 14px 34px rgba(20, 20, 30, .08);
  --ok: #11804a; --ok-bg: rgba(17, 128, 74, .10);
  --warn: #8a5a00; --warn-bg: rgba(200, 140, 0, .12);
  --due: #b84a00; --due-bg: rgba(230, 110, 20, .12);
  --bad: #c62828; --bad-bg: rgba(198, 40, 40, .10);
  --info: #2b59c3; --info-bg: rgba(43, 89, 195, .10);
  --mutedc: #5f5f66; --muted-bg: rgba(0, 0, 0, .05);
  color-scheme: light;
}
:root[data-theme="light"] body { background: #ececef radial-gradient(120% 60% at 50% -10%, #ffffff 0%, #ececef 60%) no-repeat fixed; }
:root[data-theme="light"] .topbar { background: rgba(255, 255, 255, .72); }
:root[data-theme="light"] .brand-mark { color: #0d0d0f; filter: none; }
:root[data-theme="light"] .role-pill,
:root[data-theme="light"] .btn,
:root[data-theme="light"] .icon-btn,
:root[data-theme="light"] .seg,
:root[data-theme="light"] .board .nav-arrow,
:root[data-theme="light"] .stepper button,
:root[data-theme="light"] .pay-dot,
:root[data-theme="light"] .mark { background: rgba(0, 0, 0, .05); }
:root[data-theme="light"] .sync { background: rgba(0, 0, 0, .3); }
:root[data-theme="light"] .sync:not(.busy):not(.err) { box-shadow: none; }
:root[data-theme="light"] .nav { background: rgba(255, 255, 255, .74); box-shadow: var(--rim), 0 16px 34px rgba(0, 0, 0, .12); }
:root[data-theme="light"] .nav button[aria-current="page"] { color: #0d0d0f; background: rgba(0, 0, 0, .06); }
:root[data-theme="light"] .nav button[aria-current="page"] svg { filter: none; }
@media (min-width: 900px) { :root[data-theme="light"] .nav { background: none; box-shadow: none; } }
:root[data-theme="light"] .btn.primary,
:root[data-theme="light"] .fab { background: linear-gradient(180deg, #5a5a62, #43434a); color: #fff; box-shadow: var(--glow); }
:root[data-theme="light"] .btn.danger { background: rgba(198, 40, 40, .08); }
:root[data-theme="light"] .btn.ghost { color: #0d0d0f; background: none; }
:root[data-theme="light"] .seg button[aria-pressed="true"],
:root[data-theme="light"] .chip[aria-pressed="true"],
:root[data-theme="light"] .plan[aria-pressed="true"] { background: #4a4a51; color: #fff; box-shadow: var(--glow); }
:root[data-theme="light"] .plan[aria-pressed="true"] span { color: #c9c9cf; }
:root[data-theme="light"] .chip,
:root[data-theme="light"] .plan,
:root[data-theme="light"] .input,
:root[data-theme="light"] select.input,
:root[data-theme="light"] textarea.input { background: #fff; }
:root[data-theme="light"] .input:focus { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .55), 0 0 0 4px rgba(0, 0, 0, .06); }
:root[data-theme="light"] .st { background: rgba(0, 0, 0, .045) !important; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .05); }
:root[data-theme="light"] .st::before { box-shadow: none; }
:root[data-theme="light"] .tag,
:root[data-theme="light"] .who { background: rgba(0, 0, 0, .05); }
:root[data-theme="light"] .check input { accent-color: #0d0d0f; }
:root[data-theme="light"] .notice,
:root[data-theme="light"] .notice.warn,
:root[data-theme="light"] .notice.bad,
:root[data-theme="light"] .notice.info { background: rgba(0, 0, 0, .04); }
:root[data-theme="light"] .board { color: #0d0d0f; }
:root[data-theme="light"] .board::before { background: #000; opacity: .06; }
:root[data-theme="light"] .tally b,
:root[data-theme="light"] .tile.bad b,
:root[data-theme="light"] .tile.due b,
:root[data-theme="light"] .tile.warn b { text-shadow: none; }
:root[data-theme="light"] .mark svg { color: #fff; }
:root[data-theme="light"] .krow[aria-pressed="true"] .mark { background: #4a4a51; }
:root[data-theme="light"] .krow[aria-pressed="true"] { background: linear-gradient(90deg, rgba(0, 0, 0, .045), transparent 70%); }
:root[data-theme="light"] .list > * + * { border-top-color: rgba(0, 0, 0, .06); }
:root[data-theme="light"] .pay-dot { color: #0d0d0f; }
:root[data-theme="light"] .pay-dot.bad { color: var(--bad); }
:root[data-theme="light"] .tile[aria-pressed="true"] { box-shadow: inset 0 0 0 1.5px #4a4a51, var(--glow); }
:root[data-theme="light"] .overlay { background: rgba(20, 20, 25, .22); }
:root[data-theme="light"] .sheet { background: linear-gradient(180deg, #ffffff, #f2f2f4 40%); box-shadow: var(--rim), 0 -20px 60px rgba(0, 0, 0, .15); }
:root[data-theme="light"] .sheet-head,
:root[data-theme="light"] .sheet-foot { background: rgba(250, 250, 251, .82); }
:root[data-theme="light"] .meter { background: rgba(0, 0, 0, .06); }
:root[data-theme="light"] .meter i { background: rgba(0, 0, 0, .08); }
:root[data-theme="light"] .meter i.on { background: #4a4a51; box-shadow: none; }
:root[data-theme="light"] .switch input { background: rgba(0, 0, 0, .14); }
:root[data-theme="light"] .switch input:checked { background: #4a4a51; }
:root[data-theme="light"] .switch input:checked::after { background: #fff; }
:root[data-theme="light"] table.grid .sticky { background: #fff; }
:root[data-theme="light"] table.grid td.yes svg { color: #0d0d0f; filter: none; }
:root[data-theme="light"] table.grid .off { background: rgba(0, 0, 0, .03); }
:root[data-theme="light"] .login { background: #ececef radial-gradient(60% 40% at 50% 35%, #ffffff, #ececef 70%); }
:root[data-theme="light"] .login .card::before { background: #000; opacity: .05; }
:root[data-theme="light"] .login .brand-mark { color: #0d0d0f !important; }
:root[data-theme="light"] .toast { background: rgba(13, 13, 15, .9); color: #fff; box-shadow: 0 10px 30px rgba(0, 0, 0, .2); }
:root[data-theme="light"] .toast button { background: #fff; color: #000; }
:root[data-theme="light"] .demo-bar { background: #e2e2e6; }
.left-in { width: 72px; flex: none; text-align: center; }
.brow { padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.brow .name { font-weight: 600; font-size: 15px; }
.brow .meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.bfields { display: grid; grid-template-columns: 96px 1fr; gap: 10px; margin-top: 2px; }
.bfields label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); min-width: 0; }
.bfields .input { width: 100%; min-width: 0; }
.bfields .input.changed { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent); }

/* инструкция */
.help-card { display: flex; align-items: center; gap: 14px; padding: 16px; width: 100%; text-align: left; color: var(--ink); font: inherit; cursor: pointer; }
.help-card > svg { width: 26px; height: 26px; flex: none; }
.help-card > svg:last-child { width: 18px; height: 18px; color: var(--muted); }
.help-card .grow { display: flex; flex-direction: column; gap: 2px; }
.help-card b { font-size: 16px; }
.help { padding: 0; overflow: hidden; }
.help summary { list-style: none; cursor: pointer; padding: 14px 44px 14px 16px; font-weight: 600; font-size: 16px; position: relative; }
.help summary::-webkit-details-marker { display: none; }
.help summary::after { content: '+'; position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-size: 20px; color: var(--muted); }
.help[open] summary::after { content: '−'; }
.help-body { padding: 0 16px 16px; font-size: 14px; line-height: 1.5; }
.help-body > :first-child { margin-top: 0; }
.help-steps, .help-list { margin: 8px 0; padding-left: 20px; }
.help-steps li, .help-list li { margin: 5px 0; }
.help-sub { font-weight: 600; margin: 12px 0 4px; }
.help-tip { margin: 10px 0 0; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); color: var(--muted); font-size: 13px; }
.help-legend { display: flex; flex-direction: column; gap: 10px; }
.help-legend > div { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.help-legend > div > span:last-child { color: var(--muted); font-size: 13px; }
.help-table td, .help-table th { font-size: 13px; vertical-align: top; }
.help .kv { margin: 0 0 8px; }
.help-text { font-size: 13px; color: var(--muted); display: flex; gap: 6px; }
