/* ЛУЧИ — дизайн «Неон». Светлая и тёмная тема. */

:root {
  --lime: #C8FF3D;
  --lime-ink: #0B0D10;
  --bg: #F5F6F2;
  --surface: #FFFFFF;
  --soft: #F1F2ED;
  --line: #E2E4DC;
  --line-strong: #CDD0C5;
  --track: #E9EBE3;
  --text: #111316;
  --muted: #5E6470;
  --accent-text: #3F6A00;
  --accent-soft: #ECF8CC;
  --day: #6F9B00;
  --night: #4B39C9;
  --night-soft: #ECE9FF;
  --danger: #C8362B;
  --danger-soft: #FBE4E1;
  --warn: #8F5200;
  --warn-soft: #FDEFD8;
  --ok: #2F7A1F;
  --ok-soft: #E4F4DD;
  --shadow: 0 1px 2px rgba(17, 19, 22, .04), 0 8px 24px rgba(17, 19, 22, .05);
  --radius: 24px;
  --radius-sm: 14px;
  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Unbounded', 'Manrope', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #07080A;
  --surface: #111318;
  --soft: #181B21;
  --line: #23272F;
  --line-strong: #2F343D;
  --track: #23272F;
  --text: #F2F4F7;
  --muted: #8B93A1;
  --accent-text: #C8FF3D;
  --accent-soft: rgba(200, 255, 61, .12);
  --day: #C8FF3D;
  --night: #A396FF;
  --night-soft: rgba(157, 140, 255, .16);
  --danger: #F0675C;
  --danger-soft: rgba(240, 103, 92, .14);
  --warn: #FFB547;
  --warn-soft: rgba(255, 181, 71, .14);
  --ok: #7ED957;
  --ok-soft: rgba(126, 217, 87, .13);
  --shadow: 0 1px 0 rgba(255, 255, 255, .02);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 500 14px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
::selection { background: var(--lime); color: var(--lime-ink); }
a { color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 800; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; border-radius: 8px; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; font-weight: 700; }
.display { font-family: var(--display); font-weight: 700; letter-spacing: -.5px; }
.muted { color: var(--muted); }
.danger-text { color: var(--danger); }
.accent-text { color: var(--accent-text); }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- шапка ---------- */
.topbar { border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 30; }
.topbar-in { max-width: 1360px; margin: 0 auto; padding: 16px 28px 0; display: flex; flex-direction: column; gap: 14px; }
.topbar-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 12px; background: var(--lime); color: var(--lime-ink);
  display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 18px;
}
.brand-name { font-family: var(--display); font-weight: 700; font-size: 18px; letter-spacing: 1px; }
.brand-sub { font-size: 12px; color: var(--muted); margin-top: -2px; }
.tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.pill {
  height: 44px; padding: 0 16px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line);
  display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); white-space: nowrap;
}
.pill input[type="date"] { border: 0; background: transparent; color: var(--text); font-family: var(--mono); font-weight: 700; font-size: 14px; padding: 0; min-width: 0; }
.pill .num { color: var(--text); }
.sync-dot { width: 8px; height: 8px; border-radius: 4px; background: var(--ok); transition: background .3s; }
.sync-dot.is-busy { background: var(--warn); animation: pulse 1s ease-in-out infinite; }
.sync-dot.is-err { background: var(--danger); }

.icon-btn {
  width: 44px; height: 44px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line);
  display: inline-grid; place-items: center; transition: transform .15s var(--ease), border-color .2s;
}
.icon-btn:hover { border-color: var(--line-strong); }
.icon-btn:active { transform: scale(.94); }
.icon-btn svg { width: 18px; height: 18px; }

