/* Дизайн-система HR Вэладент: цвета, типографика, каркас приложения и общие компоненты.
   Bootstrap 5 остаётся основой; здесь его переменные приводятся к фирменным цветам. */

:root {
    --brand: #24387A;
    --brand-hover: #1C2D66;
    --brand-soft: #E9ECF5;
    --brand-accent: #00B4FF;

    --bg-page: #F3F4F8;
    --bg-surface: #ffffff;
    --bg-subtle: #F7F8FB;
    --border: #EAECF2;
    --border-strong: #DDE1EA;
    --border-card: #E3E6EE;
    --border-card-hover: #B9C2DC;
    --divider: #ECEEF3;
    --divider-soft: #F0F1F5;
    --dash: #E6E8EE;
    --bg-link-hover: #F0F2F8;
    --bg-segment: #E9ECF3;
    --text-nav: #3C4356;
    --text-faint: #9AA0AF;
    --text-disabled: #B4B9C5;
    --brand-on-dark: #C9D2EE;
    --brand-on-dark-soft: #DCE2F5;
    --success-on-dark: #5FD08F;
    --bg-hover: #F5F6FA;
    --bg-card-hover: #FAFBFD;

    --text: #1C2233;
    --text-secondary: #5E6577;
    --text-muted: #7A8193;

    --success: #1A7A43;
    --success-strong: #1E8A4C;
    --success-soft: #E4F3EA;
    --warning: #965C0E;
    --warning-strong: #B26E12;
    --warning-dot: #C98118;
    --warning-soft: #FCF0DA;
    --danger: #b42323;
    --danger-soft: #fdecec;
    --info: #1f5fb8;
    --info-soft: #e8f1fc;

    --radius: 8px;
    --radius-lg: 12px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
    --sidebar-width: 248px;
    --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --shadow-card: 0 1px 2px rgba(28, 34, 51, .04), 0 12px 32px -12px rgba(28, 34, 51, .12);
    --shadow-primary: 0 6px 16px -6px rgba(36, 56, 122, .5);
    --shadow-nav: 0 6px 14px -8px rgba(36, 56, 122, .6);
    --shadow-panel: 0 12px 32px -18px rgba(28, 34, 51, .12);
    --shadow-hero: 0 20px 40px -24px rgba(36, 56, 122, .7);
    --shadow-menu: 0 16px 32px -12px rgba(28, 34, 51, .2);

    --bs-primary: var(--brand);
    --bs-primary-rgb: 36, 56, 122;
    --bs-link-color: var(--brand);
    --bs-link-color-rgb: 36, 56, 122;
    --bs-link-hover-color: var(--brand-hover);
    --bs-body-font-family: var(--font);
    --bs-body-color: var(--text);
    --bs-body-bg: var(--bg-page);
    --bs-border-color: var(--border);
    --bs-border-radius: var(--radius);
}

body { font-family: var(--font); color: var(--text); background: var(--bg-page); font-size: 15px; }
h1, h2, h3, h4, h5, h6 { color: var(--text); font-weight: 600; }
:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 2px; }

.btn { border-radius: var(--radius); font-weight: 500; }
.btn-primary { --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand-hover);
    --bs-btn-hover-border-color: var(--brand-hover); --bs-btn-active-bg: var(--brand-hover); --bs-btn-active-border-color: var(--brand-hover);
    --bs-btn-disabled-bg: var(--brand); --bs-btn-disabled-border-color: var(--brand); }
.btn-outline-primary { --bs-btn-color: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand);
    --bs-btn-hover-border-color: var(--brand); --bs-btn-active-bg: var(--brand); --bs-btn-active-border-color: var(--brand); }
.btn-ghost { background: transparent; border: 1px solid var(--border-strong); color: var(--text); }
.btn-ghost:hover { background: var(--bg-subtle); border-color: var(--border-strong); color: var(--text); }
.form-control, .form-select { border-color: var(--border-strong); border-radius: var(--radius); }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37, 61, 126, .15); }

