/* Основные стили для всего сайта */
@charset "UTF-8";

/* === CAPTCHA layout (image + refresh on top, input below) === */
.captcha-wrap {
    margin-top: 12px;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.captcha-hint {
    font-size: 13px;
    color: #718096;
    margin-bottom: 8px;
    font-style: italic;
}

.captcha-label {
    margin-bottom: 8px;
    font-weight: 600;
}

.captcha-top-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

.captcha-image-box {
    flex: 1;
    min-height: 80px;  /* Увеличено для нового размера CAPTCHA */
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid rgba(0, 0, 0, 0.1);  /* Более заметная рамка */
    border-radius: 12px;
    overflow: hidden;
    padding: 8px;
}

.captcha-image {
    height: auto;
    max-height: 80px;  /* Увеличено для нового размера */
    width: auto;
    max-width: 100%;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

.captcha-refresh-btn {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: rgba(255, 255, 255, 0.9);
    font-size: 18px;
    cursor: pointer;
    transition: transform .08s ease, background .15s ease;
}

.captcha-refresh-btn:hover {
    background: #fff;
}

.captcha-refresh-btn:active {
    transform: scale(0.96);
}

.captcha-input {
    height: 46px;
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.08em;
    border-radius: 10px;
}

/* ===== ОСНОВНЫЕ СТИЛИ ===== */
body {
    font-family: 'Roboto', sans-serif;
    background-color: #f8f9fa;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    /* padding-top управляется в base.html */
    color: #212529;
}

/* ===== DARK MODE (BASE) ===== */
body.dark-mode {
    background-color: #0f1115;
    color: #e5e7eb;
}

body.dark-mode .page-content {
    background-color: #0f1115;
}

body.dark-mode .navbar {
    background-color: #151824 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

body.dark-mode .card,
body.dark-mode .dropdown-menu,
body.dark-mode .modal-content,
body.dark-mode .list-group-item,
body.dark-mode .table,
body.dark-mode .table thead th {
    background-color: #151824;
    color: #e5e7eb;
    border-color: rgba(255, 255, 255, 0.08);
}

body.dark-mode .table tbody tr {
    border-color: rgba(255, 255, 255, 0.06);
}

body.dark-mode .form-control,
body.dark-mode .form-select,
body.dark-mode .input-group-text {
    background-color: #11131a;
    color: #e5e7eb;
    border-color: rgba(255, 255, 255, 0.12);
}

body.dark-mode .form-control::placeholder {
    color: #9ca3af;
}

body.dark-mode .alert {
    background-color: #151824;
    color: #e5e7eb;
    border-color: rgba(255, 255, 255, 0.08);
}

body.dark-mode a {
    color: #9bb1ff;
}

body.dark-mode .theme-toggle {
    border-color: rgba(255, 255, 255, 0.2);
}

/* Dark mode: tone document previews */
body.dark-mode .doc-card__preview,
body.dark-mode .preview-images {
    background-color: #11131a;
}

body.dark-mode .doc-card__preview img,
body.dark-mode .preview-images img,
body.dark-mode #previewImage {
    filter: brightness(0.85) contrast(1.05) saturate(0.95);
}

body.dark-mode .doc-card {
    background: #151824;
    color: #e5e7eb;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25);
}

body.dark-mode .doc-card__head,
body.dark-mode .doc-card__foot {
    color: #e5e7eb;
}

body.dark-mode .doc-name {
    color: #f3f4f6;
}

body.dark-mode .doc-meta,
body.dark-mode .doc-meta small,
body.dark-mode .doc-meta span,
body.dark-mode .no-preview {
    color: #9ca3af;
}

body.dark-mode .doc-card__preview {
    background: #11131a;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

body.dark-mode .preview-load-btn {
    background: rgba(17, 19, 26, 0.92);
    color: #e5e7eb;
    border-color: rgba(255, 255, 255, 0.12);
}

body.dark-mode .doc-menu {
    background: #1b2130;
    border-color: rgba(255, 255, 255, 0.12);
}

body.dark-mode .doc-menu button,
body.dark-mode .doc-menu a {
    color: #e5e7eb;
}

body.dark-mode .doc-menu button:hover,
body.dark-mode .doc-menu a:hover {
    background: #2a3246;
}

/* ===== НАВИГАЦИЯ (УЛУЧШЕННАЯ) ===== */
/* Navbar стили управляются в base.html */
.navbar-old-disabled {
    background: #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
    padding: 0.25rem 1rem;
    margin: 0;
    animation: fadeInDown 0.4s ease-in-out;
}

.navbar-nav {
    display: flex;
    justify-content: flex-end;
    width: 100%;
}

/* Ссылки в меню */
/* nav-link стили управляются в base.html */
.nav-link-old-disabled {
    color: #444;
    font-weight: 500;
    position: relative;
    padding: 0.75rem 1rem;
    transition: all 0.25s ease;
    cursor: pointer;
}

/* Подсветка при наведении */

/* Кнопка профиля / флага */
.user-badge {
    background: #f8f9fa;
    border-radius: 20px;
    padding: 6px 12px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.user-badge:hover {
    background: #e9ecef;
}

/* Лёгкая анимация появления при загрузке */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== КОНТЕЙНЕРЫ ===== */
.container {
    margin: 2rem auto;
    padding: 20px;
    max-width: 90%;
    box-sizing: border-box;
}

.form-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 10px;
    box-sizing: border-box;
}

/* ===== ФОРМЫ ===== */
.form-control {
    margin-bottom: 1rem;
    padding: 0.5rem;
    font-size: 1rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    width: 100%;
    box-sizing: border-box;
}

.form-control:focus {
    border-color: rgba(128, 128, 208, 0.85);
    box-shadow: 0 0 5px rgba(128, 128, 208, 0.25);
    outline: none;
}

/* ===== КНОПКИ ===== */
.btn {
    background-color: #6b5b95;
    color: white;
    border: 1px solid #6b5b95;
    padding: 0.6rem 1.2rem;
    cursor: pointer;
    margin: 0.5rem 0;
    border-radius: 0.25rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    font-weight: bold;
    font-family: 'Roboto', sans-serif;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
}

.btn:hover {
    background-color: rgba(102, 102, 178, 0.9);
    border-color: rgba(85, 85, 148, 0.9);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    color: white;
    text-decoration: none;
}

.btn-purple {
    background-color: #6a0dad;
    border-color: #5a0c9a;
    color: #fff;
    font-weight: bold;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.btn-purple:hover {
    background-color: #570e85;
    border-color: #4c0b73;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    color: #fff;
}

.btn-purple:active {
    background-color: #4c0b73;
    border-color: #3f095f;
}

/* ===== ТАБЛИЦЫ ===== */
.table-container {
    display: flex;
    justify-content: center;
    width: 100%;
    margin: 0 auto;
}

.table {
    width: 100%;
    max-width: 1200px;
    table-layout: fixed;
    margin: 0 auto;
    border-collapse: collapse;
}

.table td .form-control {
    width: 100%;
    box-sizing: border-box;
    padding: 5px;
}

/* ===== ФУТЕР ===== */
.footer {
    padding: 1px 0;
    background-color: #343a40;
    color: #ffffff;
    text-align: center;
    width: 100%;
    margin-top: auto;
    font-size: 0.9rem;
}

.footer a {
    color: #ffffff;
    text-decoration: none;
    margin: 0 0.5rem;
}

.footer a:hover {
    text-decoration: underline;
}

.footer p {
    color: #ffffff;
    font-size: 0.9rem;
    margin: 0.5rem 0;
}

/* ===== УВЕДОМЛЕНИЯ ===== */
.notification {
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    padding: 10px;
    margin: 10px 0;
    font-size: 14px;
    border-radius: 5px;
    color: #333;
}

/* ===== ПРОГРЕСС-БАРЫ ===== */
.progress {
    height: 20px;
    background-color: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, .1);
}

.smooth-progress {
    background: linear-gradient(to right, rgba(30, 144, 255, 0.1), rgba(30, 144, 255, 1));
    width: 0;
    height: 100%;
    transition: width 0.4s ease, background 0.4s ease;
    border-radius: 10px 0 0 10px;
    color: transparent;
    font-size: 0;
}

.smooth-progress.fill {
    background: linear-gradient(to right, rgba(30, 144, 255, 0.4), rgba(30, 144, 255, 1));
    transition: background 0.4s ease-in-out;
}

.progress-bar {
    height: 100%;
    border-radius: 10px;
    transition: width 0.3s ease, background-color 0.3s ease;
    text-align: center;
    color: white;
}

.progress-bar-weak {
    background-color: rgba(255, 0, 0, 0.7);
}

.progress-bar-medium {
    background-color: rgba(255, 255, 0, 0.7);
}

.progress-bar-strong {
    background-color: rgba(0, 248, 124, 0.7);
}

/* ===== ВАКАНСИИ ===== */
.vacancies-table-container {
    max-height: 400px;
    overflow-y: scroll;
    border: 1px solid #ddd;
}

.vacancies-table-container table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 16px;
    text-align: left;
}

.vacancies-table-container th {
    background-color: #343a40;
    color: white;
    padding: 10px;
    border-bottom: 1px solid #ddd;
}

.vacancies-table-container td {
    padding: 10px;
    border-bottom: 1px solid #ddd;
}

/* ===== ГРАФИКИ ===== */
.dash-graph-container {
    width: 100%;
    margin-bottom: 20px;
}

.dash-graph {
    overflow-x: auto;
}

/* ===== ВЫПАДАЮЩИЕ МЕНЮ ===== */
.dropdown-toggle .fas.fa-ellipsis-v {
    color: white;
}

.dropdown-toggle::after {
    border-top-color: white;
}

.dropdown-menu {
    background-color: #333;
    color: white;
}

.dropdown-item {
    color: white;
}

.dropdown-item:hover {
    background-color: #555;
    color: white;
}

/* Fix: шапка сетки документов — dropdown и кнопка "more" с читаемым текстом и видимыми кнопками */
.doc-grid-header .dropdown-menu,
#selectAllDropdownBtn ~ .dropdown-menu,
#docGridHeader .dropdown-menu {
    background-color: #fff !important;
    color: #212529 !important;
    border: 1px solid rgba(0, 0, 0, 0.15);
    min-width: 220px !important;
    padding: 0.5rem 0 !important;
    z-index: 1060 !important;
}
.doc-grid-header .dropdown-menu .dropdown-item,
.doc-grid-header .dropdown-menu button,
.doc-grid-header .dropdown-menu a,
#docGridHeader .dropdown-menu .dropdown-item,
#docGridHeader .dropdown-menu button.dropdown-item {
    color: #212529 !important;
    display: block !important;
    width: 100% !important;
    padding: 0.5rem 1rem !important;
    text-align: left !important;
    cursor: pointer !important;
    border: none !important;
    background: transparent !important;
    font-size: inherit !important;
}
.doc-grid-header .dropdown-menu .dropdown-item:hover,
.doc-grid-header .dropdown-menu button:hover,
#docGridHeader .dropdown-menu .dropdown-item:hover,
#docGridHeader .dropdown-menu button.dropdown-item:hover {
    background-color: #f8f9fa !important;
    color: #212529 !important;
}
/* Кнопка "more": текст всегда виден, кликабельна (глобальный .btn даёт color: white) */
.doc-grid-header .select-all-more-btn,
.doc-grid-header #selectAllDropdownBtn,
#selectAllDropdownBtn {
    color: #1f2937 !important;
    background-color: #e5e7eb !important;
    border: 1px solid #9ca3af !important;
    cursor: pointer !important;
    pointer-events: auto !important;
    position: relative !important;
    z-index: 20 !important;
}
.doc-grid-header .select-all-more-btn:hover,
.doc-grid-header #selectAllDropdownBtn:hover,
#selectAllDropdownBtn:hover {
    color: #111827 !important;
    background-color: #d1d5db !important;
    border-color: #6b7280 !important;
}
/* Стрелка dropdown на кнопке "more" — тёмная, не белая */
.doc-grid-header #selectAllDropdownBtn.dropdown-toggle::after,
#selectAllDropdownBtn.dropdown-toggle::after {
    border-top-color: #1f2937 !important;
}
#selectAllDropdownBtn.dropdown-toggle:hover::after {
    border-top-color: #111827 !important;
}
.doc-grid-header {
    position: relative;
    z-index: 10;
}

