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

/* Цвета РЖД: красный, серый, белый */
:root {
    --primary: #E31E24;
    --primary-hover: #c41a1f;
    --rzd-grey: #4A4A4A;
    --rzd-grey-light: #6B6B6B;
    --sidebar-bg: #4A4A4A;
    --sidebar-text: #f0f0f0;
    --sidebar-active: #5a5a5a;
    --header-bg: #3d3d3d;
    --main-bg: #e8e8e8;
    --card-bg: #fff;
    --card-shadow: 0 1px 4px rgba(0,0,0,0.1);
    --border: #d0d0d0;
    --text: #333;
    --text-muted: #6B6B6B;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--main-bg);
    min-height: 100vh;
    color: var(--text);
    font-size: 15px;
    line-height: 1.5;
}

/* ——— Вход и смена пароля ——— */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    width: 100%;
    max-width: 400px;
}

.login-card h2 {
    margin-bottom: 1.5rem;
    color: var(--primary);
    text-align: center;
    font-weight: 600;
}

.login-card--wide {
    max-width: 440px;
}

.info-text {
    color: var(--text-muted);
    margin-bottom: 1rem;
    text-align: center;
    font-size: 0.95rem;
}

.info-text--small {
    font-size: 0.88rem;
    line-height: 1.45;
}

.password-requirements-list {
    margin: 0 0 1.15rem;
    padding-left: 1.35rem;
    font-size: 0.88rem;
    line-height: 1.5;
    color: var(--text-muted);
    text-align: left;
}

.password-requirements-list li {
    margin-bottom: 0.35rem;
}

.password-input-wrap {
    display: flex;
    align-items: stretch;
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.password-input-wrap:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.15);
}

.password-input-wrap input {
    flex: 1;
    min-width: 0;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0.6rem 0.75rem;
    font-size: 0.95rem;
}

.password-toggle {
    flex-shrink: 0;
    width: 44px;
    border: none;
    background: #f3f4f6;
    color: var(--rzd-grey);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
}

.password-toggle:hover {
    background: #e8eaed;
    color: var(--primary);
}

.password-toggle__icon {
    display: block;
    pointer-events: none;
}

.password-change-card {
    margin-top: 1.5rem;
    padding: 1.25rem 1.35rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fafafa;
}

.password-change-card__title {
    font-size: 1.05rem;
    margin: 0 0 0.5rem;
    color: var(--rzd-grey);
}

.password-change-card__lead {
    margin: 0 0 0.75rem;
    font-size: 0.9rem;
}

/* ——— Состав отряда (командир / комиссар) ——— */
.commander-roster-list .list-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

.commander-roster-row--danger {
    border-left: 4px solid #dc2626;
    background: #fef2f2;
}

.roster-badge {
    display: inline-block;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    font-size: 0.78rem;
    font-weight: 600;
    margin-right: 0.35rem;
    vertical-align: middle;
}

.roster-badge--danger {
    background: #fee2e2;
    color: #991b1b;
}

.roster-badge--warn {
    background: #fef3c7;
    color: #92400e;
}

.commander-roster-row__actions {
    flex-shrink: 0;
}

/* ——— Оболочка приложения ——— */
.app-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-header {
    background: var(--header-bg);
    color: #fff;
    min-height: 56px;
    height: auto;
    padding-top: max(0px, env(safe-area-inset-top, 0px));
    padding-right: max(1.5rem, env(safe-area-inset-right, 0px));
    padding-bottom: 0;
    padding-left: max(1.5rem, env(safe-area-inset-left, 0px));
    flex-shrink: 0;
    display: flex;
    align-items: center;
    box-shadow: 0 1px 0 rgba(255,255,255,0.06);
}

.app-header-inner {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.sidebar-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 8px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    transition: background 0.2s;
}
.sidebar-toggle:hover {
    background: rgba(255,255,255,0.1);
}
.sidebar-toggle-bar {
    display: block;
    height: 2px;
    width: 100%;
    background: currentColor;
    border-radius: 1px;
    transition: transform 0.2s, opacity 0.2s;
}
.sidebar-toggle.sidebar-toggle--close .sidebar-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.sidebar-toggle.sidebar-toggle--close .sidebar-toggle-bar:nth-child(2) { opacity: 0; }
.sidebar-toggle.sidebar-toggle--close .sidebar-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.app-logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
}

.app-header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-email {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.85);
}

.btn-ghost {
    background: transparent;
    color: rgba(255,255,255,0.9);
    border: 1px solid rgba(255,255,255,0.3);
    padding: 0.4rem 0.9rem;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
}

.btn-ghost:hover {
    background: rgba(255,255,255,0.1);
}

/* ——— Раскладка: сайдбар + контент ——— */
.app-layout {
    display: flex;
    flex: 1;
    min-height: 0;
}

