/* Шинный двор. Тёмная тема демо-CRM шиномонтажа. Без внешних зависимостей. */

:root {
  color-scheme: dark;
  --bg: #121417;
  --bg-2: #171a1e;
  --panel: #1c2025;
  --panel-2: #23272d;
  --panel-3: #2a2f36;
  --line: #30353d;
  --line-strong: #3d434c;
  --text: #eef1f5;
  --text-soft: #c4cad3;
  --muted: #8d96a1;
  --accent: #e8702a;
  --accent-hot: #f07f3a;
  --accent-dark: #c65b1d;
  --accent-soft: rgba(232, 112, 42, 0.14);
  --accent-line: rgba(232, 112, 42, 0.42);
  --ok: #46c48a;
  --ok-soft: rgba(70, 196, 138, 0.14);
  --info: #5aa7e8;
  --info-soft: rgba(90, 167, 232, 0.14);
  --warn: #e2b13c;
  --warn-soft: rgba(226, 177, 60, 0.14);
  --danger: #e56464;
  --danger-soft: rgba(229, 100, 100, 0.14);
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.48);
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "Courier New", monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-width: 320px;
  background:
    radial-gradient(1100px 520px at 82% -8%, rgba(232, 112, 42, 0.09), transparent 62%),
    radial-gradient(900px 460px at -10% 100%, rgba(90, 167, 232, 0.05), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

body.modal-open {
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

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

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

button {
  cursor: pointer;
}

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

.icon {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.muted {
  color: var(--muted);
}

.text-ok {
  color: var(--ok);
}

.text-danger {
  color: var(--danger);
}

.money {
  font-weight: 700;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.plate {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--bg-2);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.avatar {
  width: 32px;
  height: 32px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: var(--panel-3);
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.avatar-user {
  background: var(--accent-soft);
  color: #f4a06c;
  border: 1px solid rgba(232, 112, 42, 0.32);
}

/* Кнопки */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn .icon {
  width: 16px;
  height: 16px;
}

.btn-primary {
  background: var(--accent);
  color: #181410;
}

.btn-primary:hover {
  background: var(--accent-hot);
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text-soft);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--line-strong);
  color: var(--text);
}

.btn-ok {
  background: var(--ok);
  color: #0c1a14;
}

.btn-ok:hover {
  background: #56d39a;
}

.btn-danger {
  background: var(--danger);
  color: #1c0d0d;
}

.btn-danger:hover {
  background: #ee7777;
}

.btn-outline-danger {
  background: transparent;
  border-color: rgba(229, 100, 100, 0.42);
  color: #f28b8b;
}

.btn-outline-danger:hover {
  background: var(--danger-soft);
}

.btn-sm {
  min-height: 32px;
  padding: 0 11px;
  font-size: 12px;
  border-radius: 8px;
}

.btn-xs {
  min-height: 30px;
  padding: 0 9px;
  font-size: 11.5px;
  border-radius: 8px;
}

.btn-block {
  width: 100%;
}

.icon-btn {
  width: 38px;
  height: 38px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--line-strong);
  color: var(--text);
}

.link-btn {
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 700;
}

.link-btn:hover {
  text-decoration: underline;
}

/* Значки */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
}

.badge .icon {
  width: 12px;
  height: 12px;
}

.badge-new {
  background: var(--accent-soft);
  color: #f59a63;
  border: 1px solid rgba(232, 112, 42, 0.28);
}

.badge-work {
  background: var(--info-soft);
  color: #8fc3ef;
  border: 1px solid rgba(90, 167, 232, 0.24);
}

.badge-ok {
  background: var(--ok-soft);
  color: #67d3a2;
  border: 1px solid rgba(70, 196, 138, 0.24);
}

.badge-danger {
  background: var(--danger-soft);
  color: #f28b8b;
  border: 1px solid rgba(229, 100, 100, 0.26);
}

.badge-warn {
  background: var(--warn-soft);
  color: #edc765;
  border: 1px solid rgba(226, 177, 60, 0.24);
}

.badge-muted {
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  border: 1px solid transparent;
}

.badge-winter {
  background: var(--info-soft);
  color: #8fc3ef;
  border: 1px solid rgba(90, 167, 232, 0.24);
}

.badge-summer {
  background: var(--warn-soft);
  color: #edc765;
  border: 1px solid rgba(226, 177, 60, 0.24);
}

/* Экран входа */

.login-screen {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: hidden;
}

.login-screen::before,
.login-screen::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.login-screen::before {
  width: 620px;
  height: 620px;
  right: -260px;
  top: -240px;
  border: 1px solid rgba(232, 112, 42, 0.16);
  box-shadow:
    0 0 0 42px rgba(232, 112, 42, 0.03),
    0 0 0 92px rgba(232, 112, 42, 0.02);
}

.login-screen::after {
  width: 420px;
  height: 420px;
  left: -220px;
  bottom: -230px;
  border: 1px solid rgba(90, 167, 232, 0.1);
}

.login-wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1020px;
}

