* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background: #f1f5f9;
}

.app {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: #0f172a;
    color: white;
    padding: 24px 16px;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 12px;
    margin-bottom: 40px;
}

.logo-icon {
    background: #2563eb;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.logo-text {
    font-weight: 700;
    font-size: 20px;
    line-height: 1.2;
}

.logo-text span {
    font-size: 13px;
    color: #94a3b8;
    font-weight: 400;
}

.nav-item {
    width: 100%;
    padding: 14px 18px;
    border-radius: 12px;
    color: #cbd5e1;
    background: none;
    border: none;
    text-align: left;
    font-size: 15px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    margin-bottom: 4px;
    transition: 0.2s;
}

.nav-item i {
    width: 24px;
    font-size: 1.2rem;
}

.nav-item:hover {
    background: #1e293b;
    color: white;
}

.nav-item.active {
    background: #2563eb;
    color: white;
}

/* Dropdown menu */
.nav-item.has-dropdown {
    position: relative;
}

.nav-item .arrow {
    margin-left: auto;
    transition: transform 0.3s;
}

.nav-item.open .arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    margin-left: 46px;
    margin-top: 4px;
    margin-bottom: 8px;
    display: none;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    width: 100%;
    padding: 12px 18px;
    border-radius: 10px;
    color: #cbd5e1;
    background: none;
    border: none;
    text-align: left;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    margin-bottom: 2px;
    transition: 0.2s;
}

.dropdown-item i {
    width: 20px;
    font-size: 1rem;
}

.dropdown-item:hover {
    background: #1e293b;
    color: white;
}

.dropdown-item.active {
    background: #2563eb;
    color: white;
}

.dropdown-item.voronezh i {
    color: #eb2525;
}

.dropdown-item.partsezda i {
    color: #8b5cf6;
}

.branch-badge {
    margin-left: auto;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 20px;
    background: rgba(255,255,255,0.1);
}

/* Main content */
.main {
    flex: 1;
    margin-left: 280px;
    padding: 24px 32px;
}

.top-bar {
    background: white;
    padding: 20px 28px;
    border-radius: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

.title h1 {
    font-size: 24px;
    color: #0f172a;
}

.title p {
    color: #64748b;
    font-size: 14px;
    margin-top: 4px;
}

.btn {
    padding: 12px 24px;
    border-radius: 40px;
    font-weight: 600;
    font-size: 14px;
    border: none;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: 0.2s;
}

.btn-primary {
    background: #2563eb;
    color: white;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-secondary {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #334155;
}

.btn-secondary:hover {
    background: #f1f5f9;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

/* Stats cards */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 22px;
    border-radius: 24px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #eef2f6;
}

.stat-info h3 {
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
}

.stat-info .value {
    font-size: 32px;
    font-weight: 700;
    color: #0f172a;
}

.stat-icon {
    width: 56px;
    height: 56px;
    background: #eef2ff;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2563eb;
    font-size: 24px;
}

/* Forms */
.form-container {
    background: white;
    padding: 32px;
    border-radius: 28px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    font-size: 14px;
    color: #334155;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 14px 18px;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    font-size: 15px;
    background: #f8fafc;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #2563eb;
    background: white;
}

/* Tables */
.table-container {
    background: white;
    border-radius: 24px;
    padding: 24px;
    margin-top: 24px;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 16px 12px;
    color: #64748b;
    font-weight: 500;
    font-size: 14px;
    border-bottom: 2px solid #eef2f6;
}

td {
    padding: 16px 12px;
    border-bottom: 1px solid #f1f5f9;
}

.badge {
    padding: 4px 12px;
    border-radius: 40px;
    font-size: 13px;
    font-weight: 600;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-warning {
    background: #fef9c3;
    color: #854d0e;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

/* Kanban board */
.board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-top: 20px;
}

.column {
    background: #f8fafc;
    border-radius: 24px;
    padding: 18px;
    border: 1px solid #eef2f6;
}

.column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    font-weight: 600;
}

.task-card {
    background: white;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid #eef2f6;
    cursor: pointer;
    transition: 0.2s;
}

.task-card:hover {
    box-shadow: 0 8px 16px rgba(0,0,0,0.05);
    transform: translateY(-2px);
}

/* Stock grid */
.stock-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.product-card {
    background: white;
    border-radius: 24px;
    padding: 22px;
}

.progress-bar {
    height: 10px;
    background: #e2e8f0;
    border-radius: 20px;
    margin: 12px 0;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #2563eb;
    border-radius: 20px;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 32px;
    border-radius: 32px;
    width: 90%;
    max-width: 500px;
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #22c55e;
    color: white;
    padding: 16px 24px;
    border-radius: 16px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    transform: translateX(400px);
    transition: 0.3s;
    z-index: 2000;
}

.notification.show {
    transform: translateX(0);
}

.notification.error {
    background: #ef4444;
}

/* Scheduler styles */
.scheduler-container {
    background: white;
    border-radius: 28px;
    padding: 28px;
    margin-bottom: 24px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.02);
}

.branch-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    color: white;
}