.sidebar {
    width: 240px;
    flex-shrink: 0;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    overflow-y: auto;
    transition: transform 0.25s ease, width 0.25s ease;
    z-index: 100;
}
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 99;
}
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: calc(56px + env(safe-area-inset-top, 0px));
        left: 0;
        bottom: 0;
        transform: translateX(-100%);
        box-shadow: 4px 0 12px rgba(0,0,0,0.15);
    }
    .sidebar.sidebar--open {
        transform: translateX(0);
    }
    .sidebar-overlay.sidebar-overlay--visible {
        display: block;
        top: calc(56px + env(safe-area-inset-top, 0px));
    }
}
@media (min-width: 769px) {
    .sidebar.sidebar--collapsed {
        width: 0;
        min-width: 0;
        overflow: hidden;
        padding: 0;
    }
}

.side-nav {
    padding: 0.75rem 0;
}

.nav-group {
    margin-bottom: 0.5rem;
}

.nav-group-title {
    display: block;
    padding: 0.5rem 1.25rem 0.35rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255,255,255,0.5);
}

.side-nav a.nav-link {
    display: block;
    padding: 0.5rem 1.25rem 0.5rem 1.5rem;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.15s, color 0.15s;
    border-left: 3px solid transparent;
}

.side-nav a.nav-link:hover {
    background: rgba(255,255,255,0.06);
    color: #fff;
}

.side-nav a.nav-link.active {
    background: var(--sidebar-active);
    color: #fff;
    border-left-color: var(--primary);
    font-weight: 500;
}

.main-content {
    flex: 1;
    overflow-y: auto;
    min-width: 0;
    padding: 1.5rem 2rem max(1.5rem, env(safe-area-inset-bottom, 0px));
    max-width: 1200px;
}

/* Полноразмерная область для сводной таблицы */
.main-content.full-width-table {
    max-width: none;
    width: 100%;
    padding: 1rem 1.25rem max(1rem, env(safe-area-inset-bottom, 0px));
}
.main-content.full-width-table .view-body.card {
    max-width: none;
    width: 100%;
    padding: 1rem 1.25rem;
}
.main-content.full-width-table .table-responsive-wrap {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.main-content.full-width-table .data-table {
    min-width: 100%;
    table-layout: auto;
}
.main-content.full-width-table .view-header {
    margin-bottom: 1rem;
}
.main-content.full-width-table .view-header h2 {
    font-size: 1.25rem;
}

/* ——— Виды (экраны) ——— */
/* Не задаём height: 100% — у командира два контейнера подряд; пустой блок с 100% высоты перекрывал ЛК бойца */
.role-views {
    min-height: 0;
}

.view {
    animation: viewFade 0.2s ease;
}

@keyframes viewFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.view-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.view-header h2 {
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--text);
}

.view-body {
    min-height: 200px;
}

/* ——— Дашборд: карточки метрик и виджеты ——— */
.view-body-dashboard {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
}
.metric-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: var(--card-shadow);
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    transition: box-shadow 0.2s, transform 0.2s;
}
.metric-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.metric-card--clickable {
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    border: 1px solid transparent;
}
.metric-card--clickable:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}
.metric-card__icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}
.metric-card__icon--candidates { background: #e3f2fd; color: #1976d2; }
.metric-card__icon--squads { background: #e8f5e9; color: #2e7d32; }
.metric-card__icon--documents { background: #fff3e0; color: #e65100; }
.metric-card__icon--verified { background: #e8f5e9; color: #1b5e20; }
.metric-card__value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text);
}
.metric-card__label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}
.dashboard-widgets {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}
.dashboard-widget .widget-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text);
}
.dashboard-widget .widget-body {
    font-size: 0.9rem;
    color: var(--text-muted);
}
.dashboard-widget .widget-body ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.dashboard-widget .widget-body li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.dashboard-widget .widget-body li:last-child { border-bottom: none; }
.deadline-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
}
.deadline-item .badge {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-weight: 500;
}
.badge--warning { background: #fff3e0; color: #e65100; }
.badge--success { background: #e8f5e9; color: #2e7d32; }
.badge--muted { background: #f5f5f5; color: #616161; }
.card-stats { padding: 1rem 0; }
.card-stats p { margin-bottom: 0.5rem; }
.card-stats .btn { margin-right: 0.5rem; margin-bottom: 0.5rem; }

/* ——— ЛК кандидата: прогресс анкеты и вкладки ——— */
.candidate-lk-header {
    margin-bottom: 1.25rem;
}
.profile-progress-wrap {
    margin-bottom: 1rem;
}
.profile-progress-label {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}
.profile-progress-label strong {
    color: var(--text);
}
.profile-progress-bar {
    height: 10px;
    background: var(--border);
    border-radius: 5px;
    overflow: hidden;
}
.profile-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #c41a1f);
    border-radius: 5px;
    transition: width 0.35s ease;
}
.candidate-tabs {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}
.candidate-tab {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    background: var(--card-bg);
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.candidate-tab:hover {
    background: #f5f5f5;
    color: var(--text);
}
.candidate-tab.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ——— Дорожная карта этапов трудоустройства ——— */
.employment-step {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0;
    border-left: 3px solid var(--border);
    margin-left: 8px;
    padding-left: 1rem;
    position: relative;
}
.employment-step::before {
    content: '';
    position: absolute;
    left: -11px;
    top: 1.1rem;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border);
}
.employment-step.done {
    border-left-color: #2e7d32;
}
.employment-step.done::before {
    background: #2e7d32;
    box-shadow: 0 0 0 2px rgba(46, 125, 50, 0.3);
}
.employment-step.pending {
    border-left-color: var(--border);
    opacity: 0.85;
}
.employment-step .step-status {
    font-weight: bold;
    color: #2e7d32;
    width: 1.2rem;
}
.employment-step.pending .step-status {
    color: var(--text-muted);
}
.employment-step .step-name {
    color: var(--text);
}
.employment-step.pending .step-name {
    color: var(--text-muted);
}

.card {
    background: var(--card-bg);
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border);
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text);
}

