@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&family=Manrope:wght@400;500;600;700;800&display=swap');

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

:root {
    /* Темная тема - мягкие тона для глаз */
    --bg-primary: #12141a;
    --bg-secondary: rgba(22, 25, 32, 0.95);
    --bg-tertiary: rgba(32, 36, 46, 0.8);
    --bg-card: rgba(26, 29, 38, 0.9);
    --bg-hover: rgba(38, 42, 54, 0.9);
    --bg-glass: rgba(255, 255, 255, 0.04);
    --text-primary: #e8eaed;
    --text-secondary: #9aa0ab;
    --text-muted: #656c78;
    --accent-primary: #7c7ff2;
    --accent-secondary: #9d8cf5;
    --accent-green: #34d399;
    --accent-red: #f87171;
    --accent-yellow: #fbbf24;
    --accent-orange: #fb923c;
    --accent-cyan: #22d3ee;
    /* Семантические цвета для бейджей */
    --success: #34d399;
    --warning: #fbbf24;
    --danger: #f87171;
    --info: #22d3ee;
    --primary: #7c7ff2;
    --border-color: rgba(255, 255, 255, 0.06);
    --border-light: rgba(255, 255, 255, 0.1);
    /* Улучшенные градиенты - более мягкие */
    --gradient-primary: linear-gradient(135deg, #7c7ff2 0%, #9d8cf5 100%);
    --gradient-success: linear-gradient(135deg, #34d399 0%, #10b981 100%);
    --gradient-danger: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
    --gradient-glass: linear-gradient(135deg, rgba(124, 127, 242, 0.08) 0%, rgba(157, 140, 245, 0.08) 100%);
    /* Современные тени - менее агрессивные */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.03);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.03);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.04);
    --shadow-glow: 0 0 25px rgba(124, 127, 242, 0.25), 0 0 50px rgba(157, 140, 245, 0.12);
    --shadow-glow-hover: 0 0 35px rgba(124, 127, 242, 0.35), 0 0 70px rgba(157, 140, 245, 0.18);
    /* Размеры */
    --sidebar-width: 280px;
    --sidebar-collapsed: 80px;
    --header-height: 72px;
    /* Плавные анимации */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    /* Скругления */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-2xl: 32px;
    /* Blur эффекты для glassmorphism */
    --blur-sm: blur(8px);
    --blur-md: blur(16px);
    --blur-lg: blur(24px);
}

/* ========== LIGHT THEME - Нейтральные мягкие тона ========== */
[data-theme="light"] {
    --bg-primary: #f5f6f8;
    --bg-secondary: #ffffff;
    --bg-tertiary: #ebedf0;
    --bg-card: #ffffff;
    --bg-hover: #f0f2f5;
    --bg-glass: rgba(0, 0, 0, 0.02);
    --text-primary: #1a1d23;
    --text-secondary: #5a6270;
    --text-muted: #8a919e;
    --border-color: #d8dbe3;
    --border-light: #e8eaef;
    --accent-primary: #4f52c4;
    --accent-secondary: #6c5dd3;
    /* Семантические цвета для бейджей в светлой теме - насыщенные */
    --success: #059669;
    --warning: #d97706;
    --danger: #dc2626;
    --info: #0891b2;
    --primary: #4f52c4;
    --gradient-primary: linear-gradient(135deg, #4f52c4 0%, #6c5dd3 100%);
    --gradient-glass: linear-gradient(135deg, rgba(79, 82, 196, 0.08) 0%, rgba(108, 93, 211, 0.08) 100%);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.08), 0 4px 10px rgba(0, 0, 0, 0.06);
    --shadow-glow: 0 0 20px rgba(79, 82, 196, 0.12);
    --shadow-glow-hover: 0 0 30px rgba(79, 82, 196, 0.2);
}

