/* ==========================================
   🎨 ГЛОБАЛЬНЫЕ ПЕРЕМЕННЫЕ (ЦВЕТОВАЯ ПАЛИТРА)
   ========================================== */

:root {
    /* Шрифты */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-heading: 'Orbitron', 'Inter', sans-serif;
    
    /* Цветовая палитра */
    --bg-page: #F8FAFC;          /* Фон страницы — воздушный белый */
    --bg-surface: #FFFFFF;       /* Поверхности (карточки/шапка) — белый */
    --primary: #059669;          /* Акцент — изумруд */
    --primary-hover: #047857;    /* Акцент при наведении — тёмный изумруд */
    --primary-light: #D1FAE5;    /* Светлый изумруд (для бейджей) */
    --text-primary: #1E293B;     /* Основной текст — графит */
    --text-secondary: #64748B;   /* Второстепенный текст — серо-голубой */
    --border-color: #E2E8F0;     /* Границы/разделители — светлый */
    
    /* Тени */
    --card-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --card-hover-shadow: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.04);
    
    /* Статусы */
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --info: #3B82F6;
}

/* ==========================================
   🎨 БАЗОВЫЕ СТИЛИ
   ========================================== */

* {
    font-family: var(--font-primary);
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--bg-page);
    color: var(--text-primary);
    min-height: 100vh;
    font-size: 14px;
    line-height: 1.6;
}

/* ==========================================
   🎨 ЗАГОЛОВКИ
   ========================================== */

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--font-heading);
    color: var(--text-primary);
    letter-spacing: 0.3px;
}

.page-title,
.card-title,
.sidebar-header h3,
.auth-container h2 {
    font-family: var(--font-heading);
    letter-spacing: 0.5px;
}

/* ==========================================
   🎨 ТЕКСТ
   ========================================== */

.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-secondary); }

small, .small,
.form-text,
.file-meta,
.status-badge,
.badge,
label,
.sidebar-menu li a,
.user-info {
    font-family: var(--font-primary);
    color: var(--text-secondary);
}

/* ==========================================
   🎨 БОКОВОЕ МЕНЮ
   ========================================== */

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 250px;
    background: var(--bg-surface);
    border-right: 1px solid var(--border-color);
    padding: 20px 0;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 0 20px 20px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.sidebar-header h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-header .user-info {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
}

.sidebar-menu li {
    margin: 4px 0;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    font-size: 14px;
}

.sidebar-menu li a:hover {
    background: var(--bg-page);
    color: var(--primary);
}

.sidebar-menu li a.active {
    background: var(--primary-light);
    color: var(--primary);
    border-left-color: var(--primary);
}

.sidebar-menu li a .badge {
    margin-left: auto;
    background: var(--primary);
    color: white;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 20px;
}

/* ==========================================
   🎨 ОСНОВНОЙ КОНТЕНТ
   ========================================== */

.main-content {
    margin-left: 250px;
    padding: 30px;
    min-height: 100vh;
}

/* ==========================================
   🎨 КАРТОЧКИ ФАЙЛОВ
   ========================================== */

.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.file-card {
    background: var(--bg-surface);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--card-shadow);
    transition: all 0.25s ease;
    border: 1px solid var(--border-color);
}

.file-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--card-hover-shadow);
}

.file-card .file-icon {
    font-size: 40px;
    margin-bottom: 10px;
    display: block;
}

.file-card .file-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-primary);
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-card .file-meta {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 8px 0;
}

.file-card .file-meta span {
    display: block;
}

.file-card .file-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

/* ==========================================
   🎨 СТАТУСЫ
   ========================================== */

.status-badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge.received {
    background: var(--primary-light);
    color: var(--primary);
}

.status-badge.pending {
    background: #FEF3C7;
    color: #92400E;
}

.status-badge.sent {
    background: #DBEAFE;
    color: #1E40AF;
}

/* ==========================================
   🎨 КНОПКИ
   ========================================== */

.btn-primary-custom {
    background: var(--primary);
    color: white;
    border: none;
    padding: 8px 18px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s;
    cursor: pointer;
    font-size: 14px;
}

.btn-primary-custom:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}

.btn-success-custom {
    background: var(--primary);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s;
    cursor: pointer;
    font-size: 14px;
}

