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

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #8b5cf6;
    --secondary: #06b6d4;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --dark: #1e293b;
    --darker: #0f172a;
    --light: #f8fafc;
    --gray: #64748b;
    --gray-light: #e2e8f0;
    --border: #cbd5e1;
    --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--dark);
    line-height: 1.6;
    font-weight: 400;
}

/* Modern Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-light);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Container & Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Auth Styles */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-form {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: 40px;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 440px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.auth-form::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.auth-form h2 {
    text-align: center;
    margin-bottom: 32px;
    color: var(--darker);
    font-weight: 700;
    font-size: 28px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Form Elements */
.form-group {
    margin-bottom: 24px;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--dark);
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 16px;
    transition: var(--transition);
    background: white;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    transform: translateY(-1px);
}

/* Buttons */
.btn {
    padding: 14px 28px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.btn::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 0.5s;
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #34d399);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #f87171);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning), #fbbf24);
    color: white;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.4);
}

.btn-info {
    background: linear-gradient(135deg, var(--secondary), #22d3ee);
    color: white;
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.3);
}

.btn-info:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(6, 182, 212, 0.4);
}

/* Button Sizes */
.btn-sm {
    padding: 10px 20px;
    font-size: 14px;
}

.btn-xs {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 6px;
}

/* Dashboard Styles */
.dashboard-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 32px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.dashboard-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary), var(--success));
}

.dashboard-header h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.dashboard-header p {
    color: var(--gray);
    font-size: 16px;
    margin-bottom: 24px;
}

/* Navigation Tabs */
.nav-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 0;
    border-bottom: none;
    flex-wrap: wrap;
}

.nav-tab {
    padding: 14px 24px;
    background: rgba(255, 255, 255, 0.7);
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    color: var(--gray);
    transition: var(--transition);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(10px);
}

.nav-tab:hover {
    background: white;
    color: var(--primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.nav-tab.active {
    background: white;
    color: var(--primary);
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

/* Card Styles */
.card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 28px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: var(--transition);
}

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

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--gray-light);
}

.card-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--darker);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Table Styles */
.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius-sm);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.table th,
.table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--gray-light);
}

.table th {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table tr {
    transition: var(--transition);
}

.table tr:hover {
    background: rgba(99, 102, 241, 0.05);
    transform: scale(1.01);
}

/* Status Badges */
.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.badge-pending {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-approved {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-rejected {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Alert Styles */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    border-left: 4px solid;
    background: white;
    box-shadow: var(--shadow);
}

.alert-success {
    background: rgba(16, 185, 129, 0.05);
    border-left-color: var(--success);
    color: #065f46;
}

.alert-error {
    background: rgba(239, 68, 68, 0.05);
    border-left-color: var(--danger);
    color: #7f1d1d;
}

/* Grid System */
.row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 30px;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 32px;
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease;
    position: relative;
}

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

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

.close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    color: var(--gray);
    transition: var(--transition);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close:hover {
    background: var(--gray-light);
    color: var(--danger);
}

/* Search & Filters */
.search-controls {
    margin-bottom: 24px;
}

.search-form {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 16px;
    margin-bottom: 24px;
}

.search-input-group {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.search-input-group .form-control {
    flex: 1;
}

.search-filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Display Controls */
.display-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-sm);
    backdrop-filter: blur(10px);
}

.pagination-info, .total-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

.form-control-sm {
    padding: 8px 12px;
    font-size: 14px;
    height: auto;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.page-link {
    padding: 10px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--gray);
    transition: var(--transition);
    font-weight: 500;
}

.page-link:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
}

.page-link.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Checkbox & Radio Groups */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    padding: 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    background: white;
    gap: 12px;
}

.checkbox-label:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.02);
    transform: translateY(-1px);
}

.checkbox-label input[type="radio"] {
    margin: 0;
    transform: scale(1.2);
}

.checkbox-label input[type="radio"]:checked {
    accent-color: var(--primary);
}

/* Details Table */
.details-table {
    width: 100%;
    margin-top: 20px;
}

.details-table-inner {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background: white;
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.details-table-inner tr {
    border-bottom: 1px solid var(--gray-light);
    transition: var(--transition);
}

.details-table-inner tr:hover {
    background: rgba(99, 102, 241, 0.05);
}

.details-table-inner tr:last-child {
    border-bottom: none;
}

.detail-label {
    padding: 16px;
    font-weight: 600;
    color: var(--dark);
    width: 35%;
    vertical-align: top;
    background: rgba(99, 102, 241, 0.02);
}

.detail-value {
    padding: 16px;
    color: var(--gray);
    word-break: break-word;
    vertical-align: top;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.approval-buttons {
    display: flex;
    gap: 4px;
    margin-top: 4px;
}

/* Mobile Menu */
.mobile-menu-toggle {
    display: none;
    background: var(--primary);
    color: white;
    padding: 16px;
    text-align: center;
    font-size: 20px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    transition: var(--transition);
}

.mobile-menu-toggle:hover {
    background: var(--primary-dark);
}

/* No Results */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray);
}

.no-results p {
    margin: 12px 0;
    font-size: 16px;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 24px;
    border-radius: 16px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: var(--transition);
    border-left: 4px solid var(--primary);
}

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

.stat-number {
    font-size: 36px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
}

