/* Основные стили. Цвета берутся только из tokens.css */
* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  background-image: radial-gradient(1100px 420px at 50% -120px, rgba(224, 43, 49, 0.13), transparent 70%), radial-gradient(700px 360px at 100% 100%, rgba(224, 43, 49, 0.06), transparent 70%);
  background-attachment: fixed;
  font-family: 'Manrope', 'Noto Sans Armenian', system-ui, sans-serif; font-size: 14px; line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; font-family: 'Space Grotesk', 'Noto Sans Armenian', 'Manrope', sans-serif; font-weight: 700; }
a { color: inherit; }
button { font-family: inherit; }
[hidden] { display: none !important; }

.page { max-width: 1440px; margin: 0 auto; padding: 0 40px 48px; }
.page-narrow { max-width: 1000px; }
.muted { color: var(--text-dim); }
.faint { color: var(--text-faint); }
.num { font-family: 'Space Grotesk', 'Noto Sans Armenian', sans-serif; font-weight: 700; }
.right { text-align: right; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.loading { padding: 80px 40px; text-align: center; color: var(--text-dim); }
.empty { padding: 28px 12px; text-align: center; color: var(--text-faint); }

/* ---------- Анимации: плавные, короткие; отключаются, если на устройстве включено «уменьшить движение» ---------- */
@keyframes page-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes tile-in { from { opacity: 0; transform: translateY(16px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(10px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(14px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes dseg-in { from { opacity: 0; transform: scale(0.88); } to { opacity: 1; transform: none; } }
@keyframes bar-grow { from { transform: scaleY(0); } to { transform: none; } }
@keyframes route-bar { 0% { transform: scaleX(0); opacity: 1; } 65% { transform: scaleX(1); opacity: 1; } 100% { transform: scaleX(1); opacity: 0; } }
.page-enter { animation: page-in .3s var(--ease) backwards; }
/* Цветовая полоска вверху при каждом переходе между экранами и вкладками */
#route-bar { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 200; pointer-events: none; transform: scaleX(0); transform-origin: left; background: linear-gradient(90deg, var(--red), #FF7A45, var(--red)); box-shadow: 0 0 14px rgba(224, 43, 49, 0.8); }
#route-bar.run { animation: route-bar .65s ease-out; }
.tiles .tile:nth-child(2) { animation-delay: 50ms; } .tiles .tile:nth-child(3) { animation-delay: 100ms; } .tiles .tile:nth-child(4) { animation-delay: 150ms; }
.tiles .tile:nth-child(5) { animation-delay: 200ms; } .tiles .tile:nth-child(6) { animation-delay: 250ms; } .tiles .tile:nth-child(7) { animation-delay: 300ms; }
.tiles .tile:nth-child(8) { animation-delay: 350ms; } .tiles .tile:nth-child(n+9) { animation-delay: 400ms; }
.zone-tiles .zone-tile:nth-child(2) { animation-delay: 60ms; } .zone-tiles .zone-tile:nth-child(3) { animation-delay: 120ms; } .zone-tiles .zone-tile:nth-child(n+4) { animation-delay: 180ms; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

/* ---------- Шапка ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 30px 0 22px; flex-wrap: wrap; }
.topbar-l, .topbar-r, .topbar-page { display: flex; align-items: center; gap: 16px; }
.topbar-l { margin-right: auto; min-width: 0; }
.t-title { font-size: 22px; color: var(--text); overflow-wrap: anywhere; }
.t-sub { font-size: 13px; color: var(--text-dim); margin-top: 3px; }
.clock { font-size: 14px; color: var(--text-dim); text-align: right; }
.clock b { display: block; color: var(--text); font-weight: 600; }
.user-pill { display: flex; align-items: center; gap: 10px; background: var(--panel); border: 1px solid var(--border); border-radius: 999px; padding: 6px 16px 6px 6px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, var(--red-hover), var(--red)); display: flex; align-items: center; justify-content: center; color: var(--on-accent); font-family: 'Space Grotesk', 'Noto Sans Armenian', sans-serif; font-weight: 700; font-size: 13px; }
.user-name { font-weight: 600; font-size: 13px; }
.user-role { color: var(--text-dim); font-size: 12px; }
.round-btn { width: 40px; height: 40px; flex-shrink: 0; border-radius: 50%; background: var(--panel); border: 1px solid var(--border); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text); text-decoration: none; }
.round-btn:hover { border-color: var(--line-hover); }

/* ---------- Переключатель языка ---------- */
.lang-switch { display: inline-flex; gap: 4px; background: var(--panel); border: 1.5px solid var(--border); border-radius: 999px; padding: 4px; }
.lang-btn { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px 0 8px; border-radius: 999px; border: none; background: transparent; color: var(--text-dim); font-weight: 700; font-size: 12px; letter-spacing: 0.04em; cursor: pointer; }
.lang-btn svg { border-radius: 3px; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25); flex-shrink: 0; }
.lang-btn:hover { color: var(--text); }
.lang-btn.on { background: #fff; color: var(--ink); }
.login-lang { display: flex; justify-content: center; margin-bottom: 22px; }

/* ---------- Кнопки ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 22px; border-radius: 12px; border: none; background: #fff; color: var(--ink); font-weight: 700; font-size: 14px; cursor: pointer; text-decoration: none; white-space: nowrap; transition: transform .12s var(--ease), box-shadow .2s var(--ease), filter .2s, background .2s, border-color .2s, color .2s; }
.btn:hover { filter: brightness(0.94); }
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; filter: none; }
.btn-red { background: linear-gradient(180deg, var(--red-hover), var(--red)); color: var(--on-accent); box-shadow: 0 6px 20px rgba(224, 43, 49, 0.28); }
.btn-red:hover { filter: none; box-shadow: 0 8px 28px rgba(224, 43, 49, 0.5); transform: translateY(-1px); }
.btn-lg { height: 52px; padding: 0 30px; font-size: 15px; }
.btn-sm { height: 34px; padding: 0 14px; font-size: 12px; border-radius: 9px; }
.btn.is-off { opacity: .4; }
.btn-ghost { background: transparent; border: 1.5px solid var(--border); color: var(--text-dim); font-weight: 600; }
.btn-ghost:hover { color: var(--text); border-color: var(--line-hover); filter: none; }
.btn-dashed { background: transparent; border: 1.5px dashed var(--border); color: var(--text-dim); font-weight: 600; }
.btn-dashed:hover { color: var(--text); filter: none; }
.btn-block { width: 100%; }
.link-btn { background: none; border: none; color: var(--text-faint); cursor: pointer; font-size: 12px; padding: 4px; }
.link-btn:hover { color: var(--text); }
.x-btn { width: 34px; height: 34px; flex-shrink: 0; border-radius: 9px; background: transparent; border: 1px solid var(--border); color: var(--text-faint); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.x-btn:hover { color: var(--red); border-color: var(--red); }

/* ---------- Поля ---------- */
.cap { display: block; font-size: 11px; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; }
.fld { width: 100%; height: 42px; border-radius: 10px; border: 2px solid transparent; background: #fff; color: var(--ink); font-family: inherit; font-size: 14px; padding: 0 12px; outline: none; }
.fld { transition: border-color .15s, box-shadow .2s; }
.fld:focus { border-color: var(--red); box-shadow: 0 0 0 4px var(--red-soft); }
.fld:disabled { background: #d9d9dc; color: #555; }
textarea.fld { height: auto; min-height: 76px; padding: 10px 12px; resize: vertical; }
select.fld { cursor: pointer; }
.fld-sm { height: 38px; font-size: 13px; }
.field { margin-bottom: 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.hint { font-size: 11px; color: var(--text-faint); margin-top: 5px; }
.form-error { background: var(--warn-soft); border: 1px solid var(--warn); border-radius: 10px; padding: 10px 14px; font-size: 13px; margin-bottom: 14px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.check input { width: 18px; height: 18px; accent-color: var(--red); }
/* Касса: карточка визита */
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg button { min-height: 52px; border-radius: 12px; border: 1px solid var(--border); background: transparent; color: var(--text); font-weight: 700; font-size: 15px; cursor: pointer; }
.seg button { transition: background .18s, border-color .18s, transform .12s; }
.seg button.on { background: linear-gradient(180deg, var(--red-hover), var(--red)); border-color: var(--red); color: var(--on-accent); box-shadow: 0 6px 18px rgba(224, 43, 49, 0.3); }
.seg button:disabled { cursor: default; }
.seg small { display: block; font-weight: 500; font-size: 11px; opacity: 1; }
.time-row { display: grid; grid-template-columns: 1fr 1fr 110px; gap: 12px; align-items: end; }
.dur { height: 48px; display: flex; align-items: center; justify-content: center; border-radius: 12px; border: 1px solid var(--border); font-weight: 700; }
.guests-row { display: grid; grid-template-columns: 110px 1fr; gap: 14px; align-items: end; }
.guests-row .alert { margin: 0; }
.guest-warn { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.check-lines .ln { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.check-lines .ln b { white-space: nowrap; }
.check-lines .ln-input .fld { width: 150px; text-align: right; }
.check-total { display: flex; justify-content: space-between; align-items: center; padding: 12px 0 4px; font-size: 18px; font-weight: 800; }
.pay { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.cap-plain { text-transform: none; letter-spacing: 0; }
.pay-status { font-size: 13px; font-weight: 600; margin-top: 6px; }
@media (max-width: 600px) {
  .time-row { grid-template-columns: 1fr 1fr; }
  .dur { grid-column: 1 / -1; }
  .pay { grid-template-columns: 1fr; }
  .guests-row { grid-template-columns: 1fr; }
  .check-lines .ln-input .fld { width: 120px; }
}
/* Касса: экран «Открыть кассу» и «День закрыт» */
.open-kassa { max-width: 560px; margin: 32px auto; text-align: center; padding: 32px 28px; }
.open-kassa h2 { font-size: 22px; margin: 12px 0 10px; }
.open-kassa p { margin: 0 0 18px; line-height: 1.5; }
.open-kassa .alert { text-align: left; }
.open-kassa-icon { display: inline-flex; color: var(--red); }
/* Права пользователя: галочки по разделам */
.perm-groups { display: grid; gap: 14px; margin-bottom: 16px; }
.perm-group .check { display: flex; align-items: flex-start; margin: 6px 0; line-height: 1.35; }
.perm-group .check input { flex: none; margin-top: 1px; }

/* ---------- Карточки ---------- */
.card { background: linear-gradient(180deg, var(--panel), #121215); border: 1px solid var(--border); border-radius: 18px; padding: 22px 24px; transition: border-color .2s; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.card-t { display: flex; align-items: center; gap: 10px; font-family: 'Space Grotesk', 'Noto Sans Armenian', sans-serif; font-weight: 700; font-size: 16px; }
.card-t svg { color: var(--red); flex-shrink: 0; }
.card-foot { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--border); padding-top: 12px; margin-top: 14px; }
.card-foot .num { font-size: 18px; }

/* ---------- Плитки главного экрана ---------- */
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.tiles-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tiles-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tiles-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.tiles-4 .tile { min-height: 170px; padding: 22px 16px; }
.tiles-4 .tile-icon { width: 56px; height: 56px; }
.tiles-4 .tile-title { font-size: 17px; }
.tiles-4 .tile-sub { font-size: 12px; }
@media (max-width: 1100px) { .tiles-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tiles-3 .tile { min-height: 180px; }
.tiles-3 .tile-icon { width: 60px; height: 60px; }
.tiles-3 .tile-title { font-size: 18px; }
.bonus-box { border: 1px dashed var(--border); border-radius: 12px; padding: 12px; }
.agent-box { border: 1px dashed var(--amber); border-radius: 12px; padding: 12px; margin-top: 10px; font-size: 13px; }
.bonus-row { display: grid; grid-template-columns: 1fr 110px 34px; gap: 8px; margin-bottom: 8px; align-items: center; }
.tile { animation: tile-in .45s var(--ease) backwards; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: var(--panel); border: 1px solid var(--border); border-radius: 20px; padding: 30px 24px; min-height: 220px; cursor: pointer; text-align: center; text-decoration: none; color: var(--text); transition: border-color .2s, transform .2s var(--ease), box-shadow .25s var(--ease), background .2s; }
.tile:hover { border-color: var(--red); transform: translateY(-4px); box-shadow: var(--glow); background: linear-gradient(180deg, var(--panel2), var(--panel)); }
.tile-icon { width: 72px; height: 72px; border-radius: 50%; background: radial-gradient(circle at 30% 25%, rgba(224, 43, 49, 0.32), var(--red-soft)); display: flex; transition: transform .25s var(--ease); align-items: center; justify-content: center; color: var(--red); }
.tile:hover .tile-icon { transform: scale(1.08) rotate(-3deg); }
.tile-title { font-family: 'Space Grotesk', 'Noto Sans Armenian', sans-serif; font-weight: 700; font-size: 22px; text-transform: uppercase; }
.tile-sub { font-size: 13px; color: var(--text-dim); }
.tiles-2 .tile { min-height: 190px; }
.tiles-2 .tile-icon { width: 60px; height: 60px; }
.tiles-2 .tile-title { font-size: 19px; }
.tile-badge { position: absolute; top: 16px; right: 16px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; border-radius: 999px; padding: 4px 10px; }
.quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-top: 16px; }
.quick a { display: flex; align-items: center; gap: 10px; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; text-decoration: none; font-weight: 600; }
.quick a { transition: border-color .2s, transform .2s var(--ease), box-shadow .25s; }
.quick a:hover { border-color: var(--red); transform: translateY(-2px); box-shadow: var(--glow); }
.quick svg { color: var(--red); flex-shrink: 0; }
.quick a { min-width: 0; overflow-wrap: anywhere; }
/* Длинные армянские подписи не должны выталкивать кнопки за край узкого экрана */
.alert > div { min-width: 0; }
.alert .btn { white-space: normal; min-width: 0; max-width: 100%; text-align: center; }

/* ---------- Статусы ---------- */
.pill { display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; border-radius: 999px; padding: 3px 9px; white-space: nowrap; }
.bg-green { background: var(--green); color: #fff; }
.bg-amber { background: var(--amber); color: var(--ink); }
.bg-red { background: var(--red); color: var(--on-accent); }
.bg-grey { background: #3F3F45; color: var(--text-dim); }
.c-green { color: var(--green); }
.c-amber { color: var(--amber); }
.c-red { color: var(--warn); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dot); display: inline-block; }

/* ---------- Показатели и уведомления ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
.kpis-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; }
.kpi-l { font-size: 11px; color: var(--text-dim); text-transform: uppercase; margin-bottom: 6px; }
.kpi-v { font-family: 'Space Grotesk', 'Noto Sans Armenian', sans-serif; font-weight: 700; font-size: 22px; }
.alert { display: flex; align-items: flex-start; gap: 14px; background: var(--warn-soft); border: 1px solid rgba(242, 163, 58, 0.45); border-radius: 14px; padding: 14px 18px; margin-bottom: 20px; font-size: 13px; }
.alert svg { color: var(--warn); flex-shrink: 0; }
.alert-amber { background: var(--warn-soft); border-color: rgba(242, 163, 58, 0.45); }
.alert-amber svg { color: var(--amber); }
.notes { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.note { display: flex; align-items: center; gap: 12px; background: var(--panel2); border: 1px solid var(--border); border-left: 3px solid var(--red); border-radius: 12px; padding: 12px 16px; font-size: 13px; }
.note-text { flex: 1; }

/* ---------- Таблицы ---------- */
.table-card { background: var(--panel); border: 1px solid var(--border); border-radius: 18px; padding: 8px 20px; overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { text-align: left; padding: 12px 10px; font-size: 13px; vertical-align: middle; }
.tbl th { font-size: 11px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl td { border-bottom: 1px solid var(--border); }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr.low td { background: var(--warn-soft); }
.tbl tr.inactive td { opacity: 0.45; }
.tbl .actions { display: flex; gap: 6px; justify-content: flex-end; }

/* ---------- Неделя чек-листов ---------- */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.wd { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 10px 8px; text-align: center; }
.wd.today { border: 1.5px solid var(--red); }
.wd-d { font-family: 'Space Grotesk', 'Noto Sans Armenian', sans-serif; font-weight: 700; font-size: 12px; }
.wd-l { font-size: 11px; color: var(--text-dim); margin: 2px 0 8px; }
.section-cap { font-size: 12px; font-weight: 700; color: var(--text-dim); margin: 28px 0 10px; text-transform: uppercase; letter-spacing: 0.08em; }

/* ---------- Поиск ---------- */
.search { display: flex; gap: 12px; margin-bottom: 24px; flex-wrap: wrap; }
.search-box { flex: 1 1 320px; display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 12px; padding: 0 16px; height: 48px; color: var(--ink); }
.search-box input { border: none; outline: none; background: transparent; font-family: inherit; font-size: 14px; color: var(--ink); flex: 1; height: 100%; }
.search select { width: auto; height: 48px; border-radius: 12px; font-weight: 600; }
.results { margin: -12px 0 24px; }
.result { display: flex; gap: 14px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.result:last-child { border-bottom: none; }

/* ---------- Касса ---------- */
.kassa-grid { display: grid; grid-template-columns: var(--cols, 1.55fr 1fr); gap: 28px; align-items: start; }
.kassa-grid > * { min-width: 0; }
.line { display: grid; gap: 8px; align-items: center; margin-bottom: 8px; }
/* Продажи без визита и доп. поступления: со способом оплаты; строки чека визита — без него */
.line-sale { grid-template-columns: 2fr 0.5fr 0.8fr 0.75fr 34px; }
.line-rent { grid-template-columns: 1.6fr 0.9fr 34px; }
.line-extra { grid-template-columns: 1.6fr 0.9fr 34px; }
/* Способ оплаты — второй строкой под товаром, чтобы в узкой колонке ничего не обрезалось */
.line .pay-sel { grid-row: 2; grid-column: 1 / -2; }
.line-head .pay-h { display: none; }
.line-vs { grid-template-columns: 2fr 0.5fr 0.8fr 0.75fr 34px; }
.line-vr { grid-template-columns: 1.6fr 0.9fr 34px; }
.v-lines { margin-top: 10px; }
.line-head { font-size: 11px; font-weight: 700; color: var(--text-faint); text-transform: uppercase; }
.line .sum { text-align: right; font-weight: 600; }
.carry { background: var(--panel2); border: 1px dashed var(--border); border-radius: 10px; padding: 10px 12px; font-size: 13px; margin-bottom: 12px; }
.totals { position: sticky; bottom: 0; z-index: 5; margin-top: 26px; background: var(--panel2); border: 1px solid var(--red-soft); border-radius: 18px; padding: 16px 20px; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)) 1.3fr; gap: 10px; align-items: center; box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.35); }
.totals .l { font-size: 11px; color: var(--text-dim); text-transform: uppercase; }
.totals .v { font-family: 'Space Grotesk', 'Noto Sans Armenian', sans-serif; font-weight: 700; font-size: 17px; }
.totals .grand { background: linear-gradient(135deg, var(--red-hover), var(--red)); border-radius: 12px; padding: 10px 16px; text-align: right; color: var(--on-accent); box-shadow: 0 8px 26px rgba(224, 43, 49, 0.35); }
.totals .grand .l { color: var(--on-accent); opacity: 1; }
.totals .grand .v { font-size: 22px; }
.kassa-actions { display: flex; align-items: center; gap: 14px; padding-top: 20px; flex-wrap: wrap; }
.from-booking { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip { background: var(--panel); border: 1px dashed var(--red); color: var(--text); border-radius: 999px; padding: 7px 14px; font-size: 12px; font-weight: 600; cursor: pointer; }
.day-nav { display: flex; align-items: center; gap: 8px; }
.day-nav input { width: 160px; }
.dirty { font-size: 12px; color: var(--amber); }

/* ---------- Чек-лист ---------- */
.progress { width: 220px; height: 8px; background: var(--panel); border-radius: 999px; overflow: hidden; }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--red), #FF7A45); transition: width .45s var(--ease); }
.cl-grid { display: flex; gap: 24px; align-items: flex-start; }
.zones { width: 300px; flex-shrink: 0; background: var(--panel); border: 1px solid var(--border); border-radius: 18px; padding: 14px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 16px; }
.zrow { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; font-size: 13px; color: var(--text-dim); text-decoration: none; cursor: pointer; }
.zrow:hover { background: var(--panel2); }
.zrow.current { background: var(--red-soft); color: var(--text); font-weight: 700; }
.zrow .zc { margin-left: auto; font-size: 11px; color: var(--text-faint); }
.cl-main { flex: 1; min-width: 0; }
.item { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.item:last-child { border-bottom: none; }
.item-text { font-size: 15px; }
.state-btns { display: flex; gap: 8px; flex-shrink: 0; }
.btn-state { border-radius: 10px; height: 44px; min-width: 128px; padding: 0 16px; font-weight: 700; font-size: 12px; letter-spacing: 0.02em; cursor: pointer; border: 1.5px solid var(--border); background: transparent; color: var(--text-dim); }
.btn-state:hover { color: var(--text); border-color: var(--line-hover); }
.btn-state.on-done { background: var(--green); border-color: var(--green); color: #fff; }
.btn-state.on-rework { background: var(--warn); border-color: var(--warn); color: var(--ink); }
.rework-card { background: var(--panel); border: 1px solid var(--border); border-left: 3px solid var(--warn); border-radius: 14px; padding: 16px 18px; }

/* ---------- Чек-лист: плитки зон и крупные пункты ---------- */
.zone-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.zone-tile { display: flex; flex-direction: column; gap: 12px; background: var(--panel); border: 1.5px solid var(--border); border-radius: 20px; padding: 24px; min-height: 190px; text-decoration: none; color: var(--text); transition: border-color .2s, transform .2s var(--ease), box-shadow .25s; animation: tile-in .4s var(--ease) backwards; }
.zone-tile:hover { border-color: var(--red); transform: translateY(-3px); box-shadow: var(--glow); }
.zone-tile.st-done { border-color: rgba(63, 174, 88, 0.6); }
.zone-tile.st-rework { border-color: rgba(242, 163, 58, 0.6); }
.zone-tile.st-progress { border-color: rgba(226, 167, 61, 0.6); }
.zt-top { display: flex; justify-content: space-between; align-items: center; }
.zt-top svg { width: 24px; height: 24px; }
.zt-count { font-family: 'Space Grotesk', 'Noto Sans Armenian', sans-serif; font-weight: 700; color: var(--text-dim); }
.zt-name { font-family: 'Space Grotesk', 'Noto Sans Armenian', sans-serif; font-weight: 700; font-size: 23px; flex: 1; }
.zt-bar { height: 6px; background: var(--panel2); border-radius: 999px; overflow: hidden; }
.zt-bar > div { height: 100%; background: linear-gradient(90deg, var(--red), #FF7A45); transition: width .45s var(--ease); }
.zone-tile.st-done .zt-bar > div { background: var(--green); }
.big-items { display: flex; flex-direction: column; gap: 12px; }
.big-item { background: var(--panel); border: 1.5px solid var(--border); border-radius: 18px; padding: 18px; }
.big-item.st-done { border-color: rgba(63, 174, 88, 0.55); }
.big-item.st-rework { border-color: rgba(242, 163, 58, 0.6); }
.bi-text { font-size: 18px; font-weight: 600; margin-bottom: 14px; }
.bi-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.photo-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.photo-btn { cursor: pointer; }
.photo-thumb { position: relative; display: inline-block; }
.photo-thumb img { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); display: block; }
.photo-del { position: absolute; top: -7px; right: -7px; width: 24px; height: 24px; border-radius: 50%; border: none; background: var(--red); color: var(--on-accent); font-size: 16px; line-height: 1; cursor: pointer; }
.photo-wait { display: none; font-size: 12px; }
.photo-row.busy .photo-wait { display: inline; }
.photo-row.busy .photo-btn { opacity: .4; pointer-events: none; }
.bi-btn { display: flex; align-items: center; justify-content: center; gap: 10px; height: 64px; border-radius: 14px; border: 2px solid var(--border); background: transparent; color: var(--text-dim); font-family: inherit; font-weight: 700; font-size: 16px; text-transform: uppercase; letter-spacing: 0.03em; cursor: pointer; }
.bi-btn:hover { color: var(--text); border-color: var(--line-hover); }
.bi-btn.done.on { background: var(--green); border-color: var(--green); color: #fff; }
.bi-btn { transition: background .2s, border-color .2s, color .2s, transform .12s; }
.bi-btn:active:not(:disabled) { transform: scale(0.98); }
.bi-btn.rework.on { background: var(--warn); border-color: var(--warn); color: var(--ink); }
.bi-btn:disabled { cursor: default; }
/* Иконки на чёрном фоне: зелёная — «Выполнено / Хорошо / Да / Достаточно», красная — «Доработка / Не хорошо / Нужно»; на выбранной (залитой) кнопке иконка наследует цвет текста */
.bi-btn.done:not(.on) svg { color: var(--green); }
.bi-btn.rework:not(.on) svg { color: var(--red-hover); }
.bi-btn svg { flex-shrink: 0; }
/* Чек-лист: один пункт на весь экран */
.item-dots { display: flex; flex-wrap: wrap; gap: 7px; margin: 0 0 14px; }
.idot { width: 14px; height: 14px; border-radius: 50%; border: 0; padding: 0; background: var(--dot); cursor: pointer; transition: transform .15s, box-shadow .15s; }
.idot.st-done { background: var(--green); } .idot.st-rework { background: var(--warn); }
.idot.cur { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--text); transform: scale(1.15); }
.item-one { padding: 28px 26px; animation: pop-in .3s var(--ease); }
.ic-no { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 12px; }
.ic-text { font-size: 28px; line-height: 1.25; font-weight: 700; min-height: 92px; margin-bottom: 24px; }
.item-one .bi-btn { height: 84px; font-size: 20px; }
.rw-note { margin-top: 16px; }
.rw-note textarea { min-height: 100px; font-size: 17px; }
.rw-note textarea.need { outline: 2px solid var(--warn); outline-offset: 2px; }
.bi-btns.one { grid-template-columns: 1fr; }
.rate-btns { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.rate-btn { height: 84px; font-family: inherit; font-size: 30px; font-weight: 800; border-radius: 14px; border: 2px solid var(--border); background: transparent; color: var(--text-dim); cursor: pointer; transition: background .2s, border-color .2s, color .2s, transform .12s; }
.rate-btn:hover:not(:disabled) { color: var(--text); border-color: var(--line-hover); }
.rate-btn:active:not(:disabled) { transform: scale(0.97); }
.rate-btn.high.on { background: var(--green); border-color: var(--green); color: #fff; }
.rate-btn.low.on { background: var(--warn); border-color: var(--warn); color: var(--ink); }
.rate-btn:disabled { cursor: default; }
.rate-scale { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; font-size: 12px; color: var(--text-faint); }
.idot.st-note { background: var(--warn); }
.kind-sel { width: 235px; flex: 0 0 auto; }
.item-nav { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; padding: 20px 0 8px; }
.item-nav .btn { height: 64px; justify-content: center; }
.item-nav [data-next] { justify-self: end; min-width: 190px; } .item-nav [data-prev] { justify-self: start; min-width: 190px; }
.ic-count { font-weight: 700; font-size: 18px; min-width: 64px; text-align: center; color: var(--text-dim); }
.rework-done { background: var(--panel); border: 1px solid var(--border); border-left: 3px solid var(--warn); border-radius: 14px; padding: 14px 18px; }
.zone-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 22px 0 8px; flex-wrap: wrap; }

/* ---------- Календарь ---------- */
.cal-head, .cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.cal-head div { text-align: center; font-size: 11px; color: var(--text-faint); text-transform: uppercase; font-weight: 700; margin-bottom: 8px; }
.cal-day { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 10px; min-height: 108px; display: flex; flex-direction: column; gap: 5px; cursor: pointer; text-align: left; color: var(--text); font-family: inherit; }
.cal-day { transition: border-color .15s, background .15s, transform .12s; }
.cal-day:hover { border-color: var(--line-hover); }
.cal-day.sel { border-color: var(--red); background: var(--panel2); }
.cal-day.out { opacity: 0.6; }
.cal-day.today { outline: 1.5px solid var(--red); }
.cal-num { font-family: 'Space Grotesk', 'Noto Sans Armenian', sans-serif; font-weight: 700; font-size: 13px; }
.tag { background: var(--red-soft); border: 1px solid rgba(224, 43, 49, 0.25); font-size: 11px; font-weight: 600; border-radius: 6px; padding: 3px 6px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Гистограмма ---------- */
.bars { display: flex; align-items: flex-end; gap: 18px; height: 170px; padding: 0 6px; }
.bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; }
.bar-v { font-size: 11px; font-weight: 700; }
.bar-b { width: 100%; max-width: 46px; background: linear-gradient(180deg, var(--red-hover), var(--red)); border-radius: 6px 6px 0 0; min-height: 2px; transform-origin: bottom; animation: bar-grow .6s var(--ease) backwards; }
.bar-l { font-size: 11px; color: var(--text-faint); }

/* ---------- Модальное окно и уведомления ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.62); backdrop-filter: blur(5px); animation: fade-in .2s ease-out; display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.modal { animation: pop-in .26s var(--ease); width: 460px; max-width: 100%; max-height: calc(100vh - 32px); overflow-y: auto; background: var(--panel2); border: 1px solid var(--border); border-radius: 18px; padding: 24px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); }
.modal-wide { width: 640px; }
.modal-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.modal-h h2 { font-size: 17px; }
.modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.modal-actions .btn { flex: 1; }
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast { background: #fff; color: var(--ink); border-radius: 12px; padding: 12px 20px; font-weight: 600; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); animation: toast-in .3s var(--ease); }
.toast.err { background: var(--warn); color: var(--ink); }

/* ---------- Вход ---------- */
.login-card { animation: pop-in .5s var(--ease); }
.login-logo { filter: drop-shadow(0 6px 22px rgba(224, 43, 49, 0.35)); }
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login-card { width: 400px; max-width: 100%; padding: 32px; }
.brand { font-family: 'Space Grotesk', 'Noto Sans Armenian', sans-serif; font-weight: 700; font-size: 22px; margin-bottom: 4px; }
.login-logo { display: block; width: 190px; height: auto; margin: 0 auto 8px; }
.login-head { text-align: center; margin-bottom: 22px; }
.login-head .muted { margin-top: 2px; }
.t-brand { display: inline-flex; align-items: center; gap: 12px; }
.t-logo { height: 46px; width: auto; }
.report-logo { float: right; width: 110px; height: auto; margin: -6px 0 0 16px; }

/* ---------- Вкладки ---------- */
.tabs { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
.tab { background: var(--panel); border: 1px solid var(--border); color: var(--text-dim); border-radius: 10px; padding: 9px 16px; font-weight: 600; cursor: pointer; text-decoration: none; font-size: 13px; transition: background .2s, color .2s, border-color .2s, transform .12s; }
.tab:hover { color: var(--text); border-color: var(--line-hover); }
.tab.on { background: linear-gradient(180deg, var(--red-hover), var(--red)); color: var(--on-accent); border-color: var(--red); box-shadow: 0 6px 18px rgba(224, 43, 49, 0.3); }
.lvl-toggle { border: 1.5px solid var(--border); background: transparent; color: var(--text-faint); border-radius: 8px; height: 30px; min-width: 38px; font-weight: 700; font-size: 11px; cursor: pointer; }
.lvl-toggle.on { background: var(--red); border-color: var(--red); color: var(--on-accent); }

/* ---------- Клиенты ---------- */
.phone-wrap { display: flex; gap: 6px; align-items: center; }
.phone-wrap .x-btn { height: 42px; width: 42px; color: var(--red); border-color: var(--border); }
.phone-wrap .fld-sm + .x-btn { height: 38px; width: 38px; }
.client-hint { font-size: 12px; margin-top: 6px; min-height: 0; }
.client-hint:empty { display: none; }
.hint-known { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.hint-warn { display: block; margin-top: 6px; background: var(--warn-soft); border: 1px solid var(--warn); border-radius: 8px; padding: 6px 10px; color: var(--text); font-weight: 600; }
.stars { display: inline-flex; gap: 1px; letter-spacing: 0; }
.star { color: var(--dot); font-size: 15px; line-height: 1; background: none; border: none; padding: 0; }
button.star { font-size: 28px; cursor: pointer; padding: 0 2px; }
.star.on { color: var(--amber); }
.warn-box { background: var(--warn-soft); border: 1px solid var(--warn); border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; font-weight: 600; }
.mini-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin-bottom: 16px; }
.mini-stats > div { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.mini-stats .l { font-size: 11px; color: var(--text-faint); text-transform: uppercase; }
.mini-stats .v { font-family: 'Space Grotesk', 'Noto Sans Armenian', sans-serif; font-weight: 700; font-size: 16px; }
.list-row { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.list-row:last-child { border-bottom: none; }
.tbl tr.click { cursor: pointer; }
.tag-check { display: inline-flex; align-items: center; gap: 8px; border: 1.5px solid var(--border); border-radius: 10px; padding: 9px 14px; cursor: pointer; font-weight: 600; font-size: 13px; }
.tag-check input { width: 16px; height: 16px; accent-color: var(--red); }
.tag-check:has(input:checked) { border-color: var(--line-hover); background: var(--panel); }
.tag-check.danger:has(input:checked) { border-color: var(--warn); background: var(--warn-soft); }
.sticky-actions { position: sticky; bottom: -24px; background: var(--panel2); padding: 14px 0 4px; margin-bottom: -4px; border-top: 1px solid var(--border); }
.tbl tr.click:hover td { background: var(--panel2); }

/* ---------- Отчёт для печати ---------- */
.report { background: #fff; color: #111; max-width: 900px; margin: 24px auto; padding: 36px 40px; border-radius: 8px; font-size: 13px; }
.report h1 { font-size: 22px; margin-bottom: 4px; }
.report h2 { font-size: 15px; margin: 22px 0 8px; }
.report .muted { color: #666; }
.report table { width: 100%; border-collapse: collapse; }
.report th, .report td { text-align: left; border-bottom: 1px solid #ddd; padding: 6px 8px; vertical-align: top; }
.report th { font-size: 11px; text-transform: uppercase; color: #666; }
.report .r { text-align: right; white-space: nowrap; }
.report .tot td { font-weight: 700; border-top: 2px solid #111; }
.report .st-done { color: #1f7a35; font-weight: 700; }
/* Отчётный лист кассы: наличные в полку и подписи */
.report .cash-box { margin: 18px 0 0; padding: 12px 14px; border: 2px solid #111; border-radius: 6px; font-size: 16px; display: flex; justify-content: space-between; }
.report .signs { display: grid; grid-template-columns: 1fr 1fr 0.6fr; gap: 28px; margin-top: 44px; font-size: 12px; }
.report .sign-line { border-bottom: 1px solid #111; height: 28px; margin-bottom: 6px; }
@media (max-width: 600px) { .report .signs { grid-template-columns: 1fr; gap: 18px; } }
.report .st-rework { color: #4D7C0F; font-weight: 700; }
.report-bar { max-width: 900px; margin: 16px auto 0; display: flex; gap: 10px; justify-content: space-between; padding: 0 16px; }

@media print {
  body { background: #fff; }
  .report-bar, .toasts, [data-resolve] { display: none !important; }
  .report { margin: 0; padding: 0; max-width: none; border-radius: 0; }
  .report tr { page-break-inside: avoid; }
}

.time-pair { display: grid; grid-template-columns: minmax(0, 1fr) 104px; gap: 10px; }

/* ---------- Адаптация под планшет и телефон ---------- */
/* Скрытые на компьютере элементы, которые нужны только на узком экране */
.add-toggle, .tot-toggle, .td-l, .cal-dots, .cal-legend, .day-list { display: none; }
.wrap-narrow { flex-wrap: wrap; }
@media (min-width: 701px) { .wrap-narrow { flex-wrap: nowrap; } .item-btns { flex-wrap: nowrap; } }
.note-acts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tscroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
/* Цвета типов брони (точки в календаре на телефоне) */
.bd { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: var(--dot); }
.bd-big, .bd-full { background: var(--red); }
.bd-small { background: #5AA9E6; }
/* Брони: циферблаты двух саун на выбранный день */
.dials { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 14px; }
.dial-card { text-align: center; padding-bottom: 8px; }
.dial { width: 100%; max-width: 380px; height: auto; display: block; margin: 0 auto; }
.dseg { cursor: pointer; transition: opacity .15s, transform .2s; animation: dseg-in .5s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 14ms); transform-origin: 170px 170px; }
.dseg.busy { fill: var(--dial-busy); }
.dseg.clean { fill: var(--dial-clean); }
.dseg.free { fill: var(--dial-free); }
.dseg.closed { fill: var(--panel2); stroke: var(--border); stroke-width: 1; pointer-events: none; }
.dseg:hover { opacity: .75; }
.dial-label { fill: var(--text-faint); font-size: 11px; font-weight: 700; text-anchor: middle; dominant-baseline: middle; }
.dial-label.even { fill: var(--text-dim); font-size: 12px; }
/* Граница получаса внутри часа: тонкая отрывистая линия */
.dial-half { stroke: rgba(12, 12, 14, 0.7); stroke-width: 1; stroke-dasharray: 2.5 2.5; pointer-events: none; }
.dial-now { stroke: var(--text); stroke-width: 2.5; stroke-linecap: round; }
.dial-name { fill: var(--text); font-size: 22px; font-weight: 700; text-anchor: middle; }
.dial-sub { fill: var(--text-dim); font-size: 13px; text-anchor: middle; }
.dial-legend { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; font-size: 13px; }
.dial-legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg { display: inline-block; width: 14px; height: 14px; border-radius: 4px; }
.lg.busy { background: var(--dial-busy); } .lg.clean { background: var(--dial-clean); } .lg.free { background: var(--dial-free); } .lg.closed { background: var(--panel2); border: 1px solid var(--border); }
.book-row { display: flex; align-items: center; gap: 14px; padding: 12px 16px; cursor: pointer; flex-wrap: wrap; }
.book-row:hover { border-color: var(--line-hover); }
@media (max-width: 800px) { .dials { grid-template-columns: 1fr; } }
/* Отметка «агент ещё должен деньги» в календаре */
.debt-mark { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; border-radius: 6px; background: var(--amber); color: var(--ink); font-size: 12px; font-weight: 800; padding: 0 3px; }

/* Сенсорный экран (планшет, телефон): всё, что нажимается пальцем, не меньше 44 px */
@media (pointer: coarse), (max-width: 1100px) {
  .btn { min-height: 44px; }
  .btn-sm { height: 44px; padding: 0 16px; font-size: 13px; border-radius: 10px; }
  .round-btn, .x-btn { width: 44px; height: 44px; }
  .phone-wrap .x-btn, .phone-wrap .fld-sm + .x-btn { width: 44px; height: 44px; }
  .lang-btn { height: 40px; }
  .link-btn { min-height: 44px; padding: 10px 8px; font-size: 13px; }
  .lvl-toggle { height: 44px; min-width: 48px; font-size: 13px; }
  button.star { font-size: 34px; padding: 0 4px; }
  .check { min-height: 44px; }
  .check input { width: 22px; height: 22px; }
  .tag-check { min-height: 44px; }
  .tag-check input { width: 20px; height: 20px; }
  .tab { padding: 12px 18px; }
  .chip { padding: 12px 16px; font-size: 13px; }
  .fld { height: 46px; font-size: 15px; }
  .fld-sm { height: 44px; }
  .photo-del { width: 30px; height: 30px; top: -10px; right: -10px; }
  .photo-thumb img { width: 84px; height: 84px; }
}

/* Склад: на ноутбуке и планшете форма добавления открывается кнопкой, список — во всю ширину */
@media (max-width: 1400px) {
  .wh-grid { grid-template-columns: 1fr; }
  .wh-grid .add-card { order: -1; }
  .wh-grid .add-card:not(.open) { display: none; }
  .add-toggle { display: inline-flex; margin-bottom: 16px; }
}

/* Планшет (вертикально и горизонтально до 1100 px) */
@media (max-width: 1100px) {
  .kassa-grid { grid-template-columns: 1fr; }
  .add-first { order: -1; }
  .totals { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .totals .grand { grid-column: span 3; }
  .quick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar-page { order: 3; width: 100%; }
  .user-meta { display: none; }
  .user-pill { padding: 4px; }
  .lang-btn span { display: none; }
  .lang-btn { padding: 0 10px; }
  /* Широкие таблицы склада — карточками */
  .tbl.tbl-md, .tbl.tbl-md tbody { display: block; width: 100%; }
  .tbl.tbl-md thead { display: none; }
  .tbl.tbl-md tr { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px 16px; padding: 14px 4px; border-bottom: 1px solid var(--border); }
  .tbl.tbl-md tr:last-child { border-bottom: none; }
  .tbl.tbl-md td { display: block; padding: 0; border: none; min-width: 0; text-align: left; font-size: 14px; }
  .tbl.tbl-md td:empty { display: none; }
  .tbl.tbl-md .td-l { display: block; font-size: 11px; font-weight: 700; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 3px; }
  .tbl.tbl-md td.td-main { grid-column: 1 / -1; font-size: 16px; font-weight: 700; }
  .tbl.tbl-md td.td-full, .tbl.tbl-md td.td-act { grid-column: 1 / -1; }
  .tbl.tbl-md td.td-act .actions { justify-content: flex-start; flex-wrap: wrap; }
  .tbl.tbl-md tr.low { background: var(--warn-soft); border-radius: 12px; padding: 14px 12px; }
  .tbl.tbl-md tr.low td { background: none; }
}

@media (max-width: 860px) {
  .page { padding: 0 16px 32px; }
  .topbar { padding: 18px 0 16px; gap: 12px; }
  .tiles, .tiles-2, .tiles-3, .tiles-4 { grid-template-columns: 1fr; gap: 14px; }
  .tile, .tiles-2 .tile, .tiles-3 .tile, .tiles-4 .tile { min-height: 0; display: grid; grid-template-columns: 52px minmax(0, 1fr); column-gap: 16px; row-gap: 4px; align-items: center; text-align: left; padding: 18px; }
  .tile-icon, .tiles-2 .tile-icon, .tiles-3 .tile-icon, .tiles-4 .tile-icon { width: 52px; height: 52px; grid-column: 1; grid-row: 1 / span 3; }
  .tile-title, .tiles-2 .tile-title, .tiles-3 .tile-title, .tiles-4 .tile-title { font-size: 17px; grid-column: 2; overflow-wrap: anywhere; }
  .tile-sub { grid-column: 2; overflow-wrap: anywhere; }
  .tile-badge { position: static; grid-column: 2; grid-row: 1; justify-self: start; }
  .kpis, .kpis-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .week { gap: 5px; }
  .wd { padding: 8px 2px; }
  .cl-grid { flex-direction: column; }
  .zones { width: 100%; position: static; }
  .item { flex-direction: column; align-items: stretch; }
  .state-btns .btn-state { flex: 1; min-width: 0; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .line-sale, .line-vs { grid-template-columns: 1fr 0.5fr 0.7fr 44px; }
  .line-sale .sum, .line-vs .sum { display: none; }
  .line-rent, .line-extra, .line-vr { grid-template-columns: 1fr 0.8fr 44px; }
  .cal, .cal-head { gap: 4px; }
  .cal-day { min-height: 72px; padding: 6px; }
  .clock { display: none; }
  .progress { width: 140px; }
  .report { padding: 20px 16px; margin: 0; border-radius: 0; }
  .report-bar { flex-wrap: wrap; }
  .zone-tiles { grid-template-columns: 1fr; }
}

/* Телефон */
@media (max-width: 700px) {
  .page { padding: 0 12px 28px; }
  .topbar-r { order: -1; width: 100%; justify-content: flex-end; gap: 8px; }
  .topbar-l { width: 100%; }
  .t-title { font-size: 19px; }
  .topbar-page .row { flex-wrap: nowrap; }
  .card { padding: 18px 16px; }
  .table-card { padding: 4px 14px; }
  .modal { padding: 18px 16px; }
  .modal-actions { flex-wrap: wrap; }
  .kpi-v { font-size: 19px; }
  .search select { width: 100% !important; }
  #k-shift, #k-resp { width: 100% !important; }
  .day-nav { flex-wrap: wrap; }
  .kassa-actions .btn { flex: 1 1 140px; }
  .zone-nav .btn { flex: 1 1 auto; }
  .bi-btn { height: 58px; font-size: 14px; gap: 6px; }
  .bi-text { font-size: 17px; }
  .ic-text { font-size: 22px; min-height: 64px; margin-bottom: 18px; }
  .alert { flex-wrap: wrap; }
  .alert > div[style*="flex:1"] { flex: 1 1 calc(100% - 44px) !important; }
  .alert > .btn { width: 100%; }
  .item-one { padding: 20px 16px; }
  .item-one .bi-btn { height: 72px; font-size: 16px; }
  .rate-btn { height: 64px; font-size: 24px; }
  .kind-sel { width: 100%; }
  .rate-btns { gap: 6px; }
  .item-nav { grid-template-columns: 1fr 1fr; }
  .item-nav .ic-count { grid-column: 1 / -1; grid-row: 1; padding-bottom: 4px; }
  .item-nav [data-prev], .item-nav [data-next] { min-width: 0; width: 100%; font-size: 14px; }
  .field[style*="grid-template-columns:1fr 110px"] { grid-template-columns: 1fr 90px !important; }
  .note { flex-wrap: wrap; align-items: flex-start; }
  .note-text { flex: 1 1 calc(100% - 40px); }
  .note-acts { width: 100%; }
  .note-acts .btn { flex: 1 1 auto; }
  .time-pair { grid-template-columns: minmax(0, 1fr) 96px; }
  .btn { white-space: normal; height: auto; min-height: 44px; padding-top: 8px; padding-bottom: 8px; line-height: 1.25; text-align: center; }
  .btn-lg { min-height: 52px; }
  .card-h { flex-wrap: wrap; }
  .wrap-narrow > * { flex: 1 1 140px; }

  /* Календарь броней: точки в клетках и список броней выбранного дня */
  .cal-day { min-height: 54px; padding: 6px 4px; align-items: center; gap: 6px; }
  .cal-day .tag, .cal-day .cal-more { display: none; }
  .cal-dots { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px; }
  .cal-day.sel { border-color: var(--text); background: var(--panel2); }
  .cal-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; font-size: 12px; color: var(--text-dim); }
  .cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
  .day-list { display: block; }
  .day-item { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 14px; margin-bottom: 8px; color: var(--text); font-family: inherit; font-size: 14px; cursor: pointer; }
  .day-item .bd { width: 12px; height: 12px; }
}

/* Касса на телефоне и на невысоком планшете: панель итогов свёрнута до «Итого за день», раскрывается кнопкой */
@media (max-width: 700px), (max-width: 1100px) and (max-height: 820px) {
  .totals { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 10px; gap: 8px; margin-top: 18px; }
  .totals .grand { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px; text-align: left; padding: 8px 12px; }
  .totals .grand .v { font-size: 20px; }
  .totals:not(.open) .tot-d { display: none; }
  .tot-toggle { display: inline-flex; align-items: center; height: 40px; padding: 0 14px; border-radius: 10px; border: 1.5px solid rgba(255, 255, 255, 0.5); background: transparent; color: var(--on-accent); font-weight: 700; font-family: inherit; cursor: pointer; }

}

/* Телефон и планшет вертикально: все таблицы — карточками с подписями полей */
@media (max-width: 920px) {
  .tbl:not(.tbl-keep), .tbl:not(.tbl-keep) tbody { display: block; width: 100%; }
  .tbl:not(.tbl-keep) thead { display: none; }
  .tbl:not(.tbl-keep) tr { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px 14px; padding: 14px 2px; border-bottom: 1px solid var(--border); }
  .tbl:not(.tbl-keep) tr:last-child { border-bottom: none; }
  .tbl:not(.tbl-keep) td { display: block; padding: 0; border: none; min-width: 0; text-align: left; font-size: 14px; }
  .tbl:not(.tbl-keep) td:empty { display: none; }
  .tbl:not(.tbl-keep) .td-l { display: block; font-size: 11px; font-weight: 700; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 3px; }
  .tbl:not(.tbl-keep) td.td-main { grid-column: 1 / -1; font-size: 15px; font-weight: 700; }
  .tbl:not(.tbl-keep) td.td-full, .tbl:not(.tbl-keep) td.td-act { grid-column: 1 / -1; }
  .tbl:not(.tbl-keep) td.td-act .actions { justify-content: flex-start; flex-wrap: wrap; }
  .tbl:not(.tbl-keep) tr.low { background: var(--warn-soft); border-radius: 12px; padding: 14px 12px; }
  .tbl:not(.tbl-keep) tr.low td { background: none; }

}
