/* 🎯 БАЗОВЫЕ СТИЛИ С АКТИВНЫМ РЕДИЗАЙНОМ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
    color: #111827;
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
    font-size: 14px;
}

.container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 🔥 ШАПКА - МИНИМАЛИСТИЧНАЯ И АГРЕССИВНАЯ */
.header {
    background: linear-gradient(135deg, #000000 0%, #1a1a1a 100%);
    color: white;
    padding: 14px 0;
    margin-bottom: 28px;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 3px solid #dc2626;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #ff0000, #00ff00, #0000ff);
    animation: rgbScan 4s infinite linear;
}

@keyframes rgbScan {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.logo h1 {
    font-size: 18px;
    font-weight: 900;
    letter-spacing: 0.5px;
    background: linear-gradient(45deg, #ffffff, #dc2626);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 2px;
}

.logo p {
    font-size: 11px;
    color: #9ca3af;
    font-weight: 500;
    letter-spacing: 0.4px;
}

.phone {
    font-size: 13px;
    font-weight: 800;
    background: rgba(220, 38, 38, 0.2);
    padding: 6px 14px;
    border-radius: 6px;
    border: 1px solid rgba(220, 38, 38, 0.4);
    transition: all 0.2s ease;
}

.phone:hover {
    background: rgba(220, 38, 38, 0.3);
    transform: translateY(-1px);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 14px;
}

.logout {
    color: white;
    text-decoration: none;
    padding: 6px 14px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    font-weight: 600;
    font-size: 12px;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.1);
}

.logout:hover {
    background: #dc2626;
    border-color: #dc2626;
    transform: translateY(-1px);
}

/* 📊 СТАТИСТИКА - КОМПАКТНЫЕ КАРТОЧКИ */
.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 28px;
}

.stat-card {
    background: white;
    padding: 18px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border: 2px solid #e5e7eb;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #dc2626, #3b82f6, #10b981);
}

.stat-card:hover {
    transform: translateY(-3px);
    border-color: #dc2626;
    box-shadow: 0 8px 28px rgba(220, 38, 38, 0.12);
}

.stat-number {
    font-size: 24px;
    font-weight: 900;
    color: #dc2626;
    margin-bottom: 6px;
    font-family: 'SF Mono', monospace;
}

.stat-label {
    font-size: 12px;
    color: #6b7280;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

/* 🎮 УПРАВЛЕНИЕ - ИКОНОЧНЫЕ КНОПКИ */
.controls {
    background: white;
    padding: 18px;
    border-radius: 10px;
    margin-bottom: 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 2px solid #e5e7eb;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #f3f4f6;
    color: #374151;
    text-decoration: none;
    border-radius: 6px;
    border: 2px solid #d1d5db;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn i {
    font-size: 13px;
}

.btn:hover {
    background: #e5e7eb;
    transform: translateY(-2px);
    border-color: #9ca3af;
}

.btn-primary {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 10px rgba(220, 38, 38, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(220, 38, 38, 0.4);
}

.btn.active {
    background: #dc2626;
    color: white;
    border-color: #dc2626;
}

.status-filters {
    display: flex;
    gap: 10px;
}

/* 🔍 ПОИСК - МИНИМАЛИСТИЧНЫЙ */
.search-box {
    margin-bottom: 22px;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 12px 18px 12px 42px;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 13px;
    color: #111827;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
}

.search-box input:focus {
    outline: none;
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.search-box::before {
    content: '⌕';
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #dc2626;
    font-size: 15px;
    font-weight: 900;
}

/* 📋 ТАБЛИЦА - УЛЬТРАКОМПАКТНАЯ */
.table-container {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 28px;
    border: 2px solid #e5e7eb;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
}

thead {
    background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
    position: sticky;
    top: 0;
}

th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 700;
    color: white;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-bottom: 2px solid #dc2626;
    white-space: nowrap;
}

td {
    padding: 12px 14px;
    border-bottom: 1px solid #f3f4f6;
    color: #374151;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

tbody tr {
    transition: all 0.2s ease;
}

tbody tr:hover {
    background: #fef2f2;
}

tbody tr:nth-child(even) {
    background: #fafafa;
}

tbody tr:nth-child(even):hover {
    background: #fef2f2;
}

/* 🏷️ СТАТУСЫ - МИНИ БЕЙДЖИ */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    border-radius: 16px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    transition: all 0.2s ease;
}

.status-badge::before {
    content: '●';
    font-size: 6px;
}

.status-принят {
    background: rgba(254, 226, 226, 0.3);
    color: #991b1b;
    border: 1px solid #fca5a5;
}
/* Синее мигание для информации */
.blinking-blue {
    animation: blinkBlue 1.5s infinite;
    color: #fff;
    background: linear-gradient(45deg, #0066cc, #3399ff);
    padding: 5px 15px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 102, 204, 0.5);
}
/* Анимации */
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}
@keyframes blinkBlue {
    0%, 100% { 
        opacity: 1;
        box-shadow: 0 0 10px rgba(0, 102, 204, 0.5);
    }
    50% { 
        opacity: 0.7;
        box-shadow: 0 0 20px rgba(0, 102, 204, 0.8);
    }
}
.status-в работе {
    background: rgba(254, 243, 199, 0.3);
    color: #92400e;
    border: 1px solid #fbbf24;
}

.status-готов {
    background: rgba(220, 252, 231, 0.3);
    color: #166534;
    border: 1px solid #34d399;
}

.status-без ремонта {
    background: rgba(220, 252, 231, 0.3);
    color: #810931;
    border: 1px solid #741111;
}

.status-выдан {
    background: rgba(224, 231, 255, 0.3);
    color: #3730a3;
    border: 1px solid #818cf8;
}

.status-badge:hover {
    transform: scale(1.04);
}

/* ⚡ ДЕЙСТВИЯ - ИКОНОЧНЫЕ */
.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-right: 8px;
    font-size: 14px;
}

.edit {
    background: #3b82f6;
    color: white;
}

.edit:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.print {
    background: #10b981;
    color: white;
}

.print:hover {
    background: #059669;
    transform: translateY(-1px);
}

/* 📄 ПАГИНАЦИЯ */
.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 22px;
}

