:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #8b5cf6;
    --secondary: #06d6a0;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --success: #10b981;
    --dark: #1e293b;
    --dark-2: #334155;
    --dark-3: #475569;
    --light: #f8fafc;
    --light-2: #e2e8f0;
    --light-3: #cbd5e1;
    --gray: #64748b;
    --sidebar-width: 280px;
    --header-height: 75px;
    --border-radius: 12px;
    --border-radius-lg: 16px;
    --shadow: 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);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-success: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --gradient-warning: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: var(--dark);
    min-height: 100vh;
    line-height: 1.6;
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--dark);
    color: white;
    position: fixed;
    height: 100vh;
    z-index: 1000;
    transition: var(--transition);
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.logo-text {
    font-size: 22px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-subtitle {
    font-size: 12px;
    opacity: 0.7;
    font-weight: 500;
}

.nav-links {
    list-style: none;
    padding: 20px 0;
    flex: 1;
    overflow-y: auto;
}

.nav-links li {
    margin-bottom: 4px;
}

.nav-links a {
    display: flex;
    align-items: center;
    padding: 14px 24px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: var(--transition);
    font-weight: 500;
    border-left: 4px solid transparent;
}

.nav-links a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    border-left-color: var(--primary);
}

.nav-links a.active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-left-color: var(--primary);
    box-shadow: inset 0 0 20px rgba(99, 102, 241, 0.2);
}

.nav-links i {
    margin-right: 12px;
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.nav-links .badge {
    margin-left: auto;
    background: var(--primary);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: var(--transition);
    background: var(--light);
    min-height: 100vh;
}

/* Header */
.header {
    height: var(--header-height);
    background: white;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--dark);
    font-size: 20px;
    cursor: pointer;
}

.mobile-menu-toggle {
    display: none;
}

.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-overlay.active {
    display: block;
    opacity: 1;
}

/* User Info */
.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    border-radius: var(--border-radius);
    transition: var(--transition);
    cursor: pointer;
}

.user-info:hover {
    background: var(--light-2);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 16px;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 14px;
}

.user-role {
    font-size: 12px;
    color: var(--gray);
}

/* Admin Toggle */
.admin-toggle {
    background: var(--warning);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.admin-toggle:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.admin-toggle.active {
    background: var(--success);
}

/* Content Area */
.content {
    padding: 30px;
}

/* Stats Grid - Минималистичный стиль */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid var(--light-2);
    text-align: center;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--dark);
}

.stat-label {
    color: var(--gray);
    font-size: 14px;
    font-weight: 500;
}

.stat-trend {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 12px;
    margin-top: 8px;
    font-weight: 600;
}

.trend-up { color: var(--success); }
.trend-down { color: var(--danger); }

/* Cards */
.card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    overflow: hidden;
    border: 1px solid var(--light-2);
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--light-2);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-body {
    padding: 20px;
}

/* Tabs */
.tab-content {
    display: none;
    animation: fadeIn 0.4s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Forms */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--dark);
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--light-3);
    border-radius: var(--border-radius);
    font-size: 14px;
    transition: var(--transition);
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Единый подход для всех форм, как на вкладке "Аналитика" */
.form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1;
    min-width: 50px; /* Минимальная ширина для удобства на десктопе */
    margin-bottom: 0;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-primary { 
    background: var(--primary); 
    color: white; 
}
.btn-primary:hover { background: var(--primary-dark); }

.btn-success { 
    background: var(--success); 
    color: white; 
}
.btn-success:hover { background: #0da271; }

.btn-warning { 
    background: var(--warning); 
    color: white; 
}
.btn-warning:hover { background: #d97706; }

.btn-danger { 
    background: var(--danger); 
    color: white; 
}
.btn-danger:hover { background: #dc2626; }

.btn-secondary { 
    background: var(--gray); 
    color: white; 
}
.btn-secondary:hover { background: #475569; }

.btn-info { 
    background: var(--info); 
    color: white; 
}
.btn-info:hover { background: #2563eb; }

.btn-outline {
    background: transparent;
    border: 1px solid var(--light-3);
    color: var(--dark);
}

.btn-outline:hover {
    background: var(--light-2);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

/* Tables */
.table-container {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--light-2);
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    min-width: 50px;
}

.table th,
.table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--light-2);
}

.table th {
    background: var(--light);
    font-weight: 600;
    color: var(--dark);
    font-size: 14px;
    white-space: nowrap;
}

.table tr:hover {
    background: var(--light);
}

.table tr:last-child td {
    border-bottom: none;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-primary { background: #e0e7ff; color: #3730a3; }

/* Project Cards */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.project-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid var(--light-2);
    position: relative;
}

.project-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.project-code {
    background: var(--primary);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.project-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--dark);
}

.project-description {
    color: var(--gray);
    margin-bottom: 16px;
    line-height: 1.5;
}

.project-meta {
    display: flex;
    justify-content: space-between;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--light-2);
    font-size: 13px;
}

.project-manager, .project-deadline {
    color: var(--gray);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Transaction Cards */
.transactions-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.transaction-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 16px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border-left: 4px solid var(--info);
    cursor: pointer;
    border: 1px solid var(--light-2);
}

.transaction-card.receipt { border-left-color: var(--success); }
.transaction-card.issue { border-left-color: var(--warning); }
.transaction-card.writeoff { border-left-color: var(--danger); }

.transaction-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.transaction-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--dark);
}