/* навигация с «ездящей» подложкой */
.tabs { position: relative; display: flex; gap: 4px; overflow-x: auto; padding-bottom: 12px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative; z-index: 1; border: 0; background: transparent; white-space: nowrap;
  height: 40px; padding: 0 16px; border-radius: 20px; color: var(--muted); font-weight: 700;
  display: inline-flex; align-items: center; gap: 8px; transition: color .25s;
}
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--lime-ink); }
.tab .badge { background: var(--danger); color: #fff; }
.tab-indicator {
  position: absolute; z-index: 0; top: 0; left: 0; height: 40px; border-radius: 20px; background: var(--lime);
  transition: transform .45s var(--ease), width .45s var(--ease); pointer-events: none;
}

/* ---------- раскладка ---------- */
.page { max-width: 1360px; margin: 0 auto; padding: 28px 28px 80px; }
.pane { display: none; flex-direction: column; gap: 20px; }
.pane.is-active { display: flex; animation: paneIn .45s var(--ease) both; }
.row { display: flex; flex-wrap: wrap; gap: 20px; align-items: stretch; }
.row > * { min-width: 0; }
.grow-3 { flex: 3 1 520px; } .grow-2 { flex: 2 1 340px; } .grow-1 { flex: 1 1 300px; } .half { flex: 1 1 400px; }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px;
  display: flex; flex-direction: column; gap: 16px; box-shadow: var(--shadow); position: relative;
}
.reveal { animation: rise .55s var(--ease) both; animation-delay: calc(var(--i, 0) * 60ms); }
.card-head { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; }
.card-title { font-size: 16px; font-weight: 800; }
.card-sub { font-size: 13px; color: var(--muted); }
.section-title { font-size: 13px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .8px; }

/* ---------- главная сумма ---------- */
.hero { padding: 32px; gap: 20px; }
.hero-total { font-family: var(--display); font-weight: 700; font-size: clamp(44px, 7vw, 72px); line-height: .95; letter-spacing: -1.5px; }
.hero-total .cur { color: var(--muted); }
.progress { height: 8px; border-radius: 4px; background: var(--track); overflow: hidden; }
.progress > i { display: block; height: 100%; width: 0; border-radius: 4px; background: var(--lime); transition: width 1s var(--ease); }
:root:not([data-theme="dark"]) .progress > i { background: #9BD000; }
.progress.is-done > i { background: var(--ok); }
.stats { display: flex; flex-wrap: wrap; gap: 12px 28px; }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat-label { font-size: 12px; color: var(--muted); }
.stat-value { font-family: var(--mono); font-weight: 700; font-size: 18px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 14px;
  font-size: 13px; font-weight: 800; background: var(--soft); color: var(--text); white-space: nowrap;
}
.chip-accent { background: var(--accent-soft); color: var(--accent-text); }
.chip-danger { background: var(--danger-soft); color: var(--danger); }
.chip-warn { background: var(--warn-soft); color: var(--warn); }
.chip-night { background: var(--night-soft); color: var(--night); }
.chip-ok { background: var(--ok-soft); color: var(--ok); }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; display: inline-grid; place-items: center; font-size: 11px; font-weight: 800; }

/* ---------- кто на смене ---------- */
.sched { display: flex; flex-direction: column; gap: 6px; }
.sched-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 16px; }
.sched-row.is-today { background: var(--accent-soft); }
.sched-date { width: 44px; display: flex; flex-direction: column; align-items: center; flex: none; }
.sched-date small { font-size: 11px; color: var(--muted); }
.sched-date b { font-family: var(--display); font-size: 16px; }
.sched-names { flex: 1; display: flex; flex-direction: column; gap: 3px; font-weight: 700; }
.dot { width: 8px; height: 8px; border-radius: 4px; display: inline-block; margin-right: 8px; vertical-align: 1px; }
.dot-day { background: var(--day); } .dot-night { background: var(--night); }