.pagination a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 10px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    text-decoration: none;
    color: #6b7280;
    font-weight: 600;
    font-size: 12px;
    transition: all 0.2s ease;
}

.pagination a:hover {
    border-color: #dc2626;
    color: #dc2626;
    transform: translateY(-1px);
}

.pagination a.active {
    background: #dc2626;
    color: white;
    border-color: #dc2626;
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.3);
}

/* 📝 ФОРМА - КОМПАКТНАЯ */
.order-form {
    background: white;
    padding: 28px;
    border-radius: 12px;
    box-shadow: 0 6px 28px rgba(0, 0, 0, 0.1);
    border: 2px solid #e5e7eb;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
    margin-bottom: 18px;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #374151;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 13px;
    color: #111827;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 22px;
}

/* 💬 УВЕДОМЛЕНИЯ */
.alert {
    padding: 14px 18px;
    margin-bottom: 18px;
    border-radius: 8px;
    border-left: 4px solid;
    font-size: 12px;
    font-weight: 500;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert.success {
    background: #f0fdf4;
    color: #166534;
    border-color: #10b981;
}

.alert.error {
    background: #fef2f2;
    color: #991b1b;
    border-color: #ef4444;
}

/* 🏢 ФИЛИАЛЫ - СЕТКА */
.branch-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
    margin-bottom: 28px;
}

.branch-stat-card {
    background: white;
    padding: 18px;
    border-radius: 10px;
    border: 2px solid #e5e7eb;
    transition: all 0.3s ease;
}

.branch-stat-card:hover {
    border-color: #dc2626;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.branch-name {
    font-size: 14px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 10px;
}

.branch-total {
    display: inline-block;
    background: #dc2626;
    color: white;
    padding: 5px 10px;
    border-radius: 16px;
    font-size: 11px;
    font-weight: 700;
}

.branch-status-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 14px;
}

.branch-status-item {
    font-size: 11px;
    color: #6b7280;
}

.branch-status-count {
    font-weight: 700;
    color: #111827;
    font-size: 13px;
}

/* 📱 АДАПТИВНОСТЬ */
@media (max-width: 1024px) {
    .stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        text-align: center;
        gap: 14px;
    }
    
    .stats {
        grid-template-columns: 1fr;
    }
    
    .controls {
        flex-direction: column;
        gap: 14px;
    }
    
    .status-filters {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .branch-stats {
        grid-template-columns: 1fr;
    }
    
    table {
        font-size: 12px;
    }
    
    th, td {
        padding: 10px 12px;
    }
    
    .container {
        padding: 0 16px;
    }
}

/* 🎨 УЛУЧШЕНИЯ ДИЗАЙНА */