.branch-header.voronezh {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
}

.branch-header.partsezda {
    background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
}

.branch-icon {
    width: 50px;
    height: 50px;
    background: rgba(255,255,255,0.2);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.branch-info h2 {
    font-size: 24px;
    margin-bottom: 4px;
}

.branch-info p {
    opacity: 0.9;
    font-size: 14px;
}

.date-selector {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.date-selector input[type="date"] {
    padding: 14px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 20px;
    font-size: 16px;
    min-width: 200px;
}

.master-selector {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.master-chip {
    padding: 10px 20px;
    border-radius: 40px;
    background: #f1f5f9;
    border: 2px solid transparent;
    cursor: pointer;
    font-weight: 500;
    transition: 0.2s;
}

.master-chip:hover {
    background: #e2e8f0;
}

.master-chip.selected {
    background: #2563eb;
    color: white;
    border-color: #1d4ed8;
}

.time-slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
    margin-top: 20px;
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
}

.time-slot {
    padding: 14px 8px;
    text-align: center;
    border-radius: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    border: 2px solid transparent;
}

.time-slot.free {
    background: #dcfce7;
    color: #166534;
    border-color: #86efac;
}

.time-slot.free:hover {
    background: #bbf7d0;
    transform: scale(1.02);
}

.time-slot.busy {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fecaca;
    opacity: 0.7;
    cursor: not-allowed;
}

.time-slot.selected {
    background: #2563eb;
    color: white;
    border-color: #1e3a8a;
}

.legend {
    display: flex;
    gap: 24px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 8px;
}

.legend-color.free {
    background: #dcfce7;
    border: 2px solid #86efac;
}

.legend-color.busy {
    background: #fee2e2;
    border: 2px solid #fecaca;
}

.quick-actions {
    display: flex;
    gap: 12px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.time-slot-info {
    background: #f8fafc;
    border-radius: 20px;
    padding: 20px;
    margin-top: 20px;
}

.slot-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

/* Shift calendar styles */
.shift-calendar {
    background: white;
    border-radius: 28px;
    padding: 28px;
    margin-bottom: 24px;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-bottom: 20px;
}

.calendar-weekday {
    text-align: center;
    font-weight: 600;
    color: #64748b;
    padding: 12px;
    background: #f8fafc;
    border-radius: 12px;
}

.calendar-cell {
    min-height: 120px;
    background: #f8fafc;
    border-radius: 16px;
    padding: 12px;
    border: 2px solid transparent;
    transition: 0.2s;
}

.calendar-cell.today {
    border-color: #2563eb;
}

.calendar-cell.weekend {
    background: #fee2e2;
}

.calendar-cell .day-number {
    font-weight: 600;
    margin-bottom: 8px;
    color: #334155;
}

.shift-item {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 8px;
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    border-left: 3px solid #2563eb;
}

.shift-item.morning {
    border-left-color: #2563eb;
}

.shift-item.evening {
    border-left-color: #8b5cf6;
}

.add-shift-btn {
    width: 100%;
    padding: 8px;
    border-radius: 8px;
    border: 2px dashed #cbd5e1;
    background: none;
    color: #64748b;
    cursor: pointer;
    margin-top: 8px;
    font-size: 12px;
}

.add-shift-btn:hover {
    border-color: #2563eb;
    color: #2563eb;
}

.master-shift-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.shift-stat-card {
    background: #f8fafc;
    border-radius: 20px;
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.shift-stat-icon {
    width: 48px;
    height: 48px;
    background: white;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2563eb;
    font-size: 20px;
}

.shift-stat-info h4 {
    font-size: 14px;
    color: #64748b;
    font-weight: 500;
}

.shift-stat-info .shift-count {
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        width: 80px;
        padding: 24px 8px;
    }
    
    .logo-text,
    .nav-item span:not(.branch-badge),
    .dropdown-item span:not(.branch-badge) {
        display: none;
    }
    
    .nav-item i,
    .dropdown-item i {
        margin: 0 auto;
    }
    
    .main {
        margin-left: 80px;
    }
    
    .dropdown-menu {
        margin-left: 10px;
    }

    /* Client actions styles */
    .btn-icon {
        background: none;
        border: none;
        cursor: pointer;
        padding: 5px;
        margin: 0 5px;
        transition: transform 0.2s;
    }

    .btn-icon:hover {
        transform: scale(1.1);
    }

    .btn-icon i {
        font-size: 18px;
    }

    .edit-input {
        width: 100%;
        padding: 8px;
        border: 2px solid #e2e8f0;
        border-radius: 8px;
        font-size: 14px;
        transition: border-color 0.2s;
    }

    .edit-input:focus {
        outline: none;
        border-color: #2563eb;
    }

    #clientsTable td {
        vertical-align: middle;
        padding: 12px 8px;
    }

    #clientsTable .action-buttons,
    #clientsTable .edit-buttons {
        display: flex;
        gap: 5px;
        justify-content: flex-start;
    }

    #clientsTable tr {
        transition: opacity 0.3s;
    }

    /* Search input styles */
    #clientSearch {
        padding: 10px 18px;
        border-radius: 40px;
        border: 2px solid #e2e8f0;
        font-size: 14px;
        width: 250px;
        transition: border-color 0.2s;
    }

    #clientSearch:focus {
        outline: none;
        border-color: #2563eb;
    }

  
    /* Стили для отмененных заказов */
    .btn-danger {
        background: #ef4444;
        color: white;
        border: none;
        padding: 8px 16px;
        border-radius: 8px;
        font-weight: 500;
        cursor: pointer;
        transition: 0.2s;
    }

    .btn-danger:hover {
        background: #dc2626;
    }

    .task-card.cancelled {
        opacity: 0.7;
        background: #fef2f2;
        border-left: 4px solid #ef4444;
        position: relative;
    }

    .task-card.cancelled::before {
        content: '❌';
        position: absolute;
        top: 10px;
        right: 10px;
        font-size: 16px;
        opacity: 0.5;
    }

    /* Счетчик отмененных */
    #cancelledCount {
        background: #ef4444;
        color: white;
    }

    #filterCancelledCount {
        background: #ef4444;
        color: white;
    }
    /* Стили для drag & drop */
    .task-card[draggable="true"] {
        cursor: grab;
        user-select: none;
    }

    .task-card[draggable="true"]:active {
        cursor: grabbing;
    }

    .task-card.dragging {
        opacity: 0.5;
        transform: scale(0.95);
        box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    }

    .column.drag-over {
        background: #e0f2fe;
        border: 2px dashed #2563eb;
    }

    .column.drag-over .tasks-container {
        min-height: 200px;
    }

    /* Анимация при перетаскивании */
    @keyframes pulse {
        0% { transform: scale(1); }
        50% { transform: scale(1.02); }
        100% { transform: scale(1); }
    }

    .task-card[draggable="true"]:hover {
        animation: pulse 0.5s ease infinite;
    }

    /* Подсказка для перетаскивания */
    .drag-hint {
        font-size: 11px;
        color: #94a3b8;
        text-align: center;
        margin-top: 8px;
        padding-top: 6px;
        border-top: 1px dashed #e2e8f0;
    }

    /* Запрещаем перетаскивание для отмененных заказов */
    .task-card[data-status="cancelled"][draggable="true"] {
        cursor: not-allowed;
        opacity: 0.7;
    }

    .task-card[data-status="cancelled"][draggable="true"]:hover {
        animation: none;
    }
    /* Стили для множественного выбора */
    .time-slot.selected {
        background: #2563eb !important;
        color: white !important;
        border-color: #1d4ed8 !important;
        transform: scale(1.02);
        box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
        position: relative;
    }

    .time-slot.selected::after {
        content: '✓';
        position: absolute;
        top: 2px;
        right: 5px;
        font-size: 12px;
        font-weight: bold;
    }

    .time-slot.selected.free {
        background: #2563eb !important;
        color: white !important;
    }

    .time-slot.selected.free span {
        color: rgba(255, 255, 255, 0.9) !important;
    }

    /* Индикатор режима множественного выбора */
    .multi-select-active {
        background: #e0f2fe;
        border: 2px solid #2563eb;
        animation: pulse 1s infinite;
    }

    @keyframes pulse {
        0% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4); }
        70% { box-shadow: 0 0 0 10px rgba(37, 99, 235, 0); }
        100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
    }

    /* Подсказка для множественного выбора */
    .multi-select-hint {
        background: #e0f2fe;
        border-radius: 8px;
        padding: 8px;
        margin-top: 10px;
        text-align: center;
        color: #0369a1;
        font-size: 13px;
        border-left: 3px solid #2563eb;
    }

    /* Счетчик выбранных слотов */
    .selected-count-badge {
        background: #2563eb;
        color: white;
        padding: 4px 12px;
        border-radius: 20px;
        font-size: 13px;
        font-weight: 600;
    }

    /* Информация о выбранных слотах */
    .slots-info {
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-wrap: wrap;
        gap: 10px;
    }
    /* Стили для карточек филиалов на рабочем столе */
    .branch-slot-card {
        transition: all 0.2s;
        position: relative;
        overflow: hidden;
    }

    .branch-slot-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 20px rgba(0,0,0,0.05);
    }

    .branch-slot-card::after {
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        width: 0;
        height: 0;
        border-style: solid;
        border-width: 0 30px 30px 0;
        border-color: transparent rgba(37, 99, 235, 0.1) transparent transparent;
        opacity: 0;
        transition: opacity 0.2s;
    }

    .branch-slot-card:hover::after {
        opacity: 1;
    }

    /* Цветовые индикаторы для количества слотов */
    .branch-slot-card[data-status="critical"] {
        border-left-color: #ef4444 !important;
    }

    .branch-slot-card[data-status="low"] {
        border-left-color: #f59e0b !important;
    }

    .branch-slot-card[data-status="medium"] {
        border-left-color: #10b981 !important;
    }

    .branch-slot-card[data-status="high"] {
        border-left-color: #2563eb !important;
    }

    /* Анимация для счетчиков */
    @keyframes countPulse {
        0% { transform: scale(1); }
        50% { transform: scale(1.1); }
        100% { transform: scale(1); }
    }

    .slot-count.update {
        animation: countPulse 0.3s ease;
    }

    /* Стили для статуса "нет смен" */
    .branch-slot-card.no-masters {
        background: #fef2f2;
    }

    .branch-slot-card.no-masters .slot-status {
        color: #ef4444 !important;
    }

    .branch-slot-card.no-masters .slot-count {
        color: #ef4444 !important;
    }

    /* Дополнительные стили для карточек */
    .branch-slot-card .btn-secondary {
        background: #f8fafc;
        border: 1px solid #e2e8f0;
        transition: all 0.2s;
    }

    .branch-slot-card .btn-secondary:hover {
        background: #2563eb;
        color: white;
        border-color: #2563eb;
    }

    .branch-slot-card .btn-secondary:hover i {
        color: white;
    }

    /* Стили для эмодзи */
    .master-chip {
        font-size: 14px;
        display: inline-flex;
        align-items: center;
        gap: 5px;
    }

    .master-chip.selected {
        background: #2563eb;
        color: white;
    }

    .time-slot {
        font-family: 'Inter', sans-serif;
        position: relative;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .branch-slot-card .btn-secondary {
        font-size: 14px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 5px;
    }

    /* Убираем лишние иконки Font Awesome там где используем эмодзи */
    .btn-icon i.fas {
        display: none;
    }

    .btn-icon {
        font-size: 18px;
        padding: 5px;
        background: none;
        border: none;
        cursor: pointer;
        transition: transform 0.2s;
    }

    .btn-icon:hover {
        transform: scale(1.1);
    }

    /* Стили для кнопок с эмодзи */
    .btn-primary, .btn-secondary {
        display: inline-flex;
        align-items: center;
        gap: 8px;
    }

    /* Стили для ячеек таблицы */
    td span[style*="cursor: pointer"] {
        font-size: 18px;
        margin: 0 5px;
    }

    /* Анимация для счетчиков */
    @keyframes countPulse {
        0% { transform: scale(1); }
        50% { transform: scale(1.1); }
        100% { transform: scale(1); }
    }

    .slot-count.update {
        animation: countPulse 0.3s ease;
    }

    /* Стили для карточек филиалов */
    .branch-slot-card {
        transition: all 0.2s;
    }

    .branch-slot-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 20px rgba(0,0,0,0.05);
    }

    .branch-slot-card.no-masters {
        background: #fef2f2;
    }

    .branch-slot-card.no-masters .slot-status {
        color: #ef4444 !important;
    }

    /* Улучшенные стили для календаря смен */
    .calendar-cell {
        min-height: 130px;
        background: #f8fafc;
        border-radius: 16px;
        padding: 10px;
        border: 2px solid transparent;
        transition: 0.2s;
        display: flex;
        flex-direction: column;
    }

    .calendar-cell.empty {
        background: transparent;
        border: 2px dashed #e2e8f0;
        opacity: 0.5;
    }

    .calendar-cell.today {
        border-color: #2563eb;
        background: #eff6ff;
    }

    .calendar-cell.weekend {
        background: #fef2f2;
    }

    .calendar-cell .day-number {
        font-weight: 600;
        margin-bottom: 6px;
        color: #334155;
        font-size: 13px;
        text-align: center;
        background: rgba(0,0,0,0.02);
        padding: 2px;
        border-radius: 12px;
    }

    .calendar-cell .shifts-container {
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 6px;
        margin-bottom: 6px;
    }

    .calendar-cell .no-shifts {
        text-align: center;
        color: #cbd5e1;
        font-size: 12px;
        padding: 8px;
        font-style: italic;
    }

    .shift-item {
        font-size: 11px;
        padding: 6px;
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        background: white;
        border-left: 4px solid #2563eb;
        box-shadow: 0 2px 4px rgba(0,0,0,0.02);
        cursor: pointer;
        transition: all 0.2s;
    }

    .shift-item:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    }

    .shift-item .shift-content {
        display: flex;
        flex-direction: column;
        gap: 2px;
        flex: 1;
    }

    .shift-item .shift-master {
        font-weight: 600;
        font-size: 11px;
        color: #0f172a;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 70px;
    }

    .shift-item .shift-branch {
        font-size: 9px;
        color: #64748b;
        background: #f1f5f9;
        padding: 2px 4px;
        border-radius: 4px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 70px;
        display: inline-block;
    }

    .shift-item .shift-icons {
        font-size: 12px;
        min-width: 18px;
        text-align: center;
        margin-left: 4px;
    }

    .add-shift-btn {
        width: 100%;
        padding: 4px;
        border-radius: 8px;
        border: 1px dashed #cbd5e1;
        background: none;
        color: #64748b;
        cursor: pointer;
        margin-top: 4px;
        font-size: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 4px;
        transition: all 0.2s;
    }

    .add-shift-btn:hover {
        border-color: #2563eb;
        color: #2563eb;
        background: #f0f9ff;
    }

    .add-shift-btn i {
        font-size: 9px;
    }

    /* Статистика смен */
    .master-shift-stats {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 16px;
        margin-bottom: 24px;
    }

    .shift-stat-card {
        background: #f8fafc;
        border-radius: 20px;
        padding: 16px;
        display: flex;
        align-items: center;
        gap: 12px;
        transition: all 0.2s;
    }

    .shift-stat-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 16px rgba(0,0,0,0.05);
    }

    .shift-stat-icon {
        width: 48px;
        height: 48px;
        background: white;
        border-radius: 16px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #2563eb;
        font-size: 24px;
    }

    .shift-stat-info h4 {
        font-size: 13px;
        color: #64748b;
        font-weight: 500;
        margin-bottom: 4px;
    }

    .shift-stat-info .shift-count {
        font-size: 24px;
        font-weight: 700;
        color: #0f172a;
        line-height: 1;
    }

    /* Легенда */
    .shift-legend {
        display: flex;
        gap: 24px;
        margin-top: 20px;
        padding: 16px;
        background: #f8fafc;
        border-radius: 16px;
        flex-wrap: wrap;
    }

    .legend-item {
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 13px;
    }

    .legend-color {
        width: 20px;
        height: 20px;
        border-radius: 6px;
    }

    .legend-color.morning {
        background: #2563eb;
    }

    .legend-color.evening {
        background: #8b5cf6;
    }

    .legend-color.full {
        background: #cb2111;
    }

    /* Форма добавления смены */
    #shiftsPage .form-container {
        margin-top: 24px;
    }

    #shiftsPage .form-row {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 16px;
        align-items: end;
    }

    #shiftsPage .form-group {
        margin-bottom: 0;
    }

    #shiftsPage select,
    #shiftsPage input {
        width: 100%;
        padding: 12px 16px;
        border: 2px solid #e2e8f0;
        border-radius: 14px;
        font-size: 14px;
        background: #f8fafc;
        transition: all 0.2s;
    }

    #shiftsPage select:focus,
    #shiftsPage input:focus {
        outline: none;
        border-color: #2563eb;
        background: white;
    }

    #shiftsPage .btn-primary {
        padding: 12px 24px;
        border-radius: 40px;
        font-weight: 600;
        font-size: 14px;
        background: #2563eb;
        color: white;
        border: none;
        cursor: pointer;
        transition: all 0.2s;
        display: inline-flex;
        align-items: center;
        gap: 8px;
    }

    #shiftsPage .btn-primary:hover {
        background: #1d4ed8;
        transform: translateY(-2px);
        box-shadow: 0 8px 16px rgba(37, 99, 235, 0.2);
    }

    /* Стили для автоподстановки моделей */
    .autocomplete-suggestions {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        border: 2px solid #e2e8f0;
        border-radius: 12px;
        margin-top: 4px;
        max-height: 300px;
        overflow-y: auto;
        z-index: 1000;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    }

    .autocomplete-item {
        padding: 12px 16px;
        cursor: pointer;
        border-bottom: 1px solid #f1f5f9;
        transition: background-color 0.2s;
    }

    .autocomplete-item:last-child {
        border-bottom: none;
    }

    .autocomplete-item:hover {
        background-color: #f8fafc;
    }

    .autocomplete-item.selected {
        background-color: #eef2ff;
        border-left: 3px solid #2563eb;
    }

    /* Анимация появления */
    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .autocomplete-suggestions {
        animation: slideDown 0.2s ease-out;
    }

    /* Скроллбар для списка */
    .autocomplete-suggestions::-webkit-scrollbar {
        width: 8px;
    }

    .autocomplete-suggestions::-webkit-scrollbar-track {
        background: #f1f5f9;
        border-radius: 4px;
    }

    .autocomplete-suggestions::-webkit-scrollbar-thumb {
        background: #cbd5e1;
        border-radius: 4px;
    }

    .autocomplete-suggestions::-webkit-scrollbar-thumb:hover {
        background: #94a3b8;
    }

    /* Стили для калькулятора услуг */
    .service-card {
        transition: all 0.2s;
        cursor: pointer;
    }

    .service-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 16px rgba(0,0,0,0.05);
    }

    .service-card input[type="checkbox"] {
        width: 20px;
        height: 20px;
        cursor: pointer;
    }

    .service-card input[type="radio"] {
        width: 16px;
        height: 16px;
        cursor: pointer;
    }

    #priceCalculatorBlock {
        animation: slideDown 0.3s ease-out;
    }

    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    /* Стили для суммы */
    #totalPrice {
        transition: all 0.3s;
    }

    #totalPrice.update {
        animation: pricePulse 0.3s ease;
    }

    @keyframes pricePulse {
        0% { transform: scale(1); }
        50% { transform: scale(1.1); }
        100% { transform: scale(1); }
    }

    /* Стили для сетки услуг */
    .services-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 16px;
    }

    /* Компактные стили для страницы прайсов */
    #pricesPage .table-container {
        border-radius: 16px;
        overflow: hidden;
        box-shadow: 0 2px 8px rgba(0,0,0,0.02);
    }

    #pricesTable {
        width: 100%;
        border-collapse: collapse;
        font-size: 13px;
    }

    #pricesTable th {
        background: #f8fafc;
        padding: 12px 10px;
        font-weight: 600;
        color: #334155;
        border-bottom: 1px solid #e2e8f0;
        white-space: nowrap;
    }

    #pricesTable td {
        padding: 10px;
        border-bottom: 1px solid #f1f5f9;
        color: #0f172a;
    }

    #pricesTable tbody tr:hover td {
        background: #f8fafc;
    }

    #pricesTable td:not(:first-child):not(:nth-child(2)) {
        font-family: 'Courier New', monospace;
        font-weight: 500;
        color: #2563eb;
    }

    /* Компактные карточки статистики */
    #pricesPage .stat-card-compact {
        background: white;
        border-radius: 12px;
        padding: 12px 20px;
        display: flex;
        align-items: center;
        gap: 15px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.02);
        border: 1px solid #f1f5f9;
    }

    #pricesPage .stat-icon {
        width: 40px;
        height: 40px;
        border-radius: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 18px;
    }

    /* Убираем лишние отступы */
    #pricesPage h2 {
        margin: 0;
        font-size: 22px;
    }

    #pricesPage input, 
    #pricesPage select,
    #pricesPage button {
        font-size: 13px;
    }

    /* Упрощаем скроллбар */
    #pricesPage .table-container::-webkit-scrollbar {
        height: 6px;
    }

    #pricesPage .table-container::-webkit-scrollbar-track {
        background: #f1f5f9;
    }

    #pricesPage .table-container::-webkit-scrollbar-thumb {
        background: #cbd5e1;
        border-radius: 3px;
    }
}