.login-card {
  display: grid;
  grid-template-columns: 1.06fr 0.94fr;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.login-aside {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 36px 38px;
  background: linear-gradient(150deg, #23272e 0%, #181b1f 68%);
}

.login-aside::before {
  content: "";
  position: absolute;
  right: -150px;
  bottom: -170px;
  width: 430px;
  height: 430px;
  border-radius: 50%;
  border: 1px solid rgba(232, 112, 42, 0.2);
  box-shadow:
    0 0 0 30px rgba(232, 112, 42, 0.035),
    0 0 0 68px rgba(232, 112, 42, 0.022),
    0 0 0 112px rgba(232, 112, 42, 0.012);
}

.login-aside::after {
  content: "";
  position: absolute;
  right: 40px;
  top: 40px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 112, 42, 0.18), transparent 68%);
  pointer-events: none;
}

.login-brand {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
}

.login-brand div {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.login-brand strong {
  font-size: 16px;
  letter-spacing: 0.2px;
}

.login-brand span {
  font-size: 11.5px;
  color: var(--muted);
}

.brand-mark {
  width: 42px;
  height: 42px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(145deg, #f08a4a, #cf5d1c);
  color: #1a130d;
  box-shadow: 0 8px 20px rgba(232, 112, 42, 0.24);
}

.brand-mark .icon {
  width: 24px;
  height: 24px;
  stroke-width: 1.9;
}

.brand-mark-light {
  background: linear-gradient(145deg, #f08a4a, #cf5d1c);
}

.login-kicker {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 34px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--accent);
}

.login-aside h1 {
  position: relative;
  z-index: 1;
  margin: 14px 0 12px;
  font-size: 33px;
  line-height: 1.08;
  letter-spacing: -0.9px;
}

.login-lead {
  position: relative;
  z-index: 1;
  max-width: 340px;
  margin-bottom: 24px;
  color: var(--muted);
  font-size: 13.5px;
}

.login-features {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 11px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 12.5px;
  color: var(--text-soft);
}

.login-features li {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}

.login-check {
  width: 21px;
  height: 21px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
}

.login-check .icon {
  width: 12px;
  height: 12px;
  stroke-width: 2.4;
}

.login-facts {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.login-facts div {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.login-facts strong {
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.login-facts span {
  font-size: 10.5px;
  color: var(--muted);
}

.login-address {
  position: relative;
  z-index: 1;
  margin-top: 18px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.65;
}

.login-form-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 38px 38px 34px;
  background: #171a1e;
}

.login-form-head {
  margin-bottom: 20px;
}

.login-live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 12px;
  padding: 4px 9px;
  border: 1px solid rgba(232, 112, 42, 0.3);
  border-radius: 999px;
  background: var(--accent-soft);
  color: #f2a072;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.login-form-head h2 {
  margin-bottom: 5px;
  font-size: 24px;
  letter-spacing: -0.4px;
}

.login-form-head p {
  color: var(--muted);
  font-size: 12.5px;
}

.login-form-panel form .field {
  margin-bottom: 13px;
}

.login-hint {
  margin-top: 16px;
  color: var(--muted);
  font-size: 12px;
}

.login-hint b {
  color: var(--accent);
  font-weight: 700;
}

.login-note {
  margin-top: 8px;
  color: #7d8692;
  font-size: 11px;
}

.login-foot {
  margin-top: 18px;
  text-align: center;
  color: var(--muted);
  font-size: 11.5px;
}

.shift-dot {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(232, 112, 42, 0.16);
  animation: shiftPulse 2.6s ease-in-out infinite;
}

@keyframes shiftPulse {
  0%, 100% {
    box-shadow: 0 0 0 3px rgba(232, 112, 42, 0.16);
  }
  50% {
    box-shadow: 0 0 0 7px rgba(232, 112, 42, 0.03);
  }
}

/* Каркас приложения */

.app {
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  grid-template-areas:
    "rail top"
    "rail main";
  min-height: 100vh;
}

.rail {
  grid-area: rail;
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 18px;
  height: 100vh;
  padding: 20px 14px 16px;
  overflow-y: auto;
  background: linear-gradient(180deg, #1a1e23 0%, #14171b 100%);
  border-right: 1px solid var(--line);
  scrollbar-width: thin;
}

.rail-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 2px 4px 16px;
  border-bottom: 1px solid var(--line);
}

.rail-brand-text {
  min-width: 0;
}

.brand-name {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.brand-slogan {
  margin-top: 1px;
  color: var(--muted);
  font-size: 10.5px;
  white-space: nowrap;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-item .icon {
  color: var(--muted);
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.nav-item.is-active {
  background: var(--accent-soft);
  color: #f6a06d;
}

.nav-item.is-active .icon {
  color: var(--accent);
}

.nav-item.is-active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 3px;
  background: var(--accent);
}

.nav-count {
  margin-left: auto;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.nav-item.is-active .nav-count {
  background: rgba(232, 112, 42, 0.2);
  color: #f6a06d;
}

.rail-foot {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
}

.rail-shift {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
}

.rail-shift-label {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--accent);
}

.rail-shift strong {
  font-size: 13px;
  letter-spacing: 0.2px;
  font-variant-numeric: tabular-nums;
}

.rail-shift span:last-child {
  color: var(--muted);
  font-size: 10.5px;
}

.rail-note {
  padding: 0 2px;
  color: #6f7883;
  font-size: 10.5px;
  line-height: 1.5;
}

.reset-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border: 1px dashed var(--line-strong);
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  text-align: left;
}

.reset-btn:hover {
  border-color: var(--accent-line);
  color: var(--text-soft);
}

.reset-btn .icon {
  width: 15px;
  height: 15px;
}

.reset-confirm {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 10px;
  border: 1px solid rgba(229, 100, 100, 0.32);
  border-radius: 10px;
  background: rgba(229, 100, 100, 0.06);
}

.reset-confirm p {
  color: var(--text-soft);
  font-size: 11px;
}

.reset-actions {
  display: flex;
  gap: 6px;
}

/* Верхняя панель смены */

.topbar {
  grid-area: top;
  position: sticky;
  top: 0;
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 70px;
  padding: 10px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(20, 23, 27, 0.94);
  backdrop-filter: blur(12px);
}

.topbar-brand {
  display: none;
  align-items: center;
  gap: 8px;
}

.brand-mark-sm {
  width: 32px;
  height: 32px;
  border-radius: 9px;
}

.brand-mark-sm .icon {
  width: 19px;
  height: 19px;
}

.topbar-brand-name {
  font-size: 13.5px;
  font-weight: 800;
  white-space: nowrap;
}

.topbar-shift {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

.shift-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.topbar-kicker {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--muted);
}

.shift-info strong {
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}

.topbar-date {
  padding-left: 14px;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: 11.5px;
  white-space: nowrap;
}

.post-load {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
}

.post-meter {
  width: 88px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.post-meter-name {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.7px;
  text-transform: uppercase;
}

.post-meter-bar {
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--panel-3);
}

.post-meter-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #c85b1c, #f39a5b);
}

.post-meter-pct {
  color: var(--text-soft);
  font-size: 10px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.post-meter.is-high .post-meter-bar i {
  background: linear-gradient(90deg, #c94b4b, #ef8a6a);
}

.load-chip {
  display: none;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(232, 112, 42, 0.28);
  border-radius: 999px;
  background: var(--accent-soft);
  color: #f2a072;
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-left: 4px;
  padding-left: 16px;
  border-left: 1px solid var(--line);
}

.user-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.user-text strong {
  font-size: 12px;
  white-space: nowrap;
}

.user-text span {
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

/* Рабочая область */

.main {
  grid-area: main;
  min-width: 0;
  padding: 26px 28px 64px;
}

.page {
  max-width: 1460px;
  margin: 0 auto;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.page-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.6px;
  text-transform: uppercase;
}

.page-kicker::before {
  content: "";
  width: 14px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

.page-title h1 {
  margin: 5px 0 3px;
  font-size: 26px;
  letter-spacing: -0.5px;
}

.page-title p {
  color: var(--muted);
  font-size: 12.5px;
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Крупные цифры смены */

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.stat {
  position: relative;
  overflow: hidden;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.stat::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 0;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: linear-gradient(90deg, var(--accent), transparent);
  opacity: 0.55;
}

.stat-label {
  display: block;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.stat-value {
  display: block;
  margin: 6px 0 3px;
  font-size: 31px;
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
}

.stat-sub {
  display: block;
  color: var(--muted);
  font-size: 11.5px;
}

.stat.is-accent {
  border-color: rgba(232, 112, 42, 0.35);
}

.stat.is-accent .stat-value {
  color: #f2935a;
}

.stat.is-ok .stat-value {
  color: #67d3a2;
}

.stat.is-warn .stat-value {
  color: #edc765;
}

.stat.is-info .stat-value {
  color: #8fc3ef;
}

.stat.is-danger .stat-value {
  color: #f28b8b;
}

/* Карточки и панели */

.card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.card-head h2 {
  font-size: 14px;
  letter-spacing: -0.1px;
}

.card-head .muted {
  font-size: 11.5px;
}

.toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.012);
}

.toolbar .search {
  margin-left: auto;
}

.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-2);
}

.segmented button {
  min-height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.segmented button:hover {
  color: var(--text-soft);
}

.segmented button.is-active {
  background: var(--accent);
  color: #181410;
}

.search {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 200px;
  max-width: 330px;
  min-width: 180px;
}

.search .icon {
  position: absolute;
  left: 11px;
  width: 16px;
  height: 16px;
  color: var(--muted);
  pointer-events: none;
}

.search input {
  width: 100%;
  height: 40px;
  padding: 0 12px 0 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  background: var(--bg-2);
  color: var(--text);
  font-size: 13px;
}

.search input:focus {
  border-color: var(--accent-line);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

input::placeholder,
textarea::placeholder {
  color: #6f7883;
}

.list-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.015);
  color: var(--muted);
  font-size: 11.5px;
}

.list-meta strong {
  color: var(--text-soft);
  font-weight: 700;
}

.dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--line-strong);
}

/* Таблицы */

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

.table-wrap table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
}

.table-wrap thead th {
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.table-wrap tbody td {
  padding: 11px 16px;
  border-bottom: 1px solid rgba(48, 53, 61, 0.62);
  font-size: 13px;
  vertical-align: middle;
}

.table-wrap tbody tr:last-child td {
  border-bottom: 0;
}

.table-wrap tbody tr.row-click {
  cursor: pointer;
}

.table-wrap tbody tr.row-click:hover {
  background: rgba(255, 255, 255, 0.03);
}

.table-wrap tbody tr.row-click:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.td-cell {
  min-width: 0;
}

.cell-main {
  color: var(--text);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.cell-sub {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.cell-person {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.cell-person > div {
  min-width: 0;
}

.paid-flag {
  color: var(--ok);
  font-size: 11.5px;
}

.td-nowrap {
  white-space: nowrap;
}

/* Запись на посты */

.date-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.date-nav-label {
  padding: 0 6px;
  font-size: 13.5px;
  font-weight: 700;
}

.board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  padding: 14px;
}

.shift-col {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-2);
}

.shift-col-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.shift-col-head div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.shift-col-head strong {
  font-size: 13px;
}

.shift-col-head span {
  color: var(--muted);
  font-size: 10.5px;
}

.shift-load {
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #f2a072 !important;
  font-size: 11px !important;
  font-weight: 700;
  white-space: nowrap;
}

.shift-slots {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  min-height: 160px;
  padding: 12px;
}

.shift-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--muted);
  border-radius: 10px;
  background: var(--panel);
  color: inherit;
  text-align: left;
}

.shift-card:hover {
  border-color: var(--line-strong);
  border-left-color: var(--accent);
  background: var(--panel-2);
}

.shift-card.is-new {
  border-left-color: var(--accent);
}

.shift-card.is-work {
  border-left-color: var(--info);
}

.shift-card.is-done {
  border-left-color: var(--ok);
}

.shift-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.shift-time {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.4px;
}

.shift-main {
  font-size: 12.5px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.shift-sub {
  color: var(--muted);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.shift-service {
  color: var(--text-soft);
  font-size: 10.5px;
  letter-spacing: 0.2px;
}

.slot-empty {
  padding: 20px 8px;
  color: var(--muted);
  font-size: 11.5px;
  text-align: center;
}

.shift-col-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

.board-foot {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
  padding: 11px 16px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.012);
  color: var(--muted);
  font-size: 11.5px;
}

.board-foot strong {
  color: var(--text-soft);
}

/* Наряды */

.works-table table {
  min-width: 0;
}

.works-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 16px;
  border-top: 1px solid var(--line);
  background: rgba(232, 112, 42, 0.06);
  font-size: 12px;
  color: var(--muted);
}

.works-total-row strong {
  color: var(--accent);
  font-size: 19px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.works-editor {
  margin-top: 2px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-2);
}

.work-row-head,
.work-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px 90px 34px;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
}

.work-row-head {
  padding-top: 7px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.7px;
  text-transform: uppercase;
}

.work-row + .work-row {
  border-top: 1px solid rgba(48, 53, 61, 0.66);
}

.work-row select,
.work-row input {
  width: 100%;
  min-width: 0;
  height: 36px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  background: var(--panel);
  color: var(--text);
  font-size: 12px;
}

.work-row select {
  padding-right: 26px;
}

.work-sum {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.work-row .icon-btn {
  width: 34px;
  height: 34px;
}

.add-work {
  margin: 8px 10px;
}

.works-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  background: rgba(232, 112, 42, 0.06);
  color: var(--muted);
  font-size: 12px;
}

.works-total strong {
  color: var(--accent);
  font-size: 17px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Склад шин */

.storage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  padding: 14px;
}

.storage-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-2);
}

