/* ============================================================
   Мойка 24 — прототип интерфейса
   ============================================================ */

:root {
  --bg: #eef2f8;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --line: #e3e9f2;
  --line-strong: #cfd9e8;

  --brand: #1668e3;
  --brand-ink: #0b4fbe;
  --brand-soft: #e8f0fe;
  --brand-ring: rgba(22, 104, 227, 0.22);

  --green: #0f9d58;
  --green-soft: #e6f6ee;
  --red: #dc2626;
  --red-soft: #fdecec;
  --amber: #c2740a;
  --amber-soft: #fff4e2;
  --violet: #7c3aed;
  --violet-soft: #f1ebff;
  --cyan: #0891b2;

  --r-sm: 9px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 1px 2px rgba(15, 23, 42, 0.04), 0 10px 28px -16px rgba(15, 23, 42, 0.28);
  --shadow-lg: 0 24px 60px -24px rgba(15, 23, 42, 0.35);

  --font: "Segoe UI", "Inter", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink);
  background:
    radial-gradient(900px 500px at 12% -10%, #dbe9ff 0%, transparent 60%),
    radial-gradient(800px 480px at 100% 0%, #d8f4f8 0%, transparent 55%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.modal-open { overflow: hidden; }

button, input, select, textarea { font: inherit; color: inherit; }

h1, h2, h3, p { margin: 0; }

a { color: var(--brand); }

.ic {
  width: 18px;
  height: 18px;
  flex: none;
  display: block;
}

.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------------- Top bar ---------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(227, 233, 242, 0.9);
}

.topbar-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, #2f8bff, #0b53c9);
  box-shadow: 0 8px 18px -8px rgba(22, 104, 227, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.brand-mark .ic { width: 22px; height: 22px; }

.brand-name { font-weight: 750; font-size: 17px; letter-spacing: -0.01em; line-height: 1.15; }
.brand-sub { color: var(--muted); font-size: 12.5px; margin-top: 1px; }

.topbar-tools {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.shift-field, .role-field {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 8px 0 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.shift-field > span, .role-field > span {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted-2);
  font-weight: 700;
  white-space: nowrap;
}
.shift-field input[type="date"] {
  border: 0;
  background: transparent;
  outline: none;
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
  padding: 0;
  width: 128px;
}
.role-field select {
  border: 0;
  background: transparent;
  outline: none;
  font-weight: 650;
  font-size: 14px;
  color: var(--ink);
  padding: 0 4px 0 0;
  cursor: pointer;
  max-width: 150px;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-2);
  cursor: pointer;
  position: relative;
  box-shadow: var(--shadow-sm);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--line-strong); color: var(--ink); }
.icon-btn.danger:hover { background: var(--red-soft); color: var(--red); border-color: #f6c9c9; }
.icon-btn.ghost { border-color: transparent; background: transparent; box-shadow: none; }
.icon-btn.ghost:hover { background: #eef3fb; }

.bell-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--red);
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
  display: grid;
  place-items: center;
  border: 2px solid #fff;
  box-sizing: content-box;
}

/* ---------------- Shell ---------------- */

.shell {
  max-width: 1320px;
  margin: 0 auto;
  padding: 22px 24px 56px;
}

/* ---------------- KPI ---------------- */

.kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 14px 15px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  box-shadow: var(--shadow-md);
  min-width: 0;
}