[data-theme="light"] body {
    background-image: 
        radial-gradient(ellipse at top left, rgba(79, 82, 196, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(108, 93, 211, 0.04) 0%, transparent 50%);
}

[data-theme="light"] body::before {
    background: 
        radial-gradient(circle at 20% 30%, rgba(79, 82, 196, 0.02) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(108, 93, 211, 0.02) 0%, transparent 50%);
}

[data-theme="light"] .sidebar {
    background: var(--bg-secondary);
    box-shadow: 2px 0 16px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .top-header {
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .stat-card,
[data-theme="light"] .table-container,
[data-theme="light"] .report-card,
[data-theme="light"] .report-filters {
    box-shadow: var(--shadow-md);
    border-color: var(--border-color);
}

[data-theme="light"] .filter-button.active,
[data-theme="light"] .selected-car-tag {
    background: var(--accent-primary) !important;
    color: white !important;
    border-color: var(--accent-primary) !important;
}

[data-theme="light"] .nav-item.active {
    background: rgba(79, 82, 196, 0.1);
    color: var(--accent-primary);
}

[data-theme="light"] .btn-primary {
    box-shadow: 0 4px 12px rgba(79, 82, 196, 0.25);
}

[data-theme="light"] .filter-group input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(0.4);
}

/* Tabs в светлой теме */
[data-theme="light"] .tabs-container .tab-btn {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

[data-theme="light"] .tabs-container .tab-btn.active {
    background: var(--accent-primary);
    color: white;
}

/* Модальные окна в светлой теме */
[data-theme="light"] .modal-content {
    background: var(--bg-card);
    border-color: var(--border-color);
}

[data-theme="light"] .modal-header {
    background: var(--bg-card);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 15px;
    background-image: 
        radial-gradient(ellipse 80% 50% at 0% 0%, rgba(124, 127, 242, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse 80% 50% at 100% 100%, rgba(157, 140, 245, 0.08) 0%, transparent 50%);
    background-attachment: fixed;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 30%, rgba(124, 127, 242, 0.02) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(157, 140, 245, 0.02) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

.app-container {
    display: flex;
    min-height: 100vh;
}

/* ========== SIDEBAR ========== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    backdrop-filter: var(--blur-md);
    -webkit-backdrop-filter: var(--blur-md);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 100;
    transition: width var(--transition-slow), transform var(--transition-slow);
    overflow: hidden;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.3);
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

.sidebar.collapsed .sidebar-header h1,
.sidebar.collapsed .sidebar-header p,
.sidebar.collapsed .nav-item span:not(.nav-icon),
.sidebar.collapsed .theme-toggle span:first-child {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.sidebar.collapsed .sidebar-header {
    padding: 20px 12px;
}

.sidebar.collapsed .nav-item {
    padding: 14px 0;
    justify-content: center;
    position: relative;
}

.sidebar.collapsed .nav-item::after {
    content: attr(title);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    margin-left: 10px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    z-index: 1000;
}

.sidebar.collapsed .nav-item:hover::after {
    opacity: 1;
    visibility: visible;
}

.sidebar.collapsed .nav-icon {
    margin-right: 0;
    font-size: 20px;
}

.sidebar.collapsed .nav-item.active {
    background: rgba(99, 102, 241, 0.2);
}

.sidebar.collapsed .nav-item.active .nav-icon {
    transform: scale(1.1);
}

.sidebar.collapsed .theme-toggle {
    justify-content: center;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: padding var(--transition-normal);
}

.sidebar-header h1 {
    font-size: 17px;
    font-weight: 800;
    margin-bottom: 4px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.3px;
    white-space: nowrap;
    transition: opacity var(--transition-normal), width var(--transition-normal);
}

.sidebar-header p {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    transition: opacity var(--transition-normal), width var(--transition-normal);
}

.sidebar-nav {
    flex: 1;
    padding: 12px 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    margin: 0 12px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition-fast);
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 13px;
    position: relative;
    overflow: hidden;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: var(--gradient-primary);
    border-radius: 0 2px 2px 0;
    transition: height var(--transition-fast);
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: rgba(99, 102, 241, 0.12);
    color: var(--accent-primary);
}

.nav-item.active::before {
    height: 60%;
}

.nav-icon {
    margin-right: 12px;
    font-size: 18px;
    transition: margin var(--transition-normal), font-size var(--transition-normal);
    flex-shrink: 0;
}

.nav-item span:not(.nav-icon) {
    white-space: nowrap;
    transition: opacity var(--transition-normal), width var(--transition-normal);
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
}

/* Toggle Button */
.sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin: 0 auto 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--text-secondary);
    font-size: 14px;
}

.sidebar-toggle:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--accent-primary);
}

.sidebar-toggle svg {
    width: 18px;
    height: 18px;
    transition: transform var(--transition-normal);
}

.sidebar.collapsed .sidebar-toggle svg {
    transform: rotate(180deg);
}

.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-secondary);
    gap: 10px;
}

.theme-toggle span:first-child {
    white-space: nowrap;
    transition: opacity var(--transition-normal), width var(--transition-normal);
}

.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-tertiary);
    transition: var(--transition-fast);
    border-radius: 24px;
    border: 1px solid var(--border-color);
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: var(--transition-fast);
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
}

