/* ===== MODERN STYLES FOR LEGISLATIVE ARCHIVE SYSTEM ===== */
:root {
    /* Modern Color Palette */
    --primary-50: #e8f1ff;
    --primary-100: #c5d8ff;
    --primary-200: #9cbaff;
    --primary-300: #729bff;
    --primary-400: #5085ff;
    --primary-500: #1a5fff;
    --primary-600: #0052e6;
    --primary-700: #0046cc;
    --primary-800: #0039b3;
    --primary-900: #002699;
    
    --secondary-50: #f0f9ff;
    --secondary-100: #e0f2fe;
    --secondary-200: #bae6fd;
    --secondary-300: #7dd3fc;
    --secondary-400: #38bdf8;
    --secondary-500: #0ea5e9;
    --secondary-600: #0284c7;
    --secondary-700: #0369a1;
    --secondary-800: #075985;
    --secondary-900: #0c4a6e;
    
    --success-50: #f0fdf4;
    --success-100: #dcfce7;
    --success-200: #bbf7d0;
    --success-300: #86efac;
    --success-400: #4ade80;
    --success-500: #22c55e;
    --success-600: #16a34a;
    --success-700: #15803d;
    --success-800: #166534;
    --success-900: #14532d;
    
    --danger-50: #fef2f2;
    --danger-100: #fee2e2;
    --danger-200: #fecaca;
    --danger-300: #fca5a5;
    --danger-400: #f87171;
    --danger-500: #ef4444;
    --danger-600: #dc2626;
    --danger-700: #b91c1c;
    --danger-800: #991b1b;
    --danger-900: #7f1d1d;
    
    --warning-50: #fffbeb;
    --warning-100: #fef3c7;
    --warning-200: #fde68a;
    --warning-300: #fcd34d;
    --warning-400: #fbbf24;
    --warning-500: #f59e0b;
    --warning-600: #d97706;
    --warning-700: #b45309;
    --warning-800: #92400e;
    --warning-900: #78350f;
    
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    --border-radius-sm: 4px;
    --border-radius-md: 8px;
    --border-radius-lg: 12px;
    --border-radius-xl: 16px;
    --border-radius-2xl: 24px;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
    
    --max-width: 1280px;
    --header-height: 64px;
    --sidebar-width: 280px;
}

/* ===== УМЕНЬШЕНИЕ РАЗМЕРА ШРИФТА ПО ВСЕМУ ПРОЕКТУ ===== */
html {
    scroll-behavior: smooth;
    font-size: 14px; /* Уменьшено с 16px */
}

/* ===== RESET & BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    color: var(--gray-800);
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    min-height: 100vh;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--gray-900);
}

h1 {
    font-size: 2.2rem; /* Уменьшено с 2.5rem */
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-600), var(--primary-800));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h2 {
    font-size: 1.7rem; /* Уменьшено с 1.875rem */
    margin-bottom: 1.5rem;
}

h3 {
    font-size: 1.35rem; /* Уменьшено с 1.5rem */
    margin-bottom: 1rem;
}

h4 {
    font-size: 1.1rem; /* Уменьшено с 1.25rem */
    margin-bottom: 0.75rem;
}

p {
    margin-bottom: 1rem;
    color: var(--gray-600);
}

a {
    color: var(--primary-600);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-800);
}

/* ===== LAYOUT & CONTAINERS ===== */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
    width: 100%;
}

.page-wrapper {
    min-height: calc(100vh - var(--header-height));
    padding: 2rem 0;
}

/* ===== HEADER & NAVIGATION ===== */
.header {
    height: var(--header-height);
    background: linear-gradient(135deg, var(--primary-700), var(--primary-900));
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Логотип - слева */
.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    flex-shrink: 0;
}

