/* ==========================================================================
   CHERNOGOROV HOME - Apple Monochrome Design System
   Высокоточная черно-белая гамма, типографика SF Pro, тонкие обводки,
   матовые градиенты и пружинные анимации
   ========================================================================== */

:root {
    /* Цветовая палитра Apple Monochrome */
    --black: #000000;
    --gray-950: #0a0a0c;
    --gray-900: #121215;
    --gray-850: #18181b;
    --gray-800: #222226;
    --gray-700: #3f3f46;
    --gray-600: #52525b;
    --gray-500: #71717a;
    --gray-400: #a1a1aa;
    --gray-300: #d4d4d8;
    --gray-200: #e4e4e7;
    --gray-100: #f4f4f5;
    --gray-50: #fafafa;
    --white: #ffffff;

    /* Совместимость с существующими токенами */
    --bg: #f8f8fa;
    --gray: #71717a;
    --gray-2: #52525b;
    --gray-3: #27272a;
    --gray-4: #18181b;
    --gray-dark: #09090b;

    /* Тонкие обводки (Apple Hairlines) */
    --border: rgba(0, 0, 0, 0.08);
    --border-hairline: 1px solid rgba(0, 0, 0, 0.08);
    --border-subtle: 1px solid rgba(0, 0, 0, 0.05);
    --border-strong: rgba(0, 0, 0, 0.16);
    --border-focus: rgba(0, 0, 0, 0.85);

    /* Скругления Apple */
    --radius-card: 26px;
    --radius-card-sm: 18px;
    --radius-btn: 14px;
    --radius-pill: 999px;

    /* Тени и глубина */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
    --shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.03);
    --shadow-hover: 0 14px 34px -4px rgba(0, 0, 0, 0.1), 0 4px 12px rgba(0, 0, 0, 0.04);
    --shadow-float: 0 20px 48px -8px rgba(0, 0, 0, 0.14), 0 6px 16px rgba(0, 0, 0, 0.05);
    --shadow-btn-dark: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 4px 14px rgba(0, 0, 0, 0.18);
    --shadow-btn-dark-hover: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 8px 24px rgba(0, 0, 0, 0.24);

    /* Apple Ч/Б градиенты */
    --gradient-apple-dark: linear-gradient(180deg, #242428 0%, #0d0d0f 100%);
    --gradient-apple-card: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 248, 250, 0.94) 100%);
    --gradient-apple-canvas: linear-gradient(180deg, #fbfbfd 0%, #f4f4f7 100%);
    --gradient-apple-pill: linear-gradient(180deg, #ffffff 0%, #f2f2f5 100%);
    --gradient-apple-shine: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.4) 50%, transparent 100%);
    --gradient-apple-monogram: linear-gradient(145deg, #242428 0%, #0a0a0c 100%);

    /* Apple анимационные тайминги и кривые (Spring physics) */
    --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-snappy: cubic-bezier(0.2, 0.8, 0.2, 1);
    --ease-press: cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", "Inter", sans-serif;
    background: var(--gradient-apple-canvas);
    color: var(--gray-dark);
    min-height: 100vh;
    font-size: 15px;
    line-height: 1.5;
    letter-spacing: -0.011em;
    overflow-x: hidden;
}

/* --------------------------------------------------------------------------
   Декоративные размытые пятна на фоне (монохромный градиент)
   -------------------------------------------------------------------------- */
.bg-blob {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.12;
    z-index: -1;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.bg-blob-1 {
    width: 440px;
    height: 440px;
    background: radial-gradient(circle, #a1a1aa 0%, transparent 70%);
    top: -140px;
    left: -120px;
}

.bg-blob-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, #71717a 0%, transparent 70%);
    bottom: -140px;
    right: -100px;
}

.bg-blob-3 {
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, #52525b 0%, transparent 70%);
    top: 40%;
    right: 20%;
    opacity: 0.08;
}

/* --------------------------------------------------------------------------
   Glassmorphism-база Apple
   -------------------------------------------------------------------------- */
.glass {
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(28px) saturate(190%);
    -webkit-backdrop-filter: blur(28px) saturate(190%);
    border: 1px solid rgba(0, 0, 0, 0.07);
    box-shadow: var(--shadow);
    border-radius: var(--radius-card);
    transition: box-shadow 0.3s var(--ease-spring), border-color 0.3s var(--ease-spring), transform 0.3s var(--ease-spring);
}

/* --------------------------------------------------------------------------
   Навигация Apple Glass
   -------------------------------------------------------------------------- */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 22px;
    margin: 16px auto 0;
    max-width: 100%;
    width: calc(100% - 48px);
    border-radius: 24px;
    position: sticky;
    top: 16px;
    z-index: 50;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(28px) saturate(190%);
    -webkit-backdrop-filter: blur(28px) saturate(190%);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 24px -4px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.03);
    transition: all 0.3s var(--ease-spring);
}

.brand-monogram {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 11px;
    background: var(--gradient-apple-monogram);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: -0.01em;
    flex-shrink: 0;
    transition: transform 0.25s var(--ease-spring), box-shadow 0.25s var(--ease-spring);
}

.brand-monogram:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.brand-wordmark {
    letter-spacing: -0.02em;
    font-size: 14px;
    font-weight: 700;
    color: var(--gray-dark);
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    font-weight: 700;
    font-size: 15px;
    color: var(--gray-dark);
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    transition: opacity 0.2s ease;
}

.navbar-brand:hover {
    opacity: 0.85;
}

.navbar-brand i {
    color: var(--gray-dark);
    font-size: 18px;
}

.navbar-links {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: nowrap;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 7px 13px;
    border-radius: 12px;
    color: var(--gray-2);
    text-decoration: none;
    font-weight: 500;
    font-size: 13.5px;
    white-space: nowrap;
    flex-shrink: 0;
    border: 1px solid transparent;
    transition: background 0.2s var(--ease-spring), color 0.2s var(--ease-spring), transform 0.2s var(--ease-spring), border-color 0.2s var(--ease-spring);
}

button.nav-link {
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
    line-height: inherit;
    outline: none;
}

.nav-link:hover,
button.nav-link:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--black);
    transform: translateY(-1px);
}

.nav-link:active,
button.nav-link:active {
    transform: scale(0.96);
    transition: transform 0.08s var(--ease-press);
}

.nav-link.active,
button.nav-link.active {
    background: var(--gradient-apple-dark);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.nav-link.active:hover,
button.nav-link.active:hover {
    background: #000000;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.24);
}

/* --------------------------------------------------------------------------
   Выпадающие меню в навигации
   -------------------------------------------------------------------------- */
.nav-dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.nav-dropdown-toggle {
    user-select: none;
}

.dropdown-caret {
    font-size: 10px;
    margin-left: 2px;
    opacity: 0.65;
    transition: transform 0.25s var(--ease-spring), opacity 0.2s ease;
}

.nav-dropdown:hover .dropdown-caret,
.nav-dropdown.is-open .dropdown-caret {
    transform: rotate(180deg);
    opacity: 1;
}

.nav-dropdown-toggle.active .dropdown-caret {
    opacity: 0.9;
    color: #fff;
}

.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 205px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(28px) saturate(190%);
    -webkit-backdrop-filter: blur(28px) saturate(190%);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 18px;
    box-shadow: 0 16px 40px -6px rgba(0, 0, 0, 0.14), 0 2px 8px rgba(0, 0, 0, 0.04);
    padding: 7px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px) scale(0.97);
    transform-origin: top left;
    transition: opacity 0.22s var(--ease-spring), transform 0.22s var(--ease-spring), visibility 0.22s;
    pointer-events: none;
}

/* Невидимый мостик, соединяющий кнопку и меню для предотвращения потери ховера */
.nav-dropdown-menu::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 0;
    right: 0;
    height: 8px;
}

.nav-dropdown-menu-right {
    left: auto;
    right: 0;
    transform-origin: top right;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu,
.nav-dropdown.is-open .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.nav-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 10px;
    color: var(--gray-dark);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease;
}

.nav-dropdown-item i {
    font-size: 13.5px;
    width: 18px;
    text-align: center;
    color: var(--gray);
    transition: color 0.15s ease;
}

.nav-dropdown-item:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--black);
}

.nav-dropdown-item:hover i {
    color: var(--gray-dark);
}

.nav-dropdown-item.active {
    background: var(--gray-dark);
    color: #ffffff;
    font-weight: 600;
}

.nav-dropdown-item.active i {
    color: #ffffff;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    white-space: nowrap;
}

.btn-icon-only {
    width: 34px;
    height: 34px;
    min-width: 34px;
    padding: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    flex-shrink: 0;
    font-size: 13.5px;
    color: var(--gray);
    transition: all 0.2s ease;
}

.btn-icon-only:hover {
    background: rgba(0, 0, 0, 0.07);
    color: var(--black);
}

.role-subpill {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.08);
    color: var(--gray-dark);
    margin-left: 4px;
    vertical-align: middle;
}

.user-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 14px;
    color: var(--gray-dark);
}

.user-pill i {
    color: var(--gray-dark);
}

/* --------------------------------------------------------------------------
   Контейнер и общие элементы
   -------------------------------------------------------------------------- */
.container {
    width: 100%;
    max-width: 100%;
    margin: 24px auto 48px;
    padding: 0 24px;
}

.hidden {
    display: none !important;
}

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