input:checked + .slider {
    background: var(--gradient-primary);
    border-color: transparent;
}

input:checked + .slider:before {
    transform: translateX(20px);
}

/* ========== MAIN CONTENT ========== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    margin-left: var(--sidebar-width);
    transition: margin-left var(--transition-slow);
    min-height: 100vh;
}

.sidebar.collapsed ~ .main-content {
    margin-left: var(--sidebar-collapsed);
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 32px;
    height: var(--header-height);
    border-bottom: 1px solid var(--border-color);
    background: rgba(18, 18, 26, 0.85);
    backdrop-filter: var(--blur-lg);
    -webkit-backdrop-filter: var(--blur-lg);
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.2);
}

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
}

.breadcrumbs span:last-child {
    color: var(--text-primary);
    font-weight: 600;
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 13px;
    font-weight: 500;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--accent-red);
    color: var(--accent-red);
}

.content-area {
    flex: 1;
    padding: 28px;
    overflow-y: auto;
}

.content-area > h1 {
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 24px;
    letter-spacing: -0.5px;
}

/* Заголовок страницы с кнопкой действия */
.page-header-with-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 20px;
}

.page-header-with-action h1 {
    margin: 0;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.5px;
    flex: 1;
}

.page-header-with-action .btn-primary {
    flex-shrink: 0;
    white-space: nowrap;
}

/* ========== STATS ROW - Минималистичный стиль ========== */
.stats-row {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.stat-card {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
    font-size: 13px;
}

.stat-card:hover {
    background: var(--bg-hover);
    border-color: var(--primary-color);
}

.stat-card .stat-icon {
    font-size: 14px;
}

.stat-card .stat-info {
    display: flex;
    align-items: center;
    gap: 6px;
}

.stat-card .stat-value {
    font-weight: 700;
    font-size: 15px;
    color: var(--text-primary);
}

.stat-card .stat-label {
    font-size: 12px;
    color: var(--text-muted);
}

/* Убираем псевдоэлементы для минималистичного стиля */
.stat-card::before,
.stat-card::after {
    display: none;
}


/* ========== FILTERS ========== */
.filters-row {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-group select,
.filter-group input,
.search-input,
.filter-select {
    padding: 10px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 13px;
    min-width: 160px;
    font-family: inherit;
}

/* Стили для календаря */
.filter-group input[type="date"] {
    position: relative;
    cursor: pointer;
}

.filter-group input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    filter: invert(0.8);
    opacity: 0.8;
}

.filter-group input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

/* Темная тема для календаря */
[data-theme="dark"] .filter-group input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(0.9);
}

/* Светлая тема для календаря */
[data-theme="light"] .filter-group input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(0.3);
}

/* Кнопка очистки фильтра даты */
.date-filter-group {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: auto;
    flex-wrap: nowrap;
}

.date-label {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    font-weight: 500;
}

.date-filter-group input[type="date"] {
    min-width: 140px;
    padding: 10px 14px;
    padding-right: 14px;
}

.date-filter-group input[type="date"]:last-of-type {
    padding-right: 35px; /* Место для кнопки очистки */
}

.btn-clear-date {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg-hover);
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 16px;
    line-height: 1;
    padding: 0;
    transition: all var(--transition-fast);
    z-index: 10;
}

.btn-clear-date:hover {
    background: var(--accent-primary);
    color: var(--text-primary);
    transform: translateY(-50%) scale(1.1);
}
    transition: all var(--transition-fast);
}

.filter-group select:hover,
.filter-group input:hover,
.search-input:hover,
.filter-select:hover {
    border-color: var(--border-light);
}

.filter-group select:focus,
.filter-group input:focus,
.search-input:focus,
.filter-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.search-input {
    min-width: 260px;
}

/* ========== BUTTONS ========== */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    transition: all var(--transition-normal);
    margin-left: auto;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left var(--transition-slow);
}

.btn-primary:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: var(--shadow-glow-hover);
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:active {
    transform: translateY(0) scale(0.98);
}

.btn-secondary {
    padding: 12px 24px;
    background: var(--bg-tertiary);
    backdrop-filter: var(--blur-sm);
    -webkit-backdrop-filter: var(--blur-sm);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-danger {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: var(--gradient-danger);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    transition: all var(--transition-normal);
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    position: relative;
    overflow: hidden;
}

.btn-danger::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left var(--transition-slow);
}

.btn-danger:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.6), 0 0 60px rgba(220, 38, 38, 0.3);
}

.btn-danger:hover::before {
    left: 100%;
}