.transaction-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--gray);
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.transaction-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.transaction-items {
    background: var(--light);
    border-radius: var(--border-radius);
    padding: 12px;
    margin-top: 12px;
}

.transaction-item {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid var(--light-2);
}

.transaction-item:last-child {
    border-bottom: none;
}

.transaction-total {
    font-weight: 600;
    color: var(--primary);
    margin-top: 12px;
    padding-top: 12px;
    border-top: 2px solid var(--light-2);
    text-align: right;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* Search & Filters */
.search-box {
    position: relative;
    margin-bottom: 16px;
}

.search-input {
    width: 100%;
    padding: 10px 14px 10px 40px;
    border: 1px solid var(--light-3);
    border-radius: var(--border-radius);
    font-size: 14px;
    transition: var(--transition);
    background: white;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray);
}

.filters {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: white;
    padding: 24px;
    border-radius: var(--border-radius);
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: modalFadeIn 0.3s ease;
    position: relative;
    border: 1px solid var(--light-3);
}

.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--light-2);
}

.modal-header h2 {
    font-size: 22px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.close-modal {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--gray);
    transition: var(--transition);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-modal:hover {
    background: var(--light-2);
    color: var(--danger);
}

/* Empty states */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--gray);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 18px;
    margin-bottom: 8px;
    color: var(--dark);
}

.empty-state p {
    font-size: 14px;
    max-width: 400px;
    margin: 0 auto 16px;
}

/* Password Protection */
.password-prompt {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 3000;
    align-items: center;
    justify-content: center;
}

.password-prompt-content {
    background: white;
    padding: 24px;
    border-radius: var(--border-radius);
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-xl);
    text-align: center;
    color: #000000;
}

/* Category Management */
.categories-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.category-tag {
    background: var(--light-2);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.category-tag .delete-category {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 14px;
}

/* === ДОБАВЛЕНО: ПРАВИЛО ДЛЯ КЛАССА mobile-open === */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%) !important;
        transition: transform 0.3s ease;
    }
    
    .sidebar.mobile-open {
        transform: translateX(0) !important;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        padding: 12px;
        background: var(--light-2);
        border-radius: var(--border-radius);
        transition: var(--transition);
    }

    .mobile-menu-btn:hover {
        background: var(--primary);
        color: white;
    }

    .mobile-menu-btn:active {
        transform: scale(0.95);
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 0 20px;
    }
    
    .content {
        padding: 20px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    /* Единое правило для всех форм на мобильных */
    .form-row {
        flex-direction: column;
        gap: 16px;
    }
    
    /* КЛЮЧЕВОЕ ИЗМЕНЕНИЕ: Убираем min-width полностью */
    .form-row .form-group {
        min-width: auto;
        flex: none;
    }
    
    .user-details {
        display: none;
    }
    
    .table-container {
        overflow-x: auto;
    }
    
    .modal-content {
        padding: 16px;
        max-width: 95%;
    }
    
    .filters {
        flex-direction: column;
    }
    
    .table {
        min-width: 50px;
    }
}

@media (max-width: 480px) {
    .header-left h1 {
        font-size: 20px;
    }
    
    .transaction-header {
        flex-direction: column;
        gap: 10px;
    }
    
    .transaction-meta {
        flex-direction: column;
        gap: 5px;
    }
    
    .modal-content {
        padding: 16px;
    }
    
    .action-buttons {
        flex-wrap: wrap;
    }
    
    .btn-sm {
        padding: 4px 8px;
        font-size: 12px;
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .form-control {
        font-size: 16px;
    }
    
    .table {
        min-width: 50px;
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--light-2);
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* ========== ДАШБОРД: ТЁМНЫЙ РЕЖИМ ========== */
#dashboard-tab {
    background: var(--dark) !important;
    color: white !important;
    padding: 30px;
    min-height: 100%;
}

#dashboard-tab .card,
#dashboard-tab .stat-card,
#dashboard-tab .quick-action-btn,
#dashboard-tab .alerts-section {
    background: var(--dark) !important;
    border: 1px solid var(--light-2) !important;
    color: white !important;
}
#dashboard-tab .card-header,
#dashboard-tab .card-body,
#dashboard-tab .stat-value,
#dashboard-tab .stat-label,
#dashboard-tab .stat-trend,
#dashboard-tab h2,
#dashboard-tab h3,
#dashboard-tab p,
#dashboard-tab small,
#dashboard-tab strong,
#dashboard-tab .empty-state h3,
#dashboard-tab .empty-state p,
#dashboard-tab .quick-action-btn span {
    color: white !important;
}
#dashboard-tab .empty-state {
    color: var(--gray) !important;
}

