/* ---------- палитра: чёрный + зелёный из логотипа «Кинзы» ---------- */
:root {
  color-scheme: dark;
  --bg: #000000;
  --surface: #121310;
  --surface-2: #1C1E17;
  --ink: #ECEFE4;
  --muted: #959D88;
  --line: #2A2D22;
  --accent: #8E9E3E;      /* зелёный из логотипа */
  --accent-hi: #AFC152;   /* светлее — для текста и обводок */
  --accent-ink: #0A0B07;
  --accent-soft: #1D2210;
  --ok: #76C48D;
  --ok-soft: #1C3123;
  --warn: #E4AA52;
  --warn-soft: #3A2E19;
  --bad: #EC7564;
  --bad-soft: #3B201C;

  --r-manager: #E3C46A;
  --r-waiter: #7FB2EE;
  --r-bartender: #EE9D5A;
  --r-host: #5FC9B9;
  --r-trainee: #B99EE3;
  --r-cook: #D6A26E;

  --radius: 14px;
  --display: 'Oswald', 'Arial Narrow', sans-serif;
  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --nav-h: 66px;
  --cell: 40px;
  --name-w: 96px;
  --kinza: url("/icons/kinza-bg.png");
}

/* цвет должности в переменной --rc */
.role-manager { --rc: var(--r-manager); }
.role-waiter { --rc: var(--r-waiter); }
.role-bartender { --rc: var(--r-bartender); }
.role-host { --rc: var(--r-host); }
.role-trainee { --rc: var(--r-trainee); }
.role-cook { --rc: var(--r-cook); }

