/* =====================================================================
   MVP Shop — панель управления. Дизайн-система.
   Визуальная основа: светлая тема, Inter, фиолетовый акцент, карточки
   16px с мягкой тенью, липкая полупрозрачная шапка.
   ===================================================================== */

@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(/fonts/inter-cyrillic-ext.woff2) format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(/fonts/inter-cyrillic.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(/fonts/inter-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(/fonts/inter-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --background: #fafbfc;
  --foreground: #1a1d24;
  --muted: #6b7280;
  --muted-foreground: #4b5563;
  --faint: #9ca3af;
  --card: #ffffff;
  --surface-2: #fbfbfc;
  --surface-3: #f6f7f9;
  --border: #e5e7eb;
  --border-hover: #d1d5db;
  --input: #f3f4f6;
  --accent: #7e5bff;
  --accent-hover: #6b47e8;
  --accent-text: #7e5bff;
  --accent-muted: rgba(126, 91, 255, .12);
  --accent-soft: rgba(126, 91, 255, .06);
  --accent-border: rgba(126, 91, 255, .28);
  --accent-glow: rgba(126, 91, 255, .16);
  --ring: rgba(126, 91, 255, .4);
  --on-accent: #ffffff;

  --success: #059669; --success-hover: #047857; --success-bg: #ecfdf5; --success-border: #a7f3d0; --success-fg: #064e3b;
  --warning: #b45309; --warning-bg: #fffbeb; --warning-border: #fde68a; --warning-fg: #78350f;
  --danger: #dc2626;  --danger-hover: #b91c1c; --danger-bg: #fef2f2;  --danger-border: #fecaca; --danger-fg: #7f1d1d;
  --info: #2563eb;    --info-bg: #eff6ff;    --info-border: #bfdbfe;
  --neutral-bg: #f3f4f6;
  --danger-solid: #dc2626; --danger-solid-hover: #b91c1c; --success-solid: #059669; --success-solid-hover: #047857;
  --bar-pending: #f59e0b; --bar-processing: #3b82f6; --bar-approved: #10b981; --bar-rejected: #ef4444; --bar-expired: #9ca3af;
  --star: #f59e0b; --star-off: #e5e7eb;

  --header-bg: rgba(255, 255, 255, .72);
  --header-border: rgba(229, 231, 235, .8);
  --thread-bg: #fbfbfd;
  --thread-head-bg: rgba(255, 255, 255, .9);
  --overlay: rgba(17, 24, 39, .42);
  --scrim: rgba(17, 24, 39, .35);
  --skeleton: #eef0f3;
  --skeleton-shine: rgba(255, 255, 255, .7);
  --switch-off: #d1d5db;
  --block-veil: rgba(250, 251, 252, .6);

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 1px 3px rgba(0, 0, 0, .08);
  --shadow-md: 0 4px 16px -6px rgba(17, 24, 39, .12);
  --shadow-lg: 0 10px 40px -15px rgba(0, 0, 0, .15);
  --shadow-pop: 0 24px 60px -20px rgba(17, 24, 39, .28);
  --shadow-accent: 0 6px 18px -8px rgba(126, 91, 255, .8);

  --header-h: 64px;
  --sidebar-w: 256px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(.4, 0, .2, 1);
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

/* Тёмная тема — палитра из тёмных вариантов референса
   (zinc-950 фон, slate-900 поверхности, violet/emerald/amber/red-400). */
:root[data-theme="dark"] {
  --background: #0c0d12;
  --foreground: #eceef3;
  --muted: #9aa1ae;
  --muted-foreground: #b6bcc7;
  --faint: #6b7280;
  --card: #14161d;
  --surface-2: #171922;
  --surface-3: #1a1c25;
  --border: #262935;
  --border-hover: #363a49;
  --input: #1c1f29;
  --accent: #8b6dff;
  --accent-hover: #9d84ff;
  --accent-text: #a78bfa;
  --accent-muted: rgba(139, 109, 255, .18);
  --accent-soft: rgba(139, 109, 255, .08);
  --accent-border: rgba(139, 109, 255, .38);
  --accent-glow: rgba(139, 109, 255, .22);
  --ring: rgba(139, 109, 255, .5);

  --success: #34d399; --success-hover: #10b981; --success-bg: rgba(16, 185, 129, .12); --success-border: rgba(5, 150, 105, .45); --success-fg: #a7f3d0;
  --warning: #fbbf24; --warning-bg: rgba(245, 158, 11, .12); --warning-border: rgba(217, 119, 6, .45); --warning-fg: #fde68a;
  --danger: #f87171;  --danger-hover: #ef4444; --danger-bg: rgba(239, 68, 68, .12); --danger-border: rgba(220, 38, 38, .45); --danger-fg: #fecaca;
  --info: #60a5fa;    --info-bg: rgba(59, 130, 246, .12); --info-border: rgba(59, 130, 246, .4);
  --neutral-bg: #1f222c;
  --bar-expired: #6b7280;
  --star-off: #2f3340;

  --header-bg: rgba(12, 13, 18, .72);
  --header-border: rgba(38, 41, 53, .9);
  --thread-bg: #101218;
  --thread-head-bg: rgba(20, 22, 29, .9);
  --overlay: rgba(0, 0, 0, .62);
  --scrim: rgba(0, 0, 0, .55);
  --skeleton: #1c1f29;
  --skeleton-shine: rgba(255, 255, 255, .05);
  --switch-off: #3a3e4d;
  --block-veil: rgba(12, 13, 18, .55);

  --shadow: 0 1px 2px rgba(0, 0, 0, .5);
  --shadow-md: 0 6px 20px -8px rgba(0, 0, 0, .7);
  --shadow-lg: 0 14px 40px -15px rgba(0, 0, 0, .8);
  --shadow-pop: 0 28px 70px -20px rgba(0, 0, 0, .85);
  --shadow-accent: 0 8px 22px -10px rgba(139, 109, 255, .75);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 12px); }
body {
  margin: 0; min-height: 100dvh; background: var(--background); color: var(--foreground);
  font-family: var(--font); font-size: 14px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11", "ss01";
  overflow-x: hidden;
}
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3 { letter-spacing: -.02em; line-height: 1.2; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { color: var(--accent-hover); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img, svg { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--accent-muted); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: var(--mono); font-size: .92em; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.nowrap { white-space: nowrap; }
.break { overflow-wrap: anywhere; word-break: break-word; }
.hidden, [hidden] { display: none !important; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.grow { flex: 1 1 auto; min-width: 0; }
.ic { width: 18px; height: 18px; flex: none; }
.ic-sm { width: 16px; height: 16px; flex: none; }
.ic-lg { width: 22px; height: 22px; flex: none; }

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

/* ---------- Boot ---------- */
.boot { position: fixed; inset: 0; display: grid; place-content: center; justify-items: center; gap: 22px; color: var(--muted); background: var(--background); z-index: 5; }
.boot-mark { width: 44px; height: 44px; border-radius: 12px; background: var(--accent) url(/favicon.svg) center/cover; animation: pulse 1.4s var(--ease) infinite; }
.boot-text { font-size: 13px; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .55; transform: scale(.94); } }

/* ---------- Brand ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--foreground); font-weight: 700; font-size: 17px; letter-spacing: -.02em; }
.brand:hover { color: var(--foreground); }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; flex: none; background: var(--accent) url(/favicon.svg) center/cover; box-shadow: var(--shadow-accent); }
.brand-name b { color: var(--accent-text); font-weight: 700; }
.brand-tag { font-size: 11px; font-weight: 600; color: var(--accent-text); background: var(--accent-muted); border-radius: 999px; padding: 2px 8px; letter-spacing: 0; }

/* ---------- Buttons ---------- */
.btn {
  --btn-h: 40px;
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--btn-h); padding: 0 16px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--card); color: var(--foreground);
  font-size: 14px; font-weight: 600; line-height: 1; white-space: nowrap; text-decoration: none;
  transition: background .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease), box-shadow .15s var(--ease), transform .1s var(--ease);
  box-shadow: var(--shadow); user-select: none; -webkit-tap-highlight-color: transparent;
}
.btn:hover { border-color: var(--border-hover); background: var(--surface-2); color: var(--foreground); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--on-accent); }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--muted-foreground); }
.btn-ghost:hover { background: var(--input); border-color: transparent; color: var(--foreground); }
.btn-danger { background: var(--danger-solid); border-color: var(--danger-solid); color: #fff; box-shadow: 0 6px 18px -10px rgba(220, 38, 38, .7); }
.btn-danger:hover { background: var(--danger-solid-hover); border-color: var(--danger-solid-hover); color: #fff; }
.btn-danger-soft { color: var(--danger); }
.btn-danger-soft:hover { background: var(--danger-bg); border-color: var(--danger-border); color: var(--danger); }
.btn-success { background: var(--success-solid); border-color: var(--success-solid); color: #fff; box-shadow: 0 6px 18px -10px rgba(5, 150, 105, .8); }
.btn-success:hover { background: var(--success-solid-hover); border-color: var(--success-solid-hover); color: #fff; }
.btn-accent-soft { background: var(--accent-muted); border-color: transparent; color: var(--accent-text); box-shadow: none; }
.btn-accent-soft:hover { background: var(--accent-glow); border-color: transparent; color: var(--accent-text); }
.btn-sm { --btn-h: 32px; padding: 0 12px; font-size: 13px; border-radius: 10px; gap: 6px; }
.btn-lg { --btn-h: 48px; padding: 0 22px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-icon { padding: 0; width: var(--btn-h); }
.btn .ic { width: 17px; height: 17px; }
.btn-sm .ic { width: 15px; height: 15px; }
.btn[aria-busy="true"] { color: transparent !important; pointer-events: none; }
.btn[aria-busy="true"]::after {
  content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-color: var(--accent) transparent var(--accent) transparent; animation: spin .7s linear infinite;
}
.btn-primary[aria-busy="true"]::after, .btn-danger[aria-busy="true"]::after, .btn-success[aria-busy="true"]::after { border-color: #fff transparent #fff transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.link-btn:hover { color: var(--accent-hover); }

/* ---------- Form controls ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field + .field { margin-top: 14px; }
.field-label { font-size: 13px; font-weight: 600; color: var(--foreground); }
.field-hint { font-size: 12.5px; color: var(--muted); }
.field-error { font-size: 12.5px; color: var(--danger); font-weight: 500; }
.input, .select, .textarea {
  width: 100%; min-height: 44px; padding: 10px 14px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--card); color: var(--foreground);
  font-size: 15px; transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
  appearance: none; -webkit-appearance: none;
}
@media (min-width: 768px) { .input, .select, .textarea { font-size: 14px; } }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--border-hover); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-muted); }
.input[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 4px var(--danger-bg); }
.input:disabled, .textarea:disabled, .select:disabled { background: var(--input); color: var(--muted); cursor: not-allowed; }
.textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.select { padding-right: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; }
.input-sm { min-height: 36px; padding: 6px 10px; border-radius: 10px; font-size: 14px; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap > .ic { position: absolute; left: 14px; color: var(--faint); pointer-events: none; }
.input-wrap > .input { padding-left: 42px; }
.form-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.form-grid .field + .field { margin-top: 0; }
@media (min-width: 640px) { .form-grid.cols-2 { grid-template-columns: 1fr 1fr; } .form-grid .span-2 { grid-column: 1 / -1; } }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 18px; }
.check { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }

/* Switch */
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13px; color: var(--muted-foreground); background: none; border: 0; padding: 4px 0; }
.switch-track { width: 38px; height: 22px; border-radius: 999px; background: var(--switch-off); position: relative; transition: background .2s var(--ease); flex: none; }
.switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .2s var(--ease); }
.switch[aria-checked="true"] .switch-track { background: var(--accent); }
.switch[aria-checked="true"] .switch-track::after { transform: translateX(16px); }
.switch:disabled { opacity: .5; cursor: wait; }

/* ---------- Cards / surfaces ---------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); min-width: 0; }
.card-pad { padding: 20px; }
@media (min-width: 768px) { .card-pad { padding: 24px; } }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
@media (min-width: 768px) { .card-head { padding: 18px 24px; } }
.card-title { font-size: 16px; font-weight: 700; letter-spacing: -.01em; display: flex; align-items: center; gap: 10px; }
.card-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.card-body { padding: 20px; }
@media (min-width: 768px) { .card-body { padding: 20px 24px 24px; } }
.card-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.card-flush { overflow: hidden; }
.card-accent { border-color: var(--accent-border); box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow); }

.tile { width: 40px; height: 40px; border-radius: 10px; background: var(--accent-muted); color: var(--accent-text); display: grid; place-items: center; flex: none; }
.tile .ic { width: 20px; height: 20px; }
.tile-sm { width: 32px; height: 32px; border-radius: 9px; }
.tile-sm .ic { width: 17px; height: 17px; }
.tile-success { background: var(--success-bg); color: var(--success); }
.tile-warning { background: var(--warning-bg); color: var(--warning); }
.tile-danger { background: var(--danger-bg); color: var(--danger); }
.tile-neutral { background: var(--neutral-bg); color: var(--muted-foreground); }

.pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--card); color: var(--accent-text); font-size: 13px; font-weight: 500; box-shadow: var(--shadow); }
.pill .ic { width: 15px; height: 15px; }

.divider { height: 1px; background: var(--border); border: 0; margin: 16px 0; }

/* ---------- Status chips & badges ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; line-height: 1.5; }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.chip-pending    { color: var(--warning); background: var(--warning-bg); border-color: var(--warning-border); }
.chip-processing { color: var(--info); background: var(--info-bg); border-color: var(--info-border); }
.chip-approved, .chip-paid, .chip-success { color: var(--success); background: var(--success-bg); border-color: var(--success-border); }
.chip-rejected, .chip-cancelled, .chip-danger { color: var(--danger); background: var(--danger-bg); border-color: var(--danger-border); }
.chip-expired, .chip-closed, .chip-neutral { color: var(--muted-foreground); background: var(--neutral-bg); border-color: var(--border); }
.chip-open, .chip-accent { color: var(--accent-text); background: var(--accent-muted); border-color: var(--accent-border); }
.chip-lg { font-size: 13.5px; padding: 5px 12px 5px 10px; }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; background: var(--input); color: var(--muted-foreground); white-space: nowrap; }
.tag-accent { background: var(--accent-muted); color: var(--accent-text); }
.count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 11.5px; font-weight: 700; display: inline-grid; place-items: center; line-height: 1; font-variant-numeric: tabular-nums; }
.count-danger { background: var(--danger); }

/* ---------- Callouts ---------- */
.callout { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--card); font-size: 13.5px; color: var(--muted-foreground); }
.callout .ic { margin-top: 1px; }
.callout strong { color: var(--foreground); }
.callout-info { background: var(--accent-soft); border-color: var(--accent-border); }
.callout-info .ic { color: var(--accent-text); }
.callout-warning { background: var(--warning-bg); border-color: var(--warning-border); color: var(--warning-fg); }
.callout-warning .ic { color: var(--warning); }
.callout-danger { background: var(--danger-bg); border-color: var(--danger-border); color: var(--danger-fg); }
.callout-danger .ic { color: var(--danger); }
.callout-success { background: var(--success-bg); border-color: var(--success-border); color: var(--success-fg); }
.callout-success .ic { color: var(--success); }

/* ---------- Segmented tabs ---------- */
.seg { display: inline-flex; gap: 2px; padding: 4px; border-radius: var(--radius); background: var(--input); border: 1px solid var(--border); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg-btn { border: 0; background: transparent; border-radius: 9px; padding: 7px 14px; font-size: 13.5px; font-weight: 600; color: var(--muted-foreground); white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; transition: background .15s var(--ease), color .15s var(--ease); }
.seg-btn:hover { color: var(--foreground); }
.seg-btn[aria-selected="true"] { background: var(--card); color: var(--foreground); box-shadow: var(--shadow); }
.seg-btn .count { height: 18px; min-width: 18px; font-size: 11px; }
.seg-full { display: flex; width: 100%; }
.seg-full .seg-btn { flex: 1; justify-content: center; }

/* ---------- Page ---------- */
.page { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-title { font-size: 24px; font-weight: 700; letter-spacing: -.025em; }
@media (min-width: 768px) { .page-title { font-size: 28px; } }
.page-sub { color: var(--muted-foreground); margin-top: 6px; font-size: 14px; max-width: 70ch; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--muted-foreground); margin-bottom: 8px; }
.back-link:hover { color: var(--accent); }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.toolbar .input-wrap { flex: 1 1 260px; max-width: 420px; }
@media (max-width: 639px) { .toolbar .input-wrap { max-width: none; flex-basis: 100%; } .page-actions { width: 100%; } .page-actions .btn { flex: 1 1 0; min-width: 0; padding: 0 10px; font-size: 13.5px; } }

/* ---------- Stats ---------- */
.stats { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
.stat { padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.stat-top { display: flex; align-items: center; gap: 12px; }
.stat-label { font-size: 13px; color: var(--muted-foreground); font-weight: 500; }
.stat-value { font-size: 26px; font-weight: 700; letter-spacing: -.025em; font-variant-numeric: tabular-nums; line-height: 1.1; overflow-wrap: anywhere; }
.stat-value.accent { color: var(--accent-text); }
.stat-note { font-size: 12.5px; color: var(--muted); }
a.stat { color: inherit; transition: border-color .15s var(--ease), box-shadow .15s var(--ease); }
a.stat:hover { border-color: var(--accent-border); box-shadow: var(--shadow-md); color: inherit; }

/* ---------- Key-value ---------- */
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.kv-item { background: var(--card); padding: 12px 14px; min-width: 0; box-shadow: 1px 1px 0 0 var(--border); }
.kv-k { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.kv-v { font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.kv-v.lg { font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.list-rows { display: flex; flex-direction: column; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); min-width: 0; }
.list-row:first-child { border-top: 0; padding-top: 0; }
.list-row:last-child { padding-bottom: 0; }
.list-row .grow { overflow: hidden; }
.list-row-title { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row-sub { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.list-row { color: inherit; }
a.list-row:hover .list-row-title { color: var(--accent); }

/* ---------- Tables ---------- */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.table th { text-align: left; font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 12px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table th:first-child, .table td:first-child { padding-left: 20px; }
.table th:last-child, .table td:last-child { padding-right: 20px; }
.table .t-right { text-align: right; }
.table .t-actions { text-align: right; white-space: nowrap; }
.table .t-actions .btn + .btn { margin-left: 6px; }
.table tbody tr.clickable { cursor: pointer; transition: background .12s var(--ease); }
.table tbody tr.clickable:hover { background: var(--accent-soft); }
.table .t-strong { font-weight: 600; }
.table .t-clip { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.amount { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.amount.pos { color: var(--success); }
.amount.neg { color: var(--danger); }

/* Таблица превращается в карточки на узких экранах */
@media (max-width: 767px) {
  .table-cards thead { display: none; }
  .table-cards, .table-cards tbody, .table-cards tr, .table-cards td { display: block; width: 100%; }
  .table-cards tr { padding: 14px 16px; border-bottom: 1px solid var(--border); }
  .table-cards tr:last-child { border-bottom: 0; }
  .table-cards td { border: 0 !important; padding: 4px 0 !important; display: flow-root; text-align: right; min-width: 0; line-height: 1.5; }
  .table-cards td::before { content: attr(data-label); float: left; margin-right: 14px; color: var(--muted); font-size: 12.5px; font-weight: 500; text-align: left; line-height: 1.8; }
  .table-cards td[data-label=""]::before, .table-cards td:not([data-label])::before { display: none; }
  .table-cards td > .row { display: inline-flex; vertical-align: middle; }
  .table-cards td.t-primary { font-size: 15px; font-weight: 600; text-align: left; padding-bottom: 6px !important; }
  .table-cards td.t-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 10px !important; flex-wrap: wrap; }
  .table-cards td > * { min-width: 0; }
  .table-cards td.t-clip { max-width: none; white-space: normal; overflow-wrap: anywhere; text-overflow: clip; }
}
/* Широкие таблицы (много колонок/кнопок) — карточки до 1366px */
@media (max-width: 1365px) {
  .table-wide thead { display: none; }
  .table-wide, .table-wide tbody, .table-wide tr, .table-wide td { display: block; width: 100%; }
  .table-wide tr { padding: 14px 16px; border-bottom: 1px solid var(--border); }
  .table-wide tr:last-child { border-bottom: 0; }
  .table-wide td { border: 0 !important; padding: 4px 0 !important; display: flow-root; text-align: right; min-width: 0; line-height: 1.5; }
  .table-wide td::before { content: attr(data-label); float: left; margin-right: 14px; color: var(--muted); font-size: 12.5px; font-weight: 500; text-align: left; line-height: 1.8; }
  .table-wide td[data-label=""]::before, .table-wide td:not([data-label])::before { display: none; }
  .table-wide td > .row { display: inline-flex; vertical-align: middle; }
  .table-wide td.t-primary { font-size: 15px; font-weight: 600; text-align: left; padding-bottom: 6px !important; }
  .table-wide td.t-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 10px !important; flex-wrap: wrap; }
  .table-wide td > * { min-width: 0; }
  .table-wide td.t-clip { max-width: none; white-space: normal; overflow-wrap: anywhere; text-overflow: clip; }
}

.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); flex-wrap: wrap; }

/* ---------- States ---------- */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 48px 20px; color: var(--muted-foreground); }
.empty .tile { width: 52px; height: 52px; border-radius: 14px; margin-bottom: 4px; }
.empty .tile .ic { width: 24px; height: 24px; }
.empty-title { font-size: 16px; font-weight: 700; color: var(--foreground); }
.empty-text { font-size: 14px; max-width: 46ch; }
.empty .btn { margin-top: 8px; }
.skeleton { position: relative; overflow: hidden; background: var(--skeleton); border-radius: 8px; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, var(--skeleton-shine), transparent); animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }
.sk-line { height: 12px; }
.sk-title { height: 20px; width: 40%; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--accent-muted); border-top-color: var(--accent); animation: spin .8s linear infinite; }

/* ---------- App shell ---------- */
.app { min-height: 100dvh; display: flex; flex-direction: column; }
.header {
  position: sticky; top: 0; z-index: 30; height: var(--header-h);
  background: var(--header-bg); -webkit-backdrop-filter: saturate(160%) blur(12px); backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--header-border);
}
.header-in { height: 100%; display: flex; align-items: center; gap: 12px; padding: 0 16px; }
@media (min-width: 768px) { .header-in { padding: 0 24px; gap: 16px; } }
.header .brand { flex: none; }
.header-search { flex: 1 1 auto; max-width: 420px; margin-left: 16px; }
.header-search .input { min-height: 40px; background: var(--input); border-color: transparent; font-size: 14px; }
.header-search .input:focus { background: var(--card); }
.header-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.session-chip { display: none; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--card); font-size: 12.5px; color: var(--muted-foreground); max-width: 280px; }
.session-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px var(--success-bg); flex: none; }
.session-chip .email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.session-chip.warn .dot { background: var(--warning); box-shadow: 0 0 0 3px var(--warning-bg); }
@media (min-width: 1024px) { .session-chip { display: inline-flex; } }
.burger { display: inline-flex; }
@media (min-width: 1024px) { .burger { display: none; } }
@media (max-width: 767px) { .header-search { display: none; } .brand-tag { display: none; } }
@media (max-width: 389px) { .header .brand-name { display: none; } }

.layout { flex: 1; display: grid; grid-template-columns: 1fr; min-width: 0; }
@media (min-width: 1024px) { .layout { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); } }

.sidebar { background: var(--card); border-right: 1px solid var(--border); display: flex; flex-direction: column; min-width: 0; }
@media (min-width: 1024px) {
  .sidebar { position: sticky; top: var(--header-h); height: calc(100dvh - var(--header-h)); }
}
@media (max-width: 1023px) {
  .sidebar { position: fixed; z-index: 60; top: 0; bottom: 0; left: 0; width: min(304px, 86vw); transform: translateX(-102%); transition: transform .25s var(--ease); box-shadow: var(--shadow-pop); border-right: 0; }
  .sidebar.open { transform: none; }
}
.sidebar-top { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--border); height: var(--header-h); }
@media (min-width: 1024px) { .sidebar-top { display: none; } }
.nav { flex: 1; overflow-y: auto; padding: 16px 12px; display: flex; flex-direction: column; gap: 18px; overscroll-behavior: contain; }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-group-label { font-size: 12px; font-weight: 600; color: var(--faint); padding: 0 12px 6px; }
.nav-item { display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 12px; border-radius: 10px; color: var(--muted-foreground); font-weight: 500; font-size: 14px; transition: background .12s var(--ease), color .12s var(--ease); }
.nav-item .ic { color: var(--faint); transition: color .12s var(--ease); }
.nav-item:hover { background: var(--input); color: var(--foreground); }
.nav-item:hover .ic { color: var(--muted-foreground); }
.nav-item[aria-current="page"] { background: var(--accent-muted); color: var(--accent-text); font-weight: 600; }
.nav-item[aria-current="page"] .ic { color: var(--accent-text); }
.nav-item .count { margin-left: auto; }
.sidebar-foot { padding: 12px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; padding-bottom: calc(12px + var(--safe-b)); }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 6px 4px; min-width: 0; }
.sidebar-user .avatar { width: 34px; height: 34px; }
.sidebar-user-email { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user-meta { font-size: 12px; color: var(--muted); }
.scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 55; opacity: 0; pointer-events: none; transition: opacity .2s var(--ease); }
.scrim.show { opacity: 1; pointer-events: auto; }

