/* Учёт Atomic Coffee — рабочий инструмент: спокойная бумага, тёмно-бирюзовый акцент, табличные цифры. */
:root {
  --bg: #eef2f0; --surface: #ffffff; --surface-2: #f6f8f7; --ink: #15201c; --muted: #5d6a65; --line: #d9e0dd;
  --accent: #0f5f50; --accent-ink: #ffffff; --accent-soft: #dcefe8;
  --ok: #2e7d4f; --ok-soft: #dff1e5; --warn: #9a5b06; --warn-soft: #fbeed5; --bad: #b3261e; --bad-soft: #fbe3e0;
  --s1: #0f5f50; --s2: #c9761c; --s3: #4a5fc1; --s4: #9a4f8f; --s5: #5b8a2d; --s6: #b84a4a;
  --radius: 10px; --side: 232px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1513; --surface: #171f1c; --surface-2: #1d2622; --ink: #e5ece9; --muted: #98a6a0; --line: #2b3632;
    --accent: #48c2a3; --accent-ink: #062019; --accent-soft: #163029;
    --ok: #7fd197; --ok-soft: #173023; --warn: #e8b261; --warn-soft: #33281a; --bad: #f2867c; --bad-soft: #3a1f1d;
    --s1: #48c2a3; --s2: #eda25a; --s3: #8b9cf2; --s4: #d48ac9; --s5: #9ccb6a; --s6: #e88a8a;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.45 var(--font); font-variant-numeric: tabular-nums; }
a { color: var(--accent); }
h1 { font-size: 22px; margin: 0; letter-spacing: -.01em; text-wrap: balance; }
h2 { font-size: 16px; margin: 0; }
h3 { font-size: 14px; margin: 0; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }

/* каркас */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); font-size: 17px; }
.brand b { color: var(--accent); }
.brand-mark { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--accent); position: relative; }
.brand-mark::after { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--accent); }
.who { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; }
.who-name { font-weight: 600; font-size: 14px; }
.who-role { font-size: 12px; color: var(--muted); }
.menu-btn { display: none; width: 40px; height: 40px; border: 1px solid var(--line); background: var(--surface); border-radius: 8px;
  padding: 10px 9px; flex-direction: column; justify-content: space-between; cursor: pointer; }
.menu-btn span { display: block; height: 2px; background: var(--ink); border-radius: 2px; }
.shell { display: flex; align-items: flex-start; }
.side { position: sticky; top: 61px; width: var(--side); flex: none; height: calc(100vh - 61px); overflow-y: auto;
  padding: 14px 10px 24px; border-right: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; gap: 1px; }
.side a { display: block; padding: 7px 10px; border-radius: 7px; color: var(--ink); text-decoration: none; font-size: 14px; }
.side a:hover { background: var(--surface-2); }
.side a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-h { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); padding: 14px 10px 4px; }
.nav-foot { margin-top: auto; padding-top: 18px; display: flex; flex-direction: column; gap: 2px; }
.nav-foot form { margin: 0; }
.linkish { background: none; border: 0; color: var(--muted); font: inherit; font-size: 14px; padding: 7px 10px; cursor: pointer; text-align: left; width: 100%; border-radius: 7px; }
.linkish:hover { background: var(--surface-2); }
.main { flex: 1; min-width: 0; padding-inline: 24px; padding-block: 20px 60px; display: flex; flex-direction: column; gap: 18px; max-width: 1280px; }
.main.solo { margin: 0 auto; max-width: 420px; padding-block: 12vh 40px; }
@media (max-width: 980px) {
  .menu-btn { display: flex; }
  .side { position: fixed; left: 0; top: 61px; z-index: 30; transform: translateX(-105%); transition: transform .2s ease; box-shadow: 0 10px 30px rgba(0,0,0,.15); width: min(84vw, 300px); }
  .side.open { transform: none; }
  .main { padding-inline: 16px; }
}
@media (prefers-reduced-motion: reduce) { .side { transition: none; } }