/* --- Каркас: боковое меню + верхняя панель + содержимое (макет «Кабинет») --- */
.app { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-width); flex: 0 0 var(--sidebar-width); background: var(--bg-surface); border-right: 1px solid var(--border);
    display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100vh; padding: 22px 14px 16px; z-index: 1040; }
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 2px 10px 22px; text-decoration: none; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--brand); color: #fff; display: flex; align-items: center;
    justify-content: center; font-weight: 800; font-size: 16px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-weight: 800; font-size: 16px; color: var(--brand); letter-spacing: -0.01em; }
.brand-sub { font-size: 11px; color: var(--text-muted); font-weight: 600; }
.sidebar-nav { display: flex; flex-direction: column; gap: 6px; }
.nav-section { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-faint); padding: 20px 12px 6px; }
.nav-link-app { display: flex; align-items: center; gap: 12px; height: 42px; padding: 0 12px; border-radius: 12px; color: var(--text-nav);
    font-size: 14px; font-weight: 600; text-decoration: none; }
.nav-link-app i { font-size: 18px; width: 18px; color: var(--text-muted); display: inline-flex; justify-content: center; }
.nav-link-app:hover { background: var(--bg-page); color: var(--text); }
.nav-link-app.active { background: var(--brand); color: #fff; box-shadow: var(--shadow-nav); }
.nav-link-app.active i { color: #fff; }
.sidebar-footer { margin-top: auto; display: flex; flex-direction: column; gap: 4px; }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; background: var(--bg-subtle); }
.avatar { width: 36px; height: 36px; flex: none; border-radius: 50%; background: var(--brand-soft); color: var(--brand);
    display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }
.sidebar-user-name { font-weight: 700; font-size: 13px; }
.sidebar-user-role { font-size: 12px; color: var(--text-muted); }
.sidebar-actions { display: flex; gap: 4px; }
.sidebar-actions a { flex: 1; height: 38px; display: flex; align-items: center; justify-content: center; border-radius: 10px;
    font-size: 13px; font-weight: 600; color: var(--text-secondary); text-decoration: none; }
.sidebar-actions a:hover { background: var(--bg-page); color: var(--text); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 16px; padding: 22px 40px; border-bottom: 1px solid var(--border);
    background: rgba(243, 244, 248, .85); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 1030; }
.topbar-title { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; margin: 0; line-height: normal; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.menu-toggle { display: none; background: none; border: 0; font-size: 22px; color: var(--text); padding: 4px; }
.content { padding: 32px 40px 56px; max-width: 1080px; width: 100%; margin: 0 auto; }
.content-wide { max-width: 1180px; }
.content-narrow { max-width: 720px; }
.sidebar-backdrop { display: none; }

/* Переключатель профиля hh.ru в шапке */
.profile-switch-btn { display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 14px; border-radius: 12px; background: var(--bg-surface);
    border: 1px solid var(--border-card); font-size: 14px; font-weight: 600; color: var(--text); }
.profile-switch-btn:hover { border-color: var(--border-card-hover); }
.profile-switch-btn i { font-size: 12px; color: var(--text-secondary); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-faint); flex: none; }
.status-dot-ok { background: var(--success-strong); }
.status-dot-missing, .status-dot-unknown { background: var(--danger); }
.profile-menu { min-width: 200px; border: 1px solid var(--border-card); border-radius: 14px; padding: 6px; box-shadow: var(--shadow-menu); margin-top: 6px !important; }
.profile-menu-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 38px; padding: 0 12px; border-radius: 10px;
    font-size: 14px; font-weight: 600; color: var(--text); text-decoration: none; }
a.profile-menu-item:hover { background: var(--bg-page); color: var(--text); }
.profile-menu-item i { color: var(--brand); font-size: 16px; }

