/* ========================================
   MODERN PAGE HEADER & ENHANCEMENTS
   Additional styles for improved interface
   ======================================== */

.page-header {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    color: white;
    padding: 12px 16px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-left h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
}

.header-right {
    display: flex;
    gap: 12px;
}

.page-header .search-bar {
    flex: 1;
    max-width: 400px;
    margin: 0;
}

.back-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateX(-3px);
    color: white;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: rotate(180deg);
}

.page-header .search-bar {
    max-width: 600px;
    margin: 0 auto;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 48px 32px;
    background: #ffffff;
    border-radius: 14px;
    margin: 32px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.empty-state i {
    font-size: 4rem;
    color: #999999;
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 1.5rem;
    color: #222222;
    margin-bottom: 12px;
}

.empty-state p {
    color: #666666;
    font-size: 1rem;
}

/* Modern Document Card */
.modern-doc-card {
    position: relative;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modern-doc-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.modern-doc-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #1976d2 60%, #64b5f6 100%);
    opacity: 0;
    transition: all 0.2s ease;
}

.modern-doc-card:hover::after {
    opacity: 1;
}

/* Enhanced Filter Buttons */
.filter-btn {
    position: relative;
    overflow: hidden;
}

.filter-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(52, 152, 219, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.filter-btn:active::before {
    width: 300px;
    height: 300px;
}

.filter-btn i {
    margin-right: 8px;
}

/* Alert Styles */
.alert {
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    border-left: 4px solid;
    animation: slideInDown 0.4s ease-out;
}

.alert-danger {
    background: #ffebee;
    border-left-color: #c62828;
    color: #c62828;
}

.alert-success {
    background: #e8f5e9;
    border-left-color: #2e7d32;
    color: #2e7d32;
}

.alert-info {
    background: #e3f2fd;
    border-left-color: #1565c0;
    color: #1565c0;
}

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

/* Enhanced Bottom Menu */
.bottom-menu {
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
    border-top: 1px solid #f0f0f0;
}

.bottom-menu .menu-item {
    position: relative;
    transition: all 0.2s ease;
}

.bottom-menu .menu-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #1976d2 60%, #64b5f6 100%);
    transition: all 0.2s ease;
}

.bottom-menu .menu-item:hover::before,
.bottom-menu .menu-item.active::before {
    width: 60%;
}

/* Improved Search Bar */
.search-bar input:focus {
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.2);
    border-color: #1976d2;
}