.btn-danger:active {
    transform: translateY(0) scale(0.98);
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    transition: all var(--transition-fast);
}

.btn-outline:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.08);
}

/* ========== DATA TABLE ========== */
.table-container {
    background: var(--bg-card);
    backdrop-filter: var(--blur-md);
    -webkit-backdrop-filter: var(--blur-md);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
}

.data-table,
.notifications-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}

.data-table th,
.data-table td {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.data-table thead,
.notifications-table thead {
    background: var(--gradient-glass);
    backdrop-filter: var(--blur-sm);
    -webkit-backdrop-filter: var(--blur-sm);
}

/* Унифицированные стили для всех ячеек таблицы - ОДИН РАЗ */
.data-table th,
.data-table td {
    padding: 12px 8px 12px 8px !important;
    box-sizing: border-box !important;
    vertical-align: middle !important;
    border: none !important;
}

/* Первая колонка - минимальный padding слева, как в разделе заявок */
.data-table th:first-child,
.data-table td:first-child {
    padding-left: 8px !important;
    min-width: 100px !important;
    width: auto !important;
}

/* Стили для заголовков */
.data-table th {
    text-align: left !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    color: var(--text-secondary) !important;
    letter-spacing: 1px !important;
    position: relative !important;
    border: none !important;
}

/* Стили для ячеек данных */
.data-table td {
    font-size: 14px !important;
    border: none !important;
}

/* Последняя колонка - без правой границы */
.data-table th:last-child,
.data-table td:last-child {
    border: none !important;
}

/* Последняя строка - граница снизу */
.data-table tbody tr:last-child td {
    border: none !important;
}

.data-table tbody tr {
    transition: all var(--transition-fast);
    position: relative;
}

.data-table tbody tr::before {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity var(--transition-fast);
    z-index: -1;
}

/* Первая колонка - без дополнительных стилей, использует общие */
.data-table thead th:first-child,
.data-table tbody td:first-child {
    /* Все стили наследуются от базовых правил выше */
}

/* Убеждаемся, что содержимое первой ячейки не нарушает выравнивание */
.data-table td.id-cell * {
    margin: 0 !important;
    padding: 0 !important;
    vertical-align: middle !important;
    display: inline !important;
}

/* Для первой ячейки в автопарке (без id-cell) - не применяем display: inline к strong */
.data-table tbody td:first-child strong {
    display: inline !important;
    margin: 0 !important;
    padding: 0 !important;
    vertical-align: middle !important;
}

/* Элементы внутри ячеек не должны нарушать выравнивание границ */
.data-table td .car-number,
.data-table td .vin-code {
    vertical-align: middle !important;
    display: inline-block;
}

/* Последняя колонка уже обработана выше */

/* Колонка действий - фиксированная ширина */
.actions-cell {
    width: auto;
    min-width: 100px;
    text-align: center;
    white-space: nowrap;
}

.media-cell {
    width: auto;
    min-width: 80px;
    text-align: center;
    white-space: nowrap;
}

.data-table tbody tr:hover {
    background: var(--bg-hover);
    transform: scale(1.001);
}

.data-table tbody tr:hover::before {
    opacity: 1;
}

/* Стили для ячейки с ID - ячейка использует общие стили */
.data-table td.id-cell {
    /* Все стили ячейки наследуются от .data-table td */
}

/* Стили для содержимого ячейки с ID (текст #123) */
.id-cell {
    color: var(--accent-primary);
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    margin: 0 !important;
    padding: 0 !important;
    display: inline-block;
    vertical-align: middle;
}

.car-number {
    font-family: 'JetBrains Mono', monospace;
    background: var(--bg-tertiary);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.5px;
}

/* ========== PAGINATION ========== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 20px;
    background: var(--bg-card);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.pagination-btn {
    padding: 10px 18px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.pagination-btn:hover:not(:disabled) {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    transform: translateY(-1px);
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--text-secondary);
}

.pagination-info span:first-child {
    font-weight: 600;
    color: var(--text-primary);
}

.pagination-total {
    font-size: 11px;
    color: var(--text-muted);
}

.pagination select {
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 12px;
    cursor: pointer;
}

.pagination select:hover {
    border-color: var(--accent-primary);
}

.problem-cell {
    max-width: 220px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-secondary);
}

/* ========== BADGES ========== */
.type-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.type-badge.electric {
    background: rgba(234, 179, 8, 0.15);
    color: var(--accent-yellow);
}

.type-badge.mechanic {
    background: rgba(6, 182, 212, 0.15);
    color: var(--accent-cyan);
}

/* Бейдж срочности */
.urgency-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.urgency-badge.urgent {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
    animation: pulse 2s infinite;
}

.urgency-badge.normal {
    background: rgba(34, 197, 94, 0.15);
    color: var(--accent-green);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.status-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.status-badge.status-active,
.status-badge.enabled {
    background: rgba(239, 68, 68, 0.12);
    color: var(--accent-red);
}

.status-badge.status-progress {
    background: rgba(234, 179, 8, 0.12);
    color: var(--accent-yellow);
}

.status-badge.status-fixed {
    background: rgba(34, 197, 94, 0.12);
    color: var(--accent-green);
}

.status-badge.status-in-progress {
    background: rgba(59, 130, 246, 0.12);
    color: var(--accent-primary);
}

.status-badge.status-cancelled {
    background: rgba(107, 114, 128, 0.12);
    color: var(--text-muted);
}

.status-badge.status-success {
    background: rgba(34, 197, 94, 0.12);
    color: var(--accent-green);
}

.status-badge.status-error {
    background: rgba(239, 68, 68, 0.12);
    color: var(--accent-red);
}

.status-badge.status-warning {
    background: rgba(234, 179, 8, 0.12);
    color: var(--accent-yellow);
}

.status-badge.status-info {
    background: rgba(59, 130, 246, 0.12);
    color: var(--accent-primary);
}

.status-badge.status-muted {
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

.status-badge.disabled {
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

/* ========== ACTION BUTTONS ========== */
.actions-cell {
    display: flex;
    gap: 6px;
}

.btn-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 14px;
    color: var(--text-primary);
}

.btn-icon:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
    transform: scale(1.05);
}

.btn-icon.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    border-color: #dc2626;
    color: #dc2626;
}

[data-theme="light"] .btn-icon.btn-danger {
    background: rgba(220, 38, 38, 0.12);
    border-color: #b91c1c;
    color: #b91c1c;
}

.btn-icon.btn-danger:hover {
    background: var(--accent-red);
    border-color: var(--accent-red);
    color: white;
}

.btn-icon svg {
    width: 16px;
    min-width: 16px;
    height: 16px;
    min-height: 16px;
    flex-shrink: 0;
    stroke: currentColor;
    display: block;
}

.btn-icon.btn-take {
    background: linear-gradient(135deg, var(--accent-green), #059669);
    border-color: var(--accent-green);
    color: white;
}

.btn-icon.btn-take:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.btn-icon.btn-take svg {
    stroke: white;
}

/* ========== КНОПКИ МЕДИА ========== */
.media-cell {
    white-space: nowrap;
}

.btn-media {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-right: 4px;
}

.btn-media:last-child {
    margin-right: 0;
}

.btn-media:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-media.btn-photo {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

.btn-media.btn-photo:hover {
    background: rgba(6, 182, 212, 0.15);
}

.btn-media.btn-video {
    border-color: var(--accent-secondary);
    color: var(--accent-secondary);
}

.btn-media.btn-video:hover {
    background: rgba(139, 92, 246, 0.15);
}

/* ========== МОДАЛЬНОЕ ОКНО ГАЛЕРЕИ ========== */
.modal-media {
    max-width: 900px;
    width: 95%;
}

.media-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
}

.media-item {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-tertiary);
    aspect-ratio: 16/9;
}

.media-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: transform var(--transition-fast);
}