.page-title {
    font-size: 34px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.page-subtitle {
    color: var(--gray);
    font-size: 16px;
    margin-top: 4px;
}

.empty-text {
    color: var(--gray);
    text-align: center;
    padding: 24px;
    font-size: 14px;
}

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

/* --------------------------------------------------------------------------
   Кнопки в стиле Apple
   -------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-btn);
    border: 1px solid transparent;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.01em;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.2s var(--ease-spring), box-shadow 0.2s var(--ease-spring), background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    white-space: nowrap;
    user-select: none;
}

.btn:active {
    transform: scale(0.965);
    transition: transform 0.08s var(--ease-press);
}

.btn-primary {
    background: var(--gradient-apple-dark);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: var(--shadow-btn-dark);
}

.btn-primary:hover {
    background: linear-gradient(180deg, #2c2c32 0%, #000000 100%);
    transform: translateY(-1.5px);
    box-shadow: var(--shadow-btn-dark-hover);
    color: #ffffff;
}

.btn-secondary {
    background: #ffffff;
    color: var(--gray-dark);
    border: 1px solid rgba(0, 0, 0, 0.09);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.btn-secondary:hover {
    background: #fbfbfd;
    border-color: rgba(0, 0, 0, 0.18);
    transform: translateY(-1.5px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
    color: var(--black);
}

.nav-action-btn {
    padding: 8px 14px;
    font-size: 13px;
    border-radius: 12px;
    gap: 7px;
}

.btn-ghost {
    background: var(--gradient-apple-subtle);
    color: var(--gray-dark);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.btn-ghost:hover {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.16);
    transform: translateY(-1.5px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
    color: var(--black);
}

.btn-danger {
    background: linear-gradient(180deg, #3f3f46 0%, #27272a 100%);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.btn-danger:hover {
    background: linear-gradient(180deg, #27272a 0%, #18181b 100%);
    transform: translateY(-1.5px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
}

.btn-sm {
    padding: 6px 13px;
    font-size: 13px;
    border-radius: 11px;
}

.btn-block {
    width: 100%;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 11px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    background: rgba(255, 255, 255, 0.7);
    color: var(--gray-2);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s var(--ease-spring);
}

.btn-icon:hover {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.12);
    color: var(--black);
    transform: translateY(-1px) scale(1.04);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.btn-icon:active {
    transform: scale(0.92);
    transition: transform 0.08s var(--ease-press);
}

.btn-icon.danger:hover {
    background: var(--black);
    color: #fff;
    border-color: var(--black);
}

.btn-icon:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none !important;
}

/* --------------------------------------------------------------------------
   Формы и поля ввода с тонкими хайлайн-обводками
   -------------------------------------------------------------------------- */
.field-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-2);
    margin-bottom: 6px;
    letter-spacing: -0.01em;
}

.input-wrap,
.select-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrap > i,
.select-wrap > i {
    position: absolute;
    left: 15px;
    color: var(--gray);
    font-size: 14px;
    pointer-events: none;
    transition: color 0.2s ease;
}

.input-wrap input,
.select-wrap select {
    width: 100%;
    padding: 11px 16px 11px 40px;
    border-radius: 14px;
    border: 1px solid rgba(0, 0, 0, 0.09);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    font-family: inherit;
    font-size: 14.5px;
    color: var(--gray-dark);
    outline: none;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
    transition: border-color 0.2s var(--ease-spring), box-shadow 0.2s var(--ease-spring), background 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
}

.input-wrap input:hover,
.select-wrap select:hover {
    border-color: rgba(0, 0, 0, 0.16);
    background: #ffffff;
}

.input-wrap input:focus,
.select-wrap select:focus {
    border-color: var(--black);
    box-shadow: 0 0 0 3.5px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.04);
    background: #ffffff;
}

.input-wrap input:focus + i,
.input-wrap:focus-within > i {
    color: var(--black);
}

.select-wrap::after {
    content: '\f078';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 16px;
    color: var(--gray);
    font-size: 11px;
    pointer-events: none;
    transition: transform 0.2s ease;
}

/* --------------------------------------------------------------------------
   Flash-сообщения
   -------------------------------------------------------------------------- */
.flash-container {
    position: fixed;
    top: 90px;
    right: 24px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 360px;
}

.flash {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 18px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(28px) saturate(190%);
    -webkit-backdrop-filter: blur(28px) saturate(190%);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 12px 32px -4px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.04);
    animation: appleFadeUp 0.35s var(--ease-spring) both;
}

.flash i {
    font-size: 16px;
    color: var(--gray-dark);
}

/* --------------------------------------------------------------------------
   Сочные и выразительные Apple Анимации
   -------------------------------------------------------------------------- */
@keyframes appleFadeUp {
    from {
        opacity: 0;
        transform: translateY(14px) scale(0.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes appleScaleIn {
    from {
        opacity: 0;
        transform: scale(0.92);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes appleShimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

@keyframes appleGlowPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.08);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(0, 0, 0, 0.04);
    }
}

@keyframes appleCardHover {
    0% { transform: translateY(0); }
    100% { transform: translateY(-2px); }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in-up,
.apple-fade-up {
    animation: appleFadeUp 0.45s var(--ease-spring) both;
}

.apple-scale-in {
    animation: appleScaleIn 0.35s var(--ease-spring) both;
}

.apple-shimmer-effect {
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.6) 50%, transparent 100%);
    background-size: 200% 100%;
    animation: appleShimmer 2.2s infinite;
}

/* --------------------------------------------------------------------------
   Страница входа
   -------------------------------------------------------------------------- */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-card {
    width: 100%;
    max-width: 460px;
    padding: 40px 36px;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(32px) saturate(190%);
    -webkit-backdrop-filter: blur(32px) saturate(190%);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 20px 48px -8px rgba(0, 0, 0, 0.12), 0 4px 14px rgba(0, 0, 0, 0.04);
}

.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.login-logo .brand-monogram {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    font-size: 26px;
    background: var(--gradient-apple-dark);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.25);
    transition: transform 0.3s var(--ease-spring);
}

.login-logo .brand-monogram:hover {
    transform: scale(1.06) rotate(-2deg);
}

.login-title {
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    letter-spacing: -0.025em;
    color: var(--gray-dark);
}

.login-subtitle {
    color: var(--gray);
    text-align: center;
    margin: 6px 0 24px;
    font-size: 14.5px;
    letter-spacing: -0.01em;
}

.segmented {
    display: flex;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 14px;
    padding: 3px;
    margin-bottom: 24px;
    gap: 3px;
}

.segment {
    flex: 1 1 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 8px;
    border: none;
    border-radius: 11px;
    background: transparent;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--gray);
    cursor: pointer;
    white-space: nowrap;
    text-align: center;
    transition: background 0.2s var(--ease-spring), color 0.2s var(--ease-spring), box-shadow 0.2s var(--ease-spring), transform 0.15s ease;
    min-width: 0;
}

.segment:active {
    transform: scale(0.97);
}

.segment i {
    font-size: 13px;
    flex-shrink: 0;
}

.segment.active {
    background: #ffffff;
    color: var(--gray-dark);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Автокомплит выбора сотрудника на странице входа */
.worker-search-wrap {
    position: relative;
}

.worker-search-wrap .input-wrap {
    position: relative;
}

.worker-search-wrap .input-wrap input {
    padding-right: 44px;
}

.worker-dropdown-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: var(--gray);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    transition: background 0.2s, color 0.2s;
}

.worker-dropdown-toggle:hover {
    background: rgba(0, 0, 0, 0.06);
    color: var(--gray-dark);
}

.worker-suggestions {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 100;
    max-height: 240px;
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(28px) saturate(190%);
    -webkit-backdrop-filter: blur(28px) saturate(190%);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 18px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.14);
    padding: 6px;
    animation: appleFadeUp 0.25s var(--ease-spring) both;
}

.worker-suggestion-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 10px 14px;
    border: none;
    background: transparent;
    border-radius: 12px;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    font-size: 14px;
    color: var(--gray-dark);
    transition: background 0.15s var(--ease-spring), transform 0.15s ease;
}

.worker-suggestion-item:hover,
.worker-suggestion-item.active {
    background: rgba(0, 0, 0, 0.05);
    transform: translateX(2px);
}