/* ---------- основа ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg) var(--kinza) repeat;
  background-attachment: fixed;
  color: var(--ink);
  font: 15px/1.45 var(--font);
  min-height: 100dvh;
  padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0) 0 env(safe-area-inset-left, 0);
}
body.no-scroll { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent-hi); }
:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 2px; }
.hidden { display: none !important; }
h1, h2 { line-height: 1.2; margin: 0; }
.loading, .empty { color: var(--muted); padding: 32px 4px; text-align: center; }
.meta { color: var(--muted); font-size: 13px; margin: 6px 0; }
.lead { font-size: 17px; font-weight: 600; margin: 4px 0 10px; }
.page-title { font-size: 24px; font-weight: 800; letter-spacing: -0.01em; }
.sub-title { font-size: 15px; font-weight: 700; margin: 20px 0 8px; display: flex; align-items: center; gap: 8px; }
.role-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--rc, var(--muted)); display: inline-block; flex: none; }

/* ---------- кнопки ---------- */
.btn {
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  background: var(--surface-2);
  min-height: 42px;
}
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent-hi) 40%, transparent); }
.btn.ghost { background: var(--surface); border-color: var(--line); }
.btn.ghost.on { border-color: var(--accent-hi); color: var(--accent-hi); background: var(--accent-soft); }
.btn.danger { background: var(--bad-soft); color: var(--bad); }
.btn.small { min-height: 34px; padding: 6px 12px; font-size: 13px; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .55; cursor: progress; }
.icon-btn {
  border: 1px solid var(--line); background: var(--surface); border-radius: 10px;
  width: 42px; height: 42px; font-size: 22px; line-height: 1; cursor: pointer; flex: none;
}
.link { background: none; border: 0; color: var(--accent-hi); cursor: pointer; padding: 0; font-weight: 600; text-align: left; }
.row-btns { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.row-btns.tight { margin: 0; }
.row-btns .btn { flex: 1 1 auto; }
.badge { background: var(--surface-2); color: var(--muted); display: inline-block; font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 99px; white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }

/* ---------- верхняя панель / нижнее меню ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 20px;
  padding: 10px 24px;
  background: var(--surface);
  border-bottom: 2px solid var(--accent);
  min-height: 64px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 6px;
  padding: 8px 12px; border-radius: 10px; text-decoration: none; color: var(--muted); font-weight: 600;
}
.nav a[aria-current="page"] { color: var(--accent-hi); background: var(--accent-soft); }
.nav-ico { font-size: 16px; }
.nav-badge {
  background: var(--bad); color: #fff; font-size: 11px; font-weight: 800;
  min-width: 18px; height: 18px; border-radius: 9px; padding: 0 5px;
  display: inline-flex; align-items: center; justify-content: center;
}
.who { display: flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 700; font-size: 15px; text-decoration: none; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); }

.view { max-width: 980px; margin: 0 auto; padding: 18px 24px 120px; }

@media (max-width: 720px) {
  .topbar { padding: 8px 12px; }
  .who { display: none; }
  .nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: var(--surface); border-top: 1px solid var(--line);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0));
    justify-content: space-around; gap: 0;
  }
  .nav a { flex-direction: column; gap: 0; padding: 4px 8px; font-size: 11px; flex: 1; text-align: center; }
  .nav-ico { font-size: 20px; line-height: 1.2; }
  .nav-badge { position: absolute; top: 0; right: calc(50% - 22px); }
  .view { padding: 12px 10px calc(var(--nav-h) + 90px + env(safe-area-inset-bottom, 0)); }
}

/* ---------- значок-сетка ---------- */
.brand-mark { display: grid; grid-template-columns: repeat(3, 14px); gap: 3px; padding: 8px; background: var(--accent); border-radius: 14px; width: max-content; }
.brand-mark i { height: 11px; border-radius: 3px; background: color-mix(in srgb, var(--accent-ink) 30%, transparent); }
.brand-mark i.on { background: var(--accent-ink); }
.brand-mark.small { grid-template-columns: repeat(3, 7px); gap: 2px; padding: 5px; border-radius: 8px; }
.brand-mark.small i { height: 6px; border-radius: 2px; }

/* ---------- вход ---------- */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 20px; }
.login-card { width: min(380px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 28px 24px; }
.login-card h1 { font-size: 26px; font-weight: 800; margin: 18px 0 4px; }
.login-card form { margin-top: 18px; }
.form-error { color: var(--bad); font-weight: 600; min-height: 1.4em; margin: 10px 0 0; }
.fatal { max-width: 480px; margin: 15vh auto; padding: 24px; }

/* ---------- поля ---------- */
.field { display: block; margin: 12px 0; }
.field.compact { margin: 6px 0 14px; max-width: 360px; }
.field-label { display: block; font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
input:not([type=radio]):not([type=checkbox]), select, textarea {
  width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 10px;
  padding: 10px 12px; min-height: 44px; font-size: 16px; /* 16px — iPhone не зумит поле */
}
textarea { resize: vertical; }
.inline { display: flex; align-items: center; gap: 10px; }
.inline input { width: auto; flex: 1; max-width: 160px; }
.note { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; font-size: 13px; margin: 10px 0; }
.note.warn { background: var(--warn-soft); color: var(--ink); }
.comment { background: var(--surface-2); border-left: 3px solid var(--accent-hi); border-radius: 6px; padding: 8px 12px; margin: 8px 0; white-space: pre-wrap; }

/* ---------- панель недели ---------- */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.weeknav { display: flex; align-items: center; gap: 6px; }
.week-label {
  min-width: 150px; height: 42px; border: 0; background: none; cursor: pointer;
  font-size: 20px; font-weight: 800; letter-spacing: -0.01em; display: flex; flex-direction: column;
  align-items: center; justify-content: center; line-height: 1.1;
}
.week-label small { font-size: 11px; color: var(--accent-hi); font-weight: 700; }
.week-label.static { cursor: default; }
.tabs { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 3px; }
.tabs button { border: 0; background: none; padding: 7px 14px; border-radius: 8px; font-weight: 700; cursor: pointer; color: var(--muted); }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgb(0 0 0 / .08); }

.status-line { margin: 10px 0; font-size: 13px; font-weight: 600; padding-left: 10px; border-left: 3px solid var(--line); }
.status-line.open { border-color: var(--ok); }
.status-line.review { border-color: var(--warn); }
.status-line.approved { border-color: var(--accent-hi); }
.status-line.past { color: var(--muted); }

.next-shift {
  display: grid; grid-template-columns: auto 1fr; gap: 0 14px; align-items: baseline;
  background: var(--accent); color: var(--accent-ink); border-radius: var(--radius); padding: 12px 16px; margin: 10px 0 14px;
}
.ns-when { font-weight: 700; font-size: 14px; }
.ns-time { font-weight: 800; font-size: 20px; text-align: right; font-variant-numeric: tabular-nums; }
.ns-who { grid-column: 1 / -1; font-size: 13px; opacity: .85; margin-top: 2px; }

/* ---------- ТАБЛИЦА ГРАФИКА ---------- */
.grid-wrap {
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.grid { border-collapse: separate; border-spacing: 0; width: 100%; table-layout: fixed; min-width: calc(var(--name-w) + 7 * var(--cell)); }
.grid th, .grid td { padding: 0; }
.grid col, .grid thead th.corner { width: var(--name-w); }
.grid thead th {
  position: sticky; top: 0; z-index: 3; background: var(--surface);
  border-bottom: 1px solid var(--line); padding: 8px 0 6px; font-weight: 600;
}
.grid thead th.corner { position: sticky; left: 0; z-index: 4; text-align: left; padding-left: 12px; font-size: 13px; color: var(--muted); }
.grid .day { text-align: center; }
.grid .day .wd { display: block; font-size: 11px; color: var(--muted); }
.grid .day .dn { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
.grid .day.today .dn { background: var(--ink); color: var(--surface); }
/* полоса нехватки людей под датой */
.grid .day::after { content: ''; display: block; height: 3px; margin: 4px 6px 0; border-radius: 2px; background: transparent; }
.grid .day.need-short::after { background: var(--bad); }
.grid .day.need-ok::after { background: var(--ok); }
.grid .day.need-over::after { background: var(--warn); }

.grid tr.grp th {
  text-align: left; font-size: 12px; font-weight: 800; color: var(--rc);
  padding: 10px 12px 4px; background: var(--surface);
}
.grid tr.grp th span { position: sticky; left: 12px; display: inline-block; }
.grid th.name {
  position: sticky; left: 0; z-index: 2; background: var(--surface);
  text-align: left; font-weight: 600; font-size: 14px;
  padding: 0 6px 0 9px; border-left: 3px solid var(--rc);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.grid th.name span { overflow: hidden; text-overflow: ellipsis; display: block; }
.grid tr.me th.name { font-weight: 800; background: color-mix(in srgb, var(--rc) 10%, var(--surface)); }
.grid tr.me td { background: color-mix(in srgb, var(--rc) 5%, transparent); }
.grid tbody td { text-align: center; padding: 2px; }

.cell {
  position: relative; width: 100%; height: 36px; min-width: 32px;
  border: 1px solid transparent; border-radius: 8px; cursor: pointer;
  background: none; font-weight: 800; font-size: 14px; font-variant-numeric: tabular-nums;
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.cell.empty { border-color: var(--line); border-style: solid; background: transparent; }
.cell.empty:hover { background: var(--surface-2); }
.cell.kind-work { background: color-mix(in srgb, var(--rc) 30%, var(--surface)); color: color-mix(in srgb, var(--rc) 80%, var(--ink)); }
.cell.kind-off {
  color: var(--muted); font-weight: 700;
  background: repeating-linear-gradient(135deg, var(--surface-2) 0 5px, var(--surface) 5px 9px);
  border-color: var(--line);
}
.cell.draft { border: 2px dashed var(--accent-hi); opacity: .85; }
.cell.past { opacity: .55; }
.cell.today { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--ink) 25%, transparent); }
.cell.has-comment::after {
  content: ''; position: absolute; top: 3px; right: 3px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent-hi);
}
.cell.early::before {
  content: ''; position: absolute; bottom: 3px; right: 3px; width: 0; height: 0;
  border-left: 6px solid transparent; border-bottom: 6px solid currentColor; opacity: .7;
}
.cell.has-request { outline: 2px solid var(--warn); outline-offset: -2px; }
.cell.after-deadline { color: var(--bad); background: var(--bad-soft); }
.order-mode .cell.kind-work { font-size: 13px; }

.grid tfoot th, .grid tfoot td { border-top: 1px solid var(--line); font-size: 12px; padding: 6px 0; text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; }
.grid tfoot tr + tr th, .grid tfoot tr + tr td { border-top: 0; padding-top: 0; }
.grid tfoot th { position: sticky; left: 0; background: var(--surface); text-align: left; padding-left: 12px; color: var(--muted); }
.grid tfoot small { font-weight: 600; color: var(--muted); }
.grid tfoot .need-short { color: var(--bad); }
.grid tfoot .need-ok { color: var(--ok); }
.grid tfoot .need-over { color: var(--warn); }
.empty-row { padding: 28px 16px !important; color: var(--muted); }

.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--muted); margin: 10px 2px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 20px; border-radius: 5px; font-size: 11px; padding: 0 3px; }
.lg.work { background: color-mix(in srgb, var(--r-waiter) 20%, var(--surface)); color: var(--r-waiter); }
.lg.off { background: repeating-linear-gradient(135deg, var(--surface-2) 0 4px, var(--surface) 4px 7px); border: 1px solid var(--line); }
.lg.draft { border: 2px dashed var(--accent-hi); }
.lg.dot { min-width: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent-hi); }

