:root {
    --gradient-start: #667eea;
    --gradient-end: #764ba2;
    --primary-color: #667eea;
    --primary-hover: #5a6fd8;
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --text-color: #333333;
    --border-color: #e2e8f0;
    --danger-color: #e53e3e;
    --danger-hover: #c53030;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    color: var(--bs-secondary-color) !important;
    padding-top: 50px;
}

.container-fluid header {
    position: absolute;
    width: 100%;
    color: var(--bs-secondary-color) !important;
}

/* Remember me checkbox */
.remember-me {
    display: flex;
    align-items: center;
    margin: 1rem 0;
}

.remember-me input[type="checkbox"] {
    width: auto;
    margin-right: 0.5rem;
}

.remember-me label {
    margin: 0;
    font-size: 0.9rem;
    color: white;
}

/* Navbar */
.navbar {
    display: flex;
    align-items: center;
    padding: 1rem 2rem;
    position: relative;
}

/* Стили для правой части с балансом */
.links {
    flex-grow: 1; /* Занимает всё доступное пространство слева */
}

.right-links {
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-content: flex-end; /* Выравнивание по правому краю */
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.nav-links {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: var(--card-bg);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    width: 200px;
    padding: 0.5rem 0;
    z-index: 101;
}

.nav-links.active {
    display: block;
}

.nav-links a {
    display: block;
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.3s ease;
}

.nav-links a:hover {
    background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
    color: white;
}

.nav-links a.active {
    background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
    color: white;
    font-weight: 600;
}

.menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    cursor: pointer;
    margin-left: 1.5rem; /* Отступ от правых ссылок */
}

.menu-toggle span {
    display: block;
    height: 3px;
    width: 100%;
    background-color: var(--gradient-start); /* Фиолетовый цвет для гамбургера */
    border-radius: 3px;
    transition: all 0.3s ease;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-direction: column;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .page-header {
        flex-direction: row;
    }
}

.page-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: bold;
}

.page-header p {
    font-size: 1.1rem;
    color: #666;
}

/* Auth Forms */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.auth-form {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.auth-form h5 {
    color: white;
    margin-bottom: 1rem;
    text-align: center;
    font-weight: 700;
    font-size: 1.1rem;
}

.form-group {
    margin-bottom: 1rem;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.85rem;
}

.form-group label {
    color: white;
    display: block;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.form-group .form-control {
    width: 100%;
    font-size: 0.85rem;
    padding: 0.5rem 0.7rem;
    transition: all 0.2s ease;
    background-color: #ffffff;
    border: 1px solid rgba(255,255,255,0.3);
    color: #333;
}
.form-group .form-control:focus {
    box-shadow: 0 0 0 0.2rem rgba(255,255,255,0.3);
    background-color: #ffffff;
    color: #333;
}
.form-group .form-control.inactive {
    background-color: rgba(128,128,128,0.3);
    color: rgba(255,255,255,0.9);
    border: 1px solid rgba(255,255,255,0.2);
}

.checkbox label {
    color: white;
    display: flex;
    align-items: center;
}

.checkbox input {
    width: auto;
    margin-right: 0.5rem;
}

/* Buttons */
.btn {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    //width: 100%;
    padding: 12px;
    border-radius: 8px;
    font-weight: 600;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.btn:hover {
    background: #555;
}

.btn-primary {
    background: #007bff;
}

.btn-primary:hover {
    background: #0056b3;
}

.btn-secondary {
    background: #6c757d;
}

.btn-secondary:hover {
    background: #545b62;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #c53030 100%) !important;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    text-decoration: none;
    text-align: center;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(229, 62, 62, 0.3);
    color: white;
    text-decoration: none;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

.btn-custom {
    background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%) !important;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    text-decoration: none;
    text-align: center;
    opacity: 0.8;
}

.btn-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
    opacity: 1;
}

 .btn-custom-cancel {
    background: #6c757d !important;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    text-decoration: none;
    text-align: center;
}

.btn-custom-cancel:hover {
    background: #5a6268 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(108, 117, 125, 0.3);
    color: white;
    text-decoration: none;
}

.btn-light:hover, .btn-outline-light:hover {
    background: #f8f9fa;
}

/* Alerts */
.alert {
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 0.25rem;
}

.alert.success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.alert.error {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

/* Tables */
/* Table styles */
.users-table {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    //margin-top: 1rem;
}

thead {
    background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
    color: white;
}

th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
}

tbody tr {
    border: 1px solid var(--border-color);
    transition: background-color 0.3s ease;
}

tbody tr:hover {
    background-color: rgba(102, 126, 234, 0.05);
}

td {
    padding: 1rem;
}

.role-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-active {
    color: var(--gradient-start);
    font-weight: 600;
}

.actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.actions a {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

@media (max-width: 768px) {
    .users-table {
        padding: 1rem;
    }

    table {
        font-size: 0.875rem;
    }

    th, td {
        padding: 0.5rem;
    }

    .actions {
        flex-direction: column;
    }
}

/* Search and Filter Styles */
.search-filters {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.filter-row {
    display: flex;
    gap: 1rem;
    align-items: end;
}

.filter-group {
    flex: 1;
}

.filter-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #2d3748;
}

.filter-group input,
.filter-group select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    font-size: 1rem;
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.loading {
    text-align: center;
    padding: 2rem;
    color: #666;
    font-style: italic;
}

.no-results {
    text-align: center;
    padding: 3rem;
    color: #666;
    font-style: italic;
}

.search-status {
    margin-top: 1rem;
    font-size: 0.875rem;
    color: #666;
}

.reset-filters {
    background: #e2e8f0;
    color: #4a5568;
    border: none;
    padding: 0.5rem 1rem;
    height: fit-content;
}

.reset-filters:hover {
    background: #cbd5e0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .filter-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        margin-bottom: 1rem;
    }
}

/* Sortable Table Headers */
.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 20px !important;
    transition: background-color 0.2s ease;
}

.sortable:hover {
    opacity: 0.8;
}

.sortable::after {
    content: '';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    transition: border-color 0.2s ease;
}

.sortable.asc::after {
    border-bottom: 4px solid #667eea;
    border-top: none;
}

.sortable.desc::after {
    border-top: 4px solid #667eea;
    border-bottom: none;
}

.sortable::after {
    border-bottom: 4px solid #cbd5e0;
    border-top: 4px solid #cbd5e0;
}

/* Pagination Styles */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    padding: 1rem 2rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.pagination-info {
    font-size: 0.875rem;
    color: #666;
}

.pagination-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.pagination-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #cbd5e0;
    background: white;
    color: #4a5568;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    font-size: 0.875rem;
}

