@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700;900&display=swap");

* {
    box-sizing: border-box;
}

body.hr-portal {
    font-family: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f4f6fb;
    color: #1f2a37;
    overflow-x: hidden;
}

.portal-wrapper {
    position: relative;
    z-index: 1;
    display: flex;
    min-height: 100vh;
    width: 100%;
    max-width: 100%;
}

/* Модальные окна Bootstrap: контент портала должен быть выше затемнённого фона (backdrop) */
body.modal-open .portal-wrapper {
    z-index: 1060;
}

.portal-sidebar {
    width: 280px;
    background: linear-gradient(180deg, #e8eaed 0%, #d1d5db 100%);
    color: #374151;
    display: flex;
    flex-direction: column;
    padding: 18px 14px;
    position: sticky;
    top: 0;
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
}

.sidebar-nav-wrap {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}
.sidebar-nav-wrap::-webkit-scrollbar { width: 6px; }
.sidebar-nav-wrap::-webkit-scrollbar-track { background: rgba(0,0,0,0.06); border-radius: 3px; }
.sidebar-nav-wrap::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.2); border-radius: 3px; }

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    flex-shrink: 0;
}

.sidebar-header .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #1f2937;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
}

.sidebar-header img {
    filter: none;
}

/* Скрыть фоновый водяной знак «Администрация города Краснодара», если он выводится где-либо */
.portal-bg-watermark {
    display: none !important;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.sidebar-nav .nav-group {
    margin-bottom: 10px;
    padding: 8px 0 0;
    border-radius: 0;
    border-left: 0;
    background: transparent;
    --nav-group-accent: rgba(148, 163, 184, 0.8);
}

.sidebar-nav .nav-group:last-child {
    margin-bottom: 0;
}

/* Разделители и акцент группы через label, а не через цветную плашку */
.sidebar-nav .nav-group + .nav-group {
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    padding-top: 10px;
}

.sidebar-nav .nav-group[data-group="main"] {
    --nav-group-accent: #60a5fa;
}
.sidebar-nav .nav-group[data-group="people"] {
    --nav-group-accent: #34d399;
}
.sidebar-nav .nav-group[data-group="recruit"] {
    --nav-group-accent: #a78bfa;
}
.sidebar-nav .nav-group[data-group="absence"] {
    --nav-group-accent: #fbbf24;
}
.sidebar-nav .nav-group[data-group="processes"] {
    --nav-group-accent: #f472b6;
}
.sidebar-nav .nav-group[data-group="docs"] {
    --nav-group-accent: #38bdf8;
}
.sidebar-nav .nav-group[data-group="work"] {
    --nav-group-accent: #818cf8;
}
.sidebar-nav .nav-group[data-group="learning"] {
    --nav-group-accent: #4ade80;
}
.sidebar-nav .nav-group[data-group="pay"] {
    --nav-group-accent: #facc15;
}
.sidebar-nav .nav-group[data-group="corporate"] {
    --nav-group-accent: #fb923c;
}
.sidebar-nav .nav-group[data-group="admin"] {
    --nav-group-accent: #94a3b8;
}

.sidebar-nav .nav-group-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(55, 65, 81, 0.7);
    padding: 0 4px 6px;
    margin-top: 0;
}

.sidebar-nav .nav-group-toggle {
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    cursor: pointer;
    font: inherit;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-nav .nav-group-toggle > span {
    flex: 1;
}

.sidebar-nav .nav-group-toggle .nav-group-chevron {
    font-size: 10px;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.sidebar-nav .nav-group.collapsed .nav-group-chevron {
    transform: rotate(-90deg);
}

.sidebar-nav .nav-group.collapsed .nav-group-items {
    display: none;
}

.sidebar-nav .nav-group-label::before {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--nav-group-accent);
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.06);
    animation: nav-dot-pulse 2s ease-in-out infinite;
}

@keyframes nav-dot-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); }
}

.sidebar-nav .nav-group:first-child .nav-group-label {
    padding-top: 0;
}

.sidebar-nav .nav-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 5px 10px;
    border-radius: 10px;
    color: #4b5563;
    text-decoration: none;
    border: 1px solid transparent;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.sidebar-nav .nav-item i {
    width: 18px;
    text-align: center;
    color: inherit;
    opacity: 0.85;
}

.sidebar-nav .nav-item:hover {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.06);
    color: #1f2937;
}

.sidebar-nav .nav-item.active {
    background: rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 0, 0, 0.06);
    box-shadow: inset 3px 0 0 var(--nav-group-accent);
    color: #1f2937;
}

.sidebar-nav .nav-item:hover i,
.sidebar-nav .nav-item.active i {
    opacity: 1;
}

.sidebar-nav .nav-item .nav-item-label {
    flex: 1;
    min-width: 0;
}

/* Бейджи в меню: новые (зелёный) и просмотренные, но не выполненные (синий) */
.sidebar-nav .nav-item .menu-badge {
    flex-shrink: 0;
    min-width: 20px;
    height: 18px;
    padding: 0 5px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    line-height: 18px;
    text-align: center;
}

.sidebar-nav .nav-item .menu-badge.badge-new {
    background: #22c55e;
    color: #fff;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.sidebar-nav .nav-item .menu-badge.badge-viewed {
    background: #3b82f6;
    color: #fff;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2);
}

/* Звёздочка избранного в пунктах меню */
.sidebar-nav .nav-item .nav-item-fav {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    padding: 0;
    border: none;
    background: transparent;
    color: rgba(0, 0, 0, 0.25);
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
    transition: opacity 0.2s, color 0.2s;
}
.sidebar-nav .nav-item .nav-item-fav:hover {
    opacity: 1;
    color: #f59e0b;
}
.sidebar-nav .nav-item .nav-item-fav.is-favorite {
    color: #f59e0b;
    opacity: 1;
}
.sidebar-nav .nav-item .nav-item-fav i {
    font-size: 12px;
}

/* Блоки «Недавно посещённые» и «Избранное» */
.nav-group-recent .nav-group-label,
.nav-group-favorites .nav-group-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #6b7280;
}
.nav-group-favorites.nav-group-empty .nav-group-items {
    max-height: 60px;
}
.nav-favorites-placeholder {
    font-style: italic;
}
.nav-favorites-list .nav-item {
    padding: 4px 10px;
}

.sidebar-footer {
    display: grid;
    gap: 12px;
    flex-shrink: 0;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    background: transparent;
}

.demo-callout {
    background: rgba(0, 0, 0, 0.06);
    border-radius: 14px;
    padding: 12px;
}

.demo-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.portal-main {
    flex: 1 1 0;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    padding: 24px 32px 40px;
}

.portal-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.topbar-bar {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

/* Хлебные крошки в стиле системы */
.topbar-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    font-size: 14px;
}

.topbar-breadcrumbs .breadcrumb-link {
    color: #64748b;
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 10px;
    transition: color 0.2s, background 0.2s;
}

.topbar-breadcrumbs .breadcrumb-link:hover {
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.08);
}

.topbar-breadcrumbs .breadcrumb-current {
    color: #1f2a37;
    font-weight: 500;
    padding: 6px 10px;
}

.topbar-breadcrumbs .breadcrumb-sep {
    color: #cbd5e1;
    font-size: 10px;
}

.topbar-bar .topbar-filters {
    border-left: 1px solid #e2e8f0;
    padding-left: 16px;
    margin-left: 4px;
}

/* Фильтры и поиск в одной строке */
.topbar-filters {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    flex: 1 1 auto;
    min-width: 0;
}

.search-box {
    position: relative;
    background: #fff;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    min-width: 260px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    transition: box-shadow 0.2s;
}

.search-box:focus-within {
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12), 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.topbar-search {
    flex: 1 1 auto;
    min-width: 220px;
}

.hr-search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    max-height: 360px;
    overflow-y: auto;
    z-index: 1050;
}

.hr-search-empty {
    font-size: 13px;
}

.hr-search-section {
    padding: 8px 0;
}

.hr-search-section-title {
    padding: 4px 12px 6px;
    font-weight: 600;
}

.hr-search-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    color: inherit;
    text-decoration: none;
    transition: background 0.15s;
}

.hr-search-item:hover {
    background: #f1f5f9;
}

.hr-search-item-title {
    font-weight: 500;
}

.hr-search-item-sub {
    margin-top: 2px;
}

.search-box input {
    border: none;
    outline: none;
    width: 100%;
    font-size: 14px;
}

.filter-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    padding: 8px 12px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    font-size: 13px;
    transition: box-shadow 0.2s;
}

.filter-pill:hover,
.filter-pill:focus-within {
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.1);
}

.topbar-filter {
    padding: 6px 12px;
}

.filter-pill select {
    border: none;
    background: transparent;
    outline: none;
    font-size: 13px;
    max-width: 200px;
    cursor: pointer;
    color: #1f2a37;
}

.filter-pill i {
    color: #64748b;
    font-size: 12px;
}

#departmentSelect {
    max-width: 240px;
}

@media (max-width: 992px) {
    .portal-topbar {
        flex-direction: column;
        align-items: stretch;
    }
    .topbar-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .topbar-filters {
        flex-wrap: wrap;
    }
    .topbar-search {
        min-width: 100%;
    }
}