.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

.submit-bar {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 25;
  bottom: calc(18px + env(safe-area-inset-bottom, 0));
  width: min(560px, calc(100% - 20px));
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent-hi);
  border-radius: 14px; padding: 10px 10px 10px 16px; box-shadow: 0 8px 28px rgb(0 0 0 / .6);
}
.submit-bar .btn.primary { background: var(--ink); color: var(--bg); }
@media (max-width: 720px) {
  .submit-bar { bottom: calc(var(--nav-h) + 12px + env(safe-area-inset-bottom, 0)); }
}

/* узкий телефон: всё в один экран по ширине */
@media (max-width: 420px) {
  :root { --name-w: 78px; --cell: 36px; }
  .grid th.name { font-size: 13px; padding-left: 6px; }
  .cell { height: 34px; min-width: 0; font-size: 13px; border-radius: 7px; }
  .grid tbody td { padding: 2px 1px; }
  .grid .day .dn { width: 26px; height: 26px; font-size: 14px; }
  .week-label { font-size: 18px; min-width: 120px; }
  .actions .btn { flex: 1 1 100%; }
}

/* ---------- окно ---------- */
.sheet-wrap {
  position: fixed; inset: 0; z-index: 50; background: rgb(15 10 20 / 0);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  transition: background .2s;
}
.sheet-wrap.open { background: rgb(15 10 20 / .45); }
.sheet {
  width: min(480px, 100%); max-height: min(88dvh, 760px); overflow: auto;
  background: var(--surface); border-radius: 18px; padding: 0 18px 18px;
  transform: translateY(12px); opacity: 0; transition: transform .2s, opacity .2s;
}
.sheet-wrap.open .sheet { transform: none; opacity: 1; }
.sheet-head {
  position: sticky; top: 0; background: var(--surface); z-index: 1;
  display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 0 8px;
}
.sheet-head h2 { font-size: 18px; font-weight: 800; }
.sheet-head .icon-btn { width: 36px; height: 36px; font-size: 16px; }
@media (max-width: 720px) {
  .sheet-wrap { align-items: flex-end; padding: 0; }
  .sheet { width: 100%; border-radius: 18px 18px 0 0; padding-bottom: calc(18px + env(safe-area-inset-bottom, 0)); transform: translateY(40px); }
}
@media (prefers-reduced-motion: reduce) {
  .sheet, .sheet-wrap { transition: none; }
}