.kpi-ic {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  flex: none;
}
.kpi-ic .ic { width: 19px; height: 19px; }
.ic-blue { background: var(--brand-soft); color: var(--brand); }
.ic-green { background: var(--green-soft); color: var(--green); }
.ic-amber { background: var(--amber-soft); color: var(--amber); }
.ic-violet { background: var(--violet-soft); color: var(--violet); }
.ic-cyan { background: #e0f7fb; color: var(--cyan); }

.kpi-body { min-width: 0; }
.kpi-label {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kpi-value {
  font-size: 25px;
  font-weight: 780;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.kpi-value small { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.kpi-sub { font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.3; }

/* ---------------- Toolbar ---------------- */

.toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 4px 0 12px;
  flex-wrap: wrap;
}

.toolbar-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.toolbar-right { display: flex; align-items: center; gap: 9px; margin-left: auto; }

.search {
  position: relative;
  display: flex;
  align-items: center;
  width: 260px;
  height: 40px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 11px;
  box-shadow: var(--shadow-sm);
}
.search .ic { position: absolute; left: 11px; width: 17px; height: 17px; color: var(--muted-2); pointer-events: none; }
.search input {
  border: 0;
  outline: none;
  background: transparent;
  width: 100%;
  height: 100%;
  padding: 0 12px 0 36px;
  font-size: 14px;
}
.search input::placeholder { color: var(--muted-2); }
.search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }

.box-filter { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.filter-chip {
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.15s;
  white-space: nowrap;
}
.filter-chip:hover { border-color: var(--line-strong); background: var(--surface-2); }
.filter-chip.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

/* ---------------- Buttons ---------------- */

.btn {
  height: 40px;
  padding: 0 15px;
  border-radius: 11px;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.05s;
  text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn .ic { width: 17px; height: 17px; }

.btn-primary {
  background: linear-gradient(180deg, #2b7bf0, #1264dc);
  color: #fff;
  box-shadow: 0 8px 18px -10px rgba(22, 104, 227, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.btn-primary:hover { filter: brightness(1.04); }

.btn-ghost { background: #fff; border-color: var(--line); color: var(--ink-2); box-shadow: var(--shadow-sm); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--line-strong); }

.btn-soft { background: var(--brand-soft); color: var(--brand-ink); }
.btn-soft:hover { background: #dde9fd; }

.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { filter: brightness(1.05); }

.btn-sm { height: 33px; padding: 0 11px; border-radius: 9px; font-size: 13px; gap: 6px; }
.btn-sm .ic { width: 15px; height: 15px; }

.btn-block { width: 100%; }

.btn[disabled] { opacity: 0.45; cursor: not-allowed; }

/* ---------------- Table card ---------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-md);
}

.table-card { overflow: hidden; }

.table-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px 12px;
}
.table-title { font-size: 15px; font-weight: 750; display: flex; align-items: center; gap: 8px; }
.count-pill {
  min-width: 24px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: #eef3fb;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 700;
  display: inline-grid;
  place-items: center;
}
.table-hint { margin-left: auto; font-size: 12.5px; color: var(--muted-2); }

.table-scroll { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

thead th {
  position: static;
  z-index: 2;
  background: #f7f9fd;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: left;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
thead th.th-actions { text-align: right; }

tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background 0.12s; }
tbody tr:hover td { background: #f9fbff; }

.row-active td { background: linear-gradient(90deg, #f2f7ff 0%, #ffffff 55%); }
.row-active:hover td { background: linear-gradient(90deg, #eaf2ff 0%, #fbfdff 55%); }
.row-active td:first-child { box-shadow: inset 3px 0 0 var(--brand); }

.row-canceled td { background: #fcfcfd; }
.row-canceled .car-name { text-decoration: line-through; color: var(--muted); }
.row-canceled .td-sum, .row-canceled .time-btn { opacity: 0.6; }

.cell-no { color: var(--muted); font-weight: 700; font-variant-numeric: tabular-nums; width: 54px; }

.box-chip {
  display: inline-grid;
  place-items: center;
  min-width: 30px;
  height: 28px;
  padding: 0 8px;
  border-radius: 8px;
  background: #f1f5fb;
  border: 1px solid #e4ebf6;
  color: var(--ink-2);
  font-weight: 700;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.car-name { font-weight: 650; letter-spacing: -0.005em; }
.card-kicker { display: none; }
.dot-sep { color: var(--line-strong); }
.car-meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; display: flex; align-items: center; gap: 6px; }
.car-note {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-style: italic;
}
.car-note .ic { width: 13px; height: 13px; flex: none; color: var(--amber); }

.time-btn {
  border: 0;
  background: transparent;
  padding: 3px 5px;
  margin: -3px -5px;
  border-radius: 7px;
  font-weight: 650;
  font-size: 14.5px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  border-bottom: 1px dashed transparent;
  transition: 0.14s;
  white-space: nowrap;
}
.time-btn:hover { background: var(--brand-soft); color: var(--brand-ink); border-bottom-color: var(--brand); }
.time-btn.static { cursor: default; }
.time-btn.static:hover { background: transparent; color: inherit; border-bottom-color: transparent; }

.time-empty { color: var(--muted-2); font-weight: 500; }

.audit-dot {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 5px;
  color: var(--amber);
  font-size: 11px;
  font-weight: 700;
  vertical-align: 1px;
  cursor: pointer;
  border: 0;
  background: transparent;
  padding: 2px 3px;
  border-radius: 5px;
}
.audit-dot:hover { background: var(--amber-soft); }
.audit-dot .ic { width: 12px; height: 12px; }

.td-sum { min-width: 132px; }
.sum-line { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.sum-main {
  font-weight: 780;
  font-size: 15.5px;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.sum-main.est { color: var(--muted); font-weight: 650; }
.sum-sales {
  font-size: 12px;
  font-weight: 650;
  color: var(--amber);
  background: var(--amber-soft);
  padding: 1px 5px;
  border-radius: 5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.sum-sub { margin-top: 3px; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.sum-note { font-size: 11.5px; color: var(--muted-2); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 8px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}
.chip .ic { width: 13px; height: 13px; }
.chip-green { background: var(--green-soft); color: #0b7a45; }
.chip-blue { background: var(--brand-soft); color: var(--brand-ink); }
.chip-violet { background: var(--violet-soft); color: var(--violet); }
.chip-amber { background: var(--amber-soft); color: var(--amber); }
.chip-red { background: var(--red-soft); color: var(--red); }
.chip-gray { background: #f1f5f9; color: var(--muted); }

.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }

.pulse { position: relative; }
.pulse::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid currentColor;
  opacity: 0.5;
  animation: pulse 1.8s ease-out infinite;
}
@keyframes pulse {
  0% { transform: scale(0.6); opacity: 0.55; }
  70% { transform: scale(1.5); opacity: 0; }
  100% { opacity: 0; }
}

.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.td-actions { text-align: right; }

.empty {
  padding: 52px 24px;
  text-align: center;
  color: var(--muted);
}
.empty-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: #f1f6ff;
  color: var(--brand);
  display: grid;
  place-items: center;
  margin: 0 auto 12px;
}
.empty-icon .ic { width: 26px; height: 26px; }
.empty-title { font-weight: 700; color: var(--ink); font-size: 15.5px; margin-bottom: 4px; }
.empty p { font-size: 13.5px; max-width: 380px; margin: 0 auto; }

.table-foot {
  padding: 11px 18px;
  border-top: 1px solid var(--line);
  background: #fbfcfe;
  font-size: 12px;
  color: var(--muted-2);
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.table-foot b { color: var(--ink-2); font-weight: 650; }

/* ---------------- Drawer ---------------- */

.drawer-veil {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.32);
  z-index: 80;
  animation: fade 0.18s ease-out;
}
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(420px, 100%);
  background: #fff;
  z-index: 81;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  animation: slide-in 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.drawer-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--line);
}
.drawer-head h2 { font-size: 16px; font-weight: 750; }
.drawer-head .icon-btn { margin-left: auto; }
.drawer-body { overflow-y: auto; padding: 14px 14px 24px; }

.service-box {
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: var(--r-md);
  padding: 12px;
  margin-bottom: 14px;
}
.service-title {
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 8px;
}
.service-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  padding: 3px 0;
  color: var(--ink-2);
}
.service-row .ic { width: 15px; height: 15px; color: var(--muted-2); }
.service-row b { margin-left: auto; font-weight: 650; font-size: 12.5px; }

.notif-list { display: flex; flex-direction: column; gap: 8px; }
.notif {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 10px 11px;
  display: flex;
  gap: 10px;
  background: #fff;
}
.notif-ic {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  flex: none;
  background: var(--brand-soft);
  color: var(--brand);
}
.notif-ic .ic { width: 15px; height: 15px; }
.notif-body { min-width: 0; flex: 1; }
.notif-top { display: flex; align-items: baseline; gap: 8px; }
.notif-title { font-size: 13px; font-weight: 700; }
.notif-time { margin-left: auto; font-size: 11px; color: var(--muted-2); white-space: nowrap; }
.notif-text { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.notif-tag { font-size: 10.5px; font-weight: 700; color: var(--muted-2); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.04em; }

/* ---------------- Modals ---------------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  animation: fade 0.16s ease-out;
  overflow-y: auto;
}

.modal {
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 36px);
  background: #fff;
  border-radius: 19px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  animation: pop 0.18s cubic-bezier(0.2, 0.9, 0.3, 1.15);
  overflow: hidden;
}
.modal-sm { max-width: 460px; }
.modal-lg { max-width: 760px; }
.modal-xl { max-width: 920px; }

.modal-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 17px 20px 14px;
  border-bottom: 1px solid var(--line);
}
.modal-head h2 { font-size: 16.5px; font-weight: 750; letter-spacing: -0.01em; }
.modal-head .modal-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.modal-head .icon-btn { margin-left: auto; flex: none; }

.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot {
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  background: #fbfcfe;
  display: flex;
  gap: 9px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.modal-foot .btn { min-width: 108px; }
.modal-foot .foot-note { margin-right: auto; font-size: 12px; color: var(--muted-2); align-self: center; }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(0.985); } to { opacity: 1; transform: none; } }
@keyframes slide-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------------- Forms ---------------- */

.field { margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.field > label, .field-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}
.input, .select, .textarea {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  padding: 0 12px;
  font-size: 14.5px;
  outline: none;
  transition: border-color 0.14s, box-shadow 0.14s;
}
.textarea { height: auto; min-height: 88px; padding: 10px 12px; resize: vertical; line-height: 1.45; }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-ring);
}
.input:disabled, .select:disabled { background: #f6f8fb; color: var(--muted); }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.field-hint { font-size: 12px; color: var(--muted-2); margin-top: 5px; }

.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-2);
  cursor: pointer;
}
.check input { width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--brand); flex: none; }
.check b { display: block; font-size: 13.5px; font-weight: 650; }
.check span { display: block; font-size: 12px; color: var(--muted); }

.segmented { display: flex; gap: 6px; flex-wrap: wrap; }
.segmented.is-column { flex-direction: column; }
.segmented.is-column .seg-opt span { width: 100%; }
.seg-opt { position: relative; }
.seg-opt input { position: absolute; opacity: 0; pointer-events: none; }
.seg-opt span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 42px;
  padding: 0 15px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  background: #fff;
  transition: 0.14s;
  white-space: nowrap;
}
.seg-opt span .ic { width: 16px; height: 16px; color: var(--muted); }
.seg-opt input:checked + span {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-ink);
  box-shadow: 0 0 0 1px var(--brand) inset;
}
.seg-opt input:checked + span .ic { color: var(--brand); }
.seg-opt input:focus-visible + span { box-shadow: 0 0 0 3px var(--brand-ring); }