/* Select-all dropdown: видимость даже если Bootstrap переносит меню в body */
#selectAllDropdownMenu.select-all-dropdown-menu,
.select-all-dropdown-menu#selectAllDropdownMenu {
    background-color: #fff !important;
    color: #212529 !important;
    border: 1px solid rgba(0, 0, 0, 0.15);
    min-width: 220px !important;
    padding: 0.5rem 0 !important;
    z-index: 1060 !important;
}
#selectAllDropdownMenu .dropdown-item,
#selectAllDropdownMenu button.dropdown-item {
    color: #212529 !important;
    display: block !important;
    width: 100% !important;
    padding: 0.5rem 1rem !important;
    text-align: left !important;
    cursor: pointer !important;
    background: transparent !important;
}
#selectAllDropdownMenu .dropdown-item:hover,
#selectAllDropdownMenu button.dropdown-item:hover {
    background-color: #f8f9fa !important;
    color: #212529 !important;
}

/* ===== КАТЕГОРИИ ===== */
.categories-container {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.category-card {
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    width: 150px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.category-card .icon {
    font-size: 2em;
    margin-bottom: 10px;
}

.category-card .text {
    font-weight: bold;
    font-size: 1.1em;
}

/* ===== ИКОНКИ ФАЙЛОВ ===== */
.file-icon {
    width: 64px;
    height: 64px;
    display: inline-block;
    background-repeat: no-repeat;
    background-size: contain;
    margin-right: 10px;
    vertical-align: middle;
}

.pdf-icon {
    background-image: url('/static/img/pdf-icon.png');
}

.jpeg-icon {
    background-image: url('/static/img/jpeg-icon.png');
}

.png-icon {
    background-image: url('/static/img/png-icon.png');
}

.xls-icon,
.xlsx-icon {
    background-image: url('/static/img/excel-icon.png');
}

/* ===== МОБИЛЬНЫЕ УСТРОЙСТВА ===== */
@media (max-width: 768px) {
    body {
        font-size: 0.875rem;
    }

    .container {
        margin: 10px;
        padding: 10px;
        max-width: 95%;
    }

    h1,
    h2,
    h3,
    h4,
    h5,
    h6 {
        text-align: center;
    }

    .form-control,
    .btn {
        font-size: 0.875rem;
        padding: 0.5rem 0.75rem;
    }

    .btn {
        width: 100%;
        margin: 0.5rem 0;
    }

    .navbar-brand,
    .navbar-nav .nav-link {
        font-size: 0.875rem;
    }

    /* Старые стили для navbar-toggler удалены - теперь используются градиентные из base.html */

    .form-control {
        width: 100%;
    }

    .footer {
        text-align: center;
        font-size: 0.875rem;
        padding: 15px;
    }

    .footer a {
        display: block;
        margin: 0.5rem 0;
        text-align: center;
    }

    .footer p {
        font-size: 0.8rem;
        text-align: center;
    }

    .footer i {
        font-size: 20px;
    }

    /* Таблицы на мобильных */
    .table {
        width: 100%;
        font-size: 14px;
    }

    .table tbody tr {
        display: flex;
        flex-direction: column;
        width: 100%;
    }

    .table tbody tr td {
        width: 100%;
        margin-bottom: 10px;
    }

    .table thead {
        display: none;
    }

    .table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .form-control[placeholder]::placeholder {
        font-weight: bold;
        font-size: 14px;
    }

    /* Вакансии на мобильных */
    .vacancies-table-container table {
        font-size: 14px;
    }

    .vacancies-table-container th,
    .vacancies-table-container td {
        padding: 8px;
    }

    .vacancies-table-container {
        max-height: 300px;
    }

    .dash-graph {
        height: 250px;
    }

    .dash-graph-container,
    .vacancies-table-container {
        padding: 0 5px;
        margin-bottom: 10px;
    }

    .dash-graph-container {
        width: 100%;
    }

    /* Иконки файлов на мобильных */
    .file-icon {
        width: 48px;
        height: 48px;
    }
}

/* ===== БОЛЬШИЕ ЭКРАНЫ ===== */
@media (min-width: 1200px) {
    .file-icon {
        width: 80px;
        height: 80px;
    }
}

/* ===== УТИЛИТЫ ===== */
.fade {
    transition: opacity 0.15s linear;
}

.show {
    opacity: 1;
}

.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.mt-1 {
    margin-top: 0.25rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-3 {
    margin-top: 1rem;
}

.mt-4 {
    margin-top: 1.5rem;
}

.mt-5 {
    margin-top: 3rem;
}

.mb-1 {
    margin-bottom: 0.25rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-3 {
    margin-bottom: 1rem;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

.mb-5 {
    margin-bottom: 3rem;
}

.p-1 {
    padding: 0.25rem;
}

.p-2 {
    padding: 0.5rem;
}

.p-3 {
    padding: 1rem;
}

.p-4 {
    padding: 1.5rem;
}

.p-5 {
    padding: 3rem;
}

/* ===== КАСТОМНЫЙ СКРОЛЛБАР ===== */
/* Firefox */
body {
    scrollbar-width: thin;
    scrollbar-color: #6c757d #f8f9fa;
}

/* WebKit/Blink */
@supports selector(::-webkit-scrollbar) {
    body::-webkit-scrollbar {
        width: 8px;
    }

    body::-webkit-scrollbar-track {
        background: #f8f9fa;
    }

    body::-webkit-scrollbar-thumb {
        background: #6c757d;
        border-radius: 4px;
    }

    body::-webkit-scrollbar-thumb:hover {
        background: #495057;
    }
}

/* ===== GOOGLE OAUTH СТИЛИ ===== */
.divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    color: #6c757d;
    font-size: 0.875rem;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #dee2e6;
    margin: 0 1rem;
}

.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: #fff;
    border: 2px solid #dadce0;
    border-radius: 8px;
    color: #3c4043;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn-google:hover {
    background: #f8f9fa;
    border-color: #c1c7cd;
    color: #3c4043;
    text-decoration: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.btn-google:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn-google svg {
    flex-shrink: 0;
}

/* Адаптивность для Google кнопки */
@media (max-width: 576px) {
    .btn-google {
        padding: 0.625rem 0.875rem;
        font-size: 0.8rem;
        gap: 0.5rem;
    }
}

/* ===== Footer social (фикс наложения) ===== */
.footer-social,
.social-links {
    display: flex;
    align-items: center;
    gap: 12px;
    /* расстояние между ссылками */
    flex-wrap: wrap;
    /* безопасный перенос на маленьких экранах */
    margin-top: 8px;
}

.footer-social .social-link,
.social-links .social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 50%;
    /* круглые кнопки */
    text-decoration: none;
    color: inherit;
    transition: all .3s ease;
}

.footer-social .social-link span,
.social-links .social-link span {
    display: none;
    /* скрываем текст */
}

.footer-social .social-link:hover,
.social-links .social-link:hover {
    background: rgba(255, 255, 255, .15);
    border-color: rgba(255, 255, 255, .3);
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .2);
}

.footer-social .social-link i,
.social-links .social-link i {
    font-size: 18px;
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Цвета иконок */
.social-link.telegram i {
    color: #229ED9;
}

.social-link.whatsapp i {
    color: #25D366;
}

.social-link.viber i {
    color: #7360F2;
}

/* гарантируем видимость текста на любых темах */
.footer-social .social-link span:last-child,
.social-links .social-link span:last-child {
    color: rgba(255, 255, 255, .95);
    font-weight: 500;
}

/* Фикс: убираем белый фон у contact-info в футере */
.footer-premium .contact-info,
footer .contact-info {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
}

.footer-premium .contact-item,
footer .contact-item {
    color: rgba(255, 255, 255, .9) !important;
}

.footer-premium .contact-item span,
footer .contact-item span {
    color: rgba(255, 255, 255, .9) !important;
}

/* ===== Documents toolbar alignment (Perfect Align) ===== */
.docs-toolbar {
    --dt-h: 44px;
    /* общая высота контролов */
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: 12px 0 24px;
}

.docs-toolbar>* {
    align-self: stretch;
}

/* поиск тянется, селекты — компактные */
.docs-toolbar .toolbar-search {
    flex: 1 1 420px;
    min-width: 260px;
}

.docs-toolbar .toolbar-select {
    flex: 0 0 180px;
}

/* единый размер шрифта */
.docs-toolbar .form-control,
.docs-toolbar .form-select {
    font-size: 0.95rem;
    line-height: 1.25;
    margin: 0;
}

/* === input-group: ровный блок */
.docs-toolbar .toolbar-search .input-group {
    display: flex;
    align-items: stretch;
    height: var(--dt-h);
}

.docs-toolbar .input-group>.input-group-text,
.docs-toolbar .input-group>.form-control {
    height: var(--dt-h);
    padding-top: 10px;
    padding-bottom: 10px;
}

.docs-toolbar .input-group>.input-group-text {
    border-right: 0;
}

.docs-toolbar .input-group>.form-control {
    border-left: 0;
}

/* скругления */
.docs-toolbar .input-group .input-group-text {
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}

.docs-toolbar .input-group .form-control {
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
}

.docs-toolbar .form-select {
    border-radius: 12px;
}

/* === селекты: жёсткая высота */
.docs-toolbar .form-select {
    height: var(--dt-h);
    min-height: var(--dt-h);
    padding-top: 10px;
    padding-bottom: 10px;
    background-position: right .75rem center;
    background-size: 16px 12px;
}

/* счетчик и действия (для crew page) */
.docs-toolbar .counter {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: var(--dt-h);
    padding: 0 12px;
    border-radius: 20px;
    line-height: 1;
    white-space: nowrap;
    margin-left: auto;
}

.docs-toolbar .toolbar-actions {
    flex: 0 0 auto;
    display: flex;
    gap: 8px;
}

/* адаптив */
@media (max-width: 992px) {
    .docs-toolbar .toolbar-search {
        flex-basis: 100%;
    }

    .docs-toolbar .toolbar-select {
        flex: 1 1 160px;
    }

    .docs-toolbar .counter {
        margin-left: 0;
    }

    .docs-toolbar .toolbar-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* ===== Company Dashboard cards ===== */
.dashboard-cards .dashboard-card {
    min-height: 260px;
}

.dashboard-cards .card-body {
    display: flex;
    flex-direction: column;
}

.dashboard-cards .card-actions {
    margin-top: auto;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.dashboard-cards .btn-action {
    min-height: 40px;
}

.dashboard-cards .app-icon {
    font-size: 44px;
    line-height: 1;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.dashboard-cards .card-title {
    font-weight: 600;
}

.dashboard-cards .card-subtitle {
    min-height: 22px;
}

/* чтобы строки под иконкой выровнялись */
.dashboard-cards .feature-note {
    min-height: 18px;
    display: block;
}

/* фикс высоты под короткое примечание */

@media (max-width: 991.98px) {
    .dashboard-cards .dashboard-card {
        min-height: 240px;
    }
}

/* ===== ВЫРАВНИВАНИЕ КНОПОК С ИКОНКАМИ В INPUT-GROUP ===== */
/* Общие правила для правильного выравнивания кнопок с иконками относительно ячеек */
/* Используется в формах регистрации, смены пароля, поиска и других местах */

/* Базовое выравнивание для input-group */
.input-group {
    align-items: stretch !important;
}

/* Одинаковая высота для всех элементов в input-group */
.input-group > * {
    height: calc(2.25rem + 2px) !important;
    min-height: calc(2.25rem + 2px) !important;
    max-height: calc(2.25rem + 2px) !important;
    vertical-align: top !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Выравнивание для form-control и input-group-text */
.input-group .form-control,
.input-group .input-group-text {
    vertical-align: top !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Кнопки в input-group - центрирование содержимого */
.input-group .btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    vertical-align: top !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Иконки внутри кнопок - идеальное центрирование */
.input-group .btn i {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1rem !important;
    line-height: 1 !important;
    vertical-align: middle !important;
    width: 1em !important;
    height: 1em !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Иконки в input-group-text - центрирование */
.input-group .input-group-text {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.input-group .input-group-text i {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1rem !important;
    line-height: 1 !important;
    vertical-align: middle !important;
    width: 1em !important;
    height: 1em !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Обработка ошибок валидации */
.input-group .form-control.is-invalid + .btn {
    border-color: #f56565 !important;
}

/* === Seaman Guide form UI (Create Vessel + Create Seafarer only) === */
.sg-form-card {
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
    background: #ffffff;
}

.sg-modal {
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.18);
    border: 1px solid #eef2f7;
}

.sg-field {
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.sg-field:not(textarea) {
    min-height: 44px;
}

.sg-field:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.16);
}

.sg-field:disabled,
.sg-field[disabled] {
    background-color: #f8fafc;
    color: #94a3b8;
}

.sg-field.is-invalid,
.sg-field:invalid {
    border-color: #f87171;
    box-shadow: 0 0 0 0.2rem rgba(248, 113, 113, 0.14);
}

.sg-help {
    font-size: 12px;
    color: #6b7280;
}

.sg-footer {
    gap: 12px;
}

.sg-footer .btn {
    min-height: 40px;
    border-radius: 10px;
}

.sg-modal .sg-footer {
    position: sticky;
    bottom: 0;
    background: #ffffff;
    border-top: 1px solid #eef2f7;
    padding-top: 12px;
}

/* ===== Company Mail: page header (title + Back/Settings) ===== */
.page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.page-head__title .text-muted {
    margin-top: 2px;
}

.page-head__actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mail-btn {
    min-width: 120px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
}

@media (max-width: 576px) {
    .page-head {
        flex-direction: column;
        align-items: stretch;
    }
    .page-head__actions {
        justify-content: flex-end;
    }
    .mail-btn {
        flex: 1;
        min-width: 0;
    }
}

/* ===== Company Mail: поиск + Refresh — единый input-group (одна высота, одна рамка) ===== */
.mail-search-row {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.mail-search-input {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    border: 1px solid #dcdcdc;
    border-radius: 10px;
    background: #fff;
}

.mail-search-input i {
    opacity: 0.55;
}

.mail-search-input input {
    border: none;
    outline: none;
    box-shadow: none;
    padding: 10px 0;
    flex: 1;
    min-width: 0;
}

.mail-refresh-btn {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    border: 1px solid #dcdcdc;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.mail-refresh-btn:hover {
    background: rgba(120, 80, 220, 0.08);
    border-color: rgba(120, 80, 220, 0.4);
}

/* ===== Company Mail: более читаемый hover/active списка писем ===== */
.sg-mail .sg-mail-item {
    border-radius: 12px;
    padding: 12px 14px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    background: #fff;
    cursor: pointer;
    transition: background 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

.sg-mail .sg-mail-item:hover {
    background: rgba(120, 80, 220, 0.08);
    border-color: rgba(120, 80, 220, 0.25);
}

.sg-mail .sg-mail-item.is-active {
    background: rgba(120, 80, 220, 0.12);
    border-color: rgba(120, 80, 220, 0.45);
    box-shadow: 0 6px 20px rgba(30, 10, 60, 0.08);
}

.sg-mail .sg-mail-item__subject {
    font-weight: 700;
}

.sg-mail .sg-mail-item__from {
    opacity: 0.85;
    font-size: 0.92rem;
}

.sg-mail .sg-mail-item__preview {
    opacity: 0.7;
    font-size: 0.9rem;
}