/* ==================== СТИЛИ ДЛЯ ПРАЙСОВ ==================== */

/* Контейнер таблицы */
#pricesPage .table-container {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
    margin-top: 20px;
    background: white;
}

/* Сама таблица */
#pricesTable {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

/* Заголовки */
#pricesTable th {
    background: #f8fafc;
    padding: 14px 12px;
    font-weight: 600;
    color: #334155;
    border-bottom: 2px solid #e2e8f0;
    text-align: center;
}

#pricesTable th:first-child,
#pricesTable th:nth-child(2) {
    text-align: left;
    padding-left: 15px;
}

/* Ячейки */
#pricesTable td {
    padding: 12px 10px;
    border-bottom: 1px solid #f1f5f9;
    color: #0f172a;
}

#pricesTable td:first-child,
#pricesTable td:nth-child(2) {
    text-align: left;
    padding-left: 15px;
}

#pricesTable td:nth-child(3),
#pricesTable td:nth-child(4),
#pricesTable td:nth-child(5),
#pricesTable td:nth-child(6),
#pricesTable td:nth-child(7),
#pricesTable td:nth-child(8),
#pricesTable td:nth-child(9) {
    text-align: center;
    font-family: 'Courier New', monospace;
    font-weight: 500;
}

/* ===== ПРОСТОЕ ВЫДЕЛЕНИЕ СТРОК ===== */