.main { min-width: 0; padding: 20px 16px calc(40px + var(--safe-b)); }
@media (min-width: 768px) { .main { padding: 28px 28px 56px; } }
@media (min-width: 1280px) { .main { padding: 32px 40px 64px; } }
.main-in { max-width: 1240px; margin: 0 auto; min-width: 0; }
.route-chats .main { padding-bottom: 20px; }
.route-chats .main-in { max-width: 1400px; }

.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px; color: var(--accent-text); background: var(--accent-muted); flex: none; text-transform: uppercase; }
.avatar-sm { width: 32px; height: 32px; font-size: 12.5px; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; z-index: 120; right: 16px; bottom: calc(16px + var(--safe-b)); display: flex; flex-direction: column; gap: 10px; width: min(380px, calc(100vw - 32px)); pointer-events: none; }
@media (max-width: 639px) { .toasts { left: 16px; right: 16px; width: auto; top: calc(12px + env(safe-area-inset-top, 0px)); bottom: auto; } }
.toast { pointer-events: auto; display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--border); box-shadow: var(--shadow-pop); font-size: 14px; animation: toastIn .25s var(--ease); }
.toast .ic { margin-top: 1px; }
.toast-success .ic { color: var(--success); }
.toast-error { border-color: var(--danger-border); }
.toast-error .ic { color: var(--danger); }
.toast-info .ic { color: var(--accent-text); }
.toast.out { opacity: 0; transform: translateY(6px); transition: all .2s var(--ease); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Modal / sheet ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 100; background: var(--overlay); display: flex; align-items: center; justify-content: center; padding: 20px; animation: fadeIn .15s var(--ease); }
.modal { width: 100%; max-width: 520px; max-height: calc(100dvh - 40px); display: flex; flex-direction: column; background: var(--card); border-radius: 20px; box-shadow: var(--shadow-pop); border: 1px solid var(--border); animation: popIn .2s var(--ease); }
.modal-lg { max-width: 720px; }
.modal-head { display: flex; align-items: flex-start; gap: 14px; padding: 22px 24px 0; }
.modal-title { font-size: 18px; font-weight: 700; letter-spacing: -.015em; }
.modal-sub { font-size: 13.5px; color: var(--muted-foreground); margin-top: 4px; }
.modal-body { padding: 18px 24px; overflow-y: auto; overscroll-behavior: contain; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 16px 24px 22px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.modal-close { margin-left: auto; margin-top: -6px; margin-right: -8px; }
@media (max-width: 639px) {
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal { max-width: none; border-radius: 20px 20px 0 0; max-height: 92dvh; animation: sheetIn .25s var(--ease); }
  .modal-head { padding: 20px 20px 0; }
  .modal-body { padding: 16px 20px; }
  .modal-foot { padding: 14px 20px calc(16px + var(--safe-b)); }
  .modal-foot .btn { flex: 1 1 auto; }
  .modal::before { content: ""; width: 40px; height: 4px; border-radius: 4px; background: var(--border-hover); margin: 8px auto 0; }
}
@keyframes fadeIn { from { opacity: 0; } }
@keyframes popIn { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes sheetIn { from { transform: translateY(100%); } }

/* ---------- Lightbox (защищённый просмотр вложений) ---------- */
.lightbox { position: fixed; inset: 0; z-index: 130; background: rgba(10, 12, 18, .92); display: flex; flex-direction: column; animation: fadeIn .15s var(--ease); }
.lightbox-bar { display: flex; align-items: center; gap: 10px; padding: 12px 16px; color: #e5e7eb; font-size: 13px; padding-top: calc(12px + env(safe-area-inset-top, 0px)); }
.lightbox-bar .btn { background: rgba(255,255,255,.1); border-color: transparent; color: #fff; box-shadow: none; }
.lightbox-bar .btn:hover { background: rgba(255,255,255,.2); color: #fff; }
.lightbox-stage { flex: 1; display: grid; place-items: center; overflow: auto; padding: 8px 16px calc(24px + var(--safe-b)); }
.lightbox-stage img { max-width: 100%; max-height: calc(100dvh - 110px); border-radius: 10px; object-fit: contain; background: #fff; }
.lightbox-stage.zoom img { max-width: none; max-height: none; cursor: zoom-out; }
.lightbox-stage img { cursor: zoom-in; }

.attach { display: inline-block; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); background: var(--input); padding: 0; max-width: 260px; cursor: zoom-in; position: relative; }
.attach img { width: 100%; max-height: 240px; object-fit: cover; }
.attach-fail { display: inline-flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; border: 1px dashed var(--border-hover); color: var(--muted); font-size: 13px; }

/* ---------- Auth ---------- */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px calc(24px + var(--safe-b)); position: relative; overflow: hidden; }
.auth::before { content: ""; position: absolute; width: 720px; height: 720px; border-radius: 50%; top: -360px; right: -200px; background: radial-gradient(closest-side, var(--accent-glow), transparent); pointer-events: none; }
.auth::after { content: ""; position: absolute; width: 520px; height: 520px; border-radius: 50%; bottom: -300px; left: -200px; background: radial-gradient(closest-side, var(--accent-soft), transparent); pointer-events: none; }
.auth-card { position: relative; z-index: 1; width: 100%; max-width: 460px; padding: 28px 22px; }
@media (min-width: 480px) { .auth-card { padding: 36px 36px 32px; } }
.auth-card.wide { max-width: 560px; }
.auth-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 26px; }
.auth-title { font-size: 24px; font-weight: 700; letter-spacing: -.025em; }
.auth-sub { color: var(--muted-foreground); margin-top: 8px; font-size: 14.5px; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 22px 0 24px; }
.step { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.step-bar { height: 4px; border-radius: 4px; background: var(--border); }
.step-label { font-size: 12px; color: var(--faint); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 4px; }
.step.done .step-bar { background: var(--accent); }
.step.done .step-label { color: var(--muted-foreground); }
.step.current .step-bar { background: linear-gradient(90deg, var(--accent) 50%, var(--accent-muted) 50%); }
.step.current .step-label { color: var(--accent-text); font-weight: 600; }
.step-label .ic { width: 13px; height: 13px; }
.auth form { display: flex; flex-direction: column; gap: 16px; }
.phrase-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
@media (min-width: 420px) { .phrase-grid { grid-template-columns: repeat(3, 1fr); } }
.phrase-cell { position: relative; }
.phrase-cell span { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font-size: 11.5px; color: var(--faint); font-variant-numeric: tabular-nums; pointer-events: none; width: 16px; text-align: right; }
.phrase-cell .input { padding-left: 32px; min-height: 42px; font-size: 14px; }
.otp { font-size: 26px !important; letter-spacing: .5em; text-align: center; font-variant-numeric: tabular-nums; min-height: 60px !important; padding-left: calc(14px + .5em) !important; font-weight: 600; }
.auth-foot { margin-top: 22px; font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.auth-foot .ic { color: var(--success); }

/* ---------- Order search & view ---------- */
.order-search { position: relative; overflow: hidden; }
.order-search::after { content: ""; position: absolute; width: 380px; height: 380px; right: -140px; top: -220px; border-radius: 50%; background: radial-gradient(closest-side, var(--accent-glow), transparent); pointer-events: none; }
.order-search-in { position: relative; z-index: 1; padding: 22px 20px; display: flex; flex-direction: column; gap: 16px; }
@media (min-width: 768px) { .order-search-in { padding: 28px 28px; } }
.search-big { display: flex; gap: 10px; align-items: stretch; }
.search-big .input-wrap { flex: 1; }
.search-big .input { min-height: 54px; font-size: 18px; font-weight: 600; letter-spacing: .01em; padding-left: 46px; border-radius: 14px; font-variant-numeric: tabular-nums; }
.search-big .input-wrap > .hash { position: absolute; left: 16px; font-size: 20px; font-weight: 700; color: var(--accent-text); pointer-events: none; }
.search-big .btn { min-height: 54px; border-radius: 14px; padding: 0 22px; }
@media (max-width: 479px) { .search-big .btn-label { display: none; } .search-big .btn { width: 54px; padding: 0; } }
.recent { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: 13px; color: var(--muted); }
.recent .tag { cursor: pointer; border: 1px solid var(--border); background: var(--card); padding: 4px 10px; border-radius: 999px; }
.recent .tag:hover { border-color: var(--accent); color: var(--accent-text); }

.order-hero { padding: 20px; display: grid; gap: 18px; }
@media (min-width: 768px) { .order-hero { padding: 24px 28px; grid-template-columns: 1fr auto; align-items: center; } }
.order-no { font-size: 26px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
@media (min-width: 768px) { .order-no { font-size: 32px; } }
.order-meta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 8px; font-size: 13.5px; color: var(--muted-foreground); }
.order-sum { text-align: left; }
@media (min-width: 768px) { .order-sum { text-align: right; } }
.order-sum-v { font-size: 28px; font-weight: 800; letter-spacing: -.03em; color: var(--foreground); font-variant-numeric: tabular-nums; }
.order-sum-k { font-size: 12.5px; color: var(--muted); }
.order-sum-old { font-size: 13px; color: var(--faint); text-decoration: line-through; }
.order-grid { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1100px) { .order-grid { grid-template-columns: minmax(0, 1.6fr) minmax(320px, 1fr); align-items: start; } .order-side { position: sticky; top: calc(var(--header-h) + 20px); } }
.order-main, .order-side { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.actions-bar { display: flex; gap: 10px; flex-wrap: wrap; }
.actions-bar .btn { flex: 1 1 160px; }
.confirm-panel { border-radius: var(--radius); border: 1px solid var(--border); padding: 16px; display: flex; flex-direction: column; gap: 14px; animation: popIn .18s var(--ease); }
.confirm-panel.approve { background: var(--success-bg); border-color: var(--success-border); }
.confirm-panel.reject { background: var(--danger-bg); border-color: var(--danger-border); }
.confirm-panel.neutral { background: var(--accent-soft); border-color: var(--accent-border); }
.confirm-title { font-weight: 700; font-size: 15px; }
.confirm-text { font-size: 13.5px; color: var(--muted-foreground); }
.reasons { display: grid; gap: 6px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .reasons { grid-template-columns: 1fr 1fr; } }
.reason { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--card); cursor: pointer; font-size: 13.5px; }
.reason:hover { border-color: var(--border-hover); }
.reason input { accent-color: var(--danger); width: 16px; height: 16px; flex: none; }
.reason:has(input:checked) { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-bg); }

.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.tl-item { position: relative; display: flex; gap: 14px; padding-bottom: 18px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before { content: ""; position: absolute; left: 15px; top: 34px; bottom: 2px; width: 2px; background: var(--border); }
.tl-item:last-child::before { display: none; }
.tl-dot { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--neutral-bg); color: var(--muted-foreground); border: 3px solid var(--card); box-shadow: 0 0 0 1px var(--border); }
.tl-dot .ic { width: 15px; height: 15px; }
.tl-dot.accent { background: var(--accent-muted); color: var(--accent-text); }
.tl-dot.success { background: var(--success-bg); color: var(--success); }
.tl-dot.danger { background: var(--danger-bg); color: var(--danger); }
.tl-dot.warning { background: var(--warning-bg); color: var(--warning); }
.tl-body { min-width: 0; padding-top: 4px; }
.tl-title { font-weight: 600; font-size: 14px; }
.tl-meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }
.tl-note { font-size: 13px; color: var(--muted-foreground); margin-top: 6px; background: var(--input); border-radius: 8px; padding: 8px 10px; overflow-wrap: anywhere; }

.group-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); color: inherit; min-width: 0; }
a.group-item:hover { border-color: var(--accent-border); color: inherit; }
.group-item.current { border-color: var(--accent); background: var(--accent-soft); }
.group-idx { width: 28px; height: 28px; border-radius: 8px; background: var(--input); display: grid; place-items: center; font-size: 12.5px; font-weight: 700; color: var(--muted-foreground); flex: none; }

/* ---------- Chats ---------- */
.chat-app { display: grid; grid-template-columns: 1fr; height: calc(100dvh - var(--header-h) - 20px - 40px); min-height: 460px; overflow: hidden; }
@media (min-width: 768px) { .chat-app { height: calc(100dvh - var(--header-h) - 28px - 20px); } }
@media (min-width: 1024px) { .chat-app { grid-template-columns: 340px minmax(0, 1fr); } }
@media (min-width: 1280px) { .chat-app { grid-template-columns: 380px minmax(0, 1fr); height: calc(100dvh - var(--header-h) - 32px - 20px); } }
.chat-list { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--border); background: var(--card); }
.chat-list-head { padding: 16px; display: flex; flex-direction: column; gap: 12px; border-bottom: 1px solid var(--border); }
.chat-list-head .input { min-height: 40px; background: var(--input); border-color: transparent; }
.chat-list-head .input:focus { background: var(--card); }
.chat-items { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 6px; }
.chat-item { width: 100%; display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 12px; border: 0; background: transparent; text-align: left; color: inherit; min-width: 0; }
.chat-item:hover { background: var(--input); }
.chat-item[aria-current="true"] { background: var(--accent-muted); }
.chat-item-main { flex: 1; min-width: 0; }
.chat-item-top { display: flex; gap: 8px; align-items: baseline; }
.chat-item-name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.chat-item-time { font-size: 12px; color: var(--faint); flex: none; font-variant-numeric: tabular-nums; }
.chat-item-sub { display: flex; gap: 8px; align-items: center; margin-top: 3px; }
.chat-item-last { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.chat-item.unread .chat-item-name { font-weight: 700; }
.chat-item.unread .chat-item-last { color: var(--foreground); font-weight: 500; }
.chat-item-meta { font-size: 12px; color: var(--muted); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.thread { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--thread-bg); position: relative; }
.thread-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--thread-head-bg); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); min-height: 64px; }
.thread-title { font-weight: 700; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-sub { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-actions { margin-left: auto; display: flex; gap: 6px; flex: none; }
.thread-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 20px 16px; display: flex; flex-direction: column; gap: 6px; }
@media (min-width: 768px) { .thread-scroll { padding: 24px 28px; } }
.day-sep { align-self: center; font-size: 12px; font-weight: 600; color: var(--muted); background: var(--card); border: 1px solid var(--border); border-radius: 999px; padding: 3px 12px; margin: 12px 0 8px; }
.msg { max-width: min(78%, 560px); display: flex; flex-direction: column; gap: 4px; align-self: flex-start; }
.msg.me { align-self: flex-end; align-items: flex-end; }
.msg-bubble { padding: 10px 14px; border-radius: 18px 18px 18px 6px; background: var(--card); border: 1px solid var(--border); font-size: 14.5px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; box-shadow: var(--shadow); }
.msg.me .msg-bubble { background: var(--accent); border-color: var(--accent); color: var(--on-accent); border-radius: 18px 18px 6px 18px; box-shadow: var(--shadow-accent); }
.msg-time { font-size: 11.5px; color: var(--faint); padding: 0 6px; font-variant-numeric: tabular-nums; }
.msg.pending { opacity: .6; }
.msg + .msg.me, .msg.me + .msg:not(.me) { margin-top: 8px; }
.new-pill { position: absolute; left: 50%; transform: translateX(-50%); bottom: 96px; z-index: 3; box-shadow: var(--shadow-pop); }
.composer { border-top: 1px solid var(--border); background: var(--card); padding: 12px 12px calc(12px + var(--safe-b)); }
.composer-in { display: flex; gap: 10px; align-items: flex-end; background: var(--input); border: 1px solid transparent; border-radius: 16px; padding: 6px 6px 6px 14px; transition: border-color .15s, box-shadow .15s, background .15s; }
.composer-in:focus-within { background: var(--card); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-muted); }
.composer textarea { flex: 1; border: 0; background: transparent; resize: none; min-height: 24px; max-height: 180px; padding: 8px 0; font-size: 15px; line-height: 1.45; outline: none; }
.composer .btn { border-radius: 12px; flex: none; }
.composer-hint { font-size: 11.5px; color: var(--faint); padding: 6px 4px 0; display: flex; justify-content: space-between; gap: 8px; }
.composer-closed { padding: 16px; text-align: center; font-size: 13.5px; color: var(--muted); border-top: 1px solid var(--border); background: var(--card); padding-bottom: calc(16px + var(--safe-b)); }
.thread-empty { flex: 1; display: grid; place-items: center; }