.card-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.card-stats p {
    margin: 0.5rem 0;
    font-size: 0.95rem;
    color: var(--text);
}

.card-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* ——— Формы ——— */
.form-group {
    margin-bottom: 1rem;
}

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

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.15);
}

.form-group .password-input-wrap input {
    width: auto;
    max-width: none;
}

.searchable-select {
    position: relative;
}
.searchable-select input[type="text"] {
    width: 100%;
}
.searchable-dropdown {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    margin-top: 2px;
    max-height: 220px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
    z-index: 2000;
    display: none;
}
.searchable-dropdown.open {
    display: block;
}
.searchable-dropdown .option {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    background: #fff;
}
.searchable-dropdown .option:hover,
.searchable-dropdown .option.selected {
    background: rgba(196, 30, 58, 0.1);
}
.searchable-dropdown .option:last-child {
    border-bottom: none;
}
.searchable-dropdown .option-empty {
    padding: 0.5rem 0.75rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    background: #fff;
}

.searchable-dropdown.searchable-dropdown--card {
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.input-readonly {
    background: #f8fafc !important;
    color: var(--text-muted);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

/* ——— Кнопки ——— */
.btn {
    padding: 0.55rem 1.1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    background: #f8fafc;
    color: var(--text);
    text-decoration: none;
    display: inline-block;
    box-sizing: border-box;
    min-height: 44px;
    min-width: 44px;
}
.btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

.btn-secondary {
    background: var(--text-muted);
    color: #fff;
    border-color: var(--text-muted);
}

.btn-secondary:hover {
    background: #475569;
}

.btn-danger {
    background: #b91c1c;
    color: #fff;
    border-color: #b91c1c;
}
.btn-danger:hover {
    background: #991b1b;
    border-color: #991b1b;
}

.btn-sm {
    padding: 0.35rem 0.65rem;
    font-size: 0.85rem;
    min-height: 40px;
    min-width: auto;
}

/* ——— Списки и карточки элементов ——— */
.list-item {
    padding: 1rem 1.25rem;
    background: #fff;
    border-radius: 8px;
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
}

.list-item h4 {
    color: var(--text);
    margin-bottom: 0.4rem;
    font-size: 1rem;
}

.list-item p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0.25rem 0;
}

.list-item-clickable {
    cursor: pointer;
    transition: background 0.15s ease;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}
.list-item-clickable:hover {
    background: rgba(196, 30, 58, 0.06);
}
.list-item-clickable .list-item-main {
    flex: 1;
    min-width: 0;
}
.list-item-clickable .list-item-actions {
    flex-shrink: 0;
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}
.data-table-row-clickable {
    cursor: pointer;
}
.data-table-row-clickable:hover {
    background: rgba(196, 30, 58, 0.08);
}
.list-item .btn, .list-item button {
    margin-top: 0.5rem;
    margin-right: 0.5rem;
}

.doc-verify-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.doc-verify-row .inline-checkbox { flex-shrink: 0; }
.doc-verify-row > span { flex: 1; min-width: 120px; }
.doc-expand-icon { font-size: 0.8rem; color: var(--text-muted); }

.list-item-inactive {
    opacity: 0.85;
    background: var(--bg-muted, #f8f9fa);
}

/* ——— Работа с документами: раскрывающийся список кандидатов ——— */
.documents-work-accordion {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.documents-work-item {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}
.documents-work-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    cursor: pointer;
    transition: background 0.15s;
    user-select: none;
}
.documents-work-item-header:hover {
    background: rgba(196, 30, 58, 0.06);
}
.documents-work-item-header .documents-work-summary {
    flex: 1;
    min-width: 0;
}
.documents-work-item-header .documents-work-summary h4 {
    margin: 0 0 0.2rem 0;
    font-size: 1rem;
    color: var(--text);
}
.documents-work-item-header .documents-work-summary p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-muted);
}
.documents-work-item-header .documents-work-badge {
    flex-shrink: 0;
}
.documents-work-item-header .documents-work-chevron {
    flex-shrink: 0;
    color: var(--text-muted);
    transition: transform 0.2s;
}
.documents-work-item.expanded .documents-work-chevron {
    transform: rotate(180deg);
}
.documents-work-item-body {
    display: none;
    padding: 0 1rem 1rem;
    border-top: 1px solid var(--border);
}
.documents-work-item.expanded .documents-work-item-body {
    display: block;
}
.documents-work-docs {
    list-style: none;
    margin: 0 0 1rem 0;
    padding: 0;
}
.documents-work-docs li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0;
    font-size: 0.9rem;
}
.documents-work-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.documents-work-actions .btn {
    margin: 0;
}