.storage-card.is-out {
  opacity: 0.62;
}

.storage-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.storage-client {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.storage-client div {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.storage-client strong {
  font-size: 12.5px;
  overflow-wrap: anywhere;
}

.storage-client span {
  color: var(--muted);
  font-size: 10.5px;
  overflow-wrap: anywhere;
}

.storage-tires {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel);
}

.storage-tires strong {
  font-size: 12.5px;
  overflow-wrap: anywhere;
}

.storage-tires span {
  color: var(--muted);
  font-size: 11px;
}

.storage-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.storage-meta div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.storage-meta span {
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.storage-meta strong {
  font-size: 12px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.storage-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

/* Клиенты */

.note-row {
  padding: 11px 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.6;
}

/* Оплаты */

.pay-strip {
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr;
  gap: 1px;
  overflow: hidden;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
}

.pay-strip > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 16px 18px;
  background: var(--panel);
}

.pay-strip .label {
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.pay-strip .value {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.7px;
  font-variant-numeric: tabular-nums;
}

.pay-strip .sub {
  color: var(--muted);
  font-size: 11px;
}

.pay-strip-main .value {
  color: var(--accent);
  font-size: 30px;
}

.pay-strip-main {
  border-left: 3px solid var(--accent);
}

/* Отчёты */

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.metric {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.metric-label {
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.metric-value {
  margin: 7px 0 4px;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
}

.metric-sub {
  color: var(--muted);
  font-size: 11.5px;
}

.metric.is-accent {
  border-color: rgba(232, 112, 42, 0.35);
}

.metric.is-accent .metric-value {
  color: #f2935a;
}

.metric.is-ok .metric-value {
  color: #67d3a2;
}

.metric.is-info .metric-value {
  color: #8fc3ef;
}

.metric.is-warn .metric-value {
  color: #edc765;
}

.reports-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 12px;
  margin-top: 12px;
}

.bar-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
}

.load-row {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.load-info {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.load-info strong {
  font-size: 12.5px;
}

.load-info span {
  color: var(--muted);
  font-size: 10.5px;
}

.load-pct {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.load-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--bg-2);
}

.load-track i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #c85b1c, #f39a5b);
}

.load-track i.is-low {
  background: linear-gradient(90deg, #3b7ea8, #6fb5e6);
}

.chart-note {
  padding: 0 16px 16px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.service-list {
  padding: 4px 0 8px;
}

.service-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 4px 12px;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(48, 53, 61, 0.55);
  font-size: 12.5px;
}

.service-row:last-child {
  border-bottom: 0;
}

.service-name {
  overflow-wrap: anywhere;
}

.service-count {
  color: var(--muted);
  font-size: 11px;
}

.service-sum {
  font-weight: 700;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.mini-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.mini-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}

.mini-stat span {
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.7px;
  text-transform: uppercase;
}

.mini-stat strong {
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.methods-card {
  margin-top: 12px;
}

.method-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(48, 53, 61, 0.55);
  font-size: 12.5px;
}

.method-row:last-child {
  border-bottom: 0;
}

.method-row span:first-child {
  color: var(--text-soft);
}

.method-row strong {
  font-variant-numeric: tabular-nums;
}

/* Пустые состояния */

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 38px 20px;
  color: var(--muted);
  font-size: 12.5px;
  text-align: center;
}

.empty-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg-2);
  color: var(--muted);
}

.empty-icon .icon {
  width: 22px;
  height: 22px;
}

.empty p {
  max-width: 320px;
}

/* Модальные окна */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
  background: rgba(6, 8, 10, 0.74);
  backdrop-filter: blur(4px);
}