.media-item img:hover {
    transform: scale(1.05);
}

.media-item video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

/* ========== СОРТИРОВКА ТАБЛИЦЫ ========== */
.sortable {
    cursor: pointer;
    user-select: none;
    transition: background var(--transition-fast);
}

.sortable:hover {
    background: var(--bg-hover);
}

.sort-icon {
    opacity: 0.5;
    font-size: 12px;
    margin-left: 4px;
    transition: opacity var(--transition-fast);
}

.sortable:hover .sort-icon {
    opacity: 1;
}

.sortable.sorted-asc .sort-icon::after,
.sortable.sorted-desc .sort-icon::after {
    opacity: 1;
}

.sortable.sorted-asc {
    background: rgba(99, 102, 241, 0.1);
}

.sortable.sorted-asc .sort-icon {
    opacity: 1;
    color: var(--accent-primary);
}

.sortable.sorted-desc {
    background: rgba(99, 102, 241, 0.1);
}

.sortable.sorted-desc .sort-icon {
    opacity: 1;
    color: var(--accent-primary);
}

.text-muted {
    color: var(--text-muted);
    font-size: 12px;
}

.text-small {
    font-size: 11px;
}

.text-nowrap {
    white-space: nowrap;
}

.empty-cell {
    text-align: center;
    color: var(--text-muted);
    padding: 24px !important;
}