.inline-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.95rem;
}
.inline-checkbox input { margin: 0; }

.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}
.badge-secondary {
    background: #e5e7eb;
    color: #4b5563;
}

/* ——— Статусы ——— */
.status-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 500;
    margin: 0.2rem;
}

.status-verified {
    background: #dcfce7;
    color: #166534;
}

.status-pending {
    background: #fef9c3;
    color: #854d0e;
}

.status-rejected {
    background: #fee2e2;
    color: #991b1b;
}

/* ——— Сообщения ——— */
.error-message {
    color: #b91c1c;
    margin-top: 0.75rem;
    padding: 0.6rem;
    background: #fef2f2;
    border-radius: 6px;
    font-size: 0.9rem;
}

/* Пустые контейнеры в формах/модалках скрыты; !important перекрывает устаревший inline display после очистки текста */
.error-message:empty {
    display: none !important;
}

.success-message {
    color: #166534;
    margin-top: 0.75rem;
    padding: 0.6rem;
    background: #f0fdf4;
    border-radius: 6px;
    font-size: 0.9rem;
}

.text-muted {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.field-hint {
    display: block;
    margin-top: 0.25rem;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.field-error {
    display: block;
    margin-top: 0.25rem;
    color: #b91c1c;
    font-size: 0.85rem;
}

.field-error:empty { display: none; }
.input-invalid { border-color: #b91c1c !important; }

/* ——— Модальные окна ——— */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    overflow: auto;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.show {
    display: flex;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: #fff;
    padding: 1.75rem;
    border-radius: 12px;
    width: 100%;
    max-width: 440px;
    max-height: min(90vh, 100dvh - 2rem);
    overflow-y: auto;
    margin: max(0.5rem, env(safe-area-inset-top, 0px)) auto max(0.5rem, env(safe-area-inset-bottom, 0px));
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
    animation: modalSlide 0.25s ease;
}
.modal-content-wide {
    max-width: 640px;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    color: var(--text);
    font-size: 1.15rem;
    font-weight: 600;
}

.close {
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    color: var(--primary);
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

/* ——— Таблицы ——— */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.75rem;
    font-size: 0.9rem;
}

table th,
table td {
    padding: 0.65rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

table th {
    background: #f8fafc;
    font-weight: 600;
    color: var(--text);
}

table tr:hover {
    background: #f8fafc;
}

.table-responsive {
    overflow-x: auto;
}

/* ——— Права модераторов: карточки вместо широкой таблицы ——— */
.permissions-cards {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.permission-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    box-shadow: var(--card-shadow);
    border-left: 4px solid var(--primary);
}

.permission-card-header {
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--text);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}
.permission-card-email {
    font-weight: normal;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Карточка кандидата (админ) */
.card-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 0;
}
.card-table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}
.card-table td:first-child {
    font-weight: 500;
    color: var(--text);
    width: 220px;
}
.card-table input[type="text"],
.card-table input[type="date"],
.card-table select {
    width: 100%;
    max-width: 280px;
    padding: 0.4rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
}
.card-table select.card-field {
    max-width: 200px;
}

.card-table .searchable-select--card {
    width: 100%;
    max-width: 280px;
    min-width: 0;
}
.card-table .searchable-select--card .searchable-select-input {
    width: 100%;
    box-sizing: border-box;
    padding: 0.4rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: inherit;
    font-family: inherit;
    color: var(--text);
    background: #fff;
}
.card-table .searchable-select--card .searchable-select-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.12);
}