.logo-icon {
    width: 36px; /* Уменьшено с 40px */
    height: 36px;
    background: linear-gradient(135deg, #ffffff, var(--secondary-300));
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-700);
    font-size: 1rem; /* Уменьшено с 1.25rem */
    box-shadow: var(--shadow-md);
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-title {
    font-size: 1.1rem; /* Уменьшено с 1.25rem */
    font-weight: 700;
    color: white;
    line-height: 1.2;
}

.logo-subtitle {
    font-size: 0.7rem; /* Уменьшено с 0.75rem */
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

/* Пустое пространство для разделения логотипа и меню пользователя */
.header-spacer {
    flex: 1;
}

/* ===== MAIN NAVIGATION ===== */
.main-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 0.25rem;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-weight: 500;
    border-radius: var(--border-radius-md);
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.nav-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.nav-link:hover::before {
    opacity: 1;
}

.nav-link.active {
    color: white;
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
    box-shadow: var(--shadow-md);
}

.nav-link.active::before {
    opacity: 1;
}

.nav-link i {
    font-size: 1rem; /* Уменьшено с 1.125rem */
}

/* ===== USER MENU ===== */
.user-menu {
    position: relative;
    flex-shrink: 0;
}

.user-trigger {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
    backdrop-filter: blur(10px);
}

.user-trigger:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary-400), var(--secondary-600));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    box-shadow: var(--shadow-sm);
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.user-name {
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    line-height: 1.2;
}

.user-role {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.75rem;
    font-weight: 500;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    width: 240px;
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-normal);
    z-index: 1000;
    overflow: hidden;
    border: 1px solid var(--gray-200);
}

.user-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, var(--primary-50), var(--secondary-50));
    border-bottom: 1px solid var(--gray-200);
}

.dropdown-header .user-name {
    color: var(--gray-900);
    font-size: 0.875rem;
}

.dropdown-header .user-email {
    color: var(--gray-600);
    font-size: 0.75rem;
}

.dropdown-menu {
    list-style: none;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    color: var(--gray-700);
    text-decoration: none;
    transition: all var(--transition-fast);
    border-bottom: 1px solid var(--gray-100);
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background: var(--gray-50);
    color: var(--primary-700);
    padding-left: 1.5rem;
}

.dropdown-item i {
    width: 20px;
    color: var(--gray-500);
    font-size: 1rem;
}

.dropdown-item:hover i {
    color: var(--primary-600);
}

.dropdown-divider {
    height: 1px;
    background: var(--gray-200);
    margin: 0.25rem 0;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5625rem 1.125rem; /* Уменьшено */
    font-size: 0.8125rem; /* Уменьшено с 0.875rem */
    font-weight: 600;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    border: 2px solid transparent;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    user-select: none;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

.btn:focus:not(:active)::after {
    animation: ripple 1s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    100% {
        transform: scale(40, 40);
        opacity: 0;
    }
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary-500), var(--secondary-600));
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, var(--secondary-600), var(--secondary-700));
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-outline {
    background: transparent;
    border-color: var(--gray-300);
    color: var(--gray-700);
}

.btn-outline:hover {
    background: var(--gray-50);
    border-color: var(--primary-500);
    color: var(--primary-700);
    transform: translateY(-2px);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-500), var(--success-600));
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-500), var(--danger-600));
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning-500), var(--warning-600));
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-lg {
    padding: 0.75rem 1.5rem; /* Уменьшено */
    font-size: 0.9375rem; /* Уменьшено с 1rem */
    border-radius: var(--border-radius-lg);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.6875rem; /* Уменьшено с 0.75rem */
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-group {
    display: flex;
    gap: 0.5rem;
}

/* ===== FORMS ===== */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.8125rem; /* Уменьшено с 0.875rem */
}

.form-control {
    width: 100%;
    padding: 0.625rem 0.875rem; /* Уменьшено */
    font-size: 0.8125rem; /* Уменьшено с 0.875rem */
    line-height: 1.5;
    color: var(--gray-800);
    background: white;
    border: 2px solid var(--gray-300);
    border-radius: var(--border-radius-md);
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(26, 95, 255, 0.1);
}

.form-control::placeholder {
    color: var(--gray-500);
}

.form-control-lg {
    padding: 1rem 1.25rem;
    font-size: 1rem;
}

.form-control-sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
}

