* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #3C3F18;
    --secondary: #2A2C11;
    --dark: #1E1F0C;
    --gold: #e6c619;
    --gold-dark: #d4b516;
    --text-light: #b8a84e;
    --text-dark: #5a5d2e;
    --success: #27ae60;
    --danger: #e74c3c;
    --warning: #f39c12;
    --white: #ffffff;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #1E1F0C;
    min-height: 100vh;
    color: #e6c619;
}

/* Навігація */
.navbar {
    background: linear-gradient(135deg, #2A2C11 0%, #1E1F0C 100%);
    box-shadow: 0 4px 20px rgba(230, 198, 25, 0.3);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 3px solid #e6c619;
}

.nav-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 30px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 30px;
    min-height: 70px;
}

.mobile-menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(230, 198, 25, 0.2);
    border: 2px solid #e6c619;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.5rem;
    color: #e6c619;
    transition: all 0.3s;
}

.mobile-menu-toggle:hover {
    background: rgba(230, 198, 25, 0.3);
}

.nav-brand {
    color: #e6c619;
    font-size: 1.4rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 12px;
    text-shadow: 0 2px 10px rgba(230, 198, 25, 0.4);
    white-space: nowrap;
}

.nav-brand span:first-child {
    font-size: 2rem;
    filter: drop-shadow(0 0 15px rgba(230, 198, 25, 0.6));
}

.nav-menu {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.nav-link {
    color: #b8a84e;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 10px;
    transition: all 0.3s ease;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    border: 2px solid transparent;
}

.nav-link:hover {
    background: rgba(230, 198, 25, 0.1);
    color: #e6c619;
    border-color: #e6c619;
    transform: translateY(-2px);
}

.nav-link.active {
    background: linear-gradient(135deg, #e6c619 0%, #d4b516 100%);
    color: #1E1F0C;
    font-weight: 800;
    box-shadow: 0 4px 15px rgba(230, 198, 25, 0.5);
    border-color: #e6c619;
}

.nav-user {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 8px 15px;
    background: rgba(60, 63, 24, 0.5);
    border-radius: 12px;
    border: 2px solid #3C3F18;
}

.mobile-only {
    display: none;
}

.desktop-only {
    display: flex;
}

.nav-user span:first-child {
    color: #e6c619;
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
}

.role-badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
}

.role-hetman { 
    background: linear-gradient(135deg, #e6c619 0%, #d4b516 100%);
    color: #1E1F0C;
}
.role-deputy { 
    background: #3498db; 
}
.role-speaker { 
    background: #e67e22; 
}
.role-passport_officer { 
    background: #16a085; 
}
.role-admin { 
    background: #c0392b; 
}
.role-citizen { 
    background: #95a5a6; 
}

.btn-logout {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    display: inline-block;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
}

.btn-logout:hover {
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.5);
}

/* Основний контент */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0;
}

.page {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Авторізація */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 90vh;
    padding: 20px;
}

.auth-card {
    background: linear-gradient(135deg, #3C3F18 0%, #2A2C11 100%);
    padding: 50px 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(230, 198, 25, 0.3);
    text-align: center;
    max-width: 450px;
    width: 100%;
    border: 2px solid #e6c619;
}

.auth-icon {
    font-size: 5rem;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 20px rgba(230, 198, 25, 0.5));
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        filter: drop-shadow(0 0 20px rgba(230, 198, 25, 0.5));
    }
    50% {
        transform: scale(1.05);
        filter: drop-shadow(0 0 30px rgba(230, 198, 25, 0.8));
    }
}

.auth-card h1 {
    color: #e6c619;
    margin-bottom: 15px;
    font-size: 1.8rem;
    text-shadow: 0 2px 8px rgba(230, 198, 25, 0.3);
}

.auth-card p {
    color: #b8a84e;
    margin-bottom: 30px;
    font-size: 1.1rem;
}

.auth-card input {
    width: 100%;
    padding: 15px;
    border: 2px solid #e6c619;
    border-radius: 10px;
    font-size: 1.1rem;
    margin-bottom: 20px;
    transition: all 0.3s;
    background: #1E1F0C;
    color: #e6c619;
}

.auth-card input::placeholder {
    color: #5a5d2e;
}

.auth-card input:focus {
    outline: none;
    border-color: #d4b516;
    box-shadow: 0 0 0 4px rgba(230, 198, 25, 0.2);
}

.auth-details {
    margin-top: 25px;
    text-align: left;
}

.auth-details summary {
    cursor: pointer;
    color: #e6c619;
    font-weight: bold;
    padding: 10px;
    border-radius: 8px;
    transition: all 0.3s;
}

.auth-details summary:hover {
    background: #2A2C11;
}

.passport-list {
    margin-top: 15px;
    padding: 15px;
    background: #1E1F0C;
    border-radius: 8px;
    border: 2px solid #3C3F18;
    max-height: 300px;
    overflow-y: auto;
}

.passport-item {
    cursor: pointer;
    padding: 10px;
    margin-bottom: 8px;
    background: #2A2C11;
    border-radius: 6px;
    color: #b8a84e;
    font-size: 0.95rem;
    transition: all 0.3s;
    border: 1px solid #3C3F18;
}

.passport-item:hover {
    background: #3C3F18;
    color: #e6c619;
    transform: translateX(5px);
    border-color: #e6c619;
}

.passport-item strong {
    color: #e6c619;
}

/* Кнопки */
.btn-primary,
.btn-success,
.btn-danger,
.btn-warning {
    padding: 14px 28px;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 700;
}

