/* Windows Loader Styles */
#page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.98);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#page-loader.active {
    opacity: 1;
    visibility: visible;
}

.windows-loader-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
}

.windows-loading-spinner {
    box-sizing: border-box;
    width: 80px;
    height: 80px;
    padding: 4px;
    overflow: visible;
}

.windows-loading-spinner > circle {
    stroke: #1f719f;
    fill: none;
    stroke-width: 2px;
    stroke-linecap: round;
    transform-origin: 50% 50%;
    animation: windows-spinner 1.5s linear infinite;
}

@keyframes windows-spinner {
    0% {
        stroke-dasharray: 0.01px, 87.94px;
        transform: rotate(0);
        stroke: #1f719f;
    }
    50% {
        stroke-dasharray: 43.97px, 43.97px;
        transform: rotate(450deg);
        stroke: #115884;
    }
    100% {
        stroke-dasharray: 0.01px, 87.94px;
        transform: rotate(1080deg);
        stroke: #1f719f;
    }
}

/* Для мобильных */
@media (max-width: 768px) {
    .windows-loading-spinner {
        width: 60px;
        height: 60px;
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "PT Sans", "Arial", "Helvetica", sans-serif;
    line-height: 1.6;
}

html, body {
    height: 100%;
}
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
main {
    flex: 1;
}
.footer-disclaimer {
    font-size: 0.75rem;
    font-style: italic;
}

.main-header {
    background-color: #1f719f;
    padding: 10px 0;
    border-bottom: 1px solid #1f719f;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.header-left {
    display: flex;
    align-items: center;
}

.mo-logo {
    height: 80px;
    width: auto;
}

.ministry-title {
    color: white;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-size: 25px;
    font-weight: 700;
    line-height: 1.2;
    margin-left: 15px;
}

.title-down {
    color: white;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 11.23px;
    font-weight: 500;
}

.header-right {
    display: flex;
    gap: 20px;
    align-items: center;
}

.header-section {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
}

.header-section:hover {
    color: #b4d2e4;
}

.header-section i {
    font-size: 18px;
}

.header-divider {
    width: 1px;
    height: 40px;
    background-color: white;
}

.orange-bar {
    background-color: #ceecfa;
    padding: 0;
    height: 50px;
}

.orange-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    height: 50px;
}

.nav-links {
    display: flex;
    gap: 30px;
    list-style: none;
    height: 100%;
    margin: 0;
    padding: 0;
}

.nav-links li {
    display: flex;
    align-items: center;
    height: 100%;
}

.nav-links a {
    color: #115884;
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    transition: opacity 0.3s;
    display: flex;
    align-items: center;
    height: 100%;
}

.nav-links a:hover {
    opacity: 0.8;
}

.social-icons {
    display: flex;
    gap: 15px;
    align-items: center;
    height: 100%;
}

.social-icon {
    width: 24px;
    height: 24px;
    transition: transform 0.3s;
}

.social-icon:hover {
    transform: scale(1.1);
}

.auth-container {
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.auth-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
    border: 1px solid #dee2e6;
    max-width: 450px;
    width: 100%;
}

.auth-header {
    background: #1f719f;
    color: white;
    border-radius: 10px 10px 0 0;
    padding: 20px;
    text-align: center;
}

.auth-body {
    padding: 30px;
}

.form-floating {
    margin-bottom: 1rem;
}

.form-control:focus {
    border-color: #1f719f;
    box-shadow: 0 0 0 0.2rem rgba(31, 113, 159, 0.25);
}

.btn-primary {
    background-color: #1f719f;
    border-color: #1f719f;
}

.btn-primary:hover {
    background-color: #115884;
    border-color: #115884;
}

.auth-link {
    color: #1f719f;
    text-decoration: none;
}

.auth-link:hover {
    color: #115884;
    text-decoration: underline;
}

.profile-container {
    min-height: calc(100vh - 200px);
    padding: 40px 20px;
}

.profile-card {
    border: 1px solid #dee2e6;
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(0,0,0,0.1);
}

.profile-header {
    background: #1f719f;
    color: white;
    border-radius: 10px 10px 0 0;
    padding: 25px 30px;
}

.card-body {
    padding: 30px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    border: 1px solid #dee2e6;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #1f719f;
}

.stat-label {
    font-size: 0.9rem;
    color: #6c757d;
}