.form-text {
    display: block;
    margin-top: 0.375rem;
    font-size: 0.75rem;
    color: var(--gray-600);
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.form-check-input {
    width: 18px;
    height: 18px;
    border: 2px solid var(--gray-400);
    border-radius: 4px;
    background: white;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.form-check-input:checked {
    background: var(--primary-500);
    border-color: var(--primary-500);
}

.form-check-label {
    font-size: 0.875rem;
    color: var(--gray-700);
    cursor: pointer;
}

.input-group {
    display: flex;
    gap: 0.5rem;
}

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

/* ===== CARDS ===== */
.card {
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-200);
    overflow: hidden;
    transition: all var(--transition-normal);
}

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

.card-header {
    padding: 1.25rem 1.5rem;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 1.1rem; /* Уменьшено с 1.25rem */
    font-weight: 600;
    color: var(--gray-900);
    margin: 0;
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1rem 1.5rem;
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.card-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--border-radius-lg);
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

/* ===== STAT CARDS ===== */
.stat-card {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-200);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
}

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

.stat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.stat-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius-md);
    background: linear-gradient(135deg, var(--primary-50), var(--secondary-50));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-600);
    font-size: 1.125rem;
}

.stat-value {
    font-size: 1.8rem; /* Уменьшено с 2rem */
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-change {
    font-size: 0.875rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.stat-change.positive {
    color: var(--success-600);
}

.stat-change.negative {
    color: var(--danger-600);
}

/* ===== TABLES ===== */
.table-container {
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-200);
    overflow: hidden;
    margin-bottom: 2rem;
}

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

.table thead {
    background: linear-gradient(135deg, var(--primary-50), var(--secondary-50));
    border-bottom: 2px solid var(--gray-200);
}

.table th {
    padding: 1rem 1.25rem;
    text-align: left;
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.6875rem; /* Уменьшено с 0.75rem */
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--gray-200);
    white-space: nowrap;
}

.table tbody tr {
    border-bottom: 1px solid var(--gray-100);
    transition: all var(--transition-fast);
}

.table tbody tr:hover {
    background: var(--gray-50);
}

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

.table td {
    padding: 1rem 1.25rem;
    color: var(--gray-700);
    font-size: 0.8125rem; /* Уменьшено с 0.875rem */
    vertical-align: middle;
}

.table-link {
    color: var(--primary-600);
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    transition: color var(--transition-fast);
}

.table-link:hover {
    color: var(--primary-800);
    text-decoration: underline;
}

/* ===== BADGES ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.1875rem 0.5625rem; /* Уменьшено */
    font-size: 0.6875rem; /* Уменьшено с 0.75rem */
    font-weight: 600;
    line-height: 1;
    border-radius: 9999px;
    white-space: nowrap;
}

.badge-primary {
    background: linear-gradient(135deg, var(--primary-100), var(--primary-200));
    color: var(--primary-700);
}

.badge-secondary {
    background: linear-gradient(135deg, var(--secondary-100), var(--secondary-200));
    color: var(--secondary-700);
}

.badge-success {
    background: linear-gradient(135deg, var(--success-100), var(--success-200));
    color: var(--success-700);
}

.badge-danger {
    background: linear-gradient(135deg, var(--danger-100), var(--danger-200));
    color: var(--danger-700);
}

.badge-warning {
    background: linear-gradient(135deg, var(--warning-100), var(--warning-200));
    color: var(--warning-700);
}

.badge-outline {
    background: transparent;
    border: 1px solid var(--gray-300);
    color: var(--gray-700);
}

/* ===== ALERTS ===== */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--border-radius-md);
    margin-bottom: 1.5rem;
    border-left: 4px solid transparent;
    background: white;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    animation: slideIn 0.3s ease-out;
}

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

.alert-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.alert-message {
    color: var(--gray-600);
    font-size: 0.8125rem; /* Уменьшено с 0.875rem */
}

.alert-close {
    background: none;
    border: none;
    color: var(--gray-500);
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0;
    flex-shrink: 0;
    transition: color var(--transition-fast);
}

.alert-close:hover {
    color: var(--gray-700);
}

.alert-success {
    border-left-color: var(--success-500);
    background: linear-gradient(135deg, var(--success-50), white);
}

.alert-success .alert-icon {
    color: var(--success-500);
}

.alert-danger {
    border-left-color: var(--danger-500);
    background: linear-gradient(135deg, var(--danger-50), white);
}

.alert-danger .alert-icon {
    color: var(--danger-500);
}

.alert-warning {
    border-left-color: var(--warning-500);
    background: linear-gradient(135deg, var(--warning-50), white);
}

.alert-warning .alert-icon {
    color: var(--warning-500);
}

.alert-info {
    border-left-color: var(--primary-500);
    background: linear-gradient(135deg, var(--primary-50), white);
}