/* Эффект при наведении */
#pricesTable tbody tr {
    cursor: pointer;
}

#pricesTable tbody tr:hover {
    background: #f1f5f9;
}

/* ВЫДЕЛЕННАЯ СТРОКА */
#pricesTable tbody tr.price-selected-row {
    background: #2563eb !important;
    color: white !important;
    border-left: 4px solid #1e40af !important;
}

/* Ячейки выделенной строки */
#pricesTable tbody tr.price-selected-row td {
    background: transparent !important;
    color: white !important;
}

#pricesTable tbody tr.price-selected-row td strong {
    color: white !important;
}

#pricesTable tbody tr.price-selected-row td:nth-child(3),
#pricesTable tbody tr.price-selected-row td:nth-child(4),
#pricesTable tbody tr.price-selected-row td:nth-child(5),
#pricesTable tbody tr.price-selected-row td:nth-child(6),
#pricesTable tbody tr.price-selected-row td:nth-child(7),
#pricesTable tbody tr.price-selected-row td:nth-child(8),
#pricesTable tbody tr.price-selected-row td:nth-child(9) {
    color: white !important;
    font-weight: 700;
}

/* Четные строки */
#pricesTable tbody tr:nth-child(even) {
    background-color: #fafbfc;
}

#pricesTable tbody tr.price-selected-row:nth-child(even) {
    background: #2563eb !important;
}