.role-switch {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border-radius: 999px;
    padding: 6px 10px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.role-switch select {
    border: none;
    outline: none;
}

.icon-btn {
    border: none;
    background: #fff;
    border-radius: 12px;
    padding: 10px 12px;
    min-width: 44px;
    min-height: 44px;
    position: relative;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    -webkit-tap-highlight-color: transparent;
}

.icon-btn .badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #ef4444;
}

.section {
    margin-bottom: 36px;
}

.section > * + * {
    margin-top: 16px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.section-header h1,
.section-header h2 {
    margin-bottom: 4px;
    font-weight: 600;
}

.subtitle {
    color: #64748b;
    margin-bottom: 0;
}

.role-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #111827;
    color: #fff;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 14px;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.kpi-card {
    background: #fff;
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.kpi-card.interactive,
.chart-tile.interactive,
.panel.interactive {
    cursor: pointer;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.kpi-card.interactive:hover,
.chart-tile.interactive:hover,
.panel.interactive:hover {
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
}

a.kpi-card.interactive:hover {
    transform: translateY(-2px);
}

.chart-tile.interactive:hover {
    transform: translateY(-2px);
}

.kpi-card.is-compact {
    padding: 12px;
}

.kpi-card.is-compact .kpi-value {
    font-size: 22px;
}

.kpi-card.is-compact .kpi-title {
    font-size: 12px;
}

.kpi-title {
    color: #64748b;
    font-size: 13px;
}

.kpi-value {
    font-size: 28px;
    font-weight: 700;
    margin: 8px 0;
}

.kpi-meta {
    color: #10b981;
    font-size: 12px;
}

/* Дашборд руководителя */
.manager-dashboard-block {
    border-left: 4px solid #3b82f6;
}
.manager-dashboard-block .panel-header h3 {
    margin: 0;
    font-size: 1.1rem;
}
.manager-kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}
.manager-kpi-row .kpi-card {
    min-width: 0;
}
.manager-tasks-row h4 {
    font-size: 0.95rem;
    color: #475569;
    font-weight: 600;
}

/* Карточки задач (Мои задачи) */
.task-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.task-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 14px 16px;
    border-radius: 14px;
    text-decoration: none;
    color: inherit;
    background: #fff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.task-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.12);
}

