/* Kohi Nur Delivery — дизайн-система v3 */
:root {
  --bg-side: #17172A;
  --bg: #F5F6FB;
  --card: #FFFFFF;
  --card-2: #F0F1F9;
  --line: #E8EAF3;
  --line-field: #CDD2E2;
  --line-soft: #F0F1F7;
  --text: #1C1E2E;
  --text-2: #484D63;
  --text-3: #767C94;

  --indigo: #3A3482;
  --indigo-mid: #5A51D4;
  --indigo-light: #4B43C4;
  --indigo-pale: #3A3482;
  --focus-ring: 0 0 0 3px rgba(90, 81, 212, .22);
  --shadow-card: 0 1px 2px rgba(28, 30, 60, .04), 0 6px 20px rgba(28, 30, 60, .05);
  --tint-indigo: #EEEDFF;
  --tint-orange: #FFF1DE;
  --tint-green: #E1F5EB;
  --tint-blue: #E3EFFD;
  --tint-violet: #F5E7FA;
  --tint-teal: #DDF3F1;
  --tint-gray: #EBEDF4;

  --orange: #E08A2E;
  --orange-text: #B25E0C;
  --on-orange: #1A1206;
  --success: #1E9962;
  --danger: #D8433D;

  --st-new: #2E6FC4;
  --st-packing: #0E8F86;
  --st-delivering: #9A3FB8;
  --st-delivered: #1E9962;
  --st-closed: #6A7088;

  --r-sm: 10px;
  --r-md: 16px;
  --h: 40px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.4 Archivo, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--indigo-light); text-decoration: none; }
a:hover { color: var(--indigo-pale); }
.num, .tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-3); }
.dim { color: var(--text-2); }
.hidden { display: none !important; }