/* заголовок страницы */
.page-head { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: flex-end; justify-content: space-between; }
.page-head .sub { color: var(--muted); margin-top: 4px; max-width: 70ch; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* панели */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.panel-head { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; justify-content: space-between; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 900px) { .grid2, .grid3 { grid-template-columns: 1fr; } }

/* цифры */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kpi .k { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.kpi .v { font-size: 22px; font-weight: 700; }
.kpi .n { font-size: 13px; color: var(--muted); }
.kpi.bad { border-color: var(--bad); }
.kpi.warn { border-color: var(--warn); }
.pos { color: var(--ok); }
.neg { color: var(--bad); }

/* таблицы */
.tw { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
table.t { border-collapse: collapse; width: 100%; font-size: 14px; }
.t th, .t td { padding: 7px 9px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.t th { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; background: var(--surface); position: sticky; top: 0; }
.t td.r, .t th.r { text-align: right; white-space: nowrap; }
.t tr.total td { font-weight: 700; border-bottom: 0; border-top: 2px solid var(--line); }
.t tr.sub td { color: var(--muted); font-size: 13px; }
.t tr.strong td { font-weight: 700; background: var(--surface-2); }
.t tr:hover td { background: var(--surface-2); }
.t td a { text-decoration: none; }
.t td a:hover { text-decoration: underline; }
.t .grp td { background: var(--surface-2); font-weight: 600; font-size: 13px; color: var(--muted); }
.empty { padding: 18px; text-align: center; color: var(--muted); }

/* метки */
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 999px; white-space: nowrap; background: var(--surface-2); color: var(--muted); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.acc { background: var(--accent-soft); color: var(--accent); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* кнопки и формы */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600; font-size: 14px;
  border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: 8px; cursor: pointer; text-decoration: none; min-height: 38px; }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.quiet { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn.danger { background: transparent; color: var(--bad); border-color: var(--bad); }
.btn.small { padding: 4px 10px; min-height: 30px; font-size: 13px; }
.btn.big { min-height: 52px; font-size: 16px; padding: 12px 18px; }
.btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
form.inline { display: inline; margin: 0; }
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.form .wide { grid-column: 1 / -1; }
@media (max-width: 640px) { .form { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field label { font-size: 13px; font-weight: 600; }
.field .help { font-size: 12px; color: var(--muted); }
.field .err { font-size: 12px; color: var(--bad); }
input[type=text], input[type=number], input[type=date], input[type=month], input[type=password], input[type=search], input[type=file], select, textarea {
  font: inherit; font-size: 15px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); width: 100%; min-height: 40px; }
textarea { min-height: 70px; resize: vertical; }
input.num { text-align: right; }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.check input { width: 18px; height: 18px; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; grid-column: 1 / -1; padding-top: 4px; }
.form-actions .spacer { flex: 1; }
.filters { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; }
.filters .field { min-width: 150px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); }
.seg a { padding: 6px 12px; text-decoration: none; color: var(--ink); font-size: 14px; border-right: 1px solid var(--line); white-space: nowrap; }
.seg a:last-child { border-right: 0; }
.seg a.on { background: var(--accent); color: var(--accent-ink); }
.monthnav { display: inline-flex; align-items: center; gap: 6px; }
.monthnav a { text-decoration: none; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 5px 10px; color: var(--ink); }
.monthnav b { min-width: 130px; text-align: center; }

/* сообщения */
.flashes { display: flex; flex-direction: column; gap: 8px; }
.flash { padding: 10px 14px; border-radius: 8px; background: var(--accent-soft); color: var(--ink); border: 1px solid var(--line); }
.flash.error { background: var(--bad-soft); border-color: var(--bad); }
.flash.warn { background: var(--warn-soft); border-color: var(--warn); }
.alerts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.alerts li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 9px 0; border-top: 1px solid var(--line); }
.alerts li:first-child { border-top: 0; }
.alerts .t1 { font-weight: 600; }
.alerts .t2 { font-size: 13px; color: var(--muted); }
.note { background: var(--surface-2); border-radius: 8px; padding: 10px 12px; font-size: 13px; color: var(--muted); }

/* график смен */
.cal { border-collapse: collapse; width: 100%; font-size: 13px; table-layout: fixed; min-width: 640px; }
.cal th:first-child { width: 70px; }
.cal th, .cal td { border: 1px solid var(--line); padding: 4px; vertical-align: top; }
.cal th { background: var(--surface-2); font-weight: 600; position: sticky; top: 0; }
.cal td.day { white-space: nowrap; font-weight: 600; }
.cal tr.we td.day { color: var(--bad); }
.cal tr.today td { background: var(--accent-soft); }
.cal .slot { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal .chip span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal .chip { display: flex; justify-content: space-between; gap: 4px; align-items: center; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; font-size: 12px; text-decoration: none; color: var(--ink); }
.cal .chip.main { border-color: var(--accent); }
.cal .chip.training { border-style: dashed; }
.cal .chip.absent { text-decoration: line-through; color: var(--muted); }
.cal .add { font-size: 12px; color: var(--muted); text-decoration: none; }
.cal .add:hover { color: var(--accent); }
.cal .miss { color: var(--bad); font-size: 11px; }

/* полоски и графики */
.bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--line); min-width: 60px; }
.bar span { display: block; height: 100%; }
.chart svg { display: block; width: 100%; height: auto; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--muted); }

/* смена бариста */
.big-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.cash-sum { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; font-size: 15px; }
.cash-sum .tot { font-weight: 700; border-top: 1px solid var(--line); padding-top: 6px; }

/* строки ввода (приход, инвентаризация) */
.lines td input, .lines td select { min-height: 36px; padding: 6px 8px; }
.login-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 26px; display: flex; flex-direction: column; gap: 16px; }
.login-card .brand { font-size: 20px; }
@media print { .top, .side, .actions, .btn { display: none !important; } .main { padding: 0; } }
