        :root {
            --page-bg: #f4f6fb;
            --panel-bg: #ffffff;
            --header-bg: #eef2fc;
            --text: #172033;
            --muted: #697386;
            --border: #dbe1ec;

            --accent: #5874b8;
            --accent-hover: #4562a7;
            --accent-soft: #edf2ff;

            --success-bg: #e3f4ec;
            --success-text: #287653;

            --warning-bg: #fff3d8;
            --warning-text: #966300;

            --danger-bg: #fde9ec;
            --danger-text: #ad3d4c;

            --shadow: 0 8px 24px rgba(28, 43, 70, 0.06);
        }

        * {
            box-sizing: border-box;
        }

        body {
            min-width: 320px;
            min-height: 100vh;
            margin: 0;
            background: var(--page-bg);
            color: var(--text);
            font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
        }

        button,
        input,
        select {
            font: inherit;
        }

        .app-shell {
            padding: 28px;
        }

        .app-panel {
            width: min(1400px, 100%);
            margin: 0 auto;
            overflow: hidden;
            background: var(--panel-bg);
            border: 1px solid var(--border);
            border-radius: 14px;
            box-shadow: var(--shadow);
        }

        .page-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 20px;
            padding: 22px 28px;
            border-bottom: 1px solid var(--border);
        }

        .page-header h1 {
            margin: 0;
            font-size: 22px;
            font-weight: 700;
            letter-spacing: -0.02em;
        }

        .page-header p {
            margin: 5px 0 0;
            color: var(--muted);
            font-size: 14px;
        }

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

        .btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            min-height: 34px;
            padding: 7px 12px;
            border: 1px solid transparent;
            border-radius: 7px;
            cursor: pointer;
            font-size: 13px;
            font-weight: 600;
            transition: 0.15s ease;
        }

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

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

        .btn-secondary {
            background: #fff;
            border-color: var(--border);
            color: #4f5e78;
        }

        .btn-secondary:hover {
            background: #f7f9fd;
            border-color: #bfc9dc;
        }

        .toolbar {
            display: flex;
            align-items: end;
            gap: 12px;
            padding: 18px 28px;
            background: #fbfcff;
            border-bottom: 1px solid var(--border);
        }

        .filter-field {
            display: flex;
            flex-direction: column;
            gap: 5px;
            min-width: 150px;
        }

        .filter-field span,
        .modal-field span {
            color: var(--muted);
            font-size: 12px;
            font-weight: 600;
        }

        .filter-field input,