/* ---------------- Info / totals ---------------- */

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
.info-cell {
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 9px 11px;
  background: var(--surface-2);
}
.info-cell .k { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted-2); font-weight: 700; }
.info-cell .v { font-size: 14.5px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }

.breakdown {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 14px;
}
.breakdown-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  font-size: 13px;
  border-bottom: 1px solid var(--line);
}
.breakdown-row:last-child { border-bottom: 0; }
.breakdown-row span { color: var(--muted); }
.breakdown-row b { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 650; }

.total-box {
  border: 1px solid #cfe0fb;
  background: linear-gradient(180deg, #f5f9ff, #eef5ff);
  border-radius: 13px;
  padding: 13px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.total-box .t-label { font-size: 12.5px; color: var(--muted); font-weight: 650; }
.total-box .t-value { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: var(--brand-ink); }
.total-box .t-value small { font-size: 13px; color: var(--muted); font-weight: 650; letter-spacing: 0; }

.alert {
  display: flex;
  gap: 9px;
  padding: 10px 12px;
  border-radius: 11px;
  font-size: 12.5px;
  line-height: 1.4;
  margin-bottom: 14px;
}
.alert .ic { width: 16px; height: 16px; flex: none; margin-top: 1px; }
.alert-amber { background: var(--amber-soft); color: #7c4a04; border: 1px solid #f3dcb4; }
.alert-blue { background: var(--brand-soft); color: var(--brand-ink); border: 1px solid #cfe0fb; }
.alert-red { background: var(--red-soft); color: #991b1b; border: 1px solid #f6c9c9; }

/* ---------------- History ---------------- */

.history { margin-top: 4px; }
.history-title {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted-2);
  font-weight: 750;
  margin-bottom: 7px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.history-title .ic { width: 14px; height: 14px; }
.history-list { display: flex; flex-direction: column; gap: 6px; max-height: 180px; overflow-y: auto; }
.history-item {
  display: flex;
  gap: 8px;
  font-size: 12.5px;
  padding: 7px 9px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  align-items: baseline;
}
.history-item .h-when { color: var(--muted-2); font-size: 11.5px; white-space: nowrap; }
.history-item .h-what { color: var(--ink-2); }
.history-item .h-what b { font-variant-numeric: tabular-nums; }
.history-item .h-by { margin-left: auto; color: var(--muted-2); font-size: 11.5px; white-space: nowrap; }

/* ---------------- Sales ---------------- */

.sale-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.sale-picker {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
}
.sale-picker .select { grid-column: 1 / -1; }
.sale-picker .qty { margin-left: 0; justify-self: start; }
.sale-picker .sale-pay { justify-self: start; }
.sale-picker .btn { justify-self: end; height: 40px; }
.sale-pay {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
}
.pay-opt {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 9px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
}
.pay-opt .ic { width: 14px; height: 14px; }
.pay-opt:hover { color: var(--ink); }
.pay-opt.active { background: var(--brand); color: #fff; }
.pay-opt.active .ic { color: #fff; }
.sale-item {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
}
.sale-item.on { border-color: #cfe0fb; background: #f7faff; }
.sale-item .qty { margin-left: 0; flex: none; }
.sale-sum {
  margin-left: auto;
  font-weight: 750;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.sale-empty {
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  color: var(--muted-2);
  font-size: 13px;
}

.tg-row {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 6px;
}
.tg-row b { font-size: 13px; }
.tg-role {
  height: 32px;
  width: auto;
  min-width: 104px;
  padding: 0 6px;
  font-size: 12px;
  flex: none;
}

.user-row {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 6px;
}
.user-row b { font-size: 13px; }
.credential {
  font-family: ui-monospace, Consolas, "Courier New", monospace;
  font-size: 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  word-break: break-all;
}
.sale-name { font-weight: 650; font-size: 14px; }
.sale-price { color: var(--muted); font-size: 12.5px; margin-top: 1px; font-variant-numeric: tabular-nums; }
.qty { margin-left: auto; display: flex; align-items: center; gap: 2px; background: #fff; border: 1px solid var(--line-strong); border-radius: 10px; padding: 2px; }
.qty button {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  cursor: pointer;
  font-size: 17px;
  font-weight: 600;
  color: var(--ink-2);
  display: grid;
  place-items: center;
}
.qty button:hover { background: var(--brand-soft); color: var(--brand-ink); }
.qty .q { min-width: 28px; text-align: center; font-weight: 750; font-variant-numeric: tabular-nums; }

.sale-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 13px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 14px;
}
.sale-total b { font-size: 18px; font-variant-numeric: tabular-nums; }
.sale-total small { font-size: 11.5px; color: var(--muted); font-weight: 600; margin-left: 4px; }

/* ---------------- Расчёт смены ---------------- */

.calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.calc-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
  font-weight: 650;
  color: var(--muted);
}
.calc-field .input { height: 40px; }
.calc-auto {
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 10px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.calc-auto span {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted-2);
  font-weight: 700;
}
.calc-auto b {
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}
.calc-auto small {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.calc-formula {
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 12px;
  font-variant-numeric: tabular-nums;
}
.calc-formula b { color: var(--ink); font-size: 14px; }
.calc-hint { font-size: 12px; color: var(--muted); text-align: right; line-height: 1.4; }

/* ---------------- Settings ---------------- */

.tabs {
  display: flex;
  gap: 4px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}
.tab {
  border: 0;
  background: transparent;
  padding: 12px 11px;
  font-size: 13.5px;
  font-weight: 650;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--brand-ink); border-bottom-color: var(--brand); }

.tier-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.tier-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}
.tier-row .input { height: 38px; width: 84px; text-align: center; font-weight: 650; }
.tier-row .tier-last { font-size: 13px; color: var(--muted); white-space: nowrap; }
.tier-row .icon-btn { width: 32px; height: 32px; }

.prod-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.prod-row .input { height: 38px; }
.prod-row .p-name { flex: 1; }
.prod-row .p-price { width: 120px; }
.prod-row .icon-btn { width: 34px; height: 34px; flex: none; }

.switch-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.switch-row:last-child { border-bottom: 0; }
.switch-row .sw-text { flex: 1; }
.switch-row b { display: block; font-size: 13.5px; font-weight: 650; }
.switch-row span { display: block; font-size: 12px; color: var(--muted); }

.switch { position: relative; width: 42px; height: 25px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch .track {
  position: absolute;
  inset: 0;
  background: #d7dfeb;
  border-radius: 999px;
  transition: 0.16s;
  pointer-events: none;
}
.switch .track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 19px;
  height: 19px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.3);
  transition: 0.16s;
}
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { transform: translateX(17px); }

.price-preview {
  border: 1px dashed var(--line-strong);
  border-radius: 11px;
  padding: 10px 12px;
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 12px;
  line-height: 1.7;
}
.price-preview b { color: var(--ink-2); font-variant-numeric: tabular-nums; }

.role-matrix { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.role-matrix th, .role-matrix td { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.role-matrix th { color: var(--muted-2); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; }
.role-matrix td:not(:first-child) { text-align: center; }
.role-matrix .yes { color: var(--green); font-weight: 800; }
.role-matrix .no { color: #d3dae6; }

/* ---------------- Report ---------------- */

.report-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, #0f172a, #1e3a66);
  color: #fff;
  margin-bottom: 14px;
}
.report-hero .rh-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.08em; opacity: 0.65; font-weight: 700; }
.report-hero .rh-value { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.report-hero .rh-side { margin-left: auto; text-align: right; font-size: 12.5px; opacity: 0.8; line-height: 1.6; }

.report-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.report-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 13px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
}
.report-line span { color: var(--muted); }
.report-line b { margin-left: auto; font-variant-numeric: tabular-nums; }

/* ---------------- Toast ---------------- */

.toast-root {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
  width: max-content;
  max-width: calc(100vw - 32px);
}
.toast {
  background: #0f172a;
  color: #fff;
  border-radius: 11px;
  padding: 10px 15px;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 18px 40px -18px rgba(15, 23, 42, 0.8);
  animation: toast-in 0.2s ease-out;
  display: flex;
  align-items: center;
  gap: 8px;
}
.toast .ic { width: 16px; height: 16px; color: #7ee2a8; }
.toast.err .ic { color: #fca5a5; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------------- Responsive ---------------- */

@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .brand-sub { display: none; }
}

@media (max-width: 900px) {
  .topbar-inner { padding: 10px 14px; gap: 10px; flex-wrap: wrap; }
  .topbar-tools { margin-left: 0; width: 100%; justify-content: space-between; gap: 8px; }
  .shift-field > span, .role-field > span { display: none; }
  .shift-field, .role-field { height: 36px; padding: 0 8px; }
  .role-field select { max-width: 118px; font-size: 13px; }
  .shift-field input[type="date"] { width: 116px; font-size: 13px; }
  .shell { padding: 14px 12px 40px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .kpi { padding: 11px 12px; gap: 9px; border-radius: 14px; }
  .kpi-ic { width: 32px; height: 32px; border-radius: 9px; }
  .kpi-value { font-size: 20px; }
  .toolbar { gap: 9px; }
  .search { width: 100%; }
  .toolbar-left { width: 100%; }
  .box-filter { overflow-x: auto; flex-wrap: nowrap; width: 100%; padding-bottom: 2px; -webkit-overflow-scrolling: touch; }
  .toolbar-right { width: 100%; flex-wrap: wrap; }
  .toolbar-right .btn { flex: 1 1 calc(50% - 5px); }
  .toolbar-right .btn:nth-child(3):last-child { flex-basis: 100%; }
  .table-hint { display: none; }

  /* card-style table */
  .table-scroll table, .table-scroll thead, .table-scroll tbody, .table-scroll tr, .table-scroll td {
    display: block;
    width: 100%;
  }
  .table-scroll thead { display: none; }
  .table-scroll { overflow: visible; }
  .table-scroll tbody { padding: 4px 10px 10px; }
  .table-scroll tr {
    border: 1px solid var(--line);
    border-radius: 14px;
    margin: 8px 0;
    padding: 10px 12px 12px;
    position: relative;
    background: #fff;
  }
  .table-scroll tr.row-active { border-color: #cfdffb; }
  .table-scroll td {
    border: 0;
    padding: 4px 0;
    background: transparent !important;
  }
  .table-scroll td[data-label]::before {
    content: attr(data-label);
    display: inline-block;
    width: 92px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted-2);
    font-weight: 700;
  }
  .table-scroll td.cell-no,
  .table-scroll td[data-label="Бокс"] { display: none; }
  .table-scroll tr.row-active { border-left: 3px solid var(--brand); }
  .table-scroll tr.row-active td:first-child { box-shadow: none; }
  .table-scroll td[data-label="Заезд"], .table-scroll td[data-label="Выезд"] { display: inline-flex; width: 50%; align-items: center; padding: 2px 0; }
  .table-scroll td[data-label="Заезд"]::before, .table-scroll td[data-label="Выезд"]::before { width: auto; margin-right: 6px; }
  .table-scroll td[data-label="Сумма"] { display: flex; align-items: center; gap: 8px; padding-top: 6px; }
  .table-scroll td[data-label="Сумма"]::before { width: auto; margin-right: 4px; }
  .table-scroll td[data-label="Оплата"] { display: flex; align-items: center; gap: 8px; }
  .table-scroll td[data-label="Оплата"]::before { width: auto; margin-right: 4px; }
  .table-scroll td[data-label="Марка"]::before { display: none; }
  .table-scroll .td-actions { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }
  .table-scroll .row-actions { justify-content: flex-start; }
  .table-scroll .row-actions .btn { flex: 1; }
  .card-kicker {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 750;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted-2);
    margin-bottom: 3px;
  }
  .card-kicker b { color: var(--ink-2); font-weight: 750; }
  .table-foot { display: none; }

  .modal-backdrop { padding: 0; align-items: flex-end; }
  .modal {
    max-width: 100%;
    max-height: 94vh;
    border-radius: 20px 20px 0 0;
  }
  .modal-body { padding: 16px; }
  .modal-head { padding: 15px 16px 12px; }
  .modal-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
  .modal-foot .btn { flex: 1; min-width: 0; }
  .modal-foot .foot-note { display: none; }
  .field-row, .field-row-3 { grid-template-columns: 1fr; }
  .info-grid, .report-grid { grid-template-columns: 1fr; }
  .report-hero { flex-wrap: wrap; }
  .report-hero .rh-side { margin-left: 0; text-align: left; }
}

@media (max-width: 520px) {
  .kpis { grid-template-columns: 1fr 1fr; }
  .brand-name { font-size: 15.5px; }
  .brand-mark { width: 38px; height: 38px; border-radius: 11px; }
  .topbar-tools { gap: 6px; }
  .shift-field, .role-field { padding: 0 6px; }
  .shift-field input[type="date"] { width: 104px; font-size: 12.5px; }
  .role-field select { max-width: 96px; font-size: 12.5px; }
  .icon-btn { width: 36px; height: 36px; }
  .calc-grid { grid-template-columns: 1fr; }
  .kpi-sub { font-size: 11px; }
}

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

/* ============================================================
   Тёмная тема
   ============================================================ */

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a101c;
  --surface: #111a2b;
  --surface-2: #0d1524;
  --ink: #e8eef8;
  --ink-2: #c3cede;
  --muted: #8d9bb0;
  --muted-2: #67758a;
  --line: #1f2c42;
  --line-strong: #2c3d57;
  --brand: #4f8df7;
  --brand-ink: #a9c7ff;
  --brand-soft: #16284a;
  --brand-ring: rgba(79, 141, 247, 0.3);
  --green: #3ddc97;
  --green-soft: #0f2c1e;
  --red: #ff6b6b;
  --red-soft: #351a1d;
  --amber: #f2b45c;
  --amber-soft: #32240f;
  --violet: #b39cff;
  --violet-soft: #241a3d;
  --cyan: #55d6e8;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 30px -18px rgba(0, 0, 0, 0.8);
  --shadow-lg: 0 30px 70px -30px rgba(0, 0, 0, 0.9);
}

[data-theme="dark"] body {
  background:
    radial-gradient(900px 500px at 12% -10%, #12294a 0%, transparent 60%),
    radial-gradient(800px 480px at 100% 0%, #0d2f36 0%, transparent 55%),
    var(--bg);
}

[data-theme="dark"] .topbar {
  background: rgba(10, 16, 28, 0.84);
  border-bottom-color: var(--line);
}

[data-theme="dark"] .shift-field,
[data-theme="dark"] .role-field,
[data-theme="dark"] .icon-btn,
[data-theme="dark"] .search,
[data-theme="dark"] .btn-ghost,
[data-theme="dark"] .filter-chip,
[data-theme="dark"] .modal,
[data-theme="dark"] .drawer,
[data-theme="dark"] .notif,
[data-theme="dark"] .input,
[data-theme="dark"] .select,
[data-theme="dark"] .textarea,
[data-theme="dark"] .seg-opt span,
[data-theme="dark"] .qty,
[data-theme="dark"] .sale-item,
[data-theme="dark"] .sale-pay {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}

[data-theme="dark"] .filter-chip.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

[data-theme="dark"] thead th {
  background: var(--surface-2);
  color: var(--muted);
  border-color: var(--line);
}

[data-theme="dark"] tbody tr:hover td { background: #162033; }
[data-theme="dark"] .row-active td { background: linear-gradient(90deg, #14213a 0%, #111a2b 55%); }
[data-theme="dark"] .row-active:hover td { background: linear-gradient(90deg, #17263f 0%, #121c2e 55%); }
[data-theme="dark"] .row-canceled td { background: #0d1522; }

[data-theme="dark"] .table-foot,
[data-theme="dark"] .modal-foot { background: var(--surface-2); border-color: var(--line); }

[data-theme="dark"] .total-box {
  background: linear-gradient(180deg, #12233f, #0f1d36);
  border-color: #294269;
}

[data-theme="dark"] .sale-item.on {
  background: #16263f;
  border-color: #2b4468;
}

[data-theme="dark"] .box-chip,
[data-theme="dark"] .count-pill {
  background: #162033;
  border-color: var(--line);
  color: var(--ink-2);
}

[data-theme="dark"] .empty-icon { background: var(--brand-soft); color: var(--brand-ink); }
[data-theme="dark"] .ic-cyan { background: #0d2b33; color: var(--cyan); }
[data-theme="dark"] .chip-green { color: #6ee7b0; }
[data-theme="dark"] .role-matrix .no { color: #33445e; }

[data-theme="dark"] .alert-amber { color: #f0cf9f; border-color: #4a3a1e; }
[data-theme="dark"] .alert-blue { color: var(--brand-ink); border-color: #243a5e; }
[data-theme="dark"] .alert-red { color: #ffb3b3; border-color: #4a2222; }

[data-theme="dark"] .switch .track { background: #2a3950; }
[data-theme="dark"] .input:disabled,
[data-theme="dark"] .select:disabled { background: #0b1320; }

[data-theme="dark"] .table-scroll tr { background: var(--surface); border-color: var(--line); }
[data-theme="dark"] .table-scroll tr.row-active { border-color: #2b4468; }

[data-theme="dark"] .modal-backdrop { background: rgba(0, 0, 0, 0.62); }
[data-theme="dark"] .bell-badge { border-color: var(--surface); }
[data-theme="dark"] .toast { background: #1d2a3f; border: 1px solid var(--line-strong); }

[data-theme="dark"] .pay-opt { background: transparent; }
[data-theme="dark"] .pay-opt.active { background: var(--brand); }

/* ---------------- tablet box grid ---------------- */

.box-grid { display: none; }

.shift-close {
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  margin-left: 1px;
  white-space: nowrap;
}

.logout-text { display: none; }

.box-sheet-total {
  display: flex;
  gap: 10px;
  margin-bottom: 8px;
}
.box-sheet-total > div {
  flex: 1;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
}
.box-sheet-total span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.box-sheet-total b { font-size: 20px; }
.box-sheet-meta {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.45;
  margin-bottom: 12px;
}
.box-sheet-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.box-sheet-actions .btn-primary { grid-column: 1 / -1; }

.approval-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: #fff8e8;
  border: 1px solid #f0d9a8;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
}
.approval-box b { font-size: 15px; }
[data-theme="dark"] .approval-box { background: #241d12; border-color: #4a3a1e; }

@media (min-width: 900px) {
  .box-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
  }

  .box-card {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    aspect-ratio: 1 / 1;
    min-width: 0;
    padding: 15px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--surface);
    color: var(--ink);
    box-shadow: var(--shadow-md);
    text-align: left;
    font-family: inherit;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease;
  }
  .box-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
  .box-card.free { border: 2px dashed #c9d7ea; background: linear-gradient(180deg, #fff, #f7faff); }
  .box-card.busy { border-color: #bcd4ff; background: linear-gradient(180deg, #fff, #f1f7ff); }
  .box-card.warm.free { border-color: #efd3a3; background: linear-gradient(180deg, #fff, #fff8eb); }
  .box-card.warm.busy { border-color: #e8bd75; background: linear-gradient(180deg, #fff, #fff5e3); }

  .box-card-top {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 750;
    text-transform: uppercase;
    letter-spacing: .05em;
  }
  .box-status { color: var(--muted-2); text-transform: none; letter-spacing: 0; }
  .box-card.busy .box-status { color: var(--brand); }

  .box-card-center {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    min-width: 0;
  }
  .box-icon {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    color: var(--brand);
    background: var(--surface-2);
    margin-bottom: 4px;
  }
  .box-card.warm .box-icon { color: #b7791f; background: #fff2d8; }
  .box-card-center b {
    font-size: clamp(15px, 1.35vw, 21px);
    line-height: 1.12;
    word-break: break-word;
  }
  .box-card-center small { color: var(--muted); font-size: 11.5px; line-height: 1.3; }
  .box-card-center strong { font-size: clamp(18px, 1.55vw, 25px); line-height: 1.1; margin-top: 2px; }

  .box-card-bottom {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--brand);
    font-size: 12px;
    font-weight: 750;
  }
  .box-card.free .box-card-bottom { color: var(--muted); }
  .box-card-bottom .ic { width: 15px; height: 15px; }

  .shift-next { white-space: nowrap; }
  .logout-btn { width: auto; padding: 0 10px; gap: 6px; }
  .logout-text { display: inline; font-size: 12px; font-weight: 750; }
}

@media (max-width: 900px) {
  .shift-close { display: none; }
}

[data-theme="dark"] .box-card.free { background: linear-gradient(180deg, #101a2b, #0d1626); border-color: #2a3950; }
[data-theme="dark"] .box-card.busy { background: linear-gradient(180deg, #111d31, #0e192b); border-color: #2b4468; }
[data-theme="dark"] .box-card.warm.free { background: linear-gradient(180deg, #241d12, #1a1510); border-color: #4a3a1e; }
[data-theme="dark"] .box-card.warm.busy { background: linear-gradient(180deg, #2a2114, #1e1810); border-color: #5a4624; }
[data-theme="dark"] .box-icon { background: #162033; }
[data-theme="dark"] .box-card.warm .box-icon { background: #3a2d16; color: #f3c67a; }

/* ---------------- walk-in sales ---------------- */

.walkin-section {
  margin-top: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  box-shadow: var(--shadow-md);
}
.walkin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.walkin-head h2 { font-size: 15px; margin: 0; }
.walkin-head > b { font-size: 20px; white-space: nowrap; }
.walkin-list { display: flex; flex-direction: column; gap: 6px; }
.walkin-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 10px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
}
.walkin-time { font-size: 12px; font-weight: 750; color: var(--muted); }
.walkin-items { font-size: 13px; color: var(--ink-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.walkin-pay { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.walkin-sum { font-weight: 750; white-space: nowrap; }

@media (max-width: 900px) {
  .walkin-row {
    grid-template-columns: 42px minmax(0, 1fr) auto;
    grid-template-areas:
      "time items sum"
      "time pay pay"
      "time . del";
    row-gap: 3px;
  }
  .walkin-time { grid-area: time; }
  .walkin-items { grid-area: items; }
  .walkin-pay { grid-area: pay; }
  .walkin-sum { grid-area: sum; }
  .walkin-row .icon-btn.danger { grid-area: del; justify-self: end; }
}

[data-theme="dark"] .walkin-row { background: #111b2b; border-color: var(--line); }

/* ---------------- closed shift ---------------- */

.closed-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff6e6;
  border: 1px solid #efd4a3;
  color: #6b4a13;
  border-radius: var(--r-lg);
  padding: 12px 16px;
  margin-bottom: 14px;
}
.closed-banner b { display: block; font-size: 14px; }
.closed-banner span { display: block; font-size: 12.5px; margin-top: 2px; }
.closed-banner .ic { width: 22px; height: 22px; flex: none; }
.box-card:disabled { cursor: default; opacity: 0.95; }
.box-card:disabled:hover { transform: none; box-shadow: var(--shadow-md); }
[data-theme="dark"] .closed-banner { background: #241d12; border-color: #4a3a1e; color: #f0cf9f; }