.alert-info .alert-icon {
    color: var(--primary-500);
}

/* ===== MODALS ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: white;
    border-radius: var(--border-radius-xl);
    box-shadow: var(--shadow-2xl);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    transform: translateY(20px);
    transition: transform var(--transition-normal);
}

.modal-overlay.show .modal {
    transform: translateY(0);
}

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: var(--gray-500);
    cursor: pointer;
    font-size: 1.5rem;
    padding: 0.25rem;
    border-radius: var(--border-radius-sm);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    color: var(--gray-700);
    background: var(--gray-100);
}

.modal-body {
    padding: 2rem;
    flex: 1;
    overflow-y: auto;
}

.modal-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    flex-shrink: 0;
}

/* ===== PAGINATION ===== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.page-item {
    list-style: none;
}

.page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px; /* Уменьшено с 40px */
    height: 36px; /* Уменьшено с 40px */
    padding: 0 0.75rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--border-radius-md);
    color: var(--gray-700);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.8125rem; /* Уменьшено с 0.875rem */
    transition: all var(--transition-fast);
}

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

.page-link.active {
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
    border-color: var(--primary-500);
    color: white;
}

.page-link.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* ===== FILE UPLOAD ===== */
.file-upload {
    border: 2px dashed var(--gray-300);
    border-radius: var(--border-radius-lg);
    padding: 3rem 2rem;
    text-align: center;
    background: var(--gray-50);
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.file-upload:hover {
    border-color: var(--primary-500);
    background: linear-gradient(135deg, var(--primary-50), transparent);
    transform: translateY(-2px);
}

.file-upload.dragover {
    border-color: var(--primary-500);
    background: linear-gradient(135deg, var(--primary-100), transparent);
}

.file-upload-icon {
    font-size: 3rem;
    color: var(--primary-500);
    margin-bottom: 1rem;
}

.file-upload-text {
    font-size: 1rem;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.file-upload-hint {
    font-size: 0.875rem;
    color: var(--gray-600);
}

.file-upload-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-list {
    margin-top: 1rem;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-md);
    margin-bottom: 0.5rem;
    animation: slideIn 0.3s ease-out;
}

.file-icon {
    font-size: 1.5rem;
    color: var(--primary-500);
}

.file-info {
    flex: 1;
}

.file-name {
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.25rem;
}

.file-size {
    font-size: 0.75rem;
    color: var(--gray-600);
}

.file-remove {
    background: none;
    border: none;
    color: var(--gray-500);
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0.25rem;
    border-radius: var(--border-radius-sm);
    transition: all var(--transition-fast);
}

.file-remove:hover {
    color: var(--danger-500);
    background: var(--danger-50);
}

/* ===== DASHBOARD SPECIFIC ===== */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.dashboard-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.action-card {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    text-align: center;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-200);
    transition: all var(--transition-normal);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

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

.action-card-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--border-radius-xl);
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.75rem;
    box-shadow: var(--shadow-md);
}

.action-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0;
}

.action-card-description {
    color: var(--gray-600);
    font-size: 0.875rem;
    margin: 0;
}

/* ===== LOGIN PAGE ===== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 2rem;
}

.login-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    max-width: var(--max-width);
    width: 100%;
    background: white;
    border-radius: var(--border-radius-2xl);
    overflow: hidden;
    box-shadow: var(--shadow-2xl);
    min-height: 600px;
}

.login-form-section {
    padding: 4rem 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-header {
    text-align: center;
    margin-bottom: 3rem;
}

.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.login-logo-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
    border-radius: var(--border-radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    box-shadow: var(--shadow-lg);
}

.login-title {
    font-size: 2.2rem; /* Уменьшено с 2.5rem */
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-600), var(--primary-800));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.login-subtitle {
    color: var(--gray-600);
    font-size: 0.9375rem; /* Уменьшено с 1rem */
}

.login-features-section {
    background: linear-gradient(135deg, var(--primary-700), var(--primary-900));
    padding: 4rem 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: white;
}

.features-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.feature-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--border-radius-lg);
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.feature-content h3 {
    color: white;
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.feature-content p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.875rem;
    margin: 0;
}

/* ===== ADMIN PANEL ===== */
.admin-layout {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    gap: 2rem;
    min-height: calc(100vh - var(--header-height) - 4rem);
}