.filter-field select,
.modal-field input,
.modal-field select {
    width: 100%;
    min-height: 34px;
    padding: 6px 9px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: #fff;
    color: var(--text);
    font-size: 13px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.filter-field input:focus,
.filter-field select:focus,
.modal-field input:focus,
.modal-field select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(88, 116, 184, 0.12);
}
.modal-field input[type="search"],
.filter-field input[type="search"] {
    appearance: none;
    -webkit-appearance: none;
}

        .filter-search {
            flex: 1;
            min-width: 240px;
        }

        .message {
            display: none;
            margin: 16px 28px 0;
            padding: 10px 12px;
            border-radius: 8px;
            font-size: 13px;
        }

        .message.show {
            display: block;
        }

        .message.success {
            background: var(--success-bg);
            color: var(--success-text);
        }

        .message.error {
            background: var(--danger-bg);
            color: var(--danger-text);
        }

        .stats {
            display: grid;
            grid-template-columns: repeat(3, minmax(0, 190px));
            gap: 12px;
            padding: 20px 28px;
        }

        .stat-card {
            padding: 13px 16px;
            background: #f8faff;
            border: 1px solid var(--border);
            border-radius: 10px;
        }

        .stat-number {
            color: var(--accent);
            font-size: 22px;
            font-weight: 700;
            line-height: 1;
        }

        .stat-label {
            margin-top: 6px;
            color: var(--muted);
            font-size: 12px;
        }

        .schedule-panel {
            margin: 28px 28px 28px;
            overflow: hidden;
            border: 1px solid var(--border);
            border-radius: 10px;
        }

        .table-caption {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 16px;
            padding: 14px 16px;
            border-bottom: 1px solid var(--border);
        }

        .table-caption h2 {
            margin: 0;
            font-size: 15px;
        }

        .table-caption p,
        .drag-hint {
            margin: 3px 0 0;
            color: var(--muted);
            font-size: 12px;
        }

        .drag-hint {
            margin: 0;
        }

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

        .schedule-table {
            width: 100%;
            min-width: 900px;
            border-collapse: collapse;
        }

        .schedule-table th {
            padding: 11px 12px;
            background: var(--header-bg);
            border-bottom: 1px solid var(--border);
            color: #5f6c85;
            font-size: 12px;
            font-weight: 650;
            text-align: left;
            white-space: nowrap;
        }

        .schedule-table td {
            padding: 10px 12px;
            border-bottom: 1px solid var(--border);
            color: var(--text);
            font-size: 13px;
            vertical-align: middle;
        }

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

        .schedule-table tbody tr:hover td {
            background: #fafcff;
        }

        .schedule-table tbody tr.drag-over td {
            background: var(--accent-soft);
        }

        .schedule-table tbody tr.dragging {
            opacity: 0.45;
        }

        .drag-cell {
            width: 42px;
        }

        .drag-handle {
            width: 28px;
            height: 28px;
            padding: 0;
            border: 0;
            border-radius: 6px;
            background: transparent;
            color: #9aa5b8;
            cursor: grab;
            font-size: 17px;
            line-height: 1;
        }

        .drag-handle:hover {
            background: var(--accent-soft);
            color: var(--accent);
        }

        .drag-handle:active {
            cursor: grabbing;
        }

        .task-type {
            display: inline-flex;
            align-items: center;
            min-height: 24px;
            padding: 3px 9px;
            border-radius: 999px;
            font-size: 12px;
            font-weight: 650;
            white-space: nowrap;
        }

        .task-type.inv {
            background: var(--danger-bg);
            color: var(--danger-text);
        }

        .task-type.price {
            background: var(--warning-bg);
            color: var(--warning-text);
        }

        .employee-cell {
            display: flex;
            align-items: center;
            gap: 7px;
        }

        .employee-dot {
            width: 7px;
            height: 7px;
            border-radius: 50%;
            background: #48a977;
        }

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

        .row-action {
            min-height: 28px;
            padding: 5px 8px;
            border: 1px solid var(--border);
            border-radius: 6px;
            background: #fff;
            color: #52627d;
            cursor: pointer;
            font-size: 12px;
        }

        .row-action:hover {
            background: var(--accent-soft);
            border-color: #b8c6e7;
            color: var(--accent);
        }

        .row-action.delete:hover {
            background: var(--danger-bg);
            border-color: #efbdc4;
            color: var(--danger-text);
        }

        .empty-state {
            padding: 32px 20px;
            color: var(--muted);
            font-size: 13px;
            text-align: center;
        }

        .modal {
            display: none;
            position: fixed;
            z-index: 1000;
            inset: 0;
            align-items: center;
            justify-content: center;
            padding: 20px;
            background: rgba(23, 32, 51, 0.35);
        }

        .modal.show {
            display: flex;
        }

        .modal-dialog {
            width: min(480px, 100%);
            overflow: hidden;
            background: #fff;
            border: 1px solid var(--border);
            border-radius: 12px;
            box-shadow: 0 20px 50px rgba(23, 32, 51, 0.2);
        }

        .modal-header,
        .modal-footer {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 16px;
            padding: 16px 20px;
        }

        .modal-header {
            border-bottom: 1px solid var(--border);
        }

        .modal-header h2 {
            margin: 0;
            font-size: 16px;
        }

        .modal-header p {
            margin: 4px 0 0;
            color: var(--muted);
            font-size: 12px;
        }

        .modal-body {
            padding: 20px;
        }

        .modal-footer {
            justify-content: flex-end;
            border-top: 1px solid var(--border);
        }

        .icon-btn {
            width: 30px;
            height: 30px;
            border: 0;
            border-radius: 6px;
            background: transparent;
            color: var(--muted);
            cursor: pointer;
            font-size: 22px;
        }

        .icon-btn:hover {
            background: #f2f4f8;
            color: var(--text);
        }

        .shift-info {
            margin-bottom: 16px;
            padding: 10px 12px;
            background: var(--success-bg);
            border-radius: 7px;
            color: var(--success-text);
            font-size: 13px;
        }

        .no-shift-warning {
            margin-bottom: 16px;
            padding: 10px 12px;
            background: var(--warning-bg);
            border-radius: 7px;
            color: var(--warning-text);
            font-size: 13px;
        }

        .modal-field {
            display: flex;
            flex-direction: column;
            gap: 6px;
        }

        @media (max-width: 800px) {
            .app-shell {
                padding: 12px;
            }

            .page-header,
            .toolbar {
                align-items: stretch;
                flex-direction: column;
                padding: 16px;
            }

            .header-actions,
            .header-actions .btn,
            .toolbar .btn {
                width: 100%;
            }

            .filter-search {
                min-width: 0;
            }

            .stats {
                grid-template-columns: 1fr;
                padding: 16px;
            }

            .schedule-panel {
                margin: 0 16px 16px;
            }

            .drag-hint {
                display: none;
            }
        }

        .header-main {
            display: flex;
            align-items: center;
            gap: 28px;
        }

        .header-stats {
            display: flex;
            align-items: center;
            gap: 18px;
            padding-left: 22px;
            border-left: 1px solid var(--border);
        }

        .header-stat {
            display: flex;
            flex-direction: column;
            gap: 2px;
            white-space: nowrap;
        }

        .header-stat strong {
            color: var(--accent);
            font-size: 18px;
            font-weight: 700;
            line-height: 1;
        }

        .header-stat span {
            color: var(--muted);
            font-size: 11px;
            font-weight: 500;
        }

        @media (max-width: 1000px) {
            .header-main {
                align-items: flex-start;
                flex-direction: column;
                gap: 14px;
            }

            .header-stats {
                width: 100%;
                padding-top: 12px;
                padding-left: 0;
                border-top: 1px solid var(--border);
                border-left: 0;
            }
        }

        @media (max-width: 560px) {
            .header-stats {
                justify-content: space-between;
                gap: 8px;
            }

            .header-stat span {
                font-size: 10px;
            }
        }

        .csv-help-dialog {
            width: min(620px, 100%);
        }

        .csv-help-text,
        .csv-help-note {
            margin: 0;
            color: var(--muted);
            font-size: 13px;
            line-height: 1.5;
        }

        .csv-help-note {
            margin-top: 14px;
        }

        .csv-help-note code {
            padding: 2px 5px;
            background: #f1f4fa;
            border-radius: 4px;
            color: var(--text);
        }

        .csv-example {
            margin: 12px 0 0;
            padding: 12px;
            overflow-x: auto;
            background: #f7f9fd;
            border: 1px solid var(--border);
            border-radius: 7px;
            color: #33415c;
            font-family: "SFMono-Regular", Consolas, monospace;
            font-size: 12px;
            line-height: 1.6;
            white-space: pre-wrap;
        }

        .task-type.other {
            background: #edf0f5;
            color: #5d687a;
        }

        .create-task-dialog {
            width: min(620px, 100%);
        }

        .wizard-progress {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 16px 20px;
            border-bottom: 1px solid var(--border);
        }

        .wizard-progress-item {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 24px;
            height: 24px;
            border-radius: 50%;
            background: #eef1f6;
            color: var(--muted);
            font-size: 12px;
            font-weight: 700;
            transition: 0.2s ease;
        }

        .wizard-progress-item.active {
            background: var(--accent);
            color: #fff;
        }

        .wizard-progress-item.done {
            background: var(--success-bg);
            color: var(--success-text);
        }

        .wizard-progress-line {
            width: 38px;
            height: 1px;
            background: var(--border);
        }

        .wizard-viewport {
            overflow: hidden;
        }

        .wizard-track {
            display: flex;
            width: 300%;
            transition: transform 0.28s ease;
        }

        .wizard-step {
            width: 33.3333%;
            flex: 0 0 33.3333%;
        }

        .wizard-step-content {
            min-height: 280px;
            padding: 20px;
        }

        .wizard-search-field {
            margin-top: 16px;
        }

        .wizard-description {
            margin: 14px 0 0;
            color: var(--muted);
            font-size: 13px;
            line-height: 1.5;
        }

        .group-list {
            display: grid;
            gap: 8px;
            max-height: 260px;
            margin-top: 14px;
            overflow-y: auto;
        }

        .group-option {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            width: 100%;
            padding: 11px 12px;
            border: 1px solid var(--border);
            border-radius: 8px;
            background: #fff;
            color: var(--text);
            cursor: pointer;
            text-align: left;
            transition: 0.15s ease;
        }

        .group-option:hover {
            background: #fafcff;
            border-color: #b8c6e7;
        }

        .group-option.selected {
            background: var(--accent-soft);
            border-color: var(--accent);
        }

        .group-option-name {
            display: block;
            font-size: 13px;
            font-weight: 650;
        }

        .group-option-check {
            color: var(--accent);
            font-size: 16px;
            font-weight: 700;
        }

        .task-summary {
            margin-top: 16px;
            padding: 12px;
            background: #f7f9fd;
            border: 1px solid var(--border);
            border-radius: 8px;
            color: #4f5e78;
            font-size: 13px;
            line-height: 1.6;
        }

        @media (max-width: 560px) {
            .wizard-step-content {
                min-height: 320px;
            }

            .wizard-progress-line {
                flex: 1;
            }
        }

        .groups-manager-dialog {
            width: min(720px, 100%);
        }

        .groups-manager-body {
            padding: 20px;
        }

        .add-group-form {
            display: grid;
            grid-template-columns: minmax(0, 1.4fr) minmax(180px, 1fr) auto;
            align-items: end;
            gap: 12px;
            padding-bottom: 18px;
            border-bottom: 1px solid var(--border);
        }

        .groups-manager-title {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin: 18px 0 10px;
            color: var(--muted);
            font-size: 12px;
            font-weight: 650;
        }

        .groups-count {
            padding: 2px 8px;
            border-radius: 999px;
            background: var(--accent-soft);
            color: var(--accent);
        }

        .groups-manager-list {
            display: grid;
            gap: 8px;
            max-height: 390px;
            overflow-y: auto;
        }

        .group-manager-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 14px;
            padding: 11px 12px;
            border: 1px solid var(--border);
            border-radius: 8px;
            background: #fff;
        }

        .group-manager-name {
            color: var(--text);
            font-size: 13px;
            font-weight: 650;
        }

        .group-delete-button {
            min-width: 32px;
            min-height: 30px;
            padding: 5px 8px;
            border: 1px solid #efbdc4;
            border-radius: 6px;
            background: #fff;
            color: var(--danger-text);
            cursor: pointer;
            font-size: 12px;
        }

        .group-delete-button:hover {
            background: var(--danger-bg);
        }

        .groups-empty {
            padding: 22px;
            color: var(--muted);
            font-size: 13px;
            text-align: center;
            border: 1px dashed var(--border);
            border-radius: 8px;
        }

        @media (max-width: 680px) {
            .add-group-form {
                grid-template-columns: 1fr;
            }

            .add-group-form .btn {
                width: 100%;
            }
        }

        .modal-message {
            display: none;
            margin-bottom: 14px;
            padding: 10px 12px;
            border-radius: 7px;
            font-size: 13px;
            line-height: 1.4;
        }

        .modal-message.show {
            display: block;
        }

        .modal-message.success {
            background: var(--success-bg);
            color: var(--success-text);
        }

        .modal-message.error {
            background: var(--danger-bg);
            color: var(--danger-text);
        }

        .group-manager-period {
            margin-top: 3px;
            color: var(--muted);
            font-size: 12px;
        }

        .periods-list {
            display: grid;
            gap: 10px;
            padding: 12px;
        }

        .period-block {
            overflow: hidden;
            border: 1px solid var(--border);
            border-radius: 9px;
            background: #fff;
        }

        .period-summary {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 16px;
            padding: 13px 14px;
            background: #f8faff;
            cursor: pointer;
            list-style: none;
            user-select: none;
        }

        .period-summary::-webkit-details-marker {
            display: none;
        }

        .period-summary:hover {
            background: #f3f6fd;
        }

        .period-summary-main {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .period-chevron {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 18px;
            color: var(--accent);
            font-size: 18px;
            line-height: 1;
        }

        .period-title {
            color: var(--text);
            font-size: 13px;
            font-weight: 700;
        }

        .period-range {
            margin-top: 2px;
            color: var(--muted);
            font-size: 11px;
        }

        .period-stats {
            display: flex;
            align-items: center;
            gap: 7px;
            color: var(--muted);
            font-size: 12px;
            white-space: nowrap;
        }

        .period-divider {
            color: var(--border);
        }

        .period-progress {
            padding: 3px 7px;
            border-radius: 999px;
            background: var(--accent-soft);
            color: var(--accent);
            font-weight: 700;
        }

        .period-content {
            border-top: 1px solid var(--border);
        }

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

        .complete-cell {
            width: 68px;
            text-align: center;
        }

        .task-checkbox-label {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
        }

        .task-complete-checkbox {
            width: 16px;
            height: 16px;
            margin: 0;
            accent-color: #48a977;
            cursor: pointer;
        }

.task-type-cell {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.warehouse-task td {
    background: #f3f7ff;
}

.warehouse-task:hover td {
    background: #eaf1ff;
}

.warehouse-task-badge {
    display: inline-flex;
    align-items: center;
    min-height: 21px;
    padding: 2px 7px;
    border-radius: 999px;
    background: #dce8ff;
    color: #46689f;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}
/*клодори*/
/* Поручение кладовщика: спокойное холодное выделение */
.task-row.warehouse-task td {
    background: #f1f5ff;
}

.task-row.warehouse-task td:first-child {
    box-shadow: inset 3px 0 0 #6a83c2;
}

.task-row.warehouse-task:hover td {
    background: #e7eeff;
}

.task-row.warehouse-task .employee-dot {
    background: #6a83c2;
}

.warehouse-task-badge {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 2px 7px;
    border-radius: 999px;
    background: #dce6ff;
    color: #4d679f;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.warehouse-actions-note {
    color: #71809e;
    font-size: 11px;
    white-space: nowrap;
}
/* Выполненная задача всегда зелёная */
.task-row.warehouse-task.completed td {
    background: #eef9f2;
}

.task-row.warehouse-task.completed td:first-child {
    box-shadow: inset 3px 0 0 #48a977;
}

.task-row.warehouse-task.completed .employee-dot {
    background: #48a977;
}

/* Просроченная задача кладовщика */
.task-row.warehouse-task.overdue td {
    background: #fff1f2;
}

.task-row.warehouse-task.overdue td:first-child {
    box-shadow: inset 3px 0 0 #d65c68;
}

.task-row.warehouse-task.overdue .employee-dot {
    background: #d65c68;
}
        /* Выполненная задача */
        .task-row.completed td {
            background: #eef9f2;
        }

        .task-row.completed .task-type {
            opacity: 0.82;
        }

        .task-row.completed td:not(.complete-cell) {
            color: #3d6d54;
        }

        /* Просроченная невыполненная задача */
        .task-row.overdue td {
            background: #fff1f2;
        }

        .task-row.overdue td:first-child {
            box-shadow: inset 3px 0 0 #d65c68;
        }

        /* Задача на текущую дату */
        .task-row.today td {
            background: #fff9df;
        }

        .task-row.today td:first-child {
            box-shadow: inset 3px 0 0 #d4a72c;
        }

        .task-row.completed:hover td {
            background: #e6f6ec;
        }

        .task-row.overdue:hover td {
            background: #ffe8ea;
        }

        .task-row.today:hover td {
            background: #fff4c7;
        }

        @media (max-width: 720px) {
            .period-summary {
                align-items: flex-start;
                flex-direction: column;
                gap: 8px;
            }

            .period-stats {
                padding-left: 28px;
                white-space: normal;
            }
        }
        .group-manager-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.group-period-select {
    min-height: 30px;
    max-width: 185px;
    padding: 5px 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
    color: #4f5e78;
    cursor: pointer;
    font-size: 12px;
}

.group-period-select:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 3px rgba(88, 116, 184, 0.12);
}

@media (max-width: 560px) {
    .group-manager-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .group-manager-controls {
        width: 100%;
    }

    .group-period-select {
        flex: 1;
        max-width: none;
    }
}
.table-caption-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.view-switcher {
    display: inline-flex;
    padding: 3px;
    background: #f0f3f9;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.view-switcher-button {
    min-height: 28px;
    padding: 5px 9px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
}

.view-switcher-button:hover {
    color: var(--text);
}

.view-switcher-button.active {
    background: #fff;
    color: var(--accent);
    box-shadow: 0 1px 3px rgba(23, 32, 51, 0.12);
}

@media (max-width: 720px) {
    .table-caption-actions {
        align-items: flex-end;
        flex-direction: column;
        gap: 8px;
    }
}
.archive-dialog {
    width: min(860px, 100%);
}

.archive-body {
    display: grid;
    gap: 20px;
    max-height: min(70vh, 720px);
    padding: 20px;
    overflow-y: auto;
}

.archive-section {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
}

.archive-section-header {
    margin-bottom: 14px;
}

.archive-section-header h3 {
    margin: 0;
    color: var(--text);
    font-size: 14px;
}

.archive-section-header p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.archive-month-field {
    max-width: 220px;
    margin-top: 12px;
}

.archive-results {
    margin-top: 14px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.archive-placeholder,
.archive-empty {
    padding: 20px;
    color: var(--muted);
    font-size: 13px;
    text-align: center;
}

.archive-results-table {
    width: 100%;
    border-collapse: collapse;
}

.archive-results-table th {
    padding: 10px 12px;
    background: var(--header-bg);
    border-bottom: 1px solid var(--border);
    color: #5f6c85;
    font-size: 12px;
    font-weight: 650;
    text-align: left;
}

.archive-results-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    font-size: 13px;
}

.archive-results-table tr:last-child td {
    border-bottom: 0;
}

.archive-status {
    display: inline-flex;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 650;
    white-space: nowrap;
}

.archive-status.completed {
    background: var(--success-bg);
    color: var(--success-text);
}

.archive-status.not-completed {
    background: var(--danger-bg);
    color: var(--danger-text);
}

.archive-create-section {
    background: #fbfcff;
}

.archive-create-controls {
    display: flex;
    align-items: end;
    gap: 12px;
}

@media (max-width: 620px) {
    .archive-create-controls {
        align-items: stretch;
        flex-direction: column;
    }

    .archive-create-controls .btn {
        width: 100%;
    }
}
.task-transfer-section {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

.task-transfer-title {
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
}

.task-transfer-description {
    margin: 5px 0 12px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

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

.move-date-options {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 10px;
    margin-top: 12px;
}

@media (max-width: 520px) {
    .task-transfer-actions .btn {
        width: 100%;
    }

    .move-date-options {
        grid-template-columns: 1fr;
    }

    .move-date-options .btn {
        width: 100%;
    }
}
/* Сотрудник не работает в дату поручения */
.task-row.not-on-shift td {
    background: #fdf0f6;
}

.task-row.not-on-shift td:first-child {
    box-shadow: inset 3px 0 0 #c65a92;
}

.task-row.not-on-shift:hover td {
    background: #f9e3ef;
}

.task-row.not-on-shift .employee-dot {
    background: #c65a92;
}

.task-warning-badge {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    margin-left: 2px;
    padding: 2px 7px;
    border-radius: 999px;
    background: #f8dce9;
    color: #a63f73;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}
/* Кладовщики */
.warehouse-dialog {
    width: min(920px, 100%);
}

.warehouse-body {
    max-height: min(70vh, 720px);
    padding: 20px;
    overflow-y: auto;
}

.warehouse-controls {
    display: grid;
    grid-template-columns: minmax(160px, 1fr) minmax(190px, 1fr) auto;
    align-items: end;
    gap: 12px;
}

.warehouse-info {
    margin-top: 16px;
    padding: 11px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f8faff;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.warehouse-tasks-list {
    margin-top: 16px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 9px;
}

.warehouse-empty {
    padding: 24px;
    color: var(--muted);
    font-size: 13px;
    text-align: center;
}

.warehouse-table {
    width: 100%;
    border-collapse: collapse;
}

.warehouse-table th {
    padding: 10px 12px;
    background: var(--header-bg);
    border-bottom: 1px solid var(--border);
    color: #5f6c85;
    font-size: 12px;
    font-weight: 650;
    text-align: left;
}

.warehouse-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    font-size: 13px;
    vertical-align: middle;
}

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

.warehouse-period-badge {
    display: inline-flex;
    min-height: 22px;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    background: #edf2ff;
    color: var(--accent);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.warehouse-row.completed td {
    background: #eef9f2;
}

.warehouse-row.completed .warehouse-period-badge {
    background: var(--success-bg);
    color: var(--success-text);
}

@media (max-width: 700px) {
    .warehouse-controls {
        grid-template-columns: 1fr;
    }

    .warehouse-controls .btn {
        width: 100%;
    }
}

.assignment-choice-dialog {
    width: min(580px, 100%);
}

.assignment-choice-body {
    display: grid;
    gap: 12px;
    padding: 20px;
}

.assignment-choice-card {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    color: var(--text);
    cursor: pointer;
    text-align: left;
    transition: 0.15s ease;
}

.assignment-choice-card:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.assignment-choice-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 9px;
    background: #eef3ff;
    font-size: 20px;
}

.assignment-choice-content {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 4px;
}

.assignment-choice-content strong {
    color: var(--text);
    font-size: 14px;
}

.assignment-choice-content small {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}

.assignment-choice-arrow {
    color: var(--accent);
    font-size: 26px;
    line-height: 1;
}
.assignment-choice-dialog {
    width: min(580px, 100%);
}

.assignment-choice-body {
    display: grid;
    gap: 12px;
    padding: 20px;
}

.assignment-choice-card {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    color: var(--text);
    cursor: pointer;
    text-align: left;
    transition: 0.15s ease;
}

.assignment-choice-card:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.assignment-choice-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 9px;
    background: #eef3ff;
    font-size: 20px;
}

.assignment-choice-content {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 4px;
}

.assignment-choice-content strong {
    color: var(--text);
    font-size: 14px;
}

.assignment-choice-content small {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}

.assignment-choice-arrow {
    color: var(--accent);
    font-size: 26px;
    line-height: 1;
}
.warehouse-assign-dialog {
    width: min(700px, 100%);
}

.warehouse-assign-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.warehouse-assign-viewport {
    overflow: hidden;
}

.warehouse-assign-track {
    display: flex;
    width: 300%;
    transition: transform 0.28s ease;
}

.warehouse-assign-step {
    width: 33.3333%;
    flex: 0 0 33.3333%;
}

.warehouse-assign-step-content {
    min-height: 330px;
    padding: 20px;
}

.warehouse-scenario-card {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 100%;
    margin-bottom: 10px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: #fff;
    color: var(--text);
    cursor: pointer;
    text-align: left;
}

.warehouse-scenario-card:hover,
.warehouse-scenario-card.selected {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.warehouse-scenario-card strong {
    font-size: 13px;
}

.warehouse-scenario-card span {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}

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

.warehouse-search-field {
    margin-top: 14px;
}

.warehouse-selection-heading {
    margin: 18px 0 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.warehouse-checkbox-list {
    display: grid;
    gap: 7px;
    max-height: 180px;
    overflow-y: auto;
    padding: 2px;
}

.warehouse-checkbox-row {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 36px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
}

.warehouse-checkbox-row:hover {
    background: #fafcff;
    border-color: #b8c6e7;
}

.warehouse-checkbox-row input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--accent);
}

.warehouse-checkbox-period {
    margin-left: auto;
    padding: 2px 6px;
    border-radius: 999px;
    background: #edf2ff;
    color: var(--accent);
    font-size: 10px;
    font-weight: 700;
}

@media (max-width: 560px) {
    .warehouse-fields-grid {
        grid-template-columns: 1fr;
    }
}
.warehouse-unassigned-badge {
    display: inline-block;
    margin-left: 10px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    color: #ffd166;
    background: rgba(255, 209, 102, 0.12);
    border: 1px solid rgba(255, 209, 102, 0.35);
    white-space: nowrap;
}
.warehouse-unassigned-badge {
    display: inline-block;
    margin-left: 10px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    color: #ffd166;
    background: rgba(255, 209, 102, 0.12);
    border: 1px solid rgba(255, 209, 102, 0.35);
    white-space: nowrap;
    cursor: help;
    user-select: none;
}

.warehouse-unassigned-badge:hover {
    background: rgba(255, 209, 102, 0.22);
}
/* =========================================================
   Верхняя панель приложения
   ========================================================= */

.app-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;

    box-sizing: border-box;
    width: 100%;
    min-height: 74px;
    padding: 12px 24px;

    color: #f4f6fb;
    background: #263247;
    border-bottom: 1px solid rgba(190, 205, 230, 0.16);
    box-shadow: 0 4px 16px rgba(20, 30, 48, 0.12);
}

/* Логотип и название */

.app-topbar-brand {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 10px;
    min-width: 0;
}

.app-topbar-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 38px;

    width: 38px;
    height: 38px;

    color: #f5f7fd;
    background: #405171;
    border: 1px solid rgba(210, 223, 246, 0.24);
    border-radius: 10px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.app-topbar-title h1 {
    margin: 0;
    color: #f4f6fb;
    font-size: 16px;
    font-weight: 750;
    line-height: 1.3;
    letter-spacing: -0.25px;
}

.app-topbar-title p {
    margin: 3px 0 0;
    color: #aeb9cc;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.35;
}

/* Показатели */

.app-topbar-stats {
    display: flex;
    align-items: stretch;
    justify-content: flex-start;
    flex: 1 1 auto;
    gap: 5px;

    box-sizing: border-box;
    min-width: 0;
    padding: 4px;

    background: rgba(12, 20, 34, 0.23);
    border: 1px solid rgba(190, 205, 230, 0.18);
    border-radius: 11px;
}

.app-topbar-stat {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3px;

    min-width: 64px;
    padding: 5px 10px;

    background: rgba(255, 255, 255, 0.045);
    border: 1px solid rgba(190, 205, 230, 0.1);
    border-radius: 7px;
}

.app-topbar-stat span {
    color: #aeb9cc;
    font-size: 9px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
}

.app-topbar-stat strong {
    color: #f4f6fb;
    font-size: 15px;
    font-weight: 750;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.app-topbar-stat-warning {
    background: rgba(224, 171, 66, 0.08);
    border-color: rgba(224, 171, 66, 0.22);
}

.app-topbar-stat-warning strong {
    color: #ffd078;
}

/* Переходы в приложения */

.app-topbar-links {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex: 0 0 auto;
    gap: 6px;
}

.app-topbar-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;

    box-sizing: border-box;
    min-height: 36px;
    padding: 8px 10px;

    color: #dbe3f1;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(190, 205, 230, 0.23);
    border-radius: 9px;

    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;

    transition:
        background 0.15s ease,
        border-color 0.15s ease;
}

a.app-topbar-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(210, 224, 248, 0.45);
}

a.app-topbar-link:focus-visible {
    outline: 2px solid #9ebeff;
    outline-offset: 3px;
}

.app-topbar-link-icon {
    font-size: 17px;
    line-height: 1;
}

.app-topbar-link-disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* Рабочая панель: оформление самих .btn не изменяем */

.inventory-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

/* На небольших экранах ссылки переходят на следующую строку */

@media (max-width: 1200px) {
    .app-topbar {
        flex-wrap: wrap;
        gap: 12px 20px;
    }

    .app-topbar-stats {
        flex: 1 1 350px;
    }

    .app-topbar-links {
        flex: 1 1 100%;
    }
}

@media (max-width: 640px) {
    .app-topbar {
        padding: 12px 14px;
    }

    .app-topbar-brand {
        width: 100%;
    }

    .app-topbar-stats {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        flex-basis: 100%;
    }

    .app-topbar-stat {
        min-width: 0;
    }

    .app-topbar-links {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .app-topbar-link {
        min-width: 0;
        min-height: 40px;
    }

    .inventory-actions {
        gap: 8px;
    }
}
/* =========================================================
   Рабочая панель инструментов
   ========================================================= */

.inventory-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;

    box-sizing: border-box;
    margin: 0 0 20px;
    padding: 12px 14px;

    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 13px;
}

.inventory-actions-main,
.inventory-actions-service {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

/* Общая основа кнопок */

.inventory-actions .inventory-tool {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    box-sizing: border-box;
    min-height: 40px;
    margin: 0;
    padding: 9px 14px;

    appearance: none;
    color: #475569;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 9px;
    box-shadow: none;

    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;

    transition:
        background 0.15s ease,
        color 0.15s ease,
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

.inventory-actions .inventory-tool svg {
    display: block;
    flex: 0 0 18px;
    width: 18px;
    height: 18px;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.inventory-actions .inventory-tool:hover {
    color: #1e293b;
    background: #edf2f7;
}

.inventory-actions .inventory-tool:focus-visible {
    outline: 3px solid rgba(59, 130, 246, 0.35);
    outline-offset: 3px;
}

.inventory-actions .inventory-tool:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Главное действие */

.inventory-actions .inventory-tool-primary {
    color: #fff;
    background: #365b8c;
    border-color: #365b8c;
    box-shadow: 0 3px 7px rgba(54, 91, 140, 0.16);
}

.inventory-actions .inventory-tool-primary:hover {
    color: #fff;
    background: #294b78;
    border-color: #294b78;
    box-shadow: 0 4px 10px rgba(54, 91, 140, 0.24);
}

/* Импорт — второе по значимости действие */

.inventory-actions .inventory-tool-secondary {
    color: #475569;
    background: #fff;
    border-color: #dce3ed;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.inventory-actions .inventory-tool-secondary:hover {
    color: #294b78;
    background: #f1f5fb;
    border-color: #b8c8dd;
}

/* Архив и группы — единый блок */

.inventory-tool-group {
    display: inline-flex;
    align-items: stretch;
    overflow: hidden;

    background: #fff;
    border: 1px solid #dce3ed;
    border-radius: 9px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.inventory-actions .inventory-tool-group .inventory-tool {
    border: 0;
    border-radius: 0;
}

.inventory-actions .inventory-tool-group .inventory-tool + .inventory-tool {
    border-left: 1px solid #e2e8f0;
}

/* Справка — минимальный визуальный вес */

.inventory-actions .inventory-tool-help {
    padding-right: 6px;
    padding-left: 6px;

    color: #64748b;
    font-size: 12px;
    font-weight: 500;
}

.inventory-actions .inventory-tool-help:hover {
    color: #365b8c;
    background: transparent;
}

/* Мобильная версия */

@media (max-width: 680px) {
    .inventory-actions {
        align-items: stretch;
        gap: 12px;
        padding: 12px;
    }

    .inventory-actions-main {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .inventory-actions-main .inventory-tool {
        min-width: 0;
        padding-right: 10px;
        padding-left: 10px;
    }

    .inventory-actions-service {
        justify-content: space-between;
        width: 100%;
        gap: 8px;
    }
}

@media (max-width: 380px) {
    .inventory-actions-service {
        justify-content: flex-start;
    }

    .inventory-actions .inventory-tool-help {
        padding-left: 10px;
    }
}
/* =========================================================
   Сводка периода
   ========================================================= */

.period-block {
    overflow: hidden;
    margin-bottom: 14px;

    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 13px;

    box-shadow: 0 2px 5px rgba(15, 23, 42, 0.025);
}

.period-block > .period-overview-summary {
    display: block;
    padding: 16px 20px;

    color: #334155;
    background: #fff;
    list-style: none;
    cursor: pointer;
}

.period-overview-summary::-webkit-details-marker {
    display: none;
}

.period-overview-summary::marker {
    content: "";
}

.period-block > .period-overview-summary:hover {
    background: #fafbfd;
}

.period-block[open] > .period-overview-summary {
    border-bottom: 1px solid #e9eef5;
}

.period-overview-heading {
    display: flex;
    align-items: center;
    gap: 12px;
}

.period-overview-chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 26px;

    width: 26px;
    height: 26px;

    color: #64748b;
    background: #f1f5f9;
    border-radius: 7px;
    font-size: 23px;
    line-height: 1;

    transition: transform 0.18s ease;
}

.period-block[open] .period-overview-chevron {
    transform: rotate(90deg);
}

.period-overview-name {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.period-overview-title {
    color: #263247;
    font-size: 15px;
    font-weight: 700;
}

.period-overview-range {
    color: #7b8799;
    font-size: 11px;
}

.period-overview-status {
    margin-left: auto;
    padding: 5px 9px;

    border-radius: 7px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.period-overview-status.is-warning {
    color: #93620b;
    background: #fff6df;
    border: 1px solid #f2dfb3;
}

.period-overview-status.is-ready {
    color: #567466;
    background: #f0f7f3;
    border: 1px solid #dcebe2;
}

.period-overview-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 30px;

    margin-top: 15px;
    padding-left: 38px;
}

.period-overview-metric-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    color: #526177;
    font-size: 12px;
}

.period-overview-metric-line > span:last-child {
    color: #263247;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.period-overview-muted {
    color: #94a3b8;
    font-weight: 500;
}

.period-overview-track {
    overflow: hidden;
    height: 5px;
    margin-top: 8px;

    background: #edf1f6;
    border-radius: 10px;
}

.period-overview-fill {
    display: block;
    height: 100%;
    border-radius: inherit;
}

.period-overview-fill.distribution {
    background: #6a86ad;
}

.period-overview-fill.completion {
    background: #5b9c7a;
}

.period-overview-description {
    margin-top: 7px;
    color: #7b8799;
    font-size: 11px;
    line-height: 1.5;
}

.period-overview-description > span {
    margin: 0 6px;
    color: #bcc5d2;
}

.period-overview-warning {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;

    margin: 13px 0 0 38px;
    padding: 8px 10px;

    color: #93620b;
    background: #fffbf1;
    border: 1px solid #f3e5c5;
    border-radius: 8px;

    font-size: 11px;
    cursor: pointer;
}

.period-overview-warning > span {
    font-weight: 600;
}

.period-overview-warning:hover {
    background: #fff4d9;
}

.period-overview-warning:focus-visible {
    outline: 2px solid #b98a30;
    outline-offset: 3px;
}

@media (max-width: 680px) {
    .period-block > .period-overview-summary {
        padding: 14px;
    }

    .period-overview-heading {
        flex-wrap: wrap;
        gap: 9px;
    }

    .period-overview-status {
        margin-left: 35px;
    }

    .period-overview-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        padding-left: 0;
    }

    .period-overview-warning {
        margin-left: 0;
    }
}
/* =========================================================
   Окно нераспределённых групп
   ========================================================= */

.unassigned-dialog {
    box-sizing: border-box;
    width: min(620px, calc(100vw - 32px));
    max-height: calc(100dvh - 40px);
    margin: auto;
    padding: 0;
    overflow-y: auto;

    color: #334155;
    background: #fff;
    border: 1px solid #dce3ed;
    border-radius: 18px;
    box-shadow: 0 24px 80px rgba(15, 23, 42, 0.24);

    font-family: inherit;
}

.unassigned-dialog::backdrop {
    background: rgba(20, 30, 48, 0.48);
    backdrop-filter: blur(3px);
}

.unassigned-dialog-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;

    padding: 24px 24px 18px;
}

.unassigned-dialog-eyebrow {
    margin-bottom: 7px;
    color: #8b98aa;
    font-size: 10px;
    font-weight: 650;
    letter-spacing: 0.7px;
    text-transform: uppercase;
}

.unassigned-dialog-header h2 {
    margin: 0;
    color: #263247;
    font-size: 20px;
    line-height: 1.3;
    letter-spacing: -0.3px;
}

.unassigned-dialog-subtitle {
    margin: 7px 0 0;
    color: #7b8799;
    font-size: 12px;
    line-height: 1.5;
}

.unassigned-dialog-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 32px;

    width: 32px;
    height: 32px;
    padding: 0;

    color: #7b8799;
    background: #f3f6fa;
    border: 0;
    border-radius: 9px;
    cursor: pointer;
}

.unassigned-dialog-close svg {
    width: 17px;
    height: 17px;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
}

.unassigned-dialog-close:hover {
    color: #263247;
    background: #e9eef5;
}

/* Переключение вида сотрудников */

.unassigned-dialog-switch {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;

    margin: 0 24px;
    padding: 4px;

    background: #f0f3f8;
    border: 1px solid #e5eaf2;
    border-radius: 11px;
}

.unassigned-dialog-switch button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    min-height: 38px;
    padding: 8px;

    color: #748196;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;

    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.unassigned-dialog-switch button.is-active {
    color: #365b8c;
    background: #fff;
    border-color: #e0e6ef;
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.05);
}

.unassigned-role-count {
    min-width: 18px;
    padding: 2px 5px;

    background: #e7edf5;
    border-radius: 5px;

    font-size: 10px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.is-active .unassigned-role-count {
    color: #93620b;
    background: #fff2d4;
}

/* Список групп */

.unassigned-dialog-body {
    padding: 18px 24px 24px;
}

.unassigned-dialog-list-caption {
    margin: 0 0 12px;
    color: #7b8799;
    font-size: 12px;
}

.unassigned-dialog-list {
    display: grid;
    gap: 7px;

    margin: 0;
    padding: 0;
    list-style: none;
}

.unassigned-dialog-list li {
    display: flex;
    align-items: center;
    gap: 11px;

    padding: 11px 12px;

    background: #fafbfd;
    border: 1px solid #e8edf4;
    border-radius: 9px;
}

.unassigned-group-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 25px;

    height: 25px;

    color: #8592a5;
    background: #edf1f6;
    border-radius: 7px;

    font-size: 10px;
    font-variant-numeric: tabular-nums;
}

.unassigned-group-name {
    color: #3c4b61;
    font-size: 13px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

/* Пустой список */

.unassigned-dialog-empty {
    display: flex;
    align-items: center;
    gap: 14px;

    padding: 24px 12px;
}

.unassigned-empty-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 42px;

    height: 42px;

    color: #4d9470;
    background: #edf7f1;
    border-radius: 13px;
    font-size: 22px;
}

.unassigned-dialog-empty h3 {
    margin: 0 0 5px;
    color: #3b6350;
    font-size: 14px;
}

.unassigned-dialog-empty p {
    margin: 0;
    color: #7b8799;
    font-size: 12px;
    line-height: 1.5;
}

/* Нижняя панель */

.unassigned-dialog-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;

    padding: 15px 24px;

    background: #fafbfd;
    border-top: 1px solid #e8edf4;
}

.unassigned-dialog-footer > span {
    max-width: 320px;
    color: #8b98aa;
    font-size: 11px;
    line-height: 1.5;
}

.unassigned-dialog-done {
    padding: 9px 16px;

    color: #fff;
    background: #365b8c;
    border: 1px solid #365b8c;
    border-radius: 8px;

    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.unassigned-dialog-done:hover {
    background: #294b78;
}

.unassigned-dialog button:focus-visible {
    outline: 2px solid #8caedb;
    outline-offset: 3px;
}

/* Чтобы display:flex/grid не перекрывал атрибут hidden */

.unassigned-dialog [hidden] {
    display: none !important;
}

@media (max-width: 480px) {
    .unassigned-dialog {
        width: calc(100vw - 20px);
        border-radius: 14px;
    }

    .unassigned-dialog-header {
        padding: 20px 16px 16px;
    }

    .unassigned-dialog-header h2 {
        font-size: 18px;
    }

    .unassigned-dialog-switch {
        margin: 0 16px;
    }

    .unassigned-dialog-body {
        padding: 16px;
    }

    .unassigned-dialog-footer {
        padding: 14px 16px;
    }
}
/* =========================================================
   Панель фильтров
   ========================================================= */

.toolbar.inventory-filters {
    display: block;
    box-sizing: border-box;
    width: 100%;
    margin: 0 0 20px;
    padding: 16px;

    color: #475569;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 13px;
    box-shadow: none;
}

/* Верхняя строка */

.inventory-filters .inventory-filters-row {
    display: grid;
    grid-template-columns:
        160px
        190px
        170px
        minmax(180px, 1fr);
    align-items: end;
    gap: 12px;
}

/* Поля */

.inventory-filters .inventory-filter {
    display: flex;
    flex-direction: column;
    gap: 6px;

    box-sizing: border-box;
    min-width: 0;
    margin: 0;
    padding: 0;
}

.inventory-filters .inventory-filter > span {
    color: #8490a2;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.4;
}

.inventory-filters .inventory-filter input,
.inventory-filters .inventory-filter select {
    display: block;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    height: 40px;
    margin: 0;
    padding: 8px 11px;

    color: #475569;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: none;

    font-family: inherit;
    font-size: 12px;
    font-weight: 400;
    line-height: normal;

    transition:
        border-color 0.15s ease,
        background 0.15s ease,
        box-shadow 0.15s ease;
}

.inventory-filters .inventory-filter select {
    cursor: pointer;
}

.inventory-filters .inventory-filter input:hover,
.inventory-filters .inventory-filter select:hover {
    border-color: #cbd5e1;
}

.inventory-filters .inventory-filter input:focus,
.inventory-filters .inventory-filter select:focus {
    outline: none;

    background: #ffffff;
    border-color: #91aacc;
    box-shadow: 0 0 0 3px rgba(54, 91, 140, 0.09);
}

/* Поиск */

.inventory-filters .inventory-search-control {
    position: relative;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
}

.inventory-filters .inventory-search-control svg {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);

    display: block;
    width: 16px;
    height: 16px;

    fill: none;
    stroke: #94a3b8;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;

    pointer-events: none;
}

.inventory-filters .inventory-search-control input {
    padding-left: 35px;
}

.inventory-filters .inventory-search-control input::placeholder {
    color: #98a3b3;
    opacity: 1;
}

/* Нижняя строка */

.inventory-filters .inventory-filters-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;

    margin-top: 14px;
    padding-top: 13px;

    border-top: 1px solid #eef2f6;
}