.document-placeholder {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.user-info-table {
    width: 100%;
}

.user-info-table td {
    padding: 12px 0;
    border-bottom: 1px solid #f8f9fa;
}

.user-info-table tr:last-child td {
    border-bottom: none;
}

.hero-section {
    background: linear-gradient(135deg, #1f719f 0%, #115884 100%);
    color: white;
    padding: 80px 0;
    text-align: center;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}


.feature-card {
    text-align: center;
    padding: 30px;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    transition: transform 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-icon {
    font-size: 3rem;
    color: #1f719f;
    margin-bottom: 1rem;
}

.leaders-title {
    color: #1f719f;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-align: center;
    font-size: 1.8rem;
}

.leaders-subtitle {
    color: #6c757d;
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.leader-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 8px rgba(0,0,0,0.06);
    margin-bottom: 1rem;
    border: 1px solid #e9ecef;
    transition: all 0.2s ease;
    overflow: hidden;
}

.leader-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}

.leader-photo-container {
    position: relative;
    height: 100%;
    min-height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    padding: 15px;
}

.leader-photo {
    width: 100px;
    height: 120px;
    object-fit: cover;
    border-radius: 4px;
    border: 2px solid #1f719f;
}

.leader-badge {
    position: absolute;
    bottom: 10px;
    left: 0;
    background: #1f719f;
    color: white;
    padding: 3px 8px;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 0 3px 3px 0;
}

.leader-info {
    padding: 15px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.leader-rank {
    color: #1f719f;
    font-weight: 600;
    font-size: 0.8rem;
    margin-bottom: 3px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.leader-name {
    color: #2c3e50;
    font-weight: 700;
    margin-bottom: 5px;
    font-size: 1.1rem;
}

.leader-position {
    color: #495057;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.85rem;
    line-height: 1.3;
}

.leader-bio {
    color: #6c757d;
    line-height: 1.5;
    margin: 0;
    font-size: 0.85rem;
}

.department-section {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 1 rgba(0,0,0,0.1);
    border: 1px solid #e9ecef;
    padding: 30px;
    margin-bottom: 30px;
}

.department-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #1f719f;
}

.department-title {
    color: #1f719f;
    font-weight: 700;
    margin: 0;
    font-size: 1.5rem;
}

.department-badge {
    background: #1f719f;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.department-description {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #495057;
    margin-bottom: 25px;
    text-align: justify;
}

.tasks-title {
    color: #2c3e50;
    margin-bottom: 20px;
    font-weight: 600;
    font-size: 1.2rem;
}

.tasks-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.task-item {
    display: flex;
    align-items: flex-start;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #1f719f;
    line-height: 1.5;
}

.task-item i {
    margin-top: 2px;
    flex-shrink: 0;
}

.documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.document-item {
    text-align: center;
}

.document-thumbnail {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #e9ecef;
    transition: transform 0.3s;
}

.document-thumbnail:hover {
    transform: scale(1.05);
}

.document-info {
    margin-top: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-item.dropdown .dropdown-menu {
    border: 1px solid #1f719f;
}

.nav-item.dropdown .dropdown-item:hover {
    background-color: #1f719f;
    color: white;
}

.profile-actions {
    margin-bottom: 30px;
}

.profile-actions .btn {
    min-width: 140px;
    margin-bottom: 10px;
}

.notifications-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1050;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
    width: 90%;
}

.notification {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-left: 4px solid #6c757d;
    animation: slideInFromTop 0.3s ease-out;
    transition: all 0.3s ease;
    overflow: hidden;
}


.notification-success {
    border-left-color: #198754;
}

.notification-danger {
    border-left-color: #dc3545;
}

.notification-warning {
    border-left-color: #ffc107;
}

.notification-info {
    border-left-color: #0dcaf0;
}

.notification-content {
    display: flex;
    align-items: center;
    padding: 15px;
    gap: 12px;
}

.notification-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.notification-success .notification-icon {
    color: #198754;
}

.notification-danger .notification-icon {
    color: #dc3545;
}

.notification-warning .notification-icon {
    color: #ffc107;
}

.notification-info .notification-icon {
    color: #0dcaf0;
}

.notification-message {
    flex: 1;
    font-size: 0.9rem;
    line-height: 1.4;
}

.notification-close {
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: color 0.3s;
    flex-shrink: 0;
}

.notification-close:hover {
    color: #495057;
    background: rgba(0,0,0,0.05);
}

@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateY(-100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


@media (max-width: 768px) {
    .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;
    }
    
    .header-divider {
        width: 100%;
        height: 1px;
    }
    
    .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;
        margin-left: 0;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .auth-card {
        margin: 0 10px;
    }
    
    .department-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .department-title {
        font-size: 1.3rem;
    }
    
    .department-section {
        padding: 20px;
    }
    
    .task-item {
        flex-direction: column;
        gap: 10px;
    }
    
    .documents-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
    
    .card-body {
        padding: 20px;
    }
    
    .profile-header {
        padding: 20px;
    }
}

@media (max-width: 576px) {
    .leader-photo {
        width: 70px;
        height: 90px;
    }
    
    .leader-info {
        padding: 10px;
    }
    
    .leader-name {
        font-size: 0.95rem;
    }
    
    .leader-badge {
        font-size: 0.65rem;
        padding: 2px 6px;
    }
    
    @media (max-width: 576px) {
        .notifications-container {
            left: 50%;
            right: auto;
            top: 10px;
            max-width: 95%;
        }
    }
    
    .notification-content {
        padding: 12px;
    }
    
    .notification-message {
        font-size: 0.85rem;
    }
    
    .profile-actions .btn {
        min-width: 100%;
    }
}

.department-content {
    line-height: 1.6;
}

.department-content p {
    margin-bottom: 1rem;
    text-align: justify;
}

.department-content strong {
    color: #1f719f;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-text {
    font-size: 0.875rem;
    color: #6c757d;
}

.user-info-table td:first-child {
    width: 140px;
    font-weight: 600;
    color: #495057;
}

.user-info-table td:last-child {
    color: #6c757d;
}

.btn {
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-sm {
    border-radius: 4px;
}

.card {
    border: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.list-group-item {
    border: 1px solid #e9ecef;
    margin-bottom: 10px;
    border-radius: 6px;
}

h1, h2, h3, h4, h5, h6 {
    color: #2c3e50;
    font-weight: 600;
}

h6 {
    color: #495057;
    margin-bottom: 15px;
    font-size: 1rem;
}

.rank-with-image {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rank-image {
    width: 50px;
    height: 50px;
    object-fit: contain;
}

.rank-text {
    font-size: 0.9rem;
    font-weight: 500;
}

.latest-news-card {
    border: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.section-title {
    color: #2c3e50;
    font-weight: 700;
    text-transform: uppercase;
    border-bottom: 3px solid #e74c3c;
    padding-bottom: 10px;
}

.stat-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    color: #6c757d;
    text-transform: uppercase;
}

.contact-card {
    text-align: center;
    padding: 30px 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

.contact-icon {
    font-size: 3rem;
    color: #e74c3c;
    margin-bottom: 15px;
}

.contact-info {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
}

.contact-link {
    color: #e74c3c;
    text-decoration: none;
    font-weight: 600;
}

.contact-link:hover {
    color: #c0392b;
}

.table-sm th,
.table-sm td {
    padding: 4px 6px;
    font-size: 0.85rem;
}

.employees-table tbody tr {
    line-height: 1.1;
    height: 35px;
}

/* Компактные заголовки */
.leaders-title {
    font-size: 1.8rem !important;
}

.department-title {
    font-size: 1.3rem !important;
}

.leader-panel {
    background: linear-gradient(135deg, #dc3545, #c82333) !important;
}

.form-control-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.rank-image-small {
    width: 20px;
    height: 20px;
}

.rank-text-small {
    font-size: 0.65rem;
}

.nav-item.dropdown .dropdown-menu {
    position: absolute;
    left: 0;
    top: 100%;
    margin-top: 0;
    border: 1px solid #1f719f;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 200px;
    z-index: 1000;
    background: white;
    display: none;
}

.nav-item.dropdown .dropdown-menu.show {
    display: block;
}

.admin-panel-item .dropdown-menu {
    min-width: 250px;
}

@media (min-width: 769px) {
    .nav-item.dropdown .dropdown-menu {
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
    }
}

@media (max-width: 768px) {
    .nav-item.dropdown .dropdown-menu {
        position: static;
        box-shadow: none;
        border: none;
        border-top: 1px solid #dee2e6;
        width: 100%;
    }
    
    .admin-panel-item .dropdown-menu {
        display: none !important;
    }
}

/* Система уведомлений */

#notificationModal .modal-dialog {
    max-width: 800px;
    margin: 1.75rem auto;
}

#notificationModal .modal-content {
    min-height: auto;
}

#notificationModal .modal-body {
    overflow-y: auto;
    padding: 30px;
    font-size: 0.95rem;
    line-height: 1.5;
    background-color: white;
}

#notificationModal .modal-footer {
    display: none;
}

#markAsReadBtn {
    display: none;
}

#notificationModal .modal-header {
    height: 35px;
    padding: 0;
    border-bottom: none;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    position: relative;
}

#notificationModal.info .modal-header {
    background: linear-gradient(135deg, #1f719f 0%, #115884 100%);
}

#notificationModal.urgent .modal-header {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

#notificationModal .modal-header .btn-close {
    margin: 0;
    padding: 5px;
    background-size: 0.7rem;
    width: 22px;
    height: 22px;
    opacity: 0.8;
    transition: all 0.2s ease;
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
}

#notificationModal .modal-header .btn-close:hover {
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
}