.btn-primary { 
    background: linear-gradient(135deg, #e6c619 0%, #d4b516 100%);
    color: #1E1F0C;
    box-shadow: 0 4px 15px rgba(230, 198, 25, 0.4);
}

.btn-success { 
    background: #27ae60;
    color: white;
}

.btn-danger { 
    background: #e74c3c;
    color: white;
}

.btn-warning { 
    background: #f39c12;
    color: white;
}

.btn-primary:hover { 
    background: linear-gradient(135deg, #d4b516 0%, #c5a028 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(230, 198, 25, 0.5);
}

.btn-success:hover { 
    background: #229954;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.4);
}

.btn-danger:hover { 
    background: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.4);
}

.btn-warning:hover { 
    background: #e67e22;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.4);
}

.btn-primary:active,
.btn-success:active,
.btn-danger:active,
.btn-warning:active {
    transform: scale(0.98);
}

/* Повідомлення */
.error-message {
    color: #e74c3c;
    margin-top: 15px;
    font-weight: 600;
    padding: 15px;
    background: rgba(231, 76, 60, 0.1);
    border-radius: 10px;
    border: 2px solid #e74c3c;
    display: block;
    animation: shake 0.5s;
    font-size: 1rem;
    text-align: center;
}

.error-message:empty {
    display: none;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.success-message {
    color: #27ae60;
    margin-top: 15px;
    font-weight: 600;
    padding: 10px;
    background: rgba(39, 174, 96, 0.1);
    border-radius: 8px;
    border: 1px solid #27ae60;
}

/* Скролбар */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #1E1F0C;
}

::-webkit-scrollbar-thumb {
    background: #3C3F18;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #e6c619;
}

/* Адаптивність */
@media (max-width: 768px) {
    .navbar {
        position: relative;
    }
    
    .nav-container {
        grid-template-columns: auto 1fr;
        padding: 10px 15px;
        gap: 10px;
        min-height: 60px;
    }
    
    .desktop-only {
        display: none !important;
    }
    
    .mobile-only {
        display: flex !important;
    }
    
    .mobile-menu-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        background: rgba(230, 198, 25, 0.2);
        border: 2px solid #e6c619;
        border-radius: 8px;
        cursor: pointer;
        font-size: 1.5rem;
        color: #e6c619;
        transition: all 0.3s;
    }
    
    .mobile-menu-toggle:hover {
        background: rgba(230, 198, 25, 0.3);
    }
    
    .nav-brand {
        font-size: 1.1rem;
        justify-content: center;
        flex: 1;
    }
    
    .nav-brand span:first-child {
        font-size: 1.5rem;
    }
    
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: linear-gradient(135deg, #2A2C11 0%, #1E1F0C 100%);
        flex-direction: column;
        gap: 0;
        padding: 10px;
        border-bottom: 3px solid #e6c619;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
        z-index: 999;
        grid-column: 1 / -1;
    }
    
    .nav-menu.active {
        display: flex !important;
    }
    
    .nav-link {
        width: 100%;
        text-align: left;
        padding: 12px 15px;
        border-radius: 8px;
        margin-bottom: 5px;
    }
    
    .nav-menu .nav-user {
        width: 100%;
        justify-content: space-between;
        padding: 12px 15px;
        margin-top: 10px;
        border-top: 2px solid #3C3F18;
        background: rgba(60, 63, 24, 0.3);
    }
    
    .nav-menu .nav-user span:first-child {
        display: block !important;
    }
    
    .role-badge {
        padding: 6px 12px;
        font-size: 0.75rem;
    }
    
    .btn-logout {
        padding: 8px 14px;
        font-size: 0.85rem;
    }
}

@media (min-width: 769px) {
    .mobile-menu-toggle {
        display: none !important;
    }
    
    .mobile-only {
        display: none !important;
    }
    
    .desktop-only {
        display: flex !important;
    }
}

@media (max-width: 1400px) and (min-width: 769px) {
    .nav-container {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 10px 15px;
    }
    
    .nav-brand {
        justify-content: center;
        font-size: 1.2rem;
        padding: 5px 0;
    }
    
    .nav-brand span:first-child {
        font-size: 1.5rem;
    }
    
    .nav-menu {
        order: 2;
        width: 100%;
        gap: 5px;
    }
    
    .nav-link {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    
    .nav-user {
        order: 1;
        width: 100%;
        justify-content: space-between;
        padding: 6px 10px;
        margin-bottom: 5px;
    }
    
    .nav-user span:first-child {
        font-size: 0.85rem;
    }
    
    .role-badge {
        padding: 4px 10px;
        font-size: 0.75rem;
    }
    
    .btn-logout {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}

@media (max-width: 1024px) and (min-width: 769px) {
    .nav-menu {
        flex-direction: column;
        gap: 5px;
    }
    
    .nav-link {
        width: 100%;
        text-align: center;
        padding: 10px;
    }
}

@media (max-width: 768px) {
    .nav-brand {
        font-size: 1.2rem;
    }

    .nav-icon {
        font-size: 1.5rem;
    }

    .auth-card {
        padding: 40px 30px;
    }

    .auth-card h1 {
        font-size: 1.5rem;
    }

    .auth-icon {
        font-size: 4rem;
    }
}

@media (max-width: 480px) {
    .auth-card {
        padding: 30px 20px;
    }

    .auth-card h1 {
        font-size: 1.3rem;
    }

    .auth-card p {
        font-size: 0.95rem;
    }

    .auth-icon {
        font-size: 3rem;
    }

    .btn-primary, .btn-success, .btn-danger, .btn-warning {
        padding: 12px 20px;
        font-size: 1rem;
    }
}