/* Переключатель выполнения */

.inventory-filters .inventory-status-switch {
    display: inline-flex;
    align-items: stretch;
    gap: 3px;

    box-sizing: border-box;
    margin: 0;
    padding: 3px;

    background: #f1f4f8;
    border: 1px solid #e6ebf2;
    border-radius: 9px;
}

.inventory-filters .inventory-status-switch button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    box-sizing: border-box;
    width: auto;
    min-height: 32px;
    margin: 0;
    padding: 6px 12px;

    appearance: none;
    color: #7b8799;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    box-shadow: none;

    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;

    cursor: pointer;

    transition:
        color 0.15s ease,
        background 0.15s ease,
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

.inventory-filters .inventory-status-switch button:hover {
    color: #365b8c;
    background: rgba(255, 255, 255, 0.5);
}

.inventory-filters .inventory-status-switch button.is-active,
.inventory-filters .inventory-status-switch button[aria-pressed="true"] {
    color: #365b8c;
    background: #ffffff;
    border-color: #e1e7ef;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

/* Сброс фильтров */

.inventory-filters .inventory-filter-reset {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;

    box-sizing: border-box;
    width: auto;
    min-height: 32px;
    margin: 0;
    padding: 6px 8px;

    appearance: none;
    color: #64748b;
    background: transparent;
    border: 0;
    border-radius: 7px;
    box-shadow: none;

    font-family: inherit;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.3;
    white-space: nowrap;

    cursor: pointer;

    transition:
        color 0.15s ease,
        background 0.15s ease;
}

.inventory-filters .inventory-filter-reset svg {
    display: block;
    flex: 0 0 15px;
    width: 15px;
    height: 15px;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.inventory-filters .inventory-filter-reset:hover:not(:disabled) {
    color: #365b8c;
    background: #f1f5fb;
}

.inventory-filters .inventory-filter-reset:disabled {
    color: #b0bac8;
    background: transparent;
    cursor: default;
}

/* Фокус клавиатуры */

.inventory-filters .inventory-status-switch button:focus-visible,
.inventory-filters .inventory-filter-reset:focus-visible {
    outline: 2px solid #91aacc;
    outline-offset: 3px;
}

/* Планшеты */

@media (max-width: 1000px) {
    .inventory-filters .inventory-filters-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .inventory-filters .inventory-filter-search {
        grid-column: 1 / -1;
    }
}

/* Телефоны */

@media (max-width: 600px) {
    .toolbar.inventory-filters {
        padding: 12px;
    }

    .inventory-filters .inventory-filters-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .inventory-filters .inventory-filter-search {
        grid-column: auto;
    }

    .inventory-filters .inventory-status-switch {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        width: 100%;
    }

    .inventory-filters .inventory-status-switch button {
        width: 100%;
        min-width: 0;
        padding-right: 7px;
        padding-left: 7px;
    }

    .inventory-filters .inventory-filter-reset {
        margin-left: auto;
    }
}

/* Узкие экраны */

@media (max-width: 380px) {
    .inventory-filters .inventory-filters-row {
        grid-template-columns: 1fr;
    }
}

/* Уменьшение анимации */

@media (prefers-reduced-motion: reduce) {
    .inventory-filters .inventory-filter input,
    .inventory-filters .inventory-filter select,
    .inventory-filters .inventory-status-switch button,
    .inventory-filters .inventory-filter-reset {
        transition: none;
    }
}
/* =========================================================
   Таблица поручений
   ========================================================= */

#scheduleViewContainer .table-scroll {
    width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
}

#scheduleViewContainer .schedule-table {
    width: 100%;
    min-width: 850px;
    margin: 0;

    border-collapse: separate;
    border-spacing: 0;

    color: #475569;
    background: #ffffff;

    font-family: inherit;
    font-size: 12px;
    line-height: 1.5;
}