.btn-success-custom:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}

.btn-outline-custom {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
    padding: 6px 16px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s;
    cursor: pointer;
}

.btn-outline-custom:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-1px);
}

/* ==========================================
   🎨 ФОРМЫ
   ========================================== */

.auth-container {
    max-width: 420px;
    margin: 80px auto;
    background: var(--bg-surface);
    padding: 40px;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
}

.auth-container h2 {
    text-align: center;
    margin-bottom: 30px;
    font-weight: 700;
    color: var(--text-primary);
}

.auth-container .form-group {
    margin-bottom: 20px;
}

.auth-container label {
    display: block;
    font-weight: 500;
    margin-bottom: 5px;
    font-size: 14px;
    color: var(--text-secondary);
}

.auth-container input[type="email"],
.auth-container input[type="password"],
.auth-container input[type="text"] {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    transition: border 0.2s;
    background: var(--bg-page);
    color: var(--text-primary);
}

.auth-container input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

.auth-container .btn-submit {
    width: 100%;
    padding: 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.auth-container .btn-submit:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}

.auth-container .auth-link {
    text-align: center;
    margin-top: 15px;
    font-size: 14px;
    color: var(--text-secondary);
}

.auth-container .auth-link a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.auth-container .auth-link a:hover {
    text-decoration: underline;
}

/* ==========================================
   🎨 УВЕДОМЛЕНИЯ (TOAST)
   ========================================== */

.toast-notification {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #FFFFFF;
    border-radius: 14px;
    padding: 16px 20px;
    max-width: 420px;
    min-width: 300px;
    z-index: 9999;
    animation: slideIn 0.4s ease;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid #E2E8F0;
}

.toast-notification .toast-title {
    font-weight: 600;
    color: var(--text-primary);
}

.toast-notification .toast-message {
    color: var(--text-secondary);
    font-size: 14px;
}

@keyframes slideIn {
    from {
        transform: translateX(100%) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}

.toast-notification {
    animation: slideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-notification .toast-title {
    font-weight: 600;
    color: var(--text-primary);
}

.toast-notification .toast-message {
    color: var(--text-secondary);
    font-size: 14px;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ==========================================
   🎨 АДАПТИВ
   ========================================== */

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        padding: 20px;
    }
    
    .file-grid {
        grid-template-columns: 1fr;
    }
    
    .auth-container {
        margin: 40px 20px;
        padding: 30px 20px;
    }
}

/* ==========================================
   🎨 ДОПОЛНИТЕЛЬНО
   ========================================== */

.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state .icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.empty-state h4 {
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.progress-upload {
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    margin-top: 10px;
}

.progress-upload .bar {
    height: 100%;
    background: var(--primary);
    border-radius: 2px;
    transition: width 0.3s;
}

/* ==========================================
   🎨 АНИМАЦИЯ ДЛЯ БЕЙДЖА
   ========================================== */

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.badge {
    animation: pulse 2s infinite;
}

/* ==========================================
   🎨 СТИЛИ ДЛЯ ТАБЛИЦЫ ШТАТА
   ========================================== */

.table-users {
    width: 100%;
    border-collapse: collapse;
}

.table-users th {
    text-align: left;
    padding: 12px 16px;
    background: var(--bg-page);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 13px;
    border-bottom: 2px solid var(--border-color);
}

.table-users td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}

.table-users tr:hover {
    background: var(--bg-page);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.user-avatar.admin {
    background: var(--primary);
}

.user-avatar.user {
    background: #10B981;
}

.role-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.role-badge.admin {
    background: var(--primary-light);
    color: var(--primary);
}

.role-badge.user {
    background: var(--bg-page);
    color: var(--text-secondary);
}

/* ==========================================
   🎨 СТРАНИЦА ВХОДА / РЕГИСТРАЦИИ
   ========================================== */

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #F8FAFC 0%, #E2E8F0 100%);
    padding: 20px;
}

.auth-card {
    background: #FFFFFF;
    border-radius: 24px;
    padding: 48px 40px;
    max-width: 440px;
    width: 100%;
    border: 1px solid #E2E8F0;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.06), 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: transform 0.3s ease;
}

.auth-card:hover {
    transform: translateY(-2px);
}

.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo .logo-icon {
    width: 64px;
    height: 64px;
    background: #059669;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}

.auth-logo .logo-icon i {
    font-size: 32px;
    color: white;
}

.auth-logo h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: #1E293B;
    letter-spacing: 1px;
}

.auth-logo p {
    color: #64748B;
    font-size: 15px;
    margin-top: 4px;
}

.auth-form .form-group {
    margin-bottom: 20px;
}

.auth-form label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #1E293B;
    margin-bottom: 6px;
}