@media (max-width: 991.98px) {
    .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s ease; box-shadow: 0 10px 30px rgba(0,0,0,.15); }
    .app.sidebar-open .sidebar { transform: none; }
    .app.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(16, 24, 40, .35); z-index: 1035; }
    .menu-toggle { display: inline-flex; }
    .topbar { padding: 14px 16px; gap: 10px; }
    .topbar-title { font-size: 20px; }
    .content { padding: 20px 16px 40px; }
    .profile-switch-label { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (prefers-reduced-motion: reduce) { .sidebar { transition: none; } }

/* --- Карточки и заголовки разделов --- */
.panel { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.panel-body { padding: 20px 24px; }
.panel-title { font-size: 16px; font-weight: 600; margin: 0 0 4px; }
.panel-subtitle { color: var(--text-secondary); margin: 0; font-size: 14px; }
.stack { display: flex; flex-direction: column; gap: 20px; }
.muted { color: var(--text-muted); }

/* --- Уведомления (бывшие flash-сообщения) --- */
.toasts { position: fixed; top: 72px; right: 20px; z-index: 1080; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.toast-app { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius); background: var(--bg-surface);
    border: 1px solid var(--border); box-shadow: 0 8px 24px rgba(16, 24, 40, .12); font-size: 14px; }
.toast-app i { font-size: 18px; line-height: 1.2; }
.toast-app .toast-close { margin-left: auto; background: none; border: 0; color: var(--text-muted); padding: 0 0 0 8px; font-size: 18px; line-height: 1; }
.toast-success i { color: var(--success); } .toast-danger i, .toast-error i { color: var(--danger); }
.toast-warning i { color: var(--warning); } .toast-info i { color: var(--info); }

/* --- Экран результата: итог импорта, токена и т. п. (макет «Карточки кабинета») --- */
.result { max-width: 560px; margin: 8px auto 0; background: var(--bg-surface); border: 1px solid var(--border);
    border-radius: 24px; box-shadow: var(--shadow-card); padding: 28px; display: flex; flex-direction: column; gap: 24px; }
/* Как в макете: обычный межстрочный интервал браузера вместо 1.5 и 1.2 из Bootstrap */
.result, .result h2, .result h3, .result p { line-height: normal; }
.result-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.result-icon { width: 52px; height: 52px; border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 24px; }
.result-success .result-icon { background: var(--success-soft); color: var(--success-strong); }
.result-warning .result-icon { background: var(--warning-soft); color: var(--warning-strong); }
.result-danger .result-icon { background: var(--danger-soft); color: var(--danger); }
.result-info .result-icon { background: var(--info-soft); color: var(--info); }
.result-neutral .result-icon { background: var(--brand-soft); color: var(--brand); }
.result-head { display: flex; flex-direction: column; gap: 6px; }
.result-title { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; margin: 0; }
.result-text { font-size: 15px; color: var(--text-secondary); margin: 0; text-wrap: pretty; }

/* Метка статуса с точкой */
.status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.status-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-pill-success { background: var(--success-soft); color: var(--success); }
.status-pill-success::before { background: var(--success-strong); }
.status-pill-warning { background: var(--warning-soft); color: var(--warning); }
.status-pill-warning::before { background: var(--warning-dot); }
.status-pill-danger { background: var(--danger-soft); color: var(--danger); }
.status-pill-info { background: var(--info-soft); color: var(--info); }
.status-pill-neutral { background: var(--brand-soft); color: var(--brand); }

.result-details { display: flex; flex-direction: column; gap: 10px; }
.result-note { background: var(--bg-subtle); border-radius: 16px; padding: 14px 18px; font-size: 14px; color: var(--text-secondary); }
.result-list { margin: 0; padding-left: 18px; color: var(--text-secondary); font-size: 14px; }

/* Кнопки результата */
.result-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.result-actions .btn { height: 46px; border-radius: 14px; font-size: 15px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; }
.result-actions .btn-primary { padding: 0 20px; border: 0; box-shadow: var(--shadow-primary); }
.result-actions .btn-ghost { padding: 0 18px; border-color: var(--border-strong); background: var(--bg-surface); }
.result-actions .btn-ghost:hover { background: var(--bg-hover); }
.btn-quiet { background: transparent; border: 0; color: var(--text-secondary); padding: 0 12px; }
.btn-quiet:hover { color: var(--text); background: var(--bg-page); }
.result-actions .btn-quiet { font-size: 14px; gap: 6px; }
.result-actions .btn-quiet i { font-size: 13px; }

/* Ссылки: полужирные, без подчёркивания, значок внешней ссылки после текста */
.ext-link { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; text-decoration: none; }
.ext-link:hover { text-decoration: underline; }
.ext-link i { font-size: 12px; }

/* Сводка результата: подпись слева, значение справа, строки с разделителями */
.summary { background: var(--bg-subtle); border-radius: 16px; padding: 4px 18px; margin: 0; display: flex; flex-direction: column; }
.summary-row { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--divider); font-size: 14px; }
.summary-row:last-child { border-bottom: 0; }
.summary dt { color: var(--text-muted); font-weight: 500; }
.summary dd { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.summary .value-strong { font-weight: 700; }
.tabular { font-variant-numeric: tabular-nums; }
@media (max-width: 575.98px) { .summary-row { grid-template-columns: 1fr; gap: 2px; } }

.section-label { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); margin: 0; }
.result-section { display: flex; flex-direction: column; gap: 10px; }

/* Строка-ссылка на карточку в Битрикс24 */
.card-link { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--border-card); border-radius: 16px;
    text-decoration: none; color: var(--text); background: var(--bg-surface); }