.pagination-btn:hover:not(:disabled) {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.page-numbers {
    display: flex;
    gap: 0.25rem;
}

.per-page-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 1rem;
    font-size: 0.875rem;
}

.per-page-selector select {
    padding: 0.25rem;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    background: white;
}

/* Responsive Pagination */
@media (max-width: 768px) {
    .pagination {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .pagination-controls {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .page-numbers {
        order: -1;
        justify-content: center;
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .per-page-selector {
        margin-left: 0;
        justify-content: center;
        width: 100%;
    }
}


/* Registration */
.password-requirements {
    font-size: 0.875rem;
    color: #421d5f;
    margin-top: 0.25rem;
}
.requirement {
    margin: 0.1rem 0;
}
.requirement.met {
    color: #26e27d;
}
.requirement.unmet {
    color: #ffd027;
}

.register-form .requirement.met {
    color: #19663e;
}
.register-form .requirement.unmet {
    color: #cd1c1c;
}

/* Profile */
.form-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 992px) {
    .profile-content {
        grid-template-columns: 1fr 1fr;
    }
}

.form-section, .profile-actions {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border-top: 4px solid;
    border-image: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%) 1;
}

.form-section h2, .action-card h3 {
    margin-bottom: 1.5rem;
    color: var(--text-color);
    font-size: 1.5rem;
}

.form-content .form-group {
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.form-content .form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
}

.form-content .form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s ease;    
}

.form-content .form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.form-content .form-control:disabled {
    background-color: #f4f4f4;
    color: #666;
    cursor: not-allowed;
}

.form-content .form-control.inactive {
    background-color: #f8f9fa;
    color: #6c757d;
}

.form-content select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23667eea' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    padding-right: 2.5rem;
}

.form-content .form-check {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
}

.form-content .form-check-input {
    margin-right: 0.5rem;
    width: 1.2rem;
    height: 1.2rem;
    accent-color: var(--primary-color);
    border-color: var(--primary-color);
}

.form-content .form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.form-content .form-check-label {
    font-weight: 500;
}

