/* Justo · Чек-лист кафе — токени дизайн-системи Justo + компоненти сервісу (лише світла тема) */
@import url("https://fonts.googleapis.com/css2?family=Onest:wght@400;500;600;700;800&family=Golos+Text:wght@400;500;600&display=swap");

:root {
  --brand-orange: #E98538; --brand-orange-strong: #D9752A; --brand-orange-soft: #FBEDDF;
  --brand-green: #9EC048; --brand-green-strong: #8CB13A; --brand-green-soft: #F0F5E1; --brand-green-deep: #6FA332;
  --accent-teal: #4AA79B; --accent-teal-soft: #E3F1EF; --accent-blue: #6292CC; --accent-blue-soft: #E8EFF8;
  --accent-sand: #C8A96E; --accent-sand-soft: #F6EFE1;
  --success: #6FA332; --success-soft: #F0F5E1; --warning: #C9862E; --warning-soft: #F9EEDC;
  --error: #D2543F; --error-soft: #FAE7E3; --info: #4E8FBF; --info-soft: #E8EFF8;
  --ink-900: #23241F; --ink-700: #45463E; --ink-500: #6B685D; --ink-400: #9B998E; --ink-300: #B9B7AC;
  --ink-200: #D8D6CC; --ink-150: #E7E5DC; --ink-100: #F1F0EA; --ink-50: #F8F7F2;
  --surface-page: #FBFAF7; --surface-card: #FFFFFF; --surface-raised: #FFFFFF; --surface-sunken: #F1F0EA;
  --text-primary: #23241F; --text-secondary: #6B685D; --text-muted: #9B998E; --text-on-brand: #FFFFFF;
  --border-default: #E7E5DC; --border-strong: #D8D6CC; --focus-ring: rgba(233, 133, 56, 0.45);

  --font-display: "Onest", "Helvetica Neue", sans-serif;
  --font-body: "Golos Text", "Helvetica Neue", sans-serif;

  --corner-xs: 2px 8px 8px 8px; --corner-sm: 3px 10px 10px 10px; --corner-md: 4px 16px 16px 16px;
  --corner-lg: 6px 24px 24px 24px; --corner-xl: 8px 28px 28px 28px;
  --shadow-sm: 0 1px 3px rgba(35, 36, 31, 0.07); --shadow-md: 0 2px 12px rgba(35, 36, 31, 0.08);
  --shadow-lg: 0 8px 32px rgba(35, 36, 31, 0.14);
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1); --duration-fast: 120ms; --duration-normal: 220ms;
}
/* ── База ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--surface-page); color: var(--text-primary);
  font-family: var(--font-body); font-size: 16px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; margin: 0; text-wrap: balance; }
h1 { font-size: 28px; font-weight: 800; letter-spacing: -0.01em; }
h2 { font-size: 18px; font-weight: 700; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.num { font-family: var(--font-display); font-variant-numeric: tabular-nums; }
.muted { color: var(--text-secondary); }
.small { font-size: 14px; }
.eyebrow {
  font-family: var(--font-body); font-size: 12px; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--brand-green-deep);
}
.eyebrow.is-muted { color: var(--text-muted); }
.icon { width: 20px; height: 20px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 28px; height: 28px; }
.row { display: flex; align-items: center; gap: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.grow { flex: 1; min-width: 0; }

/* ── Кнопки ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px;
  font-family: var(--font-display); font-weight: 600; font-size: 15px; padding: 9px 22px;
  border-radius: 4px 14px 14px 14px; border: 2px solid transparent;
  background: var(--brand-orange); color: var(--text-on-brand); text-decoration: none; white-space: nowrap;
  transition: background var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out);
}
.btn:hover { background: var(--brand-orange-strong); }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn:disabled:hover { background: var(--brand-orange); }
.btn-lg { min-height: 52px; font-size: 16px; padding: 12px 28px; border-radius: 4px 18px 18px 18px; }
.btn-sm { min-height: 36px; font-size: 14px; padding: 5px 14px; border-radius: 3px 10px 10px 10px; }
.btn-block { width: 100%; }
.btn-secondary { background: transparent; color: var(--text-primary); border-color: var(--border-strong); }
.btn-secondary:hover, .btn-secondary:disabled:hover { background: var(--surface-sunken); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover, .btn-ghost:disabled:hover { background: var(--surface-sunken); }
.btn-danger { background: #D2543F; color: #fff; }
.btn-danger:hover { background: #B94734; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0;
  border: none; background: transparent; color: var(--text-secondary); border-radius: var(--corner-sm);
  transition: background var(--duration-fast) var(--ease-out);
}
.icon-btn:hover { background: var(--surface-sunken); color: var(--text-primary); }
.icon-btn.is-danger:hover { background: var(--error-soft); color: var(--error); }

/* ── Картки, бейджі, вкладки ──────────────────────────────────────────── */
.card {
  background: var(--surface-card); border: 1px solid var(--border-default);
  border-radius: var(--corner-lg); box-shadow: var(--shadow-sm); padding: 20px;
}
.card-md { border-radius: var(--corner-md); padding: 16px; }
.badge {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; line-height: 1.5;
  padding: 3px 10px; border-radius: var(--corner-xs); background: var(--surface-sunken); color: var(--text-secondary);
  white-space: nowrap;
}
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-error { background: var(--error-soft); color: var(--error); }
.badge-brand { background: var(--brand-orange-soft); color: var(--brand-orange-strong); }
.badge-info { background: var(--info-soft); color: var(--info); }
.tile {
  display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; flex-shrink: 0;
  border-radius: var(--corner-sm); background: var(--brand-green-soft); color: var(--brand-green-deep);
}
.tile-orange { background: var(--brand-orange-soft); color: var(--brand-orange-strong); }
.tile-lg { width: 60px; height: 60px; border-radius: var(--corner-md); }
.tabs { display: flex; gap: 4px; background: var(--surface-sunken); padding: 4px; border-radius: 4px 14px 14px 14px; }
.tabs button {
  flex: 1; min-height: 40px; font-family: var(--font-display); font-size: 14px; font-weight: 600; padding: 6px 14px;
  border: none; border-radius: var(--corner-sm); background: transparent; color: var(--text-secondary); white-space: nowrap;
  transition: background var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out);
}
.tabs button[aria-selected="true"] { background: var(--surface-card); color: var(--text-primary); box-shadow: var(--shadow-sm); }
.tabs-fit { width: fit-content; }
.tabs-fit button { flex: none; }