/* Скроллбар */
#pricesPage .table-container::-webkit-scrollbar {
    height: 8px;
    width: 8px;
}

#pricesPage .table-container::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

#pricesPage .table-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

#pricesPage .table-container::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}   

/* Улучшение для таблиц с записями */
#upcomingAppointments td,
#bookingsList td,
#dateBookingsList td {
    vertical-align: middle;
    white-space: nowrap;
}

#upcomingAppointments td:nth-child(5),
#bookingsList td:nth-child(5),
#dateBookingsList td:nth-child(5) {
    white-space: nowrap;
}

#upcomingAppointments .badge,
#bookingsList .badge,
#dateBookingsList .badge {
    display: inline-block;
    padding: 6px 12px;
    font-size: 13px;
    white-space: nowrap;
}
/* ==================== УЛУЧШЕННЫЙ РАБОЧИЙ СТОЛ ==================== */

/* Статистика */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 24px;
    border-radius: 24px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.02);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #f1f5f9;
    transition: all 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.05);
    border-color: #e2e8f0;
}

.stat-info h3 {
    color: #64748b;
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 8px;
    letter-spacing: 0.3px;
}

.stat-info .value {
    font-size: 36px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
}

.stat-icon {
    width: 60px;
    height: 60px;
    background: #eef2ff;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2563eb;
    font-size: 28px;
}