@media (max-width: 1023px) {
  .route-chats .main { padding: 0; }
  .chat-app { height: calc(100dvh - var(--header-h)); border-radius: 0; border: 0; box-shadow: none; min-height: 0; }
  .chat-list { border-right: 0; }
  .chat-app .thread { display: none; }
  .chat-app.thread-open .thread { display: flex; position: fixed; inset: 0; z-index: 70; height: 100dvh; }
  .chat-app.thread-open .chat-list { visibility: hidden; }
  .thread-head { padding-top: calc(10px + env(safe-area-inset-top, 0px)); }
}

/* ---------- Reviews ---------- */
.review { padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.stars { color: var(--star); letter-spacing: 1px; font-size: 15px; white-space: nowrap; }
.stars .off { color: var(--star-off); }
.review-text { font-size: 14.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.review-reply { border-left: 3px solid var(--accent); background: var(--accent-soft); padding: 10px 14px; border-radius: 0 10px 10px 0; font-size: 13.5px; overflow-wrap: anywhere; white-space: pre-wrap; }

/* ---------- Bars (dashboard) ---------- */
.bars { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 130px 1fr 44px; gap: 12px; align-items: center; font-size: 13.5px; }
@media (max-width: 479px) { .bar-row { grid-template-columns: 104px 1fr 36px; } }
.bar { height: 10px; border-radius: 999px; background: var(--input); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 999px; background: var(--accent); min-width: 2px; }
.bar.pending > span { background: var(--bar-pending); } .bar.processing > span { background: var(--bar-processing); }
.bar.approved > span { background: var(--bar-approved); } .bar.rejected > span { background: var(--bar-rejected); } .bar.expired > span { background: var(--bar-expired); }

.grid-2 { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1024px) { .grid-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.grid-side { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1100px) { .grid-side { grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); align-items: start; } }

.json { font-family: var(--mono); font-size: 12px; background: var(--input); border-radius: 8px; padding: 10px 12px; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--muted-foreground); margin-top: 8px; max-height: 260px; overflow: auto; }
.code-chip { font-family: var(--mono); font-size: 13px; font-weight: 600; background: var(--input); border-radius: 8px; padding: 3px 8px; letter-spacing: .02em; white-space: nowrap; }
.copy { background: none; border: 0; padding: 4px; border-radius: 6px; color: var(--faint); display: inline-grid; place-items: center; }
.copy:hover { color: var(--accent-text); background: var(--accent-muted); }
@media (max-width: 479px) { .hide-sm { display: none; } }
.kv-v .lg { font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.attach-in-bubble { margin-top: 6px; }
.msg.me .attach { border-color: rgba(255,255,255,.4); }
.burger-back { display: inline-flex; flex: none; }
@media (min-width: 1024px) { .burger-back { display: none; } }
.op-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 768px) { .op-grid { grid-template-columns: 1fr 1fr; } }
.balance-hero { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.balance-v { font-size: 34px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }

.toolbar > *, .card-head > *, .page-head > * { min-width: 0; max-width: 100%; }
div:has(> .seg) { min-width: 0; max-width: 100%; }
@media (max-width: 639px) {
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stats .stat { padding: 14px; gap: 8px; }
  .stats .stat-top { flex-direction: column; align-items: flex-start; gap: 8px; }
  .stats .stat-top .tile { width: 32px; height: 32px; border-radius: 9px; }
  .stats .stat-value { font-size: 19px; }
  .stats .stat-note { font-size: 12px; }
}
.stat-value { white-space: nowrap; overflow-wrap: normal; }
@media (max-width: 639px) { .stats .stat-value { font-size: clamp(15px, 4.6vw, 19px); } }
.stat { min-width: 0; } .stat-value { overflow: hidden; text-overflow: ellipsis; }
.brand-name, .pill { white-space: nowrap; }
@media (max-width: 419px) { .auth-top .pill { display: none; } }
input[list]::-webkit-calendar-picker-indicator { display: none !important; }

/* =====================================================================
   Единый индикатор загрузки — тот же знак, что на экране входа:
   фирменная плитка «M» в вращающемся кольце.
   ===================================================================== */
.loader { display: grid; place-items: center; align-content: center; gap: 14px; padding: 48px 20px; color: var(--muted); font-size: 13.5px; text-align: center; animation: fadeIn .2s var(--ease) both; }
.loader-sm { padding: 22px 12px; gap: 10px; font-size: 13px; }
.loader-mark { position: relative; width: 40px; height: 40px; flex: none; }
.loader-mark::before { content: ""; position: absolute; inset: 0; border-radius: 11px; background: var(--accent) url(/favicon.svg) center/cover; box-shadow: var(--shadow-accent); animation: pulse 1.4s var(--ease) infinite; }
.loader-mark::after { content: ""; position: absolute; inset: -7px; border-radius: 50%; border: 2px solid var(--accent-muted); border-top-color: var(--accent); border-right-color: var(--accent); animation: spin .9s linear infinite; }
.loader-sm .loader-mark { width: 28px; height: 28px; }
.loader-sm .loader-mark::before { border-radius: 8px; }
.loader-sm .loader-mark::after { inset: -5px; }
.loader-text { max-width: 36ch; }
.boot .loader-mark { width: 48px; height: 48px; }
.boot .loader-mark::after { inset: -9px; }
/* строчный вариант: кольцо + текст в одну строку (для кнопок, строк таблиц) */
.spin-inline { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.spin-inline::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--accent-muted); border-top-color: var(--accent); animation: spin .8s linear infinite; flex: none; }
.spinner { border-color: var(--accent-muted); border-top-color: var(--accent); }

/* Обновление блока без перекрытия страницы: блок приглушается,
   в углу — маленький индикатор. Клики внутри блокируются. */
.is-busy { position: relative; }
.is-busy > * { transition: opacity .2s var(--ease); }
.is-busy::after { content: ""; position: absolute; inset: 0; z-index: 4; background: var(--block-veil); border-radius: inherit; animation: fadeIn .2s var(--ease) both; cursor: progress; }
.is-busy::before { content: ""; position: absolute; z-index: 5; top: 14px; right: 14px; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--accent-muted); border-top-color: var(--accent); animation: spin .8s linear infinite; }