/* Заголовки колонок */

#scheduleViewContainer .schedule-table thead th {
    padding: 11px 14px;

    color: #8a96a8;
    background: #f8fafc;
    border: 0;
    border-bottom: 1px solid #e7edf4;

    font-size: 10px;
    font-weight: 600;
    line-height: 1.4;
    text-align: left;
    white-space: nowrap;
}

/* Ячейки */

#scheduleViewContainer .schedule-table tbody td {
    padding: 14px;

    color: #526177;
    border: 0;
    border-bottom: 1px solid #eef2f6;

    vertical-align: middle;
}

#scheduleViewContainer .schedule-table tbody tr:last-child td {
    border-bottom: 0;
}

/* Строки */

#scheduleViewContainer .schedule-table tbody tr {
    background: #ffffff;

    transition:
        background-color 0.15s ease,
        box-shadow 0.15s ease;
}

#scheduleViewContainer .schedule-table tbody tr:hover {
    background: #f8fafd;
}

#scheduleViewContainer .schedule-table tbody tr:focus-within {
    background: #f3f7fc;
}

/* Перетаскивание */

#scheduleViewContainer .schedule-table .drag-cell {
    width: 30px;
    padding-right: 4px;
    padding-left: 10px;
    text-align: center;
}

#scheduleViewContainer .schedule-table .drag-handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 24px;
    min-height: 30px;

    color: #b1bdcc;
    background: transparent;
    border: 0;
    border-radius: 6px;

    cursor: grab;
}