/* ========== NOTIFICATION LOGS ========== */
.notification-logs-section {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--border-color);
}

.notification-stats-grid .stat-card {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
}

.notification-stats-grid .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}

.notification-stats-grid .stat-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ========== NOTIFICATIONS ========== */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.section-header h1 {
    margin: 0;
}

.section-header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
}

.notification-type {
    display: flex;
    align-items: center;
    gap: 12px;
}

.type-icon {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.type-icon.red { background: var(--accent-red); }
.type-icon.yellow { background: var(--accent-yellow); }
.type-icon.green { background: var(--accent-green); }
.type-icon.grey { background: var(--text-muted); }

.description {
    color: var(--text-secondary);
}

/* ========== MODAL ========== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(8px);
    animation: fadeIn 0.2s ease;
}

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

@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-content {
    width: 500px;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background: var(--bg-card);
    z-index: 10;
}

.modal-header h2 {
    font-size: 17px;
    font-weight: 700;
}

.close-btn,
.modal-close {
    width: 32px;
    height: 32px;
    background: var(--bg-tertiary);
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    line-height: 1;
}

.close-btn:hover,
.modal-close:hover {
    background: var(--accent-red);
    color: white;
}

.modal form {
    padding: 24px;
}

.modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    margin-top: 16px;
}

/* ========== FORMS ========== */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: all var(--transition-fast);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

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

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

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

/* ========== LOGIN PAGE ========== */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg-primary);
    background-image: 
        radial-gradient(ellipse at top left, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(139, 92, 246, 0.15) 0%, transparent 50%);
}

.login-box {
    width: 400px;
    padding: 40px;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
}

.login-box h1 {
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 8px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-box > p {
    color: var(--text-muted);
    margin-bottom: 32px;
    font-size: 14px;
}

.login-btn {
    width: 100%;
    padding: 14px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 2px 12px rgba(99, 102, 241, 0.3);
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

/* ========== REPORTS ========== */
.reports-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.report-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.report-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition-normal);
}

.report-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

.report-card:hover::after {
    transform: scaleX(1);
}

.report-icon {
    font-size: 32px;
    margin-bottom: 12px;
}

.report-card h3 {
    font-size: 15px;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 700;
}

.report-card p {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}

.report-preview {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-top: 20px;
}

.report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.report-actions {
    display: flex;
    gap: 12px;
}

/* ========== FLEET EXTRAS ========== */
.header-actions {
    display: flex;
    gap: 12px;
}

.vin-code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.stats-mini {
    display: flex;
    gap: 12px;
}

.stat-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border-radius: 20px;
    font-size: 12px;
    color: var(--text-secondary);
}

.stat-badge strong {
    color: var(--text-primary);
    font-weight: 700;
}

/* ========== BULK EDIT MODAL ========== */
.modal-wide {
    max-width: 800px;
    width: 90%;
}

.bulk-edit-table {
    max-height: 400px;
    overflow-y: auto;
    margin: 0 -24px;
    padding: 0 24px;
}

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

.bulk-edit-table th,
.bulk-edit-table td {
    padding: 12px 16px;
    text-align: left;
    border: none;
}

.bulk-edit-table th {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    position: sticky;
    top: 0;
    background: var(--bg-card);
    letter-spacing: 0.5px;
}

.bulk-edit-table input[type="number"] {
    width: 120px;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    font-family: 'JetBrains Mono', monospace;
}

.bulk-edit-table input[type="number"]:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.mileage-display {
    color: var(--text-muted);
    font-size: 13px;
    font-family: 'JetBrains Mono', monospace;
}

/* ========== TOAST NOTIFICATIONS ========== */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 300px;
    max-width: 400px;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100px);
    }
}

.toast.hiding {
    animation: slideOutRight 0.3s ease forwards;
}

.toast-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 2px;
}

.toast-message {
    font-size: 12px;
    color: var(--text-secondary);
}

.toast-close {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.toast-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.toast.toast-success {
    border-left: 3px solid var(--accent-green);
}

.toast.toast-error {
    border-left: 3px solid var(--accent-red);
}

.toast.toast-warning {
    border-left: 3px solid var(--accent-yellow);
}

.toast.toast-info {
    border-left: 3px solid var(--accent-primary);
}

/* ========== SKELETON LOADING ========== */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-tertiary) 0%,
        var(--bg-hover) 50%,
        var(--bg-tertiary) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

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