.admin-sidebar {
    background: white;
    border-radius: var(--border-radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 2rem;
    height: fit-content;
    position: sticky;
    top: calc(var(--header-height) + 2rem);
}

.admin-nav {
    list-style: none;
}

.admin-nav-item {
    margin-bottom: 0.5rem;
}

.admin-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    color: var(--gray-700);
    text-decoration: none;
    border-radius: var(--border-radius-lg);
    transition: all var(--transition-fast);
}

.admin-nav-link:hover {
    background: var(--gray-100);
    color: var(--primary-700);
    transform: translateX(4px);
}

.admin-nav-link.active {
    background: linear-gradient(135deg, var(--primary-50), var(--secondary-50));
    color: var(--primary-700);
    font-weight: 600;
}

.admin-nav-link i {
    width: 20px;
    text-align: center;
    font-size: 1.125rem;
}

.admin-nav-link {
    font-size: 0.8125rem; /* Уменьшено с 0.875rem */
}

.admin-content {
    background: white;
    border-radius: var(--border-radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 2rem;
}

/* ===== TABS ===== */
.tabs {
    margin-bottom: 2rem;
}

.tab-header {
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid var(--gray-200);
    margin-bottom: 2rem;
    overflow-x: auto;
}

.tab-button {
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--gray-600);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition-fast);
    position: relative;
}

.tab-button:hover {
    color: var(--primary-700);
}

.tab-button.active {
    color: var(--primary-700);
    border-bottom-color: var(--primary-500);
}

.tab-pane {
    display: none;
    animation: fadeIn 0.3s ease-out;
}

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

/* ===== FOOTER ===== */
.footer {
    background: linear-gradient(135deg, var(--gray-900), var(--gray-800));
    color: white;
    padding: 3rem 0 2rem;
    margin-top: auto;
}

.footer-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.footer-logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
}

.footer-logo-text {
    display: flex;
    flex-direction: column;
}

.footer-logo-title {
    font-size: 1.1rem; /* Уменьшено с 1.25rem */
    font-weight: 700;
    color: white;
}

.footer-logo-subtitle {
    font-size: 0.7rem; /* Уменьшено с 0.75rem */
    color: rgba(255, 255, 255, 0.7);
}

.footer-info {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.footer-copyright {
    font-size: 0.8125rem; /* Уменьшено с 0.875rem */
    color: rgba(255, 255, 255, 0.7);
}

.footer-version {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
}

.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}