/* ---------- карточки смен ---------- */
.shift { gap: 20px; transition: opacity .4s, filter .4s; }
.shift-head { display: flex; align-items: center; gap: 14px; }
.avatar {
  width: 52px; height: 52px; border-radius: 26px; display: grid; place-items: center; flex: none;
  font-family: var(--display); font-weight: 700; font-size: 18px;
}
.avatar-day { background: var(--lime); color: var(--lime-ink); }
.avatar-night { background: var(--night-soft); color: var(--night); }
.shift-who { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.shift-who select { border: 0; background: transparent; font-weight: 800; font-size: 18px; padding: 0; max-width: 100%; appearance: none; cursor: pointer; }
.shift-who select:disabled { cursor: default; opacity: 1; }
.shift-sum { display: flex; flex-direction: column; align-items: flex-end; }
.shift-sum b { font-family: var(--display); font-size: 24px; font-weight: 700; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 16px 20px; }
.field-line { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 700; }
.field-line input {
  width: 100%; height: 44px; padding: 0; border: 0; border-bottom: 2px solid var(--line); border-radius: 0;
  background: transparent; font-family: var(--mono); font-size: 22px; font-weight: 700; color: var(--text);
  transition: border-color .2s;
}
.field-line input:focus { outline: none; border-bottom-color: var(--accent-text); }
.field-line input:disabled { color: var(--muted); }
.field-line input::placeholder { color: var(--line-strong); }
.field-line.is-readonly input { border-bottom-style: dashed; }

.checklist { display: flex; flex-direction: column; gap: 8px; }
.check {
  display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 14px; border-radius: 14px;
  background: var(--soft); cursor: pointer; font-weight: 700; transition: background .2s;
}
.check:hover { background: var(--line); }
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check-box {
  width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--line-strong); flex: none;
  display: grid; place-items: center; transition: background .2s, border-color .2s, transform .25s var(--spring);
}
.check-box svg { width: 14px; height: 14px; stroke: var(--lime-ink); stroke-width: 3; fill: none; stroke-dasharray: 20; stroke-dashoffset: 20; transition: stroke-dashoffset .3s var(--ease) .05s; }
.check input:checked + .check-box { background: var(--lime); border-color: var(--lime); transform: scale(1.06); }
.check input:checked + .check-box svg { stroke-dashoffset: 0; }
.check input:focus-visible + .check-box { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.check input:disabled ~ * { opacity: .7; }
.check.is-disabled { cursor: default; }
.check.is-disabled:hover { background: var(--soft); }
.check-label { flex: 1; }
.check-tag { font-size: 12px; font-weight: 800; color: var(--muted); }

.close-zone { display: flex; flex-direction: column; gap: 10px; padding-top: 4px; }
.blockers { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.blockers li::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 3px; background: var(--warn); margin-right: 8px; vertical-align: 2px; }

.shift.is-closed .fields input, .shift.is-closed .shift-who select { pointer-events: none; }
.closed-banner {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 16px;
  background: var(--soft); font-weight: 700; animation: pop .5s var(--spring) both;
}
.closed-banner svg { width: 20px; height: 20px; flex: none; color: var(--ok); }
.closed-banner small { display: block; font-weight: 600; color: var(--muted); }

/* ---------- кнопки ---------- */
.btn {
  min-height: 48px; padding: 0 22px; border-radius: 24px; border: 1px solid transparent;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 800; text-decoration: none;
  background: var(--text); color: var(--bg); transition: transform .15s var(--ease), opacity .2s, background .2s; white-space: nowrap;
}
.btn:hover { opacity: .9; }
.btn:active { transform: scale(.97); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; }
.btn-lime { background: var(--lime); color: var(--lime-ink); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--line-strong); opacity: 1; }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 13px; border-radius: 18px; }
.btn-block { width: 100%; }
.btn svg { width: 18px; height: 18px; }
.link-btn { border: 0; background: none; padding: 4px; color: var(--muted); font-weight: 700; font-size: 13px; border-radius: 8px; }
.link-btn:hover { color: var(--danger); }
.btn.is-loading { position: relative; color: transparent !important; }
.btn.is-loading::after {
  content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid currentColor; border-color: var(--lime-ink) transparent var(--lime-ink) transparent; animation: spin .7s linear infinite;
}
.btn-danger.is-loading::after, .btn:not(.btn-lime).is-loading::after { border-color: #fff transparent #fff transparent; }

/* ---------- формы ---------- */
.form { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; align-items: end; }
.form .wide { grid-column: 1 / -1; }
.label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 800; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; height: 48px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font-size: 15px; font-weight: 600; transition: border-color .2s, box-shadow .2s;
}
.textarea { height: auto; min-height: 90px; padding: 12px 14px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent-text); box-shadow: 0 0 0 3px var(--accent-soft); }
.input:disabled, .select:disabled { background: var(--soft); color: var(--muted); }
.input.num { font-family: var(--mono); }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238B93A1' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
.hint { font-size: 12px; color: var(--muted); font-weight: 600; }

.seg { display: inline-flex; padding: 4px; border-radius: 16px; background: var(--soft); gap: 2px; flex-wrap: wrap; }
.seg button {
  border: 0; background: transparent; min-height: 40px; padding: 0 14px; border-radius: 12px; font-weight: 800; font-size: 13px;
  color: var(--muted); transition: background .2s, color .2s;
}
.seg button.is-on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.seg-ok button.is-on { background: var(--ok-soft); color: var(--ok); }
.seg-warn button.is-on { background: var(--warn-soft); color: var(--warn); }
.seg-bad button.is-on { background: var(--danger-soft); color: var(--danger); }