/* ── Форми ────────────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span, .label { font-size: 14px; font-weight: 500; color: var(--text-primary); }
.input, .select {
  width: 100%; min-height: 48px; padding: 10px 14px; font-size: 16px; background: var(--surface-card);
  border: 1.5px solid var(--border-strong); border-radius: 3px 12px 12px 12px; color: var(--text-primary);
  transition: border-color var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out);
}
.input::placeholder { color: var(--text-muted); }
.input:focus, .select:focus { outline: none; border-color: var(--brand-orange); box-shadow: 0 0 0 3px var(--focus-ring); }
.input.is-error { border-color: var(--error); }
.field-error { font-size: 13px; color: var(--error); }

/* ── Шапка ────────────────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 20; background: var(--surface-card); border-bottom: 1px solid var(--border-default);
}
.topbar-inner { display: flex; align-items: center; gap: 12px; padding: 10px 16px; margin: 0 auto; }
.logo { height: 34px; width: auto; display: block; }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--text-muted); }
.live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-300); }
.live.is-on { color: var(--success); }
.live.is-on::before { background: var(--brand-green); }
.meter { height: 6px; background: var(--surface-sunken); border-radius: 999px; overflow: hidden; margin-top: 8px; }
.meter i { display: block; height: 100%; background: var(--brand-green); border-radius: 999px; transition: width var(--duration-normal) var(--ease-out); }
.meter.is-high i { background: var(--brand-orange); }
.meter.is-full i { background: var(--error); }
.login { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.login .card { width: 100%; max-width: 400px; padding: 28px; }
.login .logo { height: 56px; align-self: flex-start; margin-bottom: 4px; }
.link-box { display: flex; gap: 8px; align-items: center; }
.link-box .input { font-size: 14px; min-height: 44px; color: var(--text-secondary); }
.qr { display: block; width: 180px; height: 180px; background: #fff; padding: 10px; border-radius: var(--corner-md); border: 1px solid var(--border-default); }
.report-pre {
  margin: 0; padding: 14px; background: var(--surface-sunken); border-radius: var(--corner-sm); font-family: var(--font-body);
  font-size: 13px; line-height: 1.5; white-space: pre-wrap; max-height: 280px; overflow: auto;
}
.divider { height: 1px; background: var(--border-default); margin: 18px 0; border: none; }
/* ── Діалог і тост ────────────────────────────────────────────────────── */
.overlay {
  position: fixed; inset: 0; z-index: 100; background: rgba(35, 36, 31, 0.45); display: flex; align-items: center;
  justify-content: center; padding: 16px; animation: fade var(--duration-normal) var(--ease-out);
}
.dialog {
  background: var(--surface-raised); border-radius: var(--corner-xl); box-shadow: var(--shadow-lg); padding: 24px;
  width: 100%; max-width: 440px; max-height: calc(100dvh - 32px); overflow: auto;
  animation: rise var(--duration-normal) var(--ease-out);
}
.dialog h2 { font-size: 20px; }
.dialog-body { margin-top: 14px; display: flex; flex-direction: column; gap: 14px; }
.dialog-body > p { color: var(--text-secondary); font-size: 15px; }
.dialog-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; }
.toasts { position: fixed; left: 16px; right: 16px; top: 72px; z-index: 200; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast {
  display: flex; gap: 12px; align-items: flex-start; background: #23241F; color: #F4F3EE; padding: 13px 16px;
  border-radius: 4px 14px 14px 14px; box-shadow: var(--shadow-lg); width: 100%; max-width: 380px; font-size: 14px;
  animation: rise var(--duration-normal) var(--ease-out);
}
.toast::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--brand-green); margin-top: 7px; flex-shrink: 0; }
.toast.is-error::before { background: #D2543F; }
.skeleton { height: 96px; border-radius: var(--corner-md); background: var(--surface-sunken); }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ── Веб-застосунок співробітника ─────────────────────────────────────── */
.app { max-width: 600px; margin: 0 auto; padding: 20px 16px calc(40px + env(safe-area-inset-bottom)); }
.app-top .topbar-inner { max-width: 600px; }
.hero { margin: 4px 0 20px; }
.hero h1 { margin: 6px 0 8px; }
.who-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.who-tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 14px; min-height: 124px; padding: 16px; text-align: left;
  background: var(--surface-card); border: 1.5px solid var(--border-default); border-radius: var(--corner-lg); box-shadow: var(--shadow-sm);
  font-family: var(--font-display); font-weight: 700; font-size: 18px; line-height: 1.2;
  transition: border-color var(--duration-fast) var(--ease-out), background var(--duration-fast) var(--ease-out);
}
.who-tile:hover, .who-tile:active { border-color: var(--brand-orange); background: var(--brand-orange-soft); }
.avatar {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; flex-shrink: 0;
  border-radius: var(--corner-sm); background: var(--brand-green-soft); color: var(--brand-green-deep);
  font-family: var(--font-display); font-weight: 800; font-size: 17px; letter-spacing: 0.02em;
}
.avatar-lg { width: 60px; height: 60px; font-size: 22px; border-radius: var(--corner-md); }