/* Тонкая полоса сетевой активности под шапкой — видна при любом запросе,
   ничего не блокирует. */
.net-bar { position: fixed; z-index: 140; top: 0; left: 0; right: 0; height: 2px; pointer-events: none; opacity: 0; transition: opacity .25s var(--ease); overflow: hidden; }
.net-bar.on { opacity: 1; }
.net-bar::before { content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: -40%; background: linear-gradient(90deg, transparent, var(--accent), transparent); animation: netbar 1.1s var(--ease) infinite; }
@keyframes netbar { to { left: 100%; } }

/* Плавное появление содержимого раздела */
.route-enter { animation: routeIn .22s var(--ease) backwards; }
/* backwards, а не both: анимация transform, «застывшая» после окончания, делает
   блок контейнером для position: fixed — полноэкранный чат на телефоне съезжал под шапку. */
@keyframes routeIn { from { opacity: 0; transform: translateY(6px); } }

/* ---------- Выпадающее меню ---------- */
.menu { position: fixed; z-index: 110; min-width: 220px; max-width: min(320px, calc(100vw - 24px)); padding: 6px; background: var(--card); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-pop); animation: popIn .14s var(--ease); }
.menu-label { font-size: 12px; font-weight: 600; color: var(--faint); padding: 8px 10px 4px; }
.menu-item { width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 0; background: none; border-radius: 9px; color: var(--foreground); font-size: 14px; font-weight: 500; text-align: left; }
.menu-item:hover, .menu-item:focus-visible { background: var(--input); outline: none; }
.menu-item .ic { color: var(--muted); }
.menu-item.danger { color: var(--danger); } .menu-item.danger .ic { color: var(--danger); }
.menu-item.success .ic { color: var(--success); }
.menu-item[aria-checked="true"] { color: var(--accent-text); font-weight: 600; }
.menu-item[aria-checked="true"] .ic { color: var(--accent-text); }
.menu-item .menu-check { margin-left: auto; opacity: 0; }
.menu-item[aria-checked="true"] .menu-check { opacity: 1; }
.menu-sep { height: 1px; background: var(--border); margin: 6px 4px; }
.menu-note { font-size: 12.5px; color: var(--muted); padding: 8px 10px; }
@media (max-width: 639px) {
  .menu.as-sheet { left: 0 !important; right: 0; top: auto !important; bottom: 0; max-width: none; border-radius: 20px 20px 0 0; padding: 10px 10px calc(12px + var(--safe-b)); animation: sheetIn .22s var(--ease); }
  .menu.as-sheet .menu-item { padding: 13px 12px; font-size: 15px; }
}
.menu-scrim { position: fixed; inset: 0; z-index: 109; background: transparent; }
@media (max-width: 639px) { .menu-scrim.for-sheet { background: var(--scrim); animation: fadeIn .15s var(--ease); } }