a.card-link:hover { border-color: var(--border-card-hover); background: var(--bg-card-hover); color: var(--text); }
.card-link-icon { width: 40px; height: 40px; flex: none; border-radius: 12px; background: var(--brand-soft); color: var(--brand);
    display: flex; align-items: center; justify-content: center; font-size: 18px; }
.card-link-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.card-link-title { display: flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 700; color: var(--brand); }
.card-link-title i { font-size: 12px; }
.card-link-meta { font-size: 13px; color: var(--text-secondary); }
.date-pill { flex: none; font-size: 12px; font-weight: 600; color: var(--text-secondary); background: var(--bg-page); padding: 5px 10px;
    border-radius: 8px; font-variant-numeric: tabular-nums; }

/* Сравнение резюме и найденного контакта */
.compare { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0; }
.compare-col { background: var(--bg-subtle); border-radius: 16px; padding: 14px 18px; font-size: 14px; display: flex; flex-direction: column; gap: 2px; }
.compare-label { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 6px; }
@media (max-width: 575.98px) { .compare { grid-template-columns: 1fr; } }

.record { border: 1px solid var(--border-card); border-radius: 16px; padding: 14px 16px; display: grid;
    grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; font-size: 14px; }
.record-title { font-weight: 600; }
.record-meta { color: var(--text-secondary); }
.record-side { text-align: right; color: var(--text-secondary); }
@media (max-width: 575.98px) { .record { grid-template-columns: 1fr; } .record-side { text-align: left; } .result { padding: 22px; border-radius: 20px; }
    .result-actions .btn-quiet { margin-left: 0 !important; } }

/* --- Этапы загрузки --- */
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.step { display: flex; align-items: center; gap: 12px; padding: 6px 0; color: var(--text-muted); }
.step-icon { width: 20px; height: 20px; flex: 0 0 20px; border-radius: 50%; border: 2px solid var(--border-strong); }
.step-active { color: var(--text); font-weight: 600; }
.step-active .step-icon { border-color: var(--brand); border-right-color: transparent; animation: step-spin .8s linear infinite; }
.step-done { color: var(--success); }
.step-done .step-icon { border-color: var(--success); background: var(--success) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='white' d='M6.5 11.2 3.3 8l1-1 2.2 2.2 5.2-5.2 1 1z'/%3E%3C/svg%3E") center/100% no-repeat; }
.step-stopped { color: var(--danger); }
.step-stopped .step-icon { border-color: var(--danger); }
.step-detail { color: var(--warning); font-size: 14px; margin: 0; }
@keyframes step-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .step-active .step-icon { animation: none; } }

/* --- Главная --- */
.profile-row { display: flex; align-items: center; gap: 14px; }
.profile-icon { width: 44px; height: 44px; border-radius: var(--radius); background: var(--brand-soft); color: var(--brand);
    display: flex; align-items: center; justify-content: center; font-size: 22px; }