.auth-form .input-group {
    position: relative;
}

.auth-form .input-group .input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #94A3B8;
    font-size: 16px;
    pointer-events: none;
    transition: color 0.2s;
}

.auth-form .input-group input {
    width: 100%;
    padding: 12px 14px 12px 44px;
    border: 2px solid #E2E8F0;
    border-radius: 12px;
    font-size: 15px;
    color: #1E293B;
    background: #F8FAFC;
    transition: all 0.2s;
}

.auth-form .input-group input:focus {
    outline: none;
    border-color: #059669;
    background: #FFFFFF;
    box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.1);
}

.auth-form .input-group input:focus + .input-icon,
.auth-form .input-group input:focus ~ .input-icon {
    color: #059669;
}

.auth-form .input-group input::placeholder {
    color: #94A3B8;
}

.auth-form .form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    font-size: 14px;
}

.auth-form .form-options label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #64748B;
    font-weight: 400;
    cursor: pointer;
}

.auth-form .form-options label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #059669;
    border-radius: 4px;
    cursor: pointer;
}

.auth-form .form-options a {
    color: #059669;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.auth-form .form-options a:hover {
    color: #047857;
    text-decoration: underline;
}

.auth-form .btn-auth {
    width: 100%;
    padding: 14px;
    background: #059669;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.auth-form .btn-auth:hover {
    background: #047857;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(5, 150, 105, 0.3);
}

.auth-form .btn-auth:active {
    transform: translateY(0);
}

.auth-form .btn-auth i {
    font-size: 18px;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #E2E8F0;
}