.seg { display: flex; border: 0; padding: 3px; margin: 12px 0; background: var(--surface-2); border-radius: 12px; }
.seg label { flex: 1; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; text-align: center; padding: 10px 4px; border-radius: 9px; font-weight: 700; cursor: pointer; color: var(--muted); }
.seg input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgb(0 0 0 / .1); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 7px 14px; font-weight: 700; cursor: pointer; font-size: 14px; }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent-hi); }

.move { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.move select { width: auto; flex: 1; }

.radio-cards { border: 0; padding: 0; margin: 4px 0 8px; display: grid; gap: 8px; }
.radio-card { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--line); border-radius: 12px; padding: 12px; cursor: pointer; }
.radio-card:has(input:checked) { border-color: var(--accent-hi); background: var(--accent-soft); }
.radio-card input { margin-top: 3px; accent-color: var(--accent); }
.radio-card b { display: block; }
.radio-card small { color: var(--muted); }

.needs-wrap { overflow-x: auto; }
.needs { border-collapse: collapse; width: 100%; }
.needs th { font-size: 13px; text-align: left; padding: 4px 6px; white-space: nowrap; }
.needs td { padding: 3px; }
.needs input { min-height: 38px; padding: 6px; text-align: center; min-width: 52px; }
.needs .all-days th, .needs .all-days td { border-bottom: 1px solid var(--line); padding-bottom: 8px; }