.worker-item-name {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.worker-item-name i {
    color: var(--gray);
    font-size: 13px;
}

.worker-item-name mark {
    background: rgba(0, 0, 0, 0.1);
    color: inherit;
    padding: 0 2px;
    border-radius: 4px;
    font-weight: 700;
}

.worker-item-stages {
    font-size: 12px;
    color: var(--gray-2);
    background: rgba(0, 0, 0, 0.04);
    padding: 3px 10px;
    border-radius: 999px;
    white-space: nowrap;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.worker-suggestion-empty {
    padding: 16px 12px;
    color: var(--gray);
    font-size: 14px;
    text-align: center;
}

/* --------------------------------------------------------------------------
   Карточки-счётчики (дашборд в Apple Monochrome)
   -------------------------------------------------------------------------- */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 22px 24px;
    border-radius: var(--radius-card-sm);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(24px) saturate(190%);
    -webkit-backdrop-filter: blur(24px) saturate(190%);
    border: 1px solid rgba(0, 0, 0, 0.07);
    box-shadow: 0 4px 16px -2px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
    transition: transform 0.25s var(--ease-spring), box-shadow 0.25s var(--ease-spring), border-color 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    border-color: rgba(0, 0, 0, 0.14);
    box-shadow: 0 12px 28px -4px rgba(0, 0, 0, 0.09), 0 2px 6px rgba(0, 0, 0, 0.03);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: transform 0.25s var(--ease-spring);
}

.stat-card:hover .stat-icon {
    transform: scale(1.08);
}

/* Монохромные оттенки Apple для иконок-счётчиков */
.stat-icon.blue { background: linear-gradient(135deg, #1c1c1e 0%, #000000 100%); }
.stat-icon.orange { background: linear-gradient(135deg, #2c2c2e 0%, #18181b 100%); }
.stat-icon.green { background: linear-gradient(135deg, #3a3a3c 0%, #242426 100%); }
.stat-icon.purple { background: linear-gradient(135deg, #48484a 0%, #2c2c2e 100%); }
.stat-icon.dark { background: linear-gradient(135deg, #1d1d1f 0%, #09090b 100%); }

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    color: var(--gray-dark);
}

.stat-label {
    color: var(--gray);
    font-size: 13.5px;
    margin-top: 4px;
    letter-spacing: -0.01em;
}

/* --------------------------------------------------------------------------
   Панели и дашборд
   -------------------------------------------------------------------------- */
.dashboard-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.panel {
    padding: 24px;
    border-radius: var(--radius-card);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(28px) saturate(190%);
    -webkit-backdrop-filter: blur(28px) saturate(190%);
    border: 1px solid rgba(0, 0, 0, 0.07);
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.02);
}

.panel-header {
    margin-bottom: 16px;
}

.panel-title {
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.02em;
    color: var(--gray-dark);
}

.panel-title i {
    color: var(--gray-dark);
}

.stage-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stage-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.stage-panel-title-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.stage-summary-pills {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-toggle-stages {
    font-size: 12.5px;
    padding: 6px 12px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.stage-card {
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.45);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: background 0.2s, box-shadow 0.2s;
    overflow: hidden;
}

.stage-card:hover {
    background: rgba(255, 255, 255, 0.7);
}

.stage-card.expanded {
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.stage-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-radius: 18px;
    transition: background 0.2s;
    gap: 10px;
}

.stage-row-clickable {
    cursor: pointer;
    user-select: none;
}

.stage-row-clickable:focus-visible {
    outline: 2px solid var(--gray-dark);
    outline-offset: -2px;
}

.stage-row-name {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    flex-shrink: 0;
}

.stage-art-count-badge {
    font-size: 11px;
    color: var(--gray-2);
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 7px;
    border-radius: 8px;
    font-weight: 600;
    white-space: nowrap;
}

.stage-row-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    justify-content: flex-end;
    flex-shrink: 0;
}

.badge-fbs-row,
.badge-fbo-row {
    font-size: 11.5px;
    padding: 3px 8px;
    white-space: nowrap;
    flex-shrink: 0;
}

.stage-chevron {
    font-size: 12px;
    color: var(--gray);
    transition: transform 0.25s ease;
    margin-left: 2px;
}

.stage-card.expanded .stage-chevron {
    transform: rotate(180deg);
}

.stage-details {
    padding: 0 16px 14px 16px;
    animation: fadeIn 0.2s ease;
}

.stage-articles-scroll {
    max-height: 280px;
    overflow-y: auto;
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    background: rgba(255, 255, 255, 0.75);
}

.stage-articles-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin: 0;
}

.stage-articles-table th {
    background: rgba(245, 245, 247, 0.95);
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 8px 12px;
    font-size: 11.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--gray);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.stage-articles-table td {
    padding: 8px 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.stage-art-row:last-child td {
    border-bottom: none;
}

.stage-art-row:hover td {
    background: rgba(0, 0, 0, 0.02);
}

.stage-art-title {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stage-art-code {
    font-size: 13px;
    color: var(--gray-dark);
}

.stage-art-name {
    font-size: 11.5px;
    color: var(--gray-2);
    line-height: 1.3;
}

.stage-art-orders {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
    margin-top: 4px;
}

.orders-prefix {
    font-size: 11px;
    color: var(--gray);
}

.stage-order-tag {
    display: inline-block;
    font-size: 11px;
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 6px;
    padding: 1px 6px;
    color: var(--gray-3);
    white-space: nowrap;
}

.stage-art-total {
    font-size: 13px;
    color: var(--gray-dark);
}

.stage-empty-articles {
    padding: 16px;
    text-align: center;
    color: var(--gray);
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    border: 1px dashed rgba(0, 0, 0, 0.08);
}

.stage-avg {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--gray);
    font-size: 13px;
    white-space: nowrap;
}

.stage-avg i {
    color: var(--gray-2);
}

.stage-badge {
    width: 26px;
    height: 26px;
    border-radius: 9px;
    background: var(--gray-dark);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}

.count-chip {
    background: rgba(0, 0, 0, 0.06);
    color: var(--gray-dark);
    font-weight: 700;
    font-size: 13px;
    padding: 3px 10px;
    border-radius: 999px;
    white-space: nowrap;
}

.log-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.log-item {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.log-item:last-child {
    border-bottom: none;
}

.log-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--gray-dark);
    margin-top: 7px;
    flex-shrink: 0;
}

.log-title {
    font-size: 14px;
}

.log-qty {
    color: var(--gray-dark);
    font-weight: 700;
}

.log-meta {
    color: var(--gray);
    font-size: 12px;
    margin-top: 2px;
}

/* --------------------------------------------------------------------------
   Выданная продукция (дашборд)
   -------------------------------------------------------------------------- */
.issued-search {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.issued-search > i {
    position: absolute;
    left: 14px;
    color: var(--gray);
    font-size: 14px;
    pointer-events: none;
}

.issued-search input {
    width: 100%;
    padding: 11px 14px 11px 40px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.7);
    font-family: inherit;
    font-size: 14px;
    color: var(--gray-dark);
    outline: none;
}

.issued-search input:focus {
    border-color: var(--gray-dark);
    background: #fff;
}

.issued-list {
    display: flex;
    flex-direction: column;
}

.issued-row {
    display: grid;
    grid-template-columns: 0.7fr 1.4fr 0.9fr 0.5fr 0.8fr 0.6fr;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    font-size: 14px;
}

.issued-row:last-child {
    border-bottom: none;
}

.issued-article {
    font-weight: 600;
}

.issued-name {
    color: var(--gray-dark);
}

.issued-type {
    display: inline-flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.05);
    color: var(--gray-dark);
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 999px;
    justify-self: start;
    white-space: nowrap;
}

.issued-qty {
    font-weight: 700;
}

.issued-order,
.issued-week {
    color: var(--gray);
    white-space: nowrap;
}

/* Таблица эффективности сотрудников в модальном окне */
.eff-modal {
    max-width: 1100px;
    max-height: calc(100vh - 48px);
    display: flex;
    flex-direction: column;
}

.eff-modal .modal-header {
    flex-shrink: 0;
    margin-bottom: 6px;
}

.eff-modal .modal-text {
    flex-shrink: 0;
    margin-bottom: 12px;
}

.eff-filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 8px 12px;
    margin-bottom: 12px;
    flex-shrink: 0;
}

.eff-filter-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.eff-filter-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-2);
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.eff-select {
    padding: 6px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #ffffff;
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-dark);
    outline: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.eff-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.15);
}

.eff-check-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-dark);
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.eff-check-label input {
    accent-color: var(--primary);
    cursor: pointer;
}

.eff-stats-chip {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-2);
    background: rgba(0, 0, 0, 0.04);
    padding: 4px 10px;
    border-radius: 20px;
    margin-left: auto;
    white-space: nowrap;
}

.eff-modal .table-scroll {
    flex: 1 1 auto;
    min-height: 180px;
    max-height: calc(100vh - 250px);
    overflow: auto;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: #ffffff;
    position: relative;
}

.eff-table {
    min-width: 600px;
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
}

.eff-table thead th {
    position: sticky;
    top: 0;
    background: #f8fafc;
    z-index: 10;
    box-shadow: 0 1px 0 var(--border);
}

.eff-table tfoot td {
    position: sticky;
    bottom: 0;
    background: #f8fafc;
    z-index: 10;
    box-shadow: 0 -1px 0 var(--border-strong);
}

.data-table tfoot td {
    font-weight: 700;
    border-top: 1px solid var(--border-strong);
    border-bottom: none;
}

/* --------------------------------------------------------------------------
   Фильтры
   -------------------------------------------------------------------------- */
.filters {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 24px;
    flex-wrap: wrap;
    position: relative;
    z-index: 20;
}

.filter-field {
    flex: 1;
    min-width: 150px;
}

.filter-field select {
    width: 100%;
    padding: 11px 14px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.7);
    font-family: inherit;
    font-size: 14px;
    color: var(--gray-dark);
    outline: none;
}

.filter-actions {
    display: flex;
    gap: 10px;
}

/* Multi-select фильтр этапов */
.multi-select-wrap {
    position: relative;
    width: 100%;
}

.multi-select-wrap.open {
    z-index: 40;
}

.multi-select-trigger {
    width: 100%;
    padding: 11px 14px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.7);
    font-family: inherit;
    font-size: 14px;
    color: var(--gray-dark);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.2s, background 0.2s;
    user-select: none;
}

.multi-select-trigger:hover,
.multi-select-wrap.open .multi-select-trigger {
    border-color: var(--gray-dark);
    background: rgba(255, 255, 255, 0.95);
}

.multi-select-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.multi-select-arrow {
    font-size: 11px;
    color: var(--gray);
    transition: transform 0.2s;
    flex-shrink: 0;
}

.multi-select-wrap.open .multi-select-arrow {
    transform: rotate(180deg);
}

.multi-select-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 220px;
    max-width: 280px;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-strong);
    border-radius: 16px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
    padding: 8px;
    z-index: 1000;
}

.multi-select-dropdown.hidden {
    display: none;
}

.multi-select-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 8px 8px 8px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 6px;
}

.multi-select-link-btn {
    background: none;
    border: none;
    color: var(--gray-dark);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 3px 6px;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}

.multi-select-link-btn:hover {
    background: rgba(0, 0, 0, 0.06);
    color: var(--black);
}

.multi-select-options {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 220px;
    overflow-y: auto;
}

.multi-select-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 10px;
    font-size: 13.5px;
    color: var(--gray-dark);
    cursor: pointer;
    transition: background 0.15s;
    user-select: none;
}

.multi-select-item:hover {
    background: rgba(0, 0, 0, 0.05);
}

.multi-select-item input[type="checkbox"] {
    accent-color: var(--gray-dark);
    width: 16px;
    height: 16px;
    cursor: pointer;
    flex-shrink: 0;
}

/* Диапазоны дат и времени */
.range-inputs {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
}

.range-inputs .form-date-input,
.range-inputs .form-time-input {
    flex: 1;
    min-width: 0;
    padding: 11px 10px;
    font-size: 13px;
}

.range-sep {
    font-size: 13px;
    color: var(--gray);
    flex-shrink: 0;
    font-weight: 500;
}

/* --------------------------------------------------------------------------
   Недели (группировка заказов)
   -------------------------------------------------------------------------- */
.week-section {
    margin-bottom: 24px;
}

.week-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 22px;
    border-radius: 20px;
    margin-bottom: 12px;
}