.form-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.action-card {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.action-card:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.action-card p {
    margin-bottom: 1rem;
}

.action-card small {
    color: #666;
    font-size: 0.875rem;
}

/* Toolbar */
.toolbar {
    margin-bottom: 1rem;
}

/* Welcome section */
.welcome {
    background: #fff;
    padding: 2rem;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.dashboard-actions {
    display: flex;
    gap: 1rem;
}

.profile-info {
    background: #fff;
    padding: 2rem;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

.profile-info p {
    margin-bottom: 1rem;
}

footer {
    background: #333;
    color: #fff;
    text-align: center;
    padding: 1rem;
    margin-top: 2rem;
}

.sidebar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    padding-bottom: 140px;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    //position: relative;
    position: sticky;
    top: 0px;
    align-self: flex-start;
    max-height: calc(100vh - 40px);
    overflow-y: auto; /* Прокрутка работает */
    padding-right: 10px;
    
    /* Скрываем полосу прокрутки в разных браузерах */
    scrollbar-width: none; /* Для Firefox */
    -ms-overflow-style: none; /* Для Internet Explorer и Edge */
}

/* Для Chrome, Safari и Opera */
.sidebar::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.sticky-buttons {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 33.333333%;
    z-index: 100;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 15px 20px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
}
@media (min-width: 992px) {
    .sticky-buttons {
        width: 33.333333%;
    }
}
@media (min-width: 1200px) {
    .sticky-buttons {
        width: 25%;
    }
}
.filter-section {
    background: rgba(255,255,255,0.15);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
}
.filter-section h6 {
    color: white;
    font-weight: 600;
    margin-bottom: 12px;
    font-size: 0.95rem;
}
.filter-section .form-control {
    font-size: 0.85rem;
    padding: 0.5rem 0.7rem;
}
.filter-section .form-check-label {
    color: rgba(255,255,255,0.9);
    font-size: 0.85rem;
}
.form-check-input {
    background-color: transparent;
    border: 2px solid rgba(255,255,255,0.6);
    width: 1.2em;
    height: 1.2em;
}
.form-check-input:checked {
    background-color: #ffffff;
    border-color: #ffffff;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23000' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10l3 3l6-6'/%3e%3c/svg%3e");
}
.stats-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    margin-top: 45px;
}
.main-content {
    padding: 20px;
    background: #f8f9fa;
    min-height: 100vh;
}
.search-btn {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    font-weight: 600;
    margin-bottom: 10px;
}
.search-btn:hover {
    background: rgba(255,255,255,0.3);
    color: white;
}
.logo-section {
    text-align: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.2);
}
.logo-section h5 {
    color: white;
    font-weight: 700;
}
.type-selector {
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 15px;
}
.type-selector .btn-check:checked + .btn {
    background-color: rgba(255,255,255,0.3);
    border-color: rgba(255,255,255,0.5);
}
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 9999;
    align-items: center;
    justify-content: center;
}
.loading-spinner {
    background: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
}
.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}


.input-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.search-box {
    position: relative;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.search-input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: #3b7ddd;
    box-shadow: 0 0 0 3px rgba(59, 125, 221, 0.1);
}