/* ---------- Переключатель темы: иконка показывает, куда переключит ---------- */
.theme-btn .ic-to-light { display: none; }
[data-theme="dark"] .theme-btn .ic-to-light { display: block; }
[data-theme="dark"] .theme-btn .ic-to-dark { display: none; }
.auth-theme { position: fixed; z-index: 3; top: calc(14px + env(safe-area-inset-top, 0px)); right: 14px; }

/* ---------- Заказы: список последних ---------- */
.orders-list-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 18px 20px; border-bottom: 1px solid var(--border); }
@media (min-width: 768px) { .orders-list-head { padding: 18px 24px; } }
.olist { display: flex; flex-direction: column; }
.olist-row { display: grid; align-items: center; gap: 14px; padding: 12px 20px; border-bottom: 1px solid var(--border); grid-template-columns: 132px minmax(0, 1.3fr) minmax(0, 1.2fr) 118px 150px 40px; transition: background .12s var(--ease); cursor: pointer; min-width: 0; }
@media (min-width: 768px) { .olist-row { padding: 12px 24px; } }
.olist-row:last-child { border-bottom: 0; }
.olist-row:hover { background: var(--accent-soft); }
.olist-row.current { background: var(--accent-muted); box-shadow: inset 3px 0 0 var(--accent); }
.olist-row.flash { animation: rowFlash 1.2s var(--ease); }
@keyframes rowFlash { 0% { background: var(--success-bg); } 100% { background: transparent; } }
.olist-head { cursor: default; background: var(--surface-2); font-size: 12.5px; font-weight: 600; color: var(--muted); padding-top: 11px; padding-bottom: 11px; }
.olist-head:hover { background: var(--surface-2); }
.olist-no { font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.01em; font-size: 14.5px; }
.olist-date { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; margin-top: 1px; white-space: nowrap; }
.olist-main { min-width: 0; }
.olist-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.olist-sub { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
.olist-sum { text-align: right; }
.olist-sum .amount { font-size: 14.5px; }
.olist-pay { font-size: 12px; color: var(--muted); margin-top: 1px; white-space: nowrap; }
.olist-act { display: flex; justify-content: flex-end; }
.olist-flags { display: inline-flex; gap: 4px; vertical-align: middle; margin-left: 6px; }
.flag { width: 18px; height: 18px; border-radius: 6px; display: inline-grid; place-items: center; background: var(--input); color: var(--muted); }
.flag .ic { width: 12px; height: 12px; }
.flag.warn { background: var(--warning-bg); color: var(--warning); }
.flag.accent { background: var(--accent-muted); color: var(--accent-text); }
@media (max-width: 1099px) {
  .olist-head { display: none; }
  .olist-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "no sum" "main main" "status act"; gap: 6px 12px; padding: 14px 16px; }
  .olist-row > .c-no { grid-area: no; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
  .olist-row > .c-main { grid-area: main; }
  .olist-row > .c-client { display: none; }
  .olist-row > .c-sum { grid-area: sum; }
  .olist-row > .c-status { grid-area: status; align-self: center; }
  .olist-row > .c-act { grid-area: act; }
  .olist-date { margin-top: 0; }
  .olist-row .c-main .olist-client-m { display: block; }
}
.olist-client-m { display: none; font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.olist-foot { padding: 12px 20px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--muted); display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.list-search { flex: 1 1 240px; max-width: 360px; }
.list-search .input { min-height: 40px; background: var(--input); border-color: transparent; }
.list-search .input:focus { background: var(--card); }
@media (max-width: 639px) { .list-search { max-width: none; flex: 1 1 auto; } .orders-list-head > .row { flex-wrap: nowrap; } }

/* Модалка действия с заказом: карточка-резюме заказа */
.op-summary { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.op-summary .grow { min-width: 0; }
.op-summary-title { font-weight: 700; }
.op-summary-sub { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.op-flow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.op-choices { display: grid; gap: 8px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .op-choices.two { grid-template-columns: 1fr 1fr; } }
.op-choice { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); cursor: pointer; text-align: left; color: inherit; width: 100%; transition: border-color .12s var(--ease), box-shadow .12s var(--ease), background .12s var(--ease); }
.op-choice:hover { border-color: var(--border-hover); }
.op-choice[aria-checked="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-muted); background: var(--accent-soft); }
.op-choice .tile { width: 34px; height: 34px; border-radius: 9px; }
.op-choice-title { font-weight: 600; font-size: 14px; }
.op-choice-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

/* Выбор товара из каталога */
.picker { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--card); }
.picker-search { padding: 8px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.picker-search .input { min-height: 38px; }
.picker-list { max-height: 264px; overflow-y: auto; overscroll-behavior: contain; }
.picker-group { font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--faint); padding: 10px 14px 4px; position: sticky; top: 0; background: var(--card); z-index: 1; }
.picker-item { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 0; background: none; color: inherit; text-align: left; font-size: 14px; }
.picker-item:hover { background: var(--input); }
.picker-item[aria-selected="true"] { background: var(--accent-muted); color: var(--accent-text); font-weight: 600; }
.picker-item .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-item .amount { color: var(--muted-foreground); font-weight: 500; }
.picker-item[aria-selected="true"] .amount { color: var(--accent-text); }
.picker-empty { padding: 18px 14px; color: var(--muted); font-size: 13.5px; text-align: center; }
.picker-chosen { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); border: 1px solid var(--accent-border); font-size: 13.5px; }

#order-result:empty, .recent:empty { display: none; }
.callout.has-action { flex-wrap: wrap; align-items: center; }
.callout.has-action .grow { flex: 1 1 220px; }
.callout.has-action .btn { margin-left: auto; }
@media (max-width: 479px) { .picker-search { flex-wrap: wrap !important; } .picker-search .select { max-width: none !important; width: 100% !important; } }
.stat-value.wrap { white-space: normal; overflow: visible; }

/* ---------- Компактная карточка заказа ---------- */
.oc { overflow: hidden; }
.oc-head { display: flex; align-items: flex-start; gap: 16px; padding: 18px 20px 14px; }
@media (min-width: 768px) { .oc-head { padding: 22px 24px 16px; } }
.oc .order-no { font-size: 26px; }
.oc .order-meta { margin-top: 6px; gap: 8px; }
.oc .order-sum { text-align: right; flex: none; }
.oc .order-sum-v { font-size: 24px; }
.oc-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); border-top: 1px solid var(--border); }
.oc-fact { padding: 12px 20px; min-width: 0; box-shadow: 1px 0 0 var(--border); }
@media (min-width: 768px) { .oc-fact { padding: 12px 24px; } }
.oc-k { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.oc-v { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.oc-sub { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oc-note { display: flex; gap: 8px; align-items: flex-start; padding: 10px 20px; border-top: 1px solid var(--border); background: var(--surface-2); font-size: 13.5px; color: var(--muted-foreground); }
.oc-note .ic { margin-top: 2px; color: var(--faint); }
@media (min-width: 768px) { .oc-note { padding: 10px 24px; } }
.oc-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--border); background: var(--surface-2); }
@media (min-width: 768px) { .oc-actions { padding: 12px 20px; } }
.oc-spacer { flex: 1 1 auto; }
.oc-final { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); padding: 0 6px; }
.oc-more .ic { transition: transform .15s var(--ease); }
.oc-more[aria-expanded="true"] .ic { transform: rotate(180deg); }
@media (max-width: 639px) {
  .oc-head { flex-direction: column; gap: 8px; }
  .oc .order-sum { text-align: left; }
  .oc-actions .btn:not(.btn-ghost) { flex: 1 1 calc(50% - 4px); }
  .oc-spacer { display: none; }
  .oc-actions .btn-ghost { flex: 1 1 calc(50% - 4px); }
}
.no-transitions, .no-transitions *, .no-transitions *::before, .no-transitions *::after { transition: none !important; }