.search-wrap { position: relative; }
.search-list {
  position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 6px); max-height: 280px; overflow: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 6px; box-shadow: 0 16px 40px rgba(0, 0, 0, .14);
  animation: dropIn .2s var(--ease) both;
}
.search-item { display: flex; justify-content: space-between; gap: 12px; width: 100%; border: 0; background: transparent; padding: 10px 12px; border-radius: 10px; font-weight: 700; text-align: left; }
.search-item:hover, .search-item.is-hl { background: var(--soft); }

/* ---------- списки и журналы ---------- */
.list { display: flex; flex-direction: column; }
.list-row { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
.list-row.is-new { animation: flash 1.4s var(--ease); }
.list-time { font-family: var(--mono); font-size: 12px; color: var(--muted); width: 44px; flex: none; }
.list-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.list-main b { font-weight: 800; }
.list-main small { color: var(--muted); font-size: 12px; font-weight: 600; }
.list-sum { font-family: var(--mono); font-weight: 700; white-space: nowrap; }
.scroll-box { max-height: 420px; overflow-y: auto; padding-right: 4px; }
.empty { padding: 20px; text-align: center; color: var(--muted); font-weight: 600; border: 1px dashed var(--line); border-radius: 16px; }
.group-date { font-size: 12px; font-weight: 800; color: var(--muted); padding: 14px 0 4px; text-transform: uppercase; letter-spacing: .6px; }

/* ---------- таблицы ---------- */
.table-box { overflow-x: auto; border: 1px solid var(--line); border-radius: 18px; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
.t th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 800; padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--soft); white-space: nowrap; position: sticky; top: 0; }
.t td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr { transition: background .15s; }
.t tbody tr:hover { background: var(--soft); }
.t .r { text-align: right; } .t .c { text-align: center; }
.t tr.is-today td { background: var(--accent-soft); }
.t input.input, .t select.select { height: 40px; font-size: 14px; }

/* ---------- ПК ---------- */
.pc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 8px; }
.pc {
  border: 0; border-radius: 14px; min-height: 64px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  transition: transform .2s var(--ease); background: var(--soft);
}
.pc:hover { transform: translateY(-2px); }
.pc small { font-family: var(--mono); font-size: 11px; opacity: .75; }
.pc b { font-family: var(--display); font-size: 16px; }
.pc.lvl-ok { background: var(--ok-soft); color: var(--ok); }
.pc.lvl-warn { background: var(--warn-soft); color: var(--warn); }
.pc.lvl-bad { background: var(--danger-soft); color: var(--danger); }
.legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 12px; color: var(--muted); font-weight: 600; }
.legend span::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legend .l-ok::before { background: var(--ok-soft); outline: 1px solid var(--ok); }
.legend .l-warn::before { background: var(--warn-soft); outline: 1px solid var(--warn); }
.legend .l-bad::before { background: var(--danger-soft); outline: 1px solid var(--danger); }