#notificationModal.info .modal-header .btn-close,
#notificationModal.urgent .modal-header .btn-close {
    filter: invert(1) brightness(2);
}

.notification-text {
    font-size: 0.95rem;
    line-height: 1.5;
    color: #2c3e50;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    background-color: transparent;
}

.notification-text p {
    margin-bottom: 20px;
}

.notification-text h1 {
    color: #1f719f;
    font-size: 1.4rem;
    margin-top: 0;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

.notification-text h2 {
    color: #1f719f;
    font-size: 1.2rem;
    margin-top: 25px;
    margin-bottom: 15px;
}

.notification-text h3 {
    color: #495057;
    font-size: 1.1rem;
    margin-top: 20px;
    margin-bottom: 12px;
}

.notification-text ul,
.notification-text ol {
    margin-left: 25px;
    margin-bottom: 20px;
}

.notification-text li {
    margin-bottom: 10px;
}

.notification-text blockquote {
    border-left: 4px solid #1f719f;
    padding-left: 20px;
    margin: 20px 0;
    font-style: italic;
    color: #6c757d;
}

.notification-text pre {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 20px 0;
    border: 1px solid #e9ecef;
}

.notification-text code {
    background-color: #f1f3f5;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.95em;
}

.notification-text img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px 0;
    display: block;
    border: 1px solid #dee2e6;
}