.search-icon {
    position: absolute;
    left: 32px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

.selected-count {
    padding: 0 20px 15px;
    color: #667eea;
    font-size: 14px;
    font-weight: 500;
}

.districts-container {
    max-height: 550px;
    overflow-y: auto;
    padding: 10px 0;
}

.district-item {
    border-bottom: 1px solid #f0f0f0;
}

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

.district-header {
    padding: 15px 25px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: #444;
    transition: background 0.2s;
}

.district-header:hover {
    background: #f8f9fa;
}

.district-header svg {
    width: 18px;
    height: 18px;
    transition: transform 0.3s;
}

.district-header.active svg {
    transform: rotate(180deg);
}

.regions-list {
    display: none;
    padding: 10px 25px 15px;
    background: #fafbfc;
}

.regions-list.active {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
}

.region-checkbox {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.region-checkbox:hover {
    background: #e9f1ff;
}

.region-checkbox input {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.region-checkbox label {
    cursor: pointer;
    color: #555;
}

.region-checkbox input:checked{
    accent-color: #667eea;
}

.region-checkbox input:checked + label {
    color: #667eea;
    font-weight: 500;
}

.no-results {
    padding: 30px;
    text-align: center;
    color: #999;
    font-style: italic;
}

.okved-input {
    width: 100%;
    padding: 14px 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    background: white;
    transition: all 0.3s;
    color: #333;
}

.okved-input:hover {
    border-color: #3b7ddd;
}

.okved-input:focus {
    outline: none;
    border-color: #3b7ddd;
    box-shadow: 0 0 0 3px rgba(59, 125, 221, 0.1);
}

.okved-input::placeholder {
    color: #999;
}

.okved-container {
    max-height: 550px;
    overflow-y: auto;
    padding: 10px 20px;
}

.okved-category {
    margin-bottom: 15px;
}

.category-header {
    padding: 12px 15px;
    background: #f8f9fa;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: #444;
    transition: background 0.2s;
}

.category-header:hover {
    background: #e9ecef;
}

.category-header svg {
    width: 18px;
    height: 18px;
    transition: transform 0.3s;
}

.category-header.active svg {
    transform: rotate(180deg);
}

.okved-items {
    display: none;
    padding: 10px 0 5px 20px;
}

.okved-items.active {
    display: block;
}

.okved-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    margin-bottom: 5px;
    border-radius: 6px;
    transition: background 0.2s;
}

.okved-item:hover {
    background: #f0f7ff;
}

.okved-checkbox {
    margin-right: 12px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #667eea;
}

.okved-code {
    font-weight: 500;
    color: #667eea;
    min-width: 80px;
}

.okved-name {
    color: #555;
    flex: 1;
}

.okved-subitems {
    padding-left: 30px;
    margin-top: 5px;
    display: none;
}

.okved-subitems.active {
    display: block;
}

.toggle-subitems {
    margin-left: 10px;
    background: none;
    border: none;
    color: #667eea;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.toggle-subitems:hover {
    background: #e9f1ff;
}

.button-cancel {
    background: #f5f5f5;
    color: #666;
}

.button-cancel:hover {
    background: #e5e5e5;
}

.button-apply {
    background: #3b7ddd;
    color: white;
}

.button-apply:hover {
    background: #2d6ac1;
}

@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-height: 85vh;
    }

    .okved-container {
        padding: 10px 15px;
    }

    .okved-code {
        min-width: 70px;
    }
}

@media (max-width: 768px) {
    .regions-list.active {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
        max-height: 85vh;
    }

    .district-header {
        padding: 15px 20px;
    }

    .regions-list {
        padding: 10px 20px 15px;
    }
}


.save-alert {
            position: fixed;
            top: 20px;
            right: 20px;
            z-index: 10000;
            min-width: 300px;
            max-width: 400px;
            box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
            border: none;
            border-radius: 10px;
            padding: 15px 20px;
            animation: slideInRight 0.3s ease-out forwards, fadeOut 0.3s ease-out 4.7s forwards;
            opacity: 0;
            transform: translateX(100%);
        }
        
        .save-alert.alert-success {
            background: linear-gradient(135deg, #28a745 0%, #218838 100%);
            color: white;
            border-left: 4px solid #1e7e34;
        }
        
        .save-alert.alert-warning {
            background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
            color: #212529;
            border-left: 4px solid #d39e00;
        }
        
        .save-alert.alert-danger {
            background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
            color: white;
            border-left: 4px solid #bd2130;
        }
        
        .save-alert.alert-info {
            background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
            color: white;
            border-left: 4px solid #117a8b;
        }
        
        .save-alert .btn-close {
            filter: invert(1) brightness(2);
            opacity: 0.8;
            margin-left: 10px;
            padding: 12px;
            background-size: 0.8em;
        }
        
        .save-alert .btn-close:hover {
            opacity: 1;
        }
        
        @keyframes slideInRight {
            from {
                opacity: 0;
                transform: translateX(100%);
            }
            to {
                opacity: 1;
                transform: translateX(0);
            }
        }
        
        @keyframes slideOutRight {
            from {
                opacity: 1;
                transform: translateX(0);
            }
            to {
                opacity: 0;
                transform: translateX(100%);
            }
        }
        
        @keyframes fadeOut {
            from {
                opacity: 1;
                transform: translateX(0);
            }
            to {
                opacity: 0;
                transform: translateX(100%);
            }
        }
        
        /* Для Bootstrap 5 иконок */
        .save-alert .bi {
            margin-right: 8px;
            font-size: 1.2em;
            vertical-align: middle;
        }
        
        /* Адаптивность */
        @media (max-width: 768px) {
            .save-alert {
                min-width: 280px;
                max-width: 90%;
                right: 10px;
                left: 10px;
                transform: translateX(0) translateY(-20px);
            }
            
            @keyframes slideInRight {
                from {
                    opacity: 0;
                    transform: translateY(-20px);
                }
                to {
                    opacity: 1;
                    transform: translateY(0);
                }
            }
            
            @keyframes fadeOut {
                from {
                    opacity: 1;
                    transform: translateY(0);
                }
                to {
                    opacity: 0;
                    transform: translateY(-20px);
                }
            }
        }
        
        /* Эффект при наведении - останавливаем анимацию исчезновения */
        .save-alert:hover {
            animation-play-state: paused;
        }
        
        .progress-bar-animated {
    animation: progress-bar-stripes 1s linear infinite;
}

@keyframes progress-bar-stripes {
    from { background-position: 1rem 0; }
    to { background-position: 0 0; }
}

.export-details {
    font-size: 0.9em;
    color: #666;
}

.btn-custom:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.excel-generation-card {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    border: 2px solid;
    border-image: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
    border-image-slice: 1;
    border-radius: 12px;
    padding: 2rem;
    margin-top: 2rem;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.1);
}