.pc-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.pc-card { border: 1px solid var(--line); border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--surface); transition: border-color .25s, box-shadow .25s, opacity .25s; }
.pc-card.is-hit { border-color: var(--accent-text); box-shadow: 0 0 0 3px var(--accent-soft); }
.pc-card.is-dim { opacity: .45; }
.pc-card h4 { font-family: var(--display); font-size: 15px; display: flex; justify-content: space-between; align-items: center; }
.pc-games { display: flex; flex-direction: column; gap: 2px; max-height: 260px; overflow-y: auto; }
.mini-check { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 600; }
.mini-check:hover { background: var(--soft); }
.mini-check input { width: 18px; height: 18px; accent-color: #9BD000; flex: none; }
.mini-check span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- зарплата ---------- */
.pay-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.pay-line { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.pay-line:last-child { border-bottom: 0; }
.pay-line .num { white-space: nowrap; }
.pay-sub { padding: 0 0 8px 12px; font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 2px; }
.pay-total { display: flex; justify-content: space-between; align-items: baseline; padding-top: 12px; border-top: 2px solid var(--text); font-weight: 800; }
.pay-total .display { font-size: 26px; }

/* ---------- калькулятор ---------- */
.price-big { font-family: var(--display); font-weight: 700; font-size: clamp(40px, 6vw, 64px); line-height: 1; letter-spacing: -1px; }
.tariff-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.tariff { border-radius: 18px; background: var(--soft); padding: 16px; display: flex; flex-direction: column; gap: 6px; transition: background .25s, box-shadow .25s; }
.tariff.is-on { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent-text); }
.tariff h4 { font-size: 15px; margin-bottom: 4px; }
.tariff-row { display: flex; justify-content: space-between; font-size: 13px; }

/* ---------- аккаунты ---------- */
.secret { display: flex; gap: 6px; align-items: center; }
.secret .input { font-family: var(--mono); font-size: 13px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- уведомления ---------- */
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: min(92vw, 460px); }
.toast {
  pointer-events: auto; background: var(--text); color: var(--bg); padding: 14px 18px; border-radius: 16px; font-weight: 700;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .2); animation: toastIn .35s var(--spring) both; white-space: pre-line; width: 100%;
  display: flex; gap: 10px; align-items: flex-start;
}
.toast.is-err { background: var(--danger); color: #fff; }
.toast.is-ok::before { content: ''; width: 8px; height: 8px; border-radius: 4px; background: var(--lime); margin-top: 6px; flex: none; }
.toast.is-out { animation: toastOut .3s var(--ease) both; }

.modal-back { position: fixed; inset: 0; z-index: 90; background: rgba(7, 8, 10, .55); display: grid; place-items: center; padding: 20px; animation: fadeIn .25s both; }
.modal { width: min(560px, 100%); background: var(--surface); border-radius: 28px; padding: 28px; display: flex; flex-direction: column; gap: 16px; animation: modalIn .35s var(--spring) both; border: 1px solid var(--line); }
.modal h2 { font-size: 22px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.modal.is-alert { border: 2px solid var(--danger); }
.modal.is-alert h2 { color: var(--danger); }
.modal .alert-text { font-size: 18px; line-height: 1.5; white-space: pre-line; }

/* ---------- вход ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: min(380px, 100%); gap: 20px; padding: 32px; animation: modalIn .5s var(--spring) both; }
.login-card .brand { justify-content: center; }
.login-card .input { text-align: center; font-size: 18px; letter-spacing: 2px; }
.login-err { color: var(--danger); font-weight: 700; text-align: center; animation: shake .4s; }

/* ---------- графики ---------- */
.bars { display: flex; align-items: flex-end; gap: 4px; height: 150px; }
.bars .bar { flex: 1; display: flex; flex-direction: column-reverse; border-radius: 6px 6px 2px 2px; overflow: hidden; min-width: 4px; transform-origin: bottom; animation: grow .8s var(--ease) both; animation-delay: calc(var(--i, 0) * 18ms); }
.bars .bar i { display: block; }
.bars .bar .b-d { background: var(--day); } .bars .bar .b-n { background: var(--night); }
.bars-x { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); font-family: var(--mono); }

/* ---------- анимации ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes paneIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(16px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(20px) scale(.95); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(10px) scale(.97); } }
@keyframes dropIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes flash { 0% { background: var(--accent-soft); } 100% { background: transparent; } }
@keyframes pulse { 50% { opacity: .35; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@keyframes grow { from { transform: scaleY(0); } to { transform: none; } }
@keyframes nudge { 30% { transform: translateX(-4px); } 60% { transform: translateX(4px); } }
.nudge { animation: nudge .35s; }

::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

/* ---------- дополнительные анимации ---------- */
.btn, .icon-btn, .seg button, .pc, .chip[data-open] { position: relative; overflow: hidden; }
.ripple { position: absolute; border-radius: 50%; background: currentColor; opacity: .22; transform: scale(0); pointer-events: none; animation: ripple .6s var(--ease) forwards; }
@keyframes ripple { to { transform: scale(2.6); opacity: 0; } }

.topbar { transition: box-shadow .3s, background .3s; }
.topbar.is-scrolled { box-shadow: 0 6px 24px rgba(0, 0, 0, .08); }
:root[data-theme="dark"] .topbar.is-scrolled { box-shadow: 0 6px 24px rgba(0, 0, 0, .5); }

/* число «подпрыгивает», когда меняется */
.bump { display: inline-block; animation: bump .45s var(--spring); }
@keyframes bump { 40% { transform: translateY(-3px) scale(1.03); } }

/* поле: линия снизу «вырастает» при фокусе */
.field-line input { background: linear-gradient(var(--accent-text), var(--accent-text)) left bottom / 0 2px no-repeat; transition: border-color .2s, background-size .35s var(--ease); }
.field-line input:focus { background-size: 100% 2px; }

/* пункт чек-листа заливается при отметке */
.check { position: relative; overflow: hidden; }
.check::before { content: ''; position: absolute; inset: 0; background: var(--accent-soft); transform: scaleX(0); transform-origin: left; transition: transform .45s var(--ease); }
.check:has(input:checked)::before { transform: scaleX(1); }
.check > * { position: relative; }

/* полоса плана: блик, когда план выполнен */
.progress > i { position: relative; overflow: hidden; }
.progress.is-done > i::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .6), transparent); transform: translateX(-100%); animation: shine 2.6s ease-in-out infinite; }
@keyframes shine { 60%, 100% { transform: translateX(100%); } }