/* Loading Animation */
.loading-spinner {
    border: 3px solid #f0f0f0;
    border-top: 3px solid #1976d2;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 32px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Profile Card */
.profile-card {
    margin-bottom: 24px;
    padding: 24px;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 20px;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: white;
}

.profile-info h3 {
    font-size: 1.5rem;
    margin-bottom: 4px;
    color: #222222;
}

.profile-role {
    color: #666666;
    font-size: 0.95rem;
}

/* Modern Setting Item */
.modern-setting-item {
    display: flex;
    align-items: center;
    padding: 18px;
    gap: 16px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #ffffff;
}

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

.modern-setting-item:hover {
    background: #f5f7fa;
    transform: translateX(5px);
}

.setting-icon {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    background: #e3f2fd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: #1976d2;
    flex-shrink: 0;
}

.setting-icon.admin-icon {
    background: #f3e5f5;
    color: #9C27B0;
}

.setting-icon.logout-icon {
    background: #ffebee;
    color: #c62828;
}

.setting-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.setting-title {
    font-size: 1.1rem;
    font-weight: 500;
    color: #222222;
    margin-bottom: 4px;
}

.setting-description {
    font-size: 0.85rem;
    color: #666666;
}

.setting-arrow {
    color: #999999;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.modern-setting-item:hover .setting-arrow {
    transform: translateX(5px);
    color: #1976d2;
}

.logout-item:hover .setting-arrow {
    color: #c62828;
}

/* Responsive Settings */
@media (max-width: 480px) {
    .profile-avatar {
        width: 60px;
        height: 60px;
        font-size: 2rem;
    }
    
    .profile-info h3 {
        font-size: 1.2rem;
    }
    
    .modern-setting-item {
        padding: 14px;
    }
    
    .setting-icon {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
    
    .setting-title {
        font-size: 1rem;
    }
    
    .setting-description {
        font-size: 0.8rem;
    }
}

/* Responsive Page Header */
@media (max-width: 480px) {
    .page-header {
        padding: 16px;
    }
    
    .header-left h1 {
        font-size: 1.125rem;
    }
    
    .back-btn, .icon-btn {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
    
    .empty-state {
        padding: 24px;
    }
    
    .empty-state i {
        font-size: 3rem;
    }
    
    .empty-state h3 {
        font-size: 1.125rem;
    }
}
/* ========================================
   ЛЕВОЕ МЕНЮ ДЛЯ ДЕСКТОПА
   ======================================== */

.side-menu {
    position: fixed;
    left: 0;
    top: 0;
    width: 260px;
    height: 100vh;
    background: linear-gradient(180deg, #2c3e50 0%, #34495e 100%);
    color: white;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
}

.menu-header {
    padding: 20px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.3rem;
    font-weight: 700;
    color: #3498db;
}

.menu-nav {
    flex: 1;
    padding: 16px 0;
    display: flex;
    flex-direction: column;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    margin: 0 8px;
    border-radius: 0 8px 8px 0;
}

.menu-link:hover {
    background-color: rgba(52, 152, 219, 0.1);
    color: #3498db;
    border-left-color: #3498db;
    padding-left: 20px;
}

.menu-link.active {
    background-color: rgba(52, 152, 219, 0.2);
    color: #3498db;
    border-left-color: #3498db;
    font-weight: 600;
}

.menu-link i {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

.menu-link span {
    flex: 1;
    white-space: nowrap;
}

.logout-link {
    color: rgba(255, 107, 107, 0.8);
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 14px;
}

.logout-link:hover {
    background-color: rgba(255, 107, 107, 0.1);
    color: #ff6b6b;
    border-left-color: #ff6b6b;
}

/* Adjust body margin when side menu is present */
@media (min-width: 768px) {
    body.has-side-menu {
        margin-left: 280px;
    }
    
    body.has-side-menu .bottom-menu {
        display: none !important;
    }
}

/* На мобилах скрываем левое меню */
@media (max-width: 767px) {
    .side-menu {
        display: none !important;
    }
    
    body.has-side-menu {
        margin-left: 0;
    }
}

/* PWA install modal */
.pwa-install-modal {
    position: fixed;
    inset: 0;
    z-index: 3000;
}

.pwa-install-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}

.pwa-install-dialog {
    position: relative;
    z-index: 1;
    width: min(92vw, 440px);
    margin: 12vh auto 0;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.24);
    padding: 18px;
}

.pwa-install-dialog h2 {
    margin: 0 28px 8px 0;
    font-size: 1.2rem;
    color: #1f2f3d;
}

.pwa-modal-close {
    position: absolute;
    right: 10px;
    top: 10px;
    border: 0;
    background: transparent;
    color: #55606b;
    font-size: 1rem;
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 50%;
}

.pwa-modal-close:hover {
    background: #eef2f5;
}

.pwa-install-status {
    margin: 0 0 14px 0;
    font-size: 0.95rem;
    color: #3e4a56;
}

.pwa-install-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.pwa-install-btn,
.pwa-guide-btn,
.pwa-skip-btn {
    border: 0;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.pwa-install-btn {
    background: #1e78d6;
    color: #ffffff;
}

.pwa-guide-btn {
    background: #e9f2fb;
    color: #1e5f97;
}

.pwa-skip-btn {
    background: #f0f2f5;
    color: #4f5963;
}

.pwa-install-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

body.pwa-modal-open {
    overflow: hidden;
}

@media (max-width: 600px) {
    .pwa-install-dialog {
        margin-top: 8vh;
        padding: 16px;
    }

    .pwa-install-btn,
    .pwa-guide-btn,
    .pwa-skip-btn {
        width: 100%;
        justify-content: center;
    }
}