.task-card.accent-blue { background: linear-gradient(180deg, #f1f6ff 0%, #ffffff 100%); }
.task-card.accent-green { background: linear-gradient(180deg, #f1fbf6 0%, #ffffff 100%); }
.task-card.accent-amber { background: linear-gradient(180deg, #fff8ef 0%, #ffffff 100%); }

.task-card-count {
    font-size: 24px;
    font-weight: 700;
    color: #3b82f6;
    line-height: 1;
}

.task-card.accent-green .task-card-count { color: #10b981; }
.task-card.accent-amber .task-card-count { color: #f59e0b; }

.task-card-label {
    font-size: 13px;
    color: #475569;
    line-height: 1.35;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.panel {
    background: #fff;
    border-radius: 16px;
    padding: 18px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
    position: relative;
    overflow: hidden;
}

.panel.accent-blue { --panel-accent: #3b82f6; background: #fff; }
.panel.accent-green { --panel-accent: #10b981; background: #fff; }
.panel.accent-amber { --panel-accent: #f59e0b; background: #fff; }
.panel.accent-purple { --panel-accent: #8b5cf6; background: #fff; }
.panel.accent-slate { --panel-accent: #64748b; background: #fff; }

.panel[class*="accent-"]::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--panel-accent, #cbd5e1);
}

.panel.accent-blue .panel-header h3,
.panel.accent-blue .panel-header h4,
.panel.accent-blue .panel-header h5,
.panel.accent-blue .panel-header .panel-title {
    color: #1d4ed8;
}

.panel.accent-green .panel-header h3,
.panel.accent-green .panel-header h4,
.panel.accent-green .panel-header h5,
.panel.accent-green .panel-header .panel-title {
    color: #047857;
}

.panel.accent-amber .panel-header h3,
.panel.accent-amber .panel-header h4,
.panel.accent-amber .panel-header h5,
.panel.accent-amber .panel-header .panel-title {
    color: #b45309;
}

.panel.accent-purple .panel-header h3,
.panel.accent-purple .panel-header h4,
.panel.accent-purple .panel-header h5,
.panel.accent-purple .panel-header .panel-title {
    color: #6d28d9;
}

.panel.accent-slate .panel-header h3,
.panel.accent-slate .panel-header h4,
.panel.accent-slate .panel-header h5,
.panel.accent-slate .panel-header .panel-title {
    color: #334155;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 16px;
}

.timeline {
    display: grid;
    gap: 12px;
}

.timeline-compact {
    gap: 4px;
}

.timeline-compact .timeline-item {
    padding: 6px 10px 6px 12px;
    margin: 0 -10px;
    border-radius: 10px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-height: auto;
    border-left: 3px solid transparent;
}

.timeline-compact .timeline-item .timeline-time {
    flex-shrink: 0;
    font-size: 11px;
    color: #64748b;
    width: 72px;
}

.timeline-compact .timeline-item .timeline-text {
    font-size: 13px;
    line-height: 1.4;
    color: #1f2a37;
}

.timeline-item .time,
.timeline-item .timeline-time {
    font-size: 12px;
    color: #64748b;
}

.pipeline {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 8px;
}

.pipeline-step {
    background: #f8fafc;
    border-radius: 12px;
    padding: 10px;
    text-align: center;
    font-size: 12px;
    text-decoration: none;
    color: inherit;
    display: block;
    transition: background 0.2s;
}
a.pipeline-step:hover {
    background: #e2e8f0;
    color: inherit;
}

.chart-mini {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 80px;
    margin-top: 16px;
}

.chart-mini .bar {
    flex: 1;
    background: #3b82f6;
    border-radius: 8px 8px 0 0;
}

.chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.chart-tile {
    background: #fff;
    border-radius: 16px;
    padding: 14px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    display: grid;
    gap: 8px;
}

.chart-title {
    font-weight: 600;
    color: #1f2a37;
    font-size: 13px;
}

.chart-subtitle {
    color: #64748b;
    font-size: 12px;
}

.chart-value {
    font-size: 18px;
    font-weight: 700;
    color: #1f2a37;
}

.chart-note {
    font-size: 12px;
    color: #64748b;
}

.sparkline {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 60px;
}

.sparkline-bar {
    flex: 1;
    background: #3b82f6;
    border-radius: 6px 6px 0 0;
    opacity: 0.75;
}

.sparkline-bar.alt {
    background: #10b981;
}

.sparkline-bar.warn {
    background: #f59e0b;
}

.chart-visual {
    width: 100%;
    height: 70px;
}

.chart-visual svg {
    width: 100%;
    height: 70px;
    display: block;
}

.chart-line {
    fill: none;
    stroke: #3b82f6;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.chart-area {
    fill: rgba(59, 130, 246, 0.16);
    stroke: #3b82f6;
    stroke-width: 1.5;
}

.chart-line.green {
    stroke: #10b981;
}

.chart-area.green {
    fill: rgba(16, 185, 129, 0.16);
    stroke: #10b981;
}

.chart-line.amber {
    stroke: #f59e0b;
}

.chart-area.amber {
    fill: rgba(245, 158, 11, 0.16);
    stroke: #f59e0b;
}

.chart-donut {
    width: 80px;
    height: 80px;
}

.chart-donut circle {
    fill: none;
    stroke-width: 7;
}

.chart-donut .bg {
    stroke: #e2e8f0;
}

.chart-donut .fg {
    stroke: #3b82f6;
    stroke-linecap: round;
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
}

.chart-gauge {
    width: 100%;
    height: 60px;
}

.chart-grid.is-dashboard .chart-visual {
    height: 58px;
}

.chart-grid.is-dashboard .chart-visual svg {
    height: 58px;
}

.chart-grid.is-dashboard .chart-donut {
    width: 60px;
    height: 60px;
}

.chart-grid.is-dashboard .chart-donut circle {
    stroke-width: 6;
}

.chart-grid.is-dashboard .chart-gauge {
    height: 52px;
}

.chart-grid.is-dashboard .chart-gauge path {
    stroke-width: 5;
}

.chart-grid.is-dashboard .chart-line {
    stroke-width: 1.6;
}

.chart-grid.is-dashboard .chart-area {
    stroke-width: 1.2;
}

.chart-gauge path {
    fill: none;
    stroke-width: 6;
    stroke-linecap: round;
}

.chart-gauge .bg {
    stroke: #e2e8f0;
}

.chart-gauge .fg {
    stroke: #10b981;
}

.chart-legend {
    display: flex;
    gap: 8px;
    font-size: 11px;
    color: #64748b;
}

.chart-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.chart-legend span::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #94a3b8;
}

.chart-legend .legend-hr::before { background: #3b82f6; }
.chart-legend .legend-leave::before { background: #10b981; }
.chart-legend .legend-compliance::before { background: #f59e0b; }

.chart-value[title],
.chart-note[title],
.chart-legend span[title] {
    cursor: help;
}

.login-page {
    background: linear-gradient(135deg, #f4f6fb 0%, #e9edf7 100%);
    overflow-x: clip;
}

@supports not (overflow-x: clip) {
    .login-page {
        overflow-x: hidden;
    }
}

/* Водяной знак на странице входа — логотип ЮГИТ и ООО «ЮГИТ» в полутоне на заднем плане */
.login-bg-watermark {
    position: fixed;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    user-select: none;
    overflow: hidden;
}
.login-watermark-logo {
    width: min(1000px, 96vw);
    max-width: 100%;
    height: auto;
    opacity: 0.12;
    filter: grayscale(1);
}
.login-wrapper {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
    padding: clamp(12px, 3vw, 24px);
}

.login-card {
    width: 100%;
    max-width: min(440px, calc(100vw - 2 * clamp(12px, 3vw, 24px)));
    min-width: 0;
    box-sizing: border-box;
    background: #fff;
    border-radius: 20px;
    padding: 28px;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.18);
    display: grid;
    gap: 14px;
}

.login-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.login-subtitle {
    color: #64748b;
    margin: 0;
}

.login-form {
    display: grid;
    gap: 14px;
}

.login-field {
    display: grid;
    gap: 6px;
    font-size: 13px;
    color: #475569;
}

.login-field input,
.login-field select {
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    padding: 10px 12px;
    font-size: 14px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.login-actions {
    display: grid;
    gap: 8px;
    margin-top: 6px;
}

.login-page .login-actions .btn {
    max-width: 100%;
    white-space: normal;
    line-height: 1.35;
    text-align: center;
    box-sizing: border-box;
}

.login-page .login-card h1 {
    overflow-wrap: break-word;
    word-break: normal;
}

.login-hint {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 12px;
    color: #64748b;
    background: #f8fafc;
    border-radius: 12px;
    padding: 10px 12px;
    word-break: normal;
    overflow-wrap: break-word;
}

.login-hint-icon {
    flex-shrink: 0;
    margin-top: 2px;
    opacity: 0.85;
}

.login-hint-body {
    flex: 1;
    min-width: 0;
}

.login-hint-body > p {
    margin-bottom: 0.4rem;
}

.login-hint-body > p:last-child {
    margin-bottom: 0;
}

.login-hint-accounts {
    padding-left: 1.15rem;
    margin: 0;
    line-height: 1.5;
}

.login-hint-accounts li {
    margin-bottom: 0.2rem;
}

.login-hint-accounts li:last-child {
    margin-bottom: 0;
}

.login-hint code,
.login-hint-accounts code {
    font-size: 0.95em;
    color: #334155;
    word-break: normal;
}

.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.flow-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.flow-card {
    background: #fff;
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
    display: grid;
    gap: 8px;
    font-size: 13px;
}

.flow-card.accent-blue { background: #f2f7ff; }
.flow-card.accent-green { background: #f2fbf6; }
.flow-card.accent-amber { background: #fff6ea; }
.flow-card.accent-purple { background: #f7f2ff; }

.flow-card .flow-step {
    font-weight: 600;
    color: #1f2a37;
}

.note-card {
    background: #0f172a;
    color: #e2e8f0;
    border-radius: 16px;
    padding: 16px;
    display: grid;
    gap: 8px;
}

.note-card strong {
    color: #fff;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-list span {
    background: #f1f5f9;
    color: #334155;
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    line-height: 1;
}

.tag-list .tag-blue { background: #e6f0ff; color: #1d4ed8; }
.tag-list .tag-green { background: #e7f7ef; color: #047857; }
.tag-list .tag-amber { background: #fff1df; color: #b45309; }
.tag-list .tag-purple { background: #efe7ff; color: #6d28d9; }
.tag-list .tag-slate { background: #eef2f7; color: #334155; }

.note-card .tag-list span {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.leadership-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.leadership-card {
    background: #fff;
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
    display: grid;
    gap: 8px;
    font-size: 13px;
}

.leadership-title {
    font-weight: 600;
    color: #1f2a37;
}

.stepper {
    display: grid;
    gap: 12px;
    margin-bottom: 16px;
}

.step-item {
    background: #fff;
    border-radius: 16px;
    padding: 14px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    display: grid;
    grid-template-columns: 40px 1fr auto;
    gap: 12px;
    align-items: center;
    font-size: 13px;
    border: 2px solid transparent;
}

.step-item.accent-blue { background: #f2f7ff; }
.step-item.accent-green { background: #f2fbf6; }
.step-item.accent-amber { background: #fff6ea; }
.step-item.accent-purple { background: #f7f2ff; }
.step-item.accent-slate { background: #f6f8fb; }

.step-index {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #334155;
}

.step-body {
    display: grid;
    gap: 4px;
}

.step-title {
    font-weight: 600;
    color: #1f2a37;
}

.step-status {
    font-size: 12px;
    color: #64748b;
}

.step-item.is-active {
    border-color: rgba(59, 130, 246, 0.4);
    background: #f8fafc;
}

.step-item.is-active .step-index {
    background: rgba(59, 130, 246, 0.15);
    color: #1d4ed8;
}

.step-item.is-complete .step-index {
    background: rgba(16, 185, 129, 0.2);
    color: #059669;
}

.wizard-panel {
    background: #fff;
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
    display: grid;
    gap: 14px;
}

.wizard-panel .panel-title {
    font-weight: 600;
    font-size: 16px;
}

.wizard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.wizard-field {
    display: grid;
    gap: 6px;
    font-size: 13px;
}

.wizard-field input,
.wizard-field select,
.wizard-field textarea {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 13px;
}

.wizard-field input.is-invalid,
.wizard-field select.is-invalid,
.wizard-field textarea.is-invalid {
    border-color: #ef4444;
    background: #fff5f5;
}

.wizard-error {
    color: #ef4444;
    font-size: 12px;
}

.wizard-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.wizard-status {
    font-size: 12px;
    color: #64748b;
}

.wizard-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #64748b;
}

.wizard-progress-bar {
    width: 140px;
    height: 6px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
}

.wizard-progress-bar span {
    display: block;
    height: 100%;
    background: #3b82f6;
    width: 0%;
    transition: width 0.2s ease;
}

.module-card {
    background: #fff;
    border-radius: 14px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.module-card.accent-blue { background: #f2f7ff; }
.module-card.accent-green { background: #f2fbf6; }
.module-card.accent-amber { background: #fff6ea; }
.module-card.accent-purple { background: #f7f2ff; }
.module-card.accent-slate { background: #f6f8fb; }

.module-link {
    text-decoration: none;
    color: inherit;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.5s ease;
}

.module-link:hover {
    color: inherit;
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.14);
}

.table-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #334155;
}

.muted {
    color: #94a3b8;
    font-size: 12px;
}

.status {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
}

.status.success { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.status.warning { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.status.danger { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.status.info { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.status.low { background: rgba(59, 130, 246, 0.12); color: #2563eb; }
.status.medium { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.status.high { background: rgba(239, 68, 68, 0.15); color: #ef4444; }

.org-grid,
.learning-grid,
.request-grid,
.comp-grid,
.roadmap-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.org-card,
.learning-card,
.request-card,
.comp-card,
.roadmap-card {
    background: #fff;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.request-card.accent-blue { background: #f2f7ff; }
.request-card.accent-green { background: #f2fbf6; }
.request-card.accent-amber { background: #fff6ea; }

.org-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.org-tags span,
.pill {
    background: #f1f5f9;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    color: #475569;
}

.pill.success { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.pill.danger { background: rgba(239, 68, 68, 0.15); color: #ef4444; }

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
}

.calendar-day {
    background: #fff;
    border-radius: 16px;
    padding: 12px;
    text-align: center;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.calendar-day.active {
    border: 2px solid #3b82f6;
}

.calendar-day .tag {
    margin-top: 8px;
    font-size: 12px;
    color: #64748b;
}

.progress-list {
    display: grid;
    gap: 12px;
}

.progress-item {
    display: grid;
    grid-template-columns: 1fr 2fr auto;
    gap: 10px;
    align-items: center;
    font-size: 13px;
}

.progress {
    background: #e2e8f0;
    height: 8px;
    border-radius: 999px;
    overflow: hidden;
}

.progress div {
    height: 100%;
    background: #3b82f6;
}

.quality-score {
    display: flex;
    align-items: center;
    gap: 16px;
}

.score-circle {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: conic-gradient(#3b82f6 0 85%, #e2e8f0 85% 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.score-circle small {
    font-size: 12px;
    color: #64748b;
}

.list-clean {
    list-style: none;
    padding-left: 0;
    margin: 0;
    display: grid;
    gap: 8px;
}

.request-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
}

.chart-rows {
    display: grid;
    gap: 10px;
}

.chart-row {
    display: grid;
    grid-template-columns: 70px 1fr 50px;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}

.chart-row div {
    background: #e2e8f0;
    border-radius: 999px;
    height: 6px;
    overflow: hidden;
}

.chart-row div div {
    height: 100%;
    background: #3b82f6;
}

.donut {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    margin: 10px auto 16px;
    background: conic-gradient(#3b82f6 0 78%, #e2e8f0 78% 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.donut-center {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.link-btn {
    border: none;
    background: transparent;
    color: #3b82f6;
    font-size: 13px;
}

.portal-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    color: #64748b;
    font-size: 13px;
}

.footer-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.footer-actions .btn {
    text-decoration: none;
    border-radius: 10px;
    padding: 6px 14px;
    font-size: 13px;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

/* Карточка сотрудника — hero-блок */
.employee-card-hero {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, #f8fafc 0%, #fff 50%);
    border-radius: 20px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
}
.employee-card-avatar {
    width: 88px;
    height: 88px;
    border-radius: 20px;
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    font-size: 1.75rem;
    flex-shrink: 0;
}
.employee-card-info { flex: 1; min-width: 0; }
.employee-card-name {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f2a37;
    margin: 0 0 0.5rem;
}
.employee-card-meta {
    font-size: 0.95rem;
    color: #64748b;
    margin: 0.25rem 0;
}

.employee-block-panel {
    transition: transform 0.2s, box-shadow 0.2s;
}
.employee-block-panel:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.1);
}
.employee-block-panel .panel-header h3 {
    font-weight: 600;
    font-size: 0.95rem;
}
.employee-block-panel .panel-header h3 .fas {
    font-size: 0.85em;
    opacity: 0.7;
    color: #64748b;
}

.profile-card {
    background: #fff;
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.profile-main {
    display: flex;
    align-items: center;
    gap: 16px;
}

.profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #334155;
    font-size: 20px;
}

.profile-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.profile-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin: 16px 0;
}

.stat-block {
    background: #fff;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.stat-title {
    color: #64748b;
    font-size: 13px;
}

.stat-value {
    font-size: 22px;
    font-weight: 700;
    margin: 6px 0;
}

.stat-meta {
    font-size: 12px;
    color: #94a3b8;
}

.profile-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 12px 0 18px;
}

.tab-btn {
    border: none;
    background: #fff;
    border-radius: 999px;
    padding: 8px 16px;
    font-size: 13px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.tab-btn.active {
    background: #111827;
    color: #fff;
}

.kanban {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 16px;
    margin-top: 20px;
}

/* Колонки по высоте контента; не растягиваются под блок «Выход»; ширина резиновая */
.kanban-column {
    flex: 1 1 220px;
    min-width: 220px;
    height: fit-content;
    align-self: flex-start;
    background: #fff;
    border-radius: 16px;
    padding: 14px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
}

/* На странице подбора колонки не тянутся по высоте «Выход» */
#module-recruiting .kanban-column {
    height: fit-content !important;
    align-self: flex-start !important;
}

/* Список выходов в колонке «Выход» — фиксированная высота и прокрутка */
.kanban-column-cards {
    max-height: 70vh;
    overflow-y: auto;
    min-height: 0;
}

.kanban-title {
    font-weight: 600;
    color: #334155;
}

.kanban-card {
    background: #f8fafc;
    border-radius: 12px;
    padding: 10px;
    display: grid;
    gap: 6px;
    font-size: 13px;
}

.calendar-board {
    background: #fff;
    border-radius: 20px;
    padding: 16px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
    margin-bottom: 20px;
}

.calendar-board-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 12px;
    color: #64748b;
    margin-bottom: 10px;
}

.calendar-board-body {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.calendar-cell {
    background: #f8fafc;
    border-radius: 12px;
    padding: 10px;
    min-height: 90px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 12px;
}

.calendar-cell.active {
    border: 2px solid #3b82f6;
    background: #eff6ff;
}

.calendar-cell.muted {
    opacity: 0.4;
}

.vacation-calendar-wrap .year-overview {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    margin-top: 16px;
}

/* Горизонтальный скролл календаря на узких экранах */
@media (max-width: 575.98px) {
    .vacation-calendar-wrap .year-overview {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        gap: 16px;
        padding-bottom: 8px;
        margin: 16px -12px 0;
    }
    .vacation-calendar-wrap .year-overview .month-cell {
        flex: 0 0 auto;
        min-width: 140px;
        scroll-snap-align: start;
    }
}

.vacation-calendar-wrap .month-cell {
    background: #f8fafc;
    border-radius: 12px;
    padding: 10px;
}

.vacation-calendar-wrap .month-days {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    margin-top: 6px;
}

.vacation-calendar-wrap .month-days .day {
    width: 20px;
    height: 20px;
    line-height: 20px;
    text-align: center;
    font-size: 11px;
    border-radius: 4px;
}

.vacation-calendar-wrap .month-days .day.weekend {
    background: #e2e8f0;
    color: #64748b;
}

.vacation-calendar-wrap .month-days .day.holiday {
    background: #fecaca;
    color: #991b1b;
}

.vacation-calendar-wrap .month-days .day.selected {
    background: #3b82f6;
    color: #fff;
}

.vacation-periods-list .input-group {
    max-width: 400px;
}

/* ——— Мобильная адаптация ——— */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: max(16px, env(safe-area-inset-top, 0px));
    left: max(16px, env(safe-area-inset-left, 0px));
    z-index: 1050;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 12px;
    background: #101725;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    cursor: pointer;
    transition: opacity 0.2s;
}
.sidebar-toggle:hover { opacity: 0.9; }
.sidebar-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 10px;
    background: rgba(255,255,255,0.1);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1040;
    background: rgba(0,0,0,0.4);
    opacity: 0;
    transition: opacity 0.25s;
}
.sidebar-backdrop.show {
    display: block;
    opacity: 1;
}

@media (max-width: 991.98px) {
    .sidebar-toggle { display: flex; }
    .portal-wrapper {
        flex-direction: row;
    }

    .portal-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 280px;
        max-width: 85vw;
        height: 100vh;
        z-index: 1055;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: 4px 0 24px rgba(0,0,0,0.15);
    }
    .portal-sidebar.open {
        transform: translateX(0);
    }

    .portal-main {
        padding: 16px;
        padding-top: max(72px, calc(env(safe-area-inset-top, 0px) + 56px));
        padding-bottom: max(16px, env(safe-area-inset-bottom, 0px));
    }

    .search-box {
        min-width: 100%;
    }

    .vacation-calendar-wrap .year-overview {
        grid-template-columns: repeat(3, 1fr);
    }

    .topbar-right .btn {
        font-size: 0.9rem;
        padding: 0.4rem 0.6rem;
    }
    .topbar-right .btn span:not(.badge) {
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

@media (max-width: 576px) {
/* Степпер потока КЭДО: Создать → Отправить → Согласовать/Подписать */
.kedo-flow-stepper {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.kedo-flow-stepper .flow-step {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
}
.kedo-flow-stepper .flow-step.is-done {
    background: rgba(16, 185, 129, 0.15);
    color: #059669;
}
.kedo-flow-stepper .flow-step.is-current {
    background: rgba(59, 130, 246, 0.15);
    color: #1d4ed8;
}
.kedo-flow-stepper .flow-step.is-pending {
    background: #f1f5f9;
    color: #64748b;
}
.kedo-flow-stepper .flow-arrow {
    color: #cbd5e1;
    font-size: 12px;
}
body.hr-portal[data-theme="dark"] .kedo-flow-stepper .flow-step.is-done {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}
body.hr-portal[data-theme="dark"] .kedo-flow-stepper .flow-step.is-current {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}
body.hr-portal[data-theme="dark"] .kedo-flow-stepper .flow-step.is-pending {
    background: #334155;
    color: #94a3b8;
}
body.hr-portal[data-theme="dark"] .kedo-flow-stepper .flow-arrow {
    color: #475569;
}

    .kedo-filters {
        flex-direction: column;
        align-items: stretch;
    }
    .kedo-filters .form-select,
    .kedo-filters .form-control {
        width: 100% !important;
        min-width: 0 !important;
    }
    .login-watermark-logo {
        width: min(400px, 92vw);
    }
    .portal-main { padding: 12px; padding-top: 68px; }
    .section-header { flex-direction: column; align-items: stretch; gap: 12px; }
    .section-header .btn { width: 100%; }
    .kpi-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .login-card {
        padding: 20px;
        margin: 0;
        max-width: min(440px, calc(100vw - 24px));
    }
    .login-wrapper {
        padding-left: max(12px, env(safe-area-inset-left, 0px));
        padding-right: max(12px, env(safe-area-inset-right, 0px));
    }
    #notificationsDropdown { min-width: calc(100vw - 24px) !important; max-width: calc(100vw - 24px) !important; }
}

@media (max-width: 767.98px) {
    .table-mobile-cards thead {
        display: none;
    }
    .table-mobile-cards,
    .table-mobile-cards tbody,
    .table-mobile-cards tr,
    .table-mobile-cards td {
        display: block;
        width: 100%;
    }
    .table-mobile-cards tr {
        background: #fff;
        border: 1px solid #e2e8f0;
        border-radius: 14px;
        padding: 10px 12px;
        margin-bottom: 12px;
        box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
    }
    .table-mobile-cards td {
        border: 0 !important;
        padding: 6px 0 !important;
        text-align: left !important;
    }
    .table-mobile-cards td::before {
        content: attr(data-label);
        display: block;
        font-size: 11px;
        line-height: 1.3;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: #64748b;
        margin-bottom: 2px;
    }
    .table-mobile-cards td:last-child {
        padding-bottom: 0 !important;
    }
    body.hr-portal[data-theme="dark"] .table-mobile-cards tr {
        background: #162031;
        border-color: #334155;
        box-shadow: none;
    }
    body.hr-portal[data-theme="dark"] .table-mobile-cards td::before {
        color: #94a3b8;
    }
}

/* ——— Анимации появления блоков на дашборде (portal) ——— */
@keyframes dashFadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes dashScaleIn {
    from {
        opacity: 0;
        transform: scale(0.96);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Заголовок секции дашборда */
#dashboard > .section-header {
    opacity: 0;
    animation: dashFadeUp 0.8s ease-out 0.15s forwards;
}

/* KPI-карточки: каскадное появление */
#dashboard .kpi-grid .kpi-card {
    opacity: 0;
    animation: dashFadeUp 0.8s ease-out forwards;
}
#dashboard .kpi-grid .kpi-card:nth-child(1) { animation-delay: 0.12s; }
#dashboard .kpi-grid .kpi-card:nth-child(2) { animation-delay: 0.18s; }
#dashboard .kpi-grid .kpi-card:nth-child(3) { animation-delay: 0.24s; }
#dashboard .kpi-grid .kpi-card:nth-child(4) { animation-delay: 0.3s; }
#dashboard .kpi-grid .kpi-card:nth-child(5) { animation-delay: 0.36s; }
#dashboard .kpi-grid .kpi-card:nth-child(6) { animation-delay: 0.42s; }
#dashboard .kpi-grid .kpi-card:nth-child(7) { animation-delay: 0.48s; }
#dashboard .kpi-grid .kpi-card:nth-child(8) { animation-delay: 0.54s; }
#dashboard .kpi-grid .kpi-card:nth-child(9) { animation-delay: 0.6s; }
#dashboard .kpi-grid .kpi-card:nth-child(10) { animation-delay: 0.66s; }
#dashboard .kpi-grid .kpi-card:nth-child(11) { animation-delay: 0.72s; }
#dashboard .kpi-grid .kpi-card:nth-child(12) { animation-delay: 0.78s; }
#dashboard .kpi-grid .kpi-card:nth-child(13) { animation-delay: 0.84s; }
#dashboard .kpi-grid .kpi-card:nth-child(14) { animation-delay: 0.9s; }
#dashboard .kpi-grid .kpi-card:nth-child(15) { animation-delay: 0.96s; }
#dashboard .kpi-grid .kpi-card:nth-child(16) { animation-delay: 1.02s; }
#dashboard .kpi-grid .kpi-card:nth-child(n+17) { animation-delay: 1.08s; }

/* Блок «Мои задачи» */
#dashboard .section-header.mt-3 {
    opacity: 0;
    animation: dashFadeUp 0.7s ease-out 0.75s forwards;
}
#dashboard .task-cards-grid {
    opacity: 0;
    animation: dashFadeUp 0.75s ease-out 0.78s forwards;
}
#dashboard .task-cards-grid .task-card {
    opacity: 0;
    animation: dashFadeUp 0.65s ease-out forwards;
}
#dashboard .task-cards-grid .task-card:nth-child(1) { animation-delay: 0.88s; }
#dashboard .task-cards-grid .task-card:nth-child(2) { animation-delay: 0.94s; }
#dashboard .task-cards-grid .task-card:nth-child(3) { animation-delay: 1s; }
#dashboard .task-cards-grid .task-card:nth-child(4) { animation-delay: 1.06s; }
#dashboard .task-cards-grid .task-card:nth-child(5) { animation-delay: 1.12s; }
#dashboard .task-cards-grid .task-card:nth-child(n+6) { animation-delay: 1.18s; }

/* Две панели: Сводка событий и Воронка подбора */
#dashboard .grid-2 {
    opacity: 0;
    animation: dashFadeUp 0.85s ease-out 0.95s forwards;
}
#dashboard .grid-2 .timeline-item {
    opacity: 0;
    animation: dashFadeIn 0.65s ease-out forwards;
}
#dashboard .grid-2 .timeline-item:nth-child(1) { animation-delay: 1.15s; }
#dashboard .grid-2 .timeline-item:nth-child(2) { animation-delay: 1.18s; }
#dashboard .grid-2 .timeline-item:nth-child(3) { animation-delay: 1.21s; }
#dashboard .grid-2 .timeline-item:nth-child(4) { animation-delay: 1.24s; }
#dashboard .grid-2 .timeline-item:nth-child(5) { animation-delay: 1.27s; }
#dashboard .grid-2 .timeline-item:nth-child(6) { animation-delay: 1.3s; }
#dashboard .grid-2 .timeline-item:nth-child(7) { animation-delay: 1.33s; }
#dashboard .grid-2 .timeline-item:nth-child(8) { animation-delay: 1.36s; }
#dashboard .grid-2 .pipeline-step {
    opacity: 0;
    animation: dashScaleIn 0.55s ease-out forwards;
}
#dashboard .grid-2 .pipeline-step:nth-child(1) { animation-delay: 1.18s; }
#dashboard .grid-2 .pipeline-step:nth-child(2) { animation-delay: 1.24s; }
#dashboard .grid-2 .pipeline-step:nth-child(3) { animation-delay: 1.3s; }
#dashboard .grid-2 .pipeline-step:nth-child(4) { animation-delay: 1.36s; }
#dashboard .grid-2 .pipeline-step:nth-child(5) { animation-delay: 1.42s; }

/* Заголовок «Графики и мониторинг» */
#dashboard .section-header:last-of-type {
    opacity: 0;
    animation: dashFadeUp 0.7s ease-out 1.1s forwards;
}

/* Чарты (графики) */
#dashboard .chart-grid.is-dashboard .chart-tile {
    opacity: 0;
    animation: dashFadeUp 0.8s ease-out forwards;
}
#dashboard .chart-grid.is-dashboard .chart-tile:nth-child(1) { animation-delay: 1.2s; }
#dashboard .chart-grid.is-dashboard .chart-tile:nth-child(2) { animation-delay: 1.3s; }
#dashboard .chart-grid.is-dashboard .chart-tile:nth-child(3) { animation-delay: 1.4s; }
#dashboard .chart-grid.is-dashboard .chart-tile:nth-child(4) { animation-delay: 1.5s; }
#dashboard .chart-grid.is-dashboard .chart-tile:nth-child(5) { animation-delay: 1.6s; }
#dashboard .chart-grid.is-dashboard .chart-tile:nth-child(6) { animation-delay: 1.7s; }

/* Секция «Функциональные модули» — появление при скролле через .animate-in */
#modulesSection .section-header {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}
#modulesSection.animate-in .section-header {
    opacity: 1;
    transform: translateY(0);
}
#modulesSection .module-card {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.65s ease-out, transform 0.65s ease-out;
}
#modulesSection.animate-in .module-card:nth-child(1) { transition-delay: 0.06s; }
#modulesSection.animate-in .module-card:nth-child(2) { transition-delay: 0.12s; }
#modulesSection.animate-in .module-card:nth-child(3) { transition-delay: 0.18s; }
#modulesSection.animate-in .module-card:nth-child(4) { transition-delay: 0.24s; }
#modulesSection.animate-in .module-card:nth-child(5) { transition-delay: 0.3s; }
#modulesSection.animate-in .module-card:nth-child(6) { transition-delay: 0.36s; }
#modulesSection.animate-in .module-card:nth-child(7) { transition-delay: 0.42s; }
#modulesSection.animate-in .module-card:nth-child(8) { transition-delay: 0.48s; }
#modulesSection.animate-in .module-card:nth-child(9) { transition-delay: 0.54s; }
#modulesSection.animate-in .module-card:nth-child(10) { transition-delay: 0.6s; }
#modulesSection.animate-in .module-card:nth-child(11) { transition-delay: 0.66s; }
#modulesSection.animate-in .module-card:nth-child(12) { transition-delay: 0.72s; }
#modulesSection.animate-in .module-card:nth-child(13) { transition-delay: 0.78s; }
#modulesSection.animate-in .module-card:nth-child(14) { transition-delay: 0.84s; }
#modulesSection.animate-in .module-card:nth-child(15) { transition-delay: 0.9s; }
#modulesSection.animate-in .module-card:nth-child(16) { transition-delay: 0.96s; }
#modulesSection.animate-in .module-card:nth-child(17) { transition-delay: 1.02s; }
#modulesSection.animate-in .module-card:nth-child(18) { transition-delay: 1.08s; }
#modulesSection.animate-in .module-card:nth-child(n+19) { transition-delay: 1.14s; }
#modulesSection.animate-in .module-card {
    opacity: 1;
    transform: translateY(0);
}

/* ——— Анимация появления блоков в модулях (Обучение, Заявки, Аттестация и т.д.) ——— */
.animate-blocks .section-header {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}
.animate-blocks.animate-in .section-header {
    opacity: 1;
    transform: translateY(0);
}
.animate-blocks .kpi-grid .kpi-card {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}
.animate-blocks.animate-in .kpi-grid .kpi-card {
    opacity: 1;
    transform: translateY(0);
}
.animate-blocks.animate-in .kpi-grid .kpi-card:nth-child(1) { transition-delay: 0.08s; }
.animate-blocks.animate-in .kpi-grid .kpi-card:nth-child(2) { transition-delay: 0.16s; }
.animate-blocks.animate-in .kpi-grid .kpi-card:nth-child(3) { transition-delay: 0.24s; }
.animate-blocks.animate-in .kpi-grid .kpi-card:nth-child(4) { transition-delay: 0.32s; }
.animate-blocks.animate-in .kpi-grid .kpi-card:nth-child(5) { transition-delay: 0.4s; }
.animate-blocks.animate-in .kpi-grid .kpi-card:nth-child(6) { transition-delay: 0.48s; }
.animate-blocks.animate-in .kpi-grid .kpi-card:nth-child(n+7) { transition-delay: 0.56s; }
.animate-blocks .panel {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}
.animate-blocks.animate-in .panel {
    opacity: 1;
    transform: translateY(0);
}
.animate-blocks.animate-in .grid-2 .panel:nth-child(1) { transition-delay: 0.2s; }
.animate-blocks.animate-in .grid-2 .panel:nth-child(2) { transition-delay: 0.32s; }
.animate-blocks.animate-in .panel.mt-4 { transition-delay: 0.32s; }
.animate-blocks .chart-tile,
.animate-blocks .chart-grid .chart-tile {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.65s ease-out, transform 0.65s ease-out;
}
.animate-blocks.animate-in .chart-tile,
.animate-blocks.animate-in .chart-grid .chart-tile {
    opacity: 1;
    transform: translateY(0);
}
.animate-blocks.animate-in .chart-grid .chart-tile:nth-child(1) { transition-delay: 0.12s; }
.animate-blocks.animate-in .chart-grid .chart-tile:nth-child(2) { transition-delay: 0.22s; }
.animate-blocks.animate-in .chart-grid .chart-tile:nth-child(3) { transition-delay: 0.32s; }
.animate-blocks.animate-in .chart-grid .chart-tile:nth-child(4) { transition-delay: 0.42s; }
.animate-blocks.animate-in .chart-grid .chart-tile:nth-child(5) { transition-delay: 0.52s; }
.animate-blocks.animate-in .chart-grid .chart-tile:nth-child(n+6) { transition-delay: 0.62s; }
/* ——— Страница «Обзор» ——— */
.overview-hero {
    margin-bottom: 2rem;
    padding: 2rem 0;
}
.overview-hero-title {
    font-size: 1.85rem;
    font-weight: 700;
    color: #1f2a37;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}
.overview-hero-subtitle {
    font-size: 1.05rem;
    color: #64748b;
    line-height: 1.5;
    margin: 0;
}
.overview-intro {
    font-size: 1rem;
    line-height: 1.65;
    color: #475569;
    margin-bottom: 2.5rem;
}
.overview-section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2a37;
    margin: 2.5rem 0 0.5rem;
    display: flex;
    align-items: center;
}
.overview-section-title i {
    color: #3b82f6;
}
.overview-section-desc {
    font-size: 0.9rem;
    color: #64748b;
    margin-bottom: 1.25rem;
}
.overview-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
}
.overview-card {
    display: block;
    padding: 1.5rem;
    border-radius: 16px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.06);
}
.overview-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    opacity: 0.6;
    transition: opacity 0.25s;
}
.overview-card.accent-blue::before { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.overview-card.accent-green::before { background: linear-gradient(90deg, #10b981, #34d399); }
.overview-card.accent-amber::before { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.overview-card.accent-purple::before { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }
.overview-card.accent-slate::before { background: linear-gradient(90deg, #64748b, #94a3b8); }
.overview-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
    color: inherit;
}
.overview-card:hover::before { opacity: 1; }
.overview-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-bottom: 1rem;
}
.overview-card.accent-blue .overview-card-icon { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.overview-card.accent-green .overview-card-icon { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.overview-card.accent-amber .overview-card-icon { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.overview-card.accent-purple .overview-card-icon { background: rgba(139, 92, 246, 0.15); color: #8b5cf6; }
.overview-card.accent-slate .overview-card-icon { background: rgba(100, 116, 139, 0.15); color: #64748b; }
.overview-card.accent-blue { background: linear-gradient(180deg, #f8fbff 0%, #fff 100%); }
.overview-card.accent-green { background: linear-gradient(180deg, #f0fdfa 0%, #fff 100%); }
.overview-card.accent-amber { background: linear-gradient(180deg, #fffbeb 0%, #fff 100%); }
.overview-card.accent-purple { background: linear-gradient(180deg, #faf5ff 0%, #fff 100%); }
.overview-card.accent-slate { background: linear-gradient(180deg, #f8fafc 0%, #fff 100%); }
.overview-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1f2a37;
    margin: 0 0 0.5rem;
}
.overview-card-pill {
    display: inline-block;
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.06);
    color: #64748b;
    margin-bottom: 0.75rem;
}
.overview-card-pill.success { background: rgba(16, 185, 129, 0.15); color: #059669; }
.overview-card p {
    font-size: 0.9rem;
    line-height: 1.5;
    color: #64748b;
    margin: 0;
}
.overview-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
    margin-top: 2rem;
}
.overview-info-card {
    padding: 1.5rem;
    border-radius: 16px;
    background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
    border: 1px solid rgba(0, 0, 0, 0.06);
}
.overview-info-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2a37;
    margin: 0 0 0.5rem;
}
.overview-info-card ul {
    margin: 0.5rem 0 0;
    padding-left: 1.25rem;
    font-size: 0.9rem;
    color: #64748b;
    line-height: 1.6;
}
.overview-info-card p {
    font-size: 0.9rem;
    color: #64748b;
    line-height: 1.55;
    margin: 0;
}
.overview-extras-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
    margin-top: 1.25rem;
}
.overview-extra-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 1.25rem 1rem;
    border-radius: 14px;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid rgba(0, 0, 0, 0.06);
}
.overview-extra-card i {
    font-size: 1.4rem;
    opacity: 0.9;
}
.overview-extra-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.1);
    color: inherit;
}
.overview-extra-card.accent-blue { background: linear-gradient(180deg, #f8fbff 0%, #fff 100%); color: #1e40af; }
.overview-extra-card.accent-green { background: linear-gradient(180deg, #f0fdfa 0%, #fff 100%); color: #047857; }
.overview-extra-card.accent-amber { background: linear-gradient(180deg, #fffbeb 0%, #fff 100%); color: #b45309; }
.overview-extra-card.accent-purple { background: linear-gradient(180deg, #faf5ff 0%, #fff 100%); color: #6d28d9; }
.overview-extra-card.accent-slate { background: linear-gradient(180deg, #f8fafc 0%, #fff 100%); color: #475569; }
.overview-extras-static .overview-extra-card { cursor: default; }
.overview-extras-static .overview-extra-card:hover { transform: none; box-shadow: none; }
.overview-ai-card {
    padding: 1.5rem;
    border-radius: 16px;
    background: linear-gradient(180deg, #f6f8fb 0%, #fff 100%);
    border: 1px solid rgba(0, 0, 0, 0.06);
    margin-top: 1rem;
}
.applicants-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}
.applicants-summary-card {
    padding: 1rem;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}
.applicants-docs-progress { display: flex; align-items: center; gap: 0.5rem; }
.applicants-docs-progress .progress { flex: 1; }

.overview-ai-card ul {
    margin: 0;
    padding-left: 1.25rem;
    font-size: 0.9rem;
    color: #64748b;
    line-height: 1.7;
}

/* Карточки обзора (overview-cards) — анимация */
.animate-blocks .overview-cards .overview-card,
.animate-blocks .overview-cards .panel,
.animate-blocks .overview-card-link {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}
.animate-blocks.animate-in .overview-cards .overview-card,
.animate-blocks.animate-in .overview-cards .panel,
.animate-blocks.animate-in .overview-card-link {
    opacity: 1;
    transform: translateY(0);
}
.animate-blocks.animate-in .overview-cards .overview-card:nth-child(1),
.animate-blocks.animate-in .overview-cards .panel:nth-child(1),
.animate-blocks.animate-in .overview-cards .overview-card-link:nth-child(1) { transition-delay: 0.1s; }
.animate-blocks.animate-in .overview-cards .overview-card:nth-child(2),
.animate-blocks.animate-in .overview-cards .panel:nth-child(2),
.animate-blocks.animate-in .overview-cards .overview-card-link:nth-child(2) { transition-delay: 0.2s; }
.animate-blocks.animate-in .overview-cards .overview-card:nth-child(3),
.animate-blocks.animate-in .overview-cards .panel:nth-child(3),
.animate-blocks.animate-in .overview-cards .overview-card-link:nth-child(3) { transition-delay: 0.3s; }
.animate-blocks.animate-in .overview-cards .overview-card:nth-child(4),
.animate-blocks.animate-in .overview-cards .panel:nth-child(4),
.animate-blocks.animate-in .overview-cards .overview-card-link:nth-child(4) { transition-delay: 0.4s; }
.animate-blocks.animate-in .overview-cards .overview-card:nth-child(5),
.animate-blocks.animate-in .overview-cards .panel:nth-child(5),
.animate-blocks.animate-in .overview-cards .overview-card-link:nth-child(5) { transition-delay: 0.5s; }
.animate-blocks.animate-in .overview-cards .overview-card:nth-child(n+6),
.animate-blocks.animate-in .overview-cards .panel:nth-child(n+6),
.animate-blocks.animate-in .overview-cards .overview-card-link:nth-child(n+6) { transition-delay: 0.6s; }

/* ——— Анимация при наведении: везде в портале (KPI, чарты, панели, модули) ——— */
.hr-portal .kpi-card,
.hr-portal .chart-tile,
.hr-portal .module-card {
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.5s ease, background-color 0.4s ease, filter 0.45s ease;
}
.hr-portal .kpi-card:hover,
.hr-portal .chart-tile:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.6);
    filter: brightness(0.98);
}
.hr-portal .module-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.5);
    filter: brightness(0.98);
}

/* Панели — во всех разделах портала */
.hr-portal .panel {
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.5s ease, filter 0.45s ease;
}
.hr-portal .panel:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.12), inset 0 1px 2px rgba(0, 0, 0, 0.04);
    filter: brightness(0.97);
}

/* Карточки-ссылки в обзоре (overview-card-link) */
.hr-portal .panel.overview-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}
.hr-portal .panel.overview-card-link:hover {
    transform: translateY(-6px) scale(1.01);
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.14), inset 0 1px 2px rgba(0, 0, 0, 0.04);
    filter: brightness(0.97);
}

/* Элементы таймлайна и воронки — во всех разделах */
.hr-portal .timeline-item,
.hr-portal .pipeline-step {
    transition: transform 0.45s ease, background-color 0.45s ease, box-shadow 0.45s ease, border-color 0.45s ease;
}
.hr-portal .timeline-item {
    padding: 8px 0;
    border-radius: 8px;
    border-left: 3px solid transparent;
}
.hr-portal .timeline-item[data-url]:not([data-url=""]) {
    cursor: pointer;
}
.hr-portal .timeline-item:hover {
    transform: translateX(4px);
    background-color: rgba(241, 245, 249, 0.9);
    border-left-color: #3b82f6;
}
.hr-portal .pipeline-step:hover {
    transform: scale(1.05);
    background-color: #e2e8f0;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.06);
}

/* Пункты списков в панелях (Мои задачи и аналоги) */
.hr-portal .panel .list-clean li {
    transition: background-color 0.4s ease;
    border-radius: 8px;
}
.hr-portal .panel .list-clean li:hover {
    background-color: rgba(0, 0, 0, 0.03);
}
.hr-portal .panel .list-clean li a {
    transition: transform 0.4s ease, padding-left 0.4s ease;
}
.hr-portal .panel .list-clean li:hover a {
    transform: translateX(4px);
}

/* Мини-графики (бары) в панели воронки */
.hr-portal .chart-mini .bar {
    transition: transform 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: bottom;
}
.hr-portal #pipelinePanel:hover .chart-mini .bar {
    transform: scaleY(1.03);
}

/* Таблицы в панелях — подсветка строки при наведении (если ещё не задано) */
.hr-portal .panel .table-hover tbody tr {
    transition: background-color 0.4s ease;
}

/* ——— Паттерны для улучшения видимости и понятности ——— */

/* Пустое состояние с подсказкой и действием */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: #64748b;
}
.empty-state-icon {
    font-size: 48px;
    color: #cbd5e1;
    margin-bottom: 16px;
}
.empty-state-title {
    font-size: 16px;
    font-weight: 500;
    color: #475569;
    margin-bottom: 8px;
}
.empty-state-desc {
    font-size: 14px;
    max-width: 400px;
    margin: 0 auto 20px;
    line-height: 1.5;
}
.empty-state-action {
    margin-top: 16px;
}

/* Информационный блок-подсказка */
.info-callout {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 14px;
    line-height: 1.5;
}
.info-callout i {
    color: #0284c7;
    margin-right: 8px;
}
.info-callout strong { color: #0c4a6e; }

/* Чек-лист увольнения: группировка */
.dismissal-checklist-groups { display: flex; flex-direction: column; gap: 16px; }
.dismissal-checklist-group { background: #f8fafc; border-radius: 10px; padding: 12px 14px; }
.dismissal-group-title { font-size: 0.85rem; font-weight: 600; color: #475569; margin-bottom: 8px; }
.dismissal-checklist-group .list-group-item { background: transparent; border-color: rgba(0,0,0,0.06); padding: 10px 0; }

/* Легенда статусов */
.status-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 24px;
    font-size: 12px;
    color: #64748b;
    margin-bottom: 12px;
}
.status-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}
.status-legend-item span.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.status-legend-item .dot-success { background: #22c55e; }
.status-legend-item .dot-warning { background: #f59e0b; }
.status-legend-item .dot-info { background: #3b82f6; }
.status-legend-item .dot-danger { background: #ef4444; }

/* Подписанные фильтры */
.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.filter-group .filter-label {
    font-size: 13px;
    color: #64748b;
}
.filter-group input, .filter-group select {
    font-size: 13px;
}

/* Тёмная тема */
body.hr-portal[data-theme="dark"] {
    background: #0f172a;
    color: #e2e8f0;
}
body.hr-portal[data-theme="dark"] .portal-topbar {
    background: #1e293b;
    border-color: #334155;
}
body.hr-portal[data-theme="dark"] .panel,
body.hr-portal[data-theme="dark"] .kpi-card {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}
body.hr-portal[data-theme="dark"] .panel-header,
body.hr-portal[data-theme="dark"] .kpi-title {
    color: #94a3b8;
}
body.hr-portal[data-theme="dark"] .table {
    color: #e2e8f0;
}
body.hr-portal[data-theme="dark"] .table-light,
body.hr-portal[data-theme="dark"] thead.table-light {
    background: #334155 !important;
    color: #e2e8f0;
}
body.hr-portal[data-theme="dark"] .form-control,
body.hr-portal[data-theme="dark"] .form-select {
    background: #334155;
    border-color: #475569;
    color: #e2e8f0;
}
body.hr-portal[data-theme="dark"] .breadcrumb-link,
body.hr-portal[data-theme="dark"] .breadcrumb-current {
    color: #94a3b8;
}
body.hr-portal[data-theme="dark"] .text-muted {
    color: #94a3b8 !important;
}
body.hr-portal[data-theme="dark"] .dropdown-menu {
    background: #1e293b;
    border-color: #334155;
}
body.hr-portal[data-theme="dark"] .dropdown-item {
    color: #e2e8f0;
}
body.hr-portal[data-theme="dark"] .dropdown-item:hover {
    background: #334155;
}
body.hr-portal[data-theme="dark"] .search-box input {
    background: #334155;
    border-color: #475569;
    color: #e2e8f0;
}

/* Тёмная тема: календарь отпусков */
body.hr-portal[data-theme="dark"] .vacation-calendar-wrap .month-cell {
    background: #334155;
    border-color: #475569;
}
body.hr-portal[data-theme="dark"] .vacation-calendar-wrap .month-days .day.weekend {
    background: #475569;
    color: #94a3b8;
}
body.hr-portal[data-theme="dark"] .vacation-calendar-wrap .month-days .day.holiday {
    background: #7f1d1d;
    color: #fecaca;
}
body.hr-portal[data-theme="dark"] .vacation-calendar-wrap .month-days .day.selected {
    background: #3b82f6;
    color: #fff;
}

/* Тёмная тема: сайдбар, pill, модалки */
body.hr-portal[data-theme="dark"] .portal-sidebar {
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    color: #e2e8f0;
}
body.hr-portal[data-theme="dark"] .modal-content {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}
body.hr-portal[data-theme="dark"] .modal-header {
    border-color: #334155;
}
body.hr-portal[data-theme="dark"] .modal-footer {
    border-color: #334155;
}
body.hr-portal[data-theme="dark"] .pill {
    background: #334155;
    color: #94a3b8;
}

/* Скелетоны загрузки */
.skeleton-line {
    display: inline-block;
    height: 14px;
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    border-radius: 4px;
}
body.hr-portal[data-theme="dark"] .skeleton-line {
    background: linear-gradient(90deg, #334155 25%, #475569 50%, #334155 75%);
    background-size: 200% 100%;
}
@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.skeleton-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid #e2e8f0;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: skeleton-spin 0.8s linear infinite;
}
@keyframes skeleton-spin {
    to { transform: rotate(360deg); }
}

/* Плавающая кнопка чат-бота в правом нижнем углу */
.chatbot-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    z-index: 1040;
}

.chatbot-fab:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 24px rgba(59, 130, 246, 0.5);
    color: #fff;
}

.chatbot-fab-icon {
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
}

.chatbot-fab {
    border: none;
    cursor: pointer;
}

/* Виджет чат-бота в правой панели */
.chatbot-panel-widget {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 320px;
    padding: 0;
}
.chatbot-widget-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    min-height: 160px;
    max-height: 280px;
}
.chatbot-widget-welcome {
    color: var(--hr-muted, #6b7280);
    font-size: 0.875rem;
}
.chatbot-widget-msg {
    margin-bottom: 10px;
}
.chatbot-widget-msg-user {
    text-align: right;
}
.chatbot-widget-msg-user .chatbot-widget-bubble {
    background: var(--hr-primary, #3b82f6);
    color: #fff;
    border-radius: 12px 12px 4px 12px;
    display: inline-block;
    max-width: 85%;
    padding: 8px 12px;
    font-size: 0.9rem;
}
.chatbot-widget-msg-bot .chatbot-widget-bubble {
    background: var(--hr-bg-muted, #f3f4f6);
    color: var(--hr-text, #1f2937);
    border-radius: 12px 12px 12px 4px;
    display: inline-block;
    max-width: 85%;
    padding: 8px 12px;
    font-size: 0.9rem;
}
.chatbot-widget-time {
    font-size: 0.7rem;
    color: var(--hr-muted, #9ca3af);
    margin-top: 4px;
}
.chatbot-widget-link {
    margin-top: 8px;
}
.chatbot-widget-link a {
    display: inline-block;
    padding: 4px 10px;
    background: var(--hr-primary, #3b82f6);
    color: #fff;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.8rem;
}
.chatbot-widget-quick {
    padding: 8px 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.chatbot-widget-qbtn {
    font-size: 0.8rem;
    padding: 4px 10px;
}
.chatbot-widget-input-wrap {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid var(--hr-border, #e5e7eb);
    align-items: flex-end;
}
.chatbot-widget-input-wrap textarea {
    flex: 1;
    resize: none;
    min-height: 40px;
    max-height: 80px;
}
.chatbot-widget-send {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    padding: 0;
}
.chatbot-widget-full-link {
    display: block;
    padding: 8px 12px;
    text-align: center;
    color: var(--hr-muted, #6b7280);
    text-decoration: none;
    border-top: 1px solid var(--hr-border, #e5e7eb);
}
.chatbot-widget-full-link:hover {
    color: var(--hr-primary, #3b82f6);
}

/* Раздел задач: текущие и прошедшие */
.tasks-panel {
    padding: 20px;
}

.tasks-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 400px;
    overflow-y: auto;
}

.tasks-list-section {
    margin-bottom: 20px;
}

.tasks-list-section:last-child {
    margin-bottom: 0;
}

.tasks-section-title {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 10px;
    padding-bottom: 6px;
}

.tasks-section-title-past {
    color: #6b7280;
}

.task-item {
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background 0.2s;
    background: rgba(248, 250, 252, 0.6);
}

.task-item:last-child {
    margin-bottom: 0;
}

.task-item-active .task-item-link {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex: 1;
    min-width: 0;
    text-decoration: none;
    color: #1f2937;
}

.task-item-active .task-item-link:hover {
    color: #3b82f6;
}

.task-item-active:not(.task-item-empty):hover {
    background: rgba(59, 130, 246, 0.08);
}

.task-item .task-item-label {
    font-size: 14px;
    line-height: 1.35;
    word-break: break-word;
}

.task-item .task-item-meta {
    display: block;
    font-size: 12px;
    color: #6b7280;
    margin-top: 2px;
}

.task-item-past {
    opacity: 0.7;
}

.task-item-past .task-item-label {
    color: #6b7280;
    font-size: 13px;
}

.task-item-past .task-item-meta {
    font-size: 11px;
    color: #9ca3af;
}

.task-item-sla-overdue {
    border-left: 3px solid #dc2626;
    padding-left: 10px;
    margin-left: 2px;
    background: rgba(220, 38, 38, 0.06);
    border-radius: 0 8px 8px 0;
}

.task-item-sla-overdue .task-item-label {
    font-weight: 600;
    color: #b91c1c;
}

.task-item-sla-overdue .task-item-meta {
    color: #991b1b;
}

#rightPanelTasksList .task-item-sla-overdue {
    padding-left: 8px;
    margin-left: 0;
}

.task-item-sla-soon {
    border-left: 3px solid #d97706;
    padding-left: 10px;
    margin-left: 2px;
    background: rgba(217, 119, 6, 0.06);
    border-radius: 0 8px 8px 0;
}

.task-item-sla-soon .task-item-label {
    font-weight: 500;
}

.task-item-sla-soon .task-item-meta {
    color: #92400e;
}

#rightPanelTasksList .task-item-sla-soon {
    padding-left: 8px;
    margin-left: 0;
}

.task-item-count {
    background: #3b82f6;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    min-width: 24px;
    height: 24px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.task-item-empty,
.task-item-loading {
    background: transparent;
}

.task-item-loading .task-item-label {
    color: #94a3b8;
}

.task-item-empty .task-item-label {
    font-size: 13px;
}

.task-item .task-approve-btn {
    flex-shrink: 0;
    padding: 6px 10px;
}

/* Задачи в правой панели — компактный вид */
#rightPanelTasksList .task-item {
    padding: 8px 10px;
    background: transparent;
}

#rightPanelTasksList .task-item:hover {
    background: rgba(59, 130, 246, 0.06);
}

#rightPanelTasksList .task-item-label {
    font-size: 13px;
}

#rightPanelTasksList .task-item-meta {
    font-size: 11px;
}

#rightPanelTasksList .task-approve-btn {
    padding: 4px 8px;
    font-size: 12px;
}

/* Панели и вкладки справа */
.right-panel {
    position: fixed;
    top: 140px;
    right: 24px;
    width: 260px;
    max-height: calc(100vh - 180px);
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(15, 23, 42, 0.12);
    z-index: 1030;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.right-panel.collapsed {
    opacity: 0;
    pointer-events: none;
    transform: translateX(20px);
}

.right-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 14px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.right-panel-header h4 {
    font-size: 13px;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
    flex: 1;
}

.right-panel-close {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #64748b;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
}

.right-panel-close i {
    display: inline-block;
    font-size: 12px;
    transition: transform 0.2s ease;
}

.right-panel-close:hover {
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
}

.right-panel.collapsed .right-panel-close i {
    transform: rotate(180deg);
}

.right-panel-body {
    padding: 10px 14px;
    max-height: 320px;
    overflow-y: auto;
}

.right-panel-body .btn {
    margin-top: 8px;
}

.right-panel-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.right-panel-list li {
    margin-bottom: 2px;
}

.right-panel-list li:last-child {
    margin-bottom: 0;
}

.right-panel-list a,
.right-panel-list li {
    display: flex;
    align-items: center;
    padding: 5px 8px;
    border-radius: 6px;
    color: #374151;
    text-decoration: none;
    font-size: 12px;
    line-height: 1.35;
    transition: background 0.2s, color 0.2s;
}

.right-panel-list a:hover {
    background: rgba(59, 130, 246, 0.08);
    color: #3b82f6;
}

.right-panel-list .me-2 {
    margin-right: 8px;
    font-size: 13px;
    opacity: 0.85;
}

.right-panel-body p {
    font-size: 12px;
    font-weight: 400;
    margin-bottom: 8px;
    line-height: 1.4;
}

/* Стек вкладок у правого края */
.right-tabs-stack {
    position: fixed;
    top: 140px;
    right: 0;
    z-index: 1025;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.right-tab {
    width: 40px;
    height: 40px;
    padding: 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-right: none;
    border-radius: 12px 0 0 12px;
    box-shadow: -2px 2px 12px rgba(15, 23, 42, 0.08);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    transition: background 0.2s, color 0.2s;
}

.right-tab:hover {
    background: #f8fafc;
    color: #3b82f6;
}

.right-tab.active {
    background: #eff6ff;
    color: #3b82f6;
    border-color: #93c5fd;
}

.right-tab i {
    font-size: 16px;
}

.right-tab-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 10px;
    min-width: 16px;
    padding: 0 4px;
}

.right-tab.right-tab-hidden {
    display: none;
}

@media (max-width: 1199.98px) {
    .right-panel {
        top: 120px;
        right: 16px;
        width: 260px;
    }
    .right-tabs-stack {
        top: 120px;
    }
}

@media (max-width: 767.98px) {
    .right-panel,
    .right-tabs-stack {
        display: none !important;
    }
}

/* Сортируемые заголовки таблиц */
th.sortable {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}
th.sortable:hover {
    color: var(--bs-primary, #0d6efd);
}

/* Печать */
@media print {
    body.hr-portal .portal-sidebar,
    body.hr-portal .chatbot-fab,
    body.hr-portal .right-panel,
    body.hr-portal .right-tabs-stack,
    body.hr-portal .sidebar-toggle,
    body.hr-portal .sidebar-backdrop,
    body.hr-portal .portal-topbar .topbar-filters,
    body.hr-portal .portal-topbar .topbar-right,
    body.hr-portal .btn,
    body.hr-portal .icon-btn,
    body.hr-portal #themeToggle,
    body.hr-portal .no-print { display: none !important; }
    body.hr-portal .portal-main { margin-left: 0 !important; }
    body.hr-portal .panel, body.hr-portal .section { break-inside: avoid; }
}