.week-title {
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.week-title i {
    color: var(--gray-dark);
}

/* --------------------------------------------------------------------------
   Таблицы
   -------------------------------------------------------------------------- */
.table-panel {
    width: 100%;
    padding: 8px;
    border-radius: 28px;
    overflow: hidden;
}

.table-scroll {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

.data-table th {
    text-align: left;
    padding: 14px 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    font-size: 14px;
    word-break: break-word;
    overflow-wrap: break-word;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr {
    transition: background 0.15s;
}

.data-table tbody tr:hover {
    background: rgba(0, 0, 0, 0.02);
}

.td-number {
    font-weight: 600;
}

.td-comment {
    color: var(--gray);
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.td-actions {
    text-align: right;
    white-space: nowrap;
}

/* Бейджи статусов (оттенки серого) */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.badge-inprogress { background: #e8e8ed; color: #1d1d1f; }
.badge-ready { background: #d1d1d6; color: #1d1d1f; }
.badge-issued { background: #3a3a3c; color: #ffffff; }
.badge-blue { background: #e8e8ed; color: #1d1d1f; }
.badge-green { background: #d1d1d6; color: #1d1d1f; }
.badge-purple { background: #3a3a3c; color: #ffffff; }
.badge-orange { background: #fef3c7; color: #92400e; }

.user-pill-sm {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.04);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

.count-chip {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.05);
    font-size: 13.5px;
}

.form-date-input {
    width: 100%;
    padding: 11px 14px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.7);
    font-family: inherit;
    font-size: 14px;
    color: var(--gray-dark);
    outline: none;
}

.op-modal-info {
    padding: 14px 16px;
    border-radius: 16px;
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.info-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13.5px;
    gap: 12px;
}

.info-line span:first-child {
    color: var(--gray);
}

.glass-subtle {
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

/* --------------------------------------------------------------------------
   Страница этапа (карточки заказов)
   -------------------------------------------------------------------------- */
.stage-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 16px;
    font-weight: 600;
    color: var(--gray-dark);
}

.stage-counter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 16px;
    font-size: 14px;
    color: var(--gray-dark);
    font-weight: 600;
    transition: transform 0.25s ease, background-color 0.25s ease, border-color 0.25s ease;
    cursor: default;
    user-select: none;
}

.stage-counter-chip i {
    color: #f59e0b;
    font-size: 13px;
}

.stage-counter-chip .counter-label {
    font-size: 12px;
    color: var(--gray);
    font-weight: 500;
}

.stage-counter-chip strong {
    font-size: 15px;
    font-weight: 700;
    color: var(--gray-dark);
}

.stage-counter-chip .counter-unit {
    font-size: 12px;
    color: var(--gray);
    font-weight: 500;
}

.stage-counter-chip.bump {
    animation: counterBumpDesktop 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes counterBumpDesktop {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); background: rgba(16, 185, 129, 0.15); border-color: rgba(16, 185, 129, 0.4); }
    100% { transform: scale(1); }
}

.stage-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.stage-switch {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 16px;
}

.stage-switch i {
    color: var(--gray);
    font-size: 14px;
}

.stage-switch select {
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-dark);
    outline: none;
    cursor: pointer;
    padding-right: 4px;
}

/* Список этапов-чекбоксов при назначении сотрудникам. */
.stage-check-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.stage-check-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    font-size: 14px;
    color: var(--gray-dark);
    transition: border-color 0.2s, background 0.2s;
}

.stage-check-item:hover {
    border-color: var(--gray);
}

.stage-check-item input {
    accent-color: var(--gray-dark);
    cursor: pointer;
}

.orders-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.loading {
    padding: 40px;
    text-align: center;
    color: var(--gray);
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.order-card {
    padding: 24px;
    border-radius: 28px;
    transition: transform 0.2s, box-shadow 0.2s;
    animation: fadeInUp 0.5s ease both;
}

.order-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.order-card.open,
.order-card.open:hover {
    transform: none !important;
    animation: none !important;
}

/* Шапка карточки заказа (кликабельна — разворачивает/сворачивает) */
.order-card-head {
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    flex-wrap: wrap;
}

.order-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    border: none;
    background: rgba(0, 0, 0, 0.04);
    color: var(--gray-2);
    cursor: pointer;
    font-size: 14px;
    flex-shrink: 0;
    transition: background 0.2s, color 0.2s, transform 0.25s;
}

.order-toggle:hover {
    background: rgba(0, 0, 0, 0.08);
    color: var(--gray-dark);
}

.order-card.open .order-toggle {
    transform: rotate(180deg);
}

.order-card.open .order-card-head {
    position: sticky;
    top: 76px;
    z-index: 30;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 12px 16px;
    margin: -12px -16px 0;
    border-radius: 18px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.order-card-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    flex: 1;
    min-width: 200px;
}

.order-card-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 220px;
}

.order-card-count {
    color: var(--gray);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.order-card-body {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.order-card-number {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.order-card-week {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.05);
    color: var(--gray-dark);
    font-size: 13px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 999px;
}

.order-card-type {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--gray);
    font-size: 14px;
}

.order-card-type i {
    color: var(--gray-dark);
}

.order-progress {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.order-quantity {
    font-size: 14px;
    color: var(--gray);
    white-space: nowrap;
}

.order-quantity strong {
    color: var(--gray-dark);
    font-size: 18px;
    font-weight: 700;
}

.progress-bar {
    flex: 1;
    min-width: 120px;
    height: 8px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--gray-dark);
    border-radius: 999px;
    transition: width 0.4s ease;
}

/* --------------------------------------------------------------------------
   Модальные окна
   -------------------------------------------------------------------------- */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    z-index: 200;
    padding: 24px;
    animation: fadeIn 0.2s ease both;
    overflow-y: auto;
}

.modal {
    width: 100%;
    max-width: 440px;
    margin: auto 0;
    padding: 24px;
    border-radius: 28px;
    animation: fadeInUp 0.3s ease both;
    box-sizing: border-box;
}

.modal-sm {
    max-width: 380px;
}

.modal-lg {
    max-width: 720px;
}

.modal-xl {
    max-width: 960px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.modal-text {
    color: var(--gray);
    font-size: 15px;
    margin-bottom: 20px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.modal-subtitle {
    font-size: 14px;
    font-weight: 500;
    color: var(--gray);
    margin-left: 8px;
}

.order-modal-comment {
    color: var(--gray);
    font-size: 14px;
    margin-bottom: 14px;
}

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

/* Строки заказа в форме добавления */
.order-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.order-item-row {
    display: grid;
    grid-template-columns: 0.9fr 1.2fr 1fr 0.8fr 0.55fr auto;
    gap: 8px;
    align-items: center;
}

.order-item-row input,
.order-item-row select {
    width: 100%;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.7);
    font-family: inherit;
    font-size: 14px;
    color: var(--gray-dark);
    outline: none;
}

.order-item-row input:focus,
.order-item-row select:focus {
    border-color: var(--gray-dark);
}

/* Поиск по справочнику в форме добавления заказа */
.catalog-search {
    position: relative;
}

.catalog-search-input,
.catalog-search > input {
    width: 100%;
    padding: 11px 14px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.7);
    font-family: inherit;
    font-size: 14px;
    color: var(--gray-dark);
    outline: none;
}

.catalog-search > input:focus {
    border-color: var(--gray-dark);
    background: #fff;
}

.catalog-suggestions {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 50;
    max-height: 260px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.14);
    padding: 6px;
}

.catalog-suggestion {
    display: grid;
    grid-template-columns: 90px 1fr auto;
    gap: 10px;
    align-items: center;
    width: 100%;
    padding: 9px 10px;
    border: none;
    background: transparent;
    border-radius: 10px;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    font-size: 14px;
    color: var(--gray-dark);
}

.catalog-suggestion:hover {
    background: rgba(0, 0, 0, 0.05);
}

.catalog-suggestion .cs-article {
    font-weight: 600;
    color: var(--gray-dark);
    word-break: break-word;
    overflow-wrap: break-word;
}

.catalog-suggestion .cs-name {
    color: var(--gray);
    white-space: normal;
    word-break: break-word;
    overflow-wrap: break-word;
    line-height: 1.35;
}

.catalog-suggestion .cs-type {
    font-size: 12px;
    color: var(--gray);
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 8px;
    border-radius: 20px;
    white-space: normal;
    word-break: break-word;
    line-height: 1.25;
}

.catalog-suggestion-empty {
    padding: 12px;
    color: var(--gray);
    font-size: 14px;
    text-align: center;
}


/* Панель фильтров на странице этапа сотрудника */
.stage-filters {
    display: flex;
    align-items: flex-end;
    gap: 14px;
    padding: 16px 20px;
    margin-bottom: 20px;
    border-radius: 20px;
    flex-wrap: wrap;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--border);
}

.stage-filters .filter-field {
    flex: 1;
    min-width: 160px;
}

.stage-filters .filter-field select,
.stage-filters .filter-field input {
    width: 100%;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.9);
    font-family: inherit;
    font-size: 14px;
    color: var(--gray-dark);
    outline: none;
    transition: all 0.2s ease;
}

.stage-filters .filter-field select:focus,
.stage-filters .filter-field input:focus {
    border-color: var(--gray-dark);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

.stage-filter-count {
    font-size: 13px;
    color: var(--gray);
    align-self: center;
    margin-left: auto;
    font-weight: 500;
}

/* Фильтры строк внутри заказа */
.order-lines-filters {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
    background: rgba(255, 255, 255, 0.6);
    padding: 12px 16px;
    border-radius: 16px;
    border: 1px solid var(--border);
}

.lines-filter-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.lines-filter-field.filter-type-wrap {
    flex: 1.2;
    min-width: 160px;
}

.lines-filter-field.filter-category-wrap {
    flex: 1.1;
    min-width: 140px;
}

.lines-filter-field.filter-article-wrap {
    flex: 1.2;
    min-width: 160px;
}

.lines-filter-field.filter-search-wrap {
    flex: 1.6;
    min-width: 180px;
}

.lines-filter-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.lines-filter-field select,
.lines-filter-field .line-search-input {
    width: 100%;
    padding: 9px 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.95);
    font-family: inherit;
    font-size: 13px;
    color: var(--gray-dark);
    outline: none;
    transition: all 0.2s ease;
}

.lines-filter-field select:focus,
.lines-filter-field .line-search-input:focus {
    border-color: var(--gray-dark);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

.lines-filter-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
}

.line-filters-reset {
    padding: 8px 12px;
    border-radius: 10px;
}

/* Дропдаун настройки скрытия/отображения колонок таблицы */
.lines-col-picker-wrap {
    position: relative;
    display: inline-block;
}

.line-cols-menu-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.9);
    color: var(--gray-dark);
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    white-space: nowrap;
}

.line-cols-menu-btn:hover {
    background: #fff;
    border-color: var(--gray);
    color: var(--black);
}

.line-cols-menu-btn.active-filter {
    background: #eef2ff;
    border-color: #818cf8;
    color: #4338ca;
}

.cols-hidden-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #4f46e5;
    color: #fff;
    font-size: 10.5px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 999px;
    line-height: 1.3;
}

.lines-cols-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    z-index: 120;
    min-width: 260px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-strong);
    border-radius: 16px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.16);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    animation: fadeInDown 0.18s ease;
}

.lines-cols-dropdown.hidden {
    display: none !important;
}

.lines-cols-dropdown-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    font-size: 12px;
    font-weight: 700;
    color: var(--gray-dark);
}