.notification-text table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.notification-text table th,
.notification-text table td {
    padding: 12px;
    border: 1px solid #dee2e6;
    text-align: left;
}

.notification-text table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #495057;
}

.notification-text a {
    color: #1f719f;
    text-decoration: none;
    font-weight: 500;
}

.notification-text a:hover {
    color: #115884;
    text-decoration: underline;
}

.notification-text hr {
    margin: 30px 0;
    border: none;
    border-top: 2px solid #e9ecef;
}

@media (max-width: 768px) {
    #notificationModal .modal-dialog {
        max-width: 95%;
        margin: 10px auto;
    }
    
    #notificationModal .modal-content {
        margin: 10px;
    }
    
    #notificationModal .modal-body {
        min-height: 300px;
        padding: 20px;
    }
    
    #notificationModal .modal-header {
        height: 30px;
    }
    
    #notificationModal .modal-header .btn-close {
        width: 20px;
        height: 20px;
        padding: 4px;
        right: 6px;
    }
    
    .notification-text {
        font-size: 1.05rem;
        line-height: 1.6;
    }
    
    .notification-text h1 {
        font-size: 1.5rem;
    }
    
    .notification-text h2 {
        font-size: 1.3rem;
    }
    
    .notification-text h3 {
        font-size: 1.1rem;
    }
}

@media (max-width: 576px) {
    #notificationModal .modal-content {
        min-height: 350px;
    }
    
    #notificationModal .modal-body {
        min-height: 250px;
        padding: 15px;
    }
    
    #notificationModal .modal-header {
        height: 25px;
    }
    
    #notificationModal .modal-header .btn-close {
        width: 18px;
        height: 18px;
        padding: 3px;
        right: 5px;
    }
    
    .notification-text {
        font-size: 1rem;
    }
    
    .notification-text h1 {
        font-size: 1.3rem;
    }
}