.stat-label {
    color: var(--gray);
    font-size: 14px;
    font-weight: 500;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .container {
        padding: 16px;
    }
    
    .dashboard-header {
        padding: 24px;
    }
    
    .search-form {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .auth-form {
        padding: 24px;
        margin: 20px;
    }
    
    .dashboard-header h1 {
        font-size: 24px;
    }
    
    .nav-tabs {
        flex-direction: column;
    }
    
    .nav-tab {
        justify-content: center;
        text-align: center;
    }
    
    .card {
        padding: 20px;
    }
    
    .card-header {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }
    
    .table {
        font-size: 14px;
    }
    
    .table th,
    .table td {
        padding: 12px 8px;
    }
    
    .search-filters {
        grid-template-columns: 1fr;
    }
    
    .display-controls {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .nav-tabs {
        display: none;
    }
    
    .nav-tabs.show {
        display: flex;
    }
    
    /* Hide less important columns on mobile */
    .table th:nth-child(4),
    .table td:nth-child(4),
    .table th:nth-child(5),
    .table td:nth-child(5),
    .table th:nth-child(8),
    .table td:nth-child(8) {
        display: none;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 4px;
    }
    
    .modal-content {
        margin: 10% auto;
        padding: 24px;
        width: 95%;
    }
}







@media (max-width: 480px) {
    .container {
        padding: 12px;
    }
    
    .auth-form {
        padding: 20px;
    }
    
    .dashboard-header {
        padding: 20px;
    }
    
    .card {
        padding: 16px;
    }
    
    .row {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .search-input-group {
        flex-direction: column;
    }
}

/* Touch device improvements */
@media (hover: none) and (pointer: coarse) {
    .btn, .nav-tab, .checkbox-label {
        min-height: 44px;
        min-width: 44px;
    }
    
    .table td {
        padding: 16px 12px;
    }
    
    .page-link {
        padding: 12px 16px;
    }
}

/* Loading animation */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

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

/* Focus states for accessibility */
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .nav-tabs,
    .btn:not(.btn-primary),
    .search-controls,
    .display-controls {
        display: none !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #000;
    }
}


@media (max-width: 768px) {
    /* === КОНТЕЙНЕР КНОПОК === */
    .action-buttons {
        display: flex;                /* Flex-контейнер */
        flex-direction: row;          /* Кнопки в строку */
        gap: 4px;                     /* Расстояние между кнопками */
        flex-wrap: nowrap;            /* Запрет переноса на новую строку */
    }
    /* !important не нужен если нет конфликтов */
    
    /* === ОБЩИЕ СТИЛИ КНОПОК === */
    .action-buttons .btn {
        padding: 8px 12px;            /* Внутренние отступы */
        min-height: 36px;             /* Минимальная высота */
        font-size: 12px;              /* Размер текста */
        display: inline-flex;         /* Flex для центрирования иконок */
        align-items: center;          /* Вертикальное центрирование */
        justify-content: center;      /* Горизонтальное центрирование */
    }
    
    /* === СКРЫТИЕ ТЕКСТА В КНОПКАХ === */
    .btn-text {
        display: none;                /* Скрываем текст */
    }
    
    /* === КНОПКИ БЕЗ ТЕКСТА (ТОЛЬКО ИКОНКИ) === */
    .action-buttons .btn:not(:has(.btn-text)) {
        width: 36px;                  /* Фиксированная ширина */
        height: 36px;                 /* Фиксированная высота */
        padding: 0;                   /* Убираем отступы */
        border-radius: 50%;           /* Круглые кнопки */
    }
    
    /* === ТАБЛИЦЫ НА МОБИЛЬНЫХ === */
    .table td:nth-child(8),
    .table th:nth-child(8) {
        display: table-cell;          /* Показываем колонку действий */
        width: 60px;                  /* Уменьшаем ширину (хватит для иконки) */
        min-width: 60px;              /* Минимальная ширина */
        max-width: 60px;              /* Максимальная ширина */
        text-align: center;           /* Центрируем содержимое */
    }
    
    /* === ОЧЕНЬ МАЛЕНЬКИЕ ЭКРАНЫ (< 480px) === */
    @media (max-width: 480px) {
        .action-buttons {
            flex-direction: column;   /* Вертикальное расположение */
            gap: 8px;                 /* Увеличиваем расстояние */
            align-items: stretch;     /* Растягиваем кнопки */
        }
        
        .action-buttons .btn {
            width: 100%;              /* Полная ширина */
            justify-content: flex-start; /* Выравниваем по левому краю */
            padding: 10px 15px;       /* Увеличиваем отступы для тапов */
        }
        
        /* Показываем текст на очень маленьких экранах для доступности */
        .btn-text {
            display: inline !important;
            margin-left: 8px;         /* Отступ от иконки */
        }
        
        /* Убираем круглую форму */
        .action-buttons .btn:not(:has(.btn-text)) {
            width: 100%;
            height: auto;
            padding: 10px 15px;
            border-radius: 8px;
            justify-content: flex-start;
        }
    }
    
    /* === КОМПАКТНЫЕ ВАРИАНТЫ КНОПОК === */
    /* Эти стили можно удалить если не используются */
    .btn-sm {
        padding: 6px 10px;
        font-size: 11px;
    }
    
    .btn-xs {
        padding: 4px 6px;
        font-size: 10px;
    }
}