#scheduleViewContainer .schedule-table .drag-handle:hover {
    color: #6682a7;
    background: #eaf0f7;
}

#scheduleViewContainer .schedule-table .drag-handle:active {
    cursor: grabbing;
}

/* Выполнение */

#scheduleViewContainer .schedule-table .complete-cell {
    width: 52px;
    text-align: center;
}

#scheduleViewContainer .schedule-table input[type="checkbox"] {
    width: 17px;
    height: 17px;
    margin: 0;

    accent-color: #56896f;
    vertical-align: middle;
    cursor: pointer;
}

#scheduleViewContainer .schedule-table input[type="checkbox"]:focus-visible {
    outline: 2px solid #91aacc;
    outline-offset: 3px;
}

/* Выполненная строка: определяем по существующему чекбоксу */

#scheduleViewContainer .schedule-table tbody tr:has(
    .complete-cell input[type="checkbox"]:checked
) {
    background: #f5faf7;
}

#scheduleViewContainer .schedule-table tbody tr:has(
    .complete-cell input[type="checkbox"]:checked
):hover {
    background: #edf6f0;
}

/* Дата */

#scheduleViewContainer .schedule-table tbody td:nth-child(3) {
    min-width: 125px;

    color: #7b8799;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
}

/* Тип задачи */