/* Сводная таблица кандидатов (админ) */
.table-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}
.table-toolbar label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.table-toolbar select,
.table-toolbar input[type="text"] {
    padding: 0.4rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
}
.table-toolbar-col-visibility {
    position: relative;
}
.columns-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0.35rem;
    min-width: 260px;
    max-height: 70vh;
    overflow-y: auto;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    padding: 0.75rem 1rem;
    z-index: 50;
    display: none;
}
.columns-dropdown[aria-hidden="false"],
.columns-dropdown.columns-dropdown-open {
    display: block;
}
.columns-dropdown-title {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text);
}
#table-columns-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
}
.column-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0.25rem 0;
}
.column-checkbox input {
    accent-color: var(--primary);
    cursor: pointer;
}
.columns-dropdown-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
}
.table-responsive-wrap {
    overflow-x: auto;
    margin-top: 0.5rem;
}
.data-table {
    width: 100%;
    min-width: 1200px;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.data-table th,
.data-table td {
    padding: 0.5rem 0.6rem;
    border: 1px solid var(--border);
    text-align: left;
    white-space: nowrap;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.data-table th {
    white-space: normal;
    max-width: none;
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    position: sticky;
    top: 0;
}
.data-table tbody tr:hover {
    background: rgba(196, 30, 58, 0.05);
}
.data-table tbody tr.row-inactive {
    background: var(--bg-muted, #f8f9fa);
    opacity: 0.9;
}
.data-table tbody tr.row-updated-by-staff {
    background: #fff8dc;
}
.data-table tbody tr.row-updated-by-staff:hover {
    background: #fff0b8;
}
.data-table .table-status-select {
    min-width: 100px;
    padding: 0.25rem 0.35rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.85rem;
}

/* Таблица «Учебные центры» в админке: полные названия без обрезки */
.training-centers-admin-wrap .data-table {
    min-width: 640px;
}
.training-centers-admin-wrap .data-table td {
    white-space: normal;
    word-break: break-word;
    max-width: none;
    overflow: visible;
    text-overflow: clip;
}
.training-centers-admin-wrap .data-table td.training-centers-col-year {
    white-space: nowrap;
    width: 4.5rem;
    max-width: 6rem;
}
.training-centers-admin-wrap .data-table td.training-centers-col-actions,
.training-centers-admin-wrap .data-table th.training-centers-col-actions {
    white-space: nowrap;
    width: 1%;
    max-width: 14rem;
}

/* Компактный список кандидатов (админ / модератор): плотнее сводной таблицы */
.candidates-table-card.card {
    padding: 0;
    overflow: hidden;
}
.candidates-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1.25rem;
    margin-bottom: 0.75rem;
}
.candidates-toolbar label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
    font-size: 0.9rem;
}
.candidates-search-input {
    min-width: 200px;
    max-width: 320px;
    padding: 0.4rem 0.55rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.9rem;
}
.candidates-page-size-select {
    padding: 0.35rem 0.5rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    font-size: 0.9rem;
}
.candidates-compact-table.data-table {
    min-width: 720px;
    font-size: 0.875rem;
}
.candidates-compact-table.data-table th,
.candidates-compact-table.data-table td {
    max-width: none;
    vertical-align: middle;
}
.candidates-compact-table.data-table td.candidates-cell-fio,
.candidates-compact-table.data-table td.candidates-cell-email,
.candidates-compact-table.data-table td.candidates-cell-squad {
    white-space: normal;
    word-break: break-word;
    overflow: visible;
    text-overflow: clip;
}
.candidates-compact-table.data-table td.candidates-cell-email {
    max-width: 14rem;
}
.candidates-compact-table.data-table th.candidates-col-actions,
.candidates-compact-table.data-table td.candidates-col-actions {
    white-space: nowrap;
    width: 1%;
    min-width: 0;
    max-width: none;
    text-align: right;
    vertical-align: middle;
}
.data-table th .th-sort-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    width: 100%;
}
.data-table th .th-sort-btn:hover {
    text-decoration: underline;
    text-underline-offset: 2px;
}
.data-table th .th-sort-btn:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}
.candidates-action-btns {
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.3rem;
    justify-content: flex-end;
    max-width: 100%;
}
/* Компактные кнопки в строке таблицы: без 44px из общего .btn */
.candidates-action-btns .btn-sm,
.candidates-action-btns .btn.candidates-act-compact {
    min-height: 0;
    min-width: 0;
    padding: 0.2rem 0.5rem;
    font-size: 0.78rem;
    font-weight: 500;
    line-height: 1.25;
    border-radius: 6px;
    white-space: nowrap;
}
.candidates-action-btns .btn-primary.candidates-act-compact {
    box-shadow: none;
}
/* Вторичные действия — контур, без тяжёлой заливки */
.candidates-action-btns .btn-secondary.candidates-act-compact {
    background: #fff;
    color: #475569;
    border-color: #cbd5e1;
}
.candidates-action-btns .btn-secondary.candidates-act-compact:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #334155;
}
/* Опасное действие — компактно, без «плиты» на всю ширину */
.candidates-action-btns .btn-danger.candidates-act-compact {
    padding-left: 0.45rem;
    padding-right: 0.45rem;
}
.candidates-pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    padding: 0.65rem 1rem;
    border-top: 1px solid var(--border);
    background: var(--bg-muted, #f8fafc);
}
.candidates-pager-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}
.candidates-pager-summary {
    margin: 0;
    font-size: 0.88rem;
    color: var(--text-muted);
}
.badge.candidates-badge-inline {
    font-size: 0.72rem;
    vertical-align: middle;
    font-weight: 600;
}
.candidate-state-badges {
    margin-top: 0.35rem;
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}
.candidate-state-badges .status-badge {
    margin: 0;
    font-size: 0.72rem;
}