/* --- Страницы «Импорт резюме» и «История загрузок» (макет «Кабинет») --- */
input::placeholder { color: var(--text-faint); }
/* Как в макете: базовый шрифт 16 px и обычный межстрочный интервал вместо 15 px и 1.5 из Bootstrap */
.sidebar, .topbar, .page-stack { font-size: 16px; line-height: normal; }
.page-stack { display: flex; flex-direction: column; gap: 20px; }
.history-page { gap: 18px; }

/* Блок загрузки по ссылке */
.hero { background: var(--brand); border-radius: 24px; padding: 32px; color: #fff; display: flex; flex-direction: column; gap: 20px; box-shadow: var(--shadow-hero); }
.hero-head { display: flex; flex-direction: column; gap: 6px; }
.hero-title { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; margin: 0; color: #fff; line-height: normal; }
.hero-text { font-size: 15px; color: var(--brand-on-dark); margin: 0; text-wrap: pretty; }
.hero-form { display: flex; flex-wrap: wrap; gap: 10px; padding: 6px; border-radius: 18px; background: #fff; }
.hero-form input { flex: 1; min-width: 220px; height: 48px; border: 0; outline: 0; padding: 0 14px; font: 500 15px var(--font); color: var(--text); background: transparent; }
.hero-form input:disabled { cursor: not-allowed; }
.hero-form button { height: 48px; padding: 0 24px; border: 0; border-radius: 13px; background: var(--brand); color: #fff; font: 700 15px var(--font);
    display: flex; align-items: center; gap: 8px; }
.hero-form button:hover:not(:disabled) { background: var(--brand-hover); }
.hero-form button:disabled { opacity: .6; cursor: not-allowed; }
.hero-form:focus-within { box-shadow: 0 0 0 3px rgba(255, 255, 255, .35); }
.hero-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.hero-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 12px; border-radius: 10px; background: rgba(255, 255, 255, .1);
    font-size: 13px; color: var(--brand-on-dark-soft); text-decoration: none; }
.hero-chip b { color: #fff; font-weight: 700; }
a.hero-chip-link:hover { background: rgba(255, 255, 255, .2); color: #fff; }
.hero-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-faint); flex: none; }
.hero-dot-ok { background: var(--success-on-dark); }
.hero-dot-danger { background: #FF8A8A; }

/* Белые панели со списками */
.list-panel { background: var(--bg-surface); border: 1px solid var(--border); border-radius: 24px; padding: 8px; box-shadow: var(--shadow-panel); }
.list-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 12px; }
.list-panel-title { font-size: 18px; font-weight: 800; letter-spacing: -0.01em; margin: 0; line-height: normal; }
.head-link { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; color: var(--brand); padding: 6px 10px; border-radius: 10px; text-decoration: none; }
.head-link:hover { background: var(--bg-link-hover); color: var(--brand); }
.head-link i { font-size: 14px; }
.list-empty { padding: 48px 16px; text-align: center; font-size: 15px; color: var(--text-muted); margin: 0; }

/* Аватар кандидата */
.job-avatar { width: 42px; height: 42px; flex: none; border-radius: 13px; background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: 14px;
    display: flex; align-items: center; justify-content: center; }
.job-avatar-empty { background: var(--bg-page); color: var(--text-faint); font-size: 18px; }
.job-avatar-sm { width: 36px; height: 36px; border-radius: 11px; font-size: 13px; }
.job-avatar-sm.job-avatar-empty { font-size: 16px; }
.job-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.job-name { font-size: 15px; font-weight: 700; color: var(--text); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
a.job-name:hover { color: var(--brand); text-decoration: underline; }
.job-when { font-size: 13px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.job-author { font-size: 12px; color: var(--text-muted); }
.status-pill-sm { height: 28px; padding: 0 11px; font-size: 12px; font-weight: 700; }

/* Слоты ссылок: Карточка, Контакт, hh.ru */
.link-slots { display: grid; grid-template-columns: repeat(3, 96px); gap: 6px; }
.slot { display: flex; align-items: center; justify-content: center; gap: 4px; height: 32px; border-radius: 9px; border: 1px solid var(--border-card);
    font-size: 13px; font-weight: 600; text-decoration: none; color: var(--brand); background: var(--bg-surface); }
a.slot:hover { border-color: var(--border-card-hover); background: var(--bg-subtle); color: var(--brand); }
.slot i { font-size: 11px; }
.slot-retry { border: 0; background: var(--brand); color: #fff; font-weight: 700; gap: 5px; }
a.slot-retry:hover { background: var(--brand-hover); color: #fff; }
.slot-retry i { font-size: 12px; }
.slot-empty { border: 1px dashed var(--dash); background: transparent; }

/* Последние загрузки: широкая сетка и компактный вид для узкого блока */
.recent { container-type: inline-size; }
.recent-cols, .history-cols { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-faint); }
.recent-cols { display: grid; grid-template-columns: 42px minmax(0, 1fr) 196px 300px; column-gap: 14px; padding: 4px 12px 8px; }
.recent-list, .history-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.recent-row { display: grid; grid-template-columns: 42px minmax(0, 1fr) 196px 300px; align-items: center; column-gap: 14px; row-gap: 10px; padding: 12px;
    border-radius: 16px; border-top: 1px solid var(--divider-soft); }
.recent-row:hover, .history-row:hover { background: var(--bg-subtle); }
/* Метки итога выровнены по левому краю колонки: ровная линия при разной длине меток */
.recent-status { display: flex; justify-content: flex-start; }
@container (max-width: 900px) {
    .recent-cols { display: none; }
    .recent-row { grid-template-columns: 42px minmax(0, 1fr); }
    .recent-status, .recent-links { grid-column: 2; justify-content: flex-start; }
}

/* Шаги расширения */
.steps-panel { box-shadow: none; }
.steps-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-radius: 18px; cursor: pointer; list-style: none; }
.steps-summary::-webkit-details-marker { display: none; }
.steps-summary:hover { background: var(--bg-subtle); }
.steps-title { font-size: 16px; font-weight: 800; }
.steps-toggle { width: 32px; height: 32px; border-radius: 10px; background: var(--bg-page); display: flex; align-items: center; justify-content: center;
    font-size: 18px; font-weight: 700; color: var(--brand); }
.steps-toggle::before { content: "+"; }
details[open] .steps-toggle::before { content: "−"; }
.howto-cards { list-style: none; margin: 0; padding: 4px 12px 12px; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; }
.howto-cards li { display: flex; flex-direction: column; gap: 8px; padding: 18px; border-radius: 16px; background: var(--bg-subtle); }
.howto-cards strong { font-size: 15px; font-weight: 700; }
.howto-cards li > span:last-child { font-size: 13px; line-height: 1.5; color: var(--text-secondary); text-wrap: pretty; }
.howto-num { width: 30px; height: 30px; border-radius: 10px; background: var(--brand); color: #fff; font-size: 13px; font-weight: 800;
    display: flex; align-items: center; justify-content: center; }

/* История: сегментные переключатели */
.history-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.seg-filters { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--bg-surface); border: 1px solid var(--border); max-width: 100%;
    overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
.seg-filters::-webkit-scrollbar { display: none; }
.seg-tab { flex: none; display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 10px; color: var(--text-nav);
    font-size: 14px; font-weight: 600; text-decoration: none; }
a.seg-tab:hover { background: var(--bg-page); color: var(--text-nav); }
.seg-count { font-size: 12px; padding: 1px 7px; border-radius: 6px; background: var(--divider-soft); color: var(--text-muted); }
.seg-tab.active { background: var(--brand); color: #fff; font-weight: 700; }
a.seg-tab.active:hover { background: var(--brand); color: #fff; }
.seg-tab.active .seg-count { background: rgba(255, 255, 255, .18); color: #fff; }
.seg-tab.disabled { color: var(--text-disabled); cursor: default; }
.seg-tab.disabled .seg-count { background: #F5F6F9; color: var(--text-disabled); }
.seg-owner { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--bg-segment); }
.seg-owner a { height: 34px; padding: 0 14px; display: flex; align-items: center; border-radius: 10px; color: var(--text-secondary); font-size: 14px; font-weight: 600; text-decoration: none; }
.seg-owner a:hover { color: var(--text); }
.seg-owner a.active { background: var(--bg-surface); color: var(--brand); font-weight: 700; box-shadow: 0 1px 3px rgba(28, 34, 51, .12); }

/* История: таблица */
.history { container-type: inline-size; }
.history-cols { display: grid; grid-template-columns: minmax(0, 1fr) 190px 300px 136px; gap: 16px; padding: 12px 16px; }
.history-cols span { text-align: center; }
.history-row { display: grid; grid-template-columns: minmax(0, 1fr) 190px 300px 136px; gap: 16px; align-items: center; padding: 10px 16px;
    border-radius: 14px; border-top: 1px solid var(--divider-soft); }
.history-who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.history-row .job-name { font-size: 14px; }
.history-status { display: flex; justify-content: flex-start; }
.history-when { display: flex; align-items: baseline; justify-content: center; gap: 6px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.when-date { font-size: 14px; font-weight: 700; }
.when-time { font-size: 11px; font-weight: 500; color: var(--text-faint); }
@container (max-width: 1000px) {
    .history-cols { display: none; }
    .history-row { grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 14px 12px; }
    .history-who { grid-column: 1; grid-row: 1; }
    .history-who .job-name { white-space: normal; }
    .history-when { grid-column: 2; grid-row: 1; justify-content: flex-end; gap: 8px; }
    .history-status, .history-links { grid-column: 1 / -1; justify-content: flex-start; padding-left: 48px; }
}
@media (max-width: 575.98px) { .link-slots { grid-template-columns: repeat(3, minmax(0, 1fr)); } .hero { padding: 22px; } }

/* Общие элементы, которые используются и в администрировании */
.link-list { display: inline-flex; flex-wrap: wrap; gap: 4px 14px; font-size: 14px; }
.badge-status { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-neutral { background: var(--bg-subtle); color: var(--text-secondary); border: 1px solid var(--border); }
.table-app { --bs-table-bg: transparent; font-size: 14px; }
.table-app th { font-size: 12px; text-transform: none; color: var(--text-muted); font-weight: 600; border-bottom-color: var(--border); padding: 12px 16px; }
.table-app td { padding: 12px 16px; vertical-align: middle; border-color: var(--border); }

/* --- Администрирование --- */
.admin-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.admin-search { width: 260px; max-width: 100%; }
.stat-line { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--text-secondary); font-size: 14px; }
.stat-line strong { color: var(--text); font-size: 16px; }
.row-muted { opacity: .72; }
.row-muted:hover { opacity: 1; }
.profile-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px 24px; margin: 18px 0 0;
    padding-top: 16px; border-top: 1px solid var(--border); }
.profile-facts dt { font-size: 12px; color: var(--text-muted); font-weight: 600; margin-bottom: 4px; }
.profile-facts dd { margin: 0; font-size: 14px; }
.auth-steps { padding-left: 20px; margin: 0; display: flex; flex-direction: column; gap: 18px; }
.offcanvas { --bs-offcanvas-width: 440px; }
@media (max-width: 575.98px) { .admin-search { width: 100%; } }

/* --- Вход --- */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: var(--bg-page); }
.auth-card { width: 100%; max-width: 380px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
    box-shadow: var(--shadow); padding: 32px; }
.auth-logo { height: 40px; margin-bottom: 24px; }
.auth-title { font-size: 20px; margin: 0 0 4px; }
.auth-subtitle { color: var(--text-secondary); margin: 0 0 24px; font-size: 14px; }
.auth-error { background: var(--danger-soft); color: var(--danger); border-radius: var(--radius); padding: 10px 12px; font-size: 14px; margin-bottom: 16px; }
.password-field { position: relative; }
.password-field .form-control { padding-right: 44px; }
.password-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--text-muted); padding: 6px; }
