/* Основные стили для темной темы */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&display=swap');

:root {
    --primary-color: #1a1a1a;
    --secondary-color: #2c2c2c;
    --accent-color: #dc3545;
    --orange-color: #005b96;
    --mil-blue-dark: #003366;
    --mil-header-bg: #00427a;
    --mil-nav-bg: #002a4d;
    --text-light: #ffffff;
    --text-muted: #cccccc;
    --border-color: #444444;
    --hover-color: #b52d3c;
    
    --light-bg: #ffffff;
    --light-text: #333333;
    --light-card-bg: #f8f9fa;
    --light-border: #dee2e6;
    --light-muted: #6c757d;
    --light-header-bg: #e9ecef;

    /* Fonts */
    /* --font-main: 'Inter', system-ui, -apple-system, sans-serif; */
    --font-main: 'Times New Roman', system-ui, -apple-system, sans-serif;
    --font-heading: 'Playfair Display', serif;
}

.text-muted {
    color: #cccccc !important;
}

.rank-display {
    padding: 8px 0;
}

.rank-image-container {
    display: inline-block;
}

.rank-image {
    display: block;
}

.rank-info {
    font-size: 11px;
    line-height: 1.3;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--primary-color);
    color: var(--text-light);
    font-family: var(--font-main);
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6, .ministry-title, .hero-title, .modal-title {
    font-family: var(--font-heading);
}

.main-header {
    background-color: transparent;
    padding: 0;
    border: none;
}

/* Top Bar */
.header-top-bar {
    background-color: #1e1e1e;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.85rem;
}

.light-theme .header-top-bar {
    background-color: #f0f2f5;
    border-bottom: 1px solid #dce1e6;
}

.top-bar-link {
    color: #aaa;
    text-decoration: none;
    transition: all 0.2s ease;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
}

.light-theme .top-bar-link {
    color: #5c6c7f;
}

.top-bar-link:hover, .top-bar-link.active {
    color: var(--text-light);
}

.light-theme .top-bar-link:hover, .light-theme .top-bar-link.active {
    color: var(--mil-blue-dark);
}

/* Brand Area */
.header-brand-area {
    background: linear-gradient(135deg, var(--mil-header-bg), #003366);
    color: #fff;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    position: relative;
    z-index: 10;
}

.brand-logo {
    height: 90px;
    width: auto;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.2));
    transition: transform 0.3s ease;
}


.brand-text {
    color: #fff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.brand-title {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.02em;
}

.brand-subtitle {
    font-family: var(--font-main);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.25em;
    opacity: 0.9;
    margin-top: 6px;
    text-shadow: none;
}

/* Legacy styles for compatibility if needed */
.document-upload-item.mb-4 {
    border-bottom: 1px solid #00000017;
    padding-bottom: 15px;
}

.orange-bar {
    background-color: var(--mil-nav-bg);
    padding: 0;
    height: 54px;
    border-bottom: 3px solid var(--accent-color);
}

.orange-bar-content {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    height: 100%;
    position: relative;
}

.nav-links {
    display: flex;
    gap: 10px;
    list-style: none;
    height: 100%;
    margin: 0;
    padding: 0;
}

.nav-links li {
    display: flex;
    align-items: center;
    height: 100%;
}

.nav-links a {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 15px;
    font-family: var(--font-main);
}

.nav-links a:hover {
    background-color: rgba(255,255,255,0.05);
    color: #fff;
}

.social-icons {
    display: flex;
    gap: 15px;
    align-items: center;
    height: 100%;
    position: absolute;
    right: 20px;
}

.social-icon {
    width: 24px;
    height: 24px;
    transition: transform 0.3s;
}

.social-icon:hover {
    transform: scale(1.1);
}

.main-content {
    max-width: 1200px;
    margin: 0 auto;
    /* padding: 40px 20px; */
}