.lines-cols-dropdown-title {
    display: flex;
    align-items: center;
    gap: 6px;
}

.line-cols-reset-btn {
    border: none;
    background: transparent;
    color: #4f46e5;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.15s;
}

.line-cols-reset-btn:hover {
    background: rgba(79, 70, 229, 0.1);
}

.lines-cols-dropdown-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 290px;
    overflow-y: auto;
    padding-right: 2px;
}

.line-col-check-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 6px 8px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-dark);
    cursor: pointer;
    user-select: none;
    transition: background 0.12s;
}

.line-col-check-item:hover {
    background: rgba(0, 0, 0, 0.04);
}

.line-col-cb-input {
    width: 16px;
    height: 16px;
    accent-color: #4f46e5;
    cursor: pointer;
    margin: 0;
    flex-shrink: 0;
}

/* Поиск по строкам заказа */
.line-search {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.line-search > i {
    position: absolute;
    left: 14px;
    color: var(--gray);
    font-size: 14px;
    pointer-events: none;
}

.line-search-input {
    width: 100%;
    padding: 11px 14px 11px 40px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.7);
    font-family: inherit;
    font-size: 14px;
    color: var(--gray-dark);
    outline: none;
}

.line-search-input:focus {
    border-color: var(--gray-dark);
    background: #fff;
}

.line-count {
    color: var(--gray);
    font-size: 12px;
    margin-bottom: 8px;
}

.lines-list {
    display: flex;
    flex-direction: column;
}

/* Обертка таблицы строк заказа */
.lines-table-wrap {
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.03);
    margin-top: 10px;
    overflow: auto;
    max-height: calc(100vh - 220px);
}

.lines-table-wrap::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.lines-table-wrap::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.02);
    border-radius: 8px;
}

.lines-table-wrap::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.16);
    border-radius: 8px;
}

.lines-table-wrap::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.28);
}

/* Строка заказа (артикул, название, ткань, тип, приоритет, прогресс, ввод/статус, [печать], кнопка брака) */
.line-row {
    display: grid;
    grid-template-columns: var(--row-grid-cols, 160px minmax(150px, 1fr) 130px 140px 120px 200px 90px 88px);
    align-items: stretch;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    background: #fff;
    font-size: 13.5px;
    min-width: var(--row-min-width, 1078px);
    width: 100%;
    transition: background 0.12s ease;
}

/* Принудительное применение динамической сетки колонок, если задана переменная */
.order-lines-container[style*="--row-grid-cols"] .line-row {
    grid-template-columns: var(--row-grid-cols) !important;
    min-width: var(--row-min-width) !important;
}

/* Скрытие колонок через классы-модификаторы на контейнере */
.order-lines-container.hide-col-art .line-col-art { display: none !important; }
.order-lines-container.hide-col-name .line-col-name { display: none !important; }
.order-lines-container.hide-col-fabric .line-col-fabric { display: none !important; }
.order-lines-container.hide-col-type .line-col-type { display: none !important; }
.order-lines-container.hide-col-prio .line-col-prio { display: none !important; }
.order-lines-container.hide-col-prog .line-col-prog { display: none !important; }
.order-lines-container.hide-col-input .line-col-input,
.order-lines-container.hide-col-input .line-col-done { display: none !important; }
.order-lines-container.hide-col-print .line-col-print { display: none !important; }
.order-lines-container.hide-col-defect .line-col-defect { display: none !important; }
.order-lines-container.hide-col-stage .line-col-stage { display: none !important; }
.order-lines-container.hide-col-status .line-col-status { display: none !important; }

.line-row.has-print {
    grid-template-columns: var(--row-grid-cols, 160px minmax(150px, 1fr) 130px 140px 120px 200px 90px 40px 88px);
    min-width: var(--row-min-width, 1118px);
}

.line-row.has-select {
    grid-template-columns: var(--row-grid-cols, 44px 160px minmax(150px, 1fr) 130px 140px 120px 200px 90px 88px);
    min-width: var(--row-min-width, 1122px);
}

.line-row.has-select.has-print {
    grid-template-columns: var(--row-grid-cols, 44px 160px minmax(150px, 1fr) 130px 140px 120px 200px 90px 40px 88px);
    min-width: var(--row-min-width, 1162px);
}

.line-row.no-defect {
    grid-template-columns: var(--row-grid-cols, 160px minmax(150px, 1fr) 130px 140px 120px 200px 90px);
    min-width: var(--row-min-width, 990px);
}

.line-row.no-defect.has-print {
    grid-template-columns: var(--row-grid-cols, 160px minmax(150px, 1fr) 130px 140px 120px 200px 90px 40px);
    min-width: var(--row-min-width, 1030px);
}

.line-row.no-defect.has-select {
    grid-template-columns: var(--row-grid-cols, 44px 160px minmax(150px, 1fr) 130px 140px 120px 200px 90px);
    min-width: var(--row-min-width, 1034px);
}

.line-row.no-defect.has-select.has-print {
    grid-template-columns: var(--row-grid-cols, 44px 160px minmax(150px, 1fr) 130px 140px 120px 200px 90px 40px);
    min-width: var(--row-min-width, 1074px);
}

.line-row:last-child {
    border-bottom: none;
}

.line-row:hover:not(.line-header) {
    background: rgba(248, 250, 252, 0.95);
}

.line-row.selected {
    background: rgba(37, 99, 235, 0.08) !important;
}

.line-row.complete {
    background: rgba(248, 250, 252, 0.6);
    color: var(--gray);
}

.line-row.line-view {
    grid-template-columns: var(--row-grid-cols, 160px minmax(150px, 1fr) 130px 140px 120px 200px 120px 90px 88px);
    min-width: var(--row-min-width, 1098px);
}

.line-row.line-view.has-select {
    grid-template-columns: var(--row-grid-cols, 44px 160px minmax(150px, 1fr) 130px 140px 120px 200px 120px 90px 88px);
    min-width: var(--row-min-width, 1142px);
}

.line-row.line-view.has-admin-actions {
    grid-template-columns: var(--row-grid-cols, 160px minmax(150px, 1fr) 130px 140px 120px 200px 120px 90px 88px 48px);
    min-width: var(--row-min-width, 1146px);
}

.line-row.line-view.has-select.has-admin-actions {
    grid-template-columns: var(--row-grid-cols, 44px 160px minmax(150px, 1fr) 130px 140px 120px 200px 120px 90px 88px 48px);
    min-width: var(--row-min-width, 1190px);
}

.line-col-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    padding: 0 4px !important;
}

.line-col-actions .line-delete-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--danger, #ef4444);
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.line-col-actions .line-delete-btn:hover {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
}

.line-col-cb {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    padding: 0 4px !important;
    cursor: pointer;
}

.line-col-cb input[type="checkbox"] {
    width: 17px;
    height: 17px;
    cursor: pointer;
    accent-color: var(--primary);
    margin: 0;
}

/* Шапка таблицы (закреплена вверху таблицы — sticky) */
.line-row.line-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: #f8fafc !important;
    border-bottom: 2px solid rgba(0, 0, 0, 0.1);
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b !important;
    user-select: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.line-row.line-header > * {
    background: #f8fafc !important;
    color: #64748b !important;
    font-weight: 700 !important;
    padding: 10px 12px;
    border-right: 1px solid rgba(0, 0, 0, 0.08);
}

/* Вертикальные разделители между всеми колонками */
.line-row > * {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-right: 1px solid rgba(0, 0, 0, 0.06);
    min-width: 0;
    box-sizing: border-box;
}

.line-row > *:last-child {
    border-right: none;
}

.line-th-center {
    justify-content: center;
    text-align: center;
}

/* Колонки и элементы */
.line-col-art {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 4px;
    font-weight: 600;
    min-width: 0;
}

.line-article {
    width: 100%;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: break-word;
    line-height: 1.25;
}

.line-col-name {
    color: var(--gray-dark);
}

.line-name {
    min-width: 0;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: break-word;
    line-height: 1.35;
}

.line-col-fabric {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 3px;
    min-width: 0;
}

.line-fabric {
    display: inline-flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.05);
    color: var(--gray-dark);
    font-size: 12px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 6px;
    white-space: normal;
    word-break: break-word;
    line-height: 1.2;
}

.line-color {
    display: inline-flex;
    align-items: center;
    color: #475569;
    font-size: 11.5px;
    font-weight: 500;
    padding: 0 2px;
    white-space: normal;
    word-break: break-word;
    line-height: 1.2;
}

.line-col-prog {
    justify-content: center;
}

.line-col-input {
    justify-content: center;
    padding: 6px 8px;
}

.line-col-done {
    justify-content: center;
}

.line-col-defect {
    justify-content: center;
    padding: 6px 8px;
}

/* Кнопка "Брак" */
.btn-defect {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
    font-size: 12px;
    font-weight: 600;
    padding: 5px 9px;
    border-radius: 9px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.btn-defect:hover {
    background: #fee2e2;
    color: #b91c1c;
    border-color: #fca5a5;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.15);
}

.btn-defect:active {
    transform: translateY(0);
}

/* Информационное сообщение в модальном окне брака */
.defect-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-left: 4px solid #ef4444;
    color: #991b1b;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.4;
    margin-top: 14px;
}

.defect-notice i {
    font-size: 17px;
    color: #dc2626;
    flex-shrink: 0;
}

/* Карточка информации об артикуле в модальном окне */
.defect-info {
    padding: 12px 16px;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13.5px;
    background: rgba(248, 250, 252, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.defect-info .info-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.defect-info .info-line span:first-child {
    color: var(--gray);
}

.field-hint {
    font-size: 12px;
    color: var(--gray);
    margin-top: 4px;
}

.textarea-wrap textarea {
    width: 100%;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.8);
    font-family: inherit;
    font-size: 13.5px;
    color: var(--gray-dark);
    outline: none;
    resize: vertical;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.textarea-wrap textarea:focus {
    border-color: var(--gray-dark);
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.06);
    background: #fff;
}

/* Бейджи и иконки для брака */
.badge-defect {
    display: inline-flex;
    align-items: center;
    background: #fee2e2;
    color: #b91c1c;
    font-size: 12.5px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 999px;
    border: 1px solid #fecaca;
    white-space: nowrap;
}

.stat-icon.defect {
    background: #dc2626;
    color: #fff;
}

.week-mini-badge {
    display: inline-block;
    margin-left: 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--gray);
    background: rgba(0, 0, 0, 0.04);
    padding: 2px 6px;
    border-radius: 6px;
}