.order-list { padding: 0; margin: 10px 0; list-style: none; counter-reset: q; }
.order-list li {
  counter-increment: q; display: grid; grid-template-columns: 28px 1fr auto; gap: 2px 8px;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.order-list li::before { content: counter(q); grid-row: span 2; font-weight: 800; color: var(--rc); }
.ol-name { font-weight: 700; }
.ol-time { font-size: 13px; color: var(--muted); text-align: right; }
.ol-days { grid-column: 2 / -1; font-size: 13px; }

/* ---------- часы ---------- */
.totals { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 10px; margin: 14px 0; }
.total { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.total.main { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.total.soft { background: transparent; }
.t-num { display: block; font-size: 30px; font-weight: 800; line-height: 1.05; font-variant-numeric: tabular-nums; }
.t-lbl { font-size: 13px; opacity: .85; }
@media (max-width: 420px) {
  .totals { grid-template-columns: 1fr 1fr; }
  .total.main { grid-column: 1 / -1; }
}
.shift-list { list-style: none; padding: 0; margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.shift-list li { display: grid; grid-template-columns: 110px 1fr auto; gap: 8px; align-items: center; padding: 11px 14px; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.shift-list li:first-child { border-top: 0; }
.shift-list li.future { color: var(--muted); }
.sl-day { font-weight: 700; }
.sl-h { font-weight: 800; }
.table-scroll { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-top: 14px; }
.team { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.team th, .team td { padding: 10px 14px; text-align: right; border-top: 1px solid var(--line); }
.team thead th { border-top: 0; font-size: 12px; color: var(--muted); }
.team th[scope=row], .team thead th:first-child { text-align: left; border-left: 3px solid var(--rc, transparent); }
.team th[scope=row] small { display: block; color: var(--muted); font-weight: 500; font-size: 12px; }

/* ---------- запросы ---------- */
.req-list { list-style: none; padding: 0; margin: 14px 0; display: grid; gap: 10px; }
.req { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--rc); border-radius: var(--radius); padding: 12px 14px; }
.req-list.done .req { opacity: .7; }
.req-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.req-top small { color: var(--muted); }
.req-day { font-weight: 700; margin-left: auto; }
.req-change { display: grid; gap: 2px; margin: 8px 0; font-size: 14px; }
.req-change .was { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 50%, transparent); }
.req-change .now { font-weight: 700; }
.req-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---------- команда ---------- */
.title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.staff-list { list-style: none; padding: 0; margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.staff-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px 8px 14px; border-top: 1px solid var(--line); }
.staff-list li:first-child { border-top: 0; }
.s-name { font-weight: 600; }
.s-name small { color: var(--muted); font-weight: 500; }
.removed { margin-top: 22px; }
.removed summary { cursor: pointer; color: var(--muted); font-weight: 700; margin-bottom: 8px; }

/* ---------- профиль ---------- */
.profile { max-width: 480px; }
.who-line { display: flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 600; margin: 6px 0 18px; }
.card-block { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 16px 16px; margin-bottom: 14px; }
.card-block p { margin: 6px 0; font-size: 14px; }

/* ---------- уведомление ---------- */
.toast {
  position: fixed; left: 50%; top: calc(14px + env(safe-area-inset-top, 0)); z-index: 60;
  transform: translate(-50%, -20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--surface); padding: 10px 16px; border-radius: 12px;
  font-weight: 700; font-size: 14px; max-width: calc(100% - 24px); transition: transform .2s, opacity .2s;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast.bad { background: var(--bad); color: #fff; }
.toast.warn { background: var(--warn); color: #fff; }


/* ---------- профиль ---------- */
.profile { max-width: 720px; }
.back { display: inline-block; margin-bottom: 10px; font-weight: 700; text-decoration: none; }
.hero {
  display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--rc);
  border-radius: var(--radius); padding: 20px; margin-bottom: 14px;
}
.avatar {
  width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center;
  font-size: 28px; font-weight: 800; color: var(--bg); background: var(--rc);
  box-shadow: 0 0 0 4px var(--surface), 0 0 0 6px color-mix(in srgb, var(--rc) 50%, transparent);
}
.hero h1 { font-size: 26px; font-weight: 800; }
.hero-role { margin: 2px 0 0; color: var(--rc); font-weight: 700; }
.hero-stats { display: flex; gap: 18px; text-align: center; }
.hero-stats b { display: block; font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.hero-stats span { font-size: 12px; color: var(--muted); }
@media (max-width: 560px) {
  .hero { grid-template-columns: auto 1fr; }
  .hero-stats { grid-column: 1 / -1; justify-content: space-around; border-top: 1px solid var(--line); padding-top: 12px; }
}
.block-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.block-head .sub-title { margin: 14px 0 8px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 6px 0; }
.facts div { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; }
.facts dt { font-size: 12px; color: var(--muted); font-weight: 700; }
.facts dd { margin: 2px 0 0; font-weight: 700; }
.muted { color: var(--muted); font-weight: 500; }
.about { white-space: pre-wrap; margin: 12px 0 4px; }
.progress { height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; margin: 2px 0 12px; }
.progress i { display: block; height: 100%; background: var(--accent-hi); border-radius: 4px; }
.courses { list-style: none; padding: 0; margin: 0; }
.course { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center; padding: 11px 0; border-top: 1px solid var(--line); }
.course:first-child { border-top: 0; }
.c-mark {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  border: 2px solid var(--line); font-size: 13px; font-weight: 800;
}
.course.st-done .c-mark { background: var(--ok); border-color: var(--ok); color: var(--bg); }
.course.st-progress .c-mark { border-color: var(--warn); color: var(--warn); }
.c-text b { display: block; }
.c-text small { display: block; color: var(--muted); font-size: 13px; }
.c-text .c-note { color: var(--accent-hi); }

.page-title.small { font-size: 19px; }
.courses-head { margin-top: 30px; }
.checks { border: 0; padding: 0; margin: 12px 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.checks legend { margin-bottom: 6px; }
.checks label { display: flex; align-items: center; gap: 8px; background: var(--surface-2); padding: 8px 10px; border-radius: 10px; cursor: pointer; }
.checks input { accent-color: var(--accent-hi); width: 18px; height: 18px; }
.staff-list a.s-name { color: var(--ink); text-decoration: none; }
.staff-list a.s-name:hover { color: var(--accent-hi); }
.staff-list li.muted { padding: 12px 14px; }

/* ---------- большой экран: всё крупнее ---------- */
@media (min-width: 900px) {
  :root { --name-w: 190px; --cell: 64px; }
  body { font-size: 16px; }
  .topbar { padding: 12px 32px; }
  .brand { font-size: 20px; }
  .nav a { padding: 10px 16px; font-size: 16px; }
  .view { max-width: 1280px; padding: 24px 32px 120px; }
  .week-label { font-size: 26px; min-width: 210px; }
  .page-title { font-size: 30px; }
  .grid thead th { padding: 12px 0 8px; }
  .grid thead th.corner { font-size: 15px; padding-left: 16px; }
  .grid .day .wd { font-size: 13px; }
  .grid .day .dn { width: 38px; height: 38px; font-size: 19px; }
  .grid th.name { font-size: 16px; padding-left: 14px; }
  .grid tr.grp th { font-size: 13px; padding: 14px 16px 6px; }
  .grid tbody td { padding: 3px 4px; }
  .cell { height: 48px; font-size: 17px; border-radius: 10px; }
  .grid tfoot th, .grid tfoot td { font-size: 14px; padding: 9px 0; }
  .next-shift { padding: 16px 22px; }
  .ns-when { font-size: 16px; }
  .ns-time { font-size: 26px; }
  .ns-who { font-size: 15px; }
  .status-line { font-size: 15px; }
  .legend { font-size: 14px; }
  .btn { font-size: 15px; min-height: 46px; padding: 11px 18px; }
}


/* ---------- фирменный стиль «Кинзы» ---------- */
.page-title, .week-label, .hero h1, .login-card h1, .brand span, .t-num, .ns-time, .dish h2 {
  font-family: var(--display); font-weight: 600; letter-spacing: .01em;
}
.page-title { text-transform: none; }
.brand { text-decoration: none; color: var(--ink); }
.brand img { height: 36px; width: auto; }
.brand span { font-size: 22px; letter-spacing: .06em; }
@media (min-width: 900px) { .brand img { height: 44px; } }
.login-logo { width: 150px; height: auto; display: block; margin: 0 auto 4px; }
.login-card { text-align: center; }
.login-card form { text-align: left; }
.next-shift { color: var(--accent-ink); }
.total.main { color: var(--accent-ink); }
.nav-badge { margin-left: 2px; }

/* баннер запросов у менеджера */
.req-banner {
  width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; cursor: pointer;
  background: var(--warn-soft); color: var(--ink); border: 1px solid var(--warn); border-radius: var(--radius);
  padding: 12px 16px; margin: 0 0 12px; font-weight: 600;
}
.req-banner b { font-size: 20px; color: var(--warn); font-family: var(--display); }
.req-banner span { margin-left: auto; color: var(--warn); font-weight: 800; }
.req-box { border: 1px solid var(--warn); background: var(--warn-soft); border-radius: 12px; padding: 4px 12px 12px; margin: 10px 0; }
.req-box .row-btns { margin-top: 8px; }

/* ---------- методичка ---------- */
.guide .tabs { margin: 12px 0; }
.search { margin: 4px 0 10px; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips.scroll .chip { flex: none; }
.without { margin: 6px 0 14px; }
.chip.allergen[aria-pressed="true"] { background: var(--bad); border-color: var(--bad); color: #fff; text-decoration: line-through; }
.dish-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.dish {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; cursor: pointer; display: flex; flex-direction: column; gap: 8px;
}
.dish:hover { border-color: var(--accent); }
.dish header small { color: var(--accent-hi); font-weight: 700; font-size: 12px; }
.dish h2 { font-size: 22px; margin: 2px 0 0; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tag { font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 99px; background: var(--surface-2); color: var(--muted); }
.tag.t-хит { background: var(--accent); color: var(--accent-ink); }
.tag.t-острое { background: var(--bad-soft); color: var(--bad); }
.tag.t-вегетарианское { background: var(--ok-soft); color: var(--ok); }
.dish-desc { margin: 0; font-style: italic; color: var(--ink); line-height: 1.5; }
.dish-desc.big { font-size: 17px; }
.dish-comp { margin: 0; font-size: 14px; color: var(--muted); }
.dish-comp b { color: var(--ink); }
.allergens { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.al { font-size: 12px; font-weight: 800; padding: 3px 9px; border-radius: 6px; background: var(--warn-soft); color: var(--warn); }
.al.none { background: var(--ok-soft); color: var(--ok); }
.articles { display: grid; gap: 8px; }
.article { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 16px; }
.article summary { cursor: pointer; font-weight: 700; padding: 14px 0; }
.article[open] summary { color: var(--accent-hi); }
.article-body { white-space: pre-wrap; line-height: 1.6; padding-bottom: 12px; }
.article .btn { margin-bottom: 14px; }

.nav-badge[hidden] { display: none; }
.brand img { height: 34px; }
@media (min-width: 900px) { .brand img { height: 38px; } }
.next-shift {
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--accent); border-left: 5px solid var(--accent);
}
.ns-time { color: var(--accent-hi); }
.ns-who { opacity: 1; color: var(--muted); }

/* опоздание — всё в одну строку */
.chips.one-line { flex-wrap: nowrap; gap: 6px; }
.chips.one-line .chip { flex: 1 1 0; padding: 8px 4px; font-size: 14px; white-space: nowrap; text-align: center; }
.grid tfoot tr.need-caption th {
  position: static; text-align: left; font-size: 12px; font-weight: 600; color: var(--muted);
  padding: 10px 12px 4px; border-top: 1px solid var(--line);
}
.grid tfoot tr.need-caption + tr th, .grid tfoot tr.need-caption + tr td { border-top: 0; }


/* ---------- итог «сколько на смене» ---------- */
.grid tfoot tr.need-caption th { font-size: 13px; color: var(--ink); font-weight: 700; padding-top: 12px; }
.grid tfoot tr.need-row th { font-size: 13px; color: var(--muted); }
.need-pill {
  display: inline-flex; align-items: baseline; justify-content: center; min-width: 34px;
  padding: 4px 6px; border-radius: 8px; font-size: 15px; font-weight: 800; background: var(--surface-2); color: var(--ink);
}
.need-pill small { font-size: 12px; font-weight: 700; opacity: .75; }
.need-pill.need-short { background: var(--bad-soft); color: var(--bad); }
.need-pill.need-ok { background: var(--ok-soft); color: var(--ok); }
.need-pill.need-over { background: var(--warn-soft); color: var(--warn); }
.grid tfoot td { padding: 6px 2px 10px; }
@media (min-width: 900px) {
  .need-pill { font-size: 18px; min-width: 48px; padding: 6px 10px; }
  .need-pill small { font-size: 14px; }
  .grid tfoot tr.need-caption th { font-size: 15px; }
}
@media (max-width: 420px) {
  .need-pill { min-width: 0; width: 100%; padding: 4px 2px; font-size: 14px; }
  .need-pill small { font-size: 11px; }
}

/* ---------- методичка v2 ---------- */
.tabs.big { display: flex; width: 100%; }
.tabs.big button { flex: 1; padding: 10px 8px; font-size: 15px; }
.menu-tabs { display: flex; margin: 0 0 10px; }
.menu-tabs button { flex: 1; }
.flags { margin: 4px 0 12px; }
.chip.flag[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent-hi); }
.flag-note { margin-top: -4px; }
.dish-meta { display: inline-block; margin-top: 4px; font-size: 13px; font-weight: 700; color: var(--muted); }
.dish-flags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: auto; }
.mk { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 6px; background: var(--surface-2); color: var(--muted); }
.mk.f-острое { background: var(--bad-soft); color: var(--bad); }
.mk.f-вегетарианское { background: var(--ok-soft); color: var(--ok); }
.dish-comp { -webkit-line-clamp: 3; display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.dish .dish-desc { -webkit-line-clamp: 4; display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.info { border-radius: 12px; padding: 10px 14px; margin: 10px 0; background: var(--surface-2); }
.info p { margin: 4px 0 0; line-height: 1.5; }
.info-label { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.info.important { background: var(--bad-soft); }
.info.important .info-label { color: var(--bad); }
.info.script { background: var(--accent-soft); border-left: 3px solid var(--accent-hi); }
.info.script p { font-style: italic; color: var(--accent-hi); font-size: 16px; }
.info.script .info-label { color: var(--accent-hi); }
.info.upsell { background: var(--warn-soft); }
.info.upsell .info-label { color: var(--warn); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grp-title { margin-top: 22px; color: var(--accent-hi); }
.article-body h3 { font-family: var(--display); font-weight: 600; font-size: 18px; margin: 16px 0 6px; }
.article-body p { margin: 6px 0; white-space: normal; }
.article-body ul { margin: 6px 0; padding-left: 20px; }
.article-body li { margin: 3px 0; }
.article-body .say {
  background: var(--accent-soft); border-left: 3px solid var(--accent-hi); border-radius: 8px;
  padding: 8px 12px; font-style: italic; color: var(--accent-hi);
}
.article-body .good { color: var(--ok); }
.article-body .good::before { content: '✓ '; font-weight: 800; }
.article-body .bad { color: var(--bad); }
.article-body .bad::before { content: '✗ '; font-weight: 800; }
.article-body { white-space: normal; }

.grid tfoot tr.need-row th { padding-left: 14px; }
.flags .chips { flex-wrap: wrap; overflow: visible; }
.flags .chip { padding: 6px 11px; font-size: 13px; }
.sheet .dish-flags { margin: 6px 0 10px; }


/* ================= «Сочные плашки» ================= */
:root {
  --r-manager: #E8C65A;
  --r-waiter: #6FA8F5;
  --r-bartender: #F59A4A;
  --r-host: #4FD1BC;
  --r-trainee: #C4A3FF;
  --r-cook: #E0A56E;
}
/* полоски под датами убраны — нехватку показывают цифры внизу */
.grid .day::after { display: none; }
.grid .day.today .dn { background: var(--accent-hi); color: var(--bg); }
.grid .day.today .wd { color: var(--accent-hi); }
.grid td.td-today { background: rgb(169 187 78 / .07); }

/* клетки */
.cell { border: 0; font-weight: 800; color: var(--ink); }
.cell.kind-work { background: var(--rc); color: #101208; }
.cell.kind-off { background: #2B2E26; color: #A3A897; font-size: 11px; font-weight: 700; border: 0; }
.cell.empty { background: transparent; border: 1px solid #262A20; }
.cell.empty:hover { background: #1A1D15; border-color: #3A3F30; }
.cell.draft { background: transparent; border: 2px dashed var(--rc); color: var(--rc); opacity: 1; }
.cell.past { opacity: .45; }
.cell.today { box-shadow: none; }
.cell.has-comment::after { background: #fff; box-shadow: 0 0 0 1.5px #101208; }
.cell.kind-off.has-comment::after { box-shadow: none; }
.cell.early::before { display: none; }
.cell.has-request { outline: none; box-shadow: 0 0 0 2px #FFB020; }
.cell.after-deadline { background: var(--bad); color: #fff; }

/* имя и группа */
.grid tr.grp th { color: var(--rc); }
.grid th.name { border-left: 4px solid var(--rc); }
.grid tr.me th.name { color: var(--accent-hi); background: color-mix(in srgb, var(--accent-hi) 12%, var(--surface)); }
.grid tr.me td { background: color-mix(in srgb, var(--accent-hi) 5%, transparent); }
.me-tag {
  font-style: normal; font-size: 10px; font-weight: 800; margin-left: 5px; padding: 1px 5px;
  border-radius: 5px; background: var(--accent-hi); color: var(--bg); vertical-align: 1px;
}

/* легенда как в клетках */
.legend { gap: 8px 16px; color: var(--muted); }
.lg { min-width: 28px; height: 22px; border-radius: 6px; font-size: 11px; font-weight: 800; border: 0; }
.lg.l-work { background: var(--r-waiter); color: #101208; }
.lg.l-off { background: #2B2E26; color: #A3A897; }
.lg.l-draft { background: transparent; border: 2px dashed var(--r-waiter); color: var(--r-waiter); }
.lg.l-note { min-width: 10px; width: 10px; height: 10px; border-radius: 50%; background: #fff; }

.grid tfoot tr.need-row th { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 8px; }