/* Контроль качества данных: читаемая таблица без обрезки ключевых полей */
.quality-table-wrap {
    overflow-x: auto;
}
.quality-data-table {
    min-width: 980px;
    table-layout: fixed;
}
.quality-data-table th,
.quality-data-table td {
    white-space: normal;
    word-break: break-word;
    overflow: visible;
    text-overflow: clip;
    vertical-align: top;
    line-height: 1.35;
}
.quality-data-table th:nth-child(1),
.quality-data-table td:nth-child(1) { width: 22%; }
.quality-data-table th:nth-child(2),
.quality-data-table td:nth-child(2) { width: 16%; }
.quality-data-table th:nth-child(3),
.quality-data-table td:nth-child(3) { width: 12%; }
.quality-data-table th:nth-child(4),
.quality-data-table td:nth-child(4) { width: 8%; }
.quality-data-table th:nth-child(5),
.quality-data-table td:nth-child(5) { width: 12%; }
.quality-data-table th:nth-child(6),
.quality-data-table td:nth-child(6) { width: 22%; }
.quality-data-table th:nth-child(7),
.quality-data-table td:nth-child(7) { width: 8%; white-space: nowrap; }

.quality-view .view-body.card {
    padding: 1rem 1rem 1.1rem;
}
.quality-view .table-toolbar {
    gap: 0.65rem 0.9rem;
}
.quality-view .table-toolbar label {
    font-size: 0.88rem;
}
.quality-view .table-toolbar input[type="text"] {
    min-width: 220px;
}
.quality-view .quality-data-table {
    font-size: 0.88rem;
}
.quality-view .quality-data-table th,
.quality-view .quality-data-table td {
    padding: 0.45rem 0.5rem;
}

/* Пакетная отправка во ВСОП */
.vsop-batch-view .view-body {
    padding: 0.9rem 1rem 1.1rem;
}
.vsop-batch-view .table-toolbar {
    gap: 0.6rem 0.9rem;
}
.vsop-batch-view .table-toolbar input[type="text"] {
    min-width: 260px;
}
.vsop-batch-view .data-table {
    min-width: 1220px;
    table-layout: fixed;
}
.vsop-batch-view .data-table th,
.vsop-batch-view .data-table td {
    font-size: 0.86rem;
    line-height: 1.3;
    padding: 0.45rem 0.5rem;
    vertical-align: top;
    word-break: break-word;
}
.vsop-batch-view .data-table th:nth-child(1),
.vsop-batch-view .data-table td:nth-child(1) { width: 44px; white-space: nowrap; }
.vsop-batch-view .data-table th:nth-child(2),
.vsop-batch-view .data-table td:nth-child(2) { width: 20%; }
.vsop-batch-view .data-table th:nth-child(3),
.vsop-batch-view .data-table td:nth-child(3) { width: 12%; }
.vsop-batch-view .data-table th:nth-child(4),
.vsop-batch-view .data-table td:nth-child(4) { width: 14%; }
.vsop-batch-view .data-table th:nth-child(5),
.vsop-batch-view .data-table td:nth-child(5) { width: 15%; }
.vsop-batch-view .data-table th:nth-child(6),
.vsop-batch-view .data-table td:nth-child(6) { width: 17%; }
.vsop-batch-view .data-table th:nth-child(7),
.vsop-batch-view .data-table td:nth-child(7) { width: 22%; }

.permission-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.5rem 1.5rem;
    margin-bottom: 1rem;
}

.permission-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.permission-item input[type="checkbox"] {
    width: 1.1rem;
    height: 1.1rem;
    accent-color: var(--primary);
    cursor: pointer;
}

.permission-card-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.permission-card-actions .preset-select {
    min-width: 200px;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    font-size: 0.95rem;
}

.permissions-table th,
.permissions-table td {
    white-space: nowrap;
    vertical-align: middle;
    font-size: 0.85rem;
}

.permissions-table .preset-select {
    min-width: 140px;
    margin-right: 0.25rem;
}