.ic { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--indigo-light); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ic-18 { width: 18px; height: 18px; }
.ic-14 { width: 14px; height: 14px; }
.ic-20 { width: 20px; height: 20px; }
.ic-muted { stroke: var(--text-3); }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }
.side {
  width: 256px; flex: none; position: sticky; top: 0; height: 100vh; z-index: 40;
  --card: #25253D; --card-2: #30304D; --line: #2D2D48;
  --text: #F4F4F8; --text-2: #C9C9DA; --text-3: #9D9DB8; color: var(--text);
  --indigo-light: #A8A2F0; --indigo-pale: #C4BFF8;
  background: var(--bg-side); border-right: 1px solid var(--line);
  padding: 22px 16px; display: flex; flex-direction: column; gap: 16px; overflow-y: auto; overflow-x: hidden; scrollbar-width: none;
}
.brand { flex: none; display: flex; flex-direction: column; gap: 7px; padding: 2px 6px 18px; color: #fff; border-bottom: 1px solid var(--line); }
.brand:hover { color: #fff; }
.brand:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.brand__row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.brand__tc { flex: none; padding: 3px 5px 2px; border-radius: 5px; background: linear-gradient(135deg, #F2B766, #E08A2E); color: #2A1604; font: 700 10px/1 Archivo, system-ui, sans-serif; letter-spacing: .08em; }
.brand__name { font: italic 700 25px/1.1 "Playfair Display", Georgia, "Times New Roman", serif; white-space: nowrap; color: #fff; }
.brand__service { flex: none; font: 600 9.5px/1 Archivo, system-ui, sans-serif; letter-spacing: .2em; text-transform: uppercase; color: var(--text-3); }
.brand__line { flex: 1; height: 0; border-top: 1.5px dashed rgba(224,138,46,.55); }
.brand__dot { flex: none; position: relative; width: 6px; height: 6px; border-radius: 50%; background: #E08A2E; box-shadow: 0 0 0 2px rgba(224,138,46,.25); }
.brand__dot::after { content: ""; position: absolute; inset: -1px; border-radius: 50%; border: 1.5px solid #F2B766; opacity: 0; animation: brand-pulse 2.6s ease-out infinite; }
@keyframes brand-pulse { 0% { transform: scale(1); opacity: .9; } 100% { transform: scale(3.4); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .brand__dot::after { animation: none; } }
.side__cta {
  display: flex; align-items: center; justify-content: center; gap: 8px; height: 44px; border-radius: 12px;
  background: linear-gradient(180deg, #E58A33, #D67E2A); color: var(--on-orange, #fff); font-weight: 700; font-size: 14px;
  box-shadow: 0 6px 16px rgba(214, 126, 42, .28), inset 0 1px 0 rgba(255, 255, 255, .22);
  transition: filter .15s, transform .15s;
}
.side__cta .ic { stroke: currentColor; width: 18px; height: 18px; stroke-width: 2.4; }
.side__cta:hover { filter: brightness(1.07); transform: translateY(-1px); color: var(--on-orange, #fff); }
.side__cta.is-active { box-shadow: 0 0 0 2px rgba(255, 255, 255, .85), 0 6px 16px rgba(214, 126, 42, .28); }
.side__cta:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav__item {
  position: relative; display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 14px;
  border-radius: 12px; font-size: 14px; font-weight: 600; color: var(--text-2); transition: background .12s, color .12s;
}
.nav__item span:not(.nav__badge) { white-space: nowrap; }
.nav__item:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav__item .ic { stroke: var(--text-3); width: 19px; height: 19px; transition: stroke .12s; }
.nav__item:hover .ic { stroke: var(--indigo-pale); }
.nav__item.is-active { background: linear-gradient(135deg, #6D63EB, #4A41B8); color: #fff; box-shadow: 0 8px 20px rgba(0, 0, 0, .35); }
.nav__item:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.nav__item.is-active .ic { stroke: #fff; }
.nav__badge {
  margin-left: auto; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px;
  background: rgba(122, 114, 232, .22); color: var(--indigo-pale);
}
.nav__item.is-active .nav__badge { background: rgba(255, 255, 255, .2); color: #fff; }
.nav__badge--warn { background: rgba(224, 138, 46, .24); color: #F6C58F; }
.head__count { display: inline-grid; place-items: center; min-width: 30px; padding: 2px 9px; margin-left: 6px; border-radius: 20px; background: #f5d7b4; color: #8b4c0d; font-size: 15px; vertical-align: middle; }
.side__foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }
.bot-state { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); padding: 7px 12px; border-radius: 999px; background: rgba(30, 153, 98, .18); color: #7FDDB0; width: fit-content; font-weight: 600; }
.bot-state.is-off { background: rgba(216, 67, 61, .2); color: #FFA9A4; }
.bot-state__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px rgba(30, 153, 98, .25); }
.bot-state.is-off .bot-state__dot { background: var(--danger); }
.me { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.me__name { font-size: 13px; font-weight: 600; line-height: 1.25; }
.me__role { font-size: 12px; color: var(--text-3); }
.me__out { margin-left: auto; background: none; border: 0; padding: 6px; border-radius: 6px; cursor: pointer; display: flex; }
.me__out:hover { background: var(--card-2); }

.main { flex: 1; min-width: 0; padding: 32px; display: flex; flex-direction: column; gap: 24px; }
.head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.head__title { font-size: 24px; font-weight: 700; letter-spacing: -.01em; margin: 0; }
.head__title .muted { font-weight: 600; }
.head__sub { font-size: 13px; color: var(--text-3); margin-top: 2px; }
.head__actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.crumbs { font-size: 12px; color: var(--text-3); margin-bottom: 4px; }
.back { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; margin-bottom: 6px; }

/* ---------- Card ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); padding: 24px; box-shadow: var(--shadow-card); }
.card--flush { padding: 0; overflow: hidden; }
.card--info { background: linear-gradient(rgba(90,81,212,.06), rgba(90,81,212,.06)), var(--card); border-color: rgba(90,81,212,.35); }
.card--attention { background: linear-gradient(rgba(214,126,42,.08), rgba(214,126,42,.08)), var(--card); border-color: rgba(214,126,42,.55); }
.card--muted { border-style: dashed; border-color: var(--line-field); box-shadow: none; }
.eyebrow { display: flex; align-items: center; gap: 8px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); font-weight: 700; }
.card--info .eyebrow { color: var(--indigo-light); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ---------- Buttons ---------- */
.btn {
  height: var(--h); padding: 0 16px; border-radius: var(--r-sm); border: 1px solid transparent;
  font: 600 14px/1 inherit; font-family: inherit; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap;
  color: var(--text-2); background: transparent; transition: filter .15s, background .15s, border-color .15s;
}
.btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.btn--primary {
  background: linear-gradient(180deg, #EC9540 0%, #D67E2A 55%, #C97221 100%);
  box-shadow: 0 4px 14px rgba(214,126,42,.30), inset 0 1px 0 rgba(255,255,255,.24);
  color: var(--on-orange); font-weight: 700;
}
.btn--primary .ic { stroke: var(--on-orange); }
.btn--primary:hover { filter: brightness(1.06); color: var(--on-orange); }
.btn--primary:focus-visible { box-shadow: 0 4px 14px rgba(214,126,42,.30), var(--focus-ring); }
.btn--secondary { background: var(--card); border-color: var(--line-field); color: var(--text); box-shadow: 0 1px 2px rgba(28, 30, 60, .04); }
.btn--secondary:hover { border-color: var(--indigo-mid); background: #F7F7FF; color: var(--indigo); }
.btn--ghost:hover { background: var(--card-2); color: var(--text); }
.btn--danger { color: var(--danger); border-color: rgba(216,67,61,.4); background: transparent; }
.btn--danger .ic { stroke: var(--danger); }
.btn--danger:hover { background: rgba(216,67,61,.08); color: var(--danger); }
.btn--block { width: 100%; }
.btn--sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn[disabled], .btn.is-loading { opacity: .65; cursor: default; pointer-events: none; }
.btn.is-loading::before {
  content: ""; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite;
}
.btn.is-loading .ic { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Fields ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field__label { font-size: 12px; font-weight: 600; color: var(--text-2); }
.field__label .muted { font-weight: 500; }
.field__error { font-size: 12px; color: var(--danger); }
.field__hint { font-size: 12px; color: var(--text-3); }
.control {
  height: var(--h); border-radius: var(--r-sm); background: #FAFBFE; border: 1px solid var(--line-field);
  display: flex; align-items: center; gap: 10px; padding: 0 14px; transition: border-color .15s, box-shadow .15s, background .15s;
}
.control--area { height: auto; min-height: 88px; align-items: flex-start; padding: 12px; }
.control--area .ic { margin-top: 2px; }
.control:focus-within { background: #fff; border-color: var(--indigo-light); box-shadow: var(--focus-ring); }
.control:focus-within .ic { stroke: var(--indigo-pale); }
.control.is-invalid { border-color: var(--danger); }
.control.is-invalid:focus-within { box-shadow: 0 0 0 3px rgba(216,67,61,.2); }
.control input, .control select, .control textarea {
  flex: 1; min-width: 0; height: 100%; background: transparent; border: 0; outline: 0;
  color: var(--text); font: inherit; font-size: 14px; padding: 0;
}
.control textarea { resize: vertical; line-height: 1.5; min-height: 64px; }
.control select { appearance: none; cursor: pointer; }
.control select option { background: var(--card); color: var(--text); }
.control input::placeholder, .control textarea::placeholder { color: var(--text-3); }
.control__suffix { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--indigo-light); background: none; border: 0; cursor: pointer; padding: 0; font-family: inherit; }
.control--filter { background: var(--card); }
.control--search { flex: 1; max-width: 340px; }

.toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle label {
  height: var(--h); border-radius: var(--r-sm); border: 1px solid var(--line-field); background: var(--bg);
  color: var(--text-2); display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 14px; font-weight: 600; cursor: pointer; transition: all .15s;
}
.toggle input:checked + label { border-color: var(--indigo-mid); background: rgba(90,81,212,.10); color: var(--indigo); }
.toggle input:checked + label .ic { stroke: var(--indigo-mid); }
.toggle input:focus-visible + label { box-shadow: var(--focus-ring); }
.toggle input:disabled + label { opacity: .55; cursor: not-allowed; }
.toggle--receive label { padding: 0 12px; }
.field__label .req { color: var(--danger); font-weight: 700; margin-left: 2px; }

.segmented { display: inline-flex; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 4px; gap: 2px; box-shadow: 0 1px 2px rgba(28, 30, 60, .04); }
.segmented button, .segmented a {
  padding: 8px 16px; border-radius: 9px; font: 600 13px/1 inherit; font-family: inherit; color: var(--text-2);
  background: transparent; border: 0; cursor: pointer; text-decoration: none;
}
.segmented button:hover, .segmented a:hover { color: var(--text); }
.segmented .is-active { background: linear-gradient(135deg, #6258E0, #3F3896); color: #fff; box-shadow: 0 4px 10px rgba(74, 66, 190, .28); }
.segmented .is-active:hover { color: #fff; }
.segmented button:focus-visible, .segmented a:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* ---------- Pills & avatars ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap; color: var(--c); background: var(--bgc);
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--dot, var(--c)); }
.pill--new { --c: var(--st-new); --bgc: var(--tint-blue); }
.pill--packing, .pill--packed { --c: var(--st-packing); --bgc: var(--tint-teal); }
.pill--delivering { --c: var(--st-delivering); --bgc: var(--tint-violet); }
.pill--delivered, .pill--handed { --c: var(--st-delivered); --bgc: var(--tint-green); }
.pill--awaiting { --c: var(--orange-text); --bgc: var(--tint-orange); --dot: var(--orange); }
.pill--closed { --c: var(--st-closed); --bgc: var(--tint-gray); --dot: #8C92A8; }
.pill--cancelled { --c: var(--danger); --bgc: #FDE9E8; }
.pill--tone-green { --c: var(--st-delivered); --bgc: var(--tint-green); }
.pill--tone-blue { --c: var(--st-new); --bgc: var(--tint-blue); }
.pill--tone-violet { --c: var(--st-delivering); --bgc: var(--tint-violet); }
.pill--tone-orange { --c: var(--orange-text); --bgc: var(--tint-orange); --dot: var(--orange); }
.pill--tone-red { --c: var(--danger); --bgc: #FDE9E8; }
.pill--tone-gray { --c: var(--st-closed); --bgc: var(--tint-gray); --dot: #8C92A8; }
.client-cat { margin-top: 6px; display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-3); }
.tbl__client .pill { display: flex; width: fit-content; margin-top: 4px; height: 20px; padding: 0 8px; font-size: 11px; }

.avatar {
  width: 24px; height: 24px; border-radius: 50%; color: #121212; font-size: 11px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; flex: none;
}
.avatar--md { width: 28px; height: 28px; font-size: 12px; }
.avatar--lg { width: 36px; height: 36px; font-size: 13px; }
.avatar--empty { border: 1px dashed var(--line-field); background: transparent; }
.who { display: flex; align-items: center; gap: 8px; color: var(--text-2); min-width: 0; }
.who span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Counters ---------- */
.counters { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.counter {
  display: flex; flex-direction: column; align-items: flex-start; min-width: 0;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); padding: 18px; box-shadow: var(--shadow-card);
  text-align: left; color: var(--text); font-family: inherit; cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s;
}
.counter:hover { border-color: var(--line-field); transform: translateY(-2px); box-shadow: 0 10px 26px rgba(28, 30, 60, .09); }
.counter:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.counter.is-active { border-color: var(--indigo-mid); box-shadow: 0 0 0 3px rgba(90, 81, 212, .16), 0 10px 26px rgba(58, 52, 130, .12); }
.counter__ic { width: 42px; height: 42px; flex: none; display: grid; place-items: center; border-radius: 13px; background: var(--t); transition: background .15s; }
.counter__ic .ic { width: 20px; height: 20px; stroke: var(--c); transition: stroke .15s; }
.counter.is-active .counter__ic { background: var(--c); box-shadow: 0 6px 14px color-mix(in srgb, var(--c) 40%, transparent); }
.counter.is-active .counter__ic .ic { stroke: #fff; }
.counter__n { font-size: 30px; line-height: 1; font-weight: 700; letter-spacing: -.02em; margin-top: 16px; font-variant-numeric: tabular-nums; }
.counter__label { margin-top: 6px; font-size: 13px; color: var(--text-2); font-weight: 600; }

.filters { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.filters .control--filter { min-width: 180px; }
.range { display: flex; gap: 8px; align-items: center; }
.range input[type=date] { color-scheme: light; }

/* ---------- Table ---------- */
.tbl__row {
  display: grid; grid-template-columns: 70px 50px minmax(0,1fr) minmax(0,1.3fr) 168px 104px 108px 92px;
  gap: 12px; padding: 0 16px; min-height: 60px; align-items: center; font-size: 13px; border-bottom: 1px solid var(--line-soft);
  color: inherit;
}
a.tbl__row:hover { background: #F7F7FF; color: inherit; }
a.tbl__row:focus-visible { outline: none; background: #F6F7FC; box-shadow: inset 0 0 0 2px var(--indigo-mid); }
.tbl__head {
  min-height: 44px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-3); background: #F8F9FD; border-bottom: 1px solid var(--line);
}
.tbl__num { font-weight: 700; font-variant-numeric: tabular-nums; }
.tbl__client { font-weight: 600; }
.tbl__addr { color: var(--text-2); line-height: 1.35; }
.tbl__sum { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.tbl__pay { font-size: 12px; color: var(--text-2); }
.tbl__pay.is-attention { color: var(--orange-text); font-weight: 700; }
.tbl__status { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.tbl__age { font-size: 11px; color: var(--text-3); padding-left: 4px; }
.tbl__age.is-overdue { color: var(--danger); font-weight: 700; }
.tbl__foot { display: flex; align-items: center; padding: 0 16px; height: 48px; font-size: 12px; color: var(--text-3); }
.pager { margin-left: auto; display: flex; gap: 4px; }
.pager button {
  min-width: 30px; padding: 5px 10px; border-radius: 6px; border: 0; background: transparent;
  color: var(--text-2); font: 600 12px/1 inherit; font-family: inherit; cursor: pointer;
}
.pager button:hover { background: var(--card-2); }
.pager button.is-active { background: var(--indigo-mid); color: #fff; }

.tbl__row.is-highlight { animation: flash 3s ease-out; }
@keyframes flash { 0%, 40% { background: rgba(214,126,42,.18); } 100% { background: transparent; } }

.skeleton { height: 12px; border-radius: 6px; background: linear-gradient(90deg, #E9ECF5 0%, #F5F6FB 50%, #E9ECF5 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.empty { padding: 56px 24px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; color: var(--text-2); }
.empty .ic { width: 32px; height: 32px; stroke: var(--text-3); }
.empty__title { font-size: 16px; font-weight: 700; color: var(--text); }

/* ---------- Alerts & toasts ---------- */
.alert { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--r-sm); font-size: 13px; border: 1px solid; }
.alert .ic { stroke: currentColor; }
.alert--error { color: #B3302B; background: rgba(216,67,61,.07); border-color: rgba(216,67,61,.35); }
.alert--warning { color: var(--orange-text); background: rgba(224,138,46,.10); border-color: rgba(224,138,46,.45); }
.alert--success { color: #157A4D; background: rgba(30,153,98,.08); border-color: rgba(30,153,98,.4); }
.alert__action { margin-left: auto; }

.toasts { position: fixed; right: 24px; bottom: 24px; display: flex; flex-direction: column; gap: 8px; z-index: 50; max-width: 420px; }
.toast {
  display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: var(--r-md);
  background: #fff; border: 1px solid var(--line-field); box-shadow: 0 12px 32px rgba(28,30,60,.18);
  font-size: 13px; line-height: 1.45; animation: toast-in .25s ease-out;
}
.toast .ic { margin-top: 1px; }
.toast--success { border-color: rgba(92,194,143,.5); } .toast--success .ic { stroke: var(--success); }
.toast--warning { border-color: rgba(214,126,42,.55); } .toast--warning .ic { stroke: var(--orange-text); }
.toast--error { border-color: rgba(239,107,99,.55); } .toast--error .ic { stroke: var(--danger); }
.toast__close { margin-left: auto; background: none; border: 0; cursor: pointer; padding: 0; display: flex; }
.toast.is-leaving { opacity: 0; transform: translateY(8px); transition: all .25s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- New order ---------- */
.order-form { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.order-form__aside { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 20px; }
.order-form__fields { gap: 20px; }
.order-section { display: flex; align-items: flex-start; gap: 12px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.order-section:first-child { padding-top: 0; border-top: 0; }
.order-section__step { display: grid; place-items: center; width: 26px; height: 26px; flex: none; border-radius: 8px; background: #ECEAFE; color: var(--indigo-light); font-size: 12px; font-weight: 800; }
.order-section h2, .order-summary h2 { margin: 0; font-size: 16px; line-height: 1.3; }
.order-section p { margin: 3px 0 0; color: var(--text-3); font-size: 12px; }
.order-summary { gap: 18px; }
.order-summary__head { padding-bottom: 14px; border-bottom: 1px solid var(--line); display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.order-summary__head span, .order-summary__note { color: var(--text-3); font-size: 12px; line-height: 1.45; }
.order-summary__note { margin: 0; }
.order-summary__client { padding: 12px 14px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-sm); display: grid; gap: 4px; font-size: 13px; overflow-wrap: anywhere; }
.order-summary__client b { color: var(--text); }
.order-summary__client span { color: var(--text-2); }
.order-summary .total { padding: 4px 0; }
.order-summary .total b { font-size: 18px; color: var(--text); }
.order-summary .btn--primary { min-height: 48px; height: auto; white-space: normal; text-align: center; }
.order-summary .btn[aria-disabled="true"] { opacity: .65; pointer-events: none; }
.field__hint { margin-top: 6px; font-size: 12px; color: var(--text-3); }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.row-addr { display: grid; grid-template-columns: 200px 1fr; gap: 16px; }
.tg-preview { background: #0E1621; border-radius: var(--r-md); padding: 14px; }
.tg-bubble { background: #182533; border-radius: 12px 12px 12px 4px; padding: 10px 12px; font-size: 13px; line-height: 1.5; color: #F2F4F7; white-space: pre-line; word-break: break-word; }
.tg-bubble .tg-muted { color: #8FA3B8; }
.tg-button { margin-top: 4px; background: rgba(255,255,255,.1); border-radius: 8px; text-align: center; padding: 9px; font-size: 13px; font-weight: 600; color: #F2F4F7; }
.total { display: flex; justify-content: space-between; align-items: center; font-size: 14px; gap: 12px; }
.total b { font-variant-numeric: tabular-nums; text-align: right; }

/* ---------- Order detail ---------- */
.detail { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.timeline { display: flex; flex-direction: column; }
.step { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 16px; min-height: 32px; }
.step__rail { display: flex; flex-direction: column; align-items: center; }
.step__icon {
  width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: none;
  background: color-mix(in srgb, var(--tone) 16%, transparent); border: 1px solid color-mix(in srgb, var(--tone) 50%, transparent);
}
.step__icon .ic { stroke: var(--tone); }
.step__line { width: 2px; flex: 1; min-height: 16px; background: color-mix(in srgb, var(--tone) 40%, var(--line)); margin: 4px 0; }
.step:last-child .step__line { display: none; }
.step__body { padding: 2px 0 16px; }
.step__label { font-size: 14px; font-weight: 700; }
.step__actor { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.step__time { text-align: right; padding-top: 2px; }
.step__clock { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.step__delta { font-size: 12px; color: var(--text-3); margin-top: 2px; font-variant-numeric: tabular-nums; }
.step--new { --tone: var(--st-new); }
.step--packing { --tone: var(--st-packing); }
.step--delivering { --tone: var(--st-delivering); }
.step--delivered { --tone: var(--st-delivered); }
.step--closed { --tone: var(--st-delivered); }
.step--cancelled { --tone: var(--danger); }
.step.is-pending { --tone: #A3A9BC; }
.step.is-pending .step__label { color: var(--text-3); font-weight: 600; }
.step.is-pending .step__icon { background: transparent; border-style: dashed; }
.step.is-current { --tone: var(--orange); }
.step.is-current .step__icon { background: rgba(214,126,42,.18); box-shadow: 0 0 0 4px rgba(214,126,42,.22); border: 1px solid var(--orange); }
.step.is-current .step__icon .ic { stroke: var(--orange-text); }
.step.is-current .step__clock, .step.is-current .step__delta { color: var(--orange-text); font-weight: 600; }
.step.is-current .step__line { background: var(--line); }

.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 24px; font-size: 13px; }
.fact__label { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-3); margin-bottom: 4px; }
.fact b { font-weight: 600; }
.fact--wide { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 16px; color: var(--text-2); line-height: 1.5; }
.pre { white-space: pre-line; word-break: break-word; }
.detail__col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.detail__col .contact-card { margin-top: 0; }.items { font-size: 13px; color: var(--text-2); line-height: 1.5; }
.items .eyebrow { margin-bottom: 6px; }
.items .order-part { padding: 12px 0; }
.items .order-part__head { color: var(--text); }
.order-note { display: grid; gap: 2px; margin-top: 12px; padding: 10px 14px; border-left: 3px solid var(--orange); border-radius: 0 var(--r-sm) var(--r-sm) 0; background: var(--card-2); color: var(--text); }
.order-note .muted { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; font-weight: 700; }
.pay__sum { font-size: 30px; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; margin-top: 8px; }
.pay__sum span { font-size: 16px; color: var(--text-2); font-weight: 600; }
.pay__text { font-size: 13px; color: var(--text-2); line-height: 1.5; }
.receipt { display: flex; gap: 16px; align-items: center; }
.receipt img { width: 64px; height: 80px; object-fit: cover; border-radius: var(--r-sm); border: 1px solid var(--line-field); cursor: zoom-in; }
.lightbox { position: fixed; inset: 0; background: rgba(20,22,40,.85); display: flex; align-items: center; justify-content: center; z-index: 60; cursor: zoom-out; padding: 24px; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: var(--r-md); }
details.more summary { cursor: pointer; list-style: none; }
details.more summary::-webkit-details-marker { display: none; }
details.more.cancel { position: relative; }
.btn--danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn--danger-solid .ic { stroke: #fff; }
.btn--danger-solid:hover { background: #c23a35; color: #fff; }
.cancel__panel { position: absolute; right: 0; top: calc(100% + 8px); z-index: 20; width: 440px; max-width: calc(100vw - 32px); display: flex; flex-direction: column; gap: 16px; padding: 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: 0 18px 48px rgba(30, 28, 70, .18); }
.cancel__title { font-weight: 700; font-size: 15px; }
.cancel__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cancel__opt { position: relative; display: block; cursor: pointer; }
.cancel__opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.cancel__opt:last-child:nth-child(odd) { grid-column: 1 / -1; }
.cancel__chip { display: flex; align-items: center; gap: 8px; height: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font-size: 13px; font-weight: 600; line-height: 1.25; color: var(--text-2); transition: border-color .12s, background .12s, color .12s; }
.cancel__chip .ic { flex: none; width: 18px; height: 18px; stroke: var(--text-3); }
.cancel__opt:hover .cancel__chip { border-color: rgba(216, 67, 61, .5); }
.cancel__opt input:checked + .cancel__chip { border-color: var(--danger); background: rgba(216, 67, 61, .08); color: var(--danger); box-shadow: 0 0 0 2px rgba(216, 67, 61, .15); }
.cancel__opt input:checked + .cancel__chip .ic { stroke: var(--danger); }
.cancel__opt input:focus-visible + .cancel__chip { outline: 2px solid var(--danger); outline-offset: 2px; }
@media (max-width: 640px) { .cancel__grid { grid-template-columns: 1fr; } .cancel__panel { position: fixed; left: 16px; right: 16px; top: auto; bottom: 16px; width: auto; max-width: none; } }

/* ---------- Analytics ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi { --k: var(--indigo-mid); --kt: var(--tint-indigo); position: relative; overflow: hidden; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); padding: 18px; box-shadow: var(--shadow-card); }
.kpi__label { font-size: 12px; color: var(--text-2); font-weight: 600; }
.kpi__value { font-size: 26px; font-weight: 700; margin-top: 8px; font-variant-numeric: tabular-nums; }
.kpi__sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.analytics-kpis { grid-template-columns: repeat(5, minmax(0,1fr)); }
.attention { padding: 0; overflow: hidden; }
.attention__head { padding: 18px 22px; border-bottom: 1px solid var(--line); background: #fffaf4; }
.attention__head h2 { margin: 0; font-size: 17px; }.attention__head h2 span { display: inline-grid; place-items: center; min-width: 25px; padding: 2px 6px; border-radius: 20px; background: #f5d7b4; color: #8b4c0d; font-size: 12px; }
.attention__head p { margin: 4px 0 0; color: var(--text-3); font-size: 12px; }
.attention__row { display: grid; grid-template-columns: 90px minmax(140px,1fr) minmax(180px,1.5fr) auto; gap: 14px; align-items: center; padding: 12px 22px; border-bottom: 1px solid var(--line-soft); color: var(--text); font-size: 13px; }
.attention__row:last-child { border-bottom: 0; }.attention__row:hover { background: #f9f9fd; color: var(--text); }
.attention__row strong { color: var(--indigo-light); text-align: right; }.attention__person { display: grid; }.attention__person small { color: var(--text-3); font-size: 11px; }.attention__reason { color: var(--text-2); }
.attention__badge { background: #eceafe; color: var(--indigo); border-radius: 6px; padding: 5px 7px; font-size: 11px; font-weight: 700; text-align: center; }
.attention__badge--late { background: #fff1e2; color: #a65307; }.attention__badge--payment { background: #eaf6ee; color: #157a4d; }
.attention__clear, .attention__more { padding: 16px 22px; color: var(--text-3); font-size: 13px; }
.attention__clear { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 44px 22px; font-size: 14px; }
.attention__clear .ic { stroke: var(--success); width: 22px; height: 22px; }
.attention__more { text-align: center; border-top: 1px solid var(--line-soft); }
.counters--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.counter__hint { margin-top: 4px; font-size: 12px; color: var(--text-3); line-height: 1.35; }
.arow { --tone: var(--text-3); --tone-bg: #f1f1f5; display: grid; grid-template-columns: 84px minmax(150px, 1fr) minmax(220px, 1.6fr) minmax(140px, auto) auto; gap: 18px; align-items: center; padding: 14px 22px 14px 19px; border-bottom: 1px solid var(--line-soft); border-left: 3px solid var(--tone); color: var(--text); font-size: 13px; transition: background .12s; }
.arow:last-child { border-bottom: 0; }
.arow:hover { background: #f9f9fd; color: var(--text); }
.arow--assign { --tone: var(--st-new); --tone-bg: #e8f0fb; }
.arow--payment { --tone: var(--success); --tone-bg: #e6f5ee; }
.arow--late { --tone: var(--orange); --tone-bg: #fff1e2; }
.arow__badge { justify-self: start; background: var(--tone-bg); color: var(--text); border-radius: 6px; padding: 5px 8px; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.arow__person { display: grid; gap: 2px; min-width: 0; }
.arow__person b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.arow small { color: var(--text-3); font-size: 12px; }
.arow__what { display: grid; gap: 5px; justify-items: start; min-width: 0; }
.arow__tag { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 20px; background: var(--tone-bg); color: var(--text); font-size: 11px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; }
.arow__tag .ic { width: 13px; height: 13px; stroke: var(--tone); }
.arow__reason { color: var(--text-2); }
.arow__meta { display: grid; gap: 4px; justify-items: start; }
.arow__action { display: inline-flex; align-items: center; gap: 4px; justify-self: end; color: var(--indigo); font-weight: 600; white-space: nowrap; }
.arow__action .ic { width: 16px; height: 16px; }
@media (max-width: 1100px) { .counters--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.contact-card { margin-top: 16px; }.contact-card__head { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; margin-bottom: 18px; }.contact-card__head h2 { margin: 0; font-size: 17px; }.contact-card__head p { margin: 4px 0 0; color: var(--text-3); font-size: 12px; }.contact-card__head>span { color: var(--text-3); font-size: 12px; }
.contact-card__forms { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }.contact-card__form { display: grid; align-content: start; gap: 9px; background: #f8f9fd; border: 1px solid var(--line); border-radius: 8px; padding: 16px; }.contact-card__form .btn { justify-self: start; }.contact-card__form, .contact-card__form .control { min-width: 0; }.contact-card__form select { max-width: 100%; }.contact-card__history { border-top: 1px solid var(--line); margin-top: 20px; }.contact-card__history>div { padding: 12px 0; border-bottom: 1px solid var(--line-soft); }.contact-card__history span { margin-left: 8px; color: var(--text-3); font-size: 12px; }.contact-card__history p { margin: 4px 0 0; white-space: pre-line; }
.analytics-kpis .kpi { min-height: 134px; }
.quality-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 0; }
.quality-grid>div { display: grid; gap: 4px; padding: 2px 20px; border-left: 1px solid var(--line); }
.quality-grid>div:first-child { border-left: 0; padding-left: 0; }.quality-grid span { color: var(--text-2); font-size: 12px; }.quality-grid b { font-size: 23px; }.quality-grid small { color: var(--text-3); font-size: 11px; }
.category-row { display: grid; grid-template-columns: minmax(0,1fr) 80px 80px; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); font-size: 13px; }.category-row b { text-align: right; font-weight: 600; }
.operator-row { display: grid; grid-template-columns: minmax(0,1fr) 65px 90px 75px; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); font-size: 13px; }.operator-row>*:not(:first-child) { text-align: right; }.operator-row--head { color: var(--text-3); font-size: 11px; }
.analytics-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 16px; align-items: stretch; }
.analytics-panel { min-width: 0; }
.analytics-panel__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 22px; }
.analytics-panel__head h2 { margin: 0; font-size: 16px; }
.analytics-panel__head span { color: var(--text-3); font-size: 12px; text-align: right; }
.analytics-columns { display: flex; height: 200px; gap: 5px; align-items: stretch; overflow-x: auto; }
.analytics-column { min-width: 17px; flex: 1; display: flex; flex-direction: column; align-items: center; color: var(--text-3); font-size: 11px; }
.analytics-column b { color: var(--text-2); font-size: 11px; min-height: 17px; }
.analytics-column__track { flex: 1; width: 100%; display: flex; align-items: flex-end; background: #f0f1f8; border-radius: 5px 5px 0 0; overflow: hidden; }
.analytics-column__track span { width: 100%; display: block; background: linear-gradient(180deg,var(--indigo-mid),var(--indigo)); border-radius: 5px 5px 0 0; }
.analytics-column small { padding-top: 5px; font-size: 10px; }
.analytics-statuses { display: grid; gap: 12px; }
.analytics-status>div:first-child, .analytics-department>div:first-child, .analytics-payment__top { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; margin-bottom: 5px; }
.analytics-status__track { height: 8px; background: #eceef6; border-radius: 999px; overflow: hidden; }
.analytics-status__track span { display: block; height: 100%; min-width: 0; background: var(--indigo-mid); border-radius: inherit; }
.analytics-status__bar--cancelled { background: var(--danger) !important; }
.analytics-status__bar--delivered, .analytics-status__bar--closed { background: var(--success) !important; }
.analytics-status__bar--delivering { background: var(--orange) !important; }
.analytics-department { margin-bottom: 18px; }
.analytics-department>div:first-child span { color: var(--text-3); }
.analytics-panel__total { display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line-soft); padding: 12px 0; font-size: 13px; }
.analytics-panel__total b { white-space: nowrap; }
.analytics-payment { padding: 15px 0; border-bottom: 1px solid var(--line-soft); }
.analytics-payment:first-of-type { padding-top: 0; }
.analytics-payment__meta { display: grid; gap: 4px; margin-top: 10px; color: var(--text-3); font-size: 12px; }
.bars { display: flex; flex-direction: column; gap: 14px; }
.bar__head { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.bar__track { height: 8px; border-radius: 4px; background: var(--card-2); overflow: hidden; }
.bar__fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--indigo-mid), var(--indigo-light)); }
.list { display: flex; flex-direction: column; }
.list__row { display: grid; grid-template-columns: minmax(0, 1fr) 70px 100px 130px; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.list__row:last-child { border-bottom: 0; }
.list__row--head { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }

/* ---------- Staff ---------- */
.waiting { display: flex; flex-direction: column; gap: 14px; padding: 18px 20px; border-radius: var(--r-md); border: 1px solid #D5D2F5; background: linear-gradient(135deg, #F1F0FF, #FAFAFF); }
.waiting__head { display: flex; align-items: center; gap: 14px; }
.waiting__icon { width: 42px; height: 42px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--indigo-mid); box-shadow: 0 4px 12px rgba(90, 81, 212, .3); }
.waiting__icon .ic { stroke: #fff; }
.waiting__title { font-weight: 700; color: var(--indigo); }
.waiting__list { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.waiting__item { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border-radius: 999px; background: #fff; border: 1px solid #D5D2F5; font-size: 13px; }
.waiting__item .avatar { background: var(--indigo-mid); color: #fff; }

.ugrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.ucard { display: flex; flex-direction: column; gap: 14px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); box-shadow: var(--shadow-card); transition: box-shadow .15s, border-color .15s; }
.ucard:hover { border-color: #D5D2F5; box-shadow: 0 6px 20px rgba(58, 52, 130, .10); }
.ucard.is-off { opacity: .6; }
.ucard__top { display: flex; align-items: center; gap: 12px; }
.avatar--xl { width: 48px; height: 48px; font-size: 18px; }
.ucard__who { display: flex; flex-direction: column; min-width: 0; margin-right: auto; }
.ucard__who b { color: var(--text); font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ucard__who .muted { font-size: 12px; }
.ucard__state { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 12px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.chip--ok { background: rgba(30, 153, 98, .12); color: var(--success); }
.chip--ok .ic { stroke: var(--success); }
.chip--wait { background: rgba(224, 138, 46, .16); color: var(--orange-text); }
.chip--portal { background: rgba(90, 81, 212, .10); color: var(--indigo-light); }
.chip--off { background: rgba(106, 112, 136, .14); color: var(--st-closed); }
.ucard__foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.ucard__hint { font-size: 13px; color: var(--text-3); padding: 10px 12px; border-radius: 10px; background: var(--bg); }
.ucard__link { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 12px; background: #F6F5FF; border: 1px solid #E1DFFA; }
.ucard__link-title { font-size: 12px; font-weight: 700; color: var(--indigo); }
.ucard__link .btn { align-self: flex-start; }
.picks { display: flex; flex-direction: column; gap: 6px; max-height: 190px; overflow-y: auto; }
.pick { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 13px; }
.pick:hover { border-color: var(--indigo-mid); }
.pick:has(input:checked) { border-color: var(--indigo-mid); background: #EEEDFF; box-shadow: 0 0 0 2px rgba(90, 81, 212, .18); }
.pick:has(input:focus-visible) { outline: 2px solid var(--indigo-mid); outline-offset: 2px; }
.pick input { accent-color: var(--indigo-mid); }
.pick .avatar { background: var(--indigo-mid); color: #fff; }
.pick__name { display: flex; flex-direction: column; min-width: 0; font-weight: 600; }
.pick__name small { font-weight: 400; color: var(--text-3); }
.inline-form { display: inline; }
.checkbox { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-2); }
.checkbox input { width: 16px; height: 16px; accent-color: var(--indigo-mid); }

/* ---------- Login ---------- */

@media (max-width: 1100px) {
  .quality-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px 0; }.quality-grid>div:nth-child(3) { border-left: 0; padding-left: 0; }
  .analytics-kpis { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .analytics-grid { grid-template-columns: 1fr; }
  .counters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .order-form, .detail { grid-template-columns: minmax(0, 1fr); }
  /* на узком экране колонки растворяются: сначала оплата и данные клиента, потом история */
  .detail__col { display: contents; }
  .d-handover, .d-pay { order: 1; } .d-facts { order: 2; } .d-time { order: 3; } .d-items { order: 4; } .d-edits { order: 5; } .d-contact { order: 6; }
  .order-form__aside { position: static; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tbl { overflow-x: auto; }
  .tbl__row { min-width: 870px; }
}
@media (max-width: 760px) {
  .quality-grid { grid-template-columns: 1fr 1fr; }.quality-grid>div { padding: 0 10px; }.quality-grid b { font-size: 20px; }
  .arow { grid-template-columns: auto 1fr; gap: 8px 12px; padding: 14px 16px 14px 13px; }
  .arow__what, .arow__meta, .arow__action { grid-column: 1 / -1; }
  .arow__action { justify-self: start; }
  .counters.counters--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .counters--4 .counter__hint { display: none; }
  .attention__row { grid-template-columns: 70px 1fr; }.attention__reason,.attention__row strong { grid-column: 2; text-align: left; }.contact-card__forms { grid-template-columns: 1fr; }
  .analytics-kpis { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .analytics-page .head { align-items: flex-start; }
  .analytics-page .head__actions { margin-left: 0; }
  .side { display: none; }
  .main { padding: 16px; }
  .row-2, .row-addr, .grid-2, .facts { grid-template-columns: 1fr; }
  .ugrid { grid-template-columns: 1fr; }
}

/* ---------- Clients ---------- */
.nav__group { margin: 20px 14px 6px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.crow {
  display: grid; grid-template-columns: minmax(0,1.2fr) 150px minmax(0,1.6fr) 80px 120px 100px;
  gap: 12px; padding: 0 16px; min-height: 52px; align-items: center; font-size: 13px;
  border-bottom: 1px solid var(--line-soft); color: inherit;
}
.crow--orders { grid-template-columns: 90px 60px minmax(0,1fr) 168px 100px; }
a.crow:hover { background: #F6F7FC; color: inherit; }
.crow--head {
  min-height: 40px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-3); background: #F8F9FD; border-bottom: 1px solid var(--line);
}

/* автоподсказки по номеру в форме заказа */
.field--suggest { position: relative; }
.suggest {
  position: absolute; top: calc(100% - 4px); left: 0; right: 0; z-index: 20; display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--line-field); border-radius: var(--r-md);
  box-shadow: 0 12px 32px rgba(28, 30, 60, .16); overflow: hidden;
}
.suggest__item {
  display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 10px 14px; border: 0;
  background: transparent; color: var(--text-2); font: inherit; font-size: 12px; cursor: pointer;
}
.suggest__item b { color: var(--text); font-size: 13px; }
.suggest__item:hover, .suggest__item:focus-visible { background: var(--indigo); color: #fff; outline: none; }
.field__hint { font-size: 12px; color: var(--success); }

@media (max-width: 900px) {
  .crow, .crow--orders { grid-template-columns: 1fr; padding: 10px 16px; gap: 2px; }
  .crow--head { display: none; }
}

/* ---------- Подразделения в заказе ---------- */
.parts { display: flex; flex-direction: column; gap: 12px; }
.part { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: rgba(255, 255, 255, .02); }
.part.is-invalid { border-color: var(--danger); }
.part__head { display: grid; grid-template-columns: minmax(0, 1fr) 170px auto; gap: 8px; align-items: center; }
.part__del[hidden] { display: none; }
.part__add { align-self: flex-start; }
.total-breakdown { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-2); }
.total-breakdown:empty { display: none; }
.total-breakdown > div { display: flex; justify-content: space-between; gap: 12px; }
.dept-row { display: grid; grid-template-columns: minmax(0, 1fr) 90px 130px; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); font-size: 13px; align-items: center; }
.dept-row:last-child { border-bottom: 0; }
.dept-row b { text-align: right; font-variant-numeric: tabular-nums; }
.order-part { padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.order-part:last-child { border-bottom: 0; }
.order-part__head { display: flex; justify-content: space-between; gap: 12px; font-weight: 700; margin-bottom: 4px; }
@media (max-width: 600px) { .part__head { grid-template-columns: 1fr auto; } .part__sum { grid-column: 1 / -1; order: 3; } }

/* ---------- Состав заказа: подразделения, товары и услуги ---------- */
#cart { display: flex; flex-direction: column; gap: 14px; }
.dep-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.dep-chip { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--line-field); background: #fff; color: var(--text-2); font: inherit; font-weight: 600; cursor: pointer; transition: background .15s, border-color .15s, color .15s, box-shadow .15s; }
.dep-chip:hover { border-color: var(--indigo-mid); color: var(--indigo); background: #F7F7FE; }
.dep-chip.is-on { background: var(--indigo); border-color: var(--indigo); color: #fff; box-shadow: 0 4px 12px rgba(58, 52, 130, .28); }
.dep-chip.is-on .ic { stroke: #fff; }
.dep-chip:focus-visible, .svc__row:focus-visible, .dep-card__add:focus-visible { outline: 2px solid var(--indigo-mid); outline-offset: 2px; }
.dep-empty { padding: 16px; border: 1px dashed var(--line-field); border-radius: var(--r-md); color: var(--text-3); font-size: 14px; background: #FAFAFE; }
.dep-cards { display: flex; flex-direction: column; gap: 12px; }
.dep-card { border: 1px solid #D5D2F5; border-left: 4px solid var(--indigo-mid); border-radius: var(--r-md); background: #fff; box-shadow: var(--shadow-card); overflow: hidden; }
.dep-card__head { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 14px; background: linear-gradient(90deg, rgba(90, 81, 212, .10), rgba(90, 81, 212, .02)); }
.dep-card__title { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--indigo); }
.dep-card__sub { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text); }
.dep-card__sub span { font-weight: 600; font-size: 12px; color: var(--text-3); }
.dep-card__lines { display: flex; flex-direction: column; gap: 8px; padding: 12px 12px 4px; }
.dep-line { display: grid; grid-template-columns: minmax(0, 1fr) 150px 36px; gap: 8px; align-items: center; }
.dep-line input { height: 42px; min-width: 0; padding: 0 12px; border: 1px solid var(--line-field); border-radius: var(--r-sm); background: var(--bg); color: var(--text); font: inherit; }
.dep-line input:focus { outline: 0; background: #fff; border-color: var(--indigo-mid); box-shadow: var(--focus-ring); }
.dep-line input::placeholder { color: var(--text-3); }
.dep-line__price { display: flex; align-items: center; gap: 0; position: relative; }
.dep-line__price input { width: 100%; padding-right: 64px; text-align: right; font-weight: 700; }
.dep-line__price span { position: absolute; right: 12px; font-size: 12px; color: var(--text-3); pointer-events: none; }
.dep-line__del { width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; cursor: pointer; }
.dep-line__del:hover { background: rgba(216, 67, 61, .10); }
.dep-line__del .ic { stroke: var(--text-3); }
.dep-line__del:hover .ic { stroke: var(--danger); }
.dep-card__add { display: inline-flex; align-items: center; gap: 6px; margin: 4px 12px 12px; height: 34px; padding: 0 12px; border: 1px dashed var(--indigo-mid); border-radius: var(--r-sm); background: transparent; color: var(--indigo-light); font: inherit; font-weight: 600; font-size: 13px; cursor: pointer; }
.dep-card__add:hover { background: rgba(90, 81, 212, .07); }
.dep-card__add .ic { stroke: var(--indigo-light); }

.svc { display: flex; flex-direction: column; gap: 10px; }
.svc__title { font-size: 12px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; }
.svc__row { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--line-field); border-radius: 14px; background: #fff; cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s; }
.svc__row:hover { border-color: #E0A15A; }
.svc__row.is-on { border-color: var(--orange); background: linear-gradient(90deg, #FFF3E2, #FFFAF3); box-shadow: 0 4px 14px rgba(224, 138, 46, .18); }
.svc__icon { width: 42px; height: 42px; flex: none; display: grid; place-items: center; border-radius: 12px; background: #F0F1F8; transition: background .15s; }
.svc__icon .ic { width: 22px; height: 22px; stroke: var(--text-3); transition: stroke .15s; }
.svc__row.is-on .svc__icon { background: linear-gradient(180deg, #EC9540, #D67E2A); box-shadow: 0 3px 8px rgba(214, 126, 42, .4); }
.svc__row.is-on .svc__icon .ic { stroke: #fff; }
.svc__text { display: flex; flex-direction: column; min-width: 0; margin-right: auto; }
.svc__name { font-weight: 700; font-size: 15px; }
.svc__state { font-size: 12px; color: var(--text-3); }
.svc__row.is-on .svc__state { color: var(--orange-text); font-weight: 600; }
.svc__price { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px; border: 1px solid var(--line-field); border-radius: var(--r-sm); background: var(--bg); cursor: text; }
.svc__price:focus-within { border-color: var(--orange); background: #fff; box-shadow: 0 0 0 3px rgba(224, 138, 46, .2); }
.svc__price input { width: 52px; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-weight: 700; text-align: right; }
.svc__price input:disabled { opacity: .4; }
.svc__price span { color: var(--text-3); font-size: 13px; }
.svc__switch { position: relative; width: 46px; height: 26px; flex: none; border-radius: 999px; background: #C9CDDC; transition: background .18s; }
.svc__switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .18s; }
.svc__row.is-on .svc__switch { background: var(--orange); }
.svc__row.is-on .svc__switch::after { transform: translateX(20px); }
.svc__row.is-locked { cursor: not-allowed; background: var(--bg); border-style: dashed; box-shadow: none; }
.svc__row.is-locked:hover { border-color: var(--line-field); }
.svc__row.is-locked .svc__icon { background: #E6E8F1; }
.svc__row.is-locked .svc__name, .svc__row.is-locked .svc__price { opacity: .55; }
.svc__row.is-locked .svc__price { cursor: not-allowed; }
.svc__row.is-locked .svc__switch { background: #DADDEA; }
.svc__row input[type=checkbox] { position: absolute; opacity: 0; width: 1px; height: 1px; }
.svc__row:has(input:focus-visible) { outline: 2px solid var(--indigo-mid); outline-offset: 2px; }
@media (max-width: 600px) {
  .dep-line { grid-template-columns: minmax(0, 1fr) 120px 36px; }
  .svc__state { display: none; }
  .svc__row { gap: 10px; padding: 12px; }
  .svc__text { flex: 1 1 0; }
  .svc__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .svc__price { padding: 0 10px; }
  .svc__price span { display: none; } /* единица измерения есть в aria-label и в сумме заказа */
  .svc__price input { width: 44px; }
}

.total-breakdown { display: flex; flex-direction: column; gap: 10px; font-size: 13px; color: var(--text-2); }
.total-breakdown:empty { display: none; }
.tb__group { display: flex; flex-direction: column; gap: 3px; }
.tb__row { display: flex; justify-content: space-between; gap: 12px; }
.tb__row--head { font-weight: 700; color: var(--text); font-size: 14px; }
.tb__row--item { color: var(--text-2); padding-left: 10px; font-size: 13px; }
.tb__row--item span:first-child { overflow: hidden; text-overflow: ellipsis; }
.tb__sep { height: 1px; background: var(--line); }

/* ---------- Каталог ---------- */
.cat-row { display: grid; grid-template-columns: minmax(0, 1fr) 100px auto auto; gap: 12px; align-items: center; padding: 8px 16px; border-top: 1px solid var(--line-soft); }
.cat-row--service { grid-template-columns: minmax(0, 1fr) 90px auto auto auto; }
.cat-row--category { grid-template-columns: minmax(0, 1fr) 140px 150px auto 40px auto; }
.cat-in { min-width: 0; width: 100%; height: 38px; padding: 0 10px; border: 1px solid var(--line-field); border-radius: var(--r-sm); background: transparent; color: var(--text); font: inherit; }
.cat-in--price { text-align: right; }
.cat-in--select { appearance: none; padding-right: 30px; cursor: pointer; background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238C92A8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E") no-repeat right 9px center; }
.cat-chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); white-space: nowrap; }
@media (max-width: 700px) { .cat-row, .cat-row--service, .cat-row--category { grid-template-columns: 1fr 1fr; } }
.dep-line__del[hidden] { display: none; }
.ucard__del { margin-top: auto; padding-top: 10px; border-top: 1px dashed var(--line); }
.ucard__delbtn { display: inline-flex; align-items: center; gap: 6px; padding: 4px 0; border: 0; background: none; color: var(--text-3); font: inherit; font-size: 12px; cursor: pointer; }
.ucard__delbtn .ic { stroke: currentColor; }
.ucard__delbtn:hover { color: var(--danger); }

/* --- Касса ---------------------------------------------------------------- */
.cash-kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.kpi--ok .kpi__value { color: var(--success); }
.kpi--warn { border-color: rgba(214, 126, 42, .45); background: #FFF8F0; }
.kpi--warn .kpi__value { color: #C0661A; }
.cash-date .control { height: 38px; }
.cash-row { display: grid; grid-template-columns: minmax(0, 1.6fr) 70px repeat(3, minmax(0, 1fr)); gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); font-size: 14px; }
.cash-row > :not(:first-child) { text-align: right; }
.cash-row--head { border-top: 0; padding-top: 0; font-size: 12px; font-weight: 600; color: var(--text-3); }
.cash-row--total { border-top: 2px solid var(--line-field); font-weight: 700; }
.cash-row__name { font-weight: 600; display: flex; flex-direction: column; gap: 4px; }
.cash-old { display: inline-flex; align-items: center; gap: 4px; font-weight: 500; font-size: 12px; color: #C0661A; }
.cash-old .ic, .cash-note .ic { width: 14px; height: 14px; stroke: #C0661A; }
.cash-ok { color: var(--success); }
.cash-debt { color: #C0661A; font-weight: 700; }
.cash-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 20px; }
.cash-note { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); }
@media (max-width: 1100px) { .cash-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .cash-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cash-row { grid-template-columns: 1fr 1fr; gap: 6px 12px; }
  .cash-row--head { display: none; }
  .cash-row__name { grid-column: 1 / -1; }
  .cash-row > [data-label] { text-align: left; }
  .cash-row > [data-label]::before { content: attr(data-label) ": "; color: var(--text-3); font-weight: 500; font-size: 12px; }
}
.hotkeys-hint { margin: 0; text-align: center; font-size: 12px; color: var(--text-3); }
.hotkeys-hint kbd { display: inline-block; padding: 1px 6px; border: 1px solid var(--line-field); border-bottom-width: 2px; border-radius: 4px; background: var(--card-2); font: 600 11px/1.5 inherit; color: var(--text-2); }
@media (hover: none) { .hotkeys-hint { display: none; } }

/* --- Окно подтверждения --------------------------------------------------- */
.confirm { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(20, 22, 40, .55); }
.confirm__card { width: min(440px, 100%); background: var(--card); border-radius: var(--r-md); padding: 24px; box-shadow: 0 20px 50px rgba(20, 22, 40, .35); }
.confirm__q { margin: 0 0 22px; font-size: 16px; line-height: 1.5; font-weight: 600; color: var(--text); }
.confirm__actions { display: flex; justify-content: flex-end; gap: 10px; }
@media (max-width: 480px) { .confirm__actions { flex-direction: column-reverse; } .confirm__actions .btn { width: 100%; } }

.cash-days a, .cash-days .is-disabled { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 32px; padding: 0 14px; box-sizing: border-box; }
.cash-days a:has(> .ic:only-child), .cash-days .is-disabled { padding: 0 8px; }
.cash-days .ic { width: 16px; height: 16px; stroke: currentColor; }
.cash-days .is-disabled { color: var(--text-3); opacity: .4; cursor: not-allowed; }
.cash-days .is-active .ic { stroke: #fff; }
.cash-date .control { height: 40px; }
.head__actions { flex-wrap: wrap; }
.cash-courier { border-top: 1px solid var(--line); }
.cash-courier > .cash-row { border-top: 0; }
.cash-orders { margin: 0 0 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--card-2); overflow: hidden; }
.cash-orders__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 13px; }
.cash-orders__hint { color: var(--text-3); font-size: 12px; }
.cash-check, .cash-order { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.cash-check span { font-weight: 600; }
.cash-orders input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--indigo); flex: none; cursor: pointer; }
.cash-order { padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 14px; transition: background .12s; }
.cash-order:hover { background: rgba(90, 81, 212, .05); }
.cash-order:has(input:checked) { background: rgba(90, 81, 212, .09); }
.cash-order__num { font-weight: 700; min-width: 74px; }
.cash-order__time { color: var(--text-3); font-size: 13px; flex: 1; }
.cash-order__time em { font-style: normal; color: #C0661A; font-weight: 600; }
.cash-order__sum { margin-left: auto; }
.cash-orders__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 12px 14px; background: var(--card); }
.cash-orders__total { font-size: 14px; color: var(--text-2); }
.cash-orders__total b { color: var(--text); }
.cash-orders__total [data-sum] { font-size: 18px; }
.cash-orders__foot .btn[disabled] { opacity: .45; cursor: not-allowed; filter: none; box-shadow: none; }
@media (max-width: 480px) { .cash-orders__foot .btn { width: 100%; } }

/* история правок заказа */
.order-edit + .order-edit { border-top: 1px solid var(--line-soft); padding-top: 12px; margin-top: 4px; }
.order-edit__meta { font-size: 12px; color: var(--text-3); margin-bottom: 6px; }
.order-edit ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: 14px; }
.order-edit li { overflow-wrap: anywhere; }

/* ============ v4 · светлая цветная тема ============ */
.topbar { display: flex; align-items: center; gap: 12px; min-height: 48px; }
.topbar__hello { display: flex; flex-direction: column; margin-right: auto; min-width: 0; }
.topbar__hello b { font-size: 17px; font-weight: 700; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar__hello span { font-size: 13px; color: var(--text-3); }
.topbar__hello span::first-letter { text-transform: uppercase; }
.topbar__bell { position: relative; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-card); transition: border-color .15s, transform .15s; }
.topbar__bell .ic { stroke: var(--text-2); }
.topbar__bell:hover { border-color: var(--indigo-mid); transform: translateY(-1px); }
.topbar__bell:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.topbar__dot { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; display: grid; place-items: center; border-radius: 999px; background: var(--orange); color: var(--on-orange); font-size: 11px; font-weight: 700; border: 2px solid var(--bg); }
.topbar__ava { width: 44px; height: 44px; font-size: 16px; color: #fff; box-shadow: 0 0 0 3px #fff, var(--shadow-card); }
.topbar__menu { display: none; width: 44px; height: 44px; place-items: center; border-radius: 14px; background: var(--card); border: 1px solid var(--line); cursor: pointer; box-shadow: var(--shadow-card); }
.topbar__menu .ic { stroke: var(--text); }
.topbar__menu:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.scrim { display: none; }

/* карточки-показатели с цветом */
.kpi::after { content: ""; position: absolute; right: -26px; top: -26px; width: 72px; height: 72px; border-radius: 50%; background: var(--kt); pointer-events: none; }
.kpi > * { position: relative; z-index: 1; }
.kpi__label { display: flex; align-items: center; gap: 8px; }
.kpi__label::before { content: ""; width: 9px; height: 9px; border-radius: 3px; background: var(--k); flex: none; }
.kpi__value { font-size: 28px; letter-spacing: -.02em; }
.kpi:nth-child(5n+2) { --k: var(--success); --kt: var(--tint-green); }
.kpi:nth-child(5n+3) { --k: var(--orange); --kt: var(--tint-orange); }
.kpi:nth-child(5n+4) { --k: var(--st-new); --kt: var(--tint-blue); }
.kpi:nth-child(5n+5) { --k: var(--st-delivering); --kt: var(--tint-violet); }
.kpi--warn { --k: var(--orange); --kt: var(--tint-orange); background: #FFFAF3; }

.card { border-color: var(--line); }
.card--info { background: linear-gradient(135deg, #F3F2FF, #FBFAFF); border-color: #DAD7F7; }
.card--attention { background: linear-gradient(135deg, #FFF4E5, #FFFAF3); border-color: #F4D3A6; }
.head__title { font-size: 26px; }
.head__count { background: var(--tint-orange); color: var(--orange-text); }
.btn--primary { border-radius: 12px; }
.btn--secondary { border-radius: 12px; }
.me__name { color: var(--text); }
.ucard, .dep-card { border-radius: var(--r-md); }
.attention__head { background: #FAFAFF; }
.crow--head, .tbl__head { border-radius: 0; }
.eyebrow { color: var(--text-3); }


/* мобильное меню: боковая панель выезжает слева */
@media (max-width: 760px) {
  .topbar__menu { display: grid; }
  .topbar__hello b { font-size: 15px; }
  .topbar__ava { display: none; }
  .side { display: flex; position: fixed; left: 0; top: 0; bottom: 0; width: min(290px, 86vw); transform: translateX(-102%); visibility: hidden; transition: transform .22s ease, visibility 0s .22s; box-shadow: 0 0 40px rgba(20, 22, 40, .25); }
  .app.is-menu .side { transform: none; visibility: visible; transition: transform .22s ease; }
  .app.is-menu .scrim { display: block; position: fixed; inset: 0; z-index: 30; background: rgba(20, 22, 40, .45); }
  .counters { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .counter { padding: 14px; }
  .counter__n { font-size: 26px; margin-top: 12px; }
}
@media (prefers-reduced-motion: reduce) { .side, .counter { transition: none; } }
.empty .btn .ic { width: 16px; height: 16px; stroke: var(--on-orange); }

/* ---------- Вход: стеклянная карточка на цветном фоне ---------- */
.login {
  min-height: 100vh; display: grid; place-items: center; padding: 32px 20px; position: relative; overflow: hidden;
  background:
    radial-gradient(55% 50% at 12% 18%, rgba(98, 88, 224, .85), transparent 70%),
    radial-gradient(45% 45% at 88% 22%, rgba(224, 138, 46, .6), transparent 70%),
    radial-gradient(55% 50% at 72% 92%, rgba(14, 143, 134, .55), transparent 70%),
    linear-gradient(160deg, #221E58, #14122E);
}
.login::before, .login::after {
  content: ""; position: absolute; border-radius: 50%; pointer-events: none; filter: blur(60px); opacity: .55;
  animation: login-drift 18s ease-in-out infinite alternate;
}
.login::before { width: 420px; height: 420px; left: -120px; bottom: -140px; background: #7A72E8; }
.login::after { width: 360px; height: 360px; right: -100px; top: -120px; background: #E08A2E; animation-delay: -9s; }
@keyframes login-drift { to { transform: translate(60px, -40px) scale(1.15); } }

.login__shell {
  position: relative; z-index: 1; width: min(940px, 100%); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  border-radius: 24px; overflow: hidden; border: 1px solid rgba(255, 255, 255, .35);
  box-shadow: 0 30px 80px rgba(8, 6, 30, .5), 0 2px 0 rgba(255, 255, 255, .15) inset;
  animation: login-in .55s cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes login-in { from { opacity: 0; transform: translateY(18px); } }

.login__brand {
  position: relative; overflow: hidden; padding: 40px 32px 180px; color: #fff; min-height: 500px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; text-align: center;
  background: linear-gradient(155deg, #5A51D4 0%, #3A3482 55%, #26215E 100%);
}
.login__waves { position: absolute; left: 0; bottom: -24px; width: 100%; height: auto; pointer-events: none; }
.login__waves path:nth-child(1) { stroke: #E08A2E; stroke-opacity: .95; }
.login__waves path:nth-child(2) { stroke: #fff; stroke-opacity: .32; }
.login__waves path:nth-child(3) { stroke: #fff; stroke-opacity: .18; }
.login__waves path:nth-child(4) { stroke: #fff; stroke-opacity: .09; }
.login__plate {
  position: relative; width: min(300px, 100%); padding: 16px 20px; border-radius: 22px; background: #fff;
  box-shadow: 0 18px 40px rgba(10, 8, 40, .35), 0 0 0 6px rgba(255, 255, 255, .16);
}
.login__mark { display: block; width: 100%; height: auto; aspect-ratio: 1080 / 440; object-fit: cover; }
.login__pitch { position: relative; display: grid; gap: 8px; }
.login__tag { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.login__lead { margin: 0; font-size: 14px; line-height: 1.5; color: rgba(255, 255, 255, .86); }

.login__side { display: flex; align-items: center; background: rgba(255, 255, 255, .88); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.login .login__card { width: 100%; padding: 48px 44px; background: none; border: 0; box-shadow: none; border-radius: 0; gap: 18px; }
.login__head { text-align: center; margin-bottom: 6px; }
.login__title { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -.02em; color: var(--text); }
.login__sub { margin-top: 6px; font-size: 13px; color: var(--text-2); }
.login .control { background: #fff; box-shadow: 0 2px 8px rgba(40, 36, 100, .08); }
.login .control:focus-within { box-shadow: var(--focus-ring); }
.login__btn {
  height: 46px; margin-top: 4px; border-radius: 12px; color: #fff; letter-spacing: .1em; text-transform: uppercase;
  background: linear-gradient(135deg, #6258E0, #3F3896); box-shadow: 0 10px 22px rgba(74, 66, 190, .35);
}
.login__btn:hover { filter: brightness(1.08); color: #fff; }
.login__btn:focus-visible { box-shadow: 0 10px 22px rgba(74, 66, 190, .35), var(--focus-ring); }
.login__foot { font-size: 12px; color: var(--text-2); text-align: center; }

@media (max-width: 760px) {
  .login { padding: 16px; align-items: start; }
  .login__shell { grid-template-columns: minmax(0, 1fr); }
  .login__brand { min-height: 0; padding: 28px 20px 40px; gap: 14px; }
  .login__waves { opacity: .6; }
  .login__plate { width: min(220px, 100%); padding: 12px 16px; border-radius: 18px; }
  .login__lead { display: none; }
  .login .login__card { padding: 28px 22px 32px; }
}
@media (prefers-reduced-motion: reduce) { .login::before, .login::after, .login__shell { animation: none; } }

/* статус заказа изменился сам, без перезагрузки: короткая вспышка вокруг метки */
.pill.is-fresh { animation: pill-fresh 1.6s ease-out; }
@keyframes pill-fresh {
  from { box-shadow: 0 0 0 0 color-mix(in srgb, var(--c) 55%, transparent); }
  to { box-shadow: 0 0 0 12px transparent; }
}
@media (prefers-reduced-motion: reduce) { .pill.is-fresh { animation: none; } }
