/* VaySklad — стили для PHP-версии */
:root {
    --primary: #2563EB;
    --primary-foreground: #fff;
    --success: #22C55E;
    --danger: #EF4444;
    --background: #F8FAFC;
    --foreground: #0F172A;
    --card: #fff;
    --border: #E2E8F0;
    --muted: #F1F5F9;
    --muted-foreground: #64748B;
    --radius: 16px;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Inter', sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--foreground);
    background: var(--background);
}

/* Auth */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    background:
        radial-gradient(1200px 500px at 12% 8%, rgba(59,130,246,.16), transparent 60%),
        radial-gradient(1000px 420px at 88% 85%, rgba(56,189,248,.14), transparent 62%),
        linear-gradient(180deg, #f7faff 0%, #eef4ff 100%);
}
.auth-shell {
    width: 100%;
    max-width: 760px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}
.auth-hero {
    text-align: center;
}
.auth-card {
    width: 100%;
    max-width: 520px;
    padding: 28px 30px 24px;
    text-align: left;
    border-radius: 22px;
    border: 1px solid rgba(226, 232, 240, 0.95);
    box-shadow:
        0 18px 48px rgba(37,99,235,.12),
        0 2px 12px rgba(15,23,42,.08);
}
.auth-title {
    margin: 0 0 8px;
    font-size: 3rem;
    font-weight: 800;
    color: #0f2a57;
    display: inline-flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: 12px;
}
.auth-title .auth-logo {
    display: inline-flex;
    align-items: center;
    line-height: 0;
    flex-shrink: 0;
    margin-top: -2mm;
    margin-left: 4mm;
}
.auth-title .auth-title-text {
    white-space: nowrap;
}
.auth-title .auth-logo svg {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    display: block;
}
.auth-subtitle { margin: 0 0 24px; color: var(--muted-foreground); font-size: 14px; }
.auth-card-title {
    margin: 0;
    text-align: center;
    font-size: 2rem;
    color: #0f2a57;
}
.auth-card-subtitle {
    margin: 6px 0 22px;
    text-align: center;
    color: #7f90b0;
}
.auth-form label { display: block; text-align: left; margin-bottom: 6px; font-weight: 600; font-size: 14px; color:#334155; }
.auth-input-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    border: 1px solid #dbe5f3;
    border-radius: 12px;
    padding: 0 12px;
    background: #fff;
}
.auth-input-icon {
    color: #94a3b8;
    font-size: 15px;
}
.auth-input-wrap input {
    width: 100%;
    margin: 0;
    padding: 12px 2px;
    border: 0;
    border-radius: 0;
    font-size: 15px;
    background: transparent;
}
.auth-input-wrap input:focus { outline: none; }
.auth-form > input[type='text'],
.auth-form > input[type='email'],
.auth-form > input[type='password'],
.auth-form > input[type='number'] {
    width: 100%;
    margin: 0 0 14px;
    padding: 12px 14px;
    border: 1px solid #dbe5f3;
    border-radius: 12px;
    font-size: 15px;
    background: #fff;
}
.auth-form > input[type='text']:focus,
.auth-form > input[type='email']:focus,
.auth-form > input[type='password']:focus,
.auth-form > input[type='number']:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,.14);
}
.auth-input-wrap:focus-within {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,.14);
}
.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 2px 0 14px;
    gap: 10px;
}
.auth-remember {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #64748b;
    font-size: 14px;
}
.auth-remember input[type='checkbox'] {
    width: 16px;
    height: 16px;
    margin: 0;
    flex: 0 0 auto;
}
.auth-link {
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
}
.auth-submit {
    min-height: 46px;
    border-radius: 12px;
    font-size: 16px;
}
.auth-sep {
    position: relative;
    margin: 18px 0 14px;
    text-align: center;
    color: #94a3b8;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
}
.auth-sep::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    border-top: 1px solid #e2e8f0;
}
.auth-sep span {
    position: relative;
    background: #fff;
    padding: 0 10px;
}
.auth-download-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    margin: 0;
    padding: 14px 16px;
    border-radius: 14px;
    text-decoration: none;
    color: #0f172a;
    border: 1.5px solid #93c5fd;
    background: linear-gradient(135deg, #f8fbff 0%, #eff6ff 55%, #e8f2ff 100%);
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.1);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.auth-download-btn:hover {
    transform: translateY(-1px);
    border-color: #3b82f6;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.16);
}
.auth-download-btn:active {
    transform: translateY(0);
}
.auth-download-btn__icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}
.auth-download-btn__body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    text-align: left;
}
.auth-download-btn__title {
    font-size: 15px;
    font-weight: 700;
    color: #1e3a8a;
    line-height: 1.25;
}
.auth-download-btn__hint {
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
    line-height: 1.3;
}
.auth-download-btn__chevron {
    flex-shrink: 0;
    font-size: 26px;
    font-weight: 300;
    line-height: 1;
    color: #3b82f6;
    opacity: 0.85;
}
.auth-download-btn--mobile {
    margin-top: 10px;
    border-color: #c7d2fe;
    background: linear-gradient(135deg, #f8faff 0%, #eef2ff 55%, #e0e7ff 100%);
}
.auth-download-btn--mobile .auth-download-btn__icon {
    background: linear-gradient(135deg, #6366f1 0%, #4338ca 100%);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
}
.auth-download-btn--mobile .auth-download-btn__title {
    color: #312e81;
}
.auth-download-btn--crm {
    border-color: #c7d2fe;
}
.auth-download-btn--kassa {
    border-color: #86efac;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 55%, #d1fae5 100%);
    box-shadow: 0 4px 16px rgba(22, 163, 74, 0.12);
}
.auth-download-btn--kassa .auth-download-btn__icon {
    background: linear-gradient(135deg, #22c55e 0%, #15803d 100%);
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.35);
}
.auth-download-btn--kassa .auth-download-btn__title {
    color: #14532d;
}
.auth-download-btn--kassa .auth-download-btn__chevron {
    color: #16a34a;
}
.auth-app-mobile-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 4px;
}
@media (max-width: 640px) {
    .auth-app-mobile-group {
        gap: 14px;
        margin-top: 8px;
    }
    .auth-download-btn--mobile {
        margin-top: 0;
        padding: 18px 18px;
        min-height: 80px;
        border-radius: 18px;
        border-width: 2px;
        gap: 16px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }
    .auth-download-btn--mobile .auth-download-btn__icon {
        width: 56px;
        height: 56px;
        border-radius: 16px;
    }
    .auth-download-btn--mobile .auth-download-btn__title {
        font-size: 18px;
        font-weight: 800;
        letter-spacing: -0.02em;
    }
    .auth-download-btn--mobile .auth-download-btn__hint {
        font-size: 13px;
        margin-top: 2px;
    }
    .auth-download-btn--mobile .auth-download-btn__chevron {
        font-size: 34px;
        padding-left: 4px;
    }
    .auth-download-btn--mobile:active {
        transform: scale(0.98);
        box-shadow: 0 2px 10px rgba(37, 99, 235, 0.1);
    }
    .auth-download-btn--kassa:active {
        box-shadow: 0 2px 10px rgba(22, 163, 74, 0.12);
    }
    .auth-submit {
        min-height: 52px;
        font-size: 16px;
        font-weight: 700;
    }
}
.auth-footer { margin: 16px 0 0; text-align:center; font-size: 14px; color: var(--muted-foreground); }
.auth-footer-small { margin-top: 6px; }
.auth-footer a { color: var(--primary); font-weight: 500; }
.auth-offer-notice {
    margin-top: 22px;
    margin-bottom: 0;
    font-size: 12px;
    line-height: 1.55;
    color: #64748b;
    max-width: 22rem;
    margin-left: auto;
    margin-right: auto;
}
.auth-offer-notice a { font-weight: 600; text-underline-offset: 2px; }

.auth-shell--legal { padding: 24px 16px 40px; }
.offer-doc { max-width: 42rem; margin: 0 auto; text-align: left; padding: 22px 22px 28px; }
.offer-doc__back { margin: 0 0 12px; font-size: 14px; }
.offer-doc__title { margin: 0 0 6px; font-size: 1.35rem; font-weight: 700; color: var(--foreground); }
.offer-doc__meta { margin: 0 0 20px; font-size: 14px; }
.offer-doc__section { margin-bottom: 18px; }
.offer-doc__section h2 {
    margin: 0 0 8px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--foreground);
}
.offer-doc__section p { margin: 0 0 10px; font-size: 14px; line-height: 1.6; color: var(--muted-foreground); }
.offer-doc__dl { margin: 0; font-size: 14px; line-height: 1.55; }
.offer-doc__dl dt { font-weight: 600; color: var(--foreground); margin: 12px 0 4px; }
.offer-doc__dl dt:first-child { margin-top: 0; }
.offer-doc__dl dd { margin: 0; color: var(--muted-foreground); }

.auth-legal-links {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    text-align: center;
    line-height: 1.6;
    color: var(--muted-foreground);
}
.auth-legal-links a { font-weight: 500; }

.offer-doc__legal-nav {
    margin-top: 22px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    font-size: 13px;
    text-align: center;
    line-height: 1.65;
    color: var(--muted-foreground);
}
.offer-doc__legal-nav a { font-weight: 500; color: var(--primary); }

/* ——— Страница реквизитов (современный layout) ——— */
.req-page {
    margin: 0;
    min-height: 100vh;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: #f1f5f9;
    color: #0f172a;
}
.req-page__bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(ellipse 80% 50% at 50% -10%, rgba(59, 130, 246, 0.18), transparent),
        radial-gradient(ellipse 60% 40% at 100% 0%, rgba(124, 58, 237, 0.1), transparent),
        linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    pointer-events: none;
}
.req-header {
    position: relative;
    z-index: 1;
    padding: 28px 20px 32px;
    text-align: center;
}
.req-header__inner { max-width: 720px; margin: 0 auto; }
.req-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 20px;
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 500;
    color: #475569;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 999px;
    backdrop-filter: blur(8px);
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.req-back:hover { color: #2563eb; background: #fff; border-color: #bfdbfe; }
.req-header__badge {
    display: inline-block;
    margin-bottom: 12px;
    padding: 5px 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #1d4ed8;
    background: #dbeafe;
    border-radius: 999px;
}
.req-header__title {
    margin: 0 0 10px;
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.15;
    color: #0f172a;
}
.req-header__lead {
    margin: 0;
    font-size: 15px;
    line-height: 1.5;
    color: #64748b;
}
.req-main {
    position: relative;
    z-index: 1;
    max-width: 960px;
    margin: 0 auto;
    padding: 0 20px 48px;
}
.req-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}
.req-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 20px 22px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 4px 16px rgba(15, 23, 42, 0.03);
}
.req-card--accent {
    border-color: #c7d2fe;
    background: linear-gradient(145deg, #fff 0%, #f5f3ff 100%);
}
.req-card--wide { grid-column: 1 / -1; }
.req-card__head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.req-card__icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    background: #f1f5f9;
    border-radius: 10px;
}
.req-card__icon--contact { background: #ede9fe; }
.req-card__title {
    margin: 0;
    flex: 1;
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
}
.req-copy-all { margin-left: auto; font-size: 13px; }
.req-contacts {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.req-contact-chip {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px 14px;
    text-decoration: none;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.req-card--accent .req-contact-chip { background: rgba(255, 255, 255, 0.85); }
.req-contact-chip:hover {
    border-color: #a5b4fc;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.12);
    transform: translateY(-1px);
}
.req-contact-chip__label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
}
.req-contact-chip__value {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    word-break: break-all;
}
.req-contact-chip:hover .req-contact-chip__value { color: #4f46e5; }
.req-kv-list { display: flex; flex-direction: column; gap: 0; }
.req-kv {
    display: grid;
    grid-template-columns: minmax(120px, 34%) 1fr;
    gap: 8px 16px;
    padding: 11px 0;
    border-bottom: 1px solid #f1f5f9;
    align-items: start;
}
.req-kv:last-child { border-bottom: none; padding-bottom: 0; }
.req-kv__label {
    font-size: 12px;
    font-weight: 600;
    color: #94a3b8;
    line-height: 1.4;
}
.req-kv__value {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #1e293b;
    line-height: 1.45;
    word-break: break-word;
}
.req-kv__value a { color: #2563eb; text-decoration: none; font-weight: 600; }
.req-kv__value a:hover { text-decoration: underline; }
.req-copy {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin-top: -2px;
    padding: 0;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    color: #64748b;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.req-copy:hover { background: #eff6ff; color: #2563eb; border-color: #bfdbfe; }
.req-info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 24px;
}
.req-info {
    padding: 18px 20px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.req-info--pay { border-color: #bbf7d0; background: linear-gradient(180deg, #fff 0%, #f0fdf4 100%); }
.req-info--refund { border-color: #fed7aa; background: linear-gradient(180deg, #fff 0%, #fff7ed 100%); }
.req-info__title {
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
}
.req-info p {
    margin: 0;
    font-size: 13px;
    line-height: 1.55;
    color: #64748b;
}
.req-info a { color: #2563eb; font-weight: 600; text-decoration: none; }
.req-info a:hover { text-decoration: underline; }
.req-legal {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 6px;
    padding: 20px 16px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    backdrop-filter: blur(6px);
}
.req-legal a {
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 500;
    color: #475569;
    text-decoration: none;
    border-radius: 999px;
    transition: background 0.15s, color 0.15s;
}
.req-legal a:hover { background: #f1f5f9; color: #2563eb; }
.req-legal a[aria-current="page"] {
    background: #2563eb;
    color: #fff;
}
.req-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    z-index: 100;
    transform: translateX(-50%) translateY(12px);
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: #0f172a;
    border-radius: 999px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.25);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
}
.req-toast.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
@media (max-width: 768px) {
    .req-grid { grid-template-columns: 1fr; }
    .req-card--wide { grid-column: auto; }
    .req-info-grid { grid-template-columns: 1fr; }
    .req-kv { grid-template-columns: 1fr; gap: 4px; }
    .req-card__head { align-items: flex-start; }
    .req-copy-all { width: 100%; margin-left: 0; margin-top: 4px; }
    .req-legal { flex-direction: column; align-items: stretch; }
    .req-legal a { text-align: center; }
}

.register-consent { margin: 14px 0 4px; display: flex; flex-direction: column; gap: 12px; }
.register-consent__item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-size: 13px;
    line-height: 1.45;
    color: var(--muted-foreground);
    cursor: pointer;
}
.register-consent__item input { margin-top: 3px; flex-shrink: 0; }
.register-consent__item a { color: var(--primary); font-weight: 500; }

.legal-pd-alert {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px 14px;
    margin: 0 0 16px;
    border-radius: var(--radius);
    border: 1px solid #fcd34d;
    background: #fffbeb;
    color: #92400e;
    font-size: 14px;
    line-height: 1.5;
    max-width: 920px;
}
.legal-pd-alert__icon {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #f59e0b;
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.legal-pd-alert__text strong { color: #78350f; }
.legal-pd-alert__text a { color: #b45309; font-weight: 600; text-underline-offset: 2px; }

.legal-pd-form-notice {
    margin: 0 0 10px;
    padding: 0;
    font-size: 12px;
    line-height: 1.5;
    color: #64748b;
    text-align: right;
    max-width: 100%;
}
.form-actions .legal-pd-form-notice {
    margin: 0 0 12px;
    text-align: right;
}

/* Layout — сайдбар в стиле soft UI / glass */
body:not(.auth-page) {
    background: #e8ecf3;
}
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 332px;
    z-index: 40;
    padding: 12px;
    display: flex;
    flex-direction: column;
    background: transparent;
    border: none;
    box-shadow: none;
    transition: transform 0.25s ease;
    box-sizing: border-box;
}
.sidebar-surface {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: rgba(255, 255, 255, 0.94);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.85);
    box-shadow:
        0 12px 40px rgba(15, 23, 42, 0.09),
        0 2px 10px rgba(15, 23, 42, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    overflow: hidden;
}
.sidebar-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding: 18px 16px 16px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.95);
    flex-shrink: 0;
}
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    min-width: 0;
}
.sidebar-brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: linear-gradient(145deg, #3b82f6, #2563eb);
    color: #fff;
    font-weight: 700;
    font-size: 1.2rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}
.sidebar-brand-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.sidebar-brand-title {
    font-weight: 700;
    font-size: 1.125rem;
    letter-spacing: -0.02em;
    color: var(--foreground);
    line-height: 1.2;
}
.sidebar-brand-tagline {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--muted-foreground);
    line-height: 1.3;
}
.sidebar-close {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin: 2px -4px 0 0;
    padding: 0;
    border: none;
    border-radius: 10px;
    background: rgba(241, 245, 249, 0.9);
    color: var(--muted-foreground);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    flex-shrink: 0;
}
.sidebar-close:hover {
    background: var(--muted);
    color: var(--foreground);
}
.sidebar-nav {
    flex: 1;
    padding: 12px 10px;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
.sidebar-nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px 11px 16px;
    margin: 0;
    border-radius: 12px;
    color: #475569;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.96875rem;
    line-height: 1.35;
    letter-spacing: -0.015em;
    transition: background 0.18s ease, color 0.18s ease;
}
.sidebar-nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 0;
    border-radius: 0 4px 4px 0;
    background: var(--primary);
    transition: height 0.18s ease;
    opacity: 0;
}
.sidebar-nav-link:hover {
    background: rgba(241, 245, 249, 0.85);
    color: var(--foreground);
}
.sidebar-nav-link.active {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
    font-weight: 700;
}
.sidebar-nav-link.active::before {
    height: 60%;
    opacity: 1;
}
.sidebar-nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    color: #2563eb;
    border-radius: 8px;
    background: rgba(37, 99, 235, 0.12);
    padding: 3px;
}
.sidebar-nav-icon-svg {
    display: block;
}
.sidebar-nav-link.active .sidebar-nav-icon,
.sidebar-nav-sales-toggle.active .sidebar-nav-icon {
    color: #1d4ed8;
    background: rgba(29, 78, 216, 0.18);
}
.sidebar-nav .sidebar-nav-link:nth-of-type(4n+1) .sidebar-nav-icon,
.sidebar-nav .sidebar-nav-group:nth-of-type(4n+1) .sidebar-nav-sales-toggle .sidebar-nav-icon {
    color: #2563eb;
    background: rgba(37, 99, 235, 0.12);
}
.sidebar-nav .sidebar-nav-link:nth-of-type(4n+2) .sidebar-nav-icon,
.sidebar-nav .sidebar-nav-group:nth-of-type(4n+2) .sidebar-nav-sales-toggle .sidebar-nav-icon {
    color: #0f766e;
    background: rgba(15, 118, 110, 0.12);
}
.sidebar-nav .sidebar-nav-link:nth-of-type(4n+3) .sidebar-nav-icon,
.sidebar-nav .sidebar-nav-group:nth-of-type(4n+3) .sidebar-nav-sales-toggle .sidebar-nav-icon {
    color: #7c3aed;
    background: rgba(124, 58, 237, 0.12);
}
.sidebar-nav .sidebar-nav-link:nth-of-type(4n+4) .sidebar-nav-icon,
.sidebar-nav .sidebar-nav-group:nth-of-type(4n+4) .sidebar-nav-sales-toggle .sidebar-nav-icon {
    color: #c2410c;
    background: rgba(194, 65, 12, 0.12);
}
.sidebar-nav-label {
    flex: 1;
    min-width: 0;
    font-weight: inherit;
}

/* «Продажи» + подменю */
.sidebar-nav-group--sales {
    margin: 0;
    border-radius: 12px;
}
.sidebar-nav-sales-toggle {
    width: 100%;
    text-align: left;
    padding: 11px 14px 11px 16px;
    border: none;
    background: transparent;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.96875rem;
    line-height: 1.35;
    letter-spacing: -0.015em;
    color: #475569;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    transition: background 0.18s ease, color 0.18s ease;
    text-decoration: none;
    box-sizing: border-box;
    position: relative;
}
.sidebar-nav-sales-toggle::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 0;
    border-radius: 0 4px 4px 0;
    background: var(--primary);
    transition: height 0.18s ease;
    opacity: 0;
}
.sidebar-nav-sales-toggle .sidebar-nav-chevron {
    margin-left: auto;
    display: flex;
    align-items: center;
    opacity: 0.65;
    transition: transform 0.2s ease, opacity 0.2s;
    flex-shrink: 0;
}
.sidebar-nav-sales-toggle .sidebar-nav-chevron .sidebar-nav-icon-svg {
    width: 16px;
    height: 16px;
}
.sidebar-nav-group--sales.is-open .sidebar-nav-sales-toggle .sidebar-nav-chevron {
    transform: rotate(90deg);
}
.sidebar-nav-sales-toggle:hover {
    background: rgba(241, 245, 249, 0.85);
    color: var(--foreground);
}
.sidebar-nav-group--sales.is-open .sidebar-nav-sales-toggle {
    color: var(--foreground);
}
.sidebar-nav-sales-toggle.active,
.sidebar-nav-group--sales.is-open .sidebar-nav-sales-toggle.active {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
    font-weight: 700;
}
.sidebar-nav-sales-toggle.active::before,
.sidebar-nav-group--sales.is-open .sidebar-nav-sales-toggle.active::before {
    height: 60%;
    opacity: 1;
}
.sidebar-nav-group--sales .sidebar-nav-sub {
    display: none;
    padding: 2px 0 6px 6px;
}
.sidebar-nav-group--sales.is-open .sidebar-nav-sub {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.sidebar-nav-sub-link {
    display: flex;
    align-items: center;
    padding: 9px 14px 9px 48px;
    margin: 0;
    border-radius: 10px;
    color: #475569;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.90625rem;
    line-height: 1.35;
    letter-spacing: -0.01em;
    transition: background 0.18s ease, color 0.18s ease;
    position: relative;
}
.sidebar-nav-sub-link::before {
    content: '';
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 0;
    border-radius: 4px;
    background: var(--primary);
    transition: height 0.18s ease;
    opacity: 0;
}
.sidebar-nav-sub-link:hover {
    background: rgba(241, 245, 249, 0.9);
    color: var(--foreground);
}
.sidebar-nav-sub-link.active {
    background: rgba(37, 99, 235, 0.08);
    color: var(--primary);
    font-weight: 700;
}
.sidebar-nav-sub-link.active::before {
    height: 50%;
    opacity: 1;
}

.sidebar-footer {
    padding: 14px 14px 16px;
    border-top: 1px solid rgba(226, 232, 240, 0.95);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.sidebar-user-block {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.sidebar-user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(145deg, #e2e8f0, #cbd5e1);
    color: #475569;
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: inset 0 -2px 6px rgba(255, 255, 255, 0.6);
}
.sidebar-user-avatar--img {
    object-fit: cover;
    padding: 0;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
}
.sidebar-user-meta {
    flex: 1;
    min-width: 0;
    position: relative;
}
.sidebar-user-meta .user-info {
    margin: 0;
    padding: 0;
}
.sidebar-user-meta .user-name {
    display: block;
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--foreground);
    line-height: 1.25;
}
.sidebar-user-meta .user-email {
    display: block;
    font-size: 0.75rem;
    color: var(--muted-foreground);
    margin-top: 2px;
    word-break: break-all;
}
.sidebar-user-meta .user-balance {
    display: block;
    font-size: 0.7rem;
    margin-top: 6px;
    color: var(--muted-foreground);
}
.user-info-wrapper { position: relative; }
.user-account-menu {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    right: 0;
    padding: 8px;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.12);
    z-index: 120;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.user-account-menu[hidden] {
    display: none !important;
}
.sidebar-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: inherit;
    text-decoration: none;
    color: var(--foreground);
    background: rgba(241, 245, 249, 0.9);
    border: 1px solid transparent;
    transition: background 0.18s ease, border-color 0.18s ease;
    box-sizing: border-box;
}
.sidebar-menu-btn:hover {
    background: var(--muted);
    border-color: var(--border);
    color: var(--foreground);
}
button.sidebar-menu-btn {
    cursor: pointer;
    text-align: center;
}
.user-account-menu__btn--with-icon {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    text-align: left;
}
.user-account-menu__btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    color: #0284c7;
}
.user-account-menu__btn-icon .sidebar-nav-icon-svg {
    width: 20px;
    height: 20px;
}
.user-info { cursor: pointer; margin-bottom: 8px; }
.user-name { display: block; font-weight: 500; }
.user-email { font-size: 12px; color: var(--muted-foreground); }

.sidebar-logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.9375rem;
    font-weight: 500;
    font-family: inherit;
    text-decoration: none;
    color: var(--muted-foreground);
    background: rgba(241, 245, 249, 0.95);
    border: 1px solid rgba(226, 232, 240, 0.9);
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.sidebar-logout-btn:hover {
    background: #e2e8f0;
    color: var(--foreground);
    border-color: #cbd5e1;
}
.sidebar-logout-btn__icon {
    width: 20px;
    height: 20px;
    opacity: 0.85;
}

.main-wrap {
    margin-left: 332px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    padding: 12px 12px 0 12px;
    box-sizing: border-box;
}
/* Верхняя панель — тот же soft / glass формат, что и .sidebar-surface */
.main-wrap > .topbar {
    display: flex !important;
    flex-shrink: 0;
    align-items: center;
    position: sticky;
    top: 12px;
    z-index: 30;
}
@media (min-width: 1025px) {
    .main-wrap > .topbar {
        z-index: 50;
    }
}
.topbar {
    min-height: 56px;
    height: auto;
    padding: 10px 14px;
    gap: 12px;
    flex-wrap: wrap;
    background: rgba(255, 255, 255, 0.94);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.85);
    box-shadow:
        0 12px 40px rgba(15, 23, 42, 0.09),
        0 2px 10px rgba(15, 23, 42, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
.menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 12px;
    background: rgba(241, 245, 249, 0.9);
    color: var(--muted-foreground);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    flex-shrink: 0;
}
.menu-toggle:hover {
    background: var(--muted);
    color: var(--foreground);
}
.menu-toggle-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
}
.menu-toggle-icon .sidebar-nav-icon-svg {
    display: block;
}
.topbar-brand {
    display: none;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
    flex-shrink: 0;
}
.topbar-brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: linear-gradient(145deg, #3b82f6, #2563eb);
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}
.topbar-brand-title {
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: -0.02em;
    color: var(--foreground);
}
.topbar-point {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.topbar-field-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--muted-foreground);
    white-space: nowrap;
}
.topbar-select,
.topbar-point select {
    min-width: 140px;
    padding: 9px 12px;
    border-radius: 12px;
    border: 1px solid rgba(226, 232, 240, 0.95);
    background: rgba(241, 245, 249, 0.85);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--foreground);
    cursor: pointer;
    transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
}
.topbar-select:focus,
.topbar-point select:focus {
    outline: none;
    border-color: rgba(37, 99, 235, 0.35);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.topbar-point select:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}
.topbar-point-hint {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--muted-foreground);
}
.topbar-point--single .topbar-point-name {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 9px 12px;
    border-radius: 12px;
    border: 1px solid rgba(226, 232, 240, 0.95);
    background: rgba(241, 245, 249, 0.85);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--foreground);
    white-space: nowrap;
    max-width: min(220px, 42vw);
    overflow: hidden;
    text-overflow: ellipsis;
}
.topbar-shift-hint {
    white-space: nowrap;
}
.topbar-shift {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.topbar-shift .cash-label {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--foreground);
    padding: 8px 12px;
    border-radius: 12px;
    background: rgba(241, 245, 249, 0.9);
    border: 1px solid rgba(226, 232, 240, 0.95);
    white-space: nowrap;
}
.topbar-search {
    flex: 1;
    max-width: 400px;
    min-width: 120px;
}
.topbar-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 12px;
    font-size: 0.9375rem;
    font-family: inherit;
    background: rgba(241, 245, 249, 0.65);
    color: var(--foreground);
    transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
}
.topbar-search input::placeholder {
    color: var(--muted-foreground);
}
.topbar-search input:focus {
    outline: none;
    border-color: rgba(37, 99, 235, 0.35);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.topbar .btn-sm {
    border-radius: 12px;
    font-weight: 500;
    font-size: 0.875rem;
}
.topbar .btn-primary.btn-sm {
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}
.topbar .btn-ghost.btn-sm {
    background: rgba(241, 245, 249, 0.75);
    border: 1px solid rgba(226, 232, 240, 0.9);
    color: var(--foreground);
}
.topbar .btn-ghost.btn-sm:hover {
    background: rgba(241, 245, 249, 1);
    border-color: var(--border);
    color: var(--foreground);
}
.topbar-notify {
    position: relative;
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    padding-left: 12px !important;
    padding-right: 12px !important;
}
.topbar-notify-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    opacity: 0.9;
    color: #2563eb;
}
.topbar-notify-icon .sidebar-nav-icon-svg {
    width: 20px;
    height: 20px;
}
.topbar-notify-text {
    white-space: nowrap;
}
.topbar-notify-badge {
    position: absolute;
    top: -5px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 11px;
    font-weight: 600;
    line-height: 18px;
    text-align: center;
    border-radius: 9px;
    background: var(--danger);
    color: #fff;
}
.main-content { flex: 1; padding: 24px; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: opacity 0.2s, background 0.2s;
}
.btn:hover:not(:disabled):not([disabled]) { opacity: 0.9; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-primary {
    background: var(--primary);
    color: var(--primary-foreground);
    border: 1px solid rgba(0, 0, 0, 0.14);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.btn:disabled,
.btn[disabled] {
    cursor: not-allowed;
    opacity: 0.65;
}
.btn-primary:disabled,
.btn-primary[disabled] {
    background: var(--muted);
    color: var(--muted-foreground);
    opacity: 1;
    box-shadow: none;
    border-color: rgba(0, 0, 0, 0.08);
}
.btn-secondary:disabled,
.btn-secondary[disabled],
.btn-ghost:disabled,
.btn-ghost[disabled] {
    opacity: 0.55;
}
.btn-secondary { background: var(--muted); color: var(--foreground); }
.btn-ghost { background: transparent; color: var(--foreground); }
.btn-ghost:hover:not(:disabled):not([disabled]) { background: var(--muted); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-end { text-align: right; }
.text-warning { color: #d97706; }

/* Card */
.card {
    background: var(--card);
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    padding: 28px;
    margin-bottom: 24px;
}
.card-heading {
    margin: 0 0 20px;
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    letter-spacing: -0.01em;
}
.page-title {
    margin: 0 0 28px;
    font-size: 1.5rem;
    font-weight: 600;
    color: #111827;
    letter-spacing: -0.02em;
}
.page-actions { margin-bottom: 16px; }

/* Производство — макет: шапка с кнопками, фильтр-полоса, таблица документов */
.production-masthead {
    margin-bottom: 20px;
}
.production-page__top {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px 20px;
}
.production-page__title {
    margin: 0;
    font-size: clamp(1.5rem, 3vw, 1.85rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    color: #111827;
}
.production-page__top-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}
.production-production-btns {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.production-btn-create-locked[disabled],
.production-btn-create-locked[disabled]:hover {
    opacity: 0.72;
    cursor: not-allowed;
    box-shadow: none;
}
.production-masthead__hint {
    margin: 14px 0 0;
    width: 100%;
    font-size: 14px;
    line-height: 1.45;
}
.production-inline-form {
    display: inline;
    margin: 0;
}
.production-btn-plus {
    flex-shrink: 0;
    opacity: 0.95;
}
.production-btn-production-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    background: #3b82f6;
    color: #fff;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
    transition: background 0.15s ease, box-shadow 0.15s ease;
}
.production-btn-production-primary:hover:not(:disabled) {
    background: #2563eb;
}
.production-btn-production-primary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
}
.production-btn-production-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    background: #fff;
    color: #374151;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.production-btn-production-secondary:hover:not(:disabled) {
    border-color: #d1d5db;
    background: #f9fafb;
}
.production-btn-production-secondary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}
.production-view-toggle {
    display: flex;
    align-items: stretch;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: visible;
    background: #fff;
    margin-left: 4px;
}
.production-view-toggle > button.production-view-toggle__btn:last-of-type {
    border-right: none;
}
.production-view-toggle__details {
    position: relative;
    border: none;
    margin: 0;
}
.production-view-toggle__details[open] .production-view-toggle__btn {
    background: #eff6ff;
    color: #1d4ed8;
}
.production-view-toggle__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    min-height: 42px;
    padding: 0 12px;
    border: none;
    border-right: 1px solid #e5e7eb;
    background: #fff;
    color: #64748b;
    cursor: pointer;
    list-style: none;
}
.production-view-toggle__btn::-webkit-details-marker {
    display: none;
}
.production-view-toggle__btn:hover {
    background: #f8fafc;
    color: #334155;
}
.production-view-toggle__btn--active {
    background: #eff6ff !important;
    color: #1d4ed8 !important;
}
.production-view-toggle__btn .sidebar-nav-icon-svg {
    width: 18px;
    height: 18px;
}
.production-view-toggle__popover {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 50;
    min-width: 200px;
    padding: 12px 14px;
    background: var(--card, #fff);
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(15, 23, 42, 0.12);
}
.production-view-toggle__popover-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 6px;
}
.production-select--compact {
    font-size: 14px;
    padding: 8px 10px;
}
.production-filter-bar--lift,
.production-toolbar--lift,
.production-section--lift {
    border: 1px solid rgba(226, 232, 240, 0.95);
    box-shadow:
        0 10px 32px rgba(15, 23, 42, 0.06),
        0 2px 8px rgba(15, 23, 42, 0.03);
    border-radius: 16px;
}
.production-section--lift:not(.production-filter-bar) {
    padding: 22px 24px;
}
.production-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 14px;
    padding: 16px 20px;
    margin-bottom: 22px;
}
.production-filter-bar__field {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 0 14px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
}
.production-filter-bar__field--date {
    flex: 0 0 auto;
}
.production-filter-bar__field--warehouse {
    flex: 0 1 220px;
    min-width: 160px;
}
.production-filter-bar__icon {
    display: flex;
    color: #3b82f6;
    flex-shrink: 0;
}
.production-filter-bar__icon .sidebar-nav-icon-svg {
    width: 18px;
    height: 18px;
}
.production-filter-bar__input,
.production-filter-bar__select {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    font-size: 14px;
    font-family: inherit;
    color: #111827;
    padding: 10px 0;
    outline: none;
}
.production-filter-bar__search-wrap {
    position: relative;
    flex: 1;
    min-width: 200px;
}
.production-filter-bar__search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    color: #9ca3af;
    pointer-events: none;
}
.production-filter-bar__search {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px 12px 44px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    outline: none;
}
.production-filter-bar__search:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.production-filter-bar__submit {
    padding: 12px 28px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    background: #3b82f6;
    color: #fff;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.3);
    transition: background 0.15s ease;
}
.production-filter-bar__submit:hover {
    background: #2563eb;
}
.production-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px 20px;
    margin-bottom: 22px;
}
.production-toolbar__form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 16px 20px;
    flex: 1;
    min-width: 0;
}
.production-toolbar__actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.production-toolbar__create {
    flex-shrink: 0;
    margin: 0;
}
.production-toolbar__hint {
    margin: 0;
    width: 100%;
    font-size: 14px;
}
.production-doc-list-section {
    margin-bottom: 22px;
}
.production-doc-list__scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -4px;
}
.production-doc-list .production-table {
    min-width: 640px;
}
.production-doc-list thead th {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    border-bottom: 1px solid #e5e7eb;
    padding-top: 8px;
    padding-bottom: 12px;
}
.production-doc-list tbody td {
    font-size: 14px;
    color: #1e293b;
    padding-top: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}
.production-doc-list__docno {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: #3b82f6;
}
.production-doc-list__product {
    font-weight: 500;
}
.production-doc-list__col-qty {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.production-doc-list__row--active td {
    background: rgba(59, 130, 246, 0.07);
}
.production-doc-list__row:focus {
    outline: 2px solid #3b82f6;
    outline-offset: -2px;
}
.production-doc-list__pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    padding: 5px 10px 5px 12px;
    border-radius: 999px;
    white-space: nowrap;
}
.production-doc-list__pill-chevron {
    flex-shrink: 0;
    opacity: 0.65;
}
.production-doc-list__badge--draft {
    background: rgba(251, 191, 36, 0.2);
    color: #b45309;
}
.production-doc-list__badge--done {
    background: rgba(34, 197, 94, 0.18);
    color: #15803d;
}
.production-doc-pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 18px;
    padding-top: 4px;
}
.production-doc-pagination__range {
    font-size: 14px;
    margin-right: 8px;
}
.production-doc-pagination__page {
    min-width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #eff6ff;
    color: #1d4ed8;
    font-weight: 600;
    font-size: 14px;
}
.production-doc-pagination__nav {
    width: 32px;
    height: 32px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    color: #64748b;
}
.production-doc-pagination__nav:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.production-doc-list__empty {
    padding: 8px 0 4px;
    font-size: 15px;
}
.production-btn-create {
    border-radius: 12px;
    font-weight: 600;
    padding: 10px 20px;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}
.production-btn-create:disabled,
.production-btn-create[disabled] {
    box-shadow: none;
}
.production-btn-create--blocked {
    opacity: 0.72;
    cursor: not-allowed;
    box-shadow: none;
}
.production-btn-create--blocked:hover {
    opacity: 0.72;
}
.production-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 140px;
}
.production-field--grow {
    flex: 1;
    min-width: 200px;
}
.production-field__label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted-foreground);
}
.production-field__icon {
    display: flex;
    width: 20px;
    height: 20px;
    color: var(--primary);
    opacity: 0.9;
}
.production-field__icon .sidebar-nav-icon-svg {
    width: 20px;
    height: 20px;
}
.production-input,
.production-select {
    width: 100%;
    max-width: 100%;
    padding: 10px 14px;
    border: 1px solid rgba(226, 232, 240, 0.98);
    border-radius: 12px;
    font-size: 0.9375rem;
    font-family: inherit;
    background: rgba(248, 250, 252, 0.9);
    color: var(--foreground);
    transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}
.production-input:focus,
.production-select:focus {
    outline: none;
    border-color: rgba(37, 99, 235, 0.35);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.production-card-status {
    margin: -8px 0 16px;
    font-size: 14px;
}
.production-section {
    margin-bottom: 20px;
}
.production-section__head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 18px;
    font-size: 1.15rem;
    font-weight: 600;
    color: #111827;
    letter-spacing: -0.02em;
}
.production-section__head-icon {
    display: flex;
    width: 26px;
    height: 26px;
    color: var(--primary);
}
.production-section__head-icon .sidebar-nav-icon-svg {
    width: 26px;
    height: 26px;
}
.production-table-wrap {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    margin-bottom: 16px;
}
.production-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
}
.production-table thead th {
    text-align: left;
    padding: 12px 16px;
    background: linear-gradient(180deg, #f1f5f9 0%, #e8edf3 100%);
    color: #475569;
    font-weight: 600;
    font-size: 0.8125rem;
    letter-spacing: 0.02em;
    border-bottom: 1px solid var(--border);
}
.production-table tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    vertical-align: middle;
}
.production-table tbody tr:last-child td {
    border-bottom: none;
}
.production-table__qty {
    text-align: right;
    white-space: nowrap;
    font-weight: 500;
    color: var(--foreground);
}
.production-table__act {
    width: 1%;
    white-space: nowrap;
}
.production-table__empty-row td {
    padding: 0;
    border-bottom: none;
}
.production-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 20px 36px;
    color: var(--muted-foreground);
}
.production-empty--inline {
    flex-direction: row;
    gap: 16px;
    padding: 28px 20px;
    text-align: left;
    justify-content: center;
}
.production-empty__icon {
    display: flex;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    color: #cbd5e1;
}
.production-empty__icon .sidebar-nav-icon-svg {
    width: 48px;
    height: 48px;
}
.production-empty--inline .production-empty__icon {
    width: 40px;
    height: 40px;
}
.production-empty--inline .production-empty__icon .sidebar-nav-icon-svg {
    width: 40px;
    height: 40px;
}
.production-empty__text {
    margin: 0;
    max-width: 420px;
    font-size: 0.9375rem;
    line-height: 1.45;
    color: var(--muted-foreground);
}
.production-add-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding-top: 4px;
}
.production-add-row__product {
    flex: 1;
    min-width: 200px;
    max-width: 100%;
}
.production-add-row__qty {
    width: 110px;
    flex-shrink: 0;
}
.production-line-delete {
    margin: 0;
    display: inline;
}
@media (max-width: 640px) {
    .production-toolbar--lift,
    .production-filter-bar--lift,
    .production-section--lift,
    .production-doc-list-section {
        padding: 18px 16px;
        border-radius: 14px;
    }
    .production-filter-bar {
        padding: 14px 16px;
    }
    .production-page__top {
        flex-direction: column;
        align-items: stretch;
    }
    .production-page__top-actions {
        width: 100%;
    }
    .production-btn-production-primary,
    .production-btn-production-secondary {
        flex: 1;
        justify-content: center;
    }
    .production-add-row__qty {
        width: 100%;
    }
    .production-empty--inline {
        flex-direction: column;
        text-align: center;
    }
}

/* Stats */
.cards-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { padding: 20px; }
.stat-value { font-size: 1.5rem; font-weight: 600; }
.stat-label { font-size: 13px; color: var(--muted-foreground); margin-top: 4px; }

/* Отчёты: сводка за период (современный вид) */
.report-kassa {
    overflow: hidden;
}
.report-kassa__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}
.report-kassa__tile {
    background: linear-gradient(165deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px 18px;
    min-height: 118px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.report-kassa__label {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
}
.report-kassa__value {
    font-size: clamp(1.2rem, 2vw, 1.55rem);
    line-height: 1.2;
    letter-spacing: -0.02em;
    font-weight: 700;
    color: #0f172a;
}
.report-kassa__meta {
    margin-top: auto;
    font-size: 12px;
    line-height: 1.4;
    color: var(--muted-foreground);
}
.report-kassa__meta strong {
    color: #1e293b;
    font-weight: 600;
}
@media (max-width: 1100px) {
    .report-kassa__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 520px) {
    .report-kassa__grid {
        grid-template-columns: 1fr;
    }
}

.report-photo {
    background: #f8faff;
    border-color: #e4eaf7;
}
.report-photo__metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}
.report-photo__metric--discount .report-photo__metric-value {
    color: #1d4ed8;
}
.report-photo__metric {
    background: #fff;
    border: 1px solid #e5eaf4;
    border-radius: 12px;
    padding: 14px;
}
.report-photo__metric-label {
    color: #475569;
    font-size: 13px;
    font-weight: 600;
}
.report-photo__metric-value {
    margin-top: 6px;
    font-size: 2rem;
    line-height: 1.1;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #0f172a;
}
.report-photo__metric-sub {
    margin-top: 8px;
    font-size: 12px;
    color: #64748b;
}
.report-photo__metric-sub.is-up { color: #16a34a; }
.report-photo__metric-sub.is-down { color: #dc2626; }
.report-photo__chart-wrap,
.report-photo__section {
    margin-top: 14px;
    background: #fff;
    border: 1px solid #e5eaf4;
    border-radius: 12px;
    padding: 14px;
}
.report-photo__chart-box {
    height: 280px;
}
.report-photo__badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}
.report-photo__badge--closed {
    background: #dcfce7;
    color: #15803d;
}
.report-photo__badge--open {
    background: #fef3c7;
    color: #a16207;
}
.report-sale-source {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px;
    text-decoration: none;
    font-weight: 600;
    color: var(--primary, #2563eb);
}
.report-sale-source:hover {
    text-decoration: underline;
}
.report-sale-source__type {
    font-weight: 600;
}
.report-sale-source__num {
    font-weight: 700;
    color: inherit;
}
.report-sale-source--plain .report-sale-source__num {
    color: var(--text, #1e293b);
}
.report-sale-channel {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
}
.report-sale-channel--sale {
    background: #f1f5f9;
    color: #475569;
}
.report-sale-channel--catalog_wholesale {
    background: #fef3c7;
    color: #b45309;
}
.report-sale-channel--catalog_retail {
    background: #dbeafe;
    color: #1d4ed8;
}
.report-sale-channel-link {
    text-decoration: none;
}
.report-sale-channel-link:hover .report-sale-channel {
    filter: brightness(0.96);
}
.report-photo__bottom-grid {
    margin-top: 14px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}
.report-photo__mini {
    background: #fff;
    border: 1px solid #e5eaf4;
    border-radius: 12px;
    padding: 14px;
}
.report-photo__mini h3 {
    margin: 0 0 12px;
    font-size: 1.05rem;
}
.report-photo__mini-row,
.report-photo__mini-total {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    font-size: 14px;
    padding: 7px 0;
}
.report-photo__mini-row small {
    color: #64748b;
    font-size: 12px;
}
.report-photo__mini-total {
    margin-top: 6px;
    padding-top: 10px;
    border-top: 1px solid #e2e8f0;
    font-weight: 700;
    color: #1d4ed8;
}
@media (max-width: 1100px) {
    .report-photo__metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .report-photo__bottom-grid {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 640px) {
    .report-photo__metrics {
        grid-template-columns: 1fr;
    }
}

.summary-modern {
    overflow: hidden;
}
.summary-modern__head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px 20px;
    margin-bottom: 22px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border);
}
.summary-modern__head h2 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--foreground);
}
.summary-modern__period {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--muted-foreground);
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 8px 14px;
}
.summary-modern__period strong {
    color: var(--foreground);
    font-weight: 600;
}
.summary-modern__section {
    margin-bottom: 22px;
}
.summary-modern__section:last-of-type {
    margin-bottom: 0;
}
.summary-modern__section-title {
    margin: 0 0 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted-foreground);
}
.summary-modern__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
    gap: 14px;
}
/* Ровно 4 колонки: два ряда по четыре плитки */
.summary-modern__grid--4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}
@media (max-width: 1100px) {
    .summary-modern__grid--4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 520px) {
    .summary-modern__grid--4 {
        grid-template-columns: 1fr;
    }
}
.summary-modern__grid--2 {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.summary-tile {
    position: relative;
    background: linear-gradient(165deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px 18px;
    min-height: 112px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}
.summary-tile:hover {
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.07);
    border-color: #cbd5e1;
    transform: translateY(-1px);
}
.summary-tile::before {
    content: "";
    position: absolute;
    left: 0;
    top: 12px;
    bottom: 12px;
    width: 3px;
    border-radius: 0 4px 4px 0;
    background: var(--tile-accent, #cbd5e1);
    opacity: 0.85;
}
.summary-tile--accent-primary { --tile-accent: var(--primary); }
.summary-tile--accent-success { --tile-accent: var(--success); }
.summary-tile--accent-danger { --tile-accent: var(--danger); }
.summary-tile--accent-violet { --tile-accent: #8b5cf6; }
.summary-tile--accent-amber { --tile-accent: #f59e0b; }
.summary-tile--accent-slate { --tile-accent: #64748b; }
.summary-tile--accent-teal { --tile-accent: #14b8a6; }
.summary-tile--accent-rose { --tile-accent: #f43f5e; }
.summary-tile--hero {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.07) 0%, #ffffff 55%);
    border-color: rgba(37, 99, 235, 0.18);
}
.summary-tile--hero .summary-tile__value {
    font-size: clamp(1.25rem, 2vw, 1.5rem);
}
.summary-tile__icon {
    font-size: 1.15rem;
    line-height: 1;
    margin-bottom: 10px;
    filter: grayscale(0.15);
}
.summary-tile__value {
    font-size: 1.28rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.15;
    color: var(--foreground);
}
.summary-tile__label {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    margin-top: 8px;
}
.summary-tile__hint {
    font-size: 11px;
    line-height: 1.45;
    color: var(--muted-foreground);
    margin-top: auto;
    padding-top: 10px;
}
a.summary-tile--as-link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}
a.summary-tile--as-link:focus-visible {
    outline: 2px solid var(--primary, #2563eb);
    outline-offset: 2px;
}
a.summary-tile--as-link.is-active-detail {
    border-color: rgba(37, 99, 235, 0.45);
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.2);
}
.summary-modern__footnote {
    margin: 18px 0 0;
    padding-top: 16px;
    border-top: 1px dashed var(--border);
    font-size: 12px;
    line-height: 1.5;
    color: var(--muted-foreground);
}

/* Dashboard (home page) */
.dashboard-title {
    margin-bottom: 16px;
    font-weight: 700;
}
.dashboard-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}
.dashboard-metric-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}
.dashboard-metric-label {
    font-size: 14px;
    color: #475569;
    margin-bottom: 8px;
    font-weight: 500;
}
.dashboard-metric-value {
    font-size: 38px;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: #1e293b;
    font-weight: 700;
}
.dashboard-metric-inline {
    font-size: 24px;
    font-weight: 500;
    color: #475569;
}
.dashboard-metric-sub {
    margin-top: 8px;
    font-size: 13px;
    color: #64748b;
}
.dashboard-chart-card {
    padding: 16px 16px 8px;
}
.dashboard-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}
.dashboard-chip {
    background: #eef2ff;
    color: #1d4ed8;
    border: 1px solid #dbeafe;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
}
.dashboard-link {
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
}
.dashboard-link:hover {
    text-decoration: underline;
}
.dashboard-status {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    color: #1d4ed8;
    background: #eff6ff;
    border: 1px solid #dbeafe;
    border-radius: 999px;
    padding: 4px 10px;
}

/* Главная: ширина контента; верхняя панель — общая (см. .main-wrap > .topbar) */
body.page-home .main-content {
    max-width: 1360px;
    margin: 0 auto;
    padding: 20px 18px;
}

body.page-admin .main-content {
    max-width: 1360px;
    margin: 0 auto;
    overflow-x: hidden;
}
.admin-modern {
    background: radial-gradient(circle at top left, #f8fbff 0%, #f5f8ff 40%, #f8faff 100%);
    border: 1px solid #e4eaf7;
    border-radius: 16px;
    padding: 18px;
}
.admin-modern__lead {
    margin-bottom: 16px;
}
.admin-modern__card {
    border: 1px solid #e5eaf4;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.admin-modern__panel {
    position: relative;
    overflow: hidden;
    background: linear-gradient(165deg, #ffffff 0%, #f8fbff 100%);
    border: 1px solid rgba(219, 227, 240, 0.9);
    border-radius: 14px;
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.05),
        0 8px 28px -18px rgba(37, 99, 235, 0.35);
}
.admin-modern__panel::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #3b82f6, #60a5fa);
    opacity: 0.75;
}
.admin-modern__panel .card-heading {
    font-size: 1.15rem;
    margin-bottom: 14px;
    color: #1f2a56;
}
.admin-modern__search-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin: 0;
}
.admin-modern__input {
    min-width: 280px;
    max-width: 420px;
    width: 100%;
    padding: 9px 11px;
    border: 1px solid #dbe3f0;
    border-radius: 10px;
    background: #fff;
}
.admin-modern__input--short {
    max-width: 200px;
}
.admin-modern__restore-form {
    max-width: 540px;
}
.admin-modern__stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}
.admin-modern__stats-grid--5 {
    grid-template-columns: repeat(5, minmax(100px, 1fr));
}
@media (max-width: 1100px) {
    .admin-modern__stats-grid--5 {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
}
.admin-modern__period-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    margin: 0 0 12px;
}
.admin-modern__period-label {
    display: block;
    width: 100%;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 2px;
}
.admin-modern__period-fields {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.admin-modern__input--date {
    min-width: 0;
    max-width: 170px;
    width: auto;
}
.admin-modern__sub-actions {
    min-width: 200px;
}
.admin-modern__stat-card {
    margin: 0;
    padding: 16px;
    border-radius: 12px;
    background: linear-gradient(160deg, #fff 0%, #f8fafc 100%);
    border: 1px solid #e8eef8;
}
.admin-modern__stat-value {
    font-size: 30px;
    font-weight: 700;
    line-height: 1.1;
    color: #1f2a56;
}
.admin-modern__stat-live {
    margin-top: 8px;
    font-size: 11px;
    line-height: 1.3;
    opacity: 0.88;
}
.admin-log-result {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    line-height: 1.3;
    background: #eef2ff;
    color: #3730a3;
    white-space: nowrap;
}
.admin-log-result--success {
    background: #dcfce7;
    color: #166534;
}
.admin-log-result--wrong_password,
.admin-log-result--user_not_found,
.admin-log-result--guess_attempt,
.admin-log-result--locked,
.admin-log-result--invalid_input {
    background: #fee2e2;
    color: #991b1b;
}
.admin-modern__balance-cell {
    font-size: 13px;
    vertical-align: middle;
}
.admin-modern__balance-value {
    margin-bottom: 6px;
    font-weight: 600;
}
.admin-modern__balance-form {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}
.admin-modern__balance-input {
    width: 110px;
    padding: 4px 8px;
    font-size: 13px;
    border: 1px solid #dbe3f0;
    border-radius: 8px;
}
.admin-modern .table-wrap {
    border-radius: 12px;
    border: 1px solid #e5ecf8;
    overflow-x: hidden;
    background: #fff;
}
.admin-modern .data-table {
    width: 100%;
    table-layout: fixed;
}
.admin-modern .data-table th {
    background: #f7faff;
    color: #52607a;
    font-size: 11px;
    padding: 11px 10px;
    white-space: normal;
    line-height: 1.35;
}
.admin-modern .data-table td {
    color: #334155;
    padding: 10px 10px;
    vertical-align: top;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
}
.admin-modern .data-table tbody tr:hover {
    background: #f9fbff;
}
.admin-modern .data-table td .btn {
    white-space: normal;
}
.admin-modern__search-row .btn {
    min-width: 110px;
}
.admin-modern__sub-actions {
    min-width: 0;
}
.admin-modern__sub-form {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.admin-modern__sub-form select {
    min-width: 0 !important;
    width: auto;
}
.admin-modern__balance-form .btn {
    min-width: 0;
}
.admin-modern__panel .table-wrap + .muted {
    margin-top: 10px;
}
.admin-modern__hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}
.admin-modern__title {
    margin-bottom: 4px;
}
.admin-modern__hero-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 11px;
    border-radius: 999px;
    border: 1px solid #d8e6ff;
    background: #eef4ff;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}
.admin-modern__consent-btn {
    min-width: 128px;
}
.admin-modern__consent-modal[hidden] {
    display: none;
}
.admin-modern__consent-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
}
.admin-modern__consent-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
}
.admin-modern__consent-dialog {
    position: relative;
    width: min(680px, calc(100vw - 28px));
    margin: 8vh auto 0;
    padding: 20px;
    border-radius: 16px;
    border: 1px solid #dbe7fb;
    background: linear-gradient(165deg, #ffffff 0%, #f6f9ff 100%);
    box-shadow: 0 30px 60px -35px rgba(15, 23, 42, 0.45);
}
.admin-modern__consent-dialog h3 {
    margin: 0 0 4px;
    color: #0f2755;
}
.admin-modern__consent-owner {
    margin: 0 0 14px;
    font-size: 13px;
}
.admin-modern__consent-close {
    position: absolute;
    right: 10px;
    top: 10px;
    border: 0;
    background: #eff4ff;
    color: #1d4ed8;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}
.admin-modern__consent-list {
    display: grid;
    gap: 10px;
}
.admin-modern__consent-item {
    border: 1px solid #e2e9f7;
    border-radius: 12px;
    background: #fff;
    padding: 10px 12px;
}
.admin-modern__consent-item-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
    font-weight: 600;
    color: #1f2a56;
}
.admin-modern__consent-item-status {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    background: #dcfce7;
    color: #166534;
    white-space: nowrap;
}
.admin-modern__consent-item-status.is-warning {
    background: #fef3c7;
    color: #92400e;
}
.admin-modern__consent-item-details {
    font-size: 12px;
}
.admin-modern__tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}
.admin-modern__tab {
    display: inline-flex;
    align-items: center;
    padding: 10px 16px;
    border-radius: 10px;
    border: 1px solid #dbe7fb;
    background: #fff;
    color: #334155;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
}
.admin-modern__tab.is-active {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}
.admin-modern__tab-badge {
    margin-left: 8px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
}
.admin-modern__tab.is-active .admin-modern__tab-badge {
    background: #fff;
    color: #2563eb;
}
.admin-pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}
.admin-pricing-fieldset {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px 14px;
    margin: 0;
}
.admin-pricing-fieldset label {
    display: block;
    margin-top: 8px;
    font-size: 13px;
}
/* —— Объявления CRM: баннер + панель справа —— */
.pa-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    margin: 0;
    padding: 12px 18px;
    border: none;
    border-bottom: 1px solid rgba(37, 99, 235, 0.2);
    background: linear-gradient(90deg, #eff6ff 0%, #f8fafc 100%);
    color: #1e3a8a;
    cursor: pointer;
    text-align: left;
    font: inherit;
    transition: background 0.2s ease;
}
.pa-banner:hover {
    background: linear-gradient(90deg, #dbeafe 0%, #f1f5f9 100%);
}
.pa-banner--warning {
    border-bottom-color: rgba(234, 88, 12, 0.25);
    background: linear-gradient(90deg, #fff7ed 0%, #fffbeb 100%);
    color: #9a3412;
}
.pa-banner--promo {
    border-bottom-color: rgba(22, 163, 74, 0.25);
    background: linear-gradient(90deg, #ecfdf5 0%, #f0fdf4 100%);
    color: #166534;
}
.pa-banner__icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(37, 99, 235, 0.12);
    position: relative;
}
.pa-banner--warning .pa-banner__icon { background: rgba(234, 88, 12, 0.15); }
.pa-banner--promo .pa-banner__icon { background: rgba(22, 163, 74, 0.15); }
.pa-banner__icon::after {
    content: '';
    position: absolute;
    inset: 10px;
    background: currentColor;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M13 2L3 14h9l-1 8 10-12h-9l1-8z'/%3E%3C/svg%3E") center/contain no-repeat;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M13 2L3 14h9l-1 8 10-12h-9l1-8z'/%3E%3C/svg%3E") center/contain no-repeat;
}
.pa-banner--warning .pa-banner__icon::after {
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M12 9v4m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M12 9v4m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z'/%3E%3C/svg%3E");
}
.pa-banner__text { flex: 1; min-width: 0; }
.pa-banner__label { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; opacity: 0.75; }
.pa-banner__title { display: block; font-size: 15px; font-weight: 700; }
.pa-banner__more {
    font-size: 12px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.06);
}
.pa-banner__chev { font-size: 22px; opacity: 0.5; line-height: 1; }

.pa-drawer {
    position: fixed;
    inset: 0;
    z-index: 12000;
    pointer-events: none;
}
.pa-drawer.is-open { pointer-events: auto; }
.pa-drawer[hidden] { display: none !important; }
.pa-drawer__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    opacity: 0;
    transition: opacity 0.28s ease;
    border: none;
    cursor: pointer;
}
.pa-drawer.is-open .pa-drawer__backdrop { opacity: 1; }
.pa-drawer__panel {
    position: absolute;
    top: 0;
    right: 0;
    width: min(440px, 100vw);
    height: 100%;
    background: #fff;
    box-shadow: -12px 0 40px rgba(15, 23, 42, 0.18);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}
.pa-drawer.is-open .pa-drawer__panel { transform: translateX(0); }
.pa-drawer__head {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 22px 20px 16px;
    border-bottom: 1px solid #e2e8f0;
    background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}
.pa-drawer[data-kind="update"] .pa-drawer__icon-wrap { background: linear-gradient(135deg, #3b82f6, #2563eb); color: #fff; }
.pa-drawer[data-kind="warning"] .pa-drawer__icon-wrap { background: linear-gradient(135deg, #f59e0b, #ea580c); color: #fff; }
.pa-drawer[data-kind="promo"] .pa-drawer__icon-wrap { background: linear-gradient(135deg, #22c55e, #16a34a); color: #fff; }
.pa-drawer__icon-wrap {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.25);
}
.pa-drawer__icon-wrap svg { width: 26px; height: 26px; }
.pa-drawer__head-text { flex: 1; min-width: 0; }
.pa-drawer__kind {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    margin-bottom: 4px;
}
.pa-drawer__title { margin: 0; font-size: 1.2rem; line-height: 1.3; color: #0f172a; }
.pa-drawer__date { margin: 6px 0 0; font-size: 12px; }
.pa-drawer__close {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 10px;
    background: #f1f5f9;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: #64748b;
}
.pa-drawer__close:hover { background: #e2e8f0; color: #0f172a; }
.pa-drawer__body {
    flex: 1;
    overflow: auto;
    padding: 18px 20px;
}
.pa-drawer__photos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}
.pa-drawer__photos[hidden] { display: none !important; }
.pa-drawer__photo-link {
    display: block;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    aspect-ratio: 4/3;
}
.pa-drawer__photo-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.pa-drawer__content {
    font-size: 15px;
    line-height: 1.55;
    color: #334155;
}
.pa-drawer__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px 20px;
    border-top: 1px solid #e2e8f0;
    background: #fafbfc;
}
.pa-drawer__ack {
    flex: 1;
    padding: 14px 20px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}
.pa-drawer__ack:hover { filter: brightness(1.05); }
body.pa-drawer-open { overflow: hidden; }

/* —— Мониторинг: таблица компаний —— */
.admin-companies-table.table-wrap {
    overflow-x: auto;
}
.admin-companies-table .admin-companies-table__grid {
    table-layout: fixed;
    width: 100%;
    min-width: 1180px;
}
.admin-companies-table .admin-co-col--name { width: 11%; }
.admin-companies-table .admin-co-col--owner { width: 14%; }
.admin-companies-table .admin-co-col--policy { width: 11%; }
.admin-companies-table .admin-co-col--users { width: 6%; }
.admin-companies-table .admin-co-col--ends { width: 9%; }
.admin-companies-table .admin-co-col--balance { width: 12%; }
.admin-companies-table .admin-co-col--sub { width: 22%; }
.admin-companies-table .admin-co-col--db { width: 7%; }
.admin-companies-table .admin-co-col--actions { width: 8%; }
.admin-companies-table .data-table td.admin-co-sub,
.admin-companies-table .data-table td.admin-co-balance,
.admin-companies-table .data-table td.admin-co-actions {
    overflow: visible;
    word-break: normal;
    overflow-wrap: normal;
}
.admin-co-inline-form {
    display: block;
    width: 100%;
    margin: 0;
}
.admin-co-balance__sum {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 10px;
}
.admin-co-balance__sum span { font-weight: 600; color: #64748b; font-size: 14px; }
.admin-co-sub {
    min-width: 0;
}
.admin-co-block {
    margin-bottom: 10px;
}
.admin-co-block:last-of-type {
    margin-bottom: 0;
}
.admin-co-block__label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
    margin-bottom: 6px;
}
.admin-co-input-group {
    display: grid;
    gap: 8px;
    align-items: stretch;
    width: 100%;
}
.admin-co-input-group--2 {
    grid-template-columns: minmax(0, 1fr) auto;
}
.admin-co-input-group--3 {
    grid-template-columns: minmax(0, 1fr) minmax(72px, 88px) auto;
}
.admin-co-input,
.admin-co-select {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    font-size: 13px;
    line-height: 1.25;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #fff;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.admin-co-select {
    padding-right: 28px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M3 4.5L6 7.5L9 4.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    appearance: none;
}
.admin-co-input:focus,
.admin-co-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.admin-co-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: 0;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    transition: transform 0.12s, box-shadow 0.12s, background 0.12s;
}
.admin-co-danger-form {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e2e8f0;
}
.admin-co-btn:active { transform: scale(0.98); }
.admin-co-btn--primary {
    background: #0f172a;
    color: #fff;
}
.admin-co-btn--primary:hover { background: #1e293b; }
.admin-co-btn--accent {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}
.admin-co-btn--ghost {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #e2e8f0;
}
.admin-co-btn--ghost:hover { background: #e2e8f0; }
.admin-co-btn--danger {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}
.admin-co-btn--danger:hover { background: #fee2e2; }
.admin-co-btn--full {
    width: 100%;
    box-sizing: border-box;
}
.admin-co-actions .admin-co-btn--full + .admin-co-danger-form,
.admin-co-actions .admin-co-danger-form {
    margin-top: 8px;
    padding-top: 0;
    border-top: none;
}
.admin-co-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 128px;
}
.admin-co-link-danger {
    background: none;
    border: none;
    padding: 0;
    font-size: 12px;
    font-weight: 600;
    color: #dc2626;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.admin-co-db { font-size: 11px !important; word-break: break-all; }
@media (max-width: 1280px) {
    .admin-companies-table .admin-co-input-group--3 {
        grid-template-columns: 1fr 1fr;
    }
    .admin-companies-table .admin-co-input-group--3 .admin-co-btn {
        grid-column: 1 / -1;
        width: 100%;
    }
}
.admin-announce-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px 18px;
}
.admin-announce-field--wide { grid-column: 1 / -1; }
.admin-announce-lbl { display: block; font-size: 12px; font-weight: 600; color: #475569; margin-bottom: 6px; }
.admin-announce-file { font-size: 13px; }
.admin-announce-existing__grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
}
.admin-announce-existing__item {
    width: 100px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}
.admin-announce-existing__item img { display: block; width: 100%; height: 72px; object-fit: cover; }
.admin-announce-existing__del {
    display: block;
    padding: 6px;
    font-size: 11px;
    background: #f8fafc;
}
.admin-announce-checks { display: flex; flex-wrap: wrap; gap: 16px; margin: 14px 0; font-size: 14px; }
.admin-announce-actions { display: flex; gap: 10px; flex-wrap: wrap; }
@media (max-width: 720px) {
    .admin-modern__hero {
        flex-direction: column;
        align-items: stretch;
    }
    .admin-modern__consent-dialog {
        margin-top: 4vh;
        padding: 16px;
    }
}
@media (max-width: 1180px) {
    .admin-modern .data-table th,
    .admin-modern .data-table td {
        padding: 8px 8px;
        font-size: 12px;
    }
    .admin-modern .btn {
        min-height: 34px;
        padding: 7px 10px;
        font-size: 12px;
    }
}

.home-v2 {
    background: #f4f7ff;
    border: 1px solid #e3e9f6;
    border-radius: 12px;
    padding: 18px;
}
.home-v2__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}
.home-v2__title {
    margin: 0;
    font-size: 40px;
    line-height: 1.05;
    color: #1e2a56;
}
.home-v2__subtitle {
    margin: 6px 0 0;
    color: #64748b;
    font-size: 16px;
}
.home-v2__date {
    background: #fff;
    border: 1px solid #e3e8f4;
    border-radius: 10px;
    padding: 12px 16px;
    color: #475569;
    font-weight: 600;
    font-size: 15px;
}
.home-v2__kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}
.home-v2__kpi {
    background: #fff;
    border: 1px solid #e3e8f4;
    border-radius: 10px;
    padding: 18px;
}
.home-v2__kpi-label { font-size: 16px; color: #475569; font-weight: 600; }
.home-v2__kpi-value { margin-top: 10px; font-size: 42px; line-height: 1; font-weight: 700; letter-spacing: -0.02em; color: #1e293b; }
.home-v2__kpi-sub { margin-top: 10px; font-size: 14px; color: #64748b; }
.home-v2__kpi-sub.is-up { color: #2563eb; font-weight: 600; }
.home-v2__kpi-sub.is-down { color: #dc2626; font-weight: 600; }

.home-v2__split {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}
.home-v2__card {
    background: #fff;
    border: 1px solid #e3e8f4;
    border-radius: 10px;
    padding: 18px;
}
.home-v2__card--compact { padding: 12px; }
.home-v2__card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.home-v2__card-head h2 {
    margin: 0;
    font-size: 34px;
    color: #1f2a56;
}
.home-v2__card-head a {
    color: #2563eb;
    font-weight: 600;
    text-decoration: none;
}
.home-v2__tabs {
    display: inline-flex;
    border: 1px solid #d8e0f2;
    border-radius: 8px;
    overflow: hidden;
}
.home-v2__tabs a {
    padding: 7px 11px;
    font-size: 12px;
    text-decoration: none;
    color: #475569;
    background: #fff;
}
.home-v2__tabs a.active { background: #2563eb; color: #fff; }
.home-v2__chart-wrap { height: 330px; }
.home-v2__side { display: flex; flex-direction: column; gap: 12px; }
.home-v2__shift-item {
    border: 1px solid #edf1f8;
    border-radius: 8px;
    padding: 8px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.home-v2__shift-user { font-weight: 600; color: #334155; }
.home-v2__shift-time { font-size: 14px; color: #64748b; margin-top: 4px; }
.home-v2__btn-link {
    margin-top: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    border: 1px solid #dce4f4;
    border-radius: 8px;
    padding: 10px 12px;
    text-decoration: none;
    color: #2563eb;
    font-weight: 600;
    font-size: 14px;
}
.home-v2__returns-value {
    font-size: 40px;
    font-weight: 700;
    line-height: 1;
    color: #ef4444;
}
.home-v2__returns-sub { margin: 8px 0 0; font-size: 14px; color: #64748b; }
.home-v2__table td, .home-v2__table th { white-space: nowrap; }
.home-v2__table th { font-size: 13px; }
.home-v2__table td { font-size: 15px; }

/* CRM: Химчистка — список (page-dry-cleaning): узкие экраны, текст и таблица помещаются */
@media (max-width: 1024px) {
    body.page-dry-cleaning .home-v2 {
        padding: 12px;
        min-width: 0;
        max-width: 100%;
        box-sizing: border-box;
    }
    body.page-dry-cleaning .home-v2__head {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    body.page-dry-cleaning .home-v2__date {
        align-self: flex-start;
    }
    body.page-dry-cleaning .home-v2__title {
        font-size: clamp(1.25rem, 4.5vw, 1.65rem);
        line-height: 1.15;
        word-break: break-word;
    }
    body.page-dry-cleaning .home-v2__subtitle {
        font-size: 14px;
        line-height: 1.4;
    }
    body.page-dry-cleaning .home-v2__kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }
    body.page-dry-cleaning .home-v2__kpi {
        padding: 12px 14px;
        min-width: 0;
    }
    body.page-dry-cleaning .home-v2__kpi-label {
        font-size: 13px;
        line-height: 1.3;
    }
    body.page-dry-cleaning .home-v2__kpi-value {
        font-size: clamp(26px, 8vw, 34px);
    }
    body.page-dry-cleaning .home-v2__kpi-sub {
        font-size: 12px;
    }
    body.page-dry-cleaning .home-v2__card-head {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    body.page-dry-cleaning .home-v2__card-head h2 {
        font-size: 1.1rem;
    }
    body.page-dry-cleaning .home-v2__tabs {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        border: none;
        border-radius: 0;
        overflow: visible;
    }
    body.page-dry-cleaning .home-v2__tabs a {
        flex: 1 1 calc(33.333% - 4px);
        min-width: 0;
        text-align: center;
        box-sizing: border-box;
        border: 1px solid #d8e0f2;
        border-radius: 8px;
        padding: 8px 6px;
        font-size: 11px;
    }
    body.page-dry-cleaning .home-v2__table th,
    body.page-dry-cleaning .home-v2__table td {
        white-space: normal;
        word-break: break-word;
        vertical-align: top;
    }
    body.page-dry-cleaning .home-v2__shift-item {
        flex-wrap: wrap;
        gap: 8px;
        min-width: 0;
    }
    body.page-dry-cleaning .home-v2__shift-user {
        word-break: break-word;
        min-width: 0;
    }
    body.page-dry-cleaning .home-v2__mini-card h3 {
        font-size: 1.05rem;
    }
}
@media (max-width: 480px) {
    body.page-dry-cleaning .home-v2__tabs a {
        flex: 1 1 calc(50% - 4px);
    }
}

/* Карточки «Информация о заказе» на просмотре заказа */
.dc-order-info-mini-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}
@media (max-width: 900px) {
    body.page-dry-cleaning-edit .dc-order-info-mini-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 520px) {
    body.page-dry-cleaning-edit .dc-order-info-mini-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1024px) {
    body.page-dry-cleaning-edit .home-v2 {
        padding: 12px;
        min-width: 0;
        max-width: 100%;
        box-sizing: border-box;
    }
    body.page-dry-cleaning-edit .home-v2__title {
        font-size: clamp(1.05rem, 3.8vw, 1.45rem);
        word-break: break-word;
    }
    body.page-dry-cleaning-edit .home-v2__table th,
    body.page-dry-cleaning-edit .home-v2__table td {
        white-space: normal;
        word-break: break-word;
    }
    body.page-dry-cleaning-edit .dc-order-tools {
        width: 100%;
    }
    body.page-dry-cleaning-edit .dc-order-tools > .btn,
    body.page-dry-cleaning-edit .dc-order-tools > a.btn,
    body.page-dry-cleaning-edit .dc-order-tools > span.btn,
    body.page-dry-cleaning-edit .dc-order-tools > form {
        flex: 1 1 auto;
        min-width: 0;
        justify-content: center;
    }
}
@media (max-width: 560px) {
    body.page-dry-cleaning-edit .dc-stepper-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Dry cleaning order page (match CRM reference layout) */
.page-dry-cleaning-edit .home-v2 {
    background: #f8fbff;
    border: 1px solid #e8eef7;
    border-radius: 18px;
    padding: 18px;
}
.home-v2.page-dry-cleaning-order .home-v2__card,
.page-dry-cleaning-edit .home-v2__card {
    border: 1px solid #e7edf7;
    border-radius: 14px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}
.page-dry-cleaning-edit .home-v2__title { font-size: 44px; letter-spacing: -0.02em; line-height: 1.02; }
.page-dry-cleaning-edit .home-v2__card-head h2 { font-size: 34px; color: #172554; }
.dc-status-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.2; }
.dc-status-chip--new { background: #dbeafe; color: #1d4ed8; }
.dc-status-chip--progress { background: #fef3c7; color: #b45309; }
.dc-status-chip--ready { background: #dcfce7; color: #166534; }
.dc-status-chip--delivered { background: #d1fae5; color: #065f46; }
.dc-status-chip--cancelled { background: #fee2e2; color: #991b1b; }
.dc-order-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(360px, 1fr); gap: 16px; }
.dc-order-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.dc-order-head > div:first-child { flex: 1 1 220px; min-width: 0; }
.dc-order-tools {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    flex: 1 1 260px;
}
.dc-save-btn { box-shadow: 0 8px 18px rgba(37, 99, 235, 0.25); }
.dc-save-btn .dc-ico { color: #fff; }
.dc-order-status-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.dc-order-status-actions form { margin: 0; }
.dc-order-status-actions button { width: 100%; border-radius: 12px; padding-top: 10px; padding-bottom: 10px; font-size: 12px; }
.dc-item-row-ready { background: #ecfdf5; }
.dc-section-title { display: flex; align-items: center; gap: 8px; }
.dc-ico { width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; color: #64748b; flex: 0 0 20px; }
.dc-ico svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.dc-ico-lg {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    border-radius: 10px;
    background: #eff6ff;
    color: #2563eb;
}
.dc-ico-lg svg { width: 18px; height: 18px; stroke-width: 2.1; }
.dc-order-head h1 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dc-item-title { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.dc-item-sub { display: flex; align-items: center; gap: 6px; color: #64748b; font-size: 12px; }
.dc-tiny-dot { width: 5px; height: 5px; border-radius: 50%; background: #cbd5e1; }
.dc-history-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px dashed #e2e8f0; }
.dc-history-row:last-child { border-bottom: none; }
.dc-item-ready-btn { display: inline-flex; align-items: center; gap: 6px; border: none; background: transparent; padding: 0; color: #0f172a; font-weight: 600; cursor: pointer; }
.dc-item-ready-btn .dc-ico {
    color: #64748b;
    background: #eef2f7;
    border-radius: 999px;
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
}
.dc-item-ready-btn.is-ready .dc-ico { color: #22c55e; }
.dc-actions-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin-top: 12px;
}
.dc-action-card { display: flex; align-items: center; gap: 10px; padding: 12px 12px; border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; color: #0f172a; text-decoration: none; justify-content: flex-start; }
.dc-action-card:hover { background: #f8fbff; border-color: #d3dff3; }
.dc-action-card .dc-ico {
    color: #2563eb;
    background: #eaf2ff;
    border-radius: 10px;
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
}
.dc-action-card:nth-child(1) .dc-ico { color: #2563eb; background: #eaf2ff; }
.dc-action-card:nth-child(2) .dc-ico { color: #0891b2; background: #ecfeff; }
.dc-action-card:nth-child(3) .dc-ico { color: #7c3aed; background: #f3e8ff; }
.dc-action-card small { display: block; color: #64748b; font-size: 12px; margin-top: 2px; }
.dc-action-card--single { max-width: 420px; width: 100%; justify-content: center; margin: 0 auto; padding: 13px 14px; }
.dc-action-card--disabled { opacity: .55; cursor: not-allowed; }
.dc-action-card--disabled:hover { background: #fff; }
.dc-stepper { position: relative; padding-top: 2px; }
.dc-stepper-track { position: absolute; left: 22px; right: 22px; top: 20px; height: 3px; background: #e7edf6; border-radius: 4px; }
.dc-stepper-track-fill { height: 3px; background: #2563eb; border-radius: 4px; }
.dc-stepper-grid { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.dc-stepper-item { display: flex; flex-direction: column; align-items: center; gap: 6px; text-decoration: none; color: #475569; }
.dc-stepper-item form { margin: 0; }
.dc-stepper-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: 2px solid #cbd5e1;
    background: #fff;
    color: #64748b;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.dc-stepper-btn:hover {
    border-color: #94a3b8;
    color: #475569;
    background: #f8fafc;
}
.dc-stepper-btn svg.dc-stepper-svg,
.dc-stepper-btn .dc-stepper-svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    display: block;
}
.dc-stepper-btn .dc-stepper-svg path,
.dc-stepper-btn .dc-stepper-svg circle {
    vector-effect: non-scaling-stroke;
}
.dc-stepper-item.active .dc-stepper-btn {
    border-color: #2563eb;
    background: #2563eb;
    color: #fff;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}
.dc-stepper-item.active .dc-stepper-btn:hover {
    filter: brightness(1.03);
    color: #fff;
}
.dc-stepper-btn:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 3px;
}
.dc-stepper-label {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-align: center;
    line-height: 1.25;
    max-width: 88px;
}
.dc-stepper-item.active .dc-stepper-label {
    color: #1d4ed8;
}
.dc-history-row-main { display: flex; align-items: center; gap: 8px; }
.dc-history-row-main .dc-ico {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    border-radius: 999px;
    background: #eef2ff;
    color: #2563eb;
}
.dc-order-right { position: sticky; top: 92px; align-self: start; }
.page-dry-cleaning-edit .home-v2__table thead th { color: #6b7280; font-weight: 700; font-size: 12px; text-transform: none; background: #fbfdff; }
.page-dry-cleaning-edit .home-v2__table tbody td { border-top: 1px solid #edf2f8; vertical-align: middle; }
.page-dry-cleaning-edit .home-v2__mini-row { padding: 10px 0; border-bottom: 1px dashed #ebf0f8; font-size: 14px; }
.page-dry-cleaning-edit .home-v2__mini-row:last-child { border-bottom: none; }
.page-dry-cleaning-edit .muted { color: #6b7280; }

/* Dry cleaning — форма нового / редактирования заказа */
.page-dry-cleaning-edit .dc-edit-page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.25rem;
}
.page-dry-cleaning-edit .dc-edit-page-title {
    margin-bottom: 0.35rem;
    letter-spacing: -0.02em;
}
.page-dry-cleaning-edit .dc-edit-page-title__id {
    font-size: 0.65em;
    font-weight: 500;
    color: #94a3b8;
    vertical-align: middle;
}
.page-dry-cleaning-edit .dc-edit-page-meta {
    margin: 0 0 0.25rem;
    font-size: 0.9rem;
    color: #64748b;
}
.page-dry-cleaning-edit .dc-edit-page-meta--dim {
    opacity: 0.92;
    font-size: 0.8125rem;
}
.page-dry-cleaning-edit .dc-edit-flash {
    margin-top: 1rem;
}
.page-dry-cleaning-edit .dc-order-form {
    margin-top: 1.25rem;
    max-width: 920px;
    border: none;
    background: transparent;
    box-shadow: none;
    padding: 0;
}
.page-dry-cleaning-edit .dc-order-form__shell {
    background: linear-gradient(165deg, #ffffff 0%, #f8fafc 52%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 1.5rem 1.5rem 1.25rem;
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.04),
        0 14px 44px -18px rgba(15, 23, 42, 0.14);
}
.page-dry-cleaning-edit .dc-order-form__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem 1.5rem;
}
@media (max-width: 720px) {
    .page-dry-cleaning-edit .dc-order-form__grid {
        grid-template-columns: 1fr;
    }
}
.page-dry-cleaning-edit .dc-field--full {
    grid-column: 1 / -1;
}
.page-dry-cleaning-edit .dc-field__label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.35rem;
    letter-spacing: 0.01em;
}
.page-dry-cleaning-edit .dc-field__sub {
    display: block;
    font-size: 0.75rem;
    color: #94a3b8;
    margin: -0.1rem 0 0.4rem;
}
.page-dry-cleaning-edit .dc-field__hint {
    font-size: 0.75rem;
    color: #64748b;
    margin: 0.5rem 0 0;
    line-height: 1.45;
}
.page-dry-cleaning-edit .dc-field__hint--status {
    min-height: 1.25em;
}
.page-dry-cleaning-edit .dc-field__optional {
    font-weight: 500;
    color: #94a3b8;
}
.page-dry-cleaning-edit .dc-field__input {
    width: 100%;
    padding: 0.65rem 0.95rem;
    font-size: 0.9375rem;
    line-height: 1.45;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    color: #0f172a;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.page-dry-cleaning-edit .dc-field__input:hover {
    border-color: #cbd5e1;
}
.page-dry-cleaning-edit .dc-field__input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}
.page-dry-cleaning-edit .dc-field__input--mono {
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
}
.page-dry-cleaning-edit .dc-field__input--select {
    cursor: pointer;
    max-width: 420px;
}
.page-dry-cleaning-edit .dc-field--full .dc-field__input--select {
    max-width: none;
}
.page-dry-cleaning-edit .dc-field__input--textarea {
    resize: vertical;
    min-height: 5rem;
}
.page-dry-cleaning-edit .dc-client-panel-v2 {
    padding: 18px 18px 16px;
    border: 1px solid #e8eef7;
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.04);
}
.page-dry-cleaning-edit .dc-client-panel-v2__head {
    margin-bottom: 14px;
}
.page-dry-cleaning-edit .dc-client-panel-v2__lead {
    margin: 6px 0 0;
    font-size: 13px;
    line-height: 1.45;
}
.page-dry-cleaning-edit .dc-client-panel-v2__row {
    margin-top: 4px;
}
.page-dry-cleaning-edit .dc-client-balance-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    margin-bottom: 14px;
    border-radius: 14px;
    border: 1px solid #ddd6fe;
    background: linear-gradient(135deg, #f5f3ff 0%, #ffffff 55%);
}
.page-dry-cleaning-edit .dc-client-balance-card__ico {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ede9fe;
    color: #6d28d9;
}
.page-dry-cleaning-edit .dc-client-balance-card__body {
    min-width: 0;
}
.page-dry-cleaning-edit .dc-client-balance-card__label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #64748b;
    margin-bottom: 2px;
}
.page-dry-cleaning-edit .dc-client-balance-card__val {
    display: block;
    font-size: 22px;
    line-height: 1.2;
    color: #5b21b6;
    letter-spacing: -0.02em;
}
.page-dry-cleaning-edit .dc-client-balance-card__meta {
    display: block;
    font-size: 12px;
    margin-top: 4px;
}
.page-dry-cleaning-edit .dc-phone-match-banner[hidden] {
    display: none !important;
}
.page-dry-cleaning-edit .dc-phone-match-banner:not([hidden]) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 12px;
    padding: 12px 14px;
    margin-bottom: 14px;
    border-radius: 14px;
    border: 1px solid #bfdbfe;
    background: linear-gradient(90deg, #eff6ff 0%, #ffffff 100%);
}
.page-dry-cleaning-edit .dc-phone-match-banner__text {
    flex: 1 1 200px;
    min-width: 0;
}
.page-dry-cleaning-edit .dc-phone-match-banner__text strong {
    display: block;
    font-size: 14px;
    color: #0f172a;
}
.page-dry-cleaning-edit .dc-phone-match-banner__text .muted {
    font-size: 13px;
}
.page-dry-cleaning-edit .dc-client-suggest {
    margin-top: 8px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 10px 32px -10px rgba(15, 23, 42, 0.16);
    max-height: 220px;
    overflow: auto;
}
.page-dry-cleaning-edit .dc-client-suggest .dc-suggest-item {
    padding: 10px 12px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.875rem;
}
.page-dry-cleaning-edit .dc-client-suggest .dc-suggest-item:last-child {
    border-bottom: none;
}
.page-dry-cleaning-edit .dc-client-suggest .dc-suggest-item:hover {
    background: linear-gradient(90deg, #eff6ff 0%, #ffffff 100%);
}
.page-dry-cleaning-edit .dc-items-block {
    margin-top: 0.15rem;
}
.page-dry-cleaning-edit .dc-items-block__head {
    margin-bottom: 0.65rem;
}
.page-dry-cleaning-edit .dc-items-block__title {
    margin-bottom: 0;
}
.page-dry-cleaning-edit .dc-items-block__table-wrap {
    border: 1px solid #e2e8f0;
    border-radius: 14px 14px 0 0;
    overflow: hidden;
    background: #fff;
}
.page-dry-cleaning-edit .dc-items-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 12px;
    padding: 10px 12px;
    margin: 0;
    border: 1px solid #e2e8f0;
    border-top: none;
    border-radius: 0 0 14px 14px;
    background: #f8fafc;
}
.page-dry-cleaning-edit .dc-items-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: 1px dashed #93c5fd;
    border-radius: 12px;
    background: #fff;
    color: #1d4ed8;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.page-dry-cleaning-edit .dc-items-add-btn:hover {
    background: #eff6ff;
    border-color: #3b82f6;
    border-style: solid;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.12);
}
.page-dry-cleaning-edit .dc-items-add-btn__ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: #dbeafe;
    color: #2563eb;
}
.page-dry-cleaning-edit .dc-items-add-btn__text {
    line-height: 1.2;
}
.page-dry-cleaning-edit .dc-ref-cert-alert {
    margin: 8px 0 0;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.45;
}
.page-dry-cleaning-edit .dc-ref-cert-alert--error {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #dc2626;
    font-weight: 600;
}
.page-dry-cleaning-edit .dc-order-summary__hint.dc-order-cert-hint--error {
    color: #dc2626;
    font-weight: 600;
}
.page-dry-cleaning-edit #dc-pay-cert-hint.dc-pay-cert-hint--error {
    color: #dc2626 !important;
    font-weight: 600;
}
.page-dry-cleaning-edit .dc-pay-totals-block__row--cert[hidden] {
    display: none !important;
}
.page-dry-cleaning-edit .dc-ref-cert-alert--ok {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}
.page-dry-cleaning-edit .dc-items-block__table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.page-dry-cleaning-edit .dc-items-table {
    min-width: 920px;
}
.page-dry-cleaning-edit .dc-items-table .dc-col-name { min-width: 220px; }
.page-dry-cleaning-edit .dc-items-table .dc-col-qty { width: 96px; }
.page-dry-cleaning-edit .dc-items-table .dc-col-price { width: 110px; }
.page-dry-cleaning-edit .dc-items-table .dc-col-bonus { width: 130px; }
.page-dry-cleaning-edit .dc-items-table .dc-col-disc { width: 100px; }
.page-dry-cleaning-edit .dc-items-table .dc-col-sum { width: 110px; }
.page-dry-cleaning-edit .dc-items-table .dc-col-act { width: 52px; }
.page-dry-cleaning-edit .dc-item-cell-bonus {
    min-width: 120px;
}
.page-dry-cleaning-edit .dc-item-bonus-warn {
    display: block;
    font-size: 0.6875rem;
    line-height: 1.25;
    margin-top: 0.25rem;
    color: #b45309;
}
.page-dry-cleaning-edit .dc-order-bonus-hint {
    margin: 0.5rem 0 0;
    font-size: 0.8125rem;
}
.page-dry-cleaning-edit .dc-items-table thead th {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #64748b;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.65rem 0.85rem;
}
.page-dry-cleaning-edit .dc-items-table tbody td {
    padding: 0.65rem 0.75rem;
    vertical-align: middle;
    border-top: 1px solid #f1f5f9;
}
.page-dry-cleaning-edit .dc-items-table .dc-item-name,
.page-dry-cleaning-edit .dc-items-table .dc-item-qty,
.page-dry-cleaning-edit .dc-items-table .dc-item-price,
.page-dry-cleaning-edit .dc-items-table .dc-item-line-disc,
.page-dry-cleaning-edit .dc-items-table .dc-item-bonus-pts,
.page-dry-cleaning-edit .dc-items-table input[type="text"],
.page-dry-cleaning-edit .dc-items-table input[type="number"] {
    border-radius: 10px;
    padding: 0.5rem 0.75rem;
}
.page-dry-cleaning-edit .dc-items-block__footer {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 12px;
    padding: 0;
}
.page-dry-cleaning-edit .dc-items-block__add {
    border-radius: 10px;
}
.page-dry-cleaning-edit .dc-items-block__total {
    font-weight: 700;
    font-size: 1rem;
    color: #0f172a;
}
.page-dry-cleaning-edit .dc-items-block__total span {
    color: #2563eb;
}
.page-dry-cleaning-edit .dc-order-totals {
    margin-left: auto;
    min-width: 260px;
    max-width: 100%;
    padding: 12px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    text-align: right;
}
.page-dry-cleaning-edit .dc-order-totals__row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    padding: 4px 0;
    font-size: 0.9375rem;
    color: #475569;
}
.page-dry-cleaning-edit .dc-order-totals__row--pay {
    margin-top: 6px;
    padding-top: 10px;
    border-top: 1px solid #e2e8f0;
    font-size: 1.0625rem;
    font-weight: 700;
    color: #0f172a;
}
.page-dry-cleaning-edit .dc-order-totals__row--cert .dc-order-totals__value--discount {
    color: #059669;
    font-weight: 600;
}
.page-dry-cleaning-edit .dc-order-totals__value--pay {
    color: #2563eb;
    font-variant-numeric: tabular-nums;
}
.page-dry-cleaning-edit .dc-order-totals__hint {
    margin: 2px 0 6px;
    font-size: 0.75rem;
    line-height: 1.4;
    text-align: right;
}
.page-dry-cleaning-edit .dc-items-block__footer {
    align-items: flex-start;
}
.page-dry-cleaning-edit .dc-order-form__actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.65rem;
    margin-top: 1.25rem;
    padding-top: 0.25rem;
}
.page-dry-cleaning-edit .dc-order-form__submit {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.26);
}

/* Химчистка — форма заказа v2 (карточка, иконки в полях, зона фото) */
body.page-dry-cleaning-edit {
    background-color: #f1f5f9;
}
.page-dry-cleaning-edit .dc-dry-form-page {
    max-width: 1320px;
    margin: 0 auto;
    padding: 1rem 1rem 2.5rem;
}
.page-dry-cleaning-edit .dc-dry-form-page__toolbar {
    margin-bottom: 0.5rem;
}
.page-dry-cleaning-edit .dc-dry-form-page__toolbar .btn {
    border-radius: 10px;
}
.page-dry-cleaning-edit .dc-dry-form-page .dc-order-form {
    max-width: none;
    width: 100%;
}
.page-dry-cleaning-edit .dc-order-form__shell--v2 {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 1.75rem 1.75rem 1.5rem;
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.04),
        0 18px 48px -20px rgba(15, 23, 42, 0.12);
}
.page-dry-cleaning-edit .dc-order-card__hero {
    margin: 0 0 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid #e8eef5;
}
.page-dry-cleaning-edit .dc-order-card__eyebrow {
    margin: 0 0 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #94a3b8;
}
.page-dry-cleaning-edit .dc-order-card__title {
    margin: 0;
    font-size: 1.625rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #0f172a;
    line-height: 1.2;
}
.page-dry-cleaning-edit .dc-order-card__title-num {
    color: #2563eb;
}
.page-dry-cleaning-edit .dc-order-card__lead {
    margin: 0.5rem 0 0;
    font-size: 0.9375rem;
    line-height: 1.5;
    color: #64748b;
    max-width: 42rem;
}
.page-dry-cleaning-edit .dc-client-section {
    margin: 0 0 0.25rem;
}
.page-dry-cleaning-edit .dc-client-section__title {
    margin: 0 0 1rem;
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
}
.page-dry-cleaning-edit .dc-input-group {
    margin-bottom: 1.15rem;
}
.page-dry-cleaning-edit .dc-input-group__label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.3rem;
}
.page-dry-cleaning-edit .dc-input-group__hint {
    display: block;
    font-size: 0.75rem;
    color: #94a3b8;
    margin: 0 0 0.45rem;
    line-height: 1.4;
}
.page-dry-cleaning-edit .dc-input-group__foot {
    margin-top: 0.45rem;
    font-size: 0.75rem;
    line-height: 1.45;
}
.page-dry-cleaning-edit .dc-input-icon-wrap {
    position: relative;
    display: block;
}
.page-dry-cleaning-edit .dc-input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    pointer-events: none;
    z-index: 1;
}
.page-dry-cleaning-edit .dc-input-icon-wrap__input {
    width: 100%;
    padding: 0.65rem 0.85rem 0.65rem 2.65rem;
    font-size: 0.9375rem;
    line-height: 1.45;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    color: #0f172a;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.page-dry-cleaning-edit .dc-input-icon-wrap__input:hover {
    border-color: #cbd5e1;
}
.page-dry-cleaning-edit .dc-input-icon-wrap__input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}
.page-dry-cleaning-edit .dc-input-icon-wrap__input--mono {
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
}
.page-dry-cleaning-edit .dc-items-section__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
}
.page-dry-cleaning-edit .dc-photo-dropzone {
    border: 2px dashed #cbd5e1;
    border-radius: 14px;
    background: #fafbfc;
    padding: 1.25rem 1rem;
}
.page-dry-cleaning-edit .dc-photo-dropzone__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.65rem;
}
.page-dry-cleaning-edit .dc-photo-dropzone__icon {
    color: #94a3b8;
    line-height: 0;
}
.page-dry-cleaning-edit .dc-photo-dropzone__actions {
    justify-content: center;
    margin-top: 0;
}
.page-dry-cleaning-edit .dc-photo-dropzone .dc-items-photo-add-btn {
    background: transparent;
    border: none;
    color: #2563eb;
    font-weight: 600;
    padding: 0.35rem 0.75rem;
    box-shadow: none;
}
.page-dry-cleaning-edit .dc-photo-dropzone .dc-items-photo-add-btn:hover {
    color: #1d4ed8;
    background: rgba(37, 99, 235, 0.06);
}
.page-dry-cleaning-edit .dc-photo-dropzone__hint {
    display: block;
    width: 100%;
    text-align: center;
    font-size: 0.75rem;
}
.page-dry-cleaning-edit .dc-items-comment-meta {
    position: absolute;
    right: 0.65rem;
    bottom: 0.45rem;
    text-align: right;
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 0;
}
.page-dry-cleaning-edit .dc-field:has(.dc-items-comment-textarea) {
    position: relative;
}
.page-dry-cleaning-edit .dc-items-comment-textarea {
    padding-bottom: 1.75rem;
}
.page-dry-cleaning-edit .dc-order-form__actions--split {
    justify-content: space-between;
    align-items: center;
    width: 100%;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.page-dry-cleaning-edit .dc-order-form__reset {
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #64748b;
    font-weight: 600;
    border-radius: 10px;
    padding: 0.55rem 1.1rem;
}
.page-dry-cleaning-edit .dc-order-form__reset:hover {
    border-color: #cbd5e1;
    color: #475569;
    background: #f8fafc;
}
.page-dry-cleaning-edit .dc-item-remove__ico {
    font-size: 1rem;
    line-height: 1;
    filter: grayscale(0.2);
}
.page-dry-cleaning-edit .dc-item-remove:hover .dc-item-remove__ico {
    filter: none;
}
.page-dry-cleaning-edit .dc-item-remove:hover {
    color: #dc2626;
    border-color: #fecaca;
    background: #fef2f2;
}
.page-dry-cleaning-edit .dc-status-row {
    margin-top: 0.5rem;
    margin-bottom: 0.25rem;
}

/* Новый заказ — карточки как в макете */
.page-dry-cleaning-edit .dc-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.9375rem;
    font-weight: 500;
    color: #64748b;
    text-decoration: none;
    padding: 0.35rem 0;
}
.page-dry-cleaning-edit .dc-back-link:hover {
    color: #2563eb;
}
.page-dry-cleaning-edit .dc-order-form__shell--cards {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
}
.page-dry-cleaning-edit .dc-order-page-head {
    margin: 0 0 1.25rem;
    padding: 0;
    border: none;
}
.page-dry-cleaning-edit .dc-order-page-head__title {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #0f172a;
    line-height: 1.2;
}
.page-dry-cleaning-edit .dc-order-page-head__lead {
    margin: 0.4rem 0 0;
    font-size: 0.9375rem;
    color: #64748b;
    line-height: 1.5;
}
.page-dry-cleaning-edit .dc-form-card {
    background: #fff;
    border: 1px solid #e8eef5;
    border-radius: 12px;
    padding: 1.25rem 1.35rem 1.35rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.page-dry-cleaning-edit .dc-form-card__title {
    margin: 0 0 1rem;
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
}
.page-dry-cleaning-edit .dc-form-card__row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem 1.25rem;
}
@media (max-width: 640px) {
    .page-dry-cleaning-edit .dc-form-card__row-2 {
        grid-template-columns: 1fr;
    }
}
.page-dry-cleaning-edit .dc-form-card--existing .dc-input-group {
    margin-bottom: 1rem;
}
.page-dry-cleaning-edit .dc-form-card--existing .dc-input-group:last-child {
    margin-bottom: 0;
}
.page-dry-cleaning-edit .dc-items-block__table-wrap {
    border: 1px solid #e8eef5;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 0.85rem;
}
.page-dry-cleaning-edit .dc-items-table thead th {
    background: #f8fafc;
    font-size: 0.6875rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #64748b;
    border-bottom: 1px solid #e2e8f0;
}
.page-dry-cleaning-edit .dc-items-block .dc-items-block__footer {
    margin-bottom: 1rem;
}
.page-dry-cleaning-edit .dc-items-block__add-link {
    border: none;
    background: none;
    padding: 0;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #2563eb;
    cursor: pointer;
}
.page-dry-cleaning-edit .dc-items-block__add-link:hover {
    color: #1d4ed8;
    text-decoration: underline;
}
.page-dry-cleaning-edit .dc-max-discount-btn {
    border-radius: 8px;
    font-weight: 600;
}
.page-dry-cleaning-edit .dc-order-summary {
    margin-left: auto;
    min-width: 280px;
    max-width: 360px;
    padding: 1rem 1.15rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}
@media (max-width: 900px) {
    .page-dry-cleaning-edit .dc-items-block__footer {
        flex-direction: column;
        align-items: stretch;
    }
    .page-dry-cleaning-edit .dc-order-summary {
        margin-left: 0;
        max-width: none;
        width: 100%;
    }
}
.page-dry-cleaning-edit .dc-order-summary__row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    padding: 0.35rem 0;
    font-size: 0.9375rem;
}
.page-dry-cleaning-edit .dc-order-summary__row--pay {
    margin-top: 0.5rem;
    padding-top: 0.65rem;
    border-top: 1px solid #e2e8f0;
    font-weight: 700;
    font-size: 1rem;
}
.page-dry-cleaning-edit .dc-order-summary__value--discount {
    color: #b45309;
    font-weight: 600;
}
.page-dry-cleaning-edit .dc-order-summary__value--pay {
    color: #0f172a;
    font-size: 1.125rem;
}
.page-dry-cleaning-edit .dc-order-summary__hint {
    margin: 0.15rem 0 0.35rem;
    font-size: 0.75rem;
}
.page-dry-cleaning-edit .dc-item-discounts {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 8px;
    align-items: center;
}
.page-dry-cleaning-edit .dc-item-discounts__field {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.page-dry-cleaning-edit .dc-item-discounts__lbl {
    font-size: 0.6875rem;
    font-weight: 600;
    color: #94a3b8;
    min-width: 2rem;
}
.page-dry-cleaning-edit .dc-item-discounts__field input {
    width: 52px;
    padding: 6px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.8125rem;
}
.page-dry-cleaning-edit .dc-item-cell-discounts {
    min-width: 130px;
}
.page-dry-cleaning-edit .dc-photo-attach__label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 0;
    font-size: 0.9375rem;
    color: #2563eb;
    cursor: pointer;
    font-weight: 500;
}
.page-dry-cleaning-edit .dc-photo-attach .dc-items-photo-file-native {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}
.page-dry-cleaning-edit .dc-order-form__submit-arrow {
    margin-left: 0.35rem;
    font-weight: 400;
}

.page-dry-cleaning-edit .dc-items-photo-field {
    padding-top: 0.25rem;
}
.page-dry-cleaning-edit .dc-items-photo-field__row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
    margin-top: 0.5rem;
}
.page-dry-cleaning-edit .dc-items-photo-file-native {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.page-dry-cleaning-edit .dc-items-photo-browse-btn {
    cursor: pointer;
    margin: 0;
}
.page-dry-cleaning-edit .dc-items-photo-add-btn {
    cursor: pointer;
    margin: 0;
    background: linear-gradient(180deg, #22c55e, #16a34a);
    color: #fff !important;
    border: 1px solid #16a34a;
    box-shadow: 0 6px 16px rgba(22, 163, 74, 0.28);
    font-weight: 600;
}
.page-dry-cleaning-edit .dc-items-photo-add-btn:hover {
    filter: brightness(0.98);
}
.page-dry-cleaning-edit .dc-dry-photo-gallery {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 14px 18px;
    margin-top: 12px;
}
.page-dry-cleaning-edit .dc-new-photos-row {
    display: contents;
}
.page-dry-cleaning-edit .dc-photo-slot {
    position: relative;
    flex: 0 0 auto;
    width: 120px;
    text-align: center;
}
.page-dry-cleaning-edit .dc-photo-slot__btn {
    display: block;
    width: 100%;
    padding: 0;
    margin: 0;
    border: none;
    background: transparent;
    border-radius: 12px;
    cursor: zoom-in;
    line-height: 0;
}
.page-dry-cleaning-edit .dc-photo-slot__btn:focus-visible {
    outline: 2px solid #22c55e;
    outline-offset: 2px;
}
.page-dry-cleaning-edit .dc-photo-slot__caption {
    margin-top: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
}
.page-dry-cleaning-edit .dc-photo-slot__remove {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 26px;
    height: 26px;
    border-radius: 999px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #64748b;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}
.page-dry-cleaning-edit .dc-photo-slot__remove:hover {
    background: #fef2f2;
    color: #b91c1c;
    border-color: #fecaca;
}
.page-dry-cleaning-edit .dc-photo-slot__zoom {
    display: none;
    position: absolute;
    left: 50%;
    bottom: calc(100% + 10px);
    transform: translateX(-50%);
    z-index: 40;
    padding: 8px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
    pointer-events: none;
    max-width: min(360px, 85vw);
}
.page-dry-cleaning-edit .dc-photo-slot__zoom img {
    display: block;
    max-width: min(340px, 80vw);
    max-height: 70vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
}
.page-dry-cleaning-edit .dc-photo-slot:hover .dc-photo-slot__zoom {
    display: block;
}
.page-dry-cleaning-edit .dc-photo-slot--view .dc-photo-slot__remove {
    display: none;
}
.page-dry-cleaning-edit .dc-client-booking-photos-wrap {
    margin-top: 0.35rem;
    padding-top: 0.5rem;
    border-top: 1px dashed #e2e8f0;
}
.page-dry-cleaning-edit .dc-client-booking-photo-group {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eef2f8;
}
.page-dry-cleaning-edit .dc-client-booking-photo-group:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}
.page-dry-cleaning-edit .dc-client-booking-photo-group__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 0.75rem;
    margin-bottom: 0.35rem;
}
.page-dry-cleaning-edit .dc-client-booking-photo-group__title {
    font-size: 13px;
    font-weight: 700;
    color: #334155;
}
.page-dry-cleaning-edit .dc-client-booking-photo-group__link {
    font-size: 13px;
    font-weight: 600;
    color: #2563eb;
    text-decoration: none;
}
.page-dry-cleaning-edit .dc-client-booking-photo-group__link:hover {
    text-decoration: underline;
}
.page-dry-cleaning-edit .dc-dry-photo-gallery--nested {
    margin-top: 0.35rem;
    gap: 10px 12px;
}
.page-dry-cleaning-edit .dc-dry-photo-gallery--nested .dc-photo-slot {
    width: 100px;
}
.page-dry-cleaning-edit .dc-dry-photo-gallery--nested .dc-items-photo-view-thumb {
    width: 100px;
    height: 100px;
    object-fit: cover;
}
.page-dry-cleaning-edit .dc-dry-photo-lightbox:not([hidden]) {
    position: fixed;
    inset: 0;
    z-index: 8000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.page-dry-cleaning-edit .dc-dry-photo-lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.72);
    cursor: pointer;
}
.page-dry-cleaning-edit .dc-dry-photo-lightbox__frame {
    position: relative;
    z-index: 1;
    max-width: min(96vw, 1200px);
    max-height: 92vh;
}
.page-dry-cleaning-edit .dc-dry-photo-lightbox__img {
    display: block;
    max-width: min(96vw, 1200px);
    max-height: 88vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}
.page-dry-cleaning-edit .dc-dry-photo-lightbox__close {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: none;
    background: #fff;
    color: #0f172a;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.2);
}
.page-dry-cleaning-edit .dc-items-photo-view-thumb {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    object-fit: cover;
}
.page-dry-cleaning-edit .dc-items-photo-view-link {
    display: inline-block;
    line-height: 0;
    border-radius: 12px;
    overflow: hidden;
}
.page-dry-cleaning-edit .dc-items-photo-preview-wrap img {
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

/* Dry cleaning: payment modal */
.dc-pay-btn {
    background: linear-gradient(180deg, #22c55e, #16a34a);
    color: #fff !important;
    border: 1px solid #16a34a;
    box-shadow: 0 8px 18px rgba(22, 163, 74, 0.28);
}
.dc-pay-btn:hover { filter: brightness(.98); }
.dc-pay-btn .dc-ico { color: #fff; }
.dc-pay-modal:not([hidden]) {
    position: fixed;
    inset: 0;
    z-index: 7000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
}
.dc-pay-dialog {
    width: 100%;
    max-width: 560px;
    background: #fff;
    border: 1px solid #e7edf7;
    border-radius: 20px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
    overflow: hidden;
}
.dc-pay-dialog__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 18px 10px;
    border-bottom: 1px solid #eef2f8;
    background: linear-gradient(180deg, #fbfdff, #fff);
}
.dc-pay-kicker { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #64748b; }
.dc-pay-title { margin: 6px 0 6px; font-size: 22px; line-height: 1.15; color: #0f172a; }
.dc-pay-sub { margin: 0; font-size: 13px; color: #64748b; line-height: 1.45; max-width: 42rem; }
.dc-pay-close {
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #64748b;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}
.dc-pay-close:hover { background: #f8fafc; color: #0f172a; }
.dc-pay-form { padding: 16px 20px 20px; }
.dc-pay-summary {
    background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
    border-color: #e2e8f0;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset;
}
.dc-pay-discount-notice {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 0 0 16px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    color: #1e3a8a;
}
.dc-pay-discount-notice[hidden] {
    display: none !important;
}
.dc-pay-discount-notice--cert {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #1e3a8a;
}
.dc-pay-discount-notice--cert .dc-pay-discount-notice__ico {
    color: #2563eb;
    background: rgba(37, 99, 235, 0.12);
}
.dc-pay-discount-notice--bonus {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}
.dc-pay-discount-notice--bonus .dc-pay-discount-notice__ico {
    color: #16a34a;
    background: rgba(22, 163, 74, 0.12);
}
.dc-pay-discount-notice__ico {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.dc-pay-discount-notice__body {
    min-width: 0;
}
.dc-pay-discount-notice__title {
    display: block;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
    margin: 0 0 4px;
}
.dc-pay-discount-notice__text {
    margin: 0;
    font-size: 13px;
    line-height: 1.45;
    opacity: 0.95;
}
.dc-pay-modular {
    margin-bottom: 16px;
    border-radius: 16px;
    border: 1px solid #e8eef7;
    background: #fafbff;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}
.dc-pay-mod-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    padding: 6px;
    background: #eef2ff;
    border-bottom: 1px solid #e2e8f0;
}
.dc-pay-mod-tab {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: none;
    border-radius: 12px;
    background: transparent;
    color: #475569;
    cursor: pointer;
    text-align: left;
    font: inherit;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.dc-pay-mod-tab:hover {
    background: rgba(255, 255, 255, 0.55);
    color: #0f172a;
}
.dc-pay-mod-tab.is-active {
    background: #fff;
    color: #0f172a;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}
.dc-pay-mod-tab:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}
.dc-pay-mod-tab__ico {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    color: #6366f1;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}
.dc-pay-mod-tab.is-active .dc-pay-mod-tab__ico {
    background: linear-gradient(145deg, #eef2ff, #fff);
    color: #4f46e5;
}
.dc-pay-mod-tab[data-dc-tab="cert"] .dc-pay-mod-tab__ico {
    color: #b45309;
}
.dc-pay-mod-tab[data-dc-tab="cert"].is-active .dc-pay-mod-tab__ico {
    background: linear-gradient(145deg, #fff7ed, #fff);
    color: #c2410c;
}
.dc-pay-mod-tab__text { min-width: 0; }
.dc-pay-mod-tab__title {
    display: block;
    font-weight: 700;
    font-size: 14px;
    line-height: 1.2;
    color: inherit;
}
.dc-pay-mod-tab__hint {
    display: block;
    font-size: 11px;
    color: #94a3b8;
    margin-top: 2px;
    line-height: 1.25;
}
.dc-pay-mod-tab.is-active .dc-pay-mod-tab__hint {
    color: #64748b;
}
.dc-pay-mod-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #475569;
    background: #f1f5f9;
    border-bottom: 1px solid #e2e8f0;
}
.dc-pay-mod-heading__ico {
    display: inline-flex;
    color: #6366f1;
}
.dc-pay-mod-heading--cert .dc-pay-mod-heading__ico {
    color: #c2410c;
}
.dc-pay-mod-heading--bonus .dc-pay-mod-heading__ico {
    color: #7c3aed;
}
.dc-pay-mod-panels {
    padding: 14px 14px 16px;
}
.dc-pay-bonus-actions-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.dc-pay-bonus__input--grow {
    flex: 1 1 140px;
    min-width: 0;
    width: auto;
    max-width: 100%;
}
.dc-pay-bonus-side-btn {
    flex: 0 0 auto;
    white-space: nowrap;
    padding-left: 14px;
    padding-right: 14px;
}
.dc-pay-cert-actions-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.dc-pay-cert-apply-btn {
    flex: 0 0 auto;
    white-space: nowrap;
    padding-left: 16px;
    padding-right: 16px;
}
.dc-pay-mod-panel--bonus .dc-pay-bonus__balance strong { color: #7c3aed; }
.dc-pay-mod-panel--cert .dc-pay-bonus__input { font-variant-numeric: tabular-nums; }
.dc-pay-methods-kicker {
    margin: 0 0 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #94a3b8;
}
.dc-pay-totals-block {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 14px;
    margin-bottom: 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}
.dc-pay-totals-block__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 14px;
}
.dc-pay-totals-block__row--cert .dc-pay-totals-block__discount {
    color: #b45309;
    font-weight: 700;
}
.dc-pay-totals-block__row--pay {
    padding-top: 8px;
    margin-top: 2px;
    border-top: 1px solid #e2e8f0;
    font-weight: 600;
    color: #0f172a;
}
.dc-pay-totals-block__row--pay .dc-pay-total__val {
    font-size: 20px;
    color: #0f172a;
    letter-spacing: -0.01em;
}
.dc-pay-total {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 12px;
    border: 1px solid #e8eef7;
    border-radius: 12px;
    background: #f8fbff;
    margin-bottom: 12px;
}
.dc-pay-total__val { font-size: 20px; color: #0f172a; letter-spacing: -0.01em; }
.dc-pay-bonus {
    padding: 12px 12px;
    margin-bottom: 12px;
    border: 1px solid #e8eef7;
    border-radius: 12px;
    background: #fafbff;
}
.dc-pay-bonus__title { font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: #64748b; margin-bottom: 8px; }
.dc-pay-bonus__balance { font-size: 14px; color: #0f172a; margin-bottom: 4px; }
.dc-pay-bonus__balance strong { color: #7c3aed; }
.dc-pay-bonus__hint { font-size: 12px; line-height: 1.45; margin: 0; }
.dc-pay-bonus__label { display: block; font-size: 12px; font-weight: 600; color: #64748b; margin: 10px 0 6px; }
.dc-pay-bonus__input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 15px;
    background: #fff;
}
.dc-pay-bonus__input:focus { outline: none; border-color: #93c5fd; box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12); }
.dc-pay-methods { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.dc-pay-method {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #fff;
    cursor: pointer;
    user-select: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease;
}
.dc-pay-method:hover { border-color: #cbd5e1; box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06); }
.dc-pay-method.is-active {
    border-color: #2563eb;
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.14);
}
.dc-pay-method input { position: absolute; opacity: 0; pointer-events: none; }
.dc-pay-method__icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.dc-pay-method__icon svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.dc-pay-method__icon--cash { color: #16a34a; background: #ecfdf5; }
.dc-pay-method__icon--card { color: #2563eb; background: #eff6ff; }
.dc-pay-method__icon--mixed { color: #7c3aed; background: #f5f3ff; }
.dc-pay-method__title { display: block; font-weight: 700; color: #0f172a; font-size: 14px; }
.dc-pay-method__hint { display: block; font-size: 12px; color: #64748b; margin-top: 2px; line-height: 1.35; }
/* [hidden] must win: bare .dc-pay-mixed { display: grid } overrides UA [hidden] otherwise */
.dc-pay-mixed[hidden] {
    display: none !important;
}
.dc-pay-mixed:not([hidden]) {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}
.dc-pay-field label { display: block; font-size: 12px; font-weight: 600; color: #64748b; margin-bottom: 6px; }
.dc-pay-field input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 14px;
    background: #fff;
}
.dc-pay-field input:focus { outline: none; border-color: #93c5fd; box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12); }
.dc-pay-mixed-hint { margin: 0; grid-column: 1 / -1; font-size: 12px; }
.dc-pay-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 4px; }
.dc-pay-submit { min-width: 140px; }
@media (max-width: 640px) {
    .dc-pay-methods { grid-template-columns: 1fr; }
    .dc-pay-mixed:not([hidden]) { grid-template-columns: 1fr; }
    .dc-pay-mod-tabs { grid-template-columns: 1fr; }
}

.dc-item-name,
.dc-item-qty,
.dc-item-price,
#dc-items-table input[type="text"],
#dc-items-table input[type="number"] {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
}
.dc-suggest {
    position: fixed;
    z-index: 5000;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
    max-height: 220px;
    overflow: auto;
}
.dc-suggest-item { padding: 8px 10px; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 10px; white-space: nowrap; }
.dc-suggest-item .dc-sg-name { overflow: hidden; text-overflow: ellipsis; }
.dc-suggest-item .dc-sg-price { color: #1e40af; font-weight: 600; flex-shrink: 0; }
.dc-suggest-item:hover { background: #eef2ff; }

@media (max-width: 1080px) {
    .dc-order-grid { grid-template-columns: 1fr; }
    .dc-order-status-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dc-order-right { position: static; }
    .page-dry-cleaning-edit .home-v2__title { font-size: 34px; }
}
@media (max-width: 760px) {
    .dc-actions-row { grid-template-columns: 1fr; }
}

.home-v2__bottom {
    margin-top: 12px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}
.home-v2__mini-card {
    background: #fff;
    border: 1px solid #e3e8f4;
    border-radius: 10px;
    padding: 16px;
}
.home-v2__mini-card h3 { margin: 0 0 10px; font-size: 26px; color: #1f2a56; }
.home-v2__mini-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 0;
    font-size: 15px;
}

@media (max-width: 1200px) {
    .home-v2__kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .home-v2__split { grid-template-columns: 1fr; }
    .home-v2__bottom { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
    .home-v2__kpis,
    .home-v2__bottom { grid-template-columns: 1fr; }
}

.mock-dashboard-shell {
    background: #f4f7fc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

.mock-metrics {
    padding: 18px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}
.mock-metric-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 18px 16px 16px;
    min-height: 132px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.mock-metric-kicker {
    color: #64748b;
    font-weight: 500;
    margin-bottom: 10px;
    font-size: 15px;
    line-height: 1.2;
}
.mock-metric-main {
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}
.mock-metric-main--inline {
    align-items: baseline;
    gap: 8px;
}
.mock-metric-num {
    font-size: 40px;
    line-height: 1;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
}
.mock-metric-currency {
    font-size: 22px;
    font-weight: 600;
    color: #64748b;
}
.mock-metric-suffix {
    font-size: 22px;
    font-weight: 500;
    color: #475569;
}
.mock-metric-delta {
    margin-top: auto;
    padding-top: 8px;
    font-size: 14px;
    font-weight: 600;
}
.mock-metric-delta.is-up { color: #16a34a; }
.mock-metric-delta.is-down { color: #dc2626; }
.mock-metric-row2 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    color: #64748b;
    font-size: 14px;
}
.mock-metric-mini-icon {
    color: #94a3b8;
    display: flex;
    flex-shrink: 0;
}
.mock-metric-subline { font-weight: 500; color: #64748b; }
.mock-metric-foot {
    margin-top: auto;
    padding-top: 8px;
    font-size: 14px;
    color: #64748b;
}
.mock-metric-foot.muted-foot strong { color: #334155; font-weight: 600; }

.mock-panel {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin: 0 18px 18px;
    padding: 14px 16px;
}
.mock-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}
.mock-panel-head h2 {
    margin: 0;
    font-size: 31px;
    color: #334155;
}
.mock-panel-sub {
    margin: 4px 0 0;
    font-size: 13px;
    color: #64748b;
    font-weight: 400;
}
.mock-order-link {
    color: #2563eb;
    font-weight: 600;
    text-decoration: none;
}
.mock-order-link:hover { text-decoration: underline; }
.mock-orders-empty {
    text-align: center;
    color: #64748b;
    padding: 20px !important;
}
.mock-panel-head a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
}
.mock-tabs { display: inline-flex; border: 1px solid #d5deea; border-radius: 8px; overflow: hidden; }
.mock-tabs button,
.mock-tabs a {
    border: 0;
    background: #fff;
    padding: 8px 13px;
    font-size: 13px;
    color: #475569;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    line-height: 1.3;
}
.mock-tabs button.active,
.mock-tabs a.active { background: #2f6de8; color: #fff; }
.mock-tabs a:hover:not(.active) { background: #f1f5f9; }

.mock-orders td, .mock-orders th { font-size: 14px; }
.mock-client { display: flex; align-items: center; gap: 8px; }
.mock-client-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #334155;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.mock-order-status {
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 9px;
    color: #fff;
}
.mock-order-status.new { background: #2563eb; }
.mock-order-status.work { background: #f59e0b; }
.mock-order-status.done { background: #22c55e; }

/* Table */
.table-wrap { overflow-x: auto; border-radius: 10px; border: 1px solid #e5e7eb; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: 14px 18px; text-align: left; border-bottom: 1px solid #f3f4f6; }
.data-table tr:last-child td { border-bottom: none; }
.data-table th { font-size: 12px; font-weight: 600; color: #6b7280; text-transform: uppercase; letter-spacing: 0.03em; background: #fafafa; }
.data-table td { font-size: 14px; color: #374151; }
.data-table a { color: var(--primary); text-decoration: none; }
.data-table a:hover { text-decoration: underline; }
/* Ссылки-кнопки: иначе .data-table a перекрашивает текст в primary и он сливается с фоном .btn-primary */
.data-table a.btn { text-decoration: none; }
.data-table a.btn:hover { text-decoration: none; opacity: 0.95; }
.data-table a.btn-primary {
    color: var(--primary-foreground) !important;
}
/* Не комбинировать с btn-ghost: иначе фон прозрачный, а текст остаётся primary-foreground */
.data-table a.btn-primary.btn-ghost,
.data-table a.btn-ghost.btn-primary {
    background: var(--primary) !important;
    color: var(--primary-foreground) !important;
}
.data-table a.btn-secondary {
    background: var(--muted) !important;
    color: var(--foreground) !important;
}

/* Товары: итого закуп / продажа */
.products-summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}
.products-stat-card {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 18px;
    border-radius: 14px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid rgba(226, 232, 240, 0.95);
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.04),
        0 8px 24px -12px rgba(15, 23, 42, 0.08);
    overflow: hidden;
}
.products-stat-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    border-radius: 4px 0 0 4px;
}
.products-stat-card--buy::before {
    background: linear-gradient(180deg, #6366f1 0%, #4f46e5 100%);
}
.products-stat-card--sell::before {
    background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
}
.products-stat-card__icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    color: #4f46e5;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(79, 70, 229, 0.08) 100%);
}
.products-stat-card--sell .products-stat-card__icon {
    color: #16a34a;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.14) 0%, rgba(22, 163, 74, 0.08) 100%);
}
.products-stat-card__body {
    flex: 1;
    min-width: 0;
}
.products-stat-card__label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #64748b;
    margin-bottom: 6px;
    line-height: 1.3;
}
.products-stat-card__row {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px 8px;
}
.products-stat-card__value {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #0f172a;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}
.products-stat-card__currency {
    font-size: 1rem;
    font-weight: 600;
    color: #64748b;
}

/* Деньги — панель редактирования записи (современный UI) */
.money-edit-panel {
    position: relative;
    max-width: 880px;
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(37, 99, 235, 0.2);
    background: linear-gradient(165deg, rgba(37, 99, 235, 0.06) 0%, var(--card) 42%, var(--card) 100%);
    box-shadow:
        0 4px 24px rgba(15, 23, 42, 0.08),
        0 1px 3px rgba(15, 23, 42, 0.04);
}
.money-edit-panel::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, #60a5fa 0%, var(--primary) 45%, #1e40af 100%);
    border-radius: 14px 0 0 14px;
}
.money-edit-panel__inner {
    padding: 22px 28px 26px 32px;
}
.money-edit-panel__top {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px 20px;
    margin-bottom: 4px;
}
.money-edit-panel__badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 11px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--primary);
    background: rgba(37, 99, 235, 0.12);
    border-radius: 999px;
}
.money-edit-panel__title {
    margin: 8px 0 0;
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--foreground);
    line-height: 1.25;
}
.money-edit-panel__hint {
    margin: 14px 0 0;
    font-size: 14px;
    line-height: 1.55;
    color: var(--muted-foreground);
    padding: 12px 14px;
    background: rgba(15, 23, 42, 0.035);
    border-radius: 12px;
    border: 1px solid var(--border);
}
.money-edit-panel__form {
    margin-top: 18px;
}
.money-edit-panel__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
    gap: 16px 20px;
    align-items: start;
}
.money-edit-panel__field--amount {
    max-width: 200px;
}
.money-edit-panel__field--wide {
    grid-column: 1 / -1;
}
.money-edit-panel__field label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #475569;
}
.money-edit-panel__field input,
.money-edit-panel__field select {
    width: 100%;
    padding: 11px 14px;
    font-size: 15px;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    background: var(--card);
    color: var(--foreground);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.money-edit-panel__field input:focus,
.money-edit-panel__field select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}
.money-edit-panel__field input::placeholder {
    color: #94a3b8;
}
.money-edit-panel__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}
.money-edit-panel__actions .btn {
    min-height: 42px;
    padding-left: 22px;
    padding-right: 22px;
    border-radius: 12px;
    font-weight: 600;
}
@media (max-width: 520px) {
    .money-edit-panel__inner {
        padding: 18px 16px 22px 24px;
    }
    .money-edit-panel__field--amount {
        max-width: none;
    }
}

/* Forms */
.form-card label { display: block; margin-bottom: 4px; font-weight: 500; font-size: 14px; }
.form-card input, .form-card select { width: 100%; max-width: 400px; padding: 10px 14px; margin-bottom: 16px; border: 2px solid var(--border); border-radius: var(--radius); font-size: 15px; }
.form-card input:focus, .form-card select:focus { outline: none; border-color: var(--primary); }
.form-actions { margin-top: 24px; display: flex; gap: 12px; }
.filters-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 24px; }
.filters-row input, .filters-row select { padding: 8px 12px; border: 2px solid var(--border); border-radius: 12px; font-size: 14px; }

/* Блок выбора периода и типа — чистый, приятный для глаз */
.period-type-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 24px 32px;
    padding: 28px 28px 32px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.period-type-filter .filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.period-type-filter .filter-group label {
    font-size: 13px;
    font-weight: 500;
    color: #374151;
}
.period-type-filter input[type="date"],
.period-type-filter input[type="text"],
.period-type-filter select {
    min-height: 44px;
    padding: 10px 14px 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    color: #111827;
    transition: border-color 0.2s, box-shadow 0.15s;
}
.period-type-filter input[type="date"]:hover,
.period-type-filter input[type="text"]:hover,
.period-type-filter select:hover {
    border-color: #9ca3af;
}
.period-type-filter input[type="date"]:focus,
.period-type-filter input[type="text"]:focus,
.period-type-filter select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.period-type-filter input[type="date"],
.period-type-filter input[type="text"] {
    min-width: 170px;
}
.period-type-filter select {
    min-width: 170px;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}
.period-type-filter .btn {
    min-height: 44px;
    padding: 11px 24px;
    font-weight: 500;
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.period-type-filter .btn.btn-primary {
    background: var(--primary);
    border: none;
}
.period-type-filter .btn.btn-primary:hover {
    filter: brightness(1.04);
}

/* Фильтр списка — в формате как на странице «Продажи» (карточка, два ряда полей, кнопка Показать) */
.list-filter-form .list-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}
.list-filter-form .list-filter-label {
    display: block;
    min-width: 140px;
    font-weight: 500;
    font-size: 14px;
    color: #374151;
}
.list-filter-form .list-filter-input,
.list-filter-form .list-filter-select {
    display: block;
    margin-top: 4px;
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    min-width: 140px;
    background: #fff;
}
.list-filter-form .list-filter-select { min-width: 160px; }
.list-filter-form .list-filter-actions {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding-bottom: 2px;
}
.list-filter-form .list-filter-actions .btn { margin: 0; }

/* Инвентаризация — устаревшие стили панели (оставлены для совместимости) */
.inventory-page-header {
    margin-bottom: 20px;
}
.inventory-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 20px;
    margin-bottom: 0;
}
.inventory-toolbar .inventory-title {
    font-size: 1.35rem;
    font-weight: 600;
    margin: 0;
    color: #111827;
}
.inventory-toolbar .btn { margin: 0; }
.inventory-search-form {
    display: flex;
    align-items: center;
    margin-left: auto;
    flex: 1;
    min-width: 200px;
    max-width: 320px;
}
.inventory-search-label {
    display: flex;
    align-items: center;
    width: 100%;
    position: relative;
    margin: 0;
}
.inventory-search-icon {
    position: absolute;
    left: 12px;
    font-size: 14px;
    opacity: 0.6;
    pointer-events: none;
}
.inventory-search-input {
    width: 100%;
    min-height: 38px;
    padding: 8px 14px 8px 36px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
}
.inventory-search-input:focus {
    outline: none;
    border-color: var(--primary, #2563eb);
}

/* Панель фильтра — серый блок, кнопки слева */
.inventory-filter-panel {
    margin-top: 14px;
    padding: 18px 20px;
    background: #eef0f2;
    border: 1px solid #e0e2e5;
    border-radius: 10px;
    overflow: hidden;
}
.inventory-filter-panel .inventory-filter-form {
    padding: 0;
}
.filter-panel-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    flex-wrap: wrap;
}
.filter-actions-col {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-shrink: 0;
}
.filter-actions-col .filter-btn-find {
    background: #22c55e;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
}
.filter-actions-col .filter-btn-find:hover {
    background: #16a34a;
}
.filter-actions-col .filter-btn-clear {
    background: #d1d5db;
    color: #374151;
    border: none;
}
.filter-fields-col {
    flex: 1;
    min-width: 0;
}
.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 20px;
    align-items: flex-end;
}
.filter-row + .filter-row { margin-top: 14px; }
.inventory-filter-panel .filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 140px;
    max-width: 220px;
}
.inventory-filter-panel .filter-label {
    font-size: 12px;
    font-weight: 500;
    color: #4b5563;
}
.inventory-filter-panel .filter-group input[type="date"],
.inventory-filter-panel .filter-group input[type="text"],
.inventory-filter-panel .filter-group select {
    width: 100%;
    min-height: 36px;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    background: #fff;
    color: #111827;
}
.inventory-filter-panel .filter-group input:focus,
.inventory-filter-panel .filter-group select:focus {
    outline: none;
    border-color: var(--primary, #2563eb);
}
.inventory-filter-panel .filter-group .filter-readonly {
    background: #e5e7eb;
    color: #6b7280;
    cursor: default;
}
.inventory-filter-panel .filter-group .filter-dates {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.inventory-filter-panel .filter-date-sep {
    color: #6b7280;
    font-size: 13px;
}
.inventory-list-footer {
    margin-top: 20px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-wrap: wrap;
    gap: 24px 32px;
    align-items: center;
    font-size: 15px;
}
.inventory-list-footer .footer-stat {
    display: flex;
    align-items: baseline;
    gap: 8px;
}
.inventory-list-footer .footer-stat .footer-label {
    color: #64748b;
    font-weight: 500;
}
.inventory-list-footer .footer-stat .footer-value {
    font-weight: 700;
    color: #0f172a;
    font-variant-numeric: tabular-nums;
}

/* Order create rows */
.order-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.order-row .product-select { flex: 1; min-width: 200px; }
.order-row .qty-input { width: 80px; }
.order-row .price-input { width: 100px; }

/* Приемка — светлый стиль как в референсе */
body.receiving-create-page {
    background:
        radial-gradient(circle at 18% 0%, rgba(96, 165, 250, 0.18), transparent 34%),
        radial-gradient(circle at 88% 8%, rgba(14, 165, 233, 0.12), transparent 30%),
        linear-gradient(180deg, #f5f8ff 0%, #fbfdff 100%);
}
body.receiving-create-page .main-content {
    max-width: 1280px;
    margin: 0 auto;
    padding-top: 28px;
}
.receiving-create-shell {
    color: #172554;
}
.receiving-create-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}
.receiving-create-head .page-title {
    margin: 0 0 6px;
    color: #182454;
    font-size: 1.65rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}
.receiving-create-lead {
    margin: 0;
    max-width: 680px;
    color: #7c89a3;
    font-size: 14px;
    line-height: 1.5;
}
.receiving-create-doc-preview {
    min-width: 168px;
    padding: 14px 18px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid #e8eef8;
    box-shadow: 0 10px 28px rgba(20, 33, 61, 0.06);
}
.receiving-create-doc-preview__label {
    display: block;
    margin-bottom: 8px;
    color: #8490aa;
    font-size: 12px;
    font-weight: 700;
}
.receiving-create-doc-preview strong {
    display: block;
    color: #182454;
    font-size: 18px;
    line-height: 1.1;
}
body.receiving-create-page #orderForm {
    padding: 0;
    overflow: hidden;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid #e9eef8;
    box-shadow: 0 14px 34px rgba(20, 33, 61, 0.06);
}
body.receiving-create-page input,
body.receiving-create-page select,
body.receiving-create-page button,
body.receiving-create-page .btn {
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease, transform .18s ease;
}
body.receiving-create-page .btn:hover,
body.receiving-create-page button:hover {
    transform: translateY(-1px);
}
body.receiving-create-page #supplierBlock {
    display: grid !important;
    grid-template-columns: minmax(260px, 1fr) minmax(260px, 1fr);
    gap: 14px 28px;
    padding: 24px;
    border-bottom: 1px solid #edf2fb;
}
body.receiving-create-page #supplierBlock > p:first-child {
    grid-column: 1 / -1;
    margin: 0 !important;
    padding: 12px 14px;
    border-radius: 12px;
    background: #f7fbff;
    border: 1px solid #e5efff;
    color: #66728c;
}
body.receiving-create-page #supplierBlock label {
    color: #8490aa;
    font-size: 13px;
    font-weight: 800;
}
body.receiving-create-page #supplierBlock select,
body.receiving-create-page #supplierBlock input[type='text'],
body.receiving-create-page #orderRows input,
body.receiving-create-page #orderRows select {
    min-height: 42px;
    border-radius: 12px;
    border: 1px solid #e5ecf7;
    background: #fff;
    color: #22304f;
    box-shadow: 0 4px 14px rgba(20, 33, 61, 0.04);
}
body.receiving-create-page #supplierBlock select,
body.receiving-create-page #supplierBlock input[type='text'] {
    max-width: 100%;
}
body.receiving-create-page #addSupplierBtn {
    min-height: 42px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #e5ecf7;
    color: #34405f;
    font-weight: 700;
}
body.receiving-create-page #orderForm > .card-heading,
body.receiving-create-page #orderForm > .card-heading + .muted,
body.receiving-create-page #orderTableHeader,
body.receiving-create-page #orderRows,
body.receiving-create-page #addRow,
body.receiving-create-page #orderTotalBlock,
body.receiving-create-page #orderForm > .form-actions {
    margin-left: 24px;
    margin-right: 24px;
}
body.receiving-create-page #orderForm > .card-heading {
    margin-top: 24px;
    margin-bottom: 8px;
    color: #182454;
    font-size: 1.2rem;
    font-weight: 800;
}
body.receiving-create-page #orderForm > .card-heading + .muted {
    color: #7c89a3;
}
body.receiving-create-page #orderTableHeader {
    display: grid !important;
    grid-template-columns: 140px minmax(220px, 1fr) 78px 108px 108px 108px 112px 96px 34px;
    gap: 10px;
    align-items: center;
    margin-top: 18px;
    margin-bottom: 0 !important;
    padding: 14px 16px;
    border: 1px solid #edf2fb;
    border-bottom: none;
    border-radius: 16px 16px 0 0;
    background: #fbfcff;
    color: #8390aa !important;
    font-size: 12px !important;
    font-weight: 800 !important;
}
body.receiving-create-page #orderTableHeader > span {
    width: auto !important;
}
body.receiving-create-page #orderRows {
    border: 1px solid #edf2fb;
    border-radius: 0 0 16px 16px;
    overflow: visible;
    background: #fff;
}
body.receiving-create-page #orderRows .order-row {
    display: grid;
    grid-template-columns: 140px minmax(220px, 1fr) 78px 108px 108px 108px 112px 96px 34px;
    gap: 10px;
    align-items: center;
    margin: 0;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f4fa;
}
body.receiving-create-page #orderRows .order-row:last-child {
    border-bottom: none;
}
body.receiving-create-page #orderRows .order-row > span,
body.receiving-create-page #orderRows .order-row > input,
body.receiving-create-page #orderRows .order-row > .product-search-wrap {
    width: auto !important;
    max-width: 100%;
    margin-bottom: 0;
}
body.receiving-create-page #orderRows .product-search-wrap {
    position: relative;
    min-width: 0;
}
body.receiving-create-page #orderRows .product-search,
body.receiving-create-page #orderRows .product-id-input,
body.receiving-create-page #orderRows .qty-input,
body.receiving-create-page #orderRows .price-input,
body.receiving-create-page #orderRows .sell-price-input,
body.receiving-create-page #orderRows .storage-location-input,
body.receiving-create-page #orderRows .category-select {
    width: 100% !important;
    max-width: 100%;
    margin-bottom: 0;
}
body.receiving-create-page #orderRows .product-dropdown {
    border-radius: 14px;
    border-color: #dbe7f7;
    box-shadow: 0 14px 34px rgba(20, 33, 61, 0.14);
}
body.receiving-create-page #orderRows .print-label-btn,
body.receiving-create-page #orderRows .rm-row,
body.receiving-create-page #addRow {
    border-radius: 11px;
    font-weight: 700;
}
body.receiving-create-page #orderRows .print-label-btn {
    width: 100%;
    background: #f8fbff;
    border: 1px solid #e5ecf7;
}
body.receiving-create-page #addRow {
    margin-top: 14px;
    background: #fff;
    border: 1px solid #e5ecf7;
    color: #34405f;
    box-shadow: 0 4px 14px rgba(20, 33, 61, 0.04);
}
body.receiving-create-page #orderTotalBlock {
    display: grid;
    grid-template-columns: minmax(180px, 0.75fr) minmax(260px, 1.25fr);
    gap: 0;
    margin-top: 18px !important;
    border: 1px solid #edf2fb;
    border-radius: 16px;
    background: #fff;
    overflow: hidden;
}
body.receiving-create-page #orderTotalBlock .receiving-total-count {
    padding: 20px 22px;
}
body.receiving-create-page #orderTotalBlock .receiving-total-count span {
    display: block;
    margin-bottom: 6px;
    color: #8490aa;
    font-size: 13px;
    font-weight: 800;
}
body.receiving-create-page #orderTotalBlock .receiving-total-count strong {
    color: #1875f0;
    font-size: 30px;
    line-height: 1;
    font-weight: 900;
    letter-spacing: -0.04em;
    font-variant-numeric: tabular-nums;
}
body.receiving-create-page #orderTotalBlock .receiving-total-count small {
    margin-left: 6px;
    color: #52607a;
    font-size: 14px;
    font-weight: 800;
}
body.receiving-create-page #orderTotalBlock > p {
    margin: 0 !important;
    padding: 20px 22px;
    border-left: 1px solid #edf2fb;
}
body.receiving-create-page #orderTotalBlock #orderTotalLabel {
    display: block;
    margin-bottom: 6px;
    color: #8490aa;
    font-size: 13px;
    font-weight: 800;
}
body.receiving-create-page #orderTotalBlock #orderTotalSum {
    color: #101b42;
    font-size: 30px;
    line-height: 1;
    font-weight: 900;
    letter-spacing: -0.04em;
    font-variant-numeric: tabular-nums;
}
body.receiving-create-page #orderForm > .form-actions {
    justify-content: flex-end;
    padding: 20px 0 24px;
}
body.receiving-create-page #orderForm > .form-actions .btn {
    min-height: 44px;
    border-radius: 12px;
    font-weight: 800;
}
body.receiving-create-page #orderForm > .form-actions .btn-primary {
    background: linear-gradient(180deg, #2488ff 0%, #0b72ef 100%);
    border-color: rgba(11, 114, 239, 0.4);
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.22);
}

/* Приемка: максимально близко к референсу */
body.receiving-create-page .main-wrap {
    background: #f4f7ff;
}
body.receiving-create-page .topbar {
    display: none;
}
body.receiving-create-page .main-content {
    max-width: 1160px;
    padding-top: 30px;
}
.receiving-create-head {
    margin-bottom: 20px;
}
.receiving-create-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 12px;
}
.receiving-create-actions .btn {
    min-height: 42px;
    border-radius: 6px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 700;
}
.receiving-create-actions .btn-secondary {
    background: #fff;
    border: 1px solid #edf1f8;
    color: #4f5f7c;
    box-shadow: 0 8px 20px rgba(19, 37, 75, 0.035);
}
body.receiving-create-page .receiving-create-actions .btn-secondary,
body.receiving-create-page #receivingFocusSearch,
body.receiving-create-page #addSupplierBtn {
    background: #fff !important;
    border: 1px solid #111827 !important;
    color: #111827 !important;
    box-shadow: none !important;
}
body.receiving-create-page .receiving-create-actions .btn-secondary:hover,
body.receiving-create-page #receivingFocusSearch:hover,
body.receiving-create-page #addSupplierBtn:hover {
    background: #111827 !important;
    border-color: #111827 !important;
    color: #fff !important;
}
body.receiving-create-page #orderForm {
    background: transparent;
    border: 0;
    box-shadow: none;
    overflow: visible;
}
.receiving-doc-card {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    margin-bottom: 20px;
    padding: 0;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid #eef2f8;
    box-shadow: 0 18px 42px rgba(20, 33, 61, 0.07);
    backdrop-filter: blur(10px);
    overflow: hidden;
}
.receiving-doc-cell {
    min-height: 104px;
    padding: 26px 30px;
    border-right: 1px solid #f0f3f9;
}
.receiving-doc-cell:last-child {
    border-right: 0;
}
.receiving-doc-label {
    display: block;
    margin-bottom: 14px;
    color: #7f8ba3;
    font-size: 12px;
    font-weight: 700;
}
.receiving-doc-number-input,
.receiving-doc-date-input,
.receiving-doc-date {
    color: #172554;
    font-size: 16px;
    font-weight: 800;
}
.receiving-doc-number-input,
.receiving-doc-date-input,
.receiving-status-select,
.receiving-new-status input {
    width: 100%;
    min-height: 40px;
    padding: 9px 12px;
    border-radius: 12px;
    border: 1px solid #e3eaf6;
    background: #fff;
    color: #172554;
    box-shadow: 0 6px 16px rgba(20, 33, 61, 0.04);
}
.receiving-status-select {
    font-size: 14px;
    font-weight: 800;
    color: #168348;
    background: #ecfdf5;
    border-color: #d5f4e2;
}
.receiving-doc-cell--conducted {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
.receiving-conducted-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 9px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #f8fafc;
    color: #64748b;
    font-weight: 800;
    cursor: pointer;
}
.receiving-conducted-toggle__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border: 1px solid currentColor;
    border-radius: 999px;
    font-size: 11px;
    line-height: 1;
}
.receiving-conducted-toggle.is-posted {
    border-color: #bbf7d0;
    background: #dcfce7;
    color: #15803d;
}
.receiving-conducted-toggle:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
}
.receiving-doc-date {
    display: inline-flex;
    align-items: center;
    min-width: 150px;
    min-height: 38px;
    padding: 8px 12px;
    border-radius: 12px;
    border: 1px solid #edf1f8;
    background: #fff;
}
.receiving-status-pill,
.receiving-status-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 18px;
    border-radius: 12px;
    background: #e3f8ec;
    color: #168348;
    font-size: 13px;
    font-weight: 800;
}
.receiving-status-button {
    width: 100%;
    cursor: pointer;
    background: #fff;
    border: 1px solid #edf1f8;
    color: #66728c;
}
.receiving-new-status {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    margin-top: 10px;
}
.receiving-new-status[hidden] {
    display: none !important;
}
.receiving-status-color {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 6px 10px;
    min-height: 40px;
    border: 1px solid #e3eaf6;
    border-radius: 12px;
    background: #fff;
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
}
.receiving-status-color input[type='color'] {
    width: 30px;
    height: 28px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}
.receiving-status-pill-list {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 10px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--status-color, #2563eb) 14%, #ffffff);
    color: var(--status-color, #2563eb);
    font-size: 12px;
    font-weight: 800;
}
.receiving-status-modal {
    z-index: 2600;
}
.receiving-status-modal__card {
    width: min(560px, calc(100vw - 32px));
    max-width: 560px;
    padding: 20px;
    border-radius: 18px;
}
.receiving-status-modal__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}
.receiving-status-modal__head .card-heading {
    margin: 0 0 4px;
}
.receiving-status-list {
    display: grid;
    gap: 8px;
    max-height: 320px;
    overflow: auto;
    padding-right: 4px;
}
.receiving-status-row,
.receiving-status-new-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 46px 38px 38px;
    gap: 8px;
    align-items: center;
    padding: 8px;
    border: 1px solid #e3eaf6;
    border-radius: 14px;
    background: #f8fbff;
}
.receiving-status-row input[type='text'],
.receiving-status-new-row input[type='text'] {
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid #dbe5f3;
    border-radius: 10px;
    background: #fff;
    color: #172554;
    font-weight: 700;
}
.receiving-status-row input[type='color'],
.receiving-status-new-row input[type='color'] {
    width: 42px;
    height: 38px;
    padding: 2px;
    border: 1px solid #dbe5f3;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
}
.receiving-status-row .btn {
    min-width: 38px;
    min-height: 38px;
    padding: 0;
    border-radius: 10px;
    font-weight: 900;
}
.receiving-status-new-row {
    grid-template-columns: minmax(0, 1fr) 46px auto;
    margin-top: 12px;
    background: #fff;
}
.receiving-status-modal__actions {
    justify-content: flex-end;
    margin-top: 16px;
}
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 2500;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    background: rgba(15, 23, 42, 0.42);
    backdrop-filter: blur(8px);
}
.receiving-supplier-modal,
.client-create-modal {
    z-index: 2600;
}
body.client-modal-open {
    overflow: hidden;
}
.receiving-supplier-modal__card {
    width: min(680px, calc(100vw - 32px));
    max-width: 680px;
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 28px 70px rgba(15, 23, 42, 0.24);
}
.receiving-supplier-modal__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 24px 26px 20px;
    background: linear-gradient(135deg, #f8fbff 0%, #eef6ff 100%);
    border-bottom: 1px solid #e8eef8;
}
.receiving-supplier-modal__head .card-heading {
    margin: 4px 0 6px;
    color: #172554;
    font-size: 22px;
    font-weight: 900;
}
.receiving-supplier-modal__eyebrow {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 800;
}
.receiving-supplier-modal__close {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.78);
    color: #475569;
    font-size: 22px;
    line-height: 1;
}
.receiving-supplier-modal__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    padding: 24px 26px 8px;
}
.receiving-supplier-modal__field {
    display: grid;
    gap: 8px;
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
}
.receiving-supplier-modal__field--wide {
    grid-column: 1 / -1;
}
.receiving-supplier-modal__field input {
    width: 100%;
    min-height: 46px;
    padding: 11px 14px;
    border: 1px solid #dbe7f7;
    border-radius: 14px;
    background: #fbfdff;
    color: #172554;
    font-size: 14px;
    font-weight: 700;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}
.receiving-supplier-modal__field input:focus {
    outline: none;
    border-color: #60a5fa;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.18);
}
.receiving-supplier-modal__actions {
    justify-content: flex-end;
    margin: 0;
    padding: 18px 26px 24px;
    border-top: 1px solid #eef2f8;
}
.receiving-supplier-modal__actions .btn {
    min-height: 42px;
    border-radius: 13px;
    font-weight: 800;
}
.receiving-product-picker-modal {
    position: fixed;
    inset: 0;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 2650;
    background: rgba(15, 23, 42, 0.42);
    backdrop-filter: blur(8px);
}
.outgoing-document-modal {
    position: fixed;
    inset: 0;
    z-index: 2800;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.42);
    backdrop-filter: blur(8px);
}
.outgoing-document-modal.is-open,
.outgoing-document-modal:not([hidden]) {
    display: flex;
}
body.outgoing-document-modal-open {
    overflow: hidden;
}
.receiving-outgoing-modal__close {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    font-size: 22px;
    line-height: 1;
}
.receiving-outgoing-modal__sidebar-title {
    margin: 0 0 12px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #64748b;
}
.outgoing-document-picker__type-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    margin-bottom: 10px;
    border-radius: 10px;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 16px;
    font-weight: 900;
}
.receiving-outgoing-modal__summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
    padding: 16px 18px;
    border: 1px solid #dbeafe;
    border-radius: 18px;
    background: linear-gradient(135deg, #eff6ff 0%, #f8fbff 100%);
}
.receiving-outgoing-modal__summary-label {
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
}
.receiving-outgoing-modal__summary-amount {
    display: block;
    color: #172554;
    font-size: 28px;
    font-weight: 900;
    line-height: 1.1;
}
.receiving-outgoing-modal__summary-badge {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 6px 12px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #dbeafe;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}
.receiving-outgoing-modal__hint {
    margin: 0 0 10px;
}
.receiving-outgoing-modal__error {
    margin: 0 0 12px;
}
.receiving-outgoing-modal__fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 16px;
}
.receiving-outgoing-modal__field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
}
.receiving-outgoing-modal__field--wide {
    grid-column: 1 / -1;
}
.receiving-outgoing-modal__field > span {
    font-size: 13px;
    font-weight: 700;
    color: #334155;
}
.receiving-outgoing-modal__mixed {
    margin-top: 4px;
    padding-top: 4px;
}
.receiving-outgoing-modal__mixed-hint {
    margin: 8px 0 0;
    font-size: 13px;
}
.receiving-outgoing-modal__actions {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e8eef8;
}
.receiving-outgoing-modal__card--picker .outgoing-document-modal__head .modal-subtitle {
    margin: 6px 0 0;
    max-width: 520px;
}
.outgoing-document-modal__card {
    width: min(520px, calc(100vw - 32px));
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    padding: 24px;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 28px 70px rgba(15, 23, 42, 0.24);
}
.outgoing-document-modal__head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 14px;
}
.outgoing-document-modal__head .page-title {
    margin: 4px 0 0;
    font-size: 1.35rem;
}
.outgoing-document-modal__eyebrow {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: 999px;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 800;
}
.outgoing-document-modal__form {
    max-width: none !important;
    padding: 0;
    border: 0;
    box-shadow: none;
}
.outgoing-document-modal__form label {
    display: block;
    margin-top: 12px;
    margin-bottom: 4px;
    font-weight: 600;
}
.outgoing-document-modal__form input,
.outgoing-document-modal__form select {
    width: 100%;
    box-sizing: border-box;
}
.outgoing-document-modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 16px;
}
.outgoing-document-modal__card--picker {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    width: min(1040px, calc(100vw - 32px));
    max-width: 1040px;
    height: min(760px, calc(100vh - 48px));
    max-height: calc(100vh - 48px);
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 24px;
}
.outgoing-document-modal__card--picker .outgoing-document-modal__head {
    padding: 22px 26px 18px;
    margin-bottom: 0;
    background: linear-gradient(135deg, #f8fbff 0%, #eef6ff 100%);
    border-bottom: 1px solid #e8eef8;
}
.outgoing-document-modal__card--picker .outgoing-document-modal__head .page-title {
    color: #172554;
    font-size: 22px;
    font-weight: 900;
}
.outgoing-document-picker {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    min-height: 0;
    background: #f8fafc;
}
.outgoing-document-picker__types {
    min-height: 0;
    padding: 18px;
    overflow-y: auto;
    border-right: 1px solid #e8eef8;
    background: #f8fbff;
}
.outgoing-document-picker__type {
    display: block;
    width: 100%;
    padding: 14px;
    border: 1px solid #dbeafe;
    border-radius: 16px;
    background: #fff;
    color: #172554;
    text-align: left;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.08);
}
.outgoing-document-picker__type.is-active {
    border-color: #2563eb;
    background: linear-gradient(135deg, #eff6ff 0%, #fff 100%);
}
.outgoing-document-picker__type-title {
    display: block;
    font-size: 15px;
    font-weight: 900;
}
.outgoing-document-picker__type-text {
    display: block;
    margin-top: 6px;
    color: #64748b;
    font-size: 13px;
    line-height: 1.35;
}
.outgoing-document-picker__content {
    min-height: 0;
    padding: 22px;
    overflow-y: auto;
}
.outgoing-document-picker__panel {
    max-width: 560px;
    padding: 20px;
    border: 1px solid #e8eef8;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
}
.receiving-outgoing-modal__main {
    padding: 22px 24px 24px;
}
.receiving-outgoing-modal__form {
    margin-top: 4px;
}
.outgoing-document-modal__card--picker .outgoing-document-modal__form input,
.outgoing-document-modal__card--picker .outgoing-document-modal__form select {
    min-height: 42px;
    padding: 9px 12px;
    border: 2px solid var(--border);
    border-radius: 12px;
}
@media (max-width: 860px) {
    .outgoing-document-modal__card--picker {
        width: calc(100vw - 32px);
        height: calc(100vh - 32px);
    }
    .outgoing-document-picker {
        grid-template-columns: 1fr;
    }
    .outgoing-document-picker__types {
        border-right: 0;
        border-bottom: 1px solid #e8eef8;
    }
    .receiving-outgoing-modal__fields {
        grid-template-columns: 1fr;
    }
    .receiving-outgoing-modal__summary {
        flex-direction: column;
        align-items: flex-start;
    }
}
.receiving-product-picker-modal__card {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    width: min(1040px, calc(100vw - 32px));
    max-width: 1040px;
    height: min(760px, calc(100vh - 48px));
    max-height: calc(100vh - 48px);
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 28px 70px rgba(15, 23, 42, 0.24);
}
.receiving-product-picker-modal__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 22px 26px 18px;
    background: linear-gradient(135deg, #f8fbff 0%, #eef6ff 100%);
    border-bottom: 1px solid #e8eef8;
}
.receiving-product-picker-modal__head .card-heading {
    margin: 4px 0 6px;
    color: #172554;
    font-size: 22px;
    font-weight: 900;
}
.receiving-product-picker-modal__eyebrow {
    display: inline-flex;
    min-height: 24px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 800;
}
.receiving-product-picker-modal__close {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.78);
    color: #475569;
    font-size: 22px;
    line-height: 1;
}
.receiving-product-picker {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    min-height: 0;
    height: 100%;
}
.receiving-product-picker__categories {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 18px;
    border-right: 1px solid #edf2fb;
    background: #f8fbff;
    min-height: 0;
    overflow-y: auto;
    scrollbar-gutter: stable;
}
.receiving-product-picker__category {
    width: 100%;
    min-height: 40px;
    padding: 9px 12px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: transparent;
    color: #475569;
    text-align: left;
    font-weight: 800;
    cursor: pointer;
}
.receiving-product-picker__category:hover,
.receiving-product-picker__category.is-active {
    background: #fff;
    border-color: #dbe7f7;
    color: #111827;
}
.receiving-product-picker__content {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    min-width: 0;
    min-height: 0;
    padding: 18px;
}
.receiving-product-picker__search {
    margin-bottom: 14px;
}
.receiving-product-picker__search input {
    width: 100%;
    min-height: 46px;
    padding: 11px 14px;
    border: 1px solid #dbe7f7;
    border-radius: 14px;
    background: #fbfdff;
    color: #172554;
    font-size: 14px;
    font-weight: 700;
}
.receiving-product-picker__search input:focus {
    outline: none;
    border-color: #60a5fa;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.18);
}
.receiving-product-picker__list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 12px;
    align-content: start;
    min-height: 0;
    max-height: 100%;
    overflow-y: scroll;
    scrollbar-gutter: stable;
    padding: 2px 12px 10px 2px;
}
.receiving-product-picker__list::-webkit-scrollbar,
.receiving-product-picker__categories::-webkit-scrollbar {
    width: 10px;
}
.receiving-product-picker__list::-webkit-scrollbar-track,
.receiving-product-picker__categories::-webkit-scrollbar-track {
    background: #eef2f8;
    border-radius: 999px;
}
.receiving-product-picker__list::-webkit-scrollbar-thumb,
.receiving-product-picker__categories::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
    border: 2px solid #eef2f8;
}
.receiving-product-picker__list::-webkit-scrollbar-thumb:hover,
.receiving-product-picker__categories::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}
.receiving-product-picker__empty {
    grid-column: 1 / -1;
    margin: 18px 0;
    text-align: center;
}
.receiving-product-picker__item {
    position: relative;
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    min-height: 92px;
    padding: 12px;
    border: 1px solid #e7eef8;
    border-radius: 16px;
    background: #fff;
    cursor: pointer;
    overflow: visible;
    text-align: left;
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.receiving-product-picker__item:hover {
    z-index: 20;
    transform: translateY(-2px);
    border-color: #bfdbfe;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.1);
}
.receiving-product-picker__photo {
    position: relative;
    z-index: 3;
    width: 58px;
    height: 58px;
    cursor: zoom-in;
}
.receiving-product-picker__info {
    position: relative;
    z-index: 1;
    min-width: 0;
}
.receiving-product-picker__photo img,
.receiving-product-picker__photo-empty {
    width: 58px;
    height: 58px;
    border-radius: 12px;
    object-fit: cover;
    background: #eef2f7;
}
.receiving-product-picker__photo img {
    transition: transform .18s ease, box-shadow .18s ease;
    transform-origin: left center;
}
.receiving-product-picker__photo:hover img {
    position: relative;
    z-index: 50;
    transform: scale(2.25);
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.28);
}
.receiving-product-photo-preview {
    position: fixed;
    inset: 0;
    z-index: 4000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(8px);
    cursor: zoom-out;
}
.receiving-product-photo-preview img {
    max-width: min(860px, 92vw);
    max-height: 86vh;
    border-radius: 20px;
    object-fit: contain;
    background: #fff;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.42);
}
.receiving-product-photo-preview__close {
    position: fixed;
    top: 22px;
    right: 24px;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 999px;
    background: #fff;
    color: #111827;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}
.receiving-product-picker__name {
    color: #172554;
    font-size: 14px;
    font-weight: 900;
    line-height: 1.25;
}
.receiving-product-picker__meta {
    margin-top: 5px;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
}
@media (max-width: 760px) {
    .receiving-product-picker {
        grid-template-columns: 1fr;
    }
    .receiving-product-picker__categories {
        flex-direction: row;
        border-right: 0;
        border-bottom: 1px solid #edf2fb;
    }
    .receiving-product-picker__category {
        width: auto;
        white-space: nowrap;
    }
}
@media (max-width: 680px) {
    .receiving-supplier-modal__grid {
        grid-template-columns: 1fr;
    }
}
body.receiving-create-page .receiving-product-picker-modal .receiving-product-picker-modal__card {
    width: min(1080px, calc(100vw - 80px)) !important;
    max-width: 1080px !important;
    min-width: min(900px, calc(100vw - 80px)) !important;
    height: min(780px, calc(100vh - 80px)) !important;
}
body.receiving-create-page .receiving-product-picker-modal .receiving-product-picker {
    grid-template-columns: 230px minmax(620px, 1fr) !important;
}
body.receiving-create-page .receiving-product-picker-modal .receiving-product-picker__list {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important;
    overflow-y: auto !important;
}
@media (max-width: 980px) {
    body.receiving-create-page .receiving-product-picker-modal .receiving-product-picker-modal__card {
        width: calc(100vw - 32px) !important;
        min-width: 0 !important;
    }
    body.receiving-create-page .receiving-product-picker-modal .receiving-product-picker {
        grid-template-columns: 190px minmax(0, 1fr) !important;
    }
}
body.receiving-create-page #supplierBlock {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 36px;
    align-items: start;
    margin-bottom: 20px;
    padding: 30px;
    border-radius: 18px;
    border: 1px solid #eef2f8;
    background: #fff;
    box-shadow: 0 18px 42px rgba(20, 33, 61, 0.06);
}
body.receiving-create-page .receiving-supplier-card,
body.receiving-create-page .receiving-warehouse-field {
    min-width: 0;
}
body.receiving-create-page .receiving-supplier-card select,
body.receiving-create-page .receiving-warehouse-field select {
    display: block;
    width: 100%;
}
body.receiving-create-page .receiving-supplier-card #addSupplierBtn {
    margin-top: 12px;
}
body.receiving-create-page #orderRows .receiving-empty-template {
    display: none !important;
}
body.receiving-create-page #supplierBlock > p:first-child {
    grid-column: auto;
    padding: 0;
    background: transparent;
    border: 0;
    color: #168348;
}
body.receiving-create-page #supplierBlock label,
.receiving-warehouse-label {
    display: block;
    margin: 0 0 10px;
    color: #7f8ba3;
    font-size: 12px;
    font-weight: 800;
}
body.receiving-create-page #supplierBlock select,
body.receiving-create-page #supplierBlock input[type='text'] {
    width: 100%;
    min-height: 44px;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid #e9eef7;
    background: #fff;
    color: #172554;
    box-shadow: none;
}
body.receiving-create-page #addSupplierBtn {
    border-radius: 12px;
    box-shadow: none;
}
.receiving-warehouse-field {
    align-self: start;
}
.receiving-warehouse-field strong {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 44px;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid #e9eef7;
    background: #fff;
    color: #34405f;
    font-size: 14px;
    font-weight: 700;
}
.receiving-product-search-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: end;
    gap: 14px;
    margin-bottom: 20px;
    padding: 24px 30px;
    border-radius: 18px;
    border: 1px solid #eef2f8;
    background: #fff;
    box-shadow: 0 18px 42px rgba(20, 33, 61, 0.06);
}
body.receiving-create-page .receiving-product-search-panel .card-heading {
    margin: 0 0 12px;
    color: #7f8ba3;
    font-size: 12px;
    letter-spacing: 0;
}
body.receiving-create-page .receiving-product-search-panel .muted {
    display: none;
}
.receiving-top-search-wrap {
    position: relative;
}
.receiving-top-search-wrap input {
    width: 100%;
    min-height: 44px;
    padding: 10px 44px 10px 14px;
    border-radius: 12px;
    border: 1px solid #e9eef7;
    background: #fff;
    color: #1f2a44;
    font-size: 14px;
}
.receiving-top-search-wrap .receiving-top-dropdown {
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    z-index: 600;
    max-height: 260px;
}
body.receiving-create-page #receivingFocusSearch {
    min-height: 44px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #e9eef7;
    box-shadow: none;
    color: #4f5f7c;
}
body.receiving-create-page #addRow {
    min-height: 44px;
    margin: 0 0 0 8px;
    border-radius: 12px;
    background: #2488ff;
    color: #fff;
    border: 0;
    box-shadow: 0 8px 18px rgba(36, 136, 255, 0.22);
}
body.receiving-create-page #orderTableHeader,
body.receiving-create-page #orderRows {
    margin-left: 0;
    margin-right: 0;
}
body.receiving-create-page #orderTableHeader,
body.receiving-create-page #orderRows .order-row {
    grid-template-columns: 64px minmax(220px, 1fr) 90px 150px 90px 116px 96px 34px;
}
body.receiving-create-page #orderTableHeader {
    margin-top: 0;
    padding: 12px 14px;
    border-radius: 18px 18px 0 0;
    border-color: #eef2f8;
    background: #fff;
    color: #7f8ba3 !important;
}
body.receiving-create-page #orderRows {
    border-color: #eef2f8;
    border-radius: 0 0 18px 18px;
    box-shadow: 0 18px 42px rgba(20, 33, 61, 0.06);
}
body.receiving-create-page #orderRows .order-row {
    min-height: 72px;
    padding: 10px 14px;
    border-bottom-color: #f0f3f9;
}
body.receiving-create-page #orderTableHeader .category-col,
body.receiving-create-page #orderRows .category-col,
body.receiving-create-page #orderTableHeader .line-sum-col,
body.receiving-create-page #orderRows .line-sum-input,
body.receiving-create-page #orderTableHeader .sell-price-col,
body.receiving-create-page #orderRows .sell-price-col {
    display: none !important;
}
body.receiving-create-page #orderTableHeader .receiving-photo-col,
body.receiving-create-page #orderRows .receiving-photo-col { order: 1; }
body.receiving-create-page #orderTableHeader .product-search-wrap,
body.receiving-create-page #orderRows .product-search-wrap { order: 2; }
body.receiving-create-page #orderTableHeader .qty-input,
body.receiving-create-page #orderRows .qty-input { order: 3; }
body.receiving-create-page #orderTableHeader .storage-location-col,
body.receiving-create-page #orderRows .storage-location-col { order: 4; }
body.receiving-create-page #orderTableHeader .receiving-stock-col,
body.receiving-create-page #orderRows .receiving-stock-col { order: 5; }
body.receiving-create-page #orderTableHeader .price-input,
body.receiving-create-page #orderRows .price-input { order: 6; }
body.receiving-create-page #orderTableHeader .label-print-col,
body.receiving-create-page #orderRows .label-print-col { order: 7; }
body.receiving-create-page #orderRows .rm-row { order: 8; }
body.receiving-create-page #orderTableHeader .product-search-wrap::before {
    content: 'Наименование';
}
body.receiving-create-page #orderTableHeader .product-search-wrap {
    font-size: 0;
}
body.receiving-create-page #orderTableHeader .product-search-wrap::before {
    font-size: 12px;
}
body.receiving-create-page:not(.receiving-edit-page) #orderTableHeader,
body.receiving-create-page:not(.receiving-edit-page) #orderRows .order-row {
    grid-template-columns: 42px minmax(170px, 1fr) 58px 86px 58px 78px 74px 24px !important;
    column-gap: 6px !important;
}
body.receiving-create-page:not(.receiving-edit-page) #orderTableHeader .receiving-photo-col,
body.receiving-create-page:not(.receiving-edit-page) #orderRows .receiving-photo-col {
    grid-column: 1;
}
body.receiving-create-page:not(.receiving-edit-page) #orderTableHeader .product-search-wrap,
body.receiving-create-page:not(.receiving-edit-page) #orderRows .product-search-wrap {
    grid-column: 2;
}
body.receiving-create-page:not(.receiving-edit-page) #orderTableHeader .qty-input,
body.receiving-create-page:not(.receiving-edit-page) #orderRows .qty-input {
    grid-column: 3;
}
body.receiving-create-page:not(.receiving-edit-page) #orderTableHeader .storage-location-col,
body.receiving-create-page:not(.receiving-edit-page) #orderRows .storage-location-col {
    grid-column: 4;
}
body.receiving-create-page:not(.receiving-edit-page) #orderTableHeader .receiving-stock-col,
body.receiving-create-page:not(.receiving-edit-page) #orderRows .receiving-stock-col {
    grid-column: 5;
}
body.receiving-create-page:not(.receiving-edit-page) #orderTableHeader .price-input,
body.receiving-create-page:not(.receiving-edit-page) #orderRows .price-input:not(.line-sum-input) {
    grid-column: 6;
}
body.receiving-create-page:not(.receiving-edit-page) #orderTableHeader .label-print-col,
body.receiving-create-page:not(.receiving-edit-page) #orderRows .label-print-col {
    grid-column: 7;
}
body.receiving-create-page:not(.receiving-edit-page) #orderRows .rm-row {
    grid-column: 8;
}
body.receiving-create-page:not(.receiving-edit-page) #orderTableHeader .product-search-wrap {
    font-size: 12px;
}
body.receiving-create-page:not(.receiving-edit-page) #orderTableHeader .product-search-wrap::before {
    content: none;
}
.receiving-product-thumb {
    display: block;
    width: 38px;
    height: 38px;
    object-fit: cover;
    border-radius: 10px;
    background: #eef2f8;
    border: 1px solid #edf1f8;
}
.receiving-product-thumb--empty::before {
    content: '';
    display: block;
    width: 22px;
    height: 16px;
    margin: 15px auto;
    border-radius: 6px;
    background: #dbe3f0;
}
body.receiving-create-page #orderRows .product-search {
    border: 0;
    box-shadow: none;
    padding-left: 0;
    padding-right: 0;
    color: #182454;
    font-weight: 700;
    font-size: 12px;
}
body.receiving-create-page #orderRows .qty-input,
body.receiving-create-page #orderRows .price-input,
body.receiving-create-page #orderRows .storage-location-input {
    min-height: 36px;
    border-radius: 12px;
    box-shadow: none;
    text-align: center;
    padding-left: 6px;
    padding-right: 6px;
    font-size: 12px;
}
body.receiving-create-page #orderRows .receiving-stock-value {
    color: #34405f;
    font-weight: 700;
    text-align: center;
}
body.receiving-create-page #orderRows .print-label-btn {
    border-radius: 12px;
    min-height: 34px;
    padding: 6px 8px;
    font-size: 11px;
}
body.receiving-create-page #orderRows .rm-row {
    min-width: 24px;
    min-height: 32px;
    padding: 4px;
    border-radius: 12px;
}
body.receiving-create-page #orderTotalBlock {
    margin-left: 0;
    margin-right: 0;
    border-radius: 18px;
    border-color: #eef2f8;
    box-shadow: 0 18px 42px rgba(20, 33, 61, 0.06);
}
body.receiving-create-page #orderForm > .form-actions {
    margin-left: 0;
    margin-right: 0;
}
@media (max-width: 1180px) {
    body.receiving-create-page #orderTableHeader,
    body.receiving-create-page #orderRows .order-row {
        grid-template-columns: 130px minmax(210px, 1fr) 74px 96px 96px 96px 108px 88px 34px;
    }
}
@media (max-width: 920px) {
    .receiving-create-head,
    body.receiving-create-page #supplierBlock,
    body.receiving-create-page #orderTotalBlock {
        grid-template-columns: 1fr;
    }
    .receiving-create-head {
        display: grid;
    }
    body.receiving-create-page #orderTableHeader {
        display: none !important;
    }
    body.receiving-create-page #orderRows {
        border-radius: 16px;
        padding: 10px;
    }
    body.receiving-create-page #orderRows .order-row {
        grid-template-columns: 1fr 1fr;
        border: 1px solid #edf2fb;
        border-radius: 14px;
        margin-bottom: 10px;
        padding: 12px;
    }
    body.receiving-create-page #orderRows .product-search-wrap {
        grid-column: 1 / -1;
    }
    body.receiving-create-page #orderRows .label-print-col,
    body.receiving-create-page #orderRows .rm-row {
        width: 100% !important;
    }
    body.receiving-create-page #orderTotalBlock > p {
        border-left: none;
        border-top: 1px solid #edf2fb;
    }
}

/* Activity list */
.activity-list { list-style: none; padding: 0; margin: 0; }
.activity-item { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.activity-item:last-child { border-bottom: none; }
.muted { color: #6b7280; font-size: 14px; }
.msg { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; }
.msg-success { background: rgba(34, 197, 94, 0.12); color: #15803d; }
.msg-error { background: rgba(239, 68, 68, 0.08); color: #b91c1c; }

/* Пустое состояние в карточках */
.card-empty-state {
    padding: 32px 24px;
    text-align: center;
    color: #6b7280;
    font-size: 15px;
    line-height: 1.5;
}

/* ——— Инвентаризация: современный UI ——— */
body.inventory-module {
    background: linear-gradient(180deg, #f1f5f9 0%, #f8fafc 32%, #f8fafc 100%);
}
body.inventory-module .main-content {
    padding-bottom: 48px;
}
.inventory-page {
    max-width: 100%;
    width: 100%;
}
.inventory-page-top {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}
.inventory-page-top .page-title {
    margin-bottom: 0;
}

/* Верхняя панель документа: современные кнопки (ERP-style) */
/* z-index: выпадающее меню выходит за пределы тулбара — следующий блок (.inv-doc-hero)
   иначе рисуется поверх меню (соседний слой в DOM). */
.inv-doc-toolbar {
    position: relative;
    z-index: 30;
    overflow: visible;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 16px;
    margin: 0 0 20px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 14px;
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.04),
        0 6px 20px -6px rgba(15, 23, 42, 0.08);
}
.inv-doc-toolbar__left,
.inv-doc-toolbar__right {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.inv-doc-toolbar__right {
    margin-left: auto;
}
@media (max-width: 640px) {
    .inv-doc-toolbar__right {
        width: 100%;
        margin-left: 0;
        justify-content: flex-start;
    }
}

.inv-toolbar-btn-save {
    padding: 10px 20px;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.01em;
    color: #fff !important;
    background: linear-gradient(180deg, #34d399 0%, #16a34a 100%);
    border: 1px solid rgba(21, 128, 61, 0.4);
    border-radius: 10px;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.22) inset,
        0 2px 10px rgba(22, 163, 74, 0.32),
        0 1px 2px rgba(15, 23, 42, 0.06);
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.inv-toolbar-btn-save:hover {
    opacity: 1;
    filter: brightness(1.06);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.28) inset,
        0 4px 16px rgba(22, 163, 74, 0.38),
        0 2px 4px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}
.inv-toolbar-btn-save:active {
    transform: translateY(0);
    filter: brightness(0.98);
}
.inv-toolbar-btn-save:focus-visible {
    outline: none;
    box-shadow:
        0 0 0 3px rgba(34, 197, 94, 0.38),
        0 2px 10px rgba(22, 163, 74, 0.32);
}

.inv-doc-toolbar .btn-secondary {
    border-radius: 10px;
    background: #fff;
    color: #334155;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
    padding: 10px 16px;
    font-weight: 500;
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.inv-doc-toolbar .btn-secondary:hover {
    opacity: 1;
    background: #f8fafc;
    border-color: #cbd5e1;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.07);
}
.inv-doc-toolbar a.btn-secondary {
    box-sizing: border-box;
}

.inv-toolbar-dropdown {
    position: relative;
    z-index: 2;
    display: inline-flex;
    vertical-align: middle;
}
.inv-toolbar-dropdown__toggle {
    gap: 6px;
}
.inv-toolbar-caret {
    display: inline-block;
    font-size: 0.6rem;
    line-height: 1;
    opacity: 0.65;
    transform: translateY(1px);
    transition: transform 0.2s ease;
}
.inv-toolbar-dropdown__toggle[aria-expanded='true'] .inv-toolbar-caret {
    transform: translateY(1px) rotate(-180deg);
}
.inv-toolbar-dropdown__menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 1000;
    min-width: 268px;
    padding: 6px;
    margin: 0;
    list-style: none;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow:
        0 4px 6px -1px rgba(15, 23, 42, 0.07),
        0 16px 32px -8px rgba(15, 23, 42, 0.18);
}
.inv-toolbar-dropdown__menu[hidden] {
    display: none !important;
}
.inv-toolbar-dropdown__item {
    display: flex;
    width: 100%;
    align-items: center;
    padding: 11px 14px;
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    color: #1e293b;
    text-align: left;
    text-decoration: none;
    font-family: inherit;
    line-height: 1.35;
    cursor: pointer;
    border: none;
    border-radius: 8px;
    background: transparent;
    transition: background 0.12s ease, color 0.12s ease;
}
.inv-toolbar-dropdown__item:hover:not(:disabled) {
    background: #f1f5f9;
}
.inv-toolbar-dropdown__item:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
.inv-toolbar-dropdown__link {
    margin-top: 4px;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
    border-radius: 8px;
    color: var(--primary);
    font-weight: 600;
}
.inv-toolbar-dropdown__link:hover {
    background: rgba(37, 99, 235, 0.06);
}

.inv-doc-toolbar .btn.inv-toolbar-print {
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    color: #475569;
    padding: 9px 15px;
    font-weight: 500;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
}
.inv-doc-toolbar .btn.inv-toolbar-print:hover {
    opacity: 1;
    background: #fff;
    border-color: #cbd5e1;
    color: #0f172a;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.inv-toolbar-inline-form {
    display: inline-flex;
    margin: 0;
}

.inv-doc-toolbar .btn-ghost.text-danger {
    border-radius: 10px;
    padding: 10px 14px;
    font-weight: 600;
    border: 1px solid transparent;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.inv-doc-toolbar .btn-ghost.text-danger:hover {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.22);
    color: #b91c1c;
}

.inv-hidden-form {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Кнопки блока поиска на странице инвентаризации */
body.inventory-module .inv-search-toolbar__actions .btn,
body.inventory-module .inv-bulk-stock-form .btn {
    border-radius: 10px;
    background: #fff;
    color: #334155;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
    font-weight: 500;
    padding: 10px 16px;
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
body.inventory-module .inv-search-toolbar__actions .btn:hover,
body.inventory-module .inv-bulk-stock-form .btn:hover {
    opacity: 1;
    background: #f8fafc;
    border-color: #cbd5e1;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.07);
}

.inventory-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--muted-foreground);
    text-decoration: none;
    margin-bottom: 8px;
    transition: color 0.15s;
}
.inventory-back-link:hover {
    color: var(--primary);
}
/* Проведённая инвентаризация: привязанные списание / оприходование */
.inv-linked-wh {
    margin-bottom: 24px;
    padding: 22px 26px;
}
.inv-linked-wh__title {
    margin: 0 0 8px;
    font-size: 1.15rem;
    font-weight: 700;
    color: #0f172a;
}
.inv-linked-wh__lead {
    margin: 0 0 18px;
    font-size: 14px;
    line-height: 1.5;
    max-width: 820px;
}
.inv-linked-wh__blocks {
    display: flex;
    flex-direction: column;
    gap: 22px;
}
.inv-linked-wh__subtitle {
    margin: 0 0 8px;
    font-size: 1rem;
    font-weight: 700;
    color: #334155;
}
.inv-linked-wh__sum {
    margin: 0 0 10px;
    font-size: 14px;
}
.inv-linked-wh__table-wrap {
    border-radius: 10px;
    border: 1px solid var(--border);
}
.inv-linked-wh__table {
    font-size: 14px;
}
.inv-linked-wh__table th.num,
.inv-linked-wh__table .num-cell {
    text-align: right;
    white-space: nowrap;
}
.inv-linked-wh__name {
    display: block;
    font-weight: 600;
    color: #0f172a;
}
.inv-linked-wh__sku {
    display: block;
    font-size: 12px;
    margin-top: 2px;
}

.inv-doc-hero {
    position: relative;
    z-index: 0;
    border-radius: 16px;
    padding: 24px 28px;
    margin-bottom: 24px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 45%, #eff6ff 100%);
    border: 1px solid rgba(37, 99, 235, 0.12);
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.04),
        0 8px 24px -8px rgba(37, 99, 235, 0.12);
    overflow: hidden;
}
.inv-doc-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--primary) 0%, #38bdf8 100%);
    border-radius: 4px 0 0 4px;
}
.inv-doc-hero-title {
    margin: 0 0 4px;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: #0f172a;
}
.inv-doc-hero-sub {
    margin: 0 0 20px;
    font-size: 14px;
    color: #64748b;
}
.inv-doc-notice {
    margin: 0 0 18px;
    padding: 14px 16px;
    font-size: 14px;
    line-height: 1.55;
    color: #334155;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(37, 99, 235, 0.18);
    border-radius: 12px;
}
.inv-doc-notice a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}
.inv-doc-notice a:hover {
    text-decoration: underline;
}
/* Параметры инвентаризации — современные поля */
.inv-meta-form {
    margin: 0;
}
.inv-meta-editor {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px 22px;
    border-radius: 14px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.92) 0%, rgba(248, 250, 252, 0.98) 100%);
    border: 1px solid rgba(37, 99, 235, 0.1);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.85),
        0 4px 24px -12px rgba(15, 23, 42, 0.12);
}
.inv-meta-editor__fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
}
.inv-meta-field {
    display: flex;
    align-items: stretch;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid rgba(226, 232, 240, 0.95);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.inv-meta-field:focus-within {
    border-color: rgba(37, 99, 235, 0.45);
    box-shadow:
        0 0 0 3px rgba(37, 99, 235, 0.12),
        0 2px 8px rgba(15, 23, 42, 0.06);
}
.inv-meta-field__icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1) 0%, rgba(56, 189, 248, 0.12) 100%);
    color: var(--primary);
}
.inv-meta-field__body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.inv-meta-field__label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #64748b;
    line-height: 1.2;
}
.inv-meta-select-wrap,
.inv-meta-date-wrap {
    position: relative;
    width: 100%;
}
.inv-meta-select-wrap::after {
    content: '';
    position: absolute;
    right: 12px;
    top: 50%;
    width: 18px;
    height: 18px;
    margin-top: -9px;
    pointer-events: none;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") center / contain no-repeat;
    opacity: 0.85;
}
.inv-meta-select {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 11px 40px 11px 14px;
    font-size: 15px;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.35;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.inv-meta-select:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}
.inv-meta-select:focus {
    outline: none;
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.inv-meta-date {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 11px 14px;
    font-size: 15px;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.35;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    appearance: none;
    -webkit-appearance: none;
    min-height: 44px;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.inv-meta-date:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}
.inv-meta-date:focus {
    outline: none;
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
/* Календарь в WebKit: иконка справа */
.inv-meta-date::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.65;
    padding: 4px;
    border-radius: 6px;
}
.inv-meta-date::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
    background: rgba(37, 99, 235, 0.08);
}
.inv-meta-editor__footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 4px;
    border-top: 1px solid rgba(226, 232, 240, 0.95);
}
.inv-meta-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #b45309;
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    border: 1px solid rgba(252, 211, 77, 0.65);
    box-shadow: 0 1px 2px rgba(180, 83, 9, 0.08);
}
.inv-meta-status-pill--done {
    color: #047857;
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    border-color: rgba(110, 231, 183, 0.75);
    box-shadow: 0 1px 2px rgba(4, 120, 87, 0.08);
}
.inv-meta-status-pill__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.85;
    box-shadow: 0 0 0 3px rgba(180, 83, 9, 0.08);
}
.inv-meta-status-pill--done .inv-meta-status-pill__dot {
    box-shadow: 0 0 0 3px rgba(4, 120, 87, 0.1);
}
.inv-meta-save-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px !important;
    font-weight: 600 !important;
    border-radius: 10px !important;
    box-shadow: 0 2px 12px rgba(37, 99, 235, 0.28) !important;
    transition: box-shadow 0.2s ease, transform 0.15s ease, opacity 0.2s ease !important;
}
.inv-meta-save-btn:hover {
    opacity: 1 !important;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35) !important;
    transform: translateY(-1px);
}
.inv-meta-save-btn:active {
    transform: translateY(0);
}
.inv-meta-save-btn__icon {
    display: inline-flex;
    line-height: 0;
    opacity: 0.95;
}
.inv-meta-readonly {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    align-items: stretch;
}
.inv-meta-read-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(226, 232, 240, 0.95);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.inv-meta-read-card--status {
    align-items: center;
    justify-content: center;
    min-height: 72px;
}
.inv-meta-read-card__icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.08) 0%, rgba(56, 189, 248, 0.1) 100%);
    color: var(--primary);
}
.inv-meta-read-card__text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.inv-meta-read-card__label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
}
.inv-meta-read-card__value {
    font-size: 15px;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.35;
    word-break: break-word;
}
@media (max-width: 520px) {
    .inv-meta-editor {
        padding: 16px;
    }
    .inv-meta-editor__footer {
        flex-direction: column;
        align-items: stretch;
    }
    .inv-meta-status-pill {
        justify-content: center;
    }
    .inv-meta-save-btn {
        justify-content: center;
        width: 100%;
    }
}
.inv-meta-tile {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.inv-meta-tile-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
    margin-bottom: 6px;
}
.inv-meta-tile-value {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.35;
}
.inv-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.inv-badge--draft {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    color: #b45309;
    border: 1px solid #fcd34d;
}
.inv-badge--done {
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    color: #047857;
    border: 1px solid #6ee7b7;
}
.inv-badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.85;
}

.inv-panel {
    border-radius: 16px;
    border: 1px solid var(--border);
    background: var(--card);
    padding: 24px 28px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}
.inv-panel-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}
.inv-panel-title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 10px;
}
.inv-panel-title-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(56, 189, 248, 0.15));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}
.inv-panel-desc {
    margin: 0;
    font-size: 14px;
    color: #64748b;
    line-height: 1.55;
    max-width: 720px;
}
.inv-panel-desc strong {
    color: #475569;
    font-weight: 600;
}

.inv-sum-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px 14px;
    margin-top: 16px;
    padding: 12px 14px;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 14px;
    color: #475569;
}
.inv-sum-strip__sep {
    opacity: 0.5;
}
.inv-sum-strip__item strong {
    color: #0f172a;
    font-variant-numeric: tabular-nums;
}
.inv-sum-strip--inventory {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}
.inv-sum-strip--minimal {
    margin-top: 16px;
    padding: 14px 16px;
}
.inv-sum-strip--minimal .inv-total-line strong {
    font-variant-numeric: tabular-nums;
}

.inv-add-one-form {
    margin: 0;
}
.inv-search-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px 16px;
    margin-bottom: 8px;
}
.inv-search-toolbar__search {
    flex: 1;
    min-width: 220px;
    max-width: 100%;
}
.inv-search-toolbar__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.inv-bulk-stock-form {
    margin: 0;
    display: inline;
}

/* Сообщение после скана штрихкода в поле поиска инвентаризации */
.inv-search-feedback {
    display: block;
    margin-top: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #15803d;
    min-height: 1.25em;
}
.inv-search-feedback--error {
    color: #b91c1c;
}

/* Подсветка строки после скана штрихкода (товар поднят наверх списка) */
.inventory-table tbody tr.inv-row-scan-highlight {
    background: #ecfdf5;
    box-shadow: inset 3px 0 0 #16a34a;
    transition: background-color 0.35s ease, box-shadow 0.35s ease;
}

/* Превью списание / оприходование из инвентаризации */
.inv-wh-preview-modal {
    position: fixed;
    inset: 0;
    z-index: 2100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}
.inv-wh-preview-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
}
.inv-wh-preview-modal__card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 640px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
}
.inv-wh-preview-modal__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 22px 12px;
    border-bottom: 1px solid var(--border);
}
.inv-wh-preview-modal__title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    color: #0f172a;
}
.inv-wh-preview-modal__body {
    padding: 16px 22px;
    overflow: auto;
    flex: 1;
    min-height: 0;
}
.inv-wh-preview-modal__footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 22px 20px;
    border-top: 1px solid var(--border);
    background: #fafafa;
}
.inv-wh-preview-table-wrap {
    overflow-x: auto;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
}
.inv-wh-preview-table {
    margin: 0;
    font-size: 14px;
}
.inv-wh-preview-table th.num,
.inv-wh-preview-table .num-cell {
    text-align: right;
    white-space: nowrap;
}
.inv-wh-preview-name {
    font-weight: 600;
    color: #0f172a;
}
.inv-wh-preview-sku {
    font-size: 12px;
    margin-top: 2px;
}
.inv-wh-preview-row--warn {
    background: rgba(254, 242, 242, 0.85);
}
.inv-wh-preview-total {
    margin: 14px 0 0;
    font-size: 15px;
    color: #334155;
}

.inv-catalog-modal {
    position: fixed;
    inset: 0;
    z-index: 2650;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
}
.inv-catalog-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.42);
    backdrop-filter: blur(8px);
}
.inv-catalog-modal__card {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    width: min(860px, calc(100vw - 32px));
    max-width: 860px;
    height: min(720px, calc(100vh - 48px));
    max-height: calc(100vh - 48px);
    overflow: hidden;
    margin: 0;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 28px 70px rgba(15, 23, 42, 0.24);
}
.inv-catalog-modal__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 22px 26px 18px;
    background: linear-gradient(135deg, #f8fbff 0%, #eef6ff 100%);
    border-bottom: 1px solid #e8eef8;
}
.inv-catalog-modal__head-text {
    min-width: 0;
}
.inv-catalog-modal__eyebrow {
    display: inline-flex;
    min-height: 24px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.01em;
}
.inv-catalog-modal__title {
    margin: 8px 0 6px;
    font-size: 22px;
    font-weight: 900;
    line-height: 1.15;
    color: #172554;
}
.inv-catalog-modal__lead {
    margin: 0;
    max-width: 520px;
    font-size: 14px;
    line-height: 1.45;
    color: #64748b;
}
.inv-catalog-modal__close {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.78);
    color: #475569;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.inv-catalog-modal__close:hover {
    background: #fff;
    color: #0f172a;
}
.inv-catalog-modal__body {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    min-height: 0;
    padding: 18px 22px 12px;
}
.inv-catalog-modal__search {
    position: relative;
    display: block;
    margin-bottom: 14px;
}
.inv-catalog-modal__search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    width: 18px;
    height: 18px;
    color: #94a3b8;
    pointer-events: none;
}
.inv-catalog-modal__search-icon svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
}
.inv-catalog-modal__search input {
    width: 100%;
    min-height: 46px;
    padding: 11px 14px 11px 42px;
    border: 1px solid #dbe7f7;
    border-radius: 14px;
    background: #fbfdff;
    color: #172554;
    font-size: 14px;
    font-weight: 600;
    box-sizing: border-box;
}
.inv-catalog-modal__search input:focus {
    outline: none;
    border-color: #60a5fa;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.18);
}
.inv-catalog-modal__search input::-webkit-search-cancel-button {
    cursor: pointer;
}
.inv-catalog-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
    align-content: start;
    min-height: 0;
    overflow-y: auto;
    scrollbar-gutter: stable;
    padding: 2px 10px 8px 2px;
}
.inv-catalog-list::-webkit-scrollbar {
    width: 10px;
}
.inv-catalog-list::-webkit-scrollbar-track {
    background: #eef2f8;
    border-radius: 999px;
}
.inv-catalog-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
    border: 2px solid #eef2f8;
}
.inv-catalog-list::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}
.inv-catalog-item {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    min-height: 84px;
    padding: 12px;
    border: 1px solid #e7eef8;
    border-radius: 16px;
    background: #fff;
    cursor: pointer;
    text-align: left;
    font: inherit;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}
.inv-catalog-item:hover {
    transform: translateY(-2px);
    border-color: #bfdbfe;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.1);
}
.inv-catalog-item:focus-visible {
    outline: none;
    border-color: #60a5fa;
    box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.18);
}
.inv-catalog-item__photo {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
}
.inv-catalog-item__photo img,
.inv-catalog-item__photo-empty {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    object-fit: cover;
    background: #eef2f7;
}
.inv-catalog-item__photo-empty {
    display: block;
    border: 1px dashed #cbd5e1;
    background: linear-gradient(135deg, #eef2f7 0%, #f8fafc 100%);
}
.inv-catalog-item__info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.inv-catalog-item__name {
    font-size: 14px;
    font-weight: 800;
    line-height: 1.25;
    color: #0f172a;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.inv-catalog-item__meta {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.inv-catalog-item__stock {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    min-height: 28px;
    padding: 4px 8px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #334155;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}
.inv-catalog-modal__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 22px 16px;
    border-top: 1px solid #e8eef8;
    background: #fafcff;
}
.inv-catalog-modal__hint {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 12px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #dbeafe;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 800;
}
.inv-catalog-modal__hint:empty {
    display: none;
}
.inv-catalog-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 220px;
    padding: 24px;
    text-align: center;
    color: #64748b;
    font-size: 14px;
    font-weight: 600;
}
.inv-catalog-state small {
    font-size: 13px;
    font-weight: 500;
    color: #94a3b8;
}
.inv-catalog-state__icon {
    font-size: 28px;
    line-height: 1;
}
.inv-catalog-state--loading {
    flex-direction: row;
    gap: 12px;
}
.inv-catalog-state__spinner {
    width: 18px;
    height: 18px;
    border: 2px solid #dbeafe;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: inv-catalog-spin 0.7s linear infinite;
}
.inv-catalog-state--error {
    color: #b91c1c;
}
@keyframes inv-catalog-spin {
    to { transform: rotate(360deg); }
}
@media (max-width: 640px) {
    .inv-catalog-modal {
        padding: 12px;
    }
    .inv-catalog-modal__card {
        width: 100%;
        height: calc(100vh - 24px);
        max-height: calc(100vh - 24px);
        border-radius: 20px;
    }
    .inv-catalog-modal__head {
        padding: 18px 16px 14px;
    }
    .inv-catalog-modal__title {
        font-size: 18px;
    }
    .inv-catalog-modal__body {
        padding: 14px 14px 10px;
    }
    .inv-catalog-list {
        grid-template-columns: 1fr;
    }
    .inv-catalog-modal__foot {
        padding: 10px 14px 14px;
    }
}

.inv-search-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
    margin-bottom: 24px;
}
.inv-search-field {
    position: relative;
    flex: 1;
    min-width: 240px;
    max-width: 480px;
}
.inv-search-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
}
.inv-search-input-wrap {
    position: relative;
}
.inv-search-input-wrap::before {
    content: '⌕';
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    opacity: 0.45;
    pointer-events: none;
    line-height: 1;
}
.inv-search-input-wrap .form-control,
.inv-search-input-wrap input[type='search'] {
    width: 100%;
    min-height: 44px;
    padding: 10px 14px 10px 40px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 15px;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.inv-search-input-wrap .form-control:focus,
.inv-search-input-wrap input[type='search']:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.inv-suggest {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    z-index: 50;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    max-height: 280px;
    overflow: auto;
    box-shadow:
        0 10px 40px -12px rgba(15, 23, 42, 0.2),
        0 4px 12px rgba(15, 23, 42, 0.08);
}
.inv-suggest-item {
    padding: 12px 14px;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
    color: #334155;
    line-height: 1.4;
    transition: background 0.12s;
}
.inv-suggest-row {
    display: flex;
    gap: 12px;
    align-items: center;
}
.inv-suggest-col {
    flex: 1;
    min-width: 0;
}
.inv-suggest-title {
    font-weight: 600;
    color: #0f172a;
}
.inv-suggest-thumb {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
    background: #f1f5f9;
    border: 1px solid #e5e7eb;
}
.inv-suggest-thumb--empty {
    display: inline-block;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #e8eef9, #f1f5f9);
    border: 1px dashed #cbd5e1;
}
.inv-suggest-item:last-child {
    border-bottom: none;
}
.inv-suggest-item:hover,
.inv-suggest-item.is-active {
    background: #f8fafc;
}
.inv-suggest-meta {
    display: block;
    font-size: 12px;
    color: #94a3b8;
    margin-top: 4px;
}
.inv-suggest-empty {
    padding: 14px 16px;
    text-align: center;
}
.inv-suggest-empty__text {
    margin: 0 0 12px;
    font-size: 13px;
    color: #64748b;
    line-height: 1.45;
}
.inv-suggest-empty .btn {
    display: inline-flex;
}

.inv-bulk-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.inv-action-card {
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 18px 20px;
    background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.inv-action-card--accent {
    border-color: rgba(37, 99, 235, 0.25);
    background: linear-gradient(180deg, #ffffff 0%, #f0f9ff 100%);
}
.inv-action-card-title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
}
.inv-action-card-desc {
    margin: 0;
    font-size: 13px;
    color: #64748b;
    line-height: 1.5;
    flex: 1;
}
.inv-action-card .btn {
    align-self: flex-start;
}
.inv-input-inline {
    width: 100%;
    min-height: 42px;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.inv-input-inline:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.inv-lines-card {
    border-radius: 16px;
    overflow: hidden;
}
.inv-lines-card .card-heading {
    padding: 0 4px;
}
.inv-lines-card .table-wrap {
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #fff;
    overflow-x: auto;
}
.inventory-table .num-cell {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    color: #1e293b;
}
.inventory-table input[type='number'],
.inventory-table .inv-q-fact {
    width: 100%;
    max-width: 100%;
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    background: #fff;
    color: #1e293b;
    box-sizing: border-box;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.inventory-table input[type='number']:focus,
.inventory-table .inv-q-fact:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.inventory-table .inv-weight-stack {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
}
.inventory-table .inv-weight-tare-hint {
    display: block;
    font-size: 12px;
    line-height: 1.3;
    font-weight: 500;
    color: #64748b;
}
.inventory-table-wrap {
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}
.inventory-table--cols {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
}
.inventory-table--cols .inv-th-name {
    width: 30%;
}
.inventory-table--cols .inv-td-name {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.inventory-table--cols .inv-td-name-meta {
    flex: 1;
    min-width: 0;
}
.inventory-table--cols .inv-prod-thumb {
    width: 58px;
    height: 58px;
    object-fit: cover;
    border-radius: 10px;
    flex-shrink: 0;
    background: #f1f5f9;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(15,23,42,.10);
}
.inventory-table--cols .inv-prod-thumb-placeholder {
    width: 58px;
    height: 58px;
    border-radius: 10px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e8eef9, #f1f5f9);
    border: 1px dashed #cbd5e1;
    color: #64748b;
    text-decoration: none;
    font-size: 18px;
    line-height: 1;
}
.inventory-table--cols a.inv-prod-thumb-placeholder:hover {
    border-color: #94a3b8;
    background: #eef2ff;
}
.inventory-table--cols .inv-th-num,
.inventory-table--cols .inv-th-money {
    width: 8%;
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
}
.inventory-table--cols .inv-th-money {
    width: 10%;
}
.inventory-table--cols .inv-th-action {
    width: 72px;
    min-width: 72px;
    text-align: right;
}
.inventory-table--cols .inv-td-name .inv-name-text {
    display: block;
    font-weight: 700;
    font-size: 14px;
    color: #0f172a;
    line-height: 1.35;
}
.inventory-table--cols .inv-td-name .inv-name-link {
    text-decoration: none;
}
.inventory-table--cols .inv-td-name .inv-name-link:hover {
    text-decoration: underline;
}
.inventory-table--cols .inv-td-name .inv-sku-line {
    display: block;
    font-size: 12px;
    margin-top: 3px;
}
.inventory-table--cols .inv-q-fact {
    width: 100%;
    max-width: 100%;
    min-height: 44px;
    padding: 8px 10px;
    font-size: 14px;
}
.inventory-table--cols .inv-weight-stack .inv-q-fact {
    min-height: 40px;
}
.inventory-table--cols td {
    padding-top: 10px;
    padding-bottom: 10px;
}
.inventory-table--cols .inv-td-fact {
    vertical-align: middle;
}
.inventory-table--cols .inv-td-weight {
    vertical-align: middle;
}
.inventory-table--cols .inv-col-location .inv-storage-location {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    border: 1px solid #d7deea;
    border-radius: 12px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.8), 0 1px 2px rgba(15, 23, 42, 0.04);
    padding: 10px 12px;
    font-size: 13px;
    color: #0f172a;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.inventory-table--cols .inv-col-location .inv-storage-location::placeholder {
    color: #94a3b8;
}
.inventory-table--cols .inv-col-location .inv-storage-location:hover {
    border-color: #b8c5da;
    background: #ffffff;
}
.inventory-table--cols .inv-col-location .inv-storage-location:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.16), 0 4px 12px rgba(37, 99, 235, 0.12);
}
.inventory-table--cols .inv-money-cell {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    white-space: normal;
}
.inventory-table--cols .inv-td-del {
    vertical-align: middle;
    white-space: nowrap;
    width: 72px;
    min-width: 72px;
    text-align: right;
}
.inventory-table--cols .inv-td-del .btn {
    min-width: 60px;
    padding: 6px 8px;
    font-size: 12px;
}
.inv-lines-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.inv-cols-settings {
    position: relative;
}
.inv-cols-settings__btn {
    min-height: 42px;
    min-width: 92px;
    padding: 9px 14px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .01em;
    border: 1px solid #d4dced;
    background: linear-gradient(180deg, #ffffff 0%, #f4f8ff 100%);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}
.inv-cols-settings__btn:hover {
    border-color: #b8c6de;
    background: linear-gradient(180deg, #ffffff 0%, #edf4ff 100%);
}
.inv-cols-settings__menu {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    z-index: 30;
    min-width: 290px;
    padding: 12px;
    border-radius: 14px;
    border: 1px solid #dbe4f3;
    box-shadow: 0 14px 30px rgba(15,23,42,.18);
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}
.inv-cols-settings__menu label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 600;
    padding: 9px 8px;
    border-radius: 10px;
    cursor: pointer;
}
.inv-cols-settings__menu label:hover {
    background: rgba(59,130,246,.08);
}
.inv-cols-settings__menu input[type='checkbox'] {
    width: 18px;
    height: 18px;
}
#invLinesForm.inv-hide-col-weight .col-weight,
#invLinesForm.inv-hide-col-diff .col-diff,
#invLinesForm.inv-hide-col-location .col-location,
#invLinesForm.inv-hide-col-price .col-price,
#invLinesForm.inv-hide-col-surplus .col-surplus {
    display: none !important;
}

body.inventory-module .inventory-table .btn.btn-ghost {
    border-radius: 8px;
    padding: 6px 12px;
    font-weight: 600;
    font-size: 13px;
    border: 1px solid transparent;
    transition: background 0.15s ease, border-color 0.15s ease;
}
body.inventory-module .inventory-table .btn.btn-ghost.text-danger:hover {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.2);
}
body.inventory-module .inventory-list-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
body.inventory-module .inventory-delete-form {
    display: inline;
    margin: 0;
}

.inv-footer-card {
    margin-top: 24px;
    padding: 20px 24px;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    background: linear-gradient(135deg, #f8fafc 0%, #fff 100%);
}
.inv-footer-note {
    margin: 0 0 16px;
    font-size: 13px;
    color: #64748b;
    line-height: 1.55;
    max-width: 720px;
}
.inv-footer-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.inventory-list-hero {
    margin-bottom: 20px;
}
.inventory-list-hero .page-title {
    margin-bottom: 8px;
}
.inventory-list-lead {
    margin: 0;
    font-size: 15px;
    color: #64748b;
    max-width: 560px;
    line-height: 1.5;
}
.inventory-status-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}
.inventory-status-pill--draft {
    background: #fef3c7;
    color: #b45309;
}
.inventory-status-pill--done {
    background: #d1fae5;
    color: #047857;
}
.inv-create-card {
    max-width: 520px;
}
.inv-create-card .form-row {
    margin-bottom: 20px;
}
.inv-create-card label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}
.inv-create-card select,
.inv-create-card input[type='date'] {
    width: 100%;
    max-width: 100%;
    min-height: 44px;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.inv-create-card select:focus,
.inv-create-card input[type='date']:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.inv-empty-visual {
    text-align: center;
    padding: 48px 24px 40px;
}
.inv-empty-visual-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    border-radius: 16px;
    background: linear-gradient(135deg, #e0e7ff, #f0f9ff);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}
.inv-empty-visual h3 {
    margin: 0 0 8px;
    font-size: 1.1rem;
    font-weight: 700;
    color: #334155;
}
.inv-empty-visual p {
    margin: 0;
    font-size: 14px;
    color: #94a3b8;
}

@media (max-width: 640px) {
    .inv-doc-hero {
        padding: 20px 18px;
    }
    .inv-search-row {
        flex-direction: column;
        align-items: stretch;
    }
    .inv-search-row .btn {
        width: 100%;
    }
}

/* Pagination */
.pagination { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; align-items: center; }
.pagination .btn.is-active { background: rgba(37, 99, 235, 0.12); color: var(--primary); font-weight: 600; }
.pagination-ellipsis {
    padding: 0 2px;
    color: var(--muted-foreground, #6b7280);
    user-select: none;
    font-size: 14px;
    line-height: 1;
}
.pagination-nav--disabled {
    opacity: 0.45;
    pointer-events: none;
    cursor: default;
}
.two-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.simple-list { list-style: none; padding: 0; margin: 0; }
.simple-list li { padding: 8px 0; border-bottom: 1px solid var(--border); }
.simple-list a { color: var(--primary); text-decoration: none; }

/* Sidebar overlay (mobile) */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    z-index: 35;
    -webkit-tap-highlight-color: transparent;
}
@media (min-width: 1025px) {
    .sidebar-overlay { display: none !important; }
    .sidebar-close { display: none !important; }
}

/* Mobile — планшеты и телефоны */
@media (max-width: 1024px) {
    body:not(.auth-page) {
        background: var(--background);
    }
    .sidebar {
        width: min(320px, calc(100vw - 20px));
        max-width: 92vw;
        padding: 10px;
        transform: translateX(-105%);
        box-shadow: none;
    }
    .sidebar.open { transform: translateX(0); }
    .sidebar-close {
        display: flex;
        min-width: 48px;
        min-height: 48px;
    }
    .sidebar-surface {
        border-radius: 18px;
    }
    /* Крупнее пункты меню — удобнее нажимать пальцем */
    .sidebar-nav {
        gap: 6px;
        padding: 14px 10px;
    }
    .sidebar-nav-link {
        padding: 15px 16px 15px 18px;
        min-height: 54px;
        font-size: 1.0625rem;
        gap: 14px;
        border-radius: 14px;
    }
    .sidebar-nav-icon {
        width: 30px;
        height: 30px;
        padding: 4px;
        border-radius: 10px;
    }
    .sidebar-nav-sales-toggle {
        padding: 15px 16px 15px 18px;
        min-height: 54px;
        font-size: 1.0625rem;
        gap: 14px;
        border-radius: 14px;
    }
    .sidebar-nav-sub-link {
        padding: 13px 14px 13px 22px;
        min-height: 50px;
        font-size: 1rem;
        border-radius: 12px;
    }
    .sidebar-menu-btn,
    .sidebar-logout-btn {
        min-height: 52px;
        padding: 14px 18px;
        font-size: 1rem;
        border-radius: 14px;
    }
    .sidebar-user-block {
        padding: 4px 0 8px;
    }
    .sidebar-user-avatar {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
    }
    .main-wrap {
        margin-left: 0;
        padding: 10px 10px 0 10px;
    }
    .main-wrap > .topbar {
        top: 10px;
    }
    .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 44px;
        min-height: 44px;
        width: 44px;
        height: 44px;
        margin: 0 -4px 0 0;
    }
    .topbar-brand {
        display: inline-flex;
    }
    .topbar {
        flex-wrap: wrap;
        gap: 10px;
        min-height: 56px;
        height: auto;
        padding: 10px 12px;
        border-radius: 18px;
    }
    .topbar-point {
        order: 3;
        width: 100%;
        max-width: 100%;
    }
    .topbar-point select,
    .topbar-select { min-width: 120px; flex: 1; }
    .topbar-search {
        flex: 1;
        min-width: 0;
        max-width: none;
    }
    .topbar-search input { min-height: 40px; }
    .topbar-actions {
        flex-wrap: wrap;
        gap: 6px;
    }
    .topbar-actions .btn {
        min-height: 40px;
        padding: 8px 12px;
    }
    .main-content {
        padding: 16px 12px;
    }
    .card { padding: 20px 16px; }
    .page-title { font-size: 1.35rem; margin-bottom: 20px; }
    .two-cols { grid-template-columns: 1fr; }
    .table-wrap {
        -webkit-overflow-scrolling: touch;
        margin-left: -12px;
        margin-right: -12px;
        padding-left: 12px;
        padding-right: 12px;
    }
    .data-table th, .data-table td { padding: 12px 14px; font-size: 13px; }
    .btn {
        min-height: 44px;
        padding: 10px 16px;
    }
    .btn-sm { min-height: 40px; padding: 8px 12px; }
    .filters-row { gap: 8px; margin-bottom: 16px; }
    .period-type-filter {
        padding: 20px 16px;
        gap: 16px;
    }
    .form-card input, .form-card select { max-width: 100%; }
    /* Полная верхняя панель только на главной (index.php → body.page-home). Иначе на телефоне занимает место и перекрывает контент. */
    body:not(.page-home) .topbar .topbar-brand,
    body:not(.page-home) .topbar .topbar-point,
    body:not(.page-home) .topbar .topbar-shift,
    body:not(.page-home) .topbar .topbar-search,
    body:not(.page-home) .topbar .topbar-actions {
        display: none !important;
    }
    /* Уведомления на всех страницах (кроме главной — там своя шапка) */
    body:not(.page-home) .topbar .topbar-actions {
        display: flex !important;
        margin-left: auto;
        gap: 6px;
        flex-shrink: 0;
    }
    body:not(.page-home) .topbar .topbar-actions .btn:not(.topbar-notify) {
        display: none !important;
    }
    body:not(.page-home) .topbar .topbar-actions .topbar-notify {
        display: inline-flex !important;
    }
    body:not(.page-home) .topbar {
        min-height: 0;
        height: auto;
        flex-wrap: nowrap;
        justify-content: flex-start;
        align-items: center;
        padding: 8px 12px;
        gap: 8px;
    }
}

@media (max-width: 768px) {
    .topbar-shift .cash-label { font-size: 14px; }
    .topbar-shift-hint { display: none; }
    .cards-row { grid-template-columns: 1fr 1fr; gap: 12px; }
    .stat-card { padding: 16px; }
    .stat-value { font-size: 1.35rem; }
    .dashboard-metrics { grid-template-columns: 1fr 1fr; }
    .dashboard-metric-value { font-size: 30px; }
    .mock-metrics { grid-template-columns: 1fr 1fr; }
    .mock-metric-num { font-size: 30px; }
    .mock-panel-head h2 { font-size: 22px; }
}

@media (max-width: 640px) {
    .sidebar {
        width: min(308px, calc(100vw - 16px));
        padding: 8px;
    }
    .main-wrap {
        padding: 8px 8px 0 8px;
    }
    .main-wrap > .topbar {
        top: 8px;
    }
    .topbar {
        padding: 8px 10px;
        gap: 8px;
    }
    .topbar-notify-text {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }
    .topbar-notify {
        padding: 8px !important;
        min-width: 44px;
        min-height: 44px;
        justify-content: center;
    }
    .topbar-point {
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
    }
    .topbar-point label { font-size: 12px; }
    .topbar-point select { width: 100%; min-width: 0; }
    .main-content { padding: 12px 10px; }
    .card { padding: 16px 12px; margin-bottom: 16px; }
    .page-title { font-size: 1.2rem; margin-bottom: 16px; }
    .cards-row { grid-template-columns: 1fr; }
    .dashboard-metrics { grid-template-columns: 1fr; }
    .dashboard-metric-value { font-size: 26px; }
    .mock-metrics { grid-template-columns: 1fr; }
    .mock-metric-num { font-size: 26px; }
    .mock-panel { margin: 0 10px 10px; padding: 10px; }
    .mock-panel-head { flex-direction: column; align-items: flex-start; gap: 8px; }
    .mock-panel-head h2 { font-size: 19px; }
    /* Раньше скрывали колонки с 4-й — пропадали цены и кнопки. На ≤480px — карточки (.has-crm-mobile-cards, app.js) или скролл .table-wrap */
    .data-table th, .data-table td { padding: 10px 12px; font-size: 13px; }
    .order-row { flex-direction: column; align-items: stretch; }
    .order-row .product-select, .order-row .qty-input, .order-row .price-input { min-width: 0; width: 100%; }
    .pagination { gap: 6px; }
    .observer-banner { flex-direction: column; align-items: stretch; text-align: center; }
}

/**
 * Телефоны ≤480px: карточный вид таблиц (.has-crm-mobile-cards на обёртке + .crm-table--cards на table, data-label — app.js).
 * Safe-area, зоны нажатия ≥44px.
 */
@media (max-width: 480px) {
    .main-wrap {
        min-width: 0;
        box-sizing: border-box;
    }
    .topbar {
        min-width: 0;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    .topbar > * {
        min-width: 0;
    }
    .topbar-actions {
        width: 100%;
        justify-content: stretch;
        gap: 8px;
    }
    .topbar-actions .btn,
    .topbar-actions .btn-sm,
    .topbar-actions a.btn {
        min-height: 44px;
        min-width: 44px;
        padding-left: 14px;
        padding-right: 14px;
        flex: 1 1 auto;
        justify-content: center;
    }
    .sidebar-close {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
    }
    .main-content {
        min-width: 0;
        max-width: 100%;
        overflow-x: hidden;
    }
    .card {
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    /* Карточки: обёртка снимает горизонтальный скролл; таблица может быть не прямым ребёнком */
    .table-wrap.has-crm-mobile-cards,
    .sh-table-wrap.has-crm-mobile-cards {
        overflow-x: visible;
        max-width: 100%;
        -webkit-overflow-scrolling: touch;
        border: none;
        background: transparent;
    }
    .has-crm-mobile-cards .crm-table--cards {
        width: 100%;
        max-width: 100%;
        border-collapse: separate;
        border-spacing: 0;
        display: block;
    }
    .has-crm-mobile-cards .crm-table--cards thead {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }
    .has-crm-mobile-cards .crm-table--cards tbody {
        display: block;
    }
    .has-crm-mobile-cards .crm-table--cards tbody tr {
        display: block;
        margin-bottom: 12px;
        padding: 12px 14px;
        background: var(--card);
        border: 1px solid var(--border);
        border-radius: 12px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    }
    .has-crm-mobile-cards .crm-table--cards tbody td {
        display: flex;
        flex-wrap: wrap;
        align-items: flex-start;
        justify-content: space-between;
        gap: 10px 12px;
        width: 100% !important;
        box-sizing: border-box;
        border: none !important;
        border-bottom: 1px solid #f1f5f9 !important;
        padding: 10px 0 !important;
        text-align: right;
        font-size: 14px;
    }
    .has-crm-mobile-cards .crm-table--cards tbody td:last-child {
        border-bottom: none !important;
    }
    .has-crm-mobile-cards .crm-table--cards tbody td[data-label]::before {
        content: attr(data-label);
        font-size: 12px;
        font-weight: 600;
        color: var(--muted-foreground);
        text-align: left;
        flex: 0 1 44%;
        min-width: 0;
        line-height: 1.35;
    }
    .has-crm-mobile-cards .crm-table--cards tbody td[colspan] {
        display: block;
        text-align: center;
    }
    .has-crm-mobile-cards .crm-table--cards tbody td[colspan]::before {
        content: none !important;
    }
    .has-crm-mobile-cards .crm-table--cards tbody td[data-label]:has(.btn),
    .has-crm-mobile-cards .crm-table--cards tbody td[data-label]:has(a.btn) {
        flex-direction: column;
        align-items: stretch;
    }
    .has-crm-mobile-cards .crm-table--cards tbody td[data-label]:has(.btn)::before,
    .has-crm-mobile-cards .crm-table--cards tbody td[data-label]:has(a.btn)::before {
        flex: none;
        width: 100%;
    }
    .has-crm-mobile-cards .crm-table--cards tbody td .btn,
    .has-crm-mobile-cards .crm-table--cards tbody td a.btn {
        min-height: 44px;
        min-width: 44px;
        flex: 1 1 calc(50% - 6px);
        justify-content: center;
    }
    .has-crm-mobile-cards .crm-table--cards tbody td .btn:only-child,
    .has-crm-mobile-cards .crm-table--cards tbody td a.btn:only-child {
        flex: 1 1 100%;
    }
}

/* Удобные зоны нажатия на touch-устройствах */
@media (hover: none) and (pointer: coarse) {
    .sidebar-nav-link {
        min-height: 48px;
        padding-top: 12px;
        padding-bottom: 12px;
    }
    .sidebar-nav-sales-toggle {
        min-height: 48px;
        padding-top: 12px;
        padding-bottom: 12px;
    }
    .sidebar-nav-sub-link {
        min-height: 44px;
    }
    .btn, .btn-sm { min-height: 44px; }
    input[type="search"], input[type="text"], input[type="number"], input[type="email"], input[type="password"],
    select, .form-card input, .form-card select {
        min-height: 44px;
        font-size: 16px;
    }
}

.toast { position: fixed; bottom: 24px; right: 24px; padding: 12px 20px; border-radius: var(--radius); box-shadow: 0 4px 20px rgba(0,0,0,0.15); z-index: 50; display: none; }

/* Полноэкранное окно открытия смены после входа — современный стиль */
.open-shift-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}
.open-shift-fullscreen-card {
    width: 100%;
    max-width: 440px;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.08) inset;
    padding: 48px 40px;
    text-align: center;
    backdrop-filter: blur(12px);
}
.open-shift-fullscreen-title {
    margin: 0 0 8px;
    font-size: 1.625rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.02em;
    line-height: 1.25;
}
.open-shift-fullscreen-greeting {
    margin: 0 0 28px;
    color: #64748b;
    font-size: 15px;
}
.open-shift-fullscreen-cash {
    margin-bottom: 32px;
    padding: 28px 24px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 20px;
    border: 1px solid rgba(59, 130, 246, 0.2);
}
.open-shift-fullscreen-cash-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #0369a1;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 8px;
}
.open-shift-fullscreen-cash-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: #0c4a6e;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}
.open-shift-fullscreen-form,
.open-shift-fullscreen-form label {
    text-align: left;
}
.open-shift-fullscreen-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
    color: #334155;
}
.open-shift-fullscreen-select,
.open-shift-fullscreen-input {
    width: 100%;
    padding: 14px 18px;
    margin-bottom: 20px;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 500;
    color: #0f172a;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.open-shift-fullscreen-select {
    padding: 18px 20px;
    font-size: 18px;
    min-height: 56px;
    cursor: pointer;
}
.open-shift-fullscreen-select:hover,
.open-shift-fullscreen-input:hover {
    border-color: #cbd5e1;
}
.open-shift-fullscreen-select:focus,
.open-shift-fullscreen-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}
.open-shift-fullscreen-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 28px;
}
.open-shift-fullscreen-btn {
    width: 100%;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 14px;
    border: none;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
    transition: transform 0.15s, box-shadow 0.15s;
}
.open-shift-fullscreen-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
}
.open-shift-fullscreen-btn:active {
    transform: translateY(0);
}
.open-shift-fullscreen-skip {
    width: 100%;
}
.open-shift-fullscreen .msg { border-radius: 14px; }
.open-shift-fullscreen .msg-error { margin-bottom: 20px; }

/* Открытие / закрытие смены (shift.php) — форма по центру экрана */
body.page-shift-flow .main-content {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 56px);
    padding: 28px 20px 40px;
    background: linear-gradient(165deg, #f8fafc 0%, #eef2ff 42%, #f1f5f9 100%);
    box-sizing: border-box;
}
body.page-shift-flow .shift-flow-wrap {
    width: 100%;
    max-width: 540px;
    margin: 0 auto;
}
body.page-shift-flow .shift-flow-card {
    width: 100%;
    max-width: 540px;
    text-align: center;
    box-shadow: 0 24px 48px -16px rgba(15, 23, 42, 0.18), 0 0 0 1px rgba(148, 163, 184, 0.12);
}
body.page-shift-flow .shift-flow-card .open-shift-fullscreen-form {
    text-align: left;
}
body.page-shift-flow .shift-flow-cash-preview {
    margin-bottom: 24px;
}
body.page-shift-flow .shift-flow-meta {
    margin: -8px 0 20px;
    font-size: 14px;
    color: #64748b;
    line-height: 1.45;
}
body.page-shift-flow .shift-flow-meta--warn {
    color: #b45309;
}
body.page-shift-flow .shift-flow-hint {
    margin: -10px 0 18px;
    font-size: 13px;
    line-height: 1.45;
    color: #64748b;
}
body.page-shift-flow .shift-flow-footer-link {
    margin: 20px 0 0;
    font-size: 13px;
    color: #64748b;
}
body.page-shift-flow .shift-flow-footer-link a {
    color: #2563eb;
    font-weight: 600;
    text-decoration: none;
}
body.page-shift-flow .shift-flow-footer-link a:hover {
    text-decoration: underline;
}
body.page-shift-flow .shift-flow-conflict {
    margin: 8px 0 20px;
    padding: 16px;
    border-radius: 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    text-align: left;
}
body.page-shift-flow .shift-flow-conflict__title {
    margin: 0 0 8px;
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
}
body.page-shift-flow .shift-flow-conflict__text {
    margin: 0 0 10px;
    font-size: 14px;
    color: #475569;
    line-height: 1.5;
}
body.page-shift-flow .shift-flow-conflict__actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.open-shift-fullscreen-actions--row {
    flex-direction: row !important;
    flex-wrap: wrap;
}
.open-shift-fullscreen-actions--row .open-shift-fullscreen-btn {
    flex: 1 1 140px;
}
.open-shift-fullscreen-btn--ghost {
    background: #fff !important;
    color: #334155 !important;
    border: 2px solid #e2e8f0 !important;
    box-shadow: none !important;
}
.open-shift-fullscreen-btn--ghost:hover {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
    transform: translateY(-1px);
}
@media (max-width: 640px) {
    body.page-shift-flow .main-content {
        min-height: calc(100vh - 48px);
        padding: 16px 12px 24px;
    }
    body.page-shift-flow .open-shift-fullscreen-card {
        padding: 32px 22px;
    }
    .open-shift-fullscreen-cash-value {
        font-size: 2rem;
    }
}

/* ——— Страница «Продажи» (макет) ——— */
body.sales-page-mock {
    --sales-blue: #3b71e8;
    --sales-bg: #f4f7f9;
    --sales-green: #28a745;
    --sales-orange: #ff8c00;
}
body.sales-page-mock .main-content {
    background: var(--sales-bg);
    padding-top: 20px;
    padding-bottom: 32px;
}
body.sales-page-mock .page-title { display: none; }
.sales-mock-wrap {
    max-width: 1100px;
    margin: 0 auto;
}
.sales-mock-page-title {
    margin: 0 0 8px;
    font-size: 1.75rem;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: -0.02em;
}

/* «Продажа» — витринный макет (как в примере) */
body.sales-page-sale-v2 .sales-mock-wrap {
    max-width: 1220px;
}
body.sales-page-sale-v2 .sales-mock-card {
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.07);
}
.sales-sale-v2__search-hint {
    font-size: 12px;
    color: #94a3b8;
    margin: 0 0 10px;
    line-height: 1.45;
}
.sales-sale-v2__search-wrap {
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: #fff;
    padding: 2px 4px;
}
.sales-sale-v2__search-input {
    min-width: 0 !important;
    flex: 1;
    font-size: 15px !important;
    padding: 13px 16px !important;
    border-radius: 10px !important;
    border: none !important;
}
.sales-sale-v2__table-title {
    font-size: 1.05rem;
    padding: 18px 22px;
    color: #0f172a;
    border-bottom: 1px solid #eef2f7;
}
.sales-sale-v2__table thead th {
    text-transform: none;
    letter-spacing: 0;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    padding: 16px 14px;
}
.sales-sale-v2__table tbody td {
    padding: 16px 14px;
}
.sales-sale-v2__table .sales-prod-thumb,
.sales-sale-v2__table .sales-prod-thumb--empty,
.sales-sale-v2__table .sales-prod-thumb.sales-prod-thumb--empty {
    width: 56px;
    height: 56px;
    border-radius: 12px;
}
.sales-sale-v2__prod {
    align-items: center;
}
.sales-sale-v2__cell-price,
.sales-sale-v2__cell-sum {
    position: relative;
    vertical-align: middle;
}
.sales-sale-v2__input-price {
    max-width: 132px;
    font-size: 15px;
    font-weight: 600;
    padding: 10px 30px 10px 12px !important;
}
.sales-sale-v2__input-sum {
    max-width: 124px;
    font-size: 15px;
    font-weight: 700;
    padding: 10px 30px 10px 12px !important;
}
.sales-sale-v2__rub-muted {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 13px;
    color: #94a3b8;
    pointer-events: none;
}
.sales-sale-v2__cell-stock {
    text-align: center;
    min-width: 88px;
}
.sales-sale-v2__stock-val {
    display: block;
    font-weight: 700;
    font-size: 16px;
    color: #0f172a;
    line-height: 1.2;
}
.sales-sale-v2__stock-label {
    display: block;
    font-size: 10px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 4px;
}
.sales-qty-stepper {
    display: inline-flex;
    align-items: stretch;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    vertical-align: middle;
}
.sales-qty-step {
    width: 42px;
    min-width: 42px;
    border: none;
    font-size: 20px;
    font-weight: 600;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    font-family: inherit;
}
.sales-qty-step--down {
    background: #f8fafc;
    color: #475569;
}
.sales-qty-step--down:hover {
    background: #e2e8f0;
}
.sales-qty-step--up {
    background: var(--sales-blue);
    color: #fff;
}
.sales-qty-step--up:hover {
    filter: brightness(1.06);
}
.sales-qty-stepper__input {
    width: 56px;
    min-width: 48px;
    border: none;
    border-left: 1px solid #e2e8f0;
    border-right: 1px solid #e2e8f0;
    text-align: center;
    font-size: 16px;
    font-weight: 700;
    color: #1d4ed8;
    background: #fff;
    padding: 10px 4px;
    box-sizing: border-box;
}
.sales-qty-stepper__input:focus {
    outline: none;
    background: #fafafa;
}
.sales-sale-v2__input-disc {
    max-width: 80px;
    text-align: center;
}
.sales-sale-v2__total-row td {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 20px 18px !important;
    border-bottom: none;
}
.sales-sale-v2__total-label {
    font-size: 15px;
    color: #475569;
    vertical-align: middle;
}
.sales-sale-v2__total-value {
    font-size: 22px !important;
    font-weight: 800 !important;
    letter-spacing: -0.02em;
    color: #0f172a !important;
    text-align: right;
    vertical-align: middle;
}
.sales-sale-v2__rub {
    font-weight: 600;
    font-size: 17px;
    color: #64748b;
}
.sales-sale-v2__footer-row td {
    background: #fff;
    padding: 20px 22px !important;
    border-top: 1px solid #eef2f7;
}
.sales-sale-v2__footer {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px 28px;
}
.sales-sale-v2__footer-pay-block {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 18px;
    flex: 1;
    min-width: 280px;
}
.sales-sale-v2__pay-select {
    min-width: 200px;
}
.sales-sale-v2__footer-submit {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    min-width: 240px;
}
.sales-sale-v2__btn-save {
    border-radius: 12px;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 700;
    box-shadow: 0 6px 18px rgba(59, 113, 232, 0.35);
}
@media (max-width: 900px) {
    .sales-sale-v2__table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .sales-sale-v2__table thead th,
    .sales-sale-v2__table tbody td {
        white-space: nowrap;
    }
    .sales-sale-v2__table .sales-sale-v2__cell-product {
        white-space: normal;
        min-width: 220px;
    }
}

.sales-mock-point-hint {
    margin: 0 0 16px;
    font-size: 14px;
    color: #64748b;
}
.sales-mock-form-all { margin: 0; }
.sales-mock-card {
    background: #fff;
    border: 1px solid #e8ecf1;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}
.sales-mock-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    margin-bottom: 10px;
}
.sales-mock-client-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.sales-mock-select-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 220px;
    max-width: 480px;
    border: 1px solid #d8e0ea;
    border-radius: 8px;
    padding: 4px 12px 4px 4px;
    background: #fafbfd;
}
.sales-mock-select-wrap--search {
    max-width: 720px;
    align-items: stretch;
}
.sales-mock-client-search-wrap {
    position: relative;
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
}
.sales-mock-client-search-input {
    flex: 1;
    min-width: 0;
    border: none !important;
    background: transparent !important;
    font-size: 15px;
    font-weight: 500;
    color: #1e293b;
    padding: 10px 36px 10px 8px;
    box-shadow: none !important;
}
.sales-mock-client-search-input:focus {
    outline: none;
}
.sales-mock-client-clear {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border: none;
    background: #e2e8f0;
    color: #475569;
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 0;
    z-index: 2;
}
.sales-mock-client-clear:hover {
    background: #cbd5e1;
}
.sales-client-dropdown {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    margin-top: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(255, 255, 255, 0.8) inset;
    max-height: 280px;
    overflow-y: auto;
    z-index: 10050;
    padding: 6px;
}
.sales-client-dropdown-item {
    padding: 12px 14px;
    cursor: pointer;
    border-radius: 10px;
    font-size: 14px;
    color: #334155;
    transition: background 0.15s;
}
.sales-client-dropdown-item:hover {
    background: linear-gradient(135deg, #f0f6ff 0%, #eef2ff 100%);
}
.sales-client-dropdown-item__title {
    font-weight: 600;
    color: #0f172a;
    letter-spacing: -0.01em;
}
.sales-client-dropdown-item__meta {
    font-size: 12px;
    color: #64748b;
    margin-top: 4px;
    font-family: ui-monospace, monospace;
}
.sales-client-no-match {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    padding: 12px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1);
    z-index: 10051;
}
.sales-mock-btn--create-client {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 10px;
    border: none;
    cursor: pointer;
}
.sales-mock-select-avatar {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: #e8eef9;
    color: var(--sales-blue);
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.sales-mock-select {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 15px;
    font-weight: 500;
    color: #1e293b;
    padding: 10px 8px;
    min-width: 0;
    cursor: pointer;
}
.sales-mock-select:focus { outline: none; }
.sales-mock-bonus {
    color: var(--sales-orange);
    font-weight: 600;
    font-size: 15px;
    white-space: nowrap;
}
.sales-mock-btn--new-client {
    flex-shrink: 0;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    color: var(--sales-blue);
    cursor: pointer;
}
.sales-mock-btn--new-client:hover {
    background: #f1f5f9;
}
.sales-mock-btn--ghost {
    background: #fff;
    border: 1px solid #cbd5e1;
    color: #475569;
}
.sales-new-client-dialog {
    border: none;
    border-radius: 12px;
    padding: 0;
    max-width: 420px;
    width: calc(100% - 32px);
    box-shadow: 0 10px 40px rgba(15, 23, 42, 0.15);
}
.sales-new-client-dialog::backdrop {
    background: rgba(15, 23, 42, 0.45);
}
.sales-new-client-dialog__inner {
    padding: 20px 22px;
}
.sales-new-client-dialog__title {
    margin: 0 0 14px;
    font-size: 1.1rem;
}
.sales-new-client-dialog__field {
    margin-bottom: 12px;
}
.sales-new-client-dialog__field label {
    display: block;
    font-size: 13px;
    color: #64748b;
    margin-bottom: 4px;
}
.sales-new-client-dialog__field input {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #d8e0ea;
    font-size: 15px;
}
.sales-new-client-dialog__actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
    margin-top: 18px;
}
.sales-mock-filters-top {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}
.sales-mock-filters-col {
    flex: 1;
    min-width: 0;
    max-width: 720px;
}
.sales-mock-hint {
    margin: 0 0 10px;
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.sales-product-autocomplete {
    position: relative;
    max-width: 100%;
}
.sales-product-search-wrap {
    position: relative;
    max-width: 560px;
}
.sales-mock-input--search {
    width: 100%;
    max-width: 560px;
    padding-left: 16px !important;
    min-height: 48px;
    border-radius: 12px !important;
    border: 1px solid #e2e8f0 !important;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    font-size: 15px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.sales-mock-input--search:focus {
    outline: none;
    border-color: #3b71e8 !important;
    box-shadow: 0 0 0 3px rgba(59, 113, 232, 0.15);
    background: #fff;
}
.sales-product-dropdown {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 8px);
    margin-top: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(255, 255, 255, 0.8) inset;
    max-height: 320px;
    overflow-y: auto;
    z-index: 10050;
    padding: 6px;
}
.sales-product-dropdown-empty {
    padding: 16px 14px;
    text-align: center;
}
.sales-product-dropdown-empty__text {
    margin: 0 0 12px;
    font-size: 14px;
    color: #64748b;
    line-height: 1.45;
}
.sales-product-dropdown-empty .btn {
    display: inline-flex;
}
.sales-product-dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    cursor: pointer;
    border-radius: 10px;
    font-size: 14px;
    color: #334155;
    transition: background 0.15s, transform 0.1s;
}
.sales-product-dropdown-item:hover {
    background: linear-gradient(135deg, #f0f6ff 0%, #eef2ff 100%);
}

/* =========================
   Warehouse ("Склад") modern UI
   ========================= */
.wh-ops-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.wh-suggest {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 8px);
    z-index: 10050;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(255, 255, 255, 0.75) inset;
    max-height: 260px;
    overflow-y: auto;
    padding: 6px;
    margin-top: 0;
}
.wh-suggest div {
    padding: 10px 12px;
    cursor: pointer;
    border-radius: 10px;
    border-bottom: none;
    font-size: 14px;
    color: #334155;
    transition: background 0.15s, transform 0.1s;
}
.wh-suggest div:hover,
.wh-suggest div.sel {
    background: linear-gradient(135deg, #f0f6ff 0%, #eef2ff 100%);
}
.wh-suggest-empty {
    padding: 14px 12px;
    text-align: center;
    cursor: default;
}
.wh-suggest-empty:hover {
    background: transparent !important;
}
.wh-suggest-empty p {
    margin: 0 0 10px;
    font-size: 13px;
    color: #64748b;
    line-height: 1.45;
}

.wh-doc-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
}
.wh-doc-badge {
    font-size: 12px;
    color: #64748b;
}
.wh-doc-inv-link {
    font-size: 12px;
    text-decoration: none;
    color: #64748b;
}
.wh-doc-inv-link:hover {
    text-decoration: underline;
    color: #334155;
}

.wh-doc-summary td {
    vertical-align: middle;
}
.wh-ops-table tbody tr.wh-doc-summary {
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    transition: box-shadow 0.15s, transform 0.12s, background 0.15s;
}
.wh-ops-table tbody tr.wh-doc-summary:hover {
    background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}
.wh-ops-table tbody tr.wh-doc-summary--inv {
    background: linear-gradient(180deg, rgba(239, 246, 255, 0.7) 0%, rgba(255, 255, 255, 1) 100%);
}
.wh-ops-table tbody tr.wh-doc-summary--inv:hover {
    background: linear-gradient(180deg, rgba(239, 246, 255, 0.85) 0%, rgba(255, 255, 255, 1) 100%);
}

.wh-doc-toggle.btn.btn-secondary.btn-sm {
    border-radius: 10px;
    min-height: 34px;
    padding: 6px 10px;
}

.wh-doc-detail td {
    background: #f8fafc !important;
    padding: 10px 16px 16px !important;
    border-bottom: 1px solid #e2e8f0;
}
.wh-doc-inner {
    padding: 14px 14px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 14px;
    border: 1px solid rgba(226, 232, 240, 0.95);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}
.wh-doc-inner-table {
    font-size: 13px;
    margin: 0;
}
.wh-doc-inner--split {
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.wh-doc-inner-h {
    margin: 0 0 8px;
    font-size: 15px;
    font-weight: 750;
    color: #0f172a;
    letter-spacing: -0.01em;
}
.wh-doc-inner-sum {
    margin: 0 0 10px;
    font-size: 13px;
}
.wh-doc-inner-block {
    margin: 0;
}
.wh-line-item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 220px;
}
.wh-line-item__img {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #94a3b8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    cursor: zoom-in;
}
.wh-line-item__img--empty {
    font-size: 12px;
}
.wh-line-item__meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.wh-line-item__name {
    color: #0f172a;
    font-weight: 600;
    text-decoration: none;
    line-height: 1.3;
}
.wh-line-item__name:hover {
    text-decoration: underline;
}
.wh-qty-editor {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.wh-qty-input {
    width: 86px;
    min-height: 34px;
    padding: 6px 10px;
    border: 1px solid #dbe2ea;
    border-radius: 10px;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
}
.wh-qty-input:focus {
    outline: none;
    border-color: #3b71e8;
    box-shadow: 0 0 0 3px rgba(59, 113, 232, 0.15);
}
.sales-product-dropdown-item__inner {
    flex: 1;
    min-width: 0;
}
.sales-product-dropdown-item__title {
    font-weight: 600;
    color: #0f172a;
    letter-spacing: -0.01em;
}
.sales-product-dropdown-item__meta {
    font-size: 12px;
    color: #64748b;
    margin-top: 4px;
    font-family: ui-monospace, monospace;
}
.sales-product-dropdown-item__price {
    font-size: 13px;
    font-weight: 600;
    color: #15803d;
    margin-top: 6px;
    letter-spacing: -0.02em;
}
.sales-product-dropdown-item__arrow {
    color: #3b71e8;
    font-weight: 600;
    opacity: 0.7;
    flex-shrink: 0;
}
.sales-product-dropdown-item__row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}
.sales-product-dropdown-item__thumb {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 10px;
    flex-shrink: 0;
    background: #f1f5f9;
}
.sales-product-dropdown-item__thumb--empty {
    display: inline-block;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #e8eef9, #f1f5f9);
    border: 1px dashed #cbd5e1;
}
.sales-prod-thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 10px;
    flex-shrink: 0;
    background: #f8fafc;
    border: 1px solid #e8ecf1;
}
.sales-prod-thumb--empty,
.sales-prod-thumb.sales-prod-thumb--empty {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: #f1f5f9;
    border: 1px dashed #cbd5e1;
    vertical-align: middle;
}
.sales-prod-thumb__ph {
    font-size: 9px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.sales-photo-hover-preview {
    position: fixed;
    z-index: 100000 !important;
    background: rgba(255,255,255,0.98);
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 8px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.25);
    pointer-events: none;
    left: 0;
    top: 0;
    transform: translateZ(0);
}
.sales-photo-hover-preview img {
    display: block;
    max-width: 45vw;
    max-height: 45vh;
    object-fit: contain;
    border-radius: 10px;
}
.sales-mock-prod-with-thumb {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.sales-mock-prod-with-thumb__text {
    flex: 1;
    min-width: 0;
}
.sales-mock-pay-actions {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}
.sales-mock-pay-hint {
    font-size: 12px;
    max-width: 220px;
    line-height: 1.35;
}
.sales-mock-btn--pay {
    min-width: 140px;
}
.sales-mock-empty-point-msg {
    margin: 0 20px 12px 20px;
}
.sales-mock-empty-intro {
    margin: 0;
    padding: 16px 20px;
    font-weight: 600;
    color: #475569;
    border-bottom: 1px solid #eef2f7;
}
.sales-mock-empty-create {
    margin: 0;
}
.sales-mock-empty-prod-name {
    display: block;
    font-weight: 600;
    color: #0f172a;
}
.sales-mock-empty-payment-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 16px;
    padding: 8px 0;
}
.sales-mock-label-inline {
    font-size: 14px;
    font-weight: 600;
    color: #334155;
    margin: 0;
}
.sales-mock-mixed-wrap {
    display: none;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
}
.sales-mock-mixed-label {
    font-size: 13px;
    color: #64748b;
    margin: 0;
}
.sales-mock-tr--empty-footer td {
    background: #fafbfd;
    border-top: 1px solid #eef2f7;
}
.sales-mock-hint--after-search {
    margin-top: 10px;
    margin-bottom: 0;
    font-size: 13px;
}
.sales-product-ids-hidden {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}
.sales-mock-matched-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.sales-mock-matched-block {
    padding-bottom: 8px;
    border-bottom: 1px dashed #e8ecf1;
}
.sales-mock-matched-block:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.sales-mock-matched-line {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.sales-mock-matched-text {
    flex: 1;
    min-width: 0;
}
.sales-mock-matched-title-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}
.sales-mock-matched-name {
    font-weight: 600;
    color: #0f172a;
    font-size: 14px;
}
.sales-mock-matched-qty {
    font-size: 13px;
    font-weight: 600;
    color: #3b71e8;
    white-space: nowrap;
}
.sales-mock-matched-sku {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 2px;
    font-family: ui-monospace, monospace;
}
.sales-mock-product-sku--client {
    margin-top: 8px;
    font-size: 12px;
}
.sales-mock-inline-filters--row2 {
    margin-top: 12px;
}
.sales-mock-inline-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}
.sales-mock-input {
    border: 1px solid #d8e0ea;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    min-width: 160px;
    background: #fff;
}
.sales-mock-input--date { min-width: 140px; }
.sales-mock-date-sep { color: #94a3b8; }
.sales-mock-select--inline {
    border: 1px solid #d8e0ea;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    background: #fff;
    min-width: 150px;
}
.sales-mock-actions-top {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}
.sales-mock-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}
.sales-mock-btn--primary {
    background: var(--sales-blue);
    color: #fff;
}
.sales-mock-btn--primary:hover { filter: brightness(1.05); }
.sales-mock-btn--ghost {
    background: #f1f5f9;
    color: #475569;
}
.sales-mock-btn--ghost:hover { background: #e2e8f0; }
.sales-mock-btn--accent {
    background: var(--sales-blue);
    color: #fff;
    margin-left: auto;
}
.sales-mock-card--table {
    padding: 0;
    overflow: hidden;
}
.sales-mock-table-wrap {
    border: none;
    border-radius: 0;
}
.sales-mock-table {
    margin: 0;
}
.sales-mock-table thead th {
    background: #f8fafc;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    font-weight: 600;
    padding: 14px 16px;
    border-bottom: 1px solid #eef2f7;
}
.sales-mock-table tbody td {
    padding: 14px 16px;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
}
.sales-mock-tr:hover { background: #fafbfd; }
.sales-mock-product-cell {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.sales-mock-thumb {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: linear-gradient(135deg, #e8eef9, #f1f5f9);
    color: #475569;
    font-weight: 700;
    font-size: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.sales-mock-product-name {
    font-weight: 600;
    color: #1e293b;
    font-size: 15px;
}
.sales-mock-product-sku {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 4px;
}
.sales-mock-qty {
    font-weight: 600;
    color: #334155;
}
.sales-mock-price {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
}
.sales-mock-discount {
    color: var(--sales-green);
    font-weight: 600;
    font-size: 14px;
}
.sales-mock-th-actions { width: 100px; }
.sales-mock-td-actions {
    text-align: right;
    white-space: nowrap;
}
.sales-mock-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid #e8ecf1;
    background: #f8fafc;
    text-decoration: none;
    margin-left: 6px;
    font-size: 14px;
    color: #475569;
}
.sales-mock-icon-btn:hover { background: #eef2f7; }
.sales-mock-icon-btn--danger:hover {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}
.sales-mock-icon-btn--save {
    background: #dbeafe;
    border-color: #93c5fd;
    color: #1d4ed8;
    cursor: pointer;
}
.sales-mock-icon-btn--save:hover { background: #bfdbfe; }
.sales-mock-filter-hint { font-size: 12px; margin: 0 0 8px 0; }
.sales-mock-col-qty,
.sales-mock-col-price,
.sales-mock-col-disc { vertical-align: top; }
.sales-mock-stack-field { margin-bottom: 0.4rem; margin-top: 0; }
.sales-mock-stack-field:last-child { margin-bottom: 0; }
.sales-mock-input--cell {
    width: 100%;
    max-width: 96px;
    padding: 0.35rem 0.45rem;
    font-size: 0.875rem;
    box-sizing: border-box;
}
.sales-mock-input--disc { max-width: 72px; display: inline-block; vertical-align: middle; }
.sales-mock-disc-suffix { margin-left: 2px; font-size: 0.85rem; color: #64748b; vertical-align: middle; }
.sales-mock-total-hint { margin-top: 0.35rem; font-size: 0.8rem; }
.sales-mock-disc-hint { margin-top: 0.35rem; font-size: 0.8rem; }
.sales-mock-footer {
    padding: 16px 20px;
    border-top: 1px solid #eef2f7;
    display: flex;
    justify-content: flex-end;
    background: #fafbfd;
}
.sales-mock-total {
    font-size: 15px;
    color: #475569;
}
.sales-mock-total strong {
    font-size: 18px;
    color: #0f172a;
}
.sales-mock-empty {
    text-align: center;
    color: #94a3b8;
    padding: 32px !important;
}
.sales-mock-pagination {
    padding: 12px 16px;
    justify-content: center;
    border-top: 1px solid #eef2f7;
    margin: 0;
}
.sales-mock-page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    color: #475569;
    background: #f1f5f9;
}
.sales-mock-page-link:hover { background: #e2e8f0; }
.sales-mock-page-link.is-active {
    background: var(--sales-blue);
    color: #fff;
}
@media (max-width: 768px) {
    .sales-mock-filters-top { flex-direction: column; align-items: stretch; }
    .sales-mock-btn--accent { margin-left: 0; }
    .sales-mock-inline-filters { flex-direction: column; align-items: stretch; }
    .sales-mock-input, .sales-mock-select--inline { width: 100%; max-width: none; }
}

/*
 * Продажа (v2): правила выше по файлу перебиваются блоком .sales-mock-input--cell (ниже по каскаду).
 * Этот блок обязан идти ПОСЛЕ .sales-mock-input--cell, иначе внешний вид «не меняется».
 */
body.sales-page-sale-v2 .sales-sale-v2__line .sales-sale-v2__input-price,
body.sales-page-sale-v2 .sales-sale-v2__line .sales-sale-v2__input-sum {
    width: auto;
    min-width: 104px;
    max-width: 140px;
    padding: 10px 30px 10px 12px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.25;
}
body.sales-page-sale-v2 .sales-sale-v2__line .sales-sale-v2__input-sum {
    font-weight: 700;
}
body.sales-page-sale-v2 .sales-sale-v2__line .sales-sale-v2__input-disc {
    max-width: 88px;
    min-width: 64px;
    padding: 10px 8px;
    font-size: 14px;
    font-weight: 600;
}
body.sales-page-sale-v2 .sales-sale-v2__line .sales-qty-stepper__input {
    width: 56px;
    min-width: 48px;
    max-width: none;
    padding: 10px 4px;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
}
body.sales-page-sale-v2 .sales-sale-v2__table .sales-prod-thumb,
body.sales-page-sale-v2 .sales-sale-v2__table .sales-prod-thumb--empty,
body.sales-page-sale-v2 .sales-sale-v2__table .sales-prod-thumb.sales-prod-thumb--empty {
    width: 56px;
    height: 56px;
    border-radius: 12px;
}
body.sales-page-sale-v2 .sales-sale-v2__table-title {
    font-size: 1.08rem;
    font-weight: 700;
    color: #0f172a;
}
body.sales-page-sale-v2 .sales-sale-v2__btn-save {
    min-height: 48px;
    font-size: 16px;
    letter-spacing: 0.01em;
}
body.sales-page-sale-v2 .sales-mock-tr--bonus .sales-mock-input--cell {
    max-width: 140px;
    min-width: 100px;
    padding: 10px 12px;
    font-size: 15px;
}

/* Действия сотрудника (карточка инфо / редактирование) */
.staff-actions-panel { overflow: hidden; }
.staff-actions-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0 0 8px;
    letter-spacing: -0.02em;
}
.staff-actions-lead { margin-top: -4px !important; margin-bottom: 16px !important; }
.staff-actions-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 20px;
    align-items: flex-end;
    padding: 16px 18px;
    background: var(--muted);
    border-radius: var(--radius);
    margin-bottom: 4px;
    border: 1px solid var(--border);
}
.staff-actions-toolbar__field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted-foreground);
    margin-bottom: 6px;
}
.staff-actions-toolbar__field--user .staff-actions-user-name {
    font-weight: 600;
    font-size: 15px;
}
.staff-actions-select,
.staff-actions-input {
    padding: 10px 14px;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 15px;
    background: var(--card);
    min-width: 140px;
}
.staff-actions-toolbar__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px;
    margin-left: auto;
}
.staff-actions-apply {
    background: var(--success) !important;
    color: #fff !important;
    border: none !important;
    padding: 10px 22px !important;
    border-radius: 12px !important;
    font-weight: 600 !important;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.35);
}
.staff-actions-apply:hover {
    filter: brightness(0.96);
}
.staff-actions-clear {
    font-size: 14px !important;
}
.staff-actions-tabs-wrap {
    overflow-x: auto;
    margin: 12px 0 0;
    -webkit-overflow-scrolling: touch;
    border-bottom: 1px solid var(--border);
}
.staff-actions-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
    align-items: flex-end;
    min-height: 44px;
    padding-bottom: 0;
}
.staff-actions-tab {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 10px 14px;
    border-radius: 12px 12px 0 0;
    text-decoration: none;
    color: var(--muted-foreground);
    font-weight: 500;
    font-size: 14px;
    border: 1px solid transparent;
    border-bottom: none;
    transition: background 0.15s, color 0.15s;
}
.staff-actions-tab:hover {
    background: var(--muted);
    color: var(--foreground);
}
.staff-actions-tab.is-active {
    background: var(--card);
    color: var(--primary);
    border-color: var(--border);
    font-weight: 600;
    border-bottom: 1px solid var(--card);
    margin-bottom: -1px;
}
.staff-actions-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(145deg, #6366f1 0%, #8b5cf6 100%);
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}
.staff-actions-avatar--sm {
    width: 28px;
    height: 28px;
    font-size: 12px;
}
.staff-actions-user-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}
.staff-actions-user-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
}
.staff-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.staff-badge--sale { background: #DCFCE7; color: #166534; }
.staff-badge--return { background: #FEE2E2; color: #991B1B; }
.staff-badge--shift-open { background: #E0F2FE; color: #0369A1; }
.staff-badge--shift-close { background: #FFEDD5; color: #C2410C; }
.staff-badge--receipt { background: #DBEAFE; color: #1D4ED8; }
.staff-badge--used { background: #F3E8FF; color: #7E22CE; }
.staff-badge--product { background: #ECFCCB; color: #3F6212; }
.staff-badge--import { background: #CFFAFE; color: #0E7490; }
.staff-badge--other { background: #F1F5F9; color: #475569; }
.staff-actions-table .staff-actions-time {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    white-space: nowrap;
    color: var(--foreground);
}
.staff-actions-col-check { width: 42px; text-align: center; }
.staff-actions-col-disc { width: 72px; text-align: right; white-space: nowrap; }
.staff-actions-disc { font-weight: 700; color: #1d4ed8; }
.staff-actions-col-time { width: 64px; }
.staff-actions-col-act { width: auto; min-width: 44px; text-align: center; white-space: nowrap; }
.staff-actions-shift-row-act {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
}
.staff-actions-shift-edit-hit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    border-radius: 12px;
    border: 1px solid rgba(37, 99, 235, 0.35);
    background: rgba(37, 99, 235, 0.08);
    font-size: 20px !important;
    line-height: 1;
    text-decoration: none !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.staff-actions-shift-edit-hit:hover {
    background: rgba(37, 99, 235, 0.14);
    border-color: rgba(37, 99, 235, 0.5);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15);
}
.staff-actions-shift-delete-form-inline {
    display: inline-flex !important;
    vertical-align: middle;
    align-items: center;
}
.staff-actions-shift-delete-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    margin: 0;
    border: 1px solid rgba(239, 68, 68, 0.35);
    border-radius: 12px;
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.08s ease;
}
.staff-actions-shift-delete-btn:hover {
    background: rgba(239, 68, 68, 0.18);
    border-color: rgba(239, 68, 68, 0.5);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.2);
}
.staff-actions-shift-delete-btn:active {
    transform: scale(0.96);
}
.staff-actions-shift-delete-btn:focus-visible {
    outline: 2px solid var(--danger);
    outline-offset: 2px;
}
.staff-actions-shift-delete-btn svg {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
}
.staff-actions-icon-link {
    text-decoration: none;
    font-size: 18px;
    color: var(--primary);
    font-weight: 700;
    line-height: 1;
}
button.staff-actions-icon-link {
    background: transparent;
    border: 0;
    padding: 0;
    cursor: pointer;
    font: inherit;
}
button.staff-actions-icon-link.text-danger {
    color: var(--danger);
}
.staff-actions-icon-muted { color: var(--muted-foreground); }
.staff-actions-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px 4px 4px;
    margin-top: 8px;
    border-top: 1px solid var(--border);
    font-size: 14px;
    color: var(--muted-foreground);
}
.staff-actions-page-btns {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}
.staff-actions-page-link {
    min-width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--muted);
    color: var(--foreground);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
}
.staff-actions-page-link:hover {
    background: #e2e8f0;
}
.staff-actions-page-link.is-active {
    background: var(--primary);
    color: #fff;
}
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.staff-actions-cb {
    opacity: 0.45;
    cursor: default;
    width: 16px;
    height: 16px;
}
@media (max-width: 900px) {
    .staff-actions-toolbar__actions {
        margin-left: 0;
        width: 100%;
    }
    .staff-actions-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ========== Журнал точки: сводка по товарам за период ========== */
.point-journal-product-summary {
    margin-top: 1.5rem;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: linear-gradient(160deg, #fff 0%, #f8fafc 100%);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.04);
    overflow: hidden;
}
.point-journal-product-summary__head {
    padding: 1.1rem 1.25rem 1rem;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.65);
}
.point-journal-product-summary__title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    margin-bottom: 0.35rem;
}
.point-journal-product-summary__title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--foreground);
    line-height: 1.25;
}
.point-journal-product-summary__badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--primary);
    background: rgba(37, 99, 235, 0.1);
    border: 1px solid rgba(37, 99, 235, 0.2);
}
.point-journal-product-summary__lead {
    margin: 0;
    font-size: 0.875rem;
    color: var(--muted-foreground);
    line-height: 1.45;
}
.point-journal-product-summary__body {
    padding: 0;
}
.point-journal-product-summary__empty {
    padding: 2rem 1.25rem 2.25rem;
    text-align: center;
}
.point-journal-product-summary__empty-title {
    margin: 0 0 6px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--foreground);
}
.point-journal-product-summary__empty-hint {
    margin: 0;
    font-size: 0.875rem;
    color: var(--muted-foreground);
    max-width: 28rem;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.5;
}
.point-journal-product-summary__table-wrap {
    margin: 0 !important;
    border-radius: 0;
}
.point-journal-product-summary__table {
    margin: 0 !important;
    font-size: 0.9375rem;
}
.point-journal-product-summary__table thead th {
    background: #f1f5f9;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 700;
    color: var(--muted-foreground);
    padding: 12px 16px !important;
    border-bottom: 1px solid var(--border);
}
.point-journal-product-summary__table tbody td {
    padding: 12px 16px !important;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
}
.point-journal-product-summary__table tbody tr:last-child td {
    border-bottom: none;
}
.point-journal-product-summary__table tbody tr {
    transition: background 0.12s ease;
}
.point-journal-product-summary__table tbody tr:hover {
    background: rgba(37, 99, 235, 0.04);
}
.point-journal-product-summary__cell-name {
    font-weight: 500;
    color: var(--foreground);
}
.point-journal-product-summary__cell-num {
    text-align: right !important;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    white-space: nowrap;
    color: var(--foreground);
}
.point-journal-product-summary__table tfoot th,
.point-journal-product-summary__table tfoot td {
    padding: 14px 16px !important;
    background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
    border-top: 2px solid rgba(37, 99, 235, 0.35);
    font-weight: 700;
    font-size: 0.9375rem;
}
.point-journal-product-summary__table tfoot .point-journal-product-summary__cell-num:not(.point-journal-product-summary__total-sum) {
    font-weight: 700;
}
.point-journal-product-summary__total-sum {
    font-size: 1.05rem;
    color: var(--primary);
}
@media (max-width: 560px) {
    .point-journal-product-summary__head {
        padding: 1rem 1rem 0.875rem;
    }
    .point-journal-product-summary__table thead th,
    .point-journal-product-summary__table tbody td,
    .point-journal-product-summary__table tfoot th,
    .point-journal-product-summary__table tfoot td {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }
}

/* ========== История продаж (sales_history.php) — сбалансированный размер шрифтов ========== */
.page-sales-history .main-content,
.page-sales-history .content {
    max-width: 1200px;
}
.page-sales-history .sh-page {
    padding-bottom: 2.5rem;
    font-size: 0.9375rem;
}
.page-sales-history .sh-head {
    margin-bottom: 1.5rem;
}
.page-sales-history .sh-head__row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
}
.page-sales-history .sh-title {
    margin: 0 0 0.4rem;
    font-size: clamp(1.5rem, 2.3vw, 1.95rem);
    font-weight: 700;
    letter-spacing: -0.022em;
    line-height: 1.18;
    color: var(--foreground, #0f172a);
}
.page-sales-history .sh-subtitle {
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.45;
    color: var(--muted-foreground, #64748b);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
}
.page-sales-history .sh-subtitle__period {
    font-weight: 600;
    color: #334155;
}
.page-sales-history .sh-subtitle__dot {
    opacity: 0.45;
    font-size: 1.1em;
}
.page-sales-history .sh-lead {
    margin: 0.85rem 0 0;
    max-width: 52rem;
    font-size: 0.9375rem;
    line-height: 1.58;
    color: #475569;
}
.page-sales-history .sh-lead a {
    color: var(--primary, #2563eb);
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid rgba(37, 99, 235, 0.35);
}
.page-sales-history .sh-lead a:hover {
    border-bottom-color: var(--primary, #2563eb);
}

.page-sales-history .sh-filters {
    background: linear-gradient(165deg, #ffffff 0%, #f1f5f9 55%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.8) inset,
        0 12px 40px -18px rgba(15, 23, 42, 0.2);
    padding: 1.25rem 1.4rem 1.4rem;
    margin-bottom: 1.5rem;
}
.page-sales-history .sh-filters__head {
    margin-bottom: 1.05rem;
    padding-bottom: 0.95rem;
    border-bottom: 1px solid #e2e8f0;
}
.page-sales-history .sh-filters__title {
    margin: 0 0 0.3rem;
    font-size: 1.0625rem;
    font-weight: 700;
    color: #0f172a;
}
.page-sales-history .sh-filters__intro {
    margin: 0;
    font-size: 0.875rem;
    color: #64748b;
    line-height: 1.5;
    max-width: 40rem;
}
.page-sales-history .sh-filters__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem 1.15rem;
    align-items: end;
}
.page-sales-history .sh-field--wide {
    grid-column: 1 / -1;
}
@media (min-width: 900px) {
    .page-sales-history .sh-field--wide {
        grid-column: span 2;
    }
}
.page-sales-history .sh-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #475569;
    margin-bottom: 0.38rem;
}
.page-sales-history .sh-input {
    width: 100%;
    min-height: 44px;
    font-size: 1rem !important;
    padding: 0.45rem 0.75rem !important;
    border-radius: 12px !important;
    border-width: 1px;
    border-color: #e2e8f0 !important;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.page-sales-history .sh-input:hover {
    border-color: #cbd5e1 !important;
}
.page-sales-history .sh-input:focus {
    border-color: var(--primary, #2563eb) !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
    outline: none;
}
.page-sales-history .sh-input--select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23475569' d='M3 4.5L6 7.5L9 4.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 2.35rem !important;
}
.page-sales-history .sh-filters__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem 0.85rem;
    margin-top: 1.15rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}
.page-sales-history .sh-filters__actions .btn {
    font-size: 1rem;
    padding: 0.5rem 1.1rem;
    border-radius: 12px;
    min-height: 44px;
}
.page-sales-history .sh-btn-primary {
    min-width: 9rem;
    font-weight: 600;
    box-shadow: 0 4px 16px -5px rgba(37, 99, 235, 0.5);
}

.page-sales-history .sh-alert {
    border-radius: 14px;
    padding: 1rem 1.2rem;
    font-size: 0.9375rem;
    line-height: 1.5;
}
.page-sales-history .sh-alert--error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}
.page-sales-history .sh-alert--success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.page-sales-history .sh-results {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.9) inset,
        0 12px 42px -20px rgba(15, 23, 42, 0.16);
    overflow: hidden;
}
.page-sales-history .sh-results__toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.65rem 1rem;
    padding: 0.95rem 1.25rem;
    background: linear-gradient(180deg, #f1f5f9 0%, #fff 55%);
    border-bottom: 1px solid #e2e8f0;
}
.page-sales-history .sh-results__title {
    margin: 0;
    font-size: 1.0625rem;
    font-weight: 700;
    color: #0f172a;
}
.page-sales-history .sh-results__stat {
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.45;
    color: #64748b;
}
.page-sales-history .sh-results__stat strong {
    color: #1e293b;
    font-weight: 700;
}

.page-sales-history .sh-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.page-sales-history .sh-table {
    width: 100%;
    min-width: 860px;
    border-collapse: collapse;
    font-size: 0.9375rem;
}
.page-sales-history .sh-table thead th {
    text-align: left;
    padding: 0.72rem 1.05rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.055em;
    text-transform: uppercase;
    color: #475569;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
}
.page-sales-history .sh-th--amount {
    text-align: right;
}
.page-sales-history .sh-th--action {
    width: 1%;
    padding-right: 1.25rem;
}
.page-sales-history .sh-table tbody td {
    padding: 0.8rem 1.05rem;
    border-bottom: 1px solid #eef2f7;
    vertical-align: middle;
    color: #1e293b;
}
.page-sales-history .sh-row:nth-child(even) td {
    background: #fafbfc;
}
.page-sales-history .sh-row:last-child td {
    border-bottom: none;
}
.page-sales-history .sh-row:hover td {
    background: #eff6ff !important;
}
.page-sales-history .sh-td--time {
    font-size: 0.9375rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    color: #1e293b;
    font-weight: 600;
    vertical-align: middle;
}
.page-sales-history .sh-time-clock {
    color: #64748b;
    font-weight: 500;
    font-size: 1em;
}
.page-sales-history .sh-order-num {
    display: inline-block;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.875rem;
    font-weight: 700;
    padding: 0.22rem 0.5rem;
    border-radius: 8px;
    background: #e8eef5;
    color: #1e293b;
}
.page-sales-history .sh-td--muted {
    color: #64748b;
    font-size: 0.9375rem;
}
.page-sales-history .sh-td--amount {
    text-align: right;
    white-space: nowrap;
}
.page-sales-history .sh-amount {
    font-size: 1.0625rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.012em;
    color: #0f172a;
}
.page-sales-history .sh-rub {
    margin-left: 0.2rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #64748b;
}
.page-sales-history .sh-td--action {
    text-align: right;
    padding-right: 1.25rem;
    white-space: nowrap;
}
.page-sales-history .sh-row-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.45rem;
    flex-wrap: wrap;
}
.page-sales-history .sh-link-open {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.42rem 0.85rem;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
    border: 1px solid #1d4ed8;
    text-decoration: none;
    box-shadow: 0 3px 12px -3px rgba(37, 99, 235, 0.5);
    transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}
.page-sales-history .sh-link-open:hover {
    filter: brightness(1.05);
    box-shadow: 0 5px 14px -4px rgba(37, 99, 235, 0.6);
    color: #fff;
}
.page-sales-history .sh-link-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.42rem 0.75rem;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 700;
    color: #b91c1c;
    background: #fff;
    border: 1px solid #fecaca;
    text-decoration: none;
    transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.page-sales-history .sh-link-delete:hover {
    color: #fff;
    background: #dc2626;
    border-color: #dc2626;
}
.page-sales-history .sh-link-return,
.page-sales-returns .sh-link-return {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.42rem 0.75rem;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(180deg, #f87171 0%, #dc2626 100%);
    border: 1px solid #b91c1c;
    cursor: pointer;
    box-shadow: 0 3px 12px -3px rgba(220, 38, 38, 0.45);
    transition: filter 0.12s ease, box-shadow 0.12s ease;
}
.page-sales-history .sh-link-return:hover,
.page-sales-returns .sh-link-return:hover {
    filter: brightness(1.05);
    box-shadow: 0 5px 14px -4px rgba(220, 38, 38, 0.55);
}
.page-sales-returns .btn-danger-soft {
    background: linear-gradient(180deg, #f87171 0%, #dc2626 100%);
    border-color: #b91c1c;
    color: #fff;
}
.page-sales-returns .sr-card__actions {
    display: grid;
    gap: 0.45rem;
    margin-top: 0.35rem;
}
.page-sales-returns .sr-modal__lines--pick .sr-line-qty,
.page-sales-history .sr-modal__lines--pick .sr-line-qty {
    width: 5.5rem;
    min-height: 36px;
    padding: 0.35rem 0.5rem;
}
.page-sales-returns .sr-th-check,
.page-sales-history .sr-th-check {
    width: 2.5rem;
}
.page-sales-returns .sr-qty-hint,
.page-sales-history .sr-qty-hint {
    display: block;
    font-size: 0.75rem;
    margin-top: 0.15rem;
}
.page-sales-history .sh-link-return.is-disabled,
.page-sales-returns .sh-link-return.is-disabled,
.page-sales-returns .sr-return-btn.is-disabled {
    opacity: 0.45;
    cursor: not-allowed;
    filter: grayscale(0.25);
    box-shadow: none;
}
.page-sales-history .sh-expand-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.65rem;
    height: 1.65rem;
    margin-right: 0.35rem;
    padding: 0;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    color: #475569;
    cursor: pointer;
    vertical-align: middle;
    flex-shrink: 0;
    transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.page-sales-history .sh-expand-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #0f172a;
}
.page-sales-history .sh-row--expandable.is-expanded td {
    background: #f8fafc;
}
.page-sales-history .sh-row-detail td {
    padding: 0 !important;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}
.page-sales-history .sh-receipt {
    padding: 1rem 1.25rem 1.15rem;
}
.page-sales-history .sh-receipt--return {
    border-left: 3px solid #dc2626;
}
.page-sales-history .sh-receipt__head {
    margin-bottom: 0.65rem;
}
.page-sales-history .sh-receipt__title {
    margin: 0 0 0.35rem;
    font-size: 0.9375rem;
    font-weight: 700;
    color: #0f172a;
}
.page-sales-history .sh-receipt__pay {
    margin: 0 0 0.35rem;
}
.page-sales-history .sh-receipt__pay-split {
    font-size: 0.8125rem;
}
.page-sales-history .sh-receipt__source {
    margin: 0.35rem 0 0;
    font-size: 0.875rem;
}
.page-sales-history .sh-receipt__source a {
    font-weight: 700;
}
.page-sales-history .sh-receipt__table-wrap {
    overflow-x: auto;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
}
.page-sales-history .sh-receipt__table {
    width: 100%;
    min-width: 320px;
    border-collapse: collapse;
    font-size: 0.875rem;
}
.page-sales-history .sh-receipt__table th,
.page-sales-history .sh-receipt__table td {
    padding: 0.5rem 0.65rem;
    border-bottom: 1px solid #eef2f7;
    text-align: left;
}
.page-sales-history .sh-receipt__table th {
    background: #f8fafc;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
}
.page-sales-history .sh-receipt__num {
    white-space: nowrap;
    text-align: right;
}
.page-sales-history .sh-receipt__total {
    margin: 0.65rem 0 0;
    font-size: 0.9375rem;
}
.page-sales-history .sh-receipt__total strong {
    font-size: 1.0625rem;
}
.page-sales-history .sh-receipt__total--return strong {
    color: #dc2626;
}
.page-sales-history .sh-receipt__actions {
    margin-top: 0.75rem;
}
.page-sales-history .sh-receipt__return-hint {
    margin: 0.5rem 0 0;
    font-size: 0.875rem;
}
.page-sales-history .sh-badge,
.page-sales-returns .sh-badge {
    display: inline-flex;
    margin-left: 0.35rem;
    padding: 0.12rem 0.45rem;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 700;
    vertical-align: middle;
    white-space: nowrap;
}
.page-sales-history .sh-badge--return-partial,
.page-sales-returns .sh-badge--return-partial {
    background: #fff7ed;
    color: #c2410c;
    border: 1px solid #fed7aa;
}
.page-sales-history .sh-badge--return-full,
.page-sales-returns .sh-badge--return-full {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}
.page-sales-history .sh-badge--return-line-done,
.page-sales-returns .sh-badge--return-line-done,
.page-sales-history .sh-receipt__table .sh-badge--return-line-done,
.page-sales-returns .sh-receipt__table .sh-badge--return-line-done {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}
.page-sales-history .sh-badge--return-line-partial,
.page-sales-returns .sh-badge--return-line-partial,
.page-sales-history .sh-receipt__table .sh-badge--return-line-partial,
.page-sales-returns .sh-receipt__table .sh-badge--return-line-partial {
    background: #fff7ed;
    color: #c2410c;
    border: 1px solid #fed7aa;
}
.page-sales-history .sh-badge--return-line-none,
.page-sales-returns .sh-badge--return-line-none {
    background: #f8fafc;
    color: #64748b;
    border: 1px solid #e2e8f0;
}
.page-sales-history .sh-row--return-partial,
.page-sales-returns .sh-row--return-partial {
    background: #fffbf7;
}
.page-sales-returns .sh-td--status {
    white-space: nowrap;
}
.page-sales-history .sh-receipt__return-col,
.page-sales-returns .sh-receipt__return-col {
    white-space: nowrap;
}
.page-sales-history .sr-line-row--done,
.page-sales-returns .sr-line-row--done {
    opacity: 0.72;
}
.page-sales-history .sr-line-status,
.page-sales-returns .sr-line-status {
    white-space: nowrap;
}
.page-sales-returns .sh-td--status .sh-badge,
.page-sales-returns .sr-line-status .sh-badge,
.page-sales-returns .sr-card__row--status .sh-badge,
.page-sales-history .sh-row-actions .sh-badge--return-action {
    margin-left: 0;
}
.page-sales-history .sh-badge--return-action,
.page-sales-returns .sh-badge--return-action {
    margin-left: 0;
    border: none;
    cursor: pointer;
    font: inherit;
    line-height: 1.2;
    transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.page-sales-history .sh-badge--return-action:not(:disabled):hover,
.page-sales-returns .sh-badge--return-action:not(:disabled):hover {
    box-shadow: 0 1px 0 rgba(194, 65, 12, 0.15);
    transform: translateY(-1px);
}
.page-sales-history .sh-badge--return-action.is-disabled,
.page-sales-returns .sh-badge--return-action.is-disabled {
    cursor: not-allowed;
    opacity: 0.65;
}
.page-sales-history .sh-receipt__return-done,
.page-sales-returns .sh-receipt__return-done {
    margin: 0.75rem 0 0;
}
.page-sales-history .sh-receipt__return-continue,
.page-sales-returns .sh-receipt__return-continue {
    margin-top: 0.75rem;
}
.page-sales-history .sr-modal-done,
.page-sales-returns .sr-modal-done {
    margin-top: 0.85rem;
    padding: 0.75rem 0.85rem;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}
.page-sales-history .sr-modal-done__title,
.page-sales-returns .sr-modal-done__title {
    margin: 0 0 0.5rem;
    font-size: 0.8125rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.page-sales-history .sr-modal-done__list,
.page-sales-returns .sr-modal-done__list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0.45rem;
}
.page-sales-history .sr-modal-done__item,
.page-sales-returns .sr-modal-done__item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem 0.75rem;
    font-size: 0.9375rem;
}
.page-sales-history .sr-modal-done__name,
.page-sales-returns .sr-modal-done__name {
    color: #334155;
}
.page-sales-history .sr-modal__empty-lines,
.page-sales-returns .sr-modal__empty-lines {
    color: #64748b;
    text-align: center;
    padding: 0.75rem;
}
.page-sales-history .sh-row-actions .sh-badge--return-action,
.page-sales-returns .sh-row-actions .sh-badge--return-action {
    margin-left: 0.35rem;
}
.page-sales-history .sr-modal__pick-tools,
.page-sales-returns .sr-modal__pick-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.5rem;
}
.sh-lead--compact {
    margin: -0.25rem 0 1rem;
    font-size: 0.9375rem;
}

.sh-pay,
.page-sales-history .sh-pay {
    display: inline-flex;
    align-items: center;
    padding: 0.22rem 0.58rem;
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 700;
    white-space: nowrap;
}
.sh-pay--cash,
.page-sales-history .sh-pay--cash {
    background: #ecfdf5;
    color: #047857;
}
.sh-pay--card,
.page-sales-history .sh-pay--card {
    background: #eff6ff;
    color: #1d4ed8;
}
.sh-pay--mixed,
.page-sales-history .sh-pay--mixed {
    background: #faf5ff;
    color: #6d28d9;
}
.sh-pay--bonus,
.page-sales-history .sh-pay--bonus {
    background: #fff7ed;
    color: #c2410c;
}
.sh-pay--transfer,
.page-sales-history .sh-pay--transfer {
    background: #f0fdfa;
    color: #0f766e;
}
.sh-pay--unpaid {
    background: #fff7ed;
    color: #c2410c;
    border: 1px solid #fed7aa;
}
.sh-pay--none,
.sh-pay--default,
.page-sales-history .sh-pay--none,
.page-sales-history .sh-pay--default {
    background: #f1f5f9;
    color: #64748b;
}

.page-sales-history .sh-table__empty-row td {
    padding: 2.5rem 1.35rem;
    border-bottom: none;
    background: linear-gradient(180deg, #fafbfc 0%, #f8fafc 100%);
}
.page-sales-history .sh-empty {
    text-align: center;
    max-width: 26rem;
    margin: 0 auto;
}
.page-sales-history .sh-empty__title {
    margin: 0 0 0.4rem;
    font-size: 1.0625rem;
    font-weight: 700;
    color: #1e293b;
}
.page-sales-history .sh-empty__text {
    margin: 0;
    font-size: 0.9375rem;
    color: #64748b;
    line-height: 1.55;
}

.page-sales-history .sh-pager {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0.85rem 1.25rem 1.1rem;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border-top: 1px solid #e2e8f0;
}
.page-sales-history .sh-pager__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.4rem;
    height: 2.4rem;
    padding: 0 0.5rem;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 700;
    color: #475569;
    background: #fff;
    border: 1px solid #e2e8f0;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.page-sales-history .sh-pager__link:hover {
    border-color: #cbd5e1;
    color: #0f172a;
}
.page-sales-history .sh-pager__link.is-active {
    background: var(--primary, #2563eb);
    border-color: var(--primary, #2563eb);
    color: #fff;
}

/* —— Мобильное приложение: нижняя панель, без горизонтального скролла, safe-area —— */
html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}
@media (max-width: 1024px) {
    body:not(.auth-page) {
        overflow-x: hidden;
        max-width: 100vw;
        /* Нижний отступ под док + чёлку/home indicator; верх — под статус-бар в standalone PWA */
        padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
        padding-top: env(safe-area-inset-top, 0px);
        padding-left: env(safe-area-inset-left, 0px);
        padding-right: env(safe-area-inset-right, 0px);
    }
    body:not(.auth-page) .main-wrap {
        min-height: 100dvh;
        min-height: -webkit-fill-available;
    }
    .toast {
        left: 12px;
        right: 12px;
        bottom: calc(96px + env(safe-area-inset-bottom, 0px));
        width: auto;
    }
}
.mobile-app-dock {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 38;
    box-sizing: border-box;
    padding: 10px 10px calc(10px + env(safe-area-inset-bottom, 0px));
    grid-template-columns: repeat(var(--mobile-dock-cols, 5), minmax(0, 1fr));
    gap: 6px;
    align-items: stretch;
    background: rgba(255, 255, 255, 0.94);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--border);
    box-shadow: 0 -10px 36px rgba(15, 23, 42, 0.1);
    transition: transform 0.22s ease, opacity 0.2s ease;
}
@media (max-width: 1024px) {
    .mobile-app-dock {
        display: grid;
    }
}
@media (min-width: 1025px) {
    .mobile-app-dock {
        display: none !important;
    }
}
body.sidebar-is-open .mobile-app-dock {
    transform: translateY(110%);
    opacity: 0;
    pointer-events: none;
}
.mobile-app-dock__btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 72px;
    padding: 8px 4px;
    border: none;
    border-radius: 16px;
    background: transparent;
    color: var(--muted-foreground);
    text-decoration: none;
    font: inherit;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
.mobile-app-dock__btn.is-active {
    color: var(--primary);
    background: rgba(37, 99, 235, 0.1);
    font-weight: 600;
}
.mobile-app-dock__btn--menu {
    color: var(--foreground);
}
.mobile-app-dock__ic {
    display: flex;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.mobile-app-dock__ic .sidebar-nav-icon-svg {
    width: 30px;
    height: 30px;
}
.mobile-app-dock__txt {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.15;
    text-align: center;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.mobile-app-dock__btn:active {
    transform: scale(0.96);
    background: rgba(37, 99, 235, 0.08);
}
@media (max-width: 640px) {
    body:not(.auth-page) {
        padding-bottom: calc(100px + env(safe-area-inset-bottom, 0px));
    }
    .mobile-app-dock {
        padding: 12px 12px calc(12px + env(safe-area-inset-bottom, 0px));
        gap: 8px;
    }
    .mobile-app-dock__btn {
        min-height: 78px;
        padding: 10px 4px;
        border-radius: 18px;
    }
    .mobile-app-dock__ic {
        width: 38px;
        height: 38px;
    }
    .mobile-app-dock__ic .sidebar-nav-icon-svg {
        width: 32px;
        height: 32px;
    }
    .mobile-app-dock__txt {
        font-size: 14px;
    }
    .toast {
        bottom: calc(104px + env(safe-area-inset-bottom, 0px));
    }
}

/* Settings page modern shell */
.settings-modern {
    max-width: 1240px;
    margin: 0 auto;
    padding: 4px 6px 18px;
}
.settings-modern__hero {
    background: #fff;
    border: 1px solid #e8ecf0;
    border-radius: 24px;
    padding: 20px 22px 18px;
    margin-bottom: 16px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}
.settings-modern__hero-main {
    max-width: 100%;
}
.settings-modern__hero-title-block {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 2px;
}
.settings-modern__hero-title-block > .settings-icon {
    width: 48px;
    height: 48px;
    margin-top: 2px;
}
.settings-modern__hero-titles {
    flex: 1;
    min-width: 0;
}
.settings-modern__title {
    margin: 0;
    font-size: 1.42rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #2d3748;
}
.settings-modern__sub { margin: 7px 0 0; color: #6b7280; font-size: 13px; }
.settings-modern__tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 14px 0 0;
    border-bottom: 1px solid #e8ecf0;
    padding-bottom: 0;
}
.settings-modern__company-form {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e8ecf0;
}
.settings-modern__company-label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 13px;
    color: #4a5568;
}
.settings-modern__company-label > .settings-icon {
    width: 36px;
    height: 36px;
}
.settings-modern__company-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 12px;
    align-items: center;
}
.settings-modern__company-input {
    flex: 1 1 240px;
    min-width: 0;
    max-width: 520px;
}
/* Иконки в блоках настроек */
.settings-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #dbeafe;
    box-shadow: none;
}
.settings-icon .sidebar-nav-icon-svg {
    width: 20px;
    height: 20px;
}
.settings-summary-inner {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.settings-summary-inner > span:last-child {
    line-height: 1.25;
}
.settings-summary-inner--integration {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    row-gap: 6px;
}
.wa-int__summary-text {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
    line-height: 1.2;
    text-align: left;
}
.settings-card-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 10px;
}
.settings-card-head .settings-card-head__title {
    margin: 0;
}
.settings-card-head > .settings-icon {
    width: 44px;
    height: 44px;
}
.settings-modern__tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: none;
    border-radius: 10px 10px 0 0;
    background: transparent;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}
.settings-modern__tab:hover {
    color: #4a667a;
    background: #f1f4f8;
}
.settings-modern__tab > .settings-icon {
    width: 34px;
    height: 34px;
}
.settings-modern__tab > .settings-icon .sidebar-nav-icon-svg {
    width: 17px;
    height: 17px;
}
.settings-trash-tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    margin-left: 2px;
    border-radius: 999px;
    background: #fee2e2;
    color: #b91c1c;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    vertical-align: middle;
}
.settings-modern__tab--trash:hover .settings-trash-tab-badge {
    background: #fecaca;
}
.settings-modern__tab--active {
    color: #1d4ed8;
    background: linear-gradient(180deg, #eff6ff 0%, #f8fafc 100%);
    box-shadow: inset 0 -2px 0 #2563eb;
}
.settings-modern__tab--active > .settings-icon {
    background: #dbeafe;
    color: #1d4ed8;
    border-color: #bfdbfe;
}

/* Корзина (settings_trash.php) */
.page-trash .page-title {
    display: none;
}
.trash-page__hero > .settings-modern__hero-main {
    padding-bottom: 4px;
}
.trash-page__back {
    margin: 10px 0 0;
}
.trash-page__back .btn {
    margin: 0;
}
.trash-page__hero .settings-icon {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fecaca;
    box-shadow: none;
}
.trash-page__alert {
    border-radius: 14px;
    padding: 12px 16px;
    margin-bottom: 14px;
    font-size: 14px;
    line-height: 1.45;
    border: 1px solid transparent;
}
.trash-page__alert--success {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #065f46;
}
.trash-page__alert--info {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #475569;
}
.trash-page__alert--error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}
.trash-page__stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}
.trash-page__stat {
    background: #fff;
    border: 1px solid #e8ecf0;
    border-radius: 18px;
    padding: 16px 18px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 88px;
}
.trash-page__stat--muted .trash-page__stat-value {
    color: #64748b;
}
.trash-page__stat--action {
    justify-content: center;
    align-items: stretch;
}
.trash-page__stat--action form {
    margin: 0;
    height: 100%;
    display: flex;
    align-items: center;
}
.trash-page__stat--action .btn {
    width: 100%;
}
.trash-page__stat-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #64748b;
}
.trash-page__stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #1e293b;
    line-height: 1.1;
}
.trash-page__stat-hint {
    font-size: 13px;
    color: #64748b;
    line-height: 1.4;
}
.trash-page__empty {
    text-align: center;
    padding: 48px 24px;
    border-radius: 22px;
}
.trash-page__empty-icon {
    display: inline-flex;
    margin-bottom: 12px;
    transform: scale(1.35);
    opacity: 0.85;
}
.trash-page__empty-icon .settings-icon {
    width: 56px;
    height: 56px;
}
.trash-page__empty-title {
    margin: 0 0 8px;
    font-size: 1.15rem;
    font-weight: 700;
    color: #334155;
}
.trash-page__empty-text {
    margin: 0 0 18px;
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
}
.trash-page__list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.trash-page__item {
    background: #fff;
    border: 1px solid #e8ecf0;
    border-radius: 18px;
    padding: 16px 18px;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.04);
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 14px 20px;
    align-items: center;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.trash-page__item:hover {
    border-color: #cbd5e1;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.07);
}
.trash-page__item-main {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
}
.trash-page__item-text {
    min-width: 0;
}
.trash-page__item-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.35;
}
.trash-page__item-sub {
    margin: 4px 0 0;
    font-size: 13px;
    color: #64748b;
    line-height: 1.35;
}
.trash-page__type-badge {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}
.trash-page__item[data-type="product"] .trash-page__type-badge,
.trash-page__item[data-type="product-photo"] .trash-page__type-badge {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #bfdbfe;
}
.trash-page__item[data-type="client"] .trash-page__type-badge {
    background: #f0fdf4;
    color: #15803d;
    border-color: #bbf7d0;
}
.trash-page__item[data-type="order-sale"] .trash-page__type-badge,
.trash-page__item[data-type="order-purchase"] .trash-page__type-badge {
    background: #fff7ed;
    color: #c2410c;
    border-color: #fed7aa;
}
.trash-page__item-meta {
    grid-column: 1;
    grid-row: 2;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.trash-page__meta-chip {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 10px;
    padding: 8px 12px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    font-size: 12px;
}
.trash-page__meta-chip--warn {
    background: #fffbeb;
    border-color: #fde68a;
}
.trash-page__meta-label {
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 10px;
}
.trash-page__meta-value {
    font-weight: 600;
    color: #334155;
    white-space: nowrap;
}
.trash-page__meta-remain {
    font-size: 11px;
    font-weight: 700;
    color: #b45309;
    padding: 2px 8px;
    border-radius: 999px;
    background: #fef3c7;
}
.trash-page__item-actions {
    grid-column: 2;
    grid-row: 1 / span 2;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
    min-width: 148px;
}
.trash-page__item-actions form {
    margin: 0;
}
.trash-page__item-actions .btn {
    width: 100%;
    justify-content: center;
}
.trash-page__btn-danger {
    color: #b91c1c !important;
    border-color: #fecaca !important;
}
.trash-page__btn-danger:hover {
    background: #fef2f2 !important;
    color: #991b1b !important;
}
@media (max-width: 768px) {
    .trash-page__item {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }
    .trash-page__item-meta {
        grid-row: auto;
    }
    .trash-page__item-actions {
        grid-column: 1;
        grid-row: auto;
        flex-direction: row;
        flex-wrap: wrap;
        min-width: 0;
    }
    .trash-page__item-actions .btn {
        width: auto;
        flex: 1 1 auto;
    }
}

/* Сценарии (settings_scenarios.php) */
.page-settings-scenarios .page-title {
    display: none;
}
.scenarios-page__hero > .settings-modern__hero-main {
    padding-bottom: 4px;
}
.scenarios-page__back {
    margin: 10px 0 0;
}
.scenarios-page__back .btn {
    margin: 0;
}
.scenarios-page__alert {
    margin: 0 0 14px;
    padding: 12px 16px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid transparent;
}
.scenarios-page__alert--success {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #047857;
}
.scenarios-page__alert--error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}
.scenarios-page__how {
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 55%, #eff6ff 100%);
    border-color: #e2e8f0 !important;
    padding: 18px 20px !important;
}
.scenarios-page__how-head {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}
.scenarios-page__how-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: linear-gradient(135deg, #dbeafe 0%, #eff6ff 100%);
    color: #2563eb;
    flex-shrink: 0;
    border: 1px solid #bfdbfe;
}
.scenarios-page__how-title {
    margin: 0 0 4px;
    font-size: 1.02rem;
    font-weight: 800;
    color: #1e293b;
    letter-spacing: -0.02em;
}
.scenarios-page__how-text {
    margin: 0;
    color: #64748b;
    font-size: 14px;
    line-height: 1.55;
}
.scenarios-page__steps {
    list-style: none;
    margin: 16px 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
}
.scenarios-page__step {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}
.scenarios-page__step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: #2563eb;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
}
.scenarios-page__step-label {
    font-size: 13px;
    font-weight: 700;
    color: #334155;
}
.scenarios-page__step-arrow {
    color: #94a3b8;
    font-size: 16px;
    font-weight: 700;
}
.scenarios-page__form-card {
    padding: 20px 22px !important;
}
.scenarios-page__form-sub {
    margin: 4px 0 0;
    font-size: 13px;
    color: #64748b;
}
.scenarios-page__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 18px;
    margin-top: 18px;
}
.scenarios-page__field label {
    display: block;
    margin-bottom: 7px;
    font-size: 13px;
    font-weight: 700;
    color: #334155;
}
.scenarios-page__optional {
    font-weight: 500;
    color: #94a3b8;
    font-size: 12px;
}
.scenarios-page__field--wide {
    grid-column: 1 / -1;
}
.scenarios-page__field--full {
    grid-column: 1 / -1;
}
.scenarios-page__field input[type="text"],
.scenarios-page__field select,
.scenarios-page__field textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 11px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 14px;
    background: #fff;
    color: #1e293b;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.scenarios-page__field input[type="text"]:focus,
.scenarios-page__field select:focus,
.scenarios-page__field textarea:focus {
    outline: none;
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.scenarios-page__field textarea {
    resize: vertical;
    min-height: 92px;
    line-height: 1.5;
}
.scenarios-page__toggles {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid #eef2f7;
}
.scenarios-page__toggles-title {
    margin: 0 0 12px;
    font-size: 13px;
    font-weight: 800;
    color: #334155;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.scenarios-page__toggle-list {
    display: grid;
    gap: 10px;
}
.scenarios-page__toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid #e8ecf0;
    background: #f8fafc;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.scenarios-page__toggle:hover {
    background: #f1f5f9;
    border-color: #dbe3ec;
}
.scenarios-page__toggle-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.scenarios-page__toggle-text strong {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
}
.scenarios-page__toggle-text span {
    font-size: 12px;
    color: #64748b;
    line-height: 1.4;
}
.scenarios-page__switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 28px;
    flex-shrink: 0;
}
.scenarios-page__switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.scenarios-page__switch-slider {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: #cbd5e1;
    transition: background 0.2s ease;
}
.scenarios-page__switch-slider::before {
    content: "";
    position: absolute;
    width: 22px;
    height: 22px;
    left: 3px;
    top: 3px;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.18);
    transition: transform 0.2s ease;
}
.scenarios-page__switch input:checked + .scenarios-page__switch-slider {
    background: #2563eb;
}
.scenarios-page__switch input:checked + .scenarios-page__switch-slider::before {
    transform: translateX(20px);
}
.scenarios-page__switch input:focus-visible + .scenarios-page__switch-slider {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}
.scenarios-page__form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}
.scenarios-page__list-section {
    margin-top: 4px;
}
.scenarios-page__list-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 12px;
    padding: 0 4px;
}
.scenarios-page__list-title {
    margin: 0;
    font-size: 1.08rem;
    font-weight: 800;
    color: #1e293b;
    letter-spacing: -0.02em;
}
.scenarios-page__list-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 26px;
    padding: 0 8px;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 800;
    border: 1px solid #dbeafe;
}
.scenarios-page__list {
    display: grid;
    gap: 12px;
}
.scenarios-page__item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px 20px;
    align-items: start;
    padding: 18px 20px;
    border-radius: 18px;
    border: 1px solid #e8ecf0;
    background: #fff;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.04);
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.scenarios-page__item:hover {
    border-color: #dbe3ec;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.07);
}
.scenarios-page__item--off {
    opacity: 0.72;
    background: #f8fafc;
}
.scenarios-page__item-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.scenarios-page__section-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}
.scenarios-page__item[data-tone="violet"] .scenarios-page__section-badge {
    background: #ede9fe;
    color: #6d28d9;
    border: 1px solid #ddd6fe;
}
.scenarios-page__item[data-tone="blue"] .scenarios-page__section-badge {
    background: #dbeafe;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}
.scenarios-page__item[data-tone="emerald"] .scenarios-page__section-badge {
    background: #d1fae5;
    color: #047857;
    border: 1px solid #a7f3d0;
}
.scenarios-page__item[data-tone="amber"] .scenarios-page__section-badge {
    background: #fef3c7;
    color: #b45309;
    border: 1px solid #fde68a;
}
.scenarios-page__item[data-tone="rose"] .scenarios-page__section-badge {
    background: #ffe4e6;
    color: #be123c;
    border: 1px solid #fecdd3;
}
.scenarios-page__item[data-tone="slate"] .scenarios-page__section-badge {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}
.scenarios-page__off-badge {
    display: inline-flex;
    padding: 3px 8px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
}
.scenarios-page__item-title {
    margin: 0 0 6px;
    font-size: 1rem;
    font-weight: 800;
    color: #1e293b;
    letter-spacing: -0.02em;
}
.scenarios-page__item-instruction {
    margin: 0 0 12px;
    font-size: 13px;
    line-height: 1.5;
    color: #64748b;
}
.scenarios-page__item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}
.scenarios-page__meta-chip {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 12px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #eef2f7;
    min-width: 120px;
}
.scenarios-page__meta-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
}
.scenarios-page__meta-value {
    font-size: 13px;
    font-weight: 700;
    color: #334155;
}
.scenarios-page__assignee {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.scenarios-page__assignee-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1d4ed8;
    font-size: 11px;
    font-weight: 800;
}
.scenarios-page__action-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.scenarios-page__action-chip {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    border: 1px solid transparent;
}
.scenarios-page__action-chip--blue {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #dbeafe;
}
.scenarios-page__action-chip--violet {
    background: #f5f3ff;
    color: #6d28d9;
    border-color: #ede9fe;
}
.scenarios-page__action-chip--emerald {
    background: #ecfdf5;
    color: #047857;
    border-color: #a7f3d0;
}
.scenarios-page__item-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 120px;
}
.scenarios-page__item-actions form {
    margin: 0;
}
.scenarios-page__item-actions .btn {
    width: 100%;
    justify-content: center;
}
.scenarios-page__btn-danger {
    color: #b91c1c !important;
    border-color: #fecaca !important;
}
.scenarios-page__btn-danger:hover {
    background: #fef2f2 !important;
    color: #991b1b !important;
}
.scenarios-page__empty {
    text-align: center;
    padding: 36px 24px !important;
}
.scenarios-page__empty-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 12px;
}
.scenarios-page__empty-icon .settings-icon {
    width: 52px;
    height: 52px;
}
.scenarios-page__empty-title {
    margin: 0 0 8px;
    font-size: 1.05rem;
    font-weight: 800;
    color: #1e293b;
}
.scenarios-page__empty-text {
    margin: 0 auto 16px;
    max-width: 420px;
    font-size: 14px;
    color: #64748b;
    line-height: 1.55;
}
@media (max-width: 768px) {
    .scenarios-page__grid {
        grid-template-columns: 1fr;
    }
    .scenarios-page__field--wide {
        grid-column: auto;
    }
    .scenarios-page__item {
        grid-template-columns: 1fr;
    }
    .scenarios-page__item-actions {
        flex-direction: row;
        flex-wrap: wrap;
        min-width: 0;
    }
    .scenarios-page__item-actions .btn {
        width: auto;
        flex: 1 1 auto;
    }
    .scenarios-page__steps {
        gap: 8px;
    }
    .scenarios-page__step-arrow {
        display: none;
    }
}

.settings-modern .card {
    border: 1px solid #e8ecf0;
    border-radius: 20px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.04);
    background: #fff;
    padding: 18px 18px;
    margin-bottom: 16px !important;
}
.settings-modern .card .card-heading {
    font-size: 1.08rem;
    margin-top: 0;
    color: #2d3748;
}
.settings-modern .btn.btn-secondary {
    background: #2563eb;
    border-color: #1d4ed8;
    color: #fff;
}
.settings-modern .btn {
    border-radius: 12px;
    padding: 14px 26px;
    min-height: 50px;
    font-size: 1rem;
    font-weight: 700;
    box-sizing: border-box;
    align-items: center;
    display: inline-flex;
    justify-content: center;
    gap: 8px;
    border: 1px solid #1d4ed8;
}
.settings-modern .btn.btn-sm {
    padding: 11px 18px;
    min-height: 44px;
    font-size: 0.9375rem;
}
.settings-modern .btn.btn-primary {
    background: #2563eb;
    color: #fff;
    border: 1px solid #1d4ed8;
    box-shadow: 0 1px 2px rgba(37, 99, 235, 0.35);
}
.settings-modern .btn.btn-primary:hover:not(:disabled):not([disabled]) {
    background: #1d4ed8;
    border-color: #1e40af;
    color: #fff;
    opacity: 1;
}
/* Подпись + кнопка-действие в карточках настроек */
.settings-modern .settings-card-action {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 18px;
    margin-top: 6px;
}
.settings-modern .settings-card-action + .settings-card-action {
    margin-top: 12px;
}
.settings-modern .settings-card-action__label {
    flex: 0 0 auto;
    max-width: 100%;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #64748b;
    line-height: 1.3;
}
.settings-modern a.settings-card-action__btn {
    text-decoration: none;
}
.settings-modern .settings-card-action__btn::after {
    content: '›';
    font-size: 1.2rem;
    font-weight: 400;
    line-height: 1;
    margin-left: 2px;
    opacity: 0.75;
}
.settings-modern .settings-card-actions--row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 12px;
    align-items: center;
    margin-top: 8px;
}
.settings-modern .settings-card-actions--row .btn {
    margin: 0;
}
.settings-modern input[type="text"],
.settings-modern input[type="email"],
.settings-modern input[type="url"],
.settings-modern input[type="password"],
.settings-modern input[type="number"],
.settings-modern select,
.settings-modern textarea {
    border: 1px solid #dce2ea;
    border-radius: 10px;
    min-height: 38px;
    padding: 8px 11px;
    background: #fff;
}
.settings-modern label {
    font-weight: 600;
    color: #4a5568;
    font-size: 13px;
}
.settings-modern .muted {
    color: #718096;
}
.settings-modern .msg {
    border-radius: 10px;
}
/* Онлайн-каталог: крупная галочка рядом с подписью переключателя */
.oc-enable-label {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    user-select: none;
    margin: 0;
    padding: 14px 18px 14px 14px;
    max-width: 100%;
    box-sizing: border-box;
    border-radius: 16px;
    background: #f4f6f9;
    border: 1px solid #e6eaf0;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.oc-enable-label:hover {
    background: #eef1f6;
    border-color: #dde3eb;
}
.oc-enable-label__input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.oc-enable-label__mark {
    flex-shrink: 0;
    width: 58px;
    height: 58px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 2px solid #d9dfe8;
    color: #9aa5b5;
    transition:
        background 0.18s ease,
        border-color 0.18s ease,
        color 0.18s ease,
        box-shadow 0.18s ease;
}
.oc-enable-label__svg {
    display: block;
}
.oc-enable-label__tick {
    opacity: 0.38;
    transform: scale(0.92);
    transform-origin: center;
    transition: opacity 0.18s ease, transform 0.2s ease;
}
.oc-enable-label__input:checked + .oc-enable-label__mark {
    background: linear-gradient(160deg, #ecfdf7 0%, #d1fae5 100%);
    border-color: #6dc9a4;
    color: #0f766e;
    box-shadow: 0 2px 8px rgba(15, 118, 110, 0.12);
}
.oc-enable-label__input:checked + .oc-enable-label__mark .oc-enable-label__tick {
    opacity: 1;
    transform: scale(1);
}
.oc-enable-label__input:focus-visible + .oc-enable-label__mark {
    outline: none;
    box-shadow: 0 0 0 3px rgba(94, 129, 172, 0.35);
}
.oc-enable-label__text {
    font-size: 1.0625rem;
    font-weight: 600;
    color: #3f4d5c;
    line-height: 1.35;
}
.oc-enable-label__input:checked ~ .oc-enable-label__text {
    color: #2f3d4a;
}
/* Настройки: полноширинный «кабинетный» вид (светлый фон, карточки на всю область) */
body.page-settings .main-content {
    background: #f3f5f8;
    padding: 16px 18px 32px;
    border-radius: 0;
    min-height: calc(100vh - 120px);
    box-sizing: border-box;
}
@media (min-width: 1025px) {
    body.page-settings .main-content {
        padding: 18px 22px 36px;
    }
}
body.page-settings .page-title {
    margin: 0 0 12px;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #2d3748;
}
body.page-settings .main-content > .msg {
    margin-bottom: 12px;
}
body.page-settings .settings-modern {
    max-width: none;
    width: 100%;
    margin: 0;
    padding: 0 0 8px;
}
body.page-settings .settings-modern__hero:not(.settings-modern__hero--dashboard) {
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 12px 28px rgba(15, 23, 42, 0.04);
}
body.page-settings .settings-modern__hero--dashboard {
    box-shadow: none;
}
body.page-settings .settings-modern .card {
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.04);
}
/* Раскрытия в настройках: спокойные нейтральные «чипы» без холодного синего */
body.page-settings .settings-modern details.owner-panel-details > .owner-panel-summary,
body.page-settings .settings-modern details.bonus-details > .bonus-summary,
body.page-settings .settings-modern details.wa-int__details > .wa-int__summary {
    display: inline-flex !important;
    align-items: center;
    width: auto !important;
    max-width: max-content !important;
    box-sizing: border-box;
    justify-content: flex-start;
    gap: 6px;
    padding: 8px 14px !important;
    border-radius: 12px !important;
    font-size: 0.8125rem !important;
    font-weight: 600;
    background: #f5f7fa !important;
    color: #475569 !important;
    border: 1px solid #e4e9f0 !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.035);
}
body.page-settings .settings-modern details.owner-panel-details > .owner-panel-summary:hover,
body.page-settings .settings-modern details.bonus-details > .bonus-summary:hover,
body.page-settings .settings-modern details.wa-int__details > .wa-int__summary:hover {
    background: #eef1f5 !important;
    border-color: #d6dde6 !important;
    opacity: 1;
}
body.page-settings .settings-modern details.wa-int__details > .wa-int__summary {
    flex-wrap: wrap;
}
body.page-settings .settings-modern details.owner-panel-details > .owner-panel-summary::before,
body.page-settings .settings-modern details.bonus-details > .bonus-summary::before,
body.page-settings .settings-modern details.wa-int__details > .wa-int__summary::before {
    margin-right: 0;
    opacity: 0.65;
    color: #7c8aa0;
}
body.page-settings .settings-modern details.wa-int__details[open] > .wa-int__summary {
    border-radius: 12px 12px 0 0 !important;
    box-shadow: none;
    background: #eceff3 !important;
    border-bottom-color: #dfe4ea !important;
}
body.page-settings .settings-modern details.owner-panel-details[open] > .owner-panel-summary,
body.page-settings .settings-modern details.bonus-details[open] > .bonus-summary {
    border-radius: 12px 12px 0 0 !important;
    box-shadow: none;
    background: #eceff3 !important;
    border-bottom-color: #dfe4ea !important;
}
body.page-settings .settings-modern details.wa-int__details > .wa-int__summary .wa-int__summary-title {
    color: #334155 !important;
}
body.page-settings .settings-modern details.wa-int__details > .wa-int__summary .wa-int__summary-note {
    color: #64748b !important;
    opacity: 1 !important;
}
body.page-settings .settings-modern .wa-int__summary-note {
    font-size: 0.78rem !important;
}
body.page-settings .catalog-settings-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-start;
}
body.page-settings .catalog-settings-toolbar > .catalog-details {
    flex: 0 0 auto;
    width: auto;
    max-width: 100%;
}
body.page-settings .catalog-settings-toolbar .catalog-summary {
    display: inline-flex !important;
    width: auto !important;
    max-width: max-content !important;
    box-sizing: border-box;
    justify-content: flex-start;
    text-align: left;
    padding: 8px 14px !important;
    border-radius: 12px !important;
    font-size: 0.8125rem !important;
    font-weight: 600;
    color: #475569 !important;
    background: #f5f7fa !important;
    border: 1px solid #e4e9f0 !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.035);
}
body.page-settings .catalog-settings-toolbar .catalog-summary:hover {
    background: #eef1f5 !important;
    border-color: #d6dde6 !important;
    opacity: 1;
}
body.page-settings .catalog-settings-toolbar .catalog-details[open] > .catalog-summary {
    border-radius: 12px 12px 0 0 !important;
    background: #eceff3 !important;
    border-bottom-color: #dfe4ea !important;
}
/* Иконки в чипах настроек: приглушённые, без яркого синего */
body.page-settings .settings-modern details.owner-panel-details > .owner-panel-summary .settings-icon,
body.page-settings .settings-modern details.bonus-details > .bonus-summary .settings-icon,
body.page-settings .settings-modern details.wa-int__details > .wa-int__summary .settings-icon,
body.page-settings .catalog-settings-toolbar .catalog-summary .settings-icon {
    background: #eff6ff;
    border: 1px solid #dbeafe;
    color: #2563eb;
    box-shadow: none;
}
body.page-settings .settings-modern details.owner-panel-details > .owner-panel-summary .settings-icon .sidebar-nav-icon-svg,
body.page-settings .settings-modern details.bonus-details > .bonus-summary .settings-icon .sidebar-nav-icon-svg,
body.page-settings .settings-modern details.wa-int__details > .wa-int__summary .settings-icon .sidebar-nav-icon-svg,
body.page-settings .catalog-settings-toolbar .catalog-summary .settings-icon .sidebar-nav-icon-svg {
    filter: none;
}

/* Owner panel visibility settings */
.owner-panel-details { border: none; }
.owner-panel-summary {
    cursor: pointer;
    list-style: none;
    display: inline-block;
    font-weight: 600;
    font-size: 0.8125rem;
    padding: 8px 14px;
    border-radius: 12px;
    background: #f5f7fa;
    color: #475569;
    border: 1px solid #e4e9f0;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.035);
}
.owner-panel-summary:hover {
    background: #eef1f5;
    border-color: #d6dde6;
    opacity: 1;
}
.owner-panel-summary::-webkit-details-marker { display: none; }
.owner-panel-summary::before { content: '▶ '; font-size: 0.7em; }
.owner-panel-details[open] .owner-panel-summary::before { content: '▼ '; }
.owner-panel-body {
    margin-top: 12px;
    padding: 16px 16px 14px;
    border: 1px solid #e5ecfb;
    border-radius: 14px;
    background: var(--card-bg);
}

/* Settings integration panel */
.wa-int__details { border: none; }
.wa-int__summary {
    cursor: pointer;
    list-style: none;
    display: inline-flex !important;
    width: auto !important;
    max-width: max-content;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 8px 14px !important;
    border-radius: 12px;
    background: #f5f7fa;
    color: #475569;
    font-weight: 600;
    font-size: 0.82rem !important;
    border: 1px solid #e4e9f0;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.035);
}
.wa-int__summary:hover {
    background: #eef1f5;
    border-color: #d6dde6;
    opacity: 1;
}
.wa-int__summary::-webkit-details-marker { display: none; }
.wa-int__summary::before { content: '▶ '; font-size: 0.7em; margin-right: 2px; }
.wa-int__details[open] .wa-int__summary::before { content: '▼ '; }
.wa-int__summary-title { letter-spacing: 0.02em; color: #334155; }
.wa-int__summary-note {
    font-weight: 500;
    font-size: 0.88rem;
    color: #64748b;
    opacity: 1;
}
.wa-int__details[open] .wa-int__summary { border-radius: var(--radius, 8px) var(--radius, 8px) 0 0; margin-bottom: 0; }
.wa-int__panel {
    margin-top: 0;
    padding: 22px 22px 24px;
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 14px 14px;
    background: var(--card-bg);
    box-shadow: 0 8px 30px rgba(15, 23, 42, 0.06);
}
.wa-int__hero {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border);
}
.wa-int__hero-icon {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.04);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
}
.wa-int__title { margin: 0; font-size: 1.35rem; font-weight: 700; letter-spacing: -0.02em; }
.wa-int__subtitle { margin: 4px 0 0; font-size: 0.95rem; opacity: 0.85; }
.wa-int__alert { margin-bottom: 18px; border-radius: 10px; }
.wa-int__alert-foot { display: block; margin-top: 8px; font-size: 0.9rem; opacity: 0.95; }
.wa-int__lead { margin: 0 0 20px; line-height: 1.55; font-size: 0.95rem; max-width: 52rem; }
.wa-int__form { max-width: 44rem; }
.wa-int__toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
    padding: 14px 16px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
}
.wa-int__toggle-label { font-weight: 600; font-size: 15px; }
.wa-int__switch { position: relative; display: inline-block; width: 52px; height: 28px; flex-shrink: 0; cursor: pointer; }
.wa-int__switch-input { opacity: 0; width: 0; height: 0; position: absolute; }
.wa-int__switch-ui {
    position: absolute; inset: 0;
    background: #cbd5e1;
    border-radius: 28px;
    transition: 0.25s;
}
.wa-int__switch-ui::before {
    content: "";
    position: absolute; height: 22px; width: 22px; left: 3px; bottom: 3px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
    transition: 0.25s;
}
.wa-int__switch-input:checked + .wa-int__switch-ui { background: var(--primary); }
.wa-int__switch-input:checked + .wa-int__switch-ui::before { transform: translateX(24px); }
.wa-int__switch-input:focus-visible + .wa-int__switch-ui { box-shadow: 0 0 0 2px var(--primary); }
.wa-int__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 20px;
    margin-bottom: 8px;
}
@media (max-width: 640px) {
    .wa-int__grid { grid-template-columns: 1fr; }
}
.wa-int__field--wide { grid-column: 1 / -1; }
.wa-int__label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; color: var(--foreground); }
.wa-int__input, .wa-int__textarea {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    color: var(--foreground);
    font-family: inherit;
    font-size: 15px;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.wa-int__input:focus, .wa-int__textarea:focus {
    outline: 2px solid var(--primary);
    outline-offset: 1px;
    border-color: var(--primary);
}
.wa-int__field-hint { display: block; font-size: 12px; margin-top: 6px; opacity: 0.78; }
.wa-int__section-title { font-weight: 700; font-size: 14px; margin: 20px 0 10px; letter-spacing: 0.04em; text-transform: uppercase; opacity: 0.75; }
.wa-int__scenario {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.02);
    cursor: pointer;
    margin-bottom: 18px;
}
.wa-int__scenario input { margin-top: 4px; flex-shrink: 0; }
.wa-int__scenario-body { line-height: 1.45; font-size: 14px; }
.wa-int__field--block { margin-bottom: 4px; }
.wa-int__textarea { min-height: 120px; resize: vertical; line-height: 1.45; }
.wa-int__chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.wa-int__chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid var(--border);
}
.wa-int__chip code { font-size: 12px; background: transparent; padding: 0; }
.wa-int__legacy { font-size: 12px; margin-top: 10px; line-height: 1.4; }
.wa-int__actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 18px; }
.wa-int__btn-primary { min-width: 120px; }
.wa-int__qr { margin-top: 20px; padding-top: 16px; border-top: 1px dashed var(--border); }
.wa-int__qr-img {
    max-width: 260px;
    height: auto;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #fff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

/* Bonus section in settings */
.bonus-summary {
    cursor: pointer;
    font-weight: 600;
    font-size: 0.8125rem;
    padding: 8px 14px;
    list-style: none;
    display: inline-block;
    background: #f5f7fa;
    color: #475569;
    border-radius: 12px;
    border: 1px solid #e4e9f0;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.035);
}
.bonus-summary:hover {
    background: #eef1f5;
    border-color: #d6dde6;
    opacity: 1;
}
.bonus-summary::-webkit-details-marker { display: none; }
.bonus-summary::before { content: '▶ '; font-size: 0.7em; }
details.bonus-details[open] .bonus-summary { margin-bottom: 0; }
details.bonus-details[open] .bonus-summary::before { content: '▼ '; }
.bonus-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    padding: 14px 16px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
}
.bonus-toggle-label { font-weight: 600; font-size: 15px; color: var(--foreground); }
.bonus-toggle-switch { position: relative; display: inline-block; width: 52px; height: 28px; flex-shrink: 0; }
.bonus-toggle-input { opacity: 0; width: 0; height: 0; }
.bonus-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #cbd5e1;
    border-radius: 28px;
    transition: 0.3s;
}
.bonus-toggle-slider::before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: 0.3s;
}
.bonus-toggle-input:checked + .bonus-toggle-slider { background: var(--primary); }
.bonus-toggle-input:checked + .bonus-toggle-slider::before { transform: translateX(24px); }
.bonus-toggle-input:focus-visible + .bonus-toggle-slider { box-shadow: 0 0 0 2px var(--primary); }

/* Catalog buttons toolbar in settings */
.catalog-settings-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-start;
}
.catalog-settings-toolbar > .catalog-details {
    flex: 0 0 auto;
    max-width: 100%;
}
.catalog-summary {
    cursor: pointer;
    font-weight: 600;
    font-size: 0.8125rem;
    padding: 8px 14px;
    list-style: none;
    display: inline-block;
    background: #f5f7fa;
    color: #475569;
    border-radius: 12px;
    border: 1px solid #e4e9f0;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.035);
}
.catalog-summary:hover {
    background: #eef1f5;
    border-color: #d6dde6;
    opacity: 1;
}
.catalog-summary::-webkit-details-marker { display: none; }
.catalog-summary::before { content: '▶ '; font-size: 0.7em; }
details.catalog-details[open] .catalog-summary { margin-bottom: 0; }
details.catalog-details[open] .catalog-summary::before { content: '▼ '; }

/* Make settings lists and tables cleaner */
.settings-modern .simple-list {
    padding-left: 18px;
}
.settings-modern .simple-list li {
    margin-bottom: 6px;
}
.settings-modern .settings-category-list {
    list-style: none;
    padding-left: 0;
    margin: 0 0 12px;
}
.settings-modern .settings-category-list__item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}
.settings-modern .settings-category-list__item:last-child {
    border-bottom: none;
}
.settings-modern .settings-category-list__name {
    flex: 1 1 auto;
    min-width: 0;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}
.settings-modern .settings-category-list__name:hover {
    text-decoration: underline;
}
.settings-modern .settings-category-list__meta {
    font-size: 13px;
    white-space: nowrap;
}
.settings-modern .settings-category-list__delete {
    margin: 0;
}
.settings-modern .settings-category-list__delete .btn {
    min-height: 32px;
}
.settings-modern .data-table th,
.settings-modern .data-table td {
    border-color: #eaf0ff;
}

/* Истёкшая подписка — модальное окно «Оплата закончилась» */
.sub-pay-modal {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 16px;
    animation: sub-pay-modal-fade 0.2s ease;
}
.sub-pay-modal[hidden] {
    display: none !important;
}
@keyframes sub-pay-modal-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}
.sub-pay-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.52);
    backdrop-filter: blur(4px);
}
.sub-pay-modal__dialog {
    position: relative;
    max-width: 460px;
    width: 100%;
    background: #fff;
    border-radius: 22px;
    padding: 22px 22px 20px;
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.18), 0 0 0 1px rgba(226, 232, 240, 0.9);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    animation: sub-pay-modal-slide 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes sub-pay-modal-slide {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.sub-pay-modal__close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 12px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, color 0.15s ease;
}
.sub-pay-modal__close:hover {
    background: #e2e8f0;
    color: #334155;
}
.sub-pay-modal__hero {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 18px;
    padding-right: 36px;
}
.sub-pay-modal__icon {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: linear-gradient(145deg, #fef3c7 0%, #fde68a 100%);
    color: #b45309;
    border: 1px solid rgba(245, 158, 11, 0.35);
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.2);
}
.sub-pay-modal__hero-text {
    min-width: 0;
}
.sub-pay-modal__title {
    margin: 0 0 6px;
    font-size: 1.28rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #0f172a;
    line-height: 1.25;
}
.sub-pay-modal__lead {
    margin: 0;
    font-size: 14px;
    line-height: 1.45;
    color: #64748b;
}
.sub-pay-receipt__chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
    padding: 8px 12px;
    border-radius: 12px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    font-size: 13px;
    color: #92400e;
    line-height: 1.35;
}
.sub-pay-receipt__card {
    background: #f8fafc;
    border: 1px solid #e8ecf0;
    border-radius: 16px;
    padding: 4px 14px 12px;
    margin-bottom: 12px;
}
.sub-pay-receipt__row {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 2px 12px;
    padding: 12px 0;
    border-bottom: 1px solid #e8ecf0;
    align-items: center;
}
.sub-pay-receipt__row:last-of-type {
    border-bottom: none;
}
.sub-pay-receipt__row--addon {
    padding: 10px 0 10px 4px;
}
.sub-pay-receipt__label {
    grid-column: 1;
    grid-row: 1;
    font-weight: 700;
    font-size: 14px;
    color: #1e293b;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.sub-pay-receipt__meta {
    grid-column: 1;
    grid-row: 2;
    font-size: 12px;
    color: #64748b;
}
.sub-pay-receipt__price {
    grid-column: 2;
    grid-row: 1 / span 2;
    font-weight: 700;
    font-size: 15px;
    color: #0f172a;
    white-space: nowrap;
    align-self: center;
}
.sub-pay-receipt__dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    flex-shrink: 0;
}
.sub-pay-receipt__dot--blue {
    background: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}
.sub-pay-receipt__dot--violet {
    background: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}
.sub-pay-receipt__section-title {
    margin: 10px 0 4px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #64748b;
}
.sub-pay-receipt__empty {
    margin: 6px 0 8px;
    font-size: 13px;
    color: #94a3b8;
}
.sub-pay-receipt__total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
    padding: 14px 14px;
    border-radius: 14px;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 1px solid #bfdbfe;
    font-size: 14px;
    color: #1e40af;
}
.sub-pay-receipt__total strong {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #1d4ed8;
}
.sub-pay-receipt__hint {
    margin: 0 0 14px;
    font-size: 13px;
    line-height: 1.45;
    color: #64748b;
    padding: 10px 12px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}
.sub-pay-modal__actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.sub-pay-modal__btn-primary,
.sub-pay-modal__btn-secondary {
    width: 100%;
    justify-content: center;
    min-height: 44px;
    border-radius: 12px !important;
    font-weight: 700 !important;
}
.sub-pay-modal__btn-primary {
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.28);
}
.page-subscription-expired .subscription-expired-page-card {
    max-width: 480px !important;
    border-radius: 22px;
    border: 1px solid #e8ecf0;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
    padding: 22px 22px 20px;
}
.page-subscription-expired .sub-pay-modal__hero {
    padding-right: 0;
    margin-bottom: 16px;
}
body.subscription-expired-locked .main-content {
    pointer-events: auto;
}
body.subscription-expired-lock-open {
    overflow: hidden;
}

/* —— Возвраты: вкладки, оформление, модалка (десктоп + мобильная CRM) —— */
.page-sales-returns .sr-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0 0 1rem;
}
.page-sales-returns .sr-tabs__link {
    display: inline-flex;
    align-items: center;
    padding: 0.55rem 1rem;
    border-radius: 999px;
    font-size: 0.9375rem;
    font-weight: 700;
    text-decoration: none;
    color: #475569;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.page-sales-returns .sr-tabs__link:hover {
    color: #0f172a;
    border-color: #cbd5e1;
}
.page-sales-returns .sr-tabs__link.is-active {
    color: #fff;
    background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
    border-color: #1d4ed8;
}
.page-sales-returns .sr-create__title {
    margin: 0 0 0.75rem;
    font-size: 1.0625rem;
    font-weight: 700;
    color: #0f172a;
}
.page-sales-returns .sr-create__hint {
    margin: 0;
    font-size: 0.875rem;
    color: #64748b;
}
.page-sales-returns .sr-create__toolbar {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}
.page-sales-returns .sr-create__list-wrap {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 12px 42px -20px rgba(15, 23, 42, 0.12);
}
.page-sales-returns .sr-return-btn {
    cursor: pointer;
    border: none;
    font: inherit;
}
.page-sales-returns .btn-danger-soft {
    background: linear-gradient(180deg, #f87171 0%, #dc2626 100%);
    border-color: #b91c1c;
    color: #fff;
}
.page-sales-returns .btn-block {
    width: 100%;
    justify-content: center;
}
.page-sales-returns .sr-mobile-cards {
    display: none;
    padding: 0.75rem;
    gap: 0.65rem;
}
.page-sales-returns .sr-card {
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 0.85rem 0.95rem;
    background: #fafbfc;
}
.page-sales-returns .sr-card__head {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.55rem;
    font-size: 0.875rem;
    color: #64748b;
}
.page-sales-returns .sr-card__head strong {
    color: #0f172a;
    font-size: 1rem;
}
.page-sales-returns .sr-card__row {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.875rem;
    padding: 0.2rem 0;
    color: #475569;
}
.page-sales-returns .sr-card__row--total {
    margin: 0.35rem 0 0.65rem;
    font-size: 0.9375rem;
}
.page-sales-returns .sr-card__row--total strong {
    color: #0f172a;
}
body.sr-modal-open {
    overflow: hidden;
}
.page-sales-history .sr-modal[hidden],
.page-sales-returns .sr-modal[hidden] {
    display: none !important;
}
.page-sales-history .sr-modal,
.page-sales-returns .sr-modal {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
}
.page-sales-history .sr-modal__backdrop,
.page-sales-returns .sr-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
}
.page-sales-history .sr-modal__dialog,
.page-sales-returns .sr-modal__dialog {
    position: relative;
    width: min(520px, 100%);
    max-height: min(90vh, 720px);
    overflow: auto;
    background: #fff;
    border-radius: 18px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.22);
}
.page-sales-history .sr-modal__head,
.page-sales-returns .sr-modal__head {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.1rem 0.5rem;
    border-bottom: 1px solid #eef2f7;
}
.page-sales-history .sr-modal__head h3,
.page-sales-returns .sr-modal__head h3 {
    margin: 0 0 0.35rem;
    font-size: 1.125rem;
}
.page-sales-history .sr-modal__sub,
.page-sales-returns .sr-modal__sub {
    margin: 0;
    font-size: 0.875rem;
    color: #64748b;
    line-height: 1.45;
}
.page-sales-history .sr-modal__close,
.page-sales-returns .sr-modal__close {
    border: none;
    background: transparent;
    font-size: 1.5rem;
    line-height: 1;
    color: #64748b;
    cursor: pointer;
    padding: 0.15rem 0.35rem;
}
.page-sales-history .sr-modal__body,
.page-sales-returns .sr-modal__body {
    padding: 0.85rem 1.1rem 1.1rem;
}
.page-sales-history .sr-modal__meta p,
.page-sales-returns .sr-modal__meta p {
    margin: 0 0 0.35rem;
}
.page-sales-history .sr-modal__lines-wrap,
.page-sales-returns .sr-modal__lines-wrap {
    overflow-x: auto;
    margin: 0.75rem 0;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}
.page-sales-history .sr-modal__lines,
.page-sales-returns .sr-modal__lines {
    width: 100%;
    min-width: 360px;
    border-collapse: collapse;
    font-size: 0.875rem;
}
.page-sales-history .sr-modal__lines th,
.page-sales-history .sr-modal__lines td,
.page-sales-returns .sr-modal__lines th,
.page-sales-returns .sr-modal__lines td {
    padding: 0.55rem 0.65rem;
    border-bottom: 1px solid #eef2f7;
    text-align: left;
}
.page-sales-history .sr-modal__lines th,
.page-sales-returns .sr-modal__lines th {
    background: #f8fafc;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
}
.page-sales-history .sr-modal__total,
.page-sales-returns .sr-modal__total {
    margin: 0.65rem 0;
    font-size: 1rem;
}
.page-sales-history .sr-modal__total strong,
.page-sales-returns .sr-modal__total strong {
    font-size: 1.25rem;
    color: #dc2626;
}
.page-sales-history .sr-modal__error,
.page-sales-returns .sr-modal__error {
    margin: 0.5rem 0;
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    font-size: 0.875rem;
}
.page-sales-history .sr-modal__actions,
.page-sales-returns .sr-modal__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 0.75rem;
}
@media (max-width: 768px) {
    .page-sales-returns .sr-create-table-wrap {
        display: none;
    }
    .page-sales-returns .sr-mobile-cards {
        display: grid;
    }
    .page-sales-history .sr-modal__actions,
    .page-sales-returns .sr-modal__actions {
        flex-direction: column-reverse;
    }
    .page-sales-history .sr-modal__actions .btn,
    .page-sales-returns .sr-modal__actions .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Settings page — clean layout */
body.page-settings .page-title { display: none; }

.settings-modern__hero {
    margin-bottom: 20px;
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
}
.settings-modern__hero-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.settings-modern__hero-text { min-width: 0; }
.settings-modern__title {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #0f172a;
}
.settings-modern__sub {
    margin: 4px 0 0;
    font-size: 14px;
    color: #64748b;
}
.settings-modern__search {
    display: flex;
    align-items: center;
    gap: 10px;
    width: min(100%, 320px);
    padding: 0 14px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: #fff;
    box-sizing: border-box;
}
.settings-modern__search-ico {
    display: flex;
    color: #94a3b8;
    flex-shrink: 0;
}
.settings-modern__search input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    font-size: 14px;
    outline: none;
    padding: 0;
    min-height: auto;
}

.settings-modern__layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}
.settings-modern__aside {
    position: sticky;
    top: 12px;
    padding: 14px;
    border-radius: 16px;
    border: 1px solid #e8ecf0;
    background: #fff;
}
.settings-aside-nav__group {
    margin: 16px 0 6px;
    padding: 0 8px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: #94a3b8;
}
.settings-aside-nav__group:first-child { margin-top: 0; }
.settings-aside-nav__items { display: flex; flex-direction: column; gap: 2px; }
.settings-aside-nav__link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    text-decoration: none;
    transition: background 0.12s, color 0.12s;
}
.settings-aside-nav__link:hover { background: #f8fafc; color: #0f172a; }
.settings-aside-nav__link.is-active { background: #eff6ff; color: #2563eb; }
.settings-aside-nav__badge {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #dcfce7;
    color: #166534;
    font-size: 10px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.settings-aside-nav__badge--warn { background: #fee2e2; color: #b91c1c; }
.settings-aside-nav__footer {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #eef2f6;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.settings-aside-nav__ext {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 6px;
}
.settings-aside-nav__ext:hover { color: #2563eb; background: #f8fafc; }

.settings-modern__main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.settings-section-card { scroll-margin-top: 16px; }
.settings-section-card--hidden { display: none !important; }

.settings-panel {
    background: #fff;
    border: 1px solid #e8ecf0;
    border-radius: 16px;
    overflow: hidden;
}
.settings-panel__head {
    padding: 18px 20px 0;
}
.settings-panel__head--rich {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding-bottom: 4px;
}
.settings-panel__head--rich > .settings-icon {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: linear-gradient(145deg, #eff6ff 0%, #f8fafc 100%);
    border: 1px solid #dbeafe;
    color: #2563eb;
}
.settings-panel__head--rich > .settings-icon .sidebar-nav-icon-svg {
    width: 22px;
    height: 22px;
}
.settings-panel__head-text { min-width: 0; flex: 1; }
.settings-panel__intro {
    margin: 0 0 14px;
    font-size: 14px;
    line-height: 1.5;
    color: #64748b;
}
.settings-panel__actions {
    margin: 16px 0 0;
}
.settings-panel__title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.02em;
}
.settings-panel__desc {
    margin: 4px 0 0;
    font-size: 13px;
    color: #64748b;
    line-height: 1.45;
}
.settings-panel__body {
    padding: 16px 20px 20px;
}
.settings-panel__body > .muted:first-child { margin-top: 0; }
.settings-panel__hint {
    margin: 6px 0 0;
    font-size: 13px;
    line-height: 1.45;
}
.settings-panel__body .settings-card-action + .settings-panel__hint {
    margin-bottom: 12px;
}
.settings-panel__list {
    margin: 8px 0 16px;
    padding-left: 18px;
    font-size: 14px;
    line-height: 1.55;
}
.settings-panel__body .settings-card-action {
    margin-top: 14px;
}
.settings-panel__body .settings-card-action:first-child {
    margin-top: 0;
}
.settings-panel__body .settings-category-list {
    margin: 12px 0 0;
}
.settings-panel__body--row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}
.settings-panel__body--row .settings-modern__company-input {
    flex: 1 1 240px;
    min-width: 0;
    max-width: none;
}

.settings-panel > .settings-card-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 20px 0;
    margin: 0;
}
.settings-panel > .settings-card-head .settings-icon { display: none; }
.settings-panel > .settings-card-head .card-heading {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
}
.settings-panel > .settings-card-head ~ :not(.settings-card-head) {
    padding-left: 20px;
    padding-right: 20px;
}
.settings-panel > .settings-card-head ~ :last-child {
    padding-bottom: 20px;
}

.settings-check-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px 16px;
    margin: 0 0 16px;
}
.settings-check-grid--modern {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
}
.settings-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #334155;
    cursor: pointer;
}
.settings-check--tile {
    position: relative;
    align-items: center;
    gap: 12px;
    padding: 13px 14px;
    border: 1px solid #e8ecf0;
    border-radius: 12px;
    background: #fff;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
    user-select: none;
}
.settings-check--tile:hover {
    border-color: #cbd5e1;
    background: #fafbfc;
}
.settings-check__input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    pointer-events: none;
}
.settings-check__mark {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 7px;
    border: 2px solid #cbd5e1;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s, background 0.15s;
}
.settings-check__mark::after {
    content: '';
    width: 6px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg) scale(0);
    margin-top: -2px;
    transition: transform 0.12s ease;
}
.settings-check__input:checked + .settings-check__mark {
    background: #2563eb;
    border-color: #2563eb;
}
.settings-check__input:checked + .settings-check__mark::after {
    transform: rotate(45deg) scale(1);
}
.settings-check__input:focus-visible + .settings-check__mark {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
}
.settings-check__input:checked ~ .settings-check__text {
    color: #0f172a;
}
.settings-check--tile:has(.settings-check__input:checked) {
    border-color: #bfdbfe;
    background: #eff6ff;
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.08);
}
.settings-check__text {
    line-height: 1.35;
}
.settings-field--grow {
    flex: 1;
    min-width: 0;
}
.settings-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    padding-top: 18px;
    margin-top: 4px;
    border-top: 1px solid #eef2f6;
}
.settings-modal-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.settings-tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}
.settings-tag {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: 999px;
    background: #f0fdf4;
    color: #166534;
    font-size: 12px;
    font-weight: 600;
}

/* Action tiles — понятные карточки-ссылки в настройках */
.settings-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 10px;
}
.settings-tiles--single { grid-template-columns: 1fr; }
.settings-tile {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid #e8ecf0;
    background: #fafbfc;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
a.settings-tile:hover {
    border-color: #bfdbfe;
    background: #fff;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.08);
}
.settings-tile--action {
    background: #fff;
    cursor: default;
}
.settings-tile__icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: #fff;
    border: 1px solid #e8ecf0;
    color: #475569;
}
.settings-tile__icon .settings-icon { display: flex; }
.settings-tile__body {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.settings-tile__title {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.3;
}
.settings-tile__desc {
    font-size: 12px;
    line-height: 1.45;
    color: #64748b;
}
.settings-tile__arrow {
    flex-shrink: 0;
    font-size: 18px;
    font-weight: 600;
    color: #94a3b8;
    transition: transform 0.15s, color 0.15s;
}
a.settings-tile:hover .settings-tile__arrow {
    color: #2563eb;
    transform: translateX(3px);
}

/* Подразделы настроек (каталог, счета и т.д.) */
.settings-subpanels {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
}
.settings-subpanel {
    padding: 18px;
    border-radius: 14px;
    border: 1px solid #e8ecf0;
    background: #fafbfc;
}
.settings-subpanel__head { margin-bottom: 14px; }
.settings-subpanel__title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
}
.settings-subpanel__desc {
    margin: 4px 0 0;
    font-size: 13px;
    line-height: 1.45;
    color: #64748b;
}
.settings-subpanel__subtitle {
    margin: 0 0 10px;
    font-size: 13px;
    font-weight: 700;
    color: #334155;
}
.settings-subpanel__block + .settings-subpanel__block {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid #e8ecf0;
}
.settings-subpanel__actions { margin: 14px 0 0; }
.settings-subpanel__links {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #e8ecf0;
    font-size: 13px;
    line-height: 1.55;
}
.settings-subpanel__links-lbl {
    margin: 0 0 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #94a3b8;
}
.settings-subpanel__hint {
    margin: 10px 0 0;
    font-size: 12px;
    line-height: 1.45;
}
.settings-subpanel__table-wrap { margin-top: 14px; }
.settings-subpanel__table { font-size: 13px; }
.settings-field { display: block; margin-bottom: 8px; }
.settings-field__lbl {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #334155;
}
.settings-field__hint {
    display: block;
    margin-top: 3px;
    font-size: 12px;
    line-height: 1.45;
    color: #64748b;
    font-weight: 400;
}
.settings-field-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}
.settings-field__input {
    min-width: 0;
    flex: 1 1 200px;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    background: #fff;
    box-sizing: border-box;
}
.settings-field__input--grow { flex: 1 1 260px; }

body.page-settings .catalog-settings-toolbar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
body.page-settings .catalog-details > summary { display: none; }
body.page-settings .catalog-details > .form-card,
body.page-settings .catalog-details > .card.form-card {
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
}
body.page-settings .catalog-details .card-heading:first-child,
body.page-settings .catalog-details h2.card-heading {
    margin: 0 0 8px;
    font-size: 0.95rem;
    font-weight: 700;
    color: #334155;
}

.settings-toast {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 9999;
    padding: 12px 18px;
    border-radius: 12px;
    background: #166534;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.18);
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
}
.settings-toast--show { opacity: 1; transform: translateY(0); }
.settings-toast--info { background: #2563eb; }
.settings-alert {
    margin-bottom: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
}
.settings-alert--error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

body.page-settings .settings-modern .card,
body.page-settings .settings-modern .settings-panel {
    margin-bottom: 0 !important;
    box-shadow: none;
}

/* Collapsible settings panels (bonus, etc.) */
.settings-panel--collapsible { padding: 0; }
.settings-panel--collapsible .settings-collapse { border: none; margin: 0; }
.settings-panel--collapsible .settings-collapse__summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 16px;
    padding: 18px 20px;
    cursor: pointer;
    list-style: none;
    user-select: none;
    transition: background 0.15s;
}
.settings-panel--collapsible .settings-collapse__summary::-webkit-details-marker { display: none; }
.settings-panel--collapsible .settings-collapse__summary:hover { background: #fafbfc; }
.settings-panel--collapsible .settings-collapse[open] > .settings-collapse__summary {
    border-bottom: 1px solid #eef2f6;
    background: #fafbfc;
}
.settings-panel--collapsible .settings-collapse__text { min-width: 0; flex: 1 1 200px; }
.settings-panel--collapsible .settings-collapse__text .settings-panel__head,
.settings-panel--collapsible .settings-collapse__text .settings-panel__title,
.settings-panel--collapsible .settings-collapse__text .settings-panel__desc { margin: 0; }
.settings-panel--collapsible .settings-collapse__aside {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px 10px;
    flex-shrink: 0;
}
.settings-status-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    background: #f1f5f9;
    color: #64748b;
}
.settings-status-pill--on {
    background: #dcfce7;
    color: #166534;
}
.settings-collapse__preview {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
}
.settings-collapse__chevron {
    display: flex;
    color: #94a3b8;
    transition: transform 0.2s ease;
}
.settings-collapse[open] .settings-collapse__chevron { transform: rotate(180deg); }
.settings-collapse__body { padding: 18px 20px 20px; }

.bonus-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 20px;
    margin-bottom: 20px;
}
.bonus-form-field label {
    display: block;
    margin: 0 0 6px;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
}
.bonus-form-field input[type="number"] {
    width: 100%;
    max-width: none;
    box-sizing: border-box;
}
.bonus-form-field__input-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.bonus-form-field__input-row input { flex: 1; min-width: 0; max-width: 140px; }
.bonus-form-field__input-row--compact input { max-width: 90px; }
.bonus-form-field__suffix {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    flex-shrink: 0;
}
.bonus-form-field__hint {
    margin: 6px 0 0;
    font-size: 12px;
    line-height: 1.45;
    color: #64748b;
}
.bonus-form-section { margin-top: 4px; }
.bonus-form-section__title {
    margin: 0 0 4px;
    font-size: 14px;
    font-weight: 700;
    color: #334155;
}
.bonus-form-section__desc {
    margin: 0 0 10px;
    font-size: 12px;
    line-height: 1.45;
    color: #64748b;
}
.bonus-categories-box {
    max-height: 220px;
    overflow: auto;
    border: 1px solid #e8ecf0;
    border-radius: 12px;
    background: #fafbfc;
}
.bonus-categories-box__empty {
    margin: 0;
    padding: 14px 16px;
    font-size: 13px;
}
.bonus-categories-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.bonus-categories-table th,
.bonus-categories-table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid #eef2f6;
}
.bonus-categories-table th {
    position: sticky;
    top: 0;
    background: #f8fafc;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #94a3b8;
}
.bonus-categories-table tbody tr:last-child td { border-bottom: none; }
.bonus-form-actions {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #eef2f6;
}
body.page-settings .bonus-toggle-row {
    margin-bottom: 18px;
    background: #f8fafc;
    border-color: #e8ecf0;
}

@media (max-width: 720px) {
    .bonus-form-grid { grid-template-columns: 1fr; }
    .settings-panel--collapsible .settings-collapse__aside {
        width: 100%;
        justify-content: flex-start;
    }
    .settings-tiles { grid-template-columns: 1fr; }
    .settings-subpanels { grid-template-columns: 1fr; }
    .settings-tile--action {
        flex-wrap: wrap;
    }
    .settings-tile--action .btn {
        width: 100%;
        margin-top: 4px;
    }
}

@media (max-width: 960px) {
    .settings-modern__layout { grid-template-columns: 1fr; }
    .settings-modern__aside {
        position: static;
        padding: 12px;
        overflow-x: auto;
    }
    .settings-aside-nav {
        display: flex;
        flex-wrap: nowrap;
        gap: 6px;
        min-width: min-content;
    }
    .settings-aside-nav__group,
    .settings-aside-nav__items,
    .settings-aside-nav__footer {
        display: contents;
    }
    .settings-aside-nav__link,
    .settings-aside-nav__ext {
        white-space: nowrap;
        border: 1px solid #e8ecf0;
        background: #fff;
    }
}
@media (max-width: 520px) {
    .settings-modern__hero-inner { flex-direction: column; align-items: stretch; }
    .settings-modern__search { width: 100%; }
}

/* ── Settings dashboard (макет как на скриншоте) ── */
body.page-settings .main-content {
    background: #f4f7f9;
}
body.page-settings .page-title {
    display: none;
}
.settings-modern--dashboard {
    max-width: 1320px;
    margin: 0 auto;
    padding: 8px 8px 40px;
}
.settings-modern__hero--dashboard {
    padding: 4px 4px 24px;
    background: transparent;
    border: none;
    box-shadow: none;
}
.settings-modern__hero--dashboard .settings-modern__hero-inner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}
.settings-modern--dashboard .settings-modern__title {
    margin: 0;
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.035em;
    color: #0f172a;
    line-height: 1.15;
}
.settings-modern--dashboard .settings-modern__sub {
    margin: 8px 0 0;
    font-size: 15px;
    color: #64748b;
    max-width: 560px;
    line-height: 1.55;
}
.settings-modern__search--hero {
    width: min(100%, 420px);
    height: 48px;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    background: #fff;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.settings-dashboard {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 24px;
    align-items: start;
}
.settings-dashboard__main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 24px;
}
.settings-dashboard-block__title {
    margin: 0 0 16px;
    font-size: 1.05rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.02em;
}
.settings-dashboard-block__title--inline { margin: 0; }

.settings-quick-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}
.settings-quick-grid--empty::after {
    content: 'Ничего не найдено';
    grid-column: 1 / -1;
    padding: 32px;
    text-align: center;
    color: #94a3b8;
    font-size: 14px;
    background: #fff;
    border-radius: 24px;
    border: 1px dashed #e2e8f0;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
}
.settings-quick-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    min-height: 148px;
    padding: 20px;
    border-radius: 24px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    background: #fff;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04), 0 12px 32px rgba(15, 23, 42, 0.05);
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: border-color 0.18s, box-shadow 0.18s, transform 0.18s;
}
.settings-quick-card:hover {
    border-color: #dbeafe;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.07), 0 20px 40px rgba(15, 23, 42, 0.08);
    transform: translateY(-2px);
}
.settings-quick-card--hidden { display: none !important; }
.settings-quick-card__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    margin-bottom: 14px;
    position: relative;
}
.settings-quick-card__icon {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.settings-quick-card__icon .sidebar-nav-icon-svg {
    width: 26px;
    height: 26px;
}
.settings-quick-card__icon--blue { background: #eff6ff; color: #2563eb; }
.settings-quick-card__icon--green { background: #ecfdf5; color: #059669; }
.settings-quick-card__icon--purple { background: #f5f3ff; color: #7c3aed; }
.settings-quick-card__icon--orange { background: #fff7ed; color: #ea580c; }
.settings-quick-card__icon--rose { background: #fff1f2; color: #e11d48; }
.settings-quick-card__icon--teal { background: #f0fdfa; color: #0d9488; }
.settings-quick-card__icon--amber { background: #fffbeb; color: #d97706; }
.settings-quick-card__icon--indigo { background: #eef2ff; color: #4f46e5; }
.settings-quick-card__icon--slate { background: #f8fafc; color: #475569; }
.settings-quick-card__icon--cyan { background: #ecfeff; color: #0891b2; }
.settings-quick-card__body {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.settings-quick-card__title {
    font-size: 15px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.3;
    letter-spacing: -0.01em;
}
.settings-quick-card__desc {
    font-size: 13px;
    line-height: 1.5;
    color: #64748b;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.settings-quick-card__badge {
    position: absolute;
    top: -4px;
    left: 44px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: #fee2e2;
    color: #b91c1c;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
}
.settings-quick-card { position: relative; }
.settings-quick-card__chev {
    flex-shrink: 0;
    margin-left: auto;
    color: #cbd5e1;
    display: flex;
    align-items: center;
    transition: color 0.15s, transform 0.15s;
}
.settings-quick-card:hover .settings-quick-card__chev {
    color: #94a3b8;
    transform: translateX(3px);
}

.settings-recent__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}
.settings-recent__all {
    font-size: 13px;
    font-weight: 700;
    color: #2563eb;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.settings-recent__all:hover { text-decoration: underline; }
.settings-recent-card {
    background: #fff;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 24px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04), 0 12px 32px rgba(15, 23, 42, 0.05);
    padding: 6px 0;
    overflow: hidden;
}
.settings-recent-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.settings-recent-list__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.12s;
}
.settings-recent-list__item:hover {
    background: #fafbfc;
}
.settings-recent-list__item:last-child { border-bottom: none; }
.settings-recent-list__icon .settings-quick-card__icon {
    width: 36px;
    height: 36px;
}
.settings-recent-list__icon .settings-quick-card__icon .sidebar-nav-icon-svg {
    width: 18px;
    height: 18px;
}
.settings-recent-list__text {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    color: #334155;
    line-height: 1.4;
}
.settings-recent-list__time {
    flex-shrink: 0;
    font-size: 12px;
    color: #94a3b8;
    white-space: nowrap;
}
.settings-recent-empty {
    margin: 0;
    padding: 20px 16px;
    font-size: 13px;
}

.settings-all-sections__title {
    margin: 8px 0 12px;
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
}
.settings-all-sections--pool {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.settings-section-card--in-modal {
    display: block !important;
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    border-radius: 0 !important;
    overflow: visible !important;
}
.settings-section-card--in-modal .settings-panel__head,
.settings-section-card--in-modal > .settings-panel__head--rich {
    display: none;
}
.settings-section-card--in-modal .settings-panel__body,
.settings-section-card--in-modal .settings-panel__body--row {
    padding: 0;
}
.settings-section-card--in-modal .settings-panel__intro {
    display: none;
}
.settings-section-card--in-modal form.settings-panel__body--row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0;
}
.settings-section-card--in-modal .settings-form-actions .btn-primary,
.settings-section-card--in-modal .settings-form-actions .btn.btn-primary {
    min-width: 160px;
    padding: 14px 28px;
}
.settings-section-card--in-modal.settings-panel--collapsible .settings-collapse__summary {
    display: none;
}
.settings-section-card--in-modal.settings-panel--collapsible .settings-collapse__body {
    padding: 0;
    border: none;
}

/* Модальное окно настроек */
.settings-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}
.settings-modal.is-open {
    pointer-events: auto;
    opacity: 1;
    visibility: visible;
}
body.settings-modal-open {
    overflow: hidden;
}
.settings-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(3px);
}
.settings-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(100%, 720px);
    max-height: min(92vh, 900px);
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.22);
    overflow: hidden;
    transform: translateY(12px) scale(0.98);
    transition: transform 0.22s ease;
}
.settings-modal.is-open .settings-modal__dialog {
    transform: translateY(0) scale(1);
}
.settings-modal--wide .settings-modal__dialog {
    width: min(100%, 920px);
}
.settings-modal__header {
    flex-shrink: 0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 24px 18px;
    border-bottom: 1px solid #eef2f6;
    background: #fff;
}
.settings-modal__header-text {
    min-width: 0;
    flex: 1;
}
.settings-modal__title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.03em;
    line-height: 1.25;
}
.settings-modal__subtitle {
    margin: 6px 0 0;
    font-size: 14px;
    line-height: 1.5;
    color: #64748b;
    font-weight: 400;
}
.settings-modal__close {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    color: #64748b;
    cursor: pointer;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.settings-modal__close:hover {
    background: #f8fafc;
    color: #0f172a;
    border-color: #cbd5e1;
}
.settings-modal__body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 20px 24px 24px;
    -webkit-overflow-scrolling: touch;
    background: #fafbfc;
}
.settings-modal__body .settings-section-card--in-modal {
    background: #fff !important;
    border: 1px solid #eef2f6 !important;
    border-radius: 14px !important;
    padding: 18px 20px !important;
}
.settings-modal__body .settings-panel__body {
    background: transparent;
}
.settings-modal__body .settings-modern__company-input {
    max-width: none;
    min-height: 50px;
    font-size: 1rem;
    padding: 12px 16px;
}
.settings-modal__body .settings-field__input,
.settings-modal__body .settings-field-row select {
    min-height: 50px;
    font-size: 1rem;
}

.settings-dashboard__sidebar {
    position: sticky;
    top: 12px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.settings-widget {
    background: #fff;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 24px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04), 0 12px 32px rgba(15, 23, 42, 0.05);
    padding: 22px;
}
.settings-widget--about {
    padding: 24px;
}
.settings-widget__title {
    margin: 0 0 18px;
    font-size: 1.05rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.02em;
}

/* Блок «О системе» */
.settings-about-version {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
    padding: 18px 20px;
    border-radius: 18px;
    background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 100%);
    border: 1px solid #dbeafe;
}
.settings-about-version__body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.settings-about-version__label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #64748b;
}
.settings-about-version__num {
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: #0f172a;
}
.settings-about-version__status {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #dcfce7;
    color: #166534;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}
.settings-about-info {
    list-style: none;
    margin: 0 0 18px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.settings-about-info__item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 12px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #eef2f6;
}
.settings-about-info__icon {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.settings-about-info__icon .settings-icon {
    display: flex;
}
.settings-about-info__icon .sidebar-nav-icon-svg {
    width: 18px;
    height: 18px;
}
.settings-about-info__icon--blue { background: #eff6ff; color: #2563eb; }
.settings-about-info__icon--purple { background: #f5f3ff; color: #7c3aed; }
.settings-about-info__icon--teal { background: #f0fdfa; color: #0d9488; }
.settings-about-info__icon--green { background: #ecfdf5; color: #059669; }
.settings-about-info__text {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.settings-about-info__label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #94a3b8;
}
.settings-about-info__value {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.45;
    color: #334155;
}

.settings-widget__support-btn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 20px;
    min-height: 56px;
    border: none;
    border-radius: 16px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.28);
    transition: transform 0.12s, box-shadow 0.12s, background 0.12s;
}
.settings-widget__support-btn:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
    transform: translateY(-1px);
}
.settings-widget__support-btn:active {
    transform: translateY(0);
}
.settings-support-btn__icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
}
.settings-support-btn__svg {
    display: block;
    width: 24px;
    height: 24px;
}
.settings-widget__support-btn-text {
    line-height: 1.2;
}

/* Legacy about list (если где-то ещё используется) */
.settings-about-list {
    margin: 0 0 16px;
    padding: 0;
}
.settings-about-list__row {
    margin-bottom: 12px;
}
.settings-about-list__row:last-child { margin-bottom: 0; }
.settings-about-list dt {
    margin: 0 0 3px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #94a3b8;
}
.settings-about-list dd {
    margin: 0;
    font-size: 13px;
    color: #334155;
    line-height: 1.45;
}
.settings-about-list__value {
    font-weight: 700;
    color: #0f172a;
}
.settings-about-list__pill {
    display: inline-flex;
    margin-left: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #eff6ff;
    color: #2563eb;
    font-size: 10px;
    font-weight: 700;
    vertical-align: middle;
}

.settings-links-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.settings-links-list--modern {
    gap: 8px;
}
.settings-links-list__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    text-decoration: none;
    color: #334155;
    font-size: 13px;
    font-weight: 600;
    background: #f8fafc;
    border: 1px solid #eef2f6;
    transition: background 0.12s, border-color 0.12s, color 0.12s, transform 0.12s, box-shadow 0.12s;
}
.settings-links-list__item:hover {
    background: #fff;
    border-color: #dbeafe;
    color: #0f172a;
    transform: translateX(2px);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
}
.settings-links-list__item .settings-quick-card__icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
}
.settings-links-list__item .settings-quick-card__icon .sidebar-nav-icon-svg {
    width: 16px;
    height: 16px;
}
.settings-links-list__text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.settings-links-list__label { flex: 1; min-width: 0; font-weight: 700; color: #0f172a; }
.settings-links-list__desc {
    font-size: 12px;
    font-weight: 500;
    line-height: 1.35;
    color: #64748b;
}
.settings-links-list__badge {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #fee2e2;
    color: #b91c1c;
    font-size: 10px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 1100px) {
    .settings-quick-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .settings-dashboard { grid-template-columns: minmax(0, 1fr) 260px; }
}
@media (max-width: 960px) {
    .settings-dashboard { grid-template-columns: 1fr; }
    .settings-dashboard__sidebar {
        position: static;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
        gap: 14px;
    }
}
@media (max-width: 720px) {
    .settings-quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .settings-check-grid--modern { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .settings-modal__title { font-size: 1.2rem; }
    .settings-modal__body { padding: 16px; }
    .settings-modal__header { padding: 16px 18px 14px; }
    .settings-subpanels { grid-template-columns: 1fr; }
    .settings-tile--action { flex-wrap: wrap; }
    .settings-tile--action .btn { width: 100%; margin-top: 4px; }
}
@media (max-width: 520px) {
    .settings-quick-grid { grid-template-columns: 1fr; }
    .settings-check-grid--modern { grid-template-columns: 1fr; }
    .settings-modern--dashboard .settings-modern__title { font-size: 1.45rem; }
    .settings-recent-list__item { flex-wrap: wrap; }
    .settings-recent-list__time { width: 100%; padding-left: 48px; }
}