/* Карточки филиалов */
.branch-stat-card {
    background: white;
    border-radius: 24px;
    padding: 24px;
    border: 1px solid #f1f5f9;
    box-shadow: 0 4px 16px rgba(0,0,0,0.02);
    transition: all 0.2s;
}

.branch-stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.05);
    border-color: #e2e8f0;
}

.branch-stat-card .btn-secondary {
    transition: all 0.2s;
    font-weight: 600;
}

/* Таблица ближайших записей */
#upcomingAppointments {
    width: 100%;
    border-collapse: collapse;
}

#upcomingAppointments th {
    background: #f8fafc;
    padding: 16px 16px;
    font-size: 14px;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e2e8f0;
}

#upcomingAppointments td {
    padding: 16px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

#upcomingAppointments tbody tr {
    transition: all 0.2s;
}

#upcomingAppointments tbody tr:hover {
    background: #f8fafc;
}

/* Статусы заказов */
.status-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 40px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.status-new {
    background: #dbeafe;
    color: #2563eb;
}

.status-working {
    background: #fef3c7;
    color: #b45309;
}

.status-ready {
    background: #d1fae5;
    color: #047857;
}

.status-completed {
    background: #f3f4f6;
    color: #4b5563;
}

/* Филиалы */
.branch-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 40px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