/* ——— Тосты ——— */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background: #fff;
    padding: 0.9rem 1.25rem;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    min-width: 280px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-left: 4px solid var(--primary);
    animation: toastIn 0.3s ease;
}

@keyframes toastIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.success { border-left-color: #16a34a; }
.toast.error { border-left-color: #dc2626; }
.toast.info { border-left-color: #0ea5e9; }

.toast-message { flex: 1; font-weight: 500; font-size: 0.95rem; }
.toast-close { cursor: pointer; color: #94a3b8; font-size: 1.25rem; }

/* ——— Адаптив ——— */
@media (max-width: 768px) {
    .sidebar {
        width: 280px;
        max-width: 85vw;
    }

    .main-content {
        padding: 1rem 1rem max(1rem, env(safe-area-inset-bottom, 0px));
    }

    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-widgets {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}

/* ——— Юридические документы (согласие 152-ФЗ) ——— */
.legal-consent-page {
    background: linear-gradient(160deg, #f0f2f5 0%, #e4e7ec 45%, #dfe3ea 100%);
    min-height: 100vh;
}

.legal-consent-backdrop {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding: clamp(1.25rem, 4vw, 2.5rem) 1rem 2rem;
}

.legal-consent-inner {
    width: 100%;
    max-width: 34rem;
}

.legal-consent-card {
    position: relative;
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.06),
        0 12px 32px -8px rgba(0, 0, 0, 0.12);
    padding: 1.75rem 1.75rem 1.5rem;
    text-align: left;
    overflow: hidden;
}

.legal-consent-card__accent {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary) 0%, #ff6b6b 100%);
}

.legal-consent-badge {
    display: inline-block;
    font-size: 0.75rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--text-muted);
    background: #f1f3f5;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    margin-bottom: 0.75rem;
}

.legal-consent-title {
    margin: 0 0 0.75rem;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--rzd-grey);
    line-height: 1.25;
    text-align: left;
}

.legal-consent-lead {
    margin: 0 0 1rem;
    font-size: 0.95rem;
    line-height: 1.55;
    color: var(--text-muted);
}

.legal-doc-read {
    margin: 0 0 1.35rem;
    font-size: 0.95rem;
    line-height: 1.65;
    color: var(--text);
}

.legal-doc-inline-link {
    color: var(--primary);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    cursor: pointer;
    transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

.legal-doc-inline-link:hover {
    color: var(--primary-hover);
    text-decoration-color: var(--primary-hover);
}

.legal-consent-form {
    margin-top: 0.25rem;
}

.legal-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-bottom: 1.25rem;
    padding: 1rem 1rem 1.05rem;
    background: #f8f9fb;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.legal-checkboxes.legal-checkboxes--invalid {
    border-color: #ef4444;
    background: #fff5f5;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

.legal-check-label {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    font-size: 0.9rem;
    line-height: 1.45;
    cursor: pointer;
    text-align: left;
    color: var(--text);
}

.legal-check-label input {
    margin-top: 0.22rem;
    flex-shrink: 0;
    width: 1.05rem;
    height: 1.05rem;
    accent-color: var(--primary);
}

.legal-consent-submit {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border-radius: 10px;
}

.legal-consent-error {
    margin-top: 0.75rem;
}

.legal-consent-footnote {
    margin: 1rem 0 0;
    font-size: 0.8rem;
    line-height: 1.45;
    color: var(--text-muted);
}

.modal-content-wide {
    max-width: min(900px, 96vw);
    width: 96%;
}

.legal-doc-modal-inner {
    padding: 0;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    overflow: hidden;
}

.legal-doc-modal-inner .modal-header {
    padding: 1rem 1.25rem;
    flex-shrink: 0;
    border-bottom: 1px solid var(--border);
}

.legal-doc-iframe {
    border: none;
    width: 100%;
    flex: 1;
    min-height: 60vh;
    background: #fff;
}

/* ——— Безопасность вёрстки, доступность, мобильные устройства ——— */
html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    overflow-x: clip;
}

.skip-link {
    position: absolute;
    left: -10000px;
    top: 0;
    z-index: 100001;
    padding: 0.65rem 1.1rem;
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    border-radius: 0 0 8px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.skip-link:focus {
    left: 0;
    outline: 3px solid #fff;
    outline-offset: 2px;
}

.app-layout {
    min-width: 0;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.side-nav a.nav-link:focus-visible,
.sidebar-toggle:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

@media (max-width: 480px) {
    .app-logo {
        font-size: 1.05rem;
        line-height: 1.2;
        max-width: min(200px, 42vw);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .user-email {
        display: none;
    }

    .dashboard-stats {
        grid-template-columns: 1fr;
    }

    .login-card {
        padding: 1.5rem 1.15rem;
    }

    .modal-content {
        width: min(100%, 100vw - 1rem);
        padding: 1.25rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ——— Сообщения кандидату (отклонение документов) ——— */
.candidate-notifications-wrap {
    margin-bottom: 1rem;
}

.candidate-notifications-inner {
    padding: 1rem 1.25rem;
    border-left: 4px solid #dc2626;
}

.candidate-notifications__heading {
    font-size: 1.05rem;
    margin: 0 0 0.75rem;
    color: var(--rzd-grey);
}

.candidate-notification {
    padding: 0.85rem 0;
    border-top: 1px solid var(--border);
}

.candidate-notification:first-of-type {
    border-top: none;
    padding-top: 0;
}

.candidate-notification--unread {
    background: #fff7f7;
    margin: 0 -0.75rem;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    border-radius: 8px;
}

.candidate-notification__badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #fff;
    background: #dc2626;
    padding: 0.2rem 0.45rem;
    border-radius: 4px;
    margin-right: 0.35rem;
    vertical-align: middle;
}

.candidate-notification__title {
    font-weight: 600;
    font-size: 0.98rem;
    margin-bottom: 0.35rem;
    color: var(--text);
}

.candidate-notification__meta {
    font-size: 0.9rem;
    margin: 0 0 0.35rem;
    color: var(--text-muted);
}

.candidate-notification__msg {
    margin: 0.5rem 0;
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.45;
}

.candidate-notification__ok {
    margin-top: 0.5rem;
}

/* ——— Памятка кандидата (модалка + вход) ——— */
.login-guide-wrap {
    margin-top: 1.25rem;
    text-align: center;
}

.login-forgot-wrap {
    margin-top: 0.75rem;
    text-align: center;
}

.login-guide-btn {
    font-size: 0.9rem;
    text-decoration: underline;
    text-underline-offset: 3px;
}

#candidate-guide-modal.modal {
    z-index: 1200;
}

.candidate-guide-modal-inner {
    max-width: min(42rem, 96vw);
    padding: 1.25rem 1.5rem 1.5rem;
    max-height: min(92vh, 100dvh - 1rem);
    overflow-y: auto;
}

.candidate-guide-intro {
    margin-bottom: 1rem;
    padding: 1rem 1.1rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid var(--border);
}

.candidate-guide-intro__lead {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text);
}

.candidate-guide-rail {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-top: 0.85rem;
    flex-wrap: wrap;
}

.candidate-guide-rail__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary);
    opacity: 0.85;
}

.candidate-guide-rail__line {
    width: 2.2rem;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), #94a3b8);
    border-radius: 2px;
    opacity: 0.5;
}

.candidate-guide-accordions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: none;
    overflow: visible;
    padding-right: 0.25rem;
}