#scheduleViewContainer .schedule-table tbody td:nth-child(4) {
    min-width: 120px;
    font-size: 11px;
}

/* Группа товаров — главный акцент */

#scheduleViewContainer .schedule-table tbody td:nth-child(5) {
    min-width: 190px;

    color: #30415a;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.5;

    overflow-wrap: anywhere;
}

/* Сотрудник */

#scheduleViewContainer .schedule-table tbody td:nth-child(6) {
    min-width: 170px;

    color: #5b6b81;
    font-size: 12px;
    line-height: 1.5;
}

/* Метки типов задач, если используются в текущем шаблоне */

#scheduleViewContainer .schedule-table .task-type,
#scheduleViewContainer .schedule-table .task-type-badge {
    display: inline-flex;
    align-items: center;

    padding: 4px 7px;

    border: 1px solid #e1e7ef;
    border-radius: 6px;

    font-size: 10px;
    font-weight: 600;
    line-height: 1.35;
}

#scheduleViewContainer .schedule-table .task-type.inv,
#scheduleViewContainer .schedule-table .task-type-badge.inv {
    color: #5878a1;
    background: #f0f5fc;
    border-color: #dce6f4;
}

#scheduleViewContainer .schedule-table .task-type.price,
#scheduleViewContainer .schedule-table .task-type-badge.price {
    color: #57856f;
    background: #f0f7f3;
    border-color: #dcebe2;
}