.excel-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.password-group {
    position: relative;
}

.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper input {
    padding-right: 100px;
}

.btn-show-password {
    position: absolute;
    right: 5px;
    background: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 3px;
    padding: 5px 10px;
    font-size: 12px;
    cursor: pointer;
    z-index: 2;
}

.btn-show-password:hover {
    background: #e0e0e0;
}

.password-match {
    margin-top: 5px;
    font-size: 14px;
    min-height: 20px;
}

.password-match.valid {
    color: green;
}

.password-match.invalid {
    color: red;
}


/* Notification Alert Styles - Below Navigation */
.notification-alert {
    background: white;
    border-left: 3px solid var(--gradient-start);
    position: relative;
    width: 50%;
    z-index: 90; /* Ниже навигации */
    padding: 0.3rem 0;
    border-bottom: 1px solid var(--border-color);
    border-top: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.98);
    font-size: 0.85rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.5);
    margin-top: 7px;
    margin-bottom: -35px;
}

/* Компактный контент */
.notification-content-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 4px;
}

/* Верхняя строка с заголовком и бейджем */
.notification-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.notification-icon {
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification-icon i {
    color: white;
    font-size: 0.7rem;
}

.notification-title {
    color: var(--text-color);
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

.notification-badge {
    background: #f0f3ff;
    color: var(--gradient-start);
    padding: 0.15rem 0.5rem;
    border-radius: 16px;
    font-size: 0.7rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.notification-badge i {
    font-size: 0.65rem;
    margin-right: 3px;
}

/* Контент на новой строке */
.notification-content {
    color: #666;
    font-size: 0.85rem;
    line-height: 1.4;
    padding-left: 28px; /* Отступ равен ширине иконки + отступ */
    padding-right: 40px; /* Место для крестика */
    word-break: break-word;
}

.notification-close {
    width: 20px;
    height: 20px;
    padding: 0;
    background-size: 25px;
    opacity: 0.4;
    transition: all 0.15s ease;
    border: none;
    background-color: transparent;
    flex-shrink: 0;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='%236c757d' viewBox='0 0 16 16'%3E%3Cpath d='M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    position: absolute;
    top: 12px;
    right: 15px;
}

.notification-close:hover {
    opacity: 0.8 !important;
    background-color: #f5f5f5 !important;
    border-radius: 4px;
}

/* Mobile Responsive */
@media (max-width: 992px) {
    .notification-alert {
        padding: 0.4rem 0;
    }
    
    .notification-header {
        padding-right: 30px;
    }
    
    .notification-content {
        padding-left: 0;
        padding-right: 30px;
        font-size: 0.8rem;
    }
    
    .notification-close {
        top: 10px;
        right: 10px;
        width: 22px;
        height: 22px;
        background-size: 14px;
    }
}

/* Очень маленькие экраны */
@media (max-width: 576px) {
    .notification-title {
        font-size: 0.8rem;
    }
    
    .notification-badge {
        font-size: 0.65rem;
    }
    
    .notification-content {
        font-size: 0.75rem;
    }
}

/* Animation */
.notification-alert.hiding {
    transition: all 0.2s ease;
    opacity: 0;
    height: 0;
    padding: 0;
    margin: 0;
    overflow: hidden;
}