.modal {
  width: min(680px, 100%);
  max-height: 92vh;
  overflow-y: auto;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.modal-lg {
  width: min(800px, 100%);
}

.modal-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 22px 15px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.modal-head h2 {
  font-size: 20px;
  letter-spacing: -0.3px;
}

.modal-sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.modal-body {
  padding: 18px 22px 0;
}

.modal-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 18px;
  padding: 15px 22px;
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.modal-actions .btn {
  flex: 0 0 auto;
}

.modal-intro {
  margin-bottom: 14px;
}

.modal-intro h3 {
  margin-bottom: 2px;
  font-size: 15px;
}

.modal-intro p {
  color: var(--muted);
  font-size: 12px;
}

.entity-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.entity-top .avatar {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  font-size: 14px;
}

.entity-id {
  min-width: 0;
  flex: 1;
}

.entity-id h3 {
  margin-bottom: 3px;
  font-size: 17px;
  overflow-wrap: anywhere;
}

.entity-id p {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.entity-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--line);
}

.fact {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  padding: 11px 14px;
  background: var(--panel-2);
}

.fact span {
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.7px;
  text-transform: uppercase;
}

.fact strong {
  font-size: 12.5px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.fact-wide {
  grid-column: 1 / -1;
}

.modal-section {
  margin-top: 18px;
}

.modal-section h4 {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.modal .table-wrap {
  border: 1px solid var(--line);
  border-radius: 12px;
}

.modal .table-wrap tbody td {
  padding: 9px 13px;
  font-size: 12.5px;
}

.modal .table-wrap thead th {
  padding: 8px 13px;
}

.modal-note {
  margin-top: 14px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-2);
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.6;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 14px;
}

.span-2 {
  grid-column: span 2;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: none;
  background: var(--bg-2);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 400;
}

.field textarea {
  height: auto;
  min-height: 72px;
  padding: 10px 12px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent-line);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.field select {
  padding-right: 32px;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%238d96a1' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.form-error {
  margin: 0 0 12px;
  padding: 9px 11px;
  border: 1px solid rgba(229, 100, 100, 0.32);
  border-radius: 8px;
  background: var(--danger-soft);
  color: #f28b8b;
  font-size: 12px;
}

.form-note {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.55;
}

/* Всплывающее сообщение */

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 200;
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  background: #262b31;
  color: var(--text);
  font-size: 13px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translate(-50%, 16px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* Адаптив */

@media (max-width: 1240px) {
  .topbar-date {
    display: none;
  }

  .stats,
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mini-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  .post-load {
    display: none;
  }

  .load-chip {
    display: inline-flex;
    margin-left: auto;
  }

  .reports-grid {
    grid-template-columns: 1fr;
  }

  .pay-strip {
    grid-template-columns: 1fr 1fr;
  }

  .pay-strip-main {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  .app {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto 1fr;
    grid-template-areas:
      "top"
      "rail"
      "main";
  }

  .topbar {
    position: sticky;
    top: 0;
    min-height: 62px;
    padding: 10px 16px;
    gap: 12px;
  }

  .topbar-brand {
    display: flex;
  }

  .rail {
    position: static;
    display: block;
    height: auto;
    padding: 8px 12px;
    overflow-x: auto;
    overflow-y: hidden;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    scrollbar-width: none;
  }

  .rail::-webkit-scrollbar {
    display: none;
  }

  .rail-brand,
  .rail-foot {
    display: none;
  }

  .nav {
    flex-direction: row;
    gap: 4px;
    width: max-content;
  }

  .nav-item {
    width: auto;
    min-height: 38px;
    padding: 0 12px;
    font-size: 12.5px;
    white-space: nowrap;
  }

  .nav-item .icon {
    width: 16px;
    height: 16px;
  }

  .nav-item.is-active::before {
    left: 9px;
    right: 9px;
    top: auto;
    bottom: 2px;
    width: auto;
    height: 2px;
    border-radius: 2px;
  }

  .nav-count {
    margin-left: 2px;
  }

  .main {
    padding: 20px 18px 52px;
  }

  .topbar-shift .topbar-kicker {
    display: none;
  }

  .shift-info strong {
    font-size: 12px;
  }

  .pay-strip {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 760px) {
  .login-card {
    grid-template-columns: 1fr;
  }

  .login-aside {
    padding: 22px 24px;
  }

  .login-aside h1 {
    margin-bottom: 0;
    font-size: 24px;
  }

  .login-features,
  .login-facts,
  .login-address,
  .login-lead {
    display: none;
  }

  .login-kicker {
    margin-top: 20px;
  }

  .login-form-panel {
    padding: 24px 24px 28px;
  }

  .page-head {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .page-actions .btn {
    flex: 1;
  }

  .facts,
  .modal .facts {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: span 1;
  }

  .entity-top {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .entity-actions {
    width: 100%;
  }

  .entity-actions .btn {
    flex: 1;
  }

  .table-wrap table {
    min-width: 0;
  }

  .table-wrap thead {
    display: none;
  }

  .table-wrap table,
  .table-wrap tbody,
  .table-wrap tr,
  .table-wrap td {
    display: block;
    width: 100%;
  }

  .table-wrap tr {
    margin: 10px 12px;
    padding: 8px 13px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--bg-2);
  }

  .table-wrap tbody tr:hover {
    background: var(--bg-2);
  }

  .table-wrap tbody td {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    align-items: start;
    gap: 4px 10px;
    padding: 6px 0;
    border-bottom: 1px dashed rgba(48, 53, 61, 0.66);
    text-align: left;
  }

  .table-wrap tbody td::before {
    content: attr(data-label);
    grid-column: 1;
    grid-row: 1;
    padding-top: 2px;
    color: var(--muted);
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
  }

  .table-wrap tbody td .td-cell {
    grid-column: 2;
    grid-row: 1;
  }

  .table-wrap tbody td:last-child {
    border-bottom: 0;
  }

  .table-wrap tbody tr.row-click {
    cursor: pointer;
  }

  .table-wrap .cell-person {
    justify-content: flex-start;
  }

  .modal .table-wrap {
    border: 0;
    border-radius: 0;
  }

  .modal-actions .btn {
    flex: 1;
  }

  .payment-row td:last-child .td-cell,
  .action-cell .td-cell {
    display: flex;
    justify-content: flex-start;
  }

  .pay-strip {
    grid-template-columns: 1fr;
  }

  .pay-strip-main {
    grid-column: auto;
  }

  .login-screen {
    padding: 14px;
  }

  .login-wrap {
    max-width: 560px;
  }
}

@media (max-width: 640px) {
  .topbar {
    flex-wrap: wrap;
    gap: 8px 12px;
    padding: 10px 12px;
  }

  .topbar-brand {
    order: 1;
  }

  .topbar-user {
    order: 2;
    margin-left: auto;
    padding-left: 0;
    border-left: 0;
  }

  .topbar-shift {
    order: 3;
  }

  .load-chip {
    order: 4;
    margin-left: auto;
  }

  .user-text {
    display: none;
  }

  .topbar-user .icon-btn {
    width: 34px;
    height: 34px;
  }

  .topbar-user .avatar {
    width: 30px;
    height: 30px;
  }

  .main {
    padding: 16px 12px 46px;
  }

  .page-title h1 {
    font-size: 22px;
  }

  .stat {
    padding: 13px 14px;
  }

  .stat-value {
    font-size: 26px;
  }

  .metric {
    padding: 14px;
  }

  .metric-value {
    font-size: 26px;
  }

  .toolbar {
    padding: 11px 12px;
  }

  .toolbar .search {
    flex-basis: 100%;
    max-width: none;
    margin-left: 0;
  }

  .segmented {
    width: 100%;
    justify-content: flex-start;
  }

  .segmented button {
    flex: 0 0 auto;
    min-height: 34px;
    padding: 0 11px;
  }

  .list-meta {
    padding: 9px 13px;
  }

  .board {
    padding: 10px;
  }

  .storage-grid {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .date-nav {
    padding: 10px 12px;
  }

  .date-nav-label {
    width: 100%;
    order: 3;
    padding: 2px 0 0;
  }

  .board-foot {
    padding: 10px 13px;
  }

  .pay-strip > div {
    padding: 13px 15px;
  }

  .pay-strip-main .value {
    font-size: 27px;
  }

  .modal-backdrop {
    padding: 10px;
  }

  .modal {
    max-height: 94vh;
    border-radius: 14px;
  }

  .modal-head {
    padding: 16px 16px 12px;
  }

  .modal-head h2 {
    font-size: 18px;
  }

  .modal-body {
    padding: 14px 16px 0;
  }

  .modal-actions {
    padding: 13px 16px;
  }

  .modal-actions .btn {
    min-height: 38px;
    padding: 0 12px;
  }

  .modal .table-wrap tr {
    margin: 8px 10px;
  }

  .modal .table-wrap tbody td {
    grid-template-columns: 78px minmax(0, 1fr);
  }

  .entity-top {
    gap: 10px;
  }

  .entity-id h3 {
    font-size: 16px;
  }

  .fact {
    padding: 10px 12px;
  }

  .work-row-head,
  .work-row {
    grid-template-columns: minmax(0, 1fr) 50px 76px 30px;
    gap: 6px;
    padding: 7px 8px;
  }

  .work-row select,
  .work-row input {
    height: 34px;
    font-size: 11.5px;
  }

  .work-sum {
    font-size: 11px;
  }

  .work-row .icon-btn {
    width: 30px;
    height: 30px;
  }

  .login-aside {
    padding: 20px;
  }

  .login-form-panel {
    padding: 22px 20px 24px;
  }

  .login-form-head h2 {
    font-size: 21px;
  }
}

@media (max-width: 430px) {
  .stats,
  .metrics {
    gap: 8px;
  }

  .stat {
    padding: 11px 12px;
  }

  .stat-label {
    font-size: 8.5px;
    letter-spacing: 0.6px;
  }

  .stat-value {
    font-size: 23px;
  }

  .stat-sub {
    font-size: 10.5px;
  }

  .metric-value {
    font-size: 23px;
  }

  .mini-stats {
    gap: 8px;
  }

  .mini-stat {
    padding: 11px 12px;
  }

  .mini-stat strong {
    font-size: 16px;
  }

  .page-title p {
    font-size: 11.5px;
  }

  .board {
    grid-template-columns: 1fr;
  }

  .nav-item {
    min-height: 36px;
    padding: 0 10px;
    font-size: 12px;
  }

  .login-form-panel {
    padding: 20px 16px 22px;
  }

  .login-aside {
    padding: 18px;
  }

  .login-aside h1 {
    font-size: 21px;
  }
}

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