/* Тип продукции и этап в строке */
.line-type {
    display: inline-flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.05);
    color: var(--gray-dark);
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 999px;
    justify-self: start;
    white-space: normal;
    word-break: break-word;
    line-height: 1.25;
}

.line-stage {
    color: var(--gray);
    font-size: 13px;
    white-space: nowrap;
}

.line-priority {
    display: inline-flex;
    align-items: center;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 999px;
    justify-self: start;
    white-space: nowrap;
}

.line-priority.prio-normal {
    background: rgba(0, 0, 0, 0.05);
    color: var(--gray-dark);
}

.line-priority.prio-medium {
    background: #fef3c7;
    color: #92400e;
}

.line-priority.prio-max {
    background: #fee2e2;
    color: #b91c1c;
}

.line-priority-select {
    display: inline-flex;
    align-items: center;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 22px 3px 10px;
    border-radius: 999px;
    justify-self: start;
    white-space: nowrap;
    border: 1px solid transparent;
    cursor: pointer;
    outline: none;
    appearance: none;
    background-repeat: no-repeat;
    background-position: right 6px center;
    background-size: 10px 10px;
    transition: all 0.15s ease;
}

.line-priority-select.prio-normal {
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--gray-dark);
    border-color: rgba(0, 0, 0, 0.08);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

.line-priority-select.prio-medium {
    background-color: #fef3c7;
    color: #92400e;
    border-color: #fde68a;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2392400e' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

.line-priority-select.prio-max {
    background-color: #fee2e2;
    color: #b91c1c;
    border-color: #fecaca;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b91c1c' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

.line-priority-select:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

/* Формат прогресса: Заказано / Сделано / Осталось */
.line-progress-stats {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-size: 13.5px;
    font-weight: 500;
    white-space: nowrap;
    width: 100%;
}

.line-progress-stats .prog-val {
    display: inline-flex;
    align-items: center;
}

.line-progress-stats .prog-ord {
    color: #334155;
    font-weight: 600;
}

.line-progress-stats .prog-prod {
    color: #0284c7;
    font-weight: 600;
}

.line-progress-stats .prog-rem {
    color: #0f172a;
    font-weight: 700;
}

.line-progress-stats .prog-rem b {
    font-size: 14.5px;
    color: #ea580c;
}

.line-row.complete .line-progress-stats .prog-rem b {
    color: #16a34a;
}

.line-progress-stats .prog-slash {
    color: #cbd5e1;
    font-weight: 400;
    user-select: none;
}

.line-state {
    color: var(--gray);
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.line-state i {
    color: var(--gray-dark);
}

.line-state.complete {
    color: #16a34a;
    font-weight: 600;
}

.line-state.complete i {
    color: #16a34a;
}

.line-col-input input {
    width: 100%;
    max-width: 80px;
    padding: 7px 6px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.9);
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--gray-dark);
    text-align: center;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.line-col-input input:focus {
    border-color: var(--gray-dark);
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.06);
    background: #fff;
}

/* Строка деталей в таблице заказов (администратор) */
.order-detail-row > td {
    padding: 0 16px 16px;
    background: rgba(0, 0, 0, 0.015);
}

.order-detail-content {
    padding: 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.55);
}

.order-detail-row .order-modal-comment {
    margin-bottom: 12px;
}

/* --------------------------------------------------------------------------
   Настройки
   -------------------------------------------------------------------------- */
.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}

.stage-settings-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.stage-settings-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.5);
}

.stage-rename-form {
    flex: 1;
}

.stage-name-input,
.type-name-input {
    width: 100%;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 15px;
    font-weight: 500;
    color: var(--gray-dark);
    padding: 6px 8px;
    border-radius: 10px;
    outline: none;
    transition: background 0.2s;
}

.stage-name-input:focus,
.type-name-input:focus {
    background: rgba(0, 0, 0, 0.04);
}

.stage-row-actions {
    display: flex;
    gap: 4px;
}

.inline-add {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.inline-add .input-wrap {
    flex: 1;
}

.type-card {
    padding: 16px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.5);
    margin-bottom: 12px;
}

.type-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.type-header .type-name-input {
    font-weight: 700;
    font-size: 16px;
}

.route-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 8px 0 12px;
}

.route-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.route-grip {
    color: var(--gray);
    cursor: grab;
    font-size: 13px;
}

.route-name {
    flex: 1;
    font-weight: 500;
    font-size: 14px;
}

.route-empty {
    color: var(--gray);
    font-size: 13px;
    padding: 8px 12px;
    list-style: none;
}

.route-add {
    display: flex;
    gap: 8px;
}

.route-add select {
    flex: 1;
    padding: 9px 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.7);
    font-family: inherit;
    font-size: 14px;
    outline: none;
}

.time-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
}

.time-inputs select {
    padding: 11px 14px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.7);
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-dark);
    outline: none;
}

.time-sep {
    font-size: 20px;
    font-weight: 700;
    color: var(--gray);
}

/* --------------------------------------------------------------------------
   Toast-уведомления
   -------------------------------------------------------------------------- */
#toast-container {
    position: fixed;
    bottom: 86px;
    right: 24px;
    z-index: 500;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--shadow-hover);
    font-size: 14px;
    font-weight: 500;
    animation: fadeInUp 0.3s ease both;
}

.toast i {
    font-size: 16px;
    color: var(--gray-dark);
}

/* Динамическое уведомление о новом заказе FBS */
.toast-fbs {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 2px solid #8b5cf6;
    box-shadow: 0 16px 40px rgba(139, 92, 246, 0.25), 0 2px 8px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
    animation: fbsToastIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
    max-width: 440px;
    pointer-events: auto;
}

@keyframes fbsToastIn {
    0% {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.toast-fbs-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.35);
    animation: fbsIconBounce 1s infinite alternate ease-in-out;
}

@keyframes fbsIconBounce {
    0% { transform: scale(1); }
    100% { transform: scale(1.1); }
}

.toast-fbs-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.toast-fbs-title {
    font-weight: 700;
    font-size: 13.5px;
    color: #5b21b6;
    letter-spacing: -0.01em;
}

.toast-fbs-subtitle {
    font-size: 12px;
    color: var(--gray-2);
}

.toast-fbs-btn {
    background: #7c3aed !important;
    border-color: #6d28d9 !important;
    color: #fff !important;
    font-size: 12px !important;
    padding: 6px 12px !important;
    border-radius: 10px !important;
    white-space: nowrap;
    cursor: pointer;
    text-decoration: none;
    font-weight: 600;
}

.toast-fbs-btn:hover {
    background: #6d28d9 !important;
}

.toast-fbs-close {
    border: none;
    background: transparent;
    color: var(--gray);
    cursor: pointer;
    font-size: 14px;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: color 0.15s;
}

.toast-fbs-close:hover {
    color: var(--gray-dark);
}

/* Пульсирующая подсветка карточки FBS */
@keyframes fbsCardPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.6);
    }
    70% {
        box-shadow: 0 0 0 16px rgba(139, 92, 246, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(139, 92, 246, 0);
    }
}

.order-card-fbs-new {
    box-shadow: 0 2px 10px rgba(124, 58, 237, 0.12);
    border-left: 5px solid #7c3aed !important;
}

/* Кнопка звука в шапке этапа */
.btn-sound-stage {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.7);
    color: var(--gray-dark);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-sound-stage.muted {
    color: var(--gray);
    opacity: 0.6;
}

.btn-sound-stage:hover {
    background: #fff;
    border-color: var(--gray-dark);
}


/* --------------------------------------------------------------------------
   Адаптивность (ширина 769px - 1340px)
   -------------------------------------------------------------------------- */
@media (max-width: 1340px) and (min-width: 769px) {
    .navbar {
        padding: 8px 14px;
        gap: 8px;
    }

    .brand-wordmark {
        font-size: 13px;
    }

    .navbar-links {
        gap: 2px;
    }

    .nav-link {
        font-size: 13px;
        padding: 6px 9px;
        gap: 5px;
    }

    .btn-open-article-search .nav-search-text {
        display: none;
    }

    .navbar-user {
        gap: 6px;
    }

    .user-pill {
        font-size: 13px;
    }
}

@media (max-width: 1160px) and (min-width: 769px) {
    .brand-wordmark {
        display: none;
    }
}

/* --------------------------------------------------------------------------
   Адаптивность (ширина < 768px)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }

    .navbar {
        flex-wrap: wrap;
        padding: 10px 16px;
        top: 8px;
        margin: 8px 8px 0;
        width: calc(100% - 16px);
    }

    .navbar-links {
        order: 3;
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .nav-link {
        font-size: 13px;
        padding: 7px 10px;
    }

    .page-title {
        font-size: 26px;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .dashboard-columns,
    .settings-grid {
        grid-template-columns: 1fr;
    }

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

    .filters {
        flex-direction: column;
        align-items: stretch;
    }

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

    .flash-container {
        top: auto;
        bottom: 24px;
        right: 16px;
        left: 16px;
    }

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

    .order-item-row {
        grid-template-columns: 1fr auto;
        gap: 6px;
    }

    .order-item-row .item-remove {
        grid-column: 2 / 3;
        grid-row: 1 / 2;
        align-self: start;
    }

    .login-card {
        padding: 28px 22px;
    }

    /* Карточка заказа: прогресс переносится на новую строку */
    .order-card-head {
        gap: 10px;
    }

    .order-card-progress {
        min-width: 100%;
        order: 5;
    }

    /* Строки заказа на мобильных — стек в одну колонку */
    .line-row {
        grid-template-columns: 1fr auto;
        gap: 6px 10px;
        align-items: center;
        padding: 12px;
    }

    .line-row.line-view {
        grid-template-columns: 1fr auto;
    }

    .line-article {
        grid-column: 1 / 2;
    }

    .line-name {
        grid-column: 1 / 2;
        padding-bottom: 2px;
    }

    .line-fabric,
    .line-color {
        grid-column: 1 / 2;
    }

    .line-type {
        grid-column: 1 / 2;
    }

    .line-priority,
    .line-priority-select {
        grid-column: 1 / 2;
    }

    .line-stage {
        grid-column: 1 / 2;
    }

    .line-progress {
        grid-column: 2 / 3;
        grid-row: 1 / 3;
    }

    .line-row.line-view .line-state {
        grid-column: 1 / 3;
    }

    .line-input {
        grid-column: 1 / 2;
    }

    .line-confirm {
        grid-column: 2 / 3;
        grid-row: 4 / 5;
    }

    .line-row.complete .line-state {
        grid-column: 1 / 3;
    }

    .issued-row {
        grid-template-columns: 1fr auto;
        gap: 4px 10px;
    }

    .issued-article,
    .issued-name,
    .issued-type {
        grid-column: 1 / 2;
    }

    .issued-qty {
        grid-column: 2 / 3;
        grid-row: 1 / 4;
        align-self: center;
    }

    .issued-order,
    .issued-week {
        grid-column: 1 / 2;
    }
}