.content-card {
    background-color: var(--secondary-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.content-card h3 {
    color: var(--text-light);
    margin-bottom: 15px;
    font-size: 18px;
}

.content-card p {
    color: var(--text-muted);
    margin-bottom: 0;
}

.btn-primary {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: var(--text-light);
    font-weight: 500;
    padding: 5px 20px;
    border-radius: 4px;
    transition: all 0.3s;
}

.btn-primary:hover {
    background-color: var(--hover-color);
    border-color: var(--hover-color);
    transform: translateY(-1px);
}

.btn-outline-light {
    border-color: var(--text-light);
    color: var(--text-light);
}

.btn-outline-light:hover {
    background-color: var(--text-light);
    color: var(--primary-color);
}

.form-control {
    background-color: var(--secondary-color);
    border-color: var(--border-color);
    color: var(--text-light);
}

.form-control:focus {
    background-color: var(--secondary-color);
    border-color: var(--accent-color);
    color: var(--text-light);
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-label {
    color: var(--text-light);
    font-weight: 500;
}

.dashboard-container {
    background-color: var(--secondary-color);
    border-radius: 8px;
    margin: 20px 0;
    overflow: hidden;
}

.dashboard-header {
    background-color: var(--accent-color);
    color: var(--text-light);
    padding: 15px 20px;
    font-weight: 600;
}

.user-info {
    padding: 20px;
}

.user-avatar {
    width: 120px;
    height: 120px;
    border: 1px solid;
    border-radius: 8px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: var(--text-muted);
    margin-bottom: 20px;
    overflow: hidden;
    position: relative;
}

.user-avatar.avatar-clickable {
    cursor: pointer;
}

.user-avatar .avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.avatar-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 8px;
    pointer-events: none;
}

.user-avatar.avatar-clickable:hover .avatar-overlay {
    opacity: 1;
}

.avatar-overlay i {
    font-size: 40px;
    color: #ffffff;
}

.user-details {
    display: grid;
    gap: 15px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.detail-label {
    font-weight: 500;
    color: var(--text-muted);
}

.detail-value {
    color: var(--text-light);
}

.documents-section {
    margin-top: 30px;
}

.document-item {
    background-color: var(--secondary-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.document-info h6 {
    color: var(--text-light);
    margin-bottom: 5px;
}

.document-info small {
    color: var(--text-muted);
}

.document-actions {
    display: flex;
    gap: 10px;
}

.settings-card {
    background-color: var(--secondary-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 20px;
}

.settings-card-header {
    background-color: var(--border-color);
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
}

.settings-card-body {
    padding: 20px;
}

.modal-content {
    background-color: var(--secondary-color);
    border: 1px solid var(--border-color);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
}

.modal-footer {
    border-top: 1px solid var(--border-color);
}

.alert {
    border-radius: 6px;
}

.alert-danger {
    background-color: rgba(220, 53, 69, 0.1);
    border-color: var(--accent-color);
    color: #f53648;
}

.alert-success {
    background-color: rgba(40, 167, 69, 0.1);
    border-color: #28a745;
    color: #28a745;
}

@media (max-width: 768px) {

    .header-divider {
        width: 100%;
        height: 1px;
    }

    .header-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .header-left {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .header-right {
        flex-direction: column;
        gap: 15px;
    }
    
    .orange-bar {
        height: auto;
        padding: 15px 0;
    }
    
    .orange-bar-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
        height: auto;
    }
    
    .nav-links {
        flex-direction: column;
        gap: 15px;
        text-align: center;
        height: auto;
    }
    
    .nav-links li {
        height: auto;
        justify-content: center;
    }
    
    .nav-links a {
        height: auto;
        justify-content: center;
    }
    
    .social-icons {
        height: auto;
    }
    
    .mo-logo {
        height: 60px;
    }
    
    .ministry-title {
        font-size: 16px;
        max-width: none;
    }
}

.light-theme {
    background-color: var(--light-bg);
    color: var(--light-text);
}

.light-theme .main-header {
    background-color: var(--mil-header-bg);
    border-bottom: none;
    color: #fff;
}

.light-theme .main-header .ministry-title {
    color: #fff !important;
}

.light-theme .header-section {
    color: rgba(255, 255, 255, 0.9) !important;
}

.light-theme .header-section:hover {
    color: #fff !important;
    opacity: 0.8;
}

.light-theme .header-divider {
    background-color: rgba(255, 255, 255, 0.2);
}

.light-theme .text-white {
    color: var(--light-text) !important;
}

.light-theme .text-muted {
    color: var(--light-muted) !important;
}

.light-theme h2.text-white {
    color: var(--light-text) !important;
}

.light-theme .content-card {
    background-color: var(--light-card-bg);
    border: 1px solid var(--light-border);
}

.light-theme .content-card h3 {
    color: var(--light-text);
}

.light-theme .content-card p {
    color: var(--light-muted);
}

.light-theme .dashboard-container {
    background-color: var(--light-card-bg);
    border: 1px solid var(--light-border);
}

.light-theme .dashboard-header {
    background-color: var(--orange-color);
}

.light-theme .detail-label {
    color: var(--light-muted);
    text-align: left;
}

.light-theme .detail-value {
    color: var(--light-text);
    text-align: right;
}

.light-theme .detail-item {
    border-bottom: 1px solid var(--light-border);
}

/* Документы в светлой теме */
.light-theme .document-item {
    background-color: var(--light-card-bg);
    border: 1px solid var(--light-border);
}

.light-theme .document-info h6 {
    color: var(--light-text);
}

.light-theme .document-info small {
    color: var(--light-muted);
}

.light-theme .document-upload-item h6 {
    color: var(--light-text) !important;
}

.light-theme .settings-card {
    background-color: var(--light-card-bg);
    border: 1px solid var(--light-border);
}

.light-theme .settings-card-header {
    background-color: var(--light-header-bg);
    border-bottom: 1px solid var(--light-border);
    color: var(--light-text);
}

.light-theme .form-control {
    background-color: var(--light-bg);
    border-color: #ced4da;
    color: var(--light-text);
}

.light-theme .form-control:focus {
    background-color: var(--light-bg);
    border-color: var(--orange-color);
    color: var(--light-text);
    box-shadow: 0 0 0 0.2rem rgba(0, 91, 150, 0.25);
}

.light-theme .form-control::placeholder {
    color: var(--light-muted);
}

.light-theme .form-label {
    color: var(--light-text);
}

.light-theme .btn-outline-light {
    border-color: var(--orange-color);
    color: var(--orange-color);
}

.light-theme .btn-outline-light:hover {
    background-color: var(--orange-color);
    border-color: var(--orange-color);
    color: white;
}

.light-theme .btn-outline-secondary {
    border-color: #ced4da;
    color: var(--light-muted);
    background-color: transparent;
    transition: all 0.3s ease;
}

.light-theme .btn-outline-secondary:hover {
    background-color: var(--mil-header-bg);
    border-color: var(--mil-header-bg);
    color: #fff;
}

.light-theme .btn-primary {
    background-color: var(--orange-color);
    border-color: var(--orange-color);
}

.light-theme .btn-primary:hover {
    background-color: var(--mil-blue-dark);
    border-color: var(--mil-blue-dark);
}

.light-theme .modal-content {
    background-color: var(--light-bg);
    border: 1px solid var(--light-border);
}

.light-theme .modal-header {
    border-bottom: 1px solid var(--light-border);
}

.light-theme .modal-footer {
    border-top: 1px solid var(--light-border);
}

.light-theme footer {
    background-color: var(--mil-header-bg) !important;
    border-top: none !important;
    padding: 20px 0;
    margin-top: 50px;
    color: rgba(255, 255, 255, 0.8);
}

.light-theme footer a {
    color: rgba(255, 255, 255, 0.9) !important;
    text-decoration: none;
    transition: color 0.2s;
}

.light-theme footer a:hover {
    color: #fff !important;
    text-decoration: underline;
}

.light-theme footer .text-muted {
    color: rgba(255, 255, 255, 0.6) !important;
}

.biography-content {
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 15px;
}

.biography-content p {
    line-height: 1.6;
    font-size: 14px;
}

button[data-bs-toggle="collapse"] i {
    transition: transform 0.3s ease;
}

button[data-bs-toggle="collapse"][aria-expanded="true"] i {
    transform: rotate(180deg);
}

.light-theme .biography-content {
    background-color: rgba(0, 0, 0, 0.05);
    border-left-color: var(--orange-color);
}

.light-theme .biography-content p {
    color: var(--light-text);
}

.nav-links .dropdown-menu {
    background-color: var(--orange-color);
    border: none;
    border-radius: 0;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    min-width: 200px;
    z-index: 1050;
    margin-top: 0;
    position: absolute;
    top: 100%;
}

.nav-links .dropdown-item {
    color: white;
    padding: 8px 16px;
    transition: background-color 0.2s;
}

.nav-links .dropdown-item:hover,
.nav-links .dropdown-item:focus {
    background-color: rgba(255,255,255,0.1);
    color: white;
}

.nav-links .dropdown-toggle::after {
    display: none;
}

.nav-links .dropdown-toggle i {
    font-size: 0.8em;
    transition: transform 0.2s;
}

.nav-links .dropdown[aria-expanded="true"] .dropdown-toggle i {
    transform: rotate(180deg);
}

.nav-links .dropdown {
    position: relative;
}

.time-span {
    font-size: 0.75em;
    opacity: 0.6;
    color: var(--text-muted);
    font-weight: 300;
    margin-left: 0.25em;
}

.light-theme .time-span {
    color: var(--light-muted);
    opacity: 0.7;
}

.single-photo-block {
    width: 1024px;
    height: 450px;
    margin: 40px auto;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.main-homepage-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.light-theme .single-photo-block {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

@media (max-width: 1100px) {
    .single-photo-block {
        width: 95%;
        max-width: 1024px;
        height: auto;
        aspect-ratio: 1024/450;
        margin: 20px auto;
    }
}

@media (max-width: 576px) {
    .single-photo-block {
        margin: 15px;
        width: calc(100% - 30px);
        border-radius: 4px;
    }
}

.dashboard-action-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 1rem;
}

.dashboard-action-item {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
}

.dashboard-action-item .action-label {
    font-size: 14px;
    color: var(--text-muted);
    min-width: 100px;
    flex-shrink: 0;
    font-weight: 500;
}

.dashboard-action-item .btn {
    flex: 1;
    min-height: 32px;
    font-size: 13px;
    padding: 6px 12px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.light-theme .dashboard-action-item .action-label {
    color: var(--light-muted);
}


@media (max-width: 768px) {
    .dashboard-action-item {
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
    }
    
    .dashboard-action-item .action-label {
        min-width: auto;
        text-align: center;
        font-size: 13px;
    }
    
    .dashboard-action-item .btn {
        width: 100%;
    }
}

.user-awards-display {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.award-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    border-radius: 2px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.award-icon:hover {
    transform: scale(1.2);
    opacity: 0.8;
}

@media (max-width: 768px) {
    .award-icon {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 576px) {
    .award-icon {
        width: 18px;
        height: 18px;
    }
    
    .user-awards-display {
        gap: 4px;
    }
}

/* ============================================
   Стили из department.php
   ============================================ */
body.light-theme .content-card {
    background: #fff;
    color: #000;
}

body.light-theme .content-card h1,
body.light-theme .content-card h2,
body.light-theme .content-card h3 {
    color: #111;
}

body.light-theme .content-card p {
    color: #444;
}

.department-content {
    line-height: 1.6;
}

.department-content h1,
.department-content h2,
.department-content h3,
.department-content h4,
.department-content h5,
.department-content h6 {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.department-content ul,
.department-content ol {
    margin-bottom: 1rem;
}

.department-content img {
    max-width: 100%;
    height: auto;
    margin: 1rem 0;
}

/* ============================================
   Стили из index.php (Legacy - Removed for 2025 Redesign)
   ============================================ */


/* ============================================
   Стили из leaders.php
   ============================================ */
body.light-theme .accordion-item {
    background-color: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.125);
    margin-bottom: 1rem;
}

body.light-theme .accordion-button {
    background-color: rgba(255, 255, 255, 0.9);
    color: #000;
    font-weight: 700;
    font-size: 1.2rem;
    text-align: center;
    justify-content: center;
}

body.light-theme .accordion-button:not(.collapsed) {
    color: #000;
}

body.light-theme .accordion-body {
    background-color: #fff;
    color: #333;
}

.leader-item {
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    padding: 30px 20px;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: flex-start;
    gap: 30px;
}

.leader-item:hover {
    background-color: #f8f9fa;
}

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

.leader-item:nth-child(even) {
    flex-direction: row-reverse;
}

.leader-photo-container {
    flex-shrink: 0;
}

.leader-photo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #e9ecef;
    display: block;
}

.no-photo-placeholder {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background-color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
}

.leader-info {
    flex: 1;
    text-align: left;
}

.leader-item:nth-child(even) .leader-info {
    text-align: right;
}

.leader-name {
    font-size: 1.4rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 12px;
    line-height: 1.3;
}

.leader-position {
    color: #6c757d;
    font-weight: 500;
    margin-bottom: 16px;
    font-size: 1rem;
    line-height: 1.4;
}

.biography-toggle {
    background: none;
    border: none;
    color: #007bff;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 4px 8px;
    text-decoration: none;
    transition: color 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.biography-toggle:hover {
    color: #0056b3;
    text-decoration: underline;
}

.leader-biography {
    margin-top: 16px;
    padding: 16px;
    border-top: 1px solid #e9ecef;
    color: #495057;
    line-height: 1.6;
    font-size: 0.95rem;
    text-align: left;
    background-color: #f8f9fa;
    border-radius: 6px;
}

.leader-biography.collapsed {
    display: none;
}

.chevron-icon {
    transition: transform 0.2s ease;
    font-size: 0.8rem;
}

.chevron-icon.expanded {
    transform: rotate(180deg);
}

.section-description {
    background: rgba(108, 117, 125, 0.1);
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-style: italic;
    color: #6c757d;
}

.leaders-list {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

@media (max-width: 768px) {
    .leader-item {
        padding: 20px 16px;
        flex-direction: column !important;
        text-align: center;
        gap: 20px;
    }
    
    .leader-info {
        text-align: center !important;
    }
    
    .leader-name {
        font-size: 1.2rem;
    }
    
    .leader-position {
        font-size: 0.9rem;
    }
    
    .leader-photo,
    .no-photo-placeholder {
        width: 120px;
        height: 120px;
        margin: 0 auto;
    }
}

/* ============================================
   Стили из login.php и register.php
   ============================================ */
body.light-theme.login-page,
body.light-theme.register-page {
    background-color: #ffffff;
    color: #333333;
}

body.light-theme.login-page .content-card,
body.light-theme.register-page .content-card {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
}

body.light-theme.login-page .card,
body.light-theme.register-page .card {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
}

body.light-theme.login-page .card-header,
body.light-theme.register-page .card-header {
    background-color: var(--orange-color);
    color: white;
}

body.light-theme.login-page .form-control,
body.light-theme.register-page .form-control {
    background-color: #ffffff;
    border-color: #ced4da;
    color: #333333;
}

body.light-theme.login-page .form-control:focus,
body.light-theme.register-page .form-control:focus {
    background-color: #ffffff;
    border-color: var(--orange-color);
    color: #333333;
    box-shadow: 0 0 0 0.2rem rgba(0, 91, 150, 0.25);
}

body.light-theme.login-page .form-label,
body.light-theme.register-page .form-label {
    color: #333333;
}

body.light-theme.login-page .form-check-label,
body.light-theme.register-page .form-check-label {
    color: #333333 !important;
}

body.light-theme.login-page .text-muted,
body.light-theme.register-page .text-muted {
    color: #6c757d !important;
}

body.light-theme.login-page footer,
body.light-theme.register-page footer {
    background-color: #f8f9fa !important;
    border-top: 1px solid #dee2e6 !important;
}

body.light-theme.login-page hr,
body.light-theme.register-page hr {
    border-color: #dee2e6 !important;
}

body.light-theme.login-page .btn-outline-light,
body.light-theme.register-page .btn-outline-light {
    border-color: var(--orange-color);
    color: var(--orange-color);
}

body.light-theme.login-page .btn-outline-light:hover,
body.light-theme.register-page .btn-outline-light:hover {
    background-color: var(--orange-color);
    border-color: var(--orange-color);
    color: white;
}

body.light-theme.login-page .input-group .btn-outline-secondary,
body.light-theme.register-page .input-group .btn-outline-secondary {
    border-color: #ced4da;
    color: #6c757d;
}

body.light-theme.login-page .input-group .btn-outline-secondary:hover,
body.light-theme.register-page .input-group .btn-outline-secondary:hover {
    background-color: #e9ecef;
    color: #495057;
}

body.light-theme.register-page .text-danger {
    color: var(--orange-color) !important;
}

/* ============================================
   Стили из news_item.php
   ============================================ */
.carousel-item img {
    max-height: 480px;
    object-fit: cover;
}

.news-card {
    background: #fff;
    color: #111;
}

.news-content {
    color: #222;
}

.news-content img {
    max-width: 100%;
    height: auto;
}

.news-meta {
    font-size: 0.875rem;
}

/* ============================================
   Стили из news.php
   ============================================ */
body.light-theme .card {
    background: #fff;
    color: #000;
}

body.light-theme .card .card-title {
    color: #111;
}

body.light-theme .card .card-text {
    color: #444 !important;
}

/* ============================================
   Стили из orders.php
   ============================================ */
.orders-container {
    background: white;
    border-radius: 6px;
    padding: 0;
    margin-bottom: 20px;
    display: flex;
    min-height: 80vh;
    border: 1px solid #e5e7eb;
}

.orders-list {
    flex: 0 0 35%;
    border-right: 1px solid #e5e7eb;
    padding: 20px;
    overflow-y: auto;
    max-height: 80vh;
}

.orders-preview {
    flex: 1;
    padding: 20px;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
}

.order-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 18px;
    margin-bottom: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.order-card:hover {
    border-color: var(--orange-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.order-card.selected {
    border-color: var(--orange-color);
    background: #fff;
    box-shadow: 0 2px 12px rgba(0, 91, 150, 0.15);
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 5px;
    flex-wrap: wrap;
    gap: 10px;
}

.order-number {
    background: var(--orange-color);
    color: white;
    padding: 3px 10px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.85em;
}

.order-date {
    color: #6b7280;
    font-size: 0.9em;
}

.order-user {
    color: #374151;
    font-weight: 500;
    margin-bottom: 10px;
}

.order-description {
    color: #374151;
    line-height: 1.5;
    padding: 8px;
}

.order-files {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 15px;
}

.file-link {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: #e9ecef;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    color: #495057;
    text-decoration: none;
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.2s ease;
}

.file-link:hover {
    background: var(--orange-color);
    border-color: var(--orange-color);
    color: white;
    text-decoration: none;
}

.file-link.active {
    background: var(--orange-color);
    border-color: var(--orange-color);
    color: white;
}

.preview-placeholder {
    text-align: center;
    color: #6b7280;
}

.preview-placeholder i {
    font-size: 4rem;
    opacity: 0.3;
    margin-bottom: 20px;
}

.document-preview {
    width: 100%;
    height: 100%;
    overflow: auto;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #dee2e6;
}

.preview-title {
    font-size: 1.1em;
    font-weight: 600;
    color: #374151;
    margin: 0;
}

.preview-actions {
    display: flex;
    gap: 10px;
}

#documentViewerModal .modal-dialog {
    max-width: 90vw;
    width: 90vw;
}

#documentContainer {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 20px;
}

.pdf-viewer,
.image-viewer {
    text-align: center;
}

.pdf-controls {
    background: white;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

.pdf-canvas {
    border: 1px solid #dee2e6;
    border-radius: 4px;
    max-width: 100%;
    height: auto;
}

.document-image {
    border: 1px solid #dee2e6;
    border-radius: 4px;
}

.order-meta {
    color: #6b7280;
    font-size: 0.8em;
    border-top: 1px solid #e5e7eb;
    padding-top: 5px;
}

.pagination-container {
    display: flex;
    justify-content: center;
    margin-top: 30px;
}

.pagination .page-link {
    background: white;
    border: 1px solid #d1d5db;
    color: #374151;
}

.pagination .page-link:hover {
    background: #f3f4f6;
    color: #111827;
}

.pagination .page-item.active .page-link {
    background: var(--orange-color);
    border-color: var(--orange-color);
    color: white;
}

.no-orders {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.orders-container h2 {
    color: #111827;
}

.orders-container .text-muted {
    color: #6b7280 !important;
}

@media (max-width: 768px) {
    .orders-container {
        flex-direction: column;
        min-height: auto;
    }
    
    .orders-list {
        flex: none;
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
        max-height: none;
        overflow-y: visible;
    }
    
    .orders-preview {
        min-height: 50vh;
    }
    
    .order-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .file-link {
        justify-content: flex-start;
    }
}

/* Стили для HTML-контента пользовательских разделов */
.content-html {
    line-height: 1.8;
    color: #333;
}

.content-html h1,
.content-html h2,
.content-html h3,
.content-html h4,
.content-html h5,
.content-html h6 {
    margin-top: 1.5em;
    margin-bottom: 0.75em;
    font-weight: 600;
    color: #1a1a1a;
}

.content-html h1 { font-size: 2em; }
.content-html h2 { font-size: 1.75em; }
.content-html h3 { font-size: 1.5em; }
.content-html h4 { font-size: 1.25em; }
.content-html h5 { font-size: 1.1em; }
.content-html h6 { font-size: 1em; }

.content-html p {
    margin-bottom: 1em;
}

.content-html ul,
.content-html ol {
    margin-bottom: 1em;
    padding-left: 2em;
}

.content-html li {
    margin-bottom: 0.5em;
}

.content-html a {
    color: #005b96;
    text-decoration: none;
}

.content-html a:hover {
    text-decoration: underline;
}

.content-html img {
    max-width: 100%;
    height: auto;
    margin: 1em 0;
    border-radius: 4px;
}

.content-html blockquote {
    border-left: 4px solid #005b96;
    padding-left: 1em;
    margin: 1em 0;
    color: #666;
    font-style: italic;
}

.content-html code {
    background-color: #f5f5f5;
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.content-html pre {
    background-color: #f5f5f5;
    padding: 1em;
    border-radius: 4px;
    overflow-x: auto;
    margin: 1em 0;
}

.content-html pre code {
    background-color: transparent;
    padding: 0;
}

.content-html table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
}

.content-html table th,
.content-html table td {
    border: 1px solid #ddd;
    padding: 0.75em;
    text-align: left;
}

.content-html table th {
    background-color: #f5f5f5;
    font-weight: 600;
}

.content-html hr {
    border: none;
    border-top: 2px solid #e0e0e0;
    margin: 2em 0;
}

.doc-tabs {
    display: flex;
    margin-bottom: 15px;
    border-bottom: 1px solid #dee2e6;
}

.doc-tab {
    padding: 8px 16px;
    text-decoration: none;
    color: #495057;
    border-bottom: 2px solid transparent;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.doc-tab:hover {
    color: var(--orange-color);
}

.doc-tab.active {
    color: var(--orange-color);
    border-bottom-color: var(--orange-color);
}

.count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    margin-left: 8px;
    background: #6c757d;
    color: white;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
}

.doc-tab.active .count-badge {
    background: var(--orange-color);
}

.orders-container {
    flex: 1;
    display: flex;
    overflow: hidden;
    margin-bottom: 0;
    border-radius: 0;
    border: none;
    border-top: 1px solid #e5e7eb;
    background: #fff;
    min-height: 0;
}

.orders-list-wrapper {
    flex: 0 0 35%;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #e5e7eb;
    background: #fff;
    min-width: 300px;
}

.orders-search-area {
    padding: 15px;
    border-bottom: 1px solid #e5e7eb;
    background: #f8f9fa;
}

.orders-list {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    border-right: none;
    max-height: none;
}

.orders-preview {
    flex: 1;
    overflow-y: auto;
    background: #f8f9fa;
    padding: 20px;
    min-height: 0;
}

.coming-soon-box {
    background: white;
    border-radius: 8px;
    padding: 60px 40px;
    text-align: center;
    margin: 40px auto;
    max-width: 500px;
}

.coming-soon-icon {
    font-size: 4rem;
    color: var(--orange-color);
    margin-bottom: 20px;
}

.coming-soon-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
}

.coming-soon-text {
    color: #6c757d;
    font-size: 1rem;
    line-height: 1.6;
}

body.orders-page html,
body.orders-page body {
    height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

body.orders-page .main-header,
body.orders-page .orange-bar,
body.orders-page .footer {
    flex: 0 0 auto;
}

body.orders-page main.container-fluid {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding-bottom: 0 !important;
    height: calc(100vh - 130px);
}

@media (max-width: 768px) {
    body.orders-page main.container-fluid {
        height: auto;
        overflow: visible;
        display: block;
    }
    
    body.orders-page html,
    body.orders-page body {
        height: auto;
        overflow: auto;
        display: block;
    }
    
    .orders-container {
        flex-direction: column;
        height: auto;
    }
    
    .orders-list-wrapper {
        flex: none;
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
    }
    
    .orders-preview {
        min-height: 500px;
    }
}

.duty-schedule-wrapper {
    position: relative;
    margin-bottom: 20px;
}

.duty-schedule-list {
    transition: max-height 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    position: relative;
}

.duty-schedule-list.collapsed {
    max-height: 300px;
}

.duty-schedule-list.expanded {
    max-height: 5000px;
}

.duty-item {
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
}

.duty-item.faded {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

.duty-block {
    margin-bottom: 1rem;
}

.duty-block-header {
    color: white;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: bold;
    border-radius: 4px 4px 0 0;
}

.duty-header-green { background: linear-gradient(135deg, #28a745, #20c997); }
.duty-header-orange { background: linear-gradient(135deg, #fd7e14, #e67e22); }
.duty-header-blue { background: linear-gradient(135deg, #17a2b8, #3498db); }
.duty-header-purple { background: linear-gradient(135deg, #6f42c1, #8e44ad); }
.duty-header-red { background: linear-gradient(135deg, #dc3545, #c0392b); }

.duty-table-container {
    background: white;
    border: 1px solid #d9d9d9;
    border-top: none;
    border-radius: 0 0 4px 4px;
    overflow-x: auto;
}

.light-theme .duty-table-container {
    background: #fff;
    border-color: var(--light-border);
}

.duty-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
}

.duty-table th {
    border: 1px solid #d9d9d9;
    padding: 4px;
    font-weight: bold;
    text-align: center;
    font-size: 10px;
    color: #333;
}

.duty-table th.rank-col {
    background: #fafafa;
    min-width: 80px;
}

.duty-table th.name-col {
    background: #fafafa;
    min-width: 120px;
}

.duty-table th.day-col {
    width: 40px;
    line-height: 1.2;
}

.duty-table th.day-col.weekend {
    background: #fff3e0;
}

.duty-table th.day-col:not(.weekend) {
    background: #fafafa;
}

.duty-table .date-label {
    color: #666;
    font-size: 9px;
    display: block;
}

.duty-table td {
    border: 1px solid #d9d9d9;
    padding: 4px;
}

.duty-table td.rank-cell {
    font-size: 10px;
    color: #666;
}

.duty-table td.name-cell {
    font-size: 11px;
    color: #333;
}

.duty-table td.status-cell {
    padding: 0;
    text-align: center;
    width: 40px;
    height: 28px;
}

.duty-expand-gradient {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: linear-gradient(to bottom, transparent, var(--secondary-color));
    pointer-events: none;
    transition: opacity 0.5s ease-in-out;
    z-index: 2;
    opacity: 0;
}

.light-theme .duty-expand-gradient {
    background: linear-gradient(to bottom, transparent, #fff);
}

.duty-expand-gradient.visible {
    opacity: 1;
}

.duty-toggle-container {
    text-align: center;
    position: relative;
    z-index: 3;
    padding-bottom: 10px;
}

.duty-toggle-classic {
    border-radius: 4px;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
    padding: 6px 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-light);
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
}

.light-theme .duty-toggle-classic {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--orange-color);
    color: var(--orange-color);
}

.duty-toggle-classic:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    color: white;
}

.light-theme .duty-toggle-classic:hover {
    background: var(--orange-color);
    color: white;
}

.duty-legend {
    font-size: 10px;
    color: #ccc;
    margin-top: 8px;
    display: flex;
    gap: 12px;
    justify-content: center;
}

.light-theme .duty-legend {
    color: #666;
}

.duty-legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.duty-legend-box {
    width: 12px;
    height: 12px;
    border: 1px solid #d9d9d9;
}

.duty-status-duty { background: #000000; }
.duty-status-off { background: #ff0000; }
.duty-status-none { background: #ffffff; }/* =========================================
   New Design Styles (2025 Redesign - Refined)
   ========================================= */

/* Main Content Wrapper */
.main-content-wrapper {
    background-color: #f8f9fa;
    min-height: calc(100vh - 200px);
    padding-bottom: 2rem;
}

/* Header Top Bar Refinement */
.header-top-bar {
    background-color: var(--mil-nav-bg); /* Dark military blue */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
}

.light-theme .header-top-bar {
    background-color: var(--mil-nav-bg); /* Keep it dark for formality */
    border-bottom: none;
}

.top-bar-link {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.2s ease;
    font-weight: 400;
    display: inline-flex;
    align-items: center;
    letter-spacing: 0.3px;
}

.light-theme .top-bar-link {
    color: rgba(255, 255, 255, 0.7);
}

.top-bar-link:hover, .top-bar-link.active {
    color: #fff;
}

.light-theme .top-bar-link:hover, .light-theme .top-bar-link.active {
    color: #fff;
}

/* Header Brand Area - Tweaks */
.header-brand-area {
    background: linear-gradient(135deg, var(--mil-header-bg), #003366);
    padding: 1.5rem 0; /* Reduced padding */
}

.brand-logo {
    height: 70px; /* Reduced size */
    width: auto;
}

.brand-title {
    font-size: 1.5rem; /* Slightly smaller */
}

.brand-subtitle {
    font-size: 0.65rem;
    margin-top: 4px;
}

/* Hero Section Styles - Denser */
.hero-wrapper {
    position: relative;
    margin-bottom: 1.5rem; /* Reduced margin */
    background-color: #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.hero-image-banner {
    height: 350px;
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: center;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to right, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.4) 100%);
    display: flex;
    align-items: center;
    padding: 2rem 0;
}

.hero-overlay-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
    margin-bottom: 0.8rem;
    font-family: var(--font-heading);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.hero-overlay-text {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 0;
    max-width: 700px;
    font-weight: 400;
    line-height: 1.5;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.hero-substrate {
    background: #fff;
    padding: 1.5rem 0;
    border-bottom: 3px solid var(--mil-header-bg);
}

.hero-substrate-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1.2;
    margin-bottom: 0.5rem;
    font-family: var(--font-heading);
}

.hero-substrate-text {
    font-size: 1rem;
    color: var(--light-muted);
    margin-bottom: 0;
    max-width: 700px;
    font-weight: 400;
    line-height: 1.5;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem !important;
}

.news-card-item {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.news-card-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.news-card-header {
    margin-bottom: 0.8rem;
}

.news-date {
    font-size: 0.85rem;
    color: #6c757d;
    opacity: 0.7;
    font-weight: 400;
    display: block;
    margin-bottom: 0.75rem;
}

.news-card-img {
    height: 200px;
    background-size: cover;
    background-position: center;
    background-color: #f0f0f0;
    border-radius: 0;
    margin-bottom: 0;
}

.news-card-body {
    padding: 1.25rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.news-card-title {
    font-size: 1.15rem;
    margin-bottom: 0.75rem;
    line-height: 1.4;
    color: #1a1a1a;
    font-weight: 700;
    transition: color 0.2s ease;
}

.news-card-item:hover .news-card-title {
    color: var(--mil-header-bg);
}

.news-card-link {
    font-size: 0.9rem;
    color: var(--mil-header-bg);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s ease;
    margin-top: auto;
    padding: 0;
}

.news-card-link i {
    font-size: 0.9rem;
}

.news-card-excerpt {
    font-size: 0.95rem;
    color: #4a4a4a;
    line-height: 1.6;
    margin-bottom: 1rem;
    flex-grow: 1;
}

/* Utility Classes - Button Fixes */
.btn-mil-primary {
    background-color: var(--mil-header-bg);
    color: #fff;
    border: none;
    border-radius: 0;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    padding: 0.75rem 2rem; /* Compact padding */
    transition: background-color 0.2s ease; /* Simple transition */
    position: relative;
    overflow: hidden;
    z-index: 1;
}

/* Remove shiny animation */
.btn-mil-primary::before {
    display: none;
}

.btn-mil-primary:hover {
    background-color: var(--mil-blue-dark); /* Darken on hover */
    color: #fff;
}

/* Minimalist Quick Actions */
.btn-action-minimal {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    background-color: transparent;
    border: 1px solid var(--light-muted);
    color: var(--light-text);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border-radius: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-action-minimal:hover {
    background-color: var(--mil-header-bg);
    border-color: var(--mil-header-bg);
    color: #fff;
}

.btn-action-minimal i {
    font-size: 1.1rem;
}

.section-title {
    font-size: 1.5rem;
    padding-left: 0.8rem;
    border-left-width: 4px;
    margin-bottom: 1rem;
}

/* Responsive */
@media (max-width: 992px) {
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .news-grid {
        grid-template-columns: 1fr;
    }
    
    .hero-overlay-title {
        font-size: 1.5rem;
    }
    
    .hero-substrate-title {
        font-size: 1.5rem;
    }
    
    .hero-image-banner {
        height: 250px;
    }
}