.cg-step {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--card-bg);
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

.cg-step__summary {
    list-style: none;
    cursor: pointer;
    padding: 0.85rem 1rem;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.65rem;
    user-select: none;
}

.cg-step__summary::-webkit-details-marker {
    display: none;
}

.cg-step__summary::after {
    content: '▾';
    margin-left: auto;
    color: var(--text-muted);
    font-size: 0.85rem;
    transition: transform 0.2s ease;
}

.cg-step[open] .cg-step__summary::after {
    transform: rotate(-180deg);
}

.cg-step__num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.75rem;
    height: 1.75rem;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
}

.cg-step__body {
    padding: 0 1rem 1rem;
    font-size: 0.92rem;
    line-height: 1.55;
    color: var(--text);
    border-top: 1px solid var(--border);
}

.cg-step__body p {
    margin: 0.5rem 0 0;
}

.cg-step__body p:first-child {
    margin-top: 0.75rem;
}

.cg-list {
    margin: 0.5rem 0 0;
    padding-left: 1.2rem;
}

.cg-list--ol {
    list-style: decimal;
}

.cg-list li {
    margin: 0.35rem 0;
}

.cg-tip {
    margin-top: 0.75rem !important;
    padding: 0.55rem 0.65rem;
    background: #eff6ff;
    border-radius: 8px;
    font-size: 0.88rem;
    color: #1e40af;
    border-left: 3px solid #3b82f6;
}

.cg-callout {
    margin: 0.75rem 0 0.5rem;
    padding: 0.65rem 0.75rem;
    border-radius: 8px;
    font-size: 0.88rem;
}

.cg-callout--warn {
    background: #fffbeb;
    border: 1px solid #fcd34d;
    color: #78350f;
}

.cg-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0.65rem 0;
}

.cg-pill {
    display: inline-block;
    padding: 0.35rem 0.65rem;
    background: #f1f5f9;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    border: 1px solid var(--border);
}

.cg-muted {
    font-size: 0.86rem;
    color: var(--text-muted);
}

.candidate-guide-footer {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.nav-link--guide {
    font-weight: 600;
    color: #2563eb;
}

.nav-link--guide:hover {
    color: #1d4ed8;
}