/* --------------------------------------------------------------------------
   Переключатель FBO / FBS и стили FBS заказов
   -------------------------------------------------------------------------- */
.form-group-fulfillment {
    margin-bottom: 16px;
}

.segmented-fulfillment {
    display: inline-flex;
    background: rgba(0, 0, 0, 0.06);
    padding: 4px;
    border-radius: 14px;
    gap: 4px;
    width: 100%;
    box-sizing: border-box;
}

.segmented-fulfillment .segment-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--gray);
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
    border: none;
    background: transparent;
    text-align: center;
}

.segmented-fulfillment .segment-btn input.hidden-radio {
    display: none;
}

.segmented-fulfillment .segment-btn.active {
    background: #ffffff;
    color: var(--gray-dark);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.segmented-fulfillment .segment-btn[data-type="fbs"].active {
    color: #7c3aed;
}

.segmented-fulfillment .segment-btn[data-type="fbs"].active i {
    color: #7c3aed;
}

.segmented-fulfillment .segment-btn:hover:not(.active) {
    color: var(--gray-dark);
    background: rgba(255, 255, 255, 0.4);
}

/* Бейдж FBS */
.badge-fbs {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: linear-gradient(135deg, #ede9fe 0%, #f3e8ff 100%);
    color: #6d28d9;
    font-size: 11.5px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 999px;
    border: 1px solid #ddd6fe;
    letter-spacing: 0.02em;
    text-transform: none;
}

.badge-fbs i {
    font-size: 11px;
    color: #7c3aed;
}

/* Бейдж FBO */
.badge-fbo {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: linear-gradient(135deg, #e0f2fe 0%, #f0f9ff 100%);
    color: #0369a1;
    font-size: 11.5px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 999px;
    border: 1px solid #bae6fd;
    letter-spacing: 0.02em;
    text-transform: none;
}

.badge-fbo i {
    font-size: 11px;
    color: #0284c7;
}

.badge-fbs-mini {
    display: inline-block;
    background: #ede9fe;
    color: #6d28d9;
    font-size: 11.5px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 6px;
    border: 1px solid #ddd6fe;
    white-space: nowrap;
}

.badge-fbo-mini {
    display: inline-block;
    background: #e0f2fe;
    color: #0369a1;
    font-size: 11.5px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 6px;
    border: 1px solid #bae6fd;
    white-space: nowrap;
}

.badge-tag-transfer {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #fef3c7;
    color: #92400e;
    font-size: 10.5px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 5px;
    border: 1px solid #fde68a;
    white-space: nowrap;
    margin-left: 0;
    line-height: 1.2;
}

.badge-tag-transfer i {
    font-size: 10px;
    color: #b45309;
}

body.dark-theme .badge-tag-transfer {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.4);
}

body.dark-theme .badge-tag-transfer i {
    color: #fbbf24;
}

/* Специфичное оформление карточки заказа FBS */
.order-card.order-card-fbs {
    border-left: 4px solid #8b5cf6;
}

/* Специфичное оформление секции FBS на странице заказов */
.week-section.fbs-section .week-header {
    border-left: 4px solid #8b5cf6;
    background: linear-gradient(90deg, rgba(245, 243, 255, 0.8) 0%, rgba(255, 255, 255, 0.7) 100%);
}

.week-section.fbs-section .week-title {
    color: #5b21b6;
}

/* Кнопка перехода в Мобильный терминал в шапке ПК */
.btn-nav-mobile {
    color: #0284c7 !important;
    border-color: rgba(2, 132, 199, 0.3) !important;
    background: rgba(2, 132, 199, 0.08) !important;
    font-weight: 600;
}
.btn-nav-mobile:hover {
    background: rgba(2, 132, 199, 0.16) !important;
    color: #0369a1 !important;
}

/* Настройки: переключатель мобильного доступа для этапов */
.stage-mobile-wrap {
    margin-left: auto;
    margin-right: 8px;
}
.btn-stage-mobile-toggle {
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: var(--gray-medium);
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-stage-mobile-toggle:hover {
    background: rgba(0, 0, 0, 0.08);
    color: var(--gray-dark);
}
.btn-stage-mobile-toggle.active {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.35);
    color: #059669;
}
.inline-mobile-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--gray-medium);
    cursor: pointer;
    user-select: none;
    margin-left: 8px;
}

/* ==========================================================================
   Групповой (пакетный) выпуск артикулов
   ========================================================================== */
.batch-modal {
    max-width: 780px;
}

.batch-quick-bar {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    margin-top: 14px;
    margin-bottom: 16px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.batch-input-field {
    display: flex;
    flex-direction: column;
}

.batch-input-field.flex-grow {
    flex: 1;
}

.batch-qty-col {
    width: 120px;
}

.batch-action-col {
    display: flex;
    align-items: flex-end;
}

.batch-table-wrap {
    max-height: 340px;
    overflow-y: auto;
    border-radius: 14px;
    border: 1px solid rgba(0, 0, 0, 0.07);
    background: rgba(255, 255, 255, 0.5);
    margin-bottom: 16px;
}

.batch-table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
}

.batch-table th {
    position: sticky;
    top: 0;
    background: rgba(245, 245, 247, 0.95);
    backdrop-filter: blur(10px);
    z-index: 2;
    padding: 10px 14px;
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-medium);
}

.batch-table td {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    font-size: 13px;
    vertical-align: middle;
}

.batch-row-qty-input {
    width: 80px;
    padding: 6px 10px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    background: white;
}

.batch-empty-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 36px 16px;
    color: var(--gray);
    font-size: 13px;
    text-align: center;
}

.batch-empty-box i {
    font-size: 28px;
    opacity: 0.5;
}

.batch-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-top: 14px;
    border-top: 1px solid rgba(0, 0, 0, 0.07);
}

.batch-summary {
    font-size: 14px;
    color: var(--gray-dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

.batch-sep {
    color: var(--gray-light);
}

/* Панель пакетного проведения внутри заказа (плавающая в правом нижнем углу) */
.order-batch-bar {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999 !important;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 18px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-left: 4px solid var(--black);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.18), 0 2px 10px rgba(0, 0, 0, 0.06);
    border-radius: 18px;
    animation: batchBarSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.order-batch-bar.hidden {
    display: none !important;
}

@keyframes batchBarSlideUp {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.96);
    }
    100% {
        opacity: 1;
        transform: none;
    }
}

.order-batch-info {
    font-size: 13.5px;
    color: var(--gray-dark);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.order-batch-info i {
    color: #2563eb;
    font-size: 15px;
}

.order-batch-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-order-batch-submit {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
    font-weight: 600;
    padding: 9px 16px;
    border-radius: 12px;
    white-space: nowrap;
}

.btn-order-batch-cancel {
    padding: 6px 10px;
    border-radius: 10px;
}

@media (max-width: 768px) {
    .order-batch-bar {
        bottom: 16px;
        left: 16px;
        right: 16px;
        justify-content: space-between;
        padding: 10px 14px;
        border-radius: 16px;
    }
    .btn-order-batch-submit {
        flex: 1;
        text-align: center;
        justify-content: center;
    }
}

/* Панель массового изменения приоритетов строк заказа */
.order-prio-batch-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding: 9px 14px;
    margin-bottom: 12px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 12px;
    animation: fadeIn 0.2s ease;
}

.order-prio-batch-bar .prio-batch-info {
    font-size: 13.5px;
    color: #166534;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.order-prio-batch-bar .prio-batch-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.order-prio-batch-bar .prio-batch-label {
    font-size: 13px;
    font-weight: 500;
    color: #374151;
}

.order-prio-batch-bar .prio-batch-select {
    padding: 5px 10px;
    font-size: 13px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    background: #fff;
    cursor: pointer;
    font-weight: 500;
    outline: none;
}

.order-prio-batch-bar .prio-batch-select:focus {
    border-color: var(--primary);
}

.order-prio-batch-bar .prio-batch-quick-btns {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-prio-quick {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 9px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 7px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: #fff;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-prio-quick:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

.btn-prio-quick.prio-btn-max {
    color: #b91c1c;
    border-color: #fecaca;
    background: #fef2f2;
}
.btn-prio-quick.prio-btn-max:hover {
    background: #fee2e2;
}

.btn-prio-quick.prio-btn-mid {
    color: #b45309;
    border-color: #fde68a;
    background: #fffbeb;
}
.btn-prio-quick.prio-btn-mid:hover {
    background: #fef3c7;
}

.btn-prio-quick.prio-btn-norm {
    color: #1d4ed8;
    border-color: #bfdbfe;
    background: #eff6ff;
}
.btn-prio-quick.prio-btn-norm:hover {
    background: #dbeafe;
}

.prio-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}
.prio-dot.max { background: #ef4444; }
.prio-dot.medium { background: #f59e0b; }
.prio-dot.normal { background: #3b82f6; }

/* --------------------------------------------------------------------------
   Поиск по артикулу (для администраторов и старших смены)
   -------------------------------------------------------------------------- */
.btn-open-article-search {
    background: transparent;
    border: none;
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
    color: var(--gray-dark);
}

.btn-open-article-search:hover {
    background: rgba(0, 0, 0, 0.05);
}

.article-modal {
    max-width: 1040px;
}

.article-search-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.search-clear-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--gray);
    cursor: pointer;
    padding: 4px;
    font-size: 13px;
    border-radius: 50%;
}

.search-clear-btn:hover {
    color: var(--gray-dark);
}

.article-search-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-2);
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.article-search-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--gray-dark);
    cursor: pointer;
}

.article-modal-results {
    max-height: 62vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-right: 4px;
}

