html {
  overflow-y: scroll;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e0 #f1f5f9;
}

::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 10px;
  box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.1);
}

::-webkit-scrollbar-thumb {
  background: #cbd5e0;
  border-radius: 10px;
  box-shadow:
    inset 0 0 6px rgba(0, 0, 0, 0.1),
    0 2px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: #a0aec0;
  box-shadow:
    inset 0 0 6px rgba(0, 0, 0, 0.2),
    0 2px 8px rgba(0, 0, 0, 0.2);
}

body {
  -ms-overflow-style: scrollbar;
}

/* Кастомный скроллбар для модальных окон */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: #1e4663;
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: #f59e0b;
}

/* Кастомный скроллбар для таблиц */
.files-table::-webkit-scrollbar,
.table-responsive::-webkit-scrollbar {
    height: 8px;
}

.files-table::-webkit-scrollbar-track,
.table-responsive::-webkit-scrollbar-track {
    background: #e2e8f0;
    border-radius: 10px;
}

.files-table::-webkit-scrollbar-thumb,
.table-responsive::-webkit-scrollbar-thumb {
    background: #1e4663;
    border-radius: 10px;
}

.files-table::-webkit-scrollbar-thumb:hover,
.table-responsive::-webkit-scrollbar-thumb:hover {
    background: #f59e0b;
}

/* Кастомный скроллбар для textarea */
textarea::-webkit-scrollbar {
    width: 8px;
}

textarea::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

textarea::-webkit-scrollbar-thumb {
    background: #1e4663;
    border-radius: 10px;
}

textarea::-webkit-scrollbar-thumb:hover {
    background: #f59e0b;
}

/* Кастомный скроллбар для выпадающих списков (select) */
select::-webkit-scrollbar {
    width: 8px;
}

select::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

select::-webkit-scrollbar-thumb {
    background: #1e4663;
    border-radius: 10px;
}

@media (max-width: 992px) {
    .mobile-hidden {
        display:none !important;
    }
}

/* Основные стили */
body {
    background: #e2e8f0;
    font-family: 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1800px;
    margin: 15px auto;
    padding: 0;
    background: white;
    border-radius: 28px;
    box-shadow: 0 20px 35px -10px rgba(0,0,0,0.2);
    overflow: hidden;
    flex: 1;
}

.header {
    background: #1e4663;
    padding: 5px
}

.header h1 {
    margin: 0;
    font-size: 1.6rem;
    text-align: center;
}

.header p {
    margin: 5px 0 0;
    opacity: 0.8;
    font-size: 0.85rem;
}

.nav-bar {
    background: #f8fafc;
    padding: 0 30px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    gap: 20px;
    overflow-x: auto;
    white-space: nowrap;
    justify-content: space-between;
}

.nav-bar::-webkit-scrollbar {
    height: 4px;
}

.nav-bar a {
    padding: 12px 20px;
    text-decoration: none;
    color: #1e4663;
    font-weight: 600;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.nav-bar a:hover {
    color: #f59e0b;
}

.nav-bar a.active {
    color: #f59e0b;
    border-bottom: 3px solid #f59e0b;
}

.content {
    padding: 5px 30px;
    overflow-y: auto;
    margin-bottom: 30px;
}

.content::-webkit-scrollbar {
    width: 8px;
}

.content::-webkit-scrollbar-track {
    background: #e2e8f0;
    border-radius: 10px;
}

.content::-webkit-scrollbar-thumb {
    background: #1e4663;
    border-radius: 10px;
}

.content::-webkit-scrollbar-thumb:hover {
    background: #f59e0b;
}

.footer {
    text-align: center;
    padding: 20px;
    color: #666;
    font-size: 0.75rem;
    max-width: 1400px;
    margin: 20px auto 0;
}

.btn-primary-custom {
    background: #1e4663;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 40px;
    font-weight: 600;
    transition: 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary-custom:hover {
    background: #f59e0b;
    color: #1e2f3e;
}

.btn-success-custom {
    background: #28a745;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 40px;
    font-weight: 600;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-danger-custom {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 40px;
    font-weight: 600;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-secondary-custom {
    background: #6c757d;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 40px;
    font-weight: 600;
    transition: 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-secondary-custom:hover {
    background: #5a6268;
    color: white;
}

.messages {
    margin-bottom: 20px;
}

.alert {
    padding: 12px 18px;
    border-radius: 12px;
    margin-bottom: 10px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.modal-header {
    background: #1e4663;
    color: white;
    border: none;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
}

/* Кастомный скроллбар для модального окна */
.modal-body {
    max-height: 60vh;
    overflow-y: auto;
}

.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #1e4663;
    border-radius: 10px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: #f59e0b;
}

@media (max-width: 768px) {
    .content {
        padding: 20px;
    }
    .nav-bar {
        padding: 0 15px;
        gap: 10px;
    }
    .nav-bar a {
        padding: 10px 15px;
        font-size: 14px;
    }
}

.btn-сopy {
    color: #00000085;
    padding: 5px 5px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.75rem;
    margin-right: 5px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: 500;
    border: none;
    cursor: pointer;
}
.btn-сopy:hover {
    color: #000000;
    transform: translateY(-1px);
}

/* Предотвращает двойной скроллбар в модальных окнах */
.modal-open {
    overflow: hidden !important;
    padding-right: 0 !important;
}

.modal {
    overflow-y: auto !important;
    padding-right: 0 !important;
}

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1040;
    width: 100vw;
    height: 100vh;
    background-color: #000;
}

.modal-backdrop.show {
    opacity: 0.5;
}