.skeleton-text {
    height: 14px;
    margin-bottom: 8px;
}

.skeleton-text:last-child {
    margin-bottom: 0;
    width: 70%;
}

.skeleton-card {
    height: 100px;
    border-radius: var(--radius-lg);
}

.skeleton-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

/* ========== EMPTY STATE ========== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.empty-state-text {
    font-size: 14px;
    color: var(--text-muted);
    max-width: 300px;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1200px) {
    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .reports-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    :root {
        --sidebar-width: 100%;
        --sidebar-collapsed: 0px;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: fixed;
        bottom: 0;
        top: auto;
        flex-direction: row;
        border-right: none;
        border-top: 1px solid var(--border-color);
        z-index: 100;
    }
    
    .sidebar.collapsed {
        width: 100%;
        transform: translateY(100%);
    }
    
    .sidebar-header,
    .sidebar-footer {
        display: none;
    }
    
    .sidebar-nav {
        display: flex;
        flex-direction: row;
        padding: 0;
        width: 100%;
        gap: 0;
    }
    
    .nav-item {
        flex: 1;
        flex-direction: column;
        padding: 12px 8px;
        margin: 0;
        border-radius: 0;
        text-align: center;
        font-size: 10px;
        gap: 4px;
    }
    
    .nav-item::before {
        display: none;
    }
    
    .nav-item.active {
        background: rgba(99, 102, 241, 0.15);
    }
    
    .nav-icon {
        margin: 0;
        font-size: 20px;
    }
    
    .main-content {
        margin-left: 0;
        padding-bottom: 80px;
    }
    
    .sidebar.collapsed ~ .main-content {
        margin-left: 0;
    }
    
    .stats-row {
        grid-template-columns: 1fr;
    }
    
    .reports-grid {
        grid-template-columns: 1fr;
    }
    
    .filters-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-input,
    .filter-select {
        min-width: 100%;
    }
    
    .btn-primary {
        margin-left: 0;
        justify-content: center;
        width: 100%;
    }
    
    .header-actions {
        flex-wrap: wrap;
    }
    
    .content-area {
        padding: 20px 16px;
    }
    
    .toast-container {
        left: 16px;
        right: 16px;
        bottom: 90px;
    }
    
    .toast {
        min-width: auto;
        max-width: none;
    }
}

/* ========== MODERN ANIMATIONS ========== */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

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

@keyframes glow {
    0%, 100% { box-shadow: 0 0 20px rgba(99, 102, 241, 0.4); }
    50% { box-shadow: 0 0 40px rgba(99, 102, 241, 0.8), 0 0 60px rgba(139, 92, 246, 0.4); }
}

@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

.animate-glow {
    animation: glow 2s ease-in-out infinite;
}

/* Focus visible for accessibility */
:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* ========== MODERN SCROLLBAR ========== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 10px;
    margin: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 10px;
    border: 2px solid var(--bg-tertiary);
    transition: all var(--transition-fast);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--accent-secondary), var(--accent-primary));
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--accent-primary) var(--bg-tertiary);
}

/* ========== SORTABLE TABLE HEADERS ========== */
th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background var(--transition-fast);
}

th.sortable:hover {
    background: var(--bg-hover);
}

th.sortable .sort-icon {
    opacity: 0.4;
    font-size: 12px;
    margin-left: 4px;
}

th.sortable:hover .sort-icon {
    opacity: 0.7;
}

th.sorted-asc .sort-icon::after,
th.sorted-desc .sort-icon::after {
    opacity: 1;
}

th.sorted-asc .sort-icon {
    opacity: 1;
}

th.sorted-asc .sort-icon::after {
    content: '↑';
}

th.sorted-desc .sort-icon {
    opacity: 1;
}

th.sorted-desc .sort-icon::after {
    content: '↓';
}

/* ========== ROLE BADGES ========== */
.role-badge {
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.role-admin {
    background: linear-gradient(135deg, rgba(234, 179, 8, 0.2), rgba(234, 179, 8, 0.1));
    color: #fbbf24;
    border: 1px solid rgba(234, 179, 8, 0.3);
}

.role-driver {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(34, 197, 94, 0.1));
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.role-mechanic {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(99, 102, 241, 0.1));
    color: #818cf8;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.role-accountant {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.2), rgba(6, 182, 212, 0.1));
    color: #06b6d4;
    border: 1px solid rgba(6, 182, 212, 0.3);
}