.article-search-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 16px;
    color: var(--gray);
    text-align: center;
    gap: 12px;
}

.article-search-placeholder i {
    font-size: 40px;
    opacity: 0.35;
}

.article-search-placeholder p {
    font-size: 14px;
    max-width: 340px;
    margin: 0;
}

/* Карточка найденного артикула в модальном окне */
.article-search-card {
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 16px 20px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.article-search-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
    border-color: var(--border-strong);
}

.article-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.article-card-title-group {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
}

.line-article-badge {
    display: inline-block;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-weight: 700;
    font-size: 14px;
    color: var(--gray-dark);
    background: rgba(0, 0, 0, 0.06);
    padding: 2px 8px;
    border-radius: 8px;
    letter-spacing: 0.02em;
}

.article-card-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-dark);
}

.article-card-badges {
    display: flex;
    align-items: center;
    gap: 6px;
}

.article-card-stats {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 13px;
    color: var(--gray-2);
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 12px;
    flex-wrap: wrap;
}

.article-card-stats strong {
    color: var(--gray-dark);
}

/* Маршрут этапов */
.article-stages-flow {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    padding-top: 4px;
}

.stage-flow-step {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 12px;
    font-size: 12px;
    background: rgba(0, 0, 0, 0.04);
    color: var(--gray);
    border: 1px solid transparent;
}

.stage-flow-step.active {
    background: #ecfdf5;
    color: #065f46;
    border-color: #a7f3d0;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.12);
}

.stage-flow-step.completed {
    background: rgba(0, 0, 0, 0.02);
    color: var(--gray-2);
}

.stage-flow-arrow {
    color: var(--gray);
    font-size: 10px;
    opacity: 0.4;
}

.stage-active-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 8px;
    font-size: 12px;
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
    white-space: nowrap;
}

.stage-chip-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10b981;
    display: inline-block;
}

.stage-pills-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.article-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px solid rgba(0, 0, 0, 0.04);
}

.article-card-summary {
    font-size: 13px;
    color: var(--gray-2);
}

.article-card-summary strong {
    color: var(--gray-dark);
}

/* Панель массовых действий со справочником */
.catalog-batch-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 10px 16px;
    margin-bottom: 12px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    animation: fadeIn 0.2s ease;
}

.catalog-batch-bar .batch-bar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.catalog-batch-bar .batch-bar-count {
    font-size: 13.5px;
    color: #1e40af;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.catalog-batch-bar .batch-bar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.catalog-batch-bar .batch-quick-type-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}

.catalog-batch-bar .batch-select {
    padding: 6px 10px;
    font-size: 13px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: #fff;
    cursor: pointer;
    outline: none;
    max-width: 240px;
}

.catalog-batch-bar .batch-select:focus {
    border-color: var(--primary);
}

.data-table tr.selected-row {
    background: rgba(59, 130, 246, 0.08) !important;
}

.batch-preview-box {
    max-height: 140px;
    overflow-y: auto;
}

.batch-preview-item {
    padding: 4px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.batch-preview-item:last-child {
    border-bottom: none;
}

/* --------------------------------------------------------------------------
   Модальное окно рулона печати и печатная форма бланка
   -------------------------------------------------------------------------- */
.roll-items-table th,
.roll-items-table td {
    padding: 8px 10px;
    vertical-align: middle;
}

.roll-items-table tbody tr:hover {
    background: rgba(59, 130, 246, 0.04);
}

.roll-row-order-btns {
    display: inline-flex;
    gap: 3px;
    align-items: center;
    justify-content: center;
}

.btn-row-move {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #475569;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.1s ease;
}

.btn-row-move:hover {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #94a3b8;
}

.btn-row-move:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.roll-table-input {
    width: 100%;
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #fff;
    font-size: 13px;
    outline: none;
    box-sizing: border-box;
}

.roll-table-input:focus {
    border-color: var(--primary);
}

.roll-table-select {
    width: 100%;
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #fff;
    font-size: 12.5px;
    outline: none;
    cursor: pointer;
}

/* Стили печатного бланка рулона (А4 альбомная) */
.print-sheet-wrapper {
    font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
    color: #000;
    background: #fff;
    width: 100%;
    box-sizing: border-box;
}

.print-sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    gap: 16px;
}

.print-roll-box {
    border: 1px solid #000;
    padding: 6px 14px;
    font-size: 13pt;
    font-weight: bold;
    min-width: 220px;
    height: 38px;
    display: flex;
    align-items: center;
}

.print-sheet-qr-box {
    display: flex;
    align-items: center;
    gap: 10px;
}

.print-qr-canvas {
    width: 68px;
    height: 68px;
    display: block;
}

.print-qr-caption {
    font-size: 8pt;
    color: #333;
    line-height: 1.25;
    max-width: 130px;
}

.print-meta-text {
    font-size: 11pt;
    text-align: right;
    font-weight: 500;
    line-height: 1.35;
}

.print-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #000;
    font-size: 9.5pt;
    line-height: 1.2;
}

.print-table th,
.print-table td {
    border: 1px solid #000;
    padding: 4px 6px;
    box-sizing: border-box;
}

.print-table .col-plotter { text-align: center; width: 9%; }
.print-table .col-week { text-align: center; width: 10%; }
.print-table .col-cut { text-align: center; width: 8%; font-weight: bold; }
.print-table .col-material { text-align: center; width: 9%; }
.print-table .col-empty { width: 4%; }
.print-table .col-article {
    width: 20%;
    background-color: #d1d5db !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    font-family: Consolas, monospace;
    font-weight: 600;
}
.print-table .col-name { text-align: left; }
.print-table .col-qty { text-align: right; width: 5%; font-weight: bold; }
.print-table .col-meters-unit { text-align: right; width: 6%; }
.print-table .col-meters-total { text-align: right; width: 7%; font-weight: bold; }

.print-cut-line {
    text-align: center;
    color: #666;
    font-size: 7.5pt;
    letter-spacing: 2px;
    margin: 6px 0 3px 0;
    border-top: 1px dashed #777;
    padding-top: 2px;
    line-height: 1;
}

.print-copy-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 8.5pt;
    margin-bottom: 2px;
}

.wh-row-selected {
    background-color: rgba(37, 99, 235, 0.08) !important;
}

#stage-shift-counter {
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}

#stage-shift-counter:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Правила печати через браузер */
@media print {
    @page {
        size: landscape;
        margin: 6mm 8mm;
    }

    body.is-printing-roll {
        background: #fff !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
    }

    body.is-printing-roll > *:not(#roll-print-sheet) {
        display: none !important;
    }

    body.is-printing-roll #roll-print-sheet {
        display: block !important;
        position: static !important;
        width: 100% !important;
        background: #fff !important;
        color: #000 !important;
    }
}

/* Стили для выбора плоттера и очереди плоттеров на этапе печати */
.plotter-select-pill {
    cursor: pointer;
    user-select: none;
    display: block;
}

.plotter-select-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 2px solid var(--border);
    background: #fff;
    transition: all 0.2s ease;
    position: relative;
}

.plotter-select-box .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.plotter-select-box .check-icon {
    font-size: 1rem;
    color: var(--primary);
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s ease;
}

.plotter-select-pill input[type="radio"]:checked + .plotter-select-box {
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.05);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.plotter-select-pill input[type="radio"]:checked + .plotter-select-box .check-icon {
    opacity: 1;
    transform: scale(1);
}

.plotter-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.plotter-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.07) !important;
}

.plotter-queue-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    font-size: 0.85rem;
    transition: background 0.15s;
}

.plotter-queue-item:hover {
    background: #f1f5f9;
}

.plotter-queue-item .item-info {
    flex: 1;
    min-width: 0;
}

.plotter-queue-item .item-title {
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 6px;
}

.plotter-queue-item .item-sub {
    font-size: 0.75rem;
    color: var(--gray);
    margin-top: 2px;
}

.plotter-queue-item .item-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin-left: 8px;
}

.plotter-queue-item .btn-remove-plotter-item {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    opacity: 0.7;
    transition: opacity 0.15s, background 0.15s;
}

.plotter-queue-item .btn-remove-plotter-item:hover {
    opacity: 1;
    background: rgba(239, 68, 68, 0.1);
}

/* ==========================================================================
   Кнопка и модальное окно «Сообщить о проблеме»
   ========================================================================== */
.btn-report-problem-float {
    position: fixed;
    bottom: 22px;
    left: 22px;
    z-index: 1040;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(234, 88, 12, 0.3);
    color: #c2410c;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(234, 88, 12, 0.15);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-report-problem-float:hover {
    transform: translateY(-2px) scale(1.02);
    background: #ffffff;
    color: #ea580c;
    border-color: rgba(234, 88, 12, 0.55);
    box-shadow: 0 8px 24px rgba(234, 88, 12, 0.22);
}

.btn-report-problem-float:active {
    transform: translateY(0) scale(0.98);
}

.btn-report-problem-float i {
    font-size: 15px;
    color: #ea580c;
}

.report-problem-modal-content {
    max-width: 480px;
    width: 100%;
}

.report-sender-card {
    padding: 10px 14px;
    border-radius: 12px;
    margin-bottom: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid var(--border);
}

.urgency-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 6px;
}

.urgency-option {
    cursor: pointer;
    position: relative;
    margin: 0;
}

.urgency-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.urgency-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 10px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-dark);
    transition: all 0.18s ease;
    text-align: center;
}

.urgency-badge:hover {
    background: #fff;
    border-color: rgba(0, 0, 0, 0.15);
}

.urgency-low input[type="radio"]:checked + .urgency-badge {
    background: rgba(34, 197, 94, 0.15);
    border-color: #22c55e;
    color: #15803d;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
}

.urgency-medium input[type="radio"]:checked + .urgency-badge {
    background: rgba(234, 179, 8, 0.18);
    border-color: #eab308;
    color: #a16207;
    box-shadow: 0 0 0 2px rgba(234, 179, 8, 0.2);
}

.urgency-critical input[type="radio"]:checked + .urgency-badge {
    background: rgba(239, 68, 68, 0.15);
    border-color: #ef4444;
    color: #b91c1c;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

@media (max-width: 640px) {
    .btn-report-problem-float {
        bottom: 14px;
        left: 14px;
        padding: 8px 12px;
        font-size: 12px;
    }
    .urgency-badge {
        padding: 8px 4px;
        font-size: 11px;
    }
}