.pin-card { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; padding: 28px 20px 24px; }
.pin-dots { display: flex; gap: 14px; margin: 6px 0 2px; }
.pin-dots i { width: 18px; height: 18px; border-radius: 2px 7px 7px 7px; border: 2px solid var(--border-strong); background: transparent; }
.pin-dots i.is-on { background: var(--brand-orange); border-color: var(--brand-orange); }
.pin-dots.is-error i { border-color: var(--error); }
.pin-dots.is-error { animation: shake 320ms var(--ease-out); }
.pin-msg { min-height: 21px; font-size: 14px; color: var(--error); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; max-width: 320px; }
.keypad button {
  min-height: 64px; border: 1.5px solid var(--border-default); background: var(--surface-card); border-radius: var(--corner-md);
  font-family: var(--font-display); font-weight: 700; font-size: 26px; font-variant-numeric: tabular-nums; color: var(--text-primary);
  display: inline-flex; align-items: center; justify-content: center; box-shadow: var(--shadow-sm);
}
.keypad button:active { background: var(--brand-orange-soft); border-color: var(--brand-orange); }
.keypad button.is-ghost { border-color: transparent; background: transparent; box-shadow: none; color: var(--text-secondary); font-size: 15px; font-weight: 600; }
.keypad button:disabled { opacity: 0.45; }
@keyframes shake { 20% { transform: translateX(-7px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }

.status-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.panel {
  background: var(--surface-card); border: 1px solid var(--border-default); border-radius: var(--corner-md);
  box-shadow: var(--shadow-sm); padding: 14px 16px; min-width: 0;
}
.panel .label { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: var(--text-secondary); }
.panel .value { font-family: var(--font-display); font-weight: 800; font-size: 26px; line-height: 1.2; font-variant-numeric: tabular-nums; margin-top: 4px; }
.panel .value small { font-size: 15px; font-weight: 600; color: var(--text-muted); }
.panel .hint { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.timer.is-ok { border-color: var(--brand-green); background: var(--success-soft); }
.timer.is-ok .label, .timer.is-ok .value { color: #4F7A1E; }
.timer.is-warn { border-color: var(--warning); background: var(--warning-soft); }
.timer.is-warn .label, .timer.is-warn .value { color: #8E5B14; }
.timer.is-late { border-color: var(--error); background: var(--error-soft); }
.timer.is-late .label, .timer.is-late .value { color: #A93B28; }
.meter { height: 8px; }

.tasks { display: grid; gap: 10px; list-style: none; margin: 0; padding: 0; }
.task {
  width: 100%;
  background: var(--surface-card); border: 1.5px solid var(--border-default); border-radius: var(--corner-md); box-shadow: var(--shadow-sm);
  transition: border-color var(--duration-fast) var(--ease-out), background var(--duration-fast) var(--ease-out);
}
.task .box {
  display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; flex-shrink: 0;
  border: 2px solid var(--border-strong); border-radius: 3px 10px 10px 10px; background: var(--surface-card); color: transparent;
  transition: background var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out);
}
.task .text { flex: 1; min-width: 0; font-size: 17px; font-weight: 500; line-height: 1.35; overflow-wrap: anywhere; }
.task .when { font-family: var(--font-display); font-size: 13px; font-weight: 600; color: var(--brand-green-deep); font-variant-numeric: tabular-nums; white-space: nowrap; }
.success { text-align: center; padding: 32px 22px; display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 18px; border-color: var(--brand-green); }
.success h1 { font-size: 26px; }
.success p { color: var(--text-secondary); max-width: 36ch; }
.tile-success { background: var(--brand-green-deep); color: #fff; }
.state-card { text-align: center; padding: 32px 22px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.state-card h2 { font-size: 22px; font-weight: 800; }
.state-card p { color: var(--text-secondary); max-width: 36ch; }
.footer-note { margin-top: 28px; text-align: center; font-size: 12px; color: var(--text-muted); }
.who-chip { display: inline-flex; align-items: center; gap: 8px; min-width: 0; font-size: 14px; font-weight: 500; color: var(--text-secondary); }
.who-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Адмін-панель ─────────────────────────────────────────────────────── */
.admin { max-width: 1200px; margin: 0 auto; padding: 20px 16px 96px; }
.admin-top .topbar-inner { max-width: 1200px; }
.nav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; margin: 0 auto; max-width: 1200px; padding: 0 12px; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 14px; white-space: nowrap; text-decoration: none;
  font-family: var(--font-display); font-weight: 600; font-size: 14px; color: var(--text-secondary); border-bottom: 3px solid transparent;
}
.nav a:hover { color: var(--text-primary); }
.nav a[aria-current="page"] { color: var(--text-primary); border-bottom-color: var(--brand-orange); }
.admin-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.admin-head h1 { font-size: 24px; margin-top: 4px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.toolbar .input, .toolbar .select { width: auto; min-height: 44px; padding: 8px 12px; font-size: 15px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--surface-card); border: 1px solid var(--border-default); border-radius: var(--corner-md); box-shadow: var(--shadow-sm); padding: 14px 16px; }
.stat .label { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 400; color: var(--text-secondary); }
.stat .value { font-family: var(--font-display); font-weight: 800; font-size: 28px; line-height: 1.2; font-variant-numeric: tabular-nums; margin-top: 4px; }
.stat .value small { font-size: 14px; font-weight: 600; color: var(--text-muted); }
.section { margin-bottom: 20px; padding: 0; overflow: hidden; }
.section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 20px 12px; }
.section-head p { font-size: 14px; color: var(--text-secondary); margin-top: 2px; }
.section-body { padding: 0 20px 20px; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th {
  text-align: left; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted);
  padding: 10px 12px; border-bottom: 1px solid var(--border-default); white-space: nowrap;
}
.table td { padding: 12px; border-bottom: 1px solid var(--border-default); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table th:first-child, .table td:first-child { padding-left: 20px; }
.table th:last-child, .table td:last-child { padding-right: 20px; }
.table .num, .table td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.table td.actions { text-align: right; white-space: nowrap; }
.table strong { font-family: var(--font-display); font-weight: 700; }
.table tr.is-off td { color: var(--text-muted); }
.table a { color: var(--brand-orange-strong); text-decoration: none; font-weight: 500; }
.table a:hover { text-decoration: underline; }
.empty { padding: 28px 20px; text-align: center; color: var(--text-secondary); font-size: 15px; }
.progress-cell { display: flex; align-items: center; gap: 10px; min-width: 120px; }
.progress-cell .meter { flex: 1; height: 6px; margin: 0; }
.bar-cell { display: flex; align-items: center; gap: 10px; min-width: 150px; }
.bar-cell .bar { flex: 1; height: 10px; background: var(--surface-sunken); border-radius: 0 4px 4px 0; overflow: hidden; }
.bar-cell .bar i { display: block; height: 100%; background: var(--accent-teal); border-radius: 0 4px 4px 0; }
.bar-cell .bar.is-late i { background: var(--warning); }
.bar-cell b { min-width: 58px; text-align: right; font-family: var(--font-display); font-weight: 700; font-variant-numeric: tabular-nums; }
.check-list { list-style: none; margin: 0; padding: 0; }
.check-list li { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border-default); font-size: 15px; }
.check-list li:last-child { border-bottom: none; }
.check-list .icon { margin-top: 2px; color: var(--ink-300); }
.check-list li.is-done .icon { color: var(--brand-green-deep); }
.check-list small { display: block; font-size: 12px; color: var(--text-muted); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 15px; }
.kv dt { color: var(--text-secondary); }
.kv dd { margin: 0; font-weight: 500; }

.item-row {
  display: flex; align-items: center; gap: 10px; padding: 6px 12px 6px 8px; min-height: 56px; border-top: 1px solid var(--border-default); background: var(--surface-card);
}
.item-row .handle { cursor: grab; color: var(--ink-300); display: inline-flex; padding: 8px 4px; touch-action: none; }
.item-row .order { font-family: var(--font-display); font-weight: 700; font-size: 14px; color: var(--text-muted); min-width: 22px; text-align: right; font-variant-numeric: tabular-nums; }
.item-row .text { flex: 1; min-width: 0; font-size: 15px; overflow-wrap: anywhere; }
.item-row.is-off .text { color: var(--text-muted); }
.item-row.is-dragging { opacity: 0.4; }
.item-row.is-over { box-shadow: inset 0 3px 0 var(--brand-orange); }
.add-row { display: flex; gap: 8px; padding: 14px 20px 20px; border-top: 1px solid var(--border-default); }
.rcpt-row { display: grid; grid-template-columns: 1fr 1fr auto auto; gap: 8px; align-items: center; }
.rcpt-row .input { min-height: 44px; font-size: 15px; padding: 8px 12px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; min-height: 44px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--brand-orange); }
.pin-reveal { font-family: var(--font-display); font-weight: 800; font-size: 56px; letter-spacing: 0.18em; text-align: center; font-variant-numeric: tabular-nums; padding: 8px 0 4px 0.18em; }
.steps { margin: 0; padding-left: 20px; font-size: 15px; color: var(--text-secondary); display: grid; gap: 4px; }
.steps code, .kv code, p code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; background: var(--surface-sunken); padding: 2px 6px; border-radius: 4px; color: var(--text-primary); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* Стовпчиковий графік (одна серія — один відтінок; прострочення позначене статусним кольором і легендою) */
.chart { position: relative; padding: 4px 20px 16px; }
.chart-plot { position: relative; display: flex; align-items: flex-end; gap: 2px; height: 220px; margin-left: 44px; border-bottom: 1px solid var(--border-strong); }
.chart-grid { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--border-default); pointer-events: none; }
.chart-grid span { position: absolute; right: calc(100% + 8px); top: -9px; font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.chart-col { position: relative; flex: 1; min-width: 0; height: 100%; display: flex; align-items: flex-end; justify-content: center; background: transparent; border: none; padding: 0; cursor: default; }
.chart-col i { display: block; width: 100%; max-width: 30px; min-height: 2px; background: var(--accent-teal); border-radius: 4px 4px 0 0; }
.chart-col.is-late i { box-shadow: inset 0 4px 0 var(--error); }
.chart-col.is-empty i { background: var(--ink-200); height: 2px; border-radius: 0; }
.chart-col:hover i, .chart-col:focus-visible i { background: #3C8F84; }
.chart-col.is-empty:hover i { background: var(--ink-300); }
.chart-x { display: flex; gap: 2px; margin: 6px 0 0 44px; }
.chart-x span { flex: 1; min-width: 0; text-align: center; font-size: 11px; color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: visible; }
.chart-tip {
  position: absolute; z-index: 5; pointer-events: none; background: #23241F; color: #F4F3EE; padding: 8px 12px; font-size: 13px; line-height: 1.45;
  border-radius: 3px 10px 10px 10px; box-shadow: var(--shadow-lg); white-space: nowrap; transform: translate(-50%, -100%);
}
.chart-tip b { font-family: var(--font-display); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 0 20px 14px; font-size: 13px; color: var(--text-secondary); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 12px; height: 12px; border-radius: 3px 3px 0 0; background: var(--accent-teal); }
.legend i.is-late { box-shadow: inset 0 4px 0 var(--error); }

/* ── Адаптив ──────────────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  /* Таблиці стають картками: підпис колонки береться з data-label */
  .table.is-cards thead { display: none; }
  .table.is-cards, .table.is-cards tbody, .table.is-cards tr, .table.is-cards td { display: block; width: 100%; }
  .table.is-cards tr { padding: 10px 0; border-bottom: 1px solid var(--border-default); }
  .table.is-cards tr:last-child { border-bottom: none; }
  .table.is-cards td { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 5px 20px; border: none; text-align: right; }
  .table.is-cards td::before { content: attr(data-label); font-size: 13px; color: var(--text-secondary); text-align: left; flex-shrink: 0; }
  .table.is-cards td.is-title { justify-content: flex-start; text-align: left; font-size: 16px; }
  .table.is-cards td.is-title::before, .table.is-cards td.actions::before { content: none; }
  .table.is-cards td.actions { justify-content: flex-end; }
  .table.is-cards .bar-cell, .table.is-cards .progress-cell { flex: 1; max-width: 220px; }
}
@media (max-width: 560px) {
  h1 { font-size: 26px; }
  .dialog-actions .btn { flex: 1; padding-left: 12px; padding-right: 12px; }
  .hide-sm { display: none !important; }
  .rcpt-row { grid-template-columns: 1fr 1fr; padding-bottom: 10px; border-bottom: 1px solid var(--border-default); }
  .chart { padding-left: 12px; padding-right: 12px; }
  .section-head, .section-body { padding-left: 16px; padding-right: 16px; }
  .add-row { padding-left: 16px; padding-right: 16px; }
}
@media (max-width: 380px) {
  .panel .value { font-size: 22px; }
  .task .text { font-size: 16px; }
}

/* ── Бали, рейтинг, досягнення, підказки ──────────────────────────────── */
.textarea { min-height: 96px; resize: vertical; line-height: 1.45; }
.stars { display: inline-flex; align-items: center; gap: 2px; color: var(--ink-200); vertical-align: middle; }
.stars .icon.is-on { color: var(--brand-orange); fill: var(--brand-orange); }
.stars b { margin-left: 6px; font-family: var(--font-display); font-weight: 700; font-size: 13px; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.star-input { display: flex; gap: 6px; }
.star-input button {
  display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; padding: 0; background: var(--surface-card);
  border: 1.5px solid var(--border-strong); border-radius: var(--corner-sm); color: var(--ink-300);
}
.star-input button .icon { width: 24px; height: 24px; }
.star-input button.is-on { border-color: var(--brand-orange); background: var(--brand-orange-soft); color: var(--brand-orange); }
.star-input button.is-on .icon { fill: var(--brand-orange); }
.pts { font-family: var(--font-display); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Пункт чек-листа з підказкою: основна кнопка-позначка, поруч кнопка підказки, під ними — текст підказки */
.task { display: grid; grid-template-columns: 1fr auto; align-items: stretch; padding: 0; min-height: 0; }
.task-main {
  display: flex; align-items: center; gap: 14px; min-height: 66px; padding: 12px 12px 12px 14px; text-align: left; width: 100%;
  background: transparent; border: none; border-radius: inherit; min-width: 0;
}
.task-main:disabled { cursor: default; color: inherit; }
.task-hint-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 52px; background: transparent; border: none;
  border-left: 1px solid var(--border-default); color: var(--accent-teal); border-radius: 0 16px 16px 0;
}
.task-hint-btn[aria-expanded="true"] { background: var(--accent-teal-soft); border-radius: 0 16px 0 0; }
.task-hint {
  grid-column: 1 / -1; padding: 12px 16px 14px; border-top: 1px solid var(--border-default); background: var(--accent-teal-soft);
  border-radius: 0 0 16px 16px; font-size: 15px; line-height: 1.5; color: var(--ink-700); white-space: pre-line;
}
.task-hint .eyebrow { display: flex; align-items: center; gap: 6px; color: #2F7F74; margin-bottom: 4px; }
.task .side { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.task .pts { font-size: 12px; color: var(--text-muted); }
.task.is-done { background: var(--success-soft); border-color: var(--brand-green); box-shadow: none; }
.task.is-done .box { background: var(--brand-green-deep); border-color: var(--brand-green-deep); color: #fff; }
.task.is-done .text { color: var(--text-secondary); }
.task.is-done .pts { color: var(--brand-green-deep); }
.kind-tabs { margin-bottom: 16px; }
.kind-tabs button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; }
.notice {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; margin-bottom: 16px; border-radius: var(--corner-md);
  background: var(--warning-soft); border: 1px solid var(--warning); color: #7A4D10; font-size: 15px;
}
.notice .icon { margin-top: 2px; }
.notice.is-info { background: var(--info-soft); border-color: var(--info); color: #2F5F86; }
.review { text-align: left; width: 100%; margin-top: 6px; padding: 12px 14px; border-radius: var(--corner-sm); background: var(--surface-sunken); font-size: 15px; }
.review p { color: var(--text-primary); max-width: none; margin-top: 4px; }

/* Нижня панель вкладок застосунку працівника */
.app.has-tabs { padding-bottom: calc(104px + env(safe-area-inset-bottom)); }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: center;
  background: var(--surface-card); border-top: 1px solid var(--border-default); padding-bottom: env(safe-area-inset-bottom);
}
.tabbar-inner { display: flex; width: 100%; max-width: 600px; }
.tabbar button {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 62px; padding: 6px 4px;
  background: transparent; border: none; border-top: 3px solid transparent; color: var(--text-secondary);
  font-family: var(--font-display); font-weight: 600; font-size: 12px;
}
.tabbar button[aria-current="page"] { color: var(--brand-orange-strong); border-top-color: var(--brand-orange); }

.leaders { margin-top: 20px; }
.board { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.board li {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--surface-card);
  border: 1.5px solid var(--border-default); border-radius: var(--corner-md); min-height: 62px;
}
.board li.is-me { border-color: var(--brand-orange); background: var(--brand-orange-soft); }
.board .who { flex: 1; min-width: 0; }
.board .who strong { display: block; font-family: var(--font-display); font-weight: 700; font-size: 16px; line-height: 1.25; overflow-wrap: anywhere; }
.board .who small { font-size: 13px; color: var(--text-secondary); }
.board .pts { font-size: 18px; }
.board .pts small { display: block; font-family: var(--font-body); font-weight: 400; font-size: 11px; color: var(--text-muted); text-align: right; }
.board.is-compact li { min-height: 0; padding: 8px 0; border: none; border-radius: 0; background: transparent; border-bottom: 1px solid var(--border-default); }
.board.is-compact li:last-child { border-bottom: none; }
.rank {
  display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; flex-shrink: 0; border-radius: var(--corner-xs);
  background: var(--surface-sunken); color: var(--text-secondary); font-family: var(--font-display); font-weight: 800; font-size: 15px; font-variant-numeric: tabular-nums;
}
.rank-1 { background: var(--brand-orange); color: #fff; }
.rank-2 { background: var(--accent-sand); color: #fff; }
.rank-3 { background: var(--accent-teal); color: #fff; }

.score { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.score .value { font-family: var(--font-display); font-weight: 800; font-size: 44px; line-height: 1; font-variant-numeric: tabular-nums; }
.score .value small { font-size: 16px; font-weight: 600; color: var(--text-secondary); }
.block-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 26px 0 12px; }
.block-title h2 { font-size: 20px; font-weight: 800; }
.block-title span { font-size: 13px; color: var(--text-secondary); }
.perk { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; }
.perk + .perk { margin-top: 10px; }
.perk .grow strong { display: block; font-family: var(--font-display); font-weight: 700; font-size: 16px; line-height: 1.3; }
.perk .grow p { font-size: 14px; color: var(--text-secondary); margin-top: 2px; }
.perk.is-locked .tile { background: var(--surface-sunken); color: var(--ink-400); }
.badges { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.ach { display: flex; flex-direction: column; gap: 8px; padding: 14px; background: var(--surface-card); border: 1px solid var(--border-default); border-radius: var(--corner-md); box-shadow: var(--shadow-sm); }
.ach strong { font-family: var(--font-display); font-weight: 700; font-size: 15px; line-height: 1.25; }
.ach p { font-size: 13px; line-height: 1.4; color: var(--text-secondary); flex: 1; }
.ach .state { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--text-muted); }
.ach .meter { height: 6px; margin: 0; flex: 1; }
.ach.is-locked .tile { background: var(--surface-sunken); color: var(--ink-400); }
.ach.is-on { border-color: var(--brand-green); }
.ach.is-on .state { color: var(--success); }
.history { list-style: none; margin: 0; padding: 0; }
.history li { padding: 12px 0; border-bottom: 1px solid var(--border-default); }
.history li:last-child { border-bottom: none; }
.history .line { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.history small { display: block; font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.rules { margin: 0; padding-left: 20px; font-size: 14px; color: var(--text-secondary); display: grid; gap: 6px; }
.fieldset { border: 1px solid var(--border-default); border-radius: var(--corner-md); padding: 14px 16px 16px; margin: 0; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.fieldset legend { font-family: var(--font-display); font-weight: 700; font-size: 15px; padding: 0 6px; }
.time-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.time-row .input { padding-left: 10px; padding-right: 6px; }
.check-grid { display: grid; gap: 2px; }
.item-row .meta { display: inline-flex; align-items: center; gap: 6px; color: var(--text-muted); font-size: 13px; white-space: nowrap; }
.item-row .meta .icon { color: var(--accent-teal); }
@media (max-width: 560px) {
  .time-row { grid-template-columns: 1fr; }
  .item-row .meta { display: none; }
}
@media (max-width: 380px) {
  .task-hint-btn { width: 44px; }
}
@media (max-width: 330px) {
  .badges { grid-template-columns: 1fr; }
}

/* ── Пункти з полем вводу ─────────────────────────────────────────────── */
div.task-main { cursor: default; }
.task-field { grid-column: 1 / -1; padding: 0 14px 14px 62px; margin: -4px 0 0; }
.field-row { display: flex; align-items: center; gap: 8px; }
.field-row .input { flex: 1; min-width: 0; min-height: 44px; padding: 8px 12px; }
.field-row .unit { font-family: var(--font-display); font-weight: 700; color: var(--text-secondary); white-space: nowrap; }
.field-row .btn { flex-shrink: 0; }
.field-note { font-size: 13px; color: var(--text-secondary); margin-top: 6px; }
.field-warn { display: flex; align-items: flex-start; gap: 6px; font-size: 13px; font-weight: 600; color: #A93B28; margin-top: 6px; }
.field-warn .icon { margin-top: 2px; }
.task.is-warn { border-color: var(--error); background: var(--error-soft); }
.task.is-warn .box { background: var(--error); border-color: var(--error); }
.ach small { font-size: 12px; color: var(--text-secondary); }
@media (max-width: 380px) { .task-field { padding-left: 14px; } }

/* ── Адмінка: меню зліва (на вузьких екранах — згори, зі скролом) ──────── */
.aside {
  position: sticky; top: 0; z-index: 20; background: var(--surface-card); border-bottom: 1px solid var(--border-default);
  display: grid; grid-template-columns: 1fr auto; grid-template-areas: "brand user" "nav nav";
}
.aside-brand { grid-area: brand; padding: 10px 16px; }
.aside-user { grid-area: user; display: flex; align-items: center; gap: 8px; padding: 0 10px; }
.aside-user .who-chip { display: none; }
.aside .nav { grid-area: nav; max-width: none; margin: 0; }
.nav-label { display: none; }
@media (min-width: 1000px) {
  .aside {
    position: fixed; top: 0; bottom: 0; left: 0; width: 248px; display: flex; flex-direction: column;
    border-bottom: none; border-right: 1px solid var(--border-default);
  }
  .aside-brand { padding: 20px 20px 8px; }
  .aside-brand .logo { height: 40px; }
  .aside .nav { flex: 1; flex-direction: column; gap: 2px; padding: 4px 12px 12px; overflow-x: hidden; overflow-y: auto; }
  .aside .nav a { min-height: 44px; padding: 0 12px; font-size: 15px; gap: 12px; border-bottom: none; border-radius: var(--corner-sm); flex-shrink: 0; }
  .aside .nav a:hover { background: var(--surface-sunken); }
  .aside .nav a[aria-current="page"] { background: var(--brand-orange-soft); color: var(--brand-orange-strong); }
  .nav-label {
    display: block; padding: 16px 12px 6px; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted);
  }
  .aside-user { flex-wrap: wrap; padding: 14px 16px 16px; border-top: 1px solid var(--border-default); }
  .aside-user .who-chip { display: inline-flex; width: 100%; }
  .aside-user .icon-btn { margin-left: auto; }
  .admin { margin: 0 0 0 248px; max-width: 1280px; padding: 28px 32px 96px; }
}
.add-row { flex-wrap: wrap; }
.add-row .input { flex: 1 1 240px; }
.add-row .select { flex: 0 1 220px; width: auto; }
.icon-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.icon-pick button {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; background: var(--surface-card);
  border: 1.5px solid var(--border-strong); border-radius: var(--corner-sm); color: var(--text-secondary);
}
.icon-pick button.is-on { border-color: var(--brand-orange); background: var(--brand-orange-soft); color: var(--brand-orange-strong); }
.level-row { display: grid; grid-template-columns: 1fr 1fr 40px; gap: 8px; align-items: center; }
.level-row .input { min-height: 44px; padding: 8px 12px; }
.level-head { font-size: 13px; font-weight: 500; color: var(--text-secondary); }