/* ========== STATUS BADGES ========== */
.status-badge {
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
}

.status-active {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.status-inactive {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

/* ========== FORM IMPROVEMENTS ========== */
.required {
    color: var(--accent-red);
}

.form-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-primary);
}

/* ========== INPUT STATES ========== */
.input-error {
    border-color: var(--accent-red) !important;
    background: rgba(239, 68, 68, 0.1) !important;
}

.row-error {
    background: rgba(239, 68, 68, 0.05) !important;
}

.row-inactive {
    opacity: 0.6;
}

.error-text {
    color: var(--accent-red);
    font-size: 12px;
    font-weight: 500;
}

.success-text {
    color: var(--accent-green);
    font-size: 12px;
    font-weight: 500;
}

.text-success {
    color: var(--accent-green);
}

.text-error {
    color: var(--accent-red);
}

/* ========== MILEAGE VALUE ========== */
.mileage-value {
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
}

.mileage-value:hover {
    background: var(--bg-hover);
}

.mileage-value small {
    opacity: 0.5;
    margin-left: 4px;
}

.mileage-value:hover small {
    opacity: 1;
}

/* ========== CAR INFO HEADER ========== */
.car-info-header {
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.car-info-header .current-mileage {
    color: var(--text-secondary);
    font-size: 13px;
}

/* ========== MODAL IMPROVEMENTS ========== */
.modal-hint {
    color: var(--accent-yellow);
    font-size: 13px;
    padding: 8px 12px;
    background: rgba(234, 179, 8, 0.1);
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
}

.errors-list {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    margin-top: 16px;
    color: var(--accent-red);
}

.errors-list ul {
    margin: 8px 0 0 20px;
}

.loading-cell, .error-cell {
    text-align: center;
    padding: 20px !important;
    color: var(--text-secondary);
}

.empty-state-mini {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
}

/* ========== ALERT ========== */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.alert-info {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: var(--text-primary);
}

.alert-warning {
    background: rgba(234, 179, 8, 0.1);
    border: 1px solid rgba(234, 179, 8, 0.3);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* ========== USER INFO IN HEADER ========== */
.user-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-info > span {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ========== TABS CONTAINER ========== */
.tabs-container {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 12px 24px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
}

.tab-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--accent-primary);
}

.tab-btn.active {
    background: var(--gradient-primary);
    color: #1a1a2e;
    font-weight: 600;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(124, 127, 242, 0.3);
}

/* Тёмная тема - белый текст на кнопках */
[data-theme="dark"] .tab-btn.active,
:root:not([data-theme="light"]) .tab-btn.active {
    color: #ffffff;
}

/* Светлая тема - тёмный текст на кнопках */
[data-theme="light"] .tab-btn.active {
    color: #1a1a2e;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ========== LOGIN PAGE ENHANCEMENTS ========== */
.login-container {
    position: relative;
}

.login-theme-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.login-theme-toggle:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.login-form-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.login-form-icon svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
}

/* ========== ADMIN PANEL SECTION ========== */
.admin-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 24px;
}

.admin-tool-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all var(--transition-fast);
}

.admin-tool-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.admin-tool-card h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.admin-tool-card p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.5;
}

.admin-tool-card .btn-tool {
    width: 100%;
    padding: 10px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.admin-tool-card .btn-tool:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.admin-tool-card .btn-tool.btn-danger:hover {
    background: var(--accent-red);
    border-color: var(--accent-red);
}

/* ========== ASSIGNED MECHANIC BADGE ========== */
.assigned-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(124, 127, 242, 0.12);
    color: var(--accent-primary);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.unassigned-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--bg-tertiary);
    color: var(--text-muted);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
}

/* ========== STATUS CANCELLED ========== */
.status-badge.status-cancelled {
    background: rgba(156, 163, 175, 0.12);
    color: #9ca3af;
}

/* ========== MECHANIC FILTER ========== */
.mechanic-filter-group {
    min-width: 180px;
}

/* ========== IMPROVEMENTS FOR REPORTS ========== */
[data-theme="light"] .filter-button {
    background: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="light"] .filter-button:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-primary);
}

[data-theme="light"] .cars-dropdown {
    background: var(--bg-secondary);
    border-color: var(--border-color);
    box-shadow: var(--shadow-lg);
}

[data-theme="light"] .cars-dropdown-item:hover {
    background: var(--bg-hover);
}

/* ========== BTN TAKE REQUEST ========== */
.btn-take {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-take:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow);
}

.btn-take:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}