.auth-divider span {
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

.auth-footer {
    text-align: center;
    font-size: 14px;
    color: #64748B;
    margin-top: 20px;
}

.auth-footer a {
    color: #059669;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.auth-footer a:hover {
    color: #047857;
    text-decoration: underline;
}

.auth-error {
    background: #FEE2E2;
    border: 1px solid #FCA5A5;
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 16px;
    color: #991B1B;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.auth-error i {
    font-size: 18px;
    color: #EF4444;
}

/* Анимация появления */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-card {
    animation: fadeInUp 0.5s ease;
}

/* Демо-информация */
.auth-demo {
    margin-top: 20px;
    padding: 16px 20px;
    background: #F1F5F9;
    border-radius: 12px;
    border: 1px dashed #94A3B8;
}

.auth-demo p {
    font-size: 13px;
    color: #475569;
    margin: 0;
    line-height: 1.6;
}

.auth-demo strong {
    color: #1E293B;
}

.auth-demo .demo-credentials {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 6px;
    font-size: 13px;
}

.auth-demo .demo-credentials span {
    background: #E2E8F0;
    padding: 2px 10px;
    border-radius: 4px;
    font-family: monospace;
    color: #1E293B;
}

/* ==========================================
   🎨 АДАПТИВ ДЛЯ СТРАНИЦЫ ВХОДА
   ========================================== */

@media (max-width: 480px) {
    .auth-card {
        padding: 32px 20px;
        border-radius: 16px;
    }

    .auth-logo h1 {
        font-size: 24px;
    }

    .auth-logo .logo-icon {
        width: 56px;
        height: 56px;
    }

    .auth-logo .logo-icon i {
        font-size: 28px;
    }

    .auth-form .form-options {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }

    .auth-demo .demo-credentials {
        flex-direction: column;
        gap: 4px;
    }
}

/* ==========================================
   📱 АДАПТИВНАЯ ВЕРСТКА
   ========================================== */

/* === Планшеты (768px - 1024px) === */
@media (max-width: 1024px) {
    /* Карточки файлов - 2 колонки */
    .file-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Отступы */
    .main-content {
        padding: 20px;
    }

    /* Заголовки */
    h1 {
        font-size: 24px;
    }
}

/* === Телефоны (до 768px) === */
@media (max-width: 768px) {
    /* Боковое меню - скрыто, открывается по кнопке */
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
        box-shadow: 2px 0 20px rgba(0,0,0,0.1);
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    /* Затемнение фона при открытом меню */
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.4);
        z-index: 999;
        display: none;
        backdrop-filter: blur(4px);
    }

    .sidebar-overlay.active {
        display: block;
    }

    /* Кнопка меню всегда видна */
    #menuToggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        position: fixed;
        bottom: 24px;
        left: 24px;
        z-index: 998;
        background: #059669;
        color: white;
        border: none;
        border-radius: 50%;
        width: 56px;
        height: 56px;
        font-size: 22px;
        box-shadow: 0 4px 16px rgba(5, 150, 105, 0.35);
        cursor: pointer;
        transition: all 0.2s;
    }

    #menuToggle:hover {
        transform: scale(1.05);
        box-shadow: 0 6px 24px rgba(5, 150, 105, 0.45);
    }

    /* Основной контент */
    .main-content {
        margin-left: 0;
        padding: 16px;
    }

    /* Карточки файлов - 1 колонка */
    .file-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    /* Карточки */
    .file-card {
        padding: 16px;
    }

    /* Заголовки */
    .page-title,
    h1 {
        font-size: 20px;
    }

    /* Фильтры - вертикально */
    .filters-container {
        flex-direction: column;
        gap: 10px;
    }

    .filters-container .filter-group {
        width: 100%;
        min-width: unset;
    }

    .filters-container .filter-actions {
        width: 100%;
        flex-direction: column;
    }

    .filters-container .filter-actions button,
    .filters-container .filter-actions a {
        width: 100%;
        justify-content: center;
    }

    /* Таблицы - горизонтальный скролл */
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -16px;
        padding: 0 16px;
    }

    .table-wrapper table {
        min-width: 600px;
        font-size: 13px;
    }

    /* Страница входа */
    .auth-container,
    .auth-card {
        margin: 20px 16px;
        padding: 32px 20px;
        border-radius: 16px;
    }

    /* Профиль - одна колонка */
    .profile-layout {
        flex-direction: column;
    }

    .profile-layout .profile-sidebar {
        width: 100%;
    }

    .profile-layout .profile-content {
        width: 100%;
    }

    /* Формы */
    .form-row {
        flex-direction: column;
    }

    .form-row .form-group {
        width: 100%;
    }

    /* Кнопки в действиях карточек */
    .file-actions {
        flex-direction: column;
        gap: 8px;
    }

    .file-actions a,
    .file-actions button,
    .file-actions form {
        width: 100%;
    }

    .file-actions form button {
        width: 100%;
        justify-content: center;
    }

    /* Страница отправки */
    .send-container {
        padding: 16px;
    }

    .send-container .card {
        padding: 20px;
    }

    /* Drop-zone */
    #dropZone {
        padding: 30px 16px;
    }

    #dropZone i {
        font-size: 36px;
    }

    /* Уведомления */
    .toast-notification {
        max-width: calc(100% - 32px);
        min-width: unset;
        bottom: 16px;
        right: 16px;
        left: 16px;
        padding: 14px 16px;
    }
}

/* === Маленькие телефоны (до 480px) === */
@media (max-width: 480px) {
    .main-content {
        padding: 12px;
    }

    h1 {
        font-size: 18px;
    }

    .auth-card {
        padding: 24px 16px;
    }

    .auth-card h1 {
        font-size: 20px;
    }

    /* Карточки */
    .file-card {
        padding: 14px;
        border-radius: 12px;
    }

    /* Кнопки */
    .btn-primary-custom,
    .btn-outline-custom,
    .btn-success-custom {
        padding: 8px 14px;
        font-size: 13px;
    }

    /* Счетчики в заголовках */
    .header-stats {
        flex-wrap: wrap;
        gap: 8px;
    }

    .header-stats .stat-item {
        padding: 4px 12px;
        font-size: 12px;
    }
}

/* === Планшеты (ландшафтная ориентация) === */
@media (min-width: 769px) and (max-width: 1024px) and (orientation: landscape) {
    .file-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}