/* 1. Градиентные заголовки */
.section-title {
    font-size: 16px;
    font-weight: 800;
    margin-bottom: 18px;
    color: #111827;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 35px;
    height: 3px;
    background: linear-gradient(90deg, #dc2626, #3b82f6);
    border-radius: 2px;
}

/* 2. Карточки с аккордеон-эффектом */
.accordion-card {
    background: white;
    border-radius: 10px;
    border: 2px solid #e5e7eb;
    overflow: hidden;
    transition: all 0.3s ease;
}

.accordion-header {
    padding: 14px 18px;
    background: #f9fafb;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: #111827;
    font-size: 13px;
}

.accordion-content {
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.accordion-card.active .accordion-content {
    padding: 18px;
    max-height: 400px;
}

/* 3. Прогресс-бары */
.progress-bar {
    height: 5px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
    margin: 6px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #dc2626, #ef4444);
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* 4. Тогглы */
.toggle {
    position: relative;
    width: 40px;
    height: 22px;
    background: #d1d5db;
    border-radius: 11px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.toggle::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.toggle.active {
    background: #dc2626;
}

.toggle.active::before {
    transform: translateX(18px);
}

/* 5. Ховер-эффекты для изображений */
.img-hover {
    position: relative;
    overflow: hidden;
    border-radius: 6px;
}

.img-hover img {
    transition: transform 0.4s ease;
}

.img-hover:hover img {
    transform: scale(1.04);
}

.img-hover::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.25), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.img-hover:hover::after {
    opacity: 1;
}

/* 6. Анимированные иконки */
.icon-animate {
    transition: all 0.3s ease;
    font-size: 16px;
}

.icon-animate:hover {
    transform: rotate(12deg) scale(1.15);
    color: #dc2626;
}

/* 7. Стеклянный эффект */
.glass-effect {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.1);
}

/* 8. Таймлайн */
.timeline {
    position: relative;
    padding-left: 24px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e5e7eb;
}

.timeline-item {
    position: relative;
    margin-bottom: 16px;
    font-size: 13px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -24px;
    top: 6px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #dc2626;
    border: 2px solid white;
    box-shadow: 0 0 0 2px #fef2f2;
}

/* 9. Кастомный скроллбар */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, #dc2626, #ef4444);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(45deg, #ef4444, #dc2626);
}

/* 10. Тени разной интенсивности */
.shadow-sm { box-shadow: 0 1px 2px rgba(0,0,0,0.1); }
.shadow-md { box-shadow: 0 3px 16px rgba(0,0,0,0.08); }
.shadow-lg { box-shadow: 0 8px 32px rgba(0,0,0,0.12); }
.shadow-xl { box-shadow: 0 16px 48px rgba(0,0,0,0.16); }

/* 11. Градиентные бордеры */
.border-gradient {
    border: 2px solid transparent;
    background: linear-gradient(white, white) padding-box,
                linear-gradient(45deg, #dc2626, #3b82f6) border-box;
}

/* 12. Скелетон-загрузка */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 4px;
}

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

/* 13. Плавающие элементы */
.float-animation {
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* 14. Микроинтеракции */
.hover-lift {
    transition: transform 0.2s ease;
}

.hover-lift:hover {
    transform: translateY(-2px);
}

.hover-shadow {
    transition: box-shadow 0.2s ease;
}

.hover-shadow:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

/* 15. Акцентные кнопки */
.btn-gradient {
    background: linear-gradient(135deg, #dc2626 0%, #3b82f6 100%);
    color: white;
    border: none;
    font-size: 12px;
    padding: 8px 16px;
}

.btn-gradient:hover {
    background: linear-gradient(135deg, #b91c1c 0%, #2563eb 100%);
    transform: translateY(-2px);
}

/* 16. Цветные плашки */
.chip {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 16px;
    font-size: 10px;
    font-weight: 600;
    background: #f3f4f6;
    color: #6b7280;
    margin: 2px;
}

.chip-primary { background: #fef2f2; color: #dc2626; }
.chip-success { background: #f0fdf4; color: #10b981; }
.chip-warning { background: #fef3c7; color: #f59e0b; }
.chip-info { background: #eff6ff; color: #3b82f6; }

/* 17. Сетка карточек */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
}

/* 18. Аватарки */
.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #e5e7eb;
}

.avatar-sm { width: 28px; height: 28px; }
.avatar-lg { width: 48px; height: 48px; }
.avatar-xl { width: 64px; height: 64px; }

/* 19. Бейджи с числами */
.badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: #dc2626;
    color: white;
    border-radius: 9px;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

/* 20. Анимированный фон */
.animated-bg {
    background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}