/* закрытие смены: проход света по карточке и «защёлкивание» замка */
.shift.just-closed::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: linear-gradient(105deg, transparent 30%, var(--accent-soft) 50%, transparent 70%); background-size: 250% 100%; animation: sweep 1.1s var(--ease) both; }
@keyframes sweep { from { background-position: 120% 0; } to { background-position: -40% 0; } }
.closed-banner svg { animation: lockIn .6s var(--spring) .15s both; }
@keyframes lockIn { from { transform: scale(0) rotate(-25deg); opacity: 0; } to { transform: none; opacity: 1; } }

/* строки списков выезжают лесенкой при открытии вкладки */
.pane.is-entering .list-row { animation: rowIn .45s var(--ease) both; }
.pane.is-entering .list-row:nth-child(2) { animation-delay: 40ms; } .pane.is-entering .list-row:nth-child(3) { animation-delay: 80ms; }
.pane.is-entering .list-row:nth-child(4) { animation-delay: 120ms; } .pane.is-entering .list-row:nth-child(5) { animation-delay: 160ms; }
.pane.is-entering .list-row:nth-child(6) { animation-delay: 200ms; } .pane.is-entering .list-row:nth-child(n+7) { animation-delay: 240ms; }
@keyframes rowIn { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }

/* плитки ПК появляются по очереди */
.pc { animation: pop .4s var(--spring) both; animation-delay: calc(var(--i, 0) * 18ms); }

/* точка «Сохранено»: расходящееся кольцо */
.sync-dot { position: relative; }
.sync-dot.is-saved::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--ok); animation: ring .7s var(--ease) forwards; }
@keyframes ring { from { transform: scale(.4); opacity: 1; } to { transform: scale(1.8); opacity: 0; } }

/* уведомление: полоска оставшегося времени */
.toast { position: relative; overflow: hidden; }
.toast::after { content: ''; position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: currentColor; opacity: .25; transform-origin: left; animation: timer var(--t, 3200ms) linear forwards; }
@keyframes timer { to { transform: scaleX(0); } }

/* иконка темы поворачивается */
[data-theme-toggle] svg { transition: transform .6s var(--spring); }
:root[data-theme="dark"] [data-theme-toggle] svg { transform: rotate(-200deg); }

/* карточки чуть приподнимаются при наведении (только мышь) */
@media (hover: hover) {
  .card.grow-1:hover, .tariff:hover, .pc-card:hover { translate: 0 -2px; }
  .card, .tariff, .pc-card { transition: translate .25s var(--ease), border-color .25s, box-shadow .25s; }
  .bars .bar { transition: opacity .2s, filter .2s; }
  .bars:hover .bar { opacity: .45; }
  .bars .bar:hover { opacity: 1; filter: brightness(1.1); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important; }
}

/* ---------- телефон ---------- */
@media (max-width: 640px) {
  .topbar-in { padding: 12px 16px 0; }
  .page { padding: 18px 16px 80px; }
  .card { padding: 18px; border-radius: 20px; }
  .hero { padding: 22px; }
  .brand-sub { display: none; }
  .pill.hide-sm { display: none; }
  .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar { position: static; }
}

@media print {
  .topbar, .toasts, .btn, .tabs { display: none !important; }
  .pane { display: flex !important; }
}