#dashboard-tab .quick-action-btn i {
    color: var(--primary) !important;
}
#dashboard-tab .badge {
    color: white !important;
}

/* ========================================
   МОБИЛЬНАЯ АДАПТАЦИЯ
======================================== */

/* Планшеты и ниже (768px) */
@media screen and (max-width: 768px) {
    /* Sidebar - скрыт по умолчанию на мобильных */
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
    }

    .sidebar.active,
    .sidebar.mobile-open {
        transform: translateX(0);
    }

    /* Main content на всю ширину */
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }

    /* Header */
    .header {
        width: 100% !important;
        left: 0 !important;
    }

    /* Кнопка для открытия меню */
    .mobile-menu-toggle {
        display: block !important;
        position: fixed;
        bottom: 20px;
        right: 20px;
        width: 56px;
        height: 56px;
        background: var(--primary);
        color: white;
        border: none;
        border-radius: 50%;
        font-size: 24px;
        box-shadow: var(--shadow-xl);
        z-index: 999;
        cursor: pointer;
        transition: var(--transition);
    }

    .mobile-menu-toggle:active {
        transform: scale(0.95);
    }

    /* Overlay для sidebar */
    .mobile-overlay,
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }

    .mobile-overlay.active,
    .sidebar-overlay.active {
        display: block;
    }

    /* Projects grid - 1 колонка */
    .projects-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }

    /* Stats grid - 1 колонка */
    .stats-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }

    /* Form rows - вертикально */
    .form-row {
        flex-direction: column !important;
        gap: 16px !important;
    }

    .form-group {
        width: 100% !important;
    }

    /* Buttons - полная ширина */
    .btn {
        width: 100%;
        justify-content: center;
    }

    /* Card header - вертикально */
    .card-header {
        flex-direction: column !important;
        gap: 12px !important;
        align-items: flex-start !important;
    }

    /* Table - горизонтальный скролл */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table {
        min-width: 600px;
        font-size: 13px;
    }

    /* Modal - на весь экран */
    .modal-content {
        width: 100% !important;
        max-width: 100% !important;
        height: 100vh !important;
        margin: 0 !important;
        border-radius: 0 !important;
        max-height: 100vh !important;
        overflow-y: auto;
    }

    /* Dashboard quick actions */
    .quick-actions {
        grid-template-columns: 1fr !important;
    }

    /* Filters */
    .filters {
        flex-direction: column !important;
        gap: 12px !important;
    }

    /* Action buttons */
    .action-buttons {
        flex-wrap: wrap !important;
    }

    /* Padding adjustments */
    .main-content {
        padding: 16px !important;
    }

    .card {
        margin-bottom: 16px;
    }

    .card-body {
        padding: 16px;
    }

    /* Typography */
    h1 {
        font-size: 24px;
    }

    h2 {
        font-size: 20px;
    }

    h3 {
        font-size: 18px;
    }

    /* Project card */
    .project-card {
        padding: 16px;
    }

    .project-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start !important;
    }
}

/* Маленькие телефоны (480px) */
@media screen and (max-width: 480px) {
    /* Еще более компактные отступы */
    .main-content {
        padding: 12px !important;
    }

    .card-body {
        padding: 12px;
    }

    /* Buttons - stack */
    .action-buttons button {
        width: 100%;
        margin-bottom: 8px;
    }

    /* Typography */
    h1 {
        font-size: 20px;
    }

    h2 {
        font-size: 18px;
    }

    h3 {
        font-size: 16px;
    }

    /* Stats card */
    .stat-value {
        font-size: 24px !important;
    }

    /* Table */
    .table {
        font-size: 12px;
        min-width: 500px;
    }

    .table th,
    .table td {
        padding: 8px 4px;
    }

    /* Buttons smaller text */
    .btn {
        font-size: 14px;
        padding: 10px 16px;
    }

    .btn-sm {
        font-size: 12px;
        padding: 6px 10px;
    }

    /* Search box */
    .search-box input {
        font-size: 14px;
    }

    /* Mobile menu button smaller */
    .mobile-menu-toggle {
        width: 50px;
        height: 50px;
        font-size: 20px;
        bottom: 16px;
        right: 16px;
    }
}

/* ========== АДАПТИВНОЕ ОТОБРАЖЕНИЕ ИНВЕНТАРЯ ========== */
/* По умолчанию показываем таблицу на десктопе */
.inventory-table-container {
    display: block;
}

.inventory-cards-container {
    display: none;
}

/* На мобильных устройствах (768px и меньше) показываем карточки */
@media (max-width: 768px) {
    .inventory-table-container {
        display: none;
    }

    .inventory-cards-container {
        display: block;
    }
}