.branch-voronezh {
    background: #e0e7ff;
    color: #2563eb;
}

.branch-partsezda {
    background: #ede9fe;
    color: #8b5cf6;
}

/* Адаптивность */
@media (max-width: 1200px) {
    .stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .stats {
        grid-template-columns: 1fr;
    }
    
    #upcomingAppointments {
        font-size: 13px;
    }
    
    #upcomingAppointments th,
    #upcomingAppointments td {
        padding: 12px 8px;
    }
}

/* Простые стили для калькулятора услуг */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.service-card {
    background: white;
    border-radius: 12px;
    padding: 12px;
    border: 2px solid #e2e8f0;
    transition: all 0.2s;
}

.service-card:hover {
    border-color: #2563eb;
}

.service-card input[type="radio"],
.service-card input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.service-card label {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    white-space: nowrap;
}

.service-card label span:last-child {
    margin-left: auto;
    color: #2563eb;
    font-size: 12px;
}

/* Стили для калькулятора услуг */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.service-card {
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.service-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.service-card input[type="radio"],
.service-card input[type="checkbox"] {
    accent-color: #2563eb;
}

.service-card label {
    transition: all 0.2s;
    cursor: pointer;
}

.service-card label:hover {
    background: #eef2ff !important;
}

/* Вертикальное расположение для задних дверей */
.service-card .vertical-layout {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.service-card .vertical-layout label {
    width: 100%;
}

/* Горизонтальное расположение для остальных */
.service-card .horizontal-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* Цена в виде бейджа */
.price-badge {
    background: #eef2ff;
    color: #2563eb;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
}

/* Общая стоимость */
.total-price-container {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 20px;
    padding: 15px 20px;
    background: #f8fafc;
    border-radius: 12px;
}

.total-price-label {
    font-size: 16px;
    color: #475569;
    margin-right: 15px;
}

.total-price-value {
    font-size: 24px;
    font-weight: 800;
    color: #2563eb;
    background: white;
    padding: 8px 25px;
    border-radius: 40px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