/* ===== UTILITIES ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 2rem; }
.mt-6 { margin-top: 3rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 2rem; }
.mb-6 { margin-bottom: 3rem; }

.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 1rem; }
.p-4 { padding: 1.5rem; }
.p-5 { padding: 2rem; }
.p-6 { padding: 3rem; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

.d-flex { display: flex; }
.d-grid { display: grid; }
.d-block { display: block; }
.d-inline { display: inline; }
.d-inline-block { display: inline-block; }
.d-none { display: none; }

.align-items-center { align-items: center; }
.justify-content-center { justify-content: center; }
.justify-content-between { justify-content: space-between; }
.justify-content-end { justify-content: flex-end; }

.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }
.gap-4 { gap: 1.5rem; }
.gap-5 { gap: 2rem; }

.flex-wrap { flex-wrap: wrap; }
.flex-column { flex-direction: column; }
.flex-row { flex-direction: row; }

.position-relative { position: relative; }
.position-absolute { position: absolute; }
.position-sticky { position: sticky; }
.position-fixed { position: fixed; }

/* ===== АНИМАЦИИ ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

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

.animate-spin {
    animation: spin 1s linear infinite;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1024px) {
    :root {
        --max-width: 100%;
    }
    
    .admin-layout {
        grid-template-columns: 1fr;
    }
    
    .admin-sidebar {
        position: static;
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 768px) {
    html {
        font-size: 13px; /* Еще меньше на мобильных */
    }
    
    .header-container {
        flex-direction: column;
        padding: 1rem;
        height: auto;
        gap: 1rem;
    }
    
    /* На мобильных скрываем подзаголовок логотипа */
    .logo-subtitle {
        display: none;
    }
    
    /* На мобильных уменьшаем меню пользователя */
    .user-info {
        display: none;
    }
    
    .user-trigger {
        padding: 0.375rem 0.75rem;
    }
    
    .user-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.75rem;
    }
    
    .main-nav {
        width: 100%;
        justify-content: center;
    }
    
    .nav-list {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .dashboard-grid,
    .dashboard-actions {
        grid-template-columns: 1fr;
    }
    
    .login-container {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .login-features-section {
        display: none;
    }
    
    .table-container {
        overflow-x: auto;
    }
    
    .table {
        min-width: 768px;
    }
    
    .modal {
        width: 95%;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 12px;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    h2 {
        font-size: 1.4rem;
    }
    
    .container {
        padding: 0 1rem;
    }
    
    /* На очень маленьких экранах скрываем текст логотипа */
    .logo-text {
        display: none;
    }
    
    .logo-icon {
        width: 32px;
        height: 32px;
        font-size: 0.875rem;
    }
    
    .card-body,
    .modal-body {
        padding: 1.5rem;
    }
    
    .btn-group {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-group .btn {
        width: 100%;
    }
}

/* Дополнительные стили */
.categories-sidebar {
    scrollbar-width: thin;
    scrollbar-color: var(--gray-300) var(--gray-100);
}

.categories-sidebar::-webkit-scrollbar {
    width: 6px;
}

.categories-sidebar::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: 3px;
}

.categories-sidebar::-webkit-scrollbar-thumb {
    background-color: var(--gray-300);
    border-radius: 3px;
}

.category-link {
    position: relative;
    overflow: hidden;
}

.category-link::after {
    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;
}

.category-link:hover::after {
    left: 100%;
}

/* Animation for category items */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.category-item {
    animation: slideInLeft 0.3s ease-out;
    animation-fill-mode: both;
}

.category-item:nth-child(1) { animation-delay: 0.1s; }
.category-item:nth-child(2) { animation-delay: 0.2s; }
.category-item:nth-child(3) { animation-delay: 0.3s; }
.category-item:nth-child(4) { animation-delay: 0.4s; }
.category-item:nth-child(5) { animation-delay: 0.5s; }
.category-item:nth-child(6) { animation-delay: 0.6s; }
.category-item:nth-child(7) { animation-delay: 0.7s; }
.category-item:nth-child(8) { animation-delay: 0.8s; }
.category-item:nth-child(9) { animation-delay: 0.9s; }
.category-item:nth-child(10) { animation-delay: 1s; }

/* Responsive improvements */
@media (max-width: 768px) {
    .documents-layout {
        margin-top: 1rem;
    }
    
    .document-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .document-actions > div:first-child {
        order: 2;
        margin-top: 1rem;
    }
    
    .document-actions > div:last-child {
        order: 1;
    }
}

/* Дополнительные анимации */
@keyframes float {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(-50px, -50px) rotate(360deg); }
}

/* Дополнительные утилиты */
.bg-secondary {
    background-color: var(--gray-600) !important;
}

.bg-primary {
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600)) !important;
}

.text-white\/80 {
    color: rgba(255, 255, 255, 0.8);
}

/* Grid gap utilities */
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }
.gap-4 { gap: 1.5rem; }

.row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -0.75rem;
    margin-left: -0.75rem;
}

.col-md-6 {
    flex: 0 0 50%;
    max-width: 50%;
    padding-right: 0.75rem;
    padding-left: 0.75rem;
}

.g-4 {
    gap: 1.5rem;
}

/* Новые классы для текста */
.text-nowrap {
    white-space: nowrap;
}

.text-muted {
    color: var(--gray-500) !important;
}

/* Дополнительные утилиты для отступов */
.mb-0 { margin-bottom: 0 !important; }
.mt-4 { margin-top: 1.5rem !important; }
.ms-2 { margin-left: 0.5rem !important; }

/* Улучшенные стили для таблиц */
.table-container {
    overflow-x: auto;
    border-radius: var(--border-radius-lg);
    background: white;
}

/* Стили для формы */
.form-label {
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
    display: block;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(26, 95, 255, 0.1);
}

.form-text {
    font-size: 0.75rem;
    color: var(--gray-600);
    margin-top: 0.25rem;
}

.input-group {
    display: flex;
}

.input-group .form-control {
    flex: 1;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.input-group .btn {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

/* Стили для селектов */
select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23374151' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    padding-right: 2.5rem;
}