/* Предупреждение о смене */

#scheduleViewContainer .schedule-table .task-warning-badge {
    display: inline-flex;
    align-items: center;

    margin-top: 4px;
    padding: 3px 6px;

    color: #9a6b23;
    background: #fff6e5;
    border: 1px solid #f2e2bf;
    border-radius: 5px;

    font-size: 10px;
    font-weight: 500;
    line-height: 1.3;
}

/* Действия остаются видимыми */

#scheduleViewContainer .schedule-table tbody td:last-child {
    white-space: nowrap;
}

#scheduleViewContainer .schedule-table tbody td:last-child button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;

    box-sizing: border-box;
    min-height: 30px;
    margin: 2px;
    padding: 6px 9px;

    color: #687b96;
    background: #f6f8fb;
    border: 1px solid #e2e8f0;
    border-radius: 7px;
    box-shadow: none;

    font-family: inherit;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.2;

    cursor: pointer;

    transition:
        color 0.15s ease,
        background 0.15s ease,
        border-color 0.15s ease;
}

#scheduleViewContainer .schedule-table tbody td:last-child button:hover:not(
    :disabled
) {
    color: #365b8c;
    background: #eaf0f8;
    border-color: #c8d6e8;
}

#scheduleViewContainer .schedule-table tbody td:last-child button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

#scheduleViewContainer .schedule-table button:focus-visible {
    outline: 2px solid #91aacc;
    outline-offset: 2px;
}

/* Пустой период */

#scheduleViewContainer .period-empty {
    padding: 24px 20px;

    color: #8a96a8;
    background: #fafbfd;

    font-size: 12px;
    text-align: center;
}

/* Телефоны: сохраняем таблицу и горизонтальную прокрутку */

@media (max-width: 680px) {
    #scheduleViewContainer .schedule-table {
        min-width: 800px;
    }

    #scheduleViewContainer .schedule-table thead th {
        padding: 10px;
    }

    #scheduleViewContainer .schedule-table tbody td {
        padding: 12px 10px;
    }
}

/* Уменьшение анимации */

@media (prefers-reduced-motion: reduce) {
    #scheduleViewContainer .schedule-table tbody tr,
    #scheduleViewContainer .schedule-table tbody td:last-child button {
        transition: none;
    }
}
/* Справочник групп: редактирование ответственного */
.group-manager-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 10px;
  background: #fff;
}

.group-manager-row + .group-manager-row {
  margin-top: 8px;
}

.group-manager-name {
  font-weight: 600;
  color: #0f172a;
  overflow-wrap: anywhere;
}

.group-manager-meta {
  min-width: 96px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  background: #f1f5f9;
  border-radius: 999px;
  padding: 4px 10px;
  white-space: nowrap;
}

.group-manager-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.group-responsible-select,
.group-period-select {
  min-width: 132px;
  height: 34px;
  padding: 0 30px 0 10px;
  font-size: 13px;
  color: #0f172a;
  background-color: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.group-responsible-select:hover,
.group-period-select:hover {
  border-color: #94a3b8;
}

.group-responsible-select:focus,
.group-period-select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.group-responsible-select:disabled,
.group-period-select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Подсветка типа ответственного */
.group-responsible-select[value="warehouse"] {
  border-color: #f59e0b;
  color: #92400e;
  background-color: #fffbeb;
}

.group-responsible-select[value="seller"] {
  border-color: #cbd5e1;
  color: #0f172a;
  background-color: #fff;
}

@media (max-width: 720px) {
  .group-manager-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .group-manager-meta {
    justify-self: start;
  }

  .group-manager-controls {
    width: 100%;
  }

  .group-responsible-select,
  .group-period-select {
    flex: 1 1 140px;
    min-width: 0;
  }
}

.group-delete-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background-color: #fff;
  color: #dc2626;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.group-delete-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.group-delete-button:hover {
  background-color: #fef2f2;
  border-color: #fca5a5;
  color: #b91c1c;
}

.group-delete-button:focus-visible {
  outline: none;
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

.group-delete-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.group-responsible-select.is-warehouse {
  border-color: #f59e0b;
  color: #92400e;
  background-color: #fffbeb;
}

.group-responsible-select.is-seller {
  border-color: #cbd5e1;
  color: #0f172a;
  background-color: #fff;
}