@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Sora:wght@600;700;800&display=swap");

/* Гарантируем, что HTML-атрибут hidden всегда скрывает элемент */
[hidden] { display: none !important; }

/* ─── DESIGN TOKENS ──────────────────────────────────────────── */
:root {
    --bg-page: #f5f7fb;
    --surface: #ffffff;
    --surface-2: #f7f9fc;
    --surface-3: #eef3f8;
    --sidebar-bg-0: #ffffff;
    --sidebar-bg-1: #f6f8fb;
    --sidebar-bg-2: #edf2f7;
    --sidebar-text: #1f2a37;
    --sidebar-text-strong: #111827;
    --sidebar-text-muted: #536579;
    --sidebar-text-soft: #7b8796;
    --sidebar-border: rgba(31, 42, 55, 0.10);
    --sidebar-hover-bg: rgba(37, 99, 235, 0.07);
    --sidebar-active-bg: rgba(37, 99, 235, 0.10);
    --sidebar-active-border: rgba(37, 99, 235, 0.16);
    --line: rgba(31, 42, 55, 0.12);
    --line-soft: rgba(31, 42, 55, 0.08);
    --text: #1f2a37;
    --text-2: #4b5f76;
    --muted: #718096;
    --accent: #d7a42f;
    --accent-d: #9c6d11;
    --accent-bg: rgba(215, 164, 47, 0.14);
    --danger: #c75555;
    --danger-bg: rgba(199, 85, 85, 0.12);
    --success: #2f9b6d;
    --success-bg: rgba(47, 155, 109, 0.12);
    --warning-bg: rgba(215, 164, 47, 0.14);
    --navy: #25486a;
    --navy-2: #2f6fb1;
    --blue: #3f7dd9;
    --chart-line: rgba(31, 42, 55, 0.14);
    --chart-dot: #355f87;
    --shadow: 0 18px 36px rgba(31, 42, 55, 0.10);
    --shadow-sm: 0 8px 18px rgba(31, 42, 55, 0.08);
    --radius: 8px;
    --radius-sm: 8px;
    --radius-xs: 6px;
    --sidebar-w: 272px;
    /* Ring colours per TZ */
    --ring-white: #f4f4f4;
    --ring-black: #2e3442;
    --ring-blue: #3478f6;
    --ring-red: #d85c4a;
    --ring-yellow: #d7a728;
    --sunburst-center-text: var(--text);
    --sunburst-center-unit: var(--muted);
    --feature-card-bg: linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(247, 249, 252, .98));
    --feature-card-border: rgba(31, 42, 55, .10);
    --feature-card-shadow: 0 16px 34px rgba(31, 42, 55, .09);
    --feature-card-text: #1f2a37;
    --feature-card-muted: #718096;
    --feature-card-subtle: rgba(238, 243, 248, .84);
    --feature-card-soft: rgba(247, 249, 252, .92);
    --feature-card-soft-border: rgba(31, 42, 55, .09);
    --feature-progress-track: rgba(113, 128, 150, .20);
    --feature-progress-complete: #80c9a2;
    --feature-progress-partial: #d8bb6d;
    --feature-progress-zero: #d6928a;
    --feature-chip-complete-bg: rgba(128, 201, 162, .18);
    --feature-chip-complete-text: #326b4d;
    --feature-chip-partial-bg: rgba(216, 187, 109, .22);
    --feature-chip-partial-text: #87661d;
    --feature-chip-zero-bg: rgba(214, 146, 138, .20);
    --feature-chip-zero-text: #8f4f49;
    --score-ring-progress: #d6a84a;
    --score-ring-progress-soft: rgba(214, 168, 74, 0.16);
    --score-ring-progress-shadow: rgba(182, 133, 38, 0.18);
    --score-ring-inner-bg: #ffffff;
    --score-ring-inner-text: #25486a;
    --score-ring-inner-muted: #718096;
}

:root[data-theme="dark"] {
    --bg-page: #0a1622;
    --surface: #0f1f2e;
    --surface-2: #111f2e;
    --surface-3: #152535;
    --sidebar-bg-0: #060f18;
    --sidebar-bg-1: #08192a;
    --sidebar-bg-2: #0a1f30;
    --sidebar-text: #e7f0f7;
    --sidebar-text-strong: #ffffff;
    --sidebar-text-muted: rgba(199, 224, 238, 0.78);
    --sidebar-text-soft: rgba(174, 207, 224, 0.65);
    --sidebar-border: rgba(255, 255, 255, 0.08);
    --sidebar-hover-bg: rgba(255, 255, 255, 0.08);
    --sidebar-active-bg: rgba(255, 255, 255, 0.12);
    --sidebar-active-border: rgba(255, 255, 255, 0.12);
    --line: rgba(180, 210, 235, 0.16);
    --line-soft: rgba(180, 210, 235, 0.09);
    --text: #dceaf6;
    --text-2: #9ab4c8;
    --muted: #7a9aaf;
    --accent: #efb23a;
    --accent-d: #d79527;
    --accent-bg: rgba(239, 178, 58, 0.14);
    --danger: #ef7f7f;
    --danger-bg: rgba(239, 127, 127, 0.12);
    --success: #58c693;
    --success-bg: rgba(88, 198, 147, 0.12);
    --warning-bg: rgba(210, 154, 66, 0.14);
    --navy: #c5ddf0;
    --navy-2: #8ab8d6;
    --blue: #5a9cf8;
    --chart-line: rgba(180, 210, 235, 0.2);
    --chart-dot: #c5ddf0;
    --shadow: 0 16px 40px rgba(2, 8, 16, 0.5);
    --shadow-sm: 0 4px 14px rgba(2, 8, 16, 0.35);
    --feature-card-bg: linear-gradient(180deg, rgba(13, 34, 51, .98), rgba(10, 28, 43, .98));
    --feature-card-border: rgba(118, 152, 180, .2);
    --feature-card-shadow: 0 18px 48px rgba(1, 10, 19, .32);
    --feature-card-text: #f4f3ee;
    --feature-card-muted: #95a6b9;
    --feature-card-subtle: rgba(255,255,255,.06);
    --feature-card-soft: rgba(255,255,255,.05);
    --feature-card-soft-border: rgba(118, 152, 180, .14);
    --feature-progress-track: rgba(255,255,255,.04);
    --feature-progress-complete: #46bb8b;
    --feature-progress-partial: #c79e2f;
    --feature-progress-zero: #b45c66;
    --feature-chip-complete-bg: rgba(70, 187, 139, .18);
    --feature-chip-complete-text: #dcfff0;
    --feature-chip-partial-bg: rgba(199, 158, 47, .22);
    --feature-chip-partial-text: #ffe7a7;
    --feature-chip-zero-bg: rgba(180, 92, 102, .24);
    --feature-chip-zero-text: #ffd2d7;
    --score-ring-progress: #efb23a;
    --score-ring-progress-soft: rgba(239, 178, 58, 0.18);
    --score-ring-progress-shadow: rgba(239, 178, 58, 0.22);
    --score-ring-inner-bg: #152a3b;
    --score-ring-inner-text: #f4f3ee;
    --score-ring-inner-muted: #95a6b9;
}

:root:not([data-theme="dark"]) {
    --sunburst-center-text: #eef4fb;
    --sunburst-center-unit: rgba(233, 241, 250, 0.74);
}

/* ─── RESET ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
    font-family: "Inter", "Segoe UI", sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--bg-page);
    background-image: linear-gradient(180deg, rgba(255,255,255,.72), rgba(245,247,251,0));
    overflow-x: hidden;
}
:root[data-theme="dark"] body {
    background-image: linear-gradient(180deg, rgba(20, 37, 53, .56), rgba(10, 22, 34, 0));
}
button, input, select, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 {
    margin: 0;
    font-family: "Sora", "Inter", sans-serif;
    color: var(--text);
    line-height: 1.25;
}

/* ─── TYPOGRAPHY HELPERS ─────────────────────────────────────── */
.eyebrow, .page-kicker {
    margin: 0 0 .2rem;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--muted);
}

/* ─── APP SHELL ──────────────────────────────────────────────── */
.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    min-width: 0;
}

/* ─── SIDEBAR ────────────────────────────────────────────────── */
.sidebar-shell {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 0;
    border-right: 1px solid var(--sidebar-border);
    background: linear-gradient(180deg,
        var(--sidebar-bg-0) 0%,
        var(--sidebar-bg-1) 50%,
        var(--sidebar-bg-2) 100%);
    color: var(--sidebar-text);
}

.sidebar-brand {
    padding: 1.2rem 1.1rem 1rem;
    border-bottom: 1px solid var(--sidebar-border);
}
.sidebar-brand .eyebrow {
    color: var(--sidebar-text-soft);
    margin-bottom: .3rem;
}
.sidebar-brand h2 {
    font-size: 1.35rem;
    color: var(--sidebar-text-strong);
    letter-spacing: -.01em;
}

.sidebar-theme {
    padding: .65rem .7rem .75rem;
    border-bottom: 1px solid var(--sidebar-border);
}
.sidebar-theme .theme-switcher {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: .45rem;
    padding: .7rem;
    background: var(--sidebar-hover-bg);
    border-color: var(--sidebar-border);
}
.sidebar-theme .theme-switcher-label {
    color: var(--sidebar-text-soft);
}
.sidebar-theme .theme-switcher-control {
    display: grid;
    grid-template-columns: 1fr;
    gap: .35rem;
}
.sidebar-theme .theme-option {
    width: 100%;
    justify-content: flex-start;
}

.main-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: .2rem;
    padding: .6rem .7rem;
    overflow-y: auto;
}
.main-nav a {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .62rem .8rem;
    border-radius: var(--radius-sm);
    color: var(--sidebar-text-muted);
    font-size: .875rem;
    font-weight: 500;
    border: 1px solid transparent;
    transition: background .15s, color .15s, border-color .15s;
    position: relative;
}
.main-nav a .nav-icon {
    font-size: 1rem;
    width: 1.2rem;
    text-align: center;
    flex-shrink: 0;
}
.main-nav a:hover {
    color: var(--sidebar-text-strong);
    background: var(--sidebar-hover-bg);
}
.main-nav a.active {
    color: var(--sidebar-text-strong);
    background: var(--sidebar-active-bg);
    border-color: var(--sidebar-active-border);
    font-weight: 700;
}
.main-nav a.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    border-radius: 0 3px 3px 0;
    background: var(--accent);
}

.sidebar-user {
    padding: .8rem .9rem;
    border-top: 1px solid var(--sidebar-border);
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: .45rem .7rem;
}
.sidebar-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(239,178,58,.25);
    border: 2px solid rgba(239,178,58,.55);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .72rem;
    font-weight: 800;
    color: var(--accent);
    flex-shrink: 0;
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name {
    font-size: .8rem;
    font-weight: 700;
    color: var(--sidebar-text-strong);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-user-role {
    font-size: .7rem;
    color: var(--sidebar-text-soft);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-logout {
    grid-column: 2;
    justify-self: start;
    background: none;
    border: none;
    min-height: 34px;
    padding: .35rem .55rem;
    border-radius: var(--radius-xs);
    color: var(--sidebar-text-soft);
    cursor: pointer;
    font-size: .75rem;
    font-weight: 600;
    transition: color .15s, background .15s;
    white-space: nowrap;
}
.sidebar-logout:hover { color: var(--danger); background: var(--danger-bg); }

/* ─── WORKSPACE ──────────────────────────────────────────────── */
.workspace-shell {
    display: flex;
    flex-direction: column;
    padding: 1rem 1.25rem 1.5rem;
    min-height: 100vh;
    min-width: 0;
    gap: .85rem;
}

.page-title {
    font-size: 1.25rem;
    font-family: "Sora","Inter",sans-serif;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.theme-switcher {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    padding: .38rem .42rem .38rem .7rem;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.2);
}
.theme-switcher-label {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
}
.theme-switcher-control {
    display: inline-flex;
    align-items: center;
    gap: .32rem;
}
.theme-option {
    padding: .4rem .72rem;
    border-radius: var(--radius-xs);
    white-space: nowrap;
}

/* ─── NOTICES ────────────────────────────────────────────────── */
.notice {
    padding: .65rem .9rem;
    border-radius: var(--radius-xs);
    border: 1px solid var(--line);
    background: var(--surface);
    font-size: .85rem;
}
.notice.success { border-color: rgba(43,156,111,.35); background: var(--success-bg); color: #196044; }
.notice.error   { border-color: rgba(200,79,79,.35);  background: var(--danger-bg);  color: #7a2e2e; }
.notice.warning { border-color: rgba(183,123,33,.35); background: var(--warning-bg); color: #7c5720; }
:root[data-theme="dark"] .notice.success { color: #7debb5; }
:root[data-theme="dark"] .notice.error   { color: #f09090; }
:root[data-theme="dark"] .notice.warning { color: #dda850; }

/* ─── PAGE ROOT ──────────────────────────────────────────────── */
.page-root {
    display: grid;
    gap: .85rem;
    flex: 1;
    min-width: 0;
}

/* ─── PANELS ─────────────────────────────────────────────────── */
.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.4rem;
    box-shadow: var(--shadow-sm);
    animation: panelRise .22s ease;
    min-width: 0;
}
@keyframes panelRise {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: .8rem;
    margin-bottom: .85rem;
}
.panel-header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
    align-items: center;
    justify-content: flex-end;
}
.panel-header h2 { font-size: 1.05rem; }

/* ─── BUTTONS ────────────────────────────────────────────────── */
.primary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    background: linear-gradient(135deg, var(--accent), #f7ca5e);
    color: #172b3f;
    border: none;
    border-radius: var(--radius-sm);
    min-height: 40px;
    padding: .55rem 1rem;
    font-size: .875rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(204,138,33,.22);
    transition: transform .14s, box-shadow .14s, filter .14s;
    white-space: nowrap;
}
.primary-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(204,138,33,.3); }
.primary-btn:active { transform: translateY(0); filter: brightness(.96); }

.ghost-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    background: var(--surface-3);
    color: var(--text-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    min-height: 38px;
    padding: .48rem .85rem;
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .14s, color .14s, border-color .14s;
    white-space: nowrap;
}
.ghost-btn:hover { background: var(--line); color: var(--text); }
.ghost-btn.danger { color: var(--danger); border-color: var(--danger-bg); background: var(--danger-bg); }
.ghost-btn.danger:hover { background: rgba(200,79,79,.18); }

.segmented {
    display: inline-flex;
    align-items: center;
    background: var(--surface-3);
    color: var(--text-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-xs);
    min-height: 38px;
    padding: .42rem .78rem;
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .14s, color .14s;
}
.segmented.active {
    background: var(--navy);
    color: #fff;
    border-color: var(--navy);
}
:root[data-theme="dark"] .segmented.active { background: var(--navy-2); color: var(--bg-page); }
.segmented:not(.active):hover { background: var(--line); }

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-xs);
    background: transparent;
    border: 1px solid var(--line);
    color: var(--muted);
    cursor: pointer;
    font-size: 1rem;
    transition: background .14s, color .14s;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }

/* ─── INPUTS ─────────────────────────────────────────────────── */
input, select, textarea {
    width: 100%;
    border-radius: var(--radius-xs);
    border: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--text);
    padding: .5rem .75rem;
    min-height: 40px;
    font-size: .875rem;
    transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus, button:focus-visible {
    outline: none;
    border-color: rgba(204,138,33,.6);
    box-shadow: 0 0 0 3px rgba(239,178,58,.2);
}
input:hover:not(:focus), select:hover:not(:focus) { border-color: rgba(16,49,72,.22); }
:root[data-theme="dark"] input,
:root[data-theme="dark"] select,
:root[data-theme="dark"] textarea { background: var(--surface-3); }

/* ─── TOOLBAR / FILTER ROW ───────────────────────────────────── */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    align-items: center;
}
.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    align-items: center;
    margin-bottom: .75rem;
}
.filter-row input[type="search"] { flex: 1 1 200px; }
.filter-row select,
.filter-select {
    flex: 1 1 180px;
    min-width: 0;
    width: auto;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-xs);
    color: var(--text);
    font-size: .85rem;
    padding: .45rem .65rem;
    cursor: pointer;
}

.bvi-form-panel,
.supervisor-note-form {
    display: grid;
    gap: .9rem;
}

.bvi-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: .85rem;
}

.bvi-form-grid label,
.supervisor-note-form {
    color: var(--text);
}

.bvi-form-grid label span,
.supervisor-note-form label span {
    display: block;
    margin-bottom: .35rem;
    font-size: .82rem;
    color: var(--muted);
}

.bvi-form-grid input,
.bvi-form-grid select,
.supervisor-note-form textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    color: var(--text);
    padding: .8rem .9rem;
}

.supervisor-note-form textarea {
    min-height: 180px;
    resize: vertical;
    font: inherit;
}

.bvi-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: .75rem;
}

.bvi-section-caption {
    margin: 0 0 .9rem;
    color: var(--muted);
    font-size: .88rem;
}

.profile-bvi-meta {
    margin: .35rem 0 0;
    color: var(--feature-card-muted);
    font-size: 1rem;
}

.profile-bvi-head {
    display: flex;
    justify-content: flex-end;
    margin-bottom: .4rem;
}

.profile-bvi-note {
    margin-top: 1rem;
    max-width: 760px;
    padding: .95rem 1rem;
    background: var(--feature-card-subtle);
    border-radius: var(--radius);
    border: 1px solid var(--feature-card-soft-border);
}

.profile-bvi-note .eyebrow {
    margin-bottom: .45rem;
}

.profile-bvi-note-body {
    color: var(--feature-card-text);
    line-height: 1.55;
}

.profile-bvi-note small {
    display: block;
    margin-top: .55rem;
    color: var(--feature-card-muted);
}

.profile-bvi-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    margin-top: 1rem;
}

.profile-bvi-actions .ghost-btn[disabled] {
    opacity: .55;
    cursor: not-allowed;
}

/* ─── DASHBOARD GRID ─────────────────────────────────────────── */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: .85rem;
    align-items: start;
}
.chart-area {
    display: flex;
    flex-direction: column;
    gap: .6rem;
}
.dashboard-chart { min-height: 520px; position: relative; }
.viz-svg { width: 100%; height: 100%; display: block; }
.chart-empty {
    display: grid;
    place-items: center;
    min-height: 200px;
    color: var(--muted);
    font-size: .9rem;
    text-align: center;
}
.chart-empty.compact { min-height: 100px; }

/* Chart controls bar */
.chart-controls {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    align-items: center;
    padding: .55rem .7rem;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}
.chart-controls select { width: auto; flex: 0 0 auto; padding: .32rem .6rem; font-size: .82rem; }
.chart-controls input[type="search"] { flex: 1 1 160px; padding: .32rem .6rem; font-size: .82rem; }
.chart-controls .segmented { padding: .32rem .65rem; font-size: .82rem; }
.chart-controls select,
.chart-controls input[type="search"],
.chart-controls .segmented,
.chart-controls .switcher {
    min-height: 40px;
}
.ctrl-sep {
    width: 1px;
    height: 22px;
    background: var(--line);
    flex-shrink: 0;
}
.export-btn {
    margin-left: auto;
    background: var(--accent-bg);
    color: var(--accent-d);
    border: 1px solid rgba(239,178,58,.3);
    padding: .32rem .75rem;
    font-size: .8rem;
    font-weight: 700;
    border-radius: var(--radius-xs);
    cursor: pointer;
    white-space: nowrap;
    transition: background .14s;
}
.export-btn:hover { background: rgba(239,178,58,.22); }

/* ─── LEGEND ─────────────────────────────────────────────────── */
.legend-row {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    padding: .5rem 0 .1rem;
}
.legend-chip {
    display: inline-flex;
    align-items: center;
    gap: .38rem;
    padding: .28rem .6rem;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    color: var(--text-2);
    font-size: .75rem;
    font-weight: 600;
}
.legend-chip i {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.ring-swatch {
    display: inline-block;
    width: 20px;
    height: 6px;
    border-radius: 3px;
    flex-shrink: 0;
}
.suspicious-ring {
    background: #FF4444;
}
.achievement-ring {
    background: #FFD700;
}

/* ─── DASHBOARD SIDE PANEL ───────────────────────────────────── */
.sticky-panel { position: sticky; top: 1rem; }

/* ─── METRIC CARDS ───────────────────────────────────────────── */
.metric-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: .5rem;
}
.metric-card {
    padding: .65rem .75rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: var(--surface);
}
.metric-card span { display: block; font-size: .72rem; color: var(--muted); margin-bottom: .15rem; }
.metric-card strong {
    display: block;
    font-family: "Sora","Inter",sans-serif;
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--navy);
    letter-spacing: -.02em;
    line-height: 1.15;
}
:root[data-theme="dark"] .metric-card strong { color: var(--text); }

/* ─── HERO / PROFILE ─────────────────────────────────────────── */
.detail-hero {
    display: grid;
    grid-template-columns: 1fr 140px;
    gap: .8rem;
    align-items: center;
    margin-bottom: .85rem;
}
.hero-score {
    font-family: "Sora","Inter",sans-serif;
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--navy);
    letter-spacing: -.04em;
    line-height: 1;
    margin: 0 0 .2rem;
}
:root[data-theme="dark"] .hero-score { color: var(--text); }
.hero-caption { color: var(--muted); font-size: .8rem; margin: 0 0 .15rem; }
.hero-meta    { color: var(--muted); font-size: .75rem; margin: 0; }

/* ─── INFO GRID ──────────────────────────────────────────────── */
.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: .5rem;
    margin: 0 0 .85rem;
}
.info-grid div {
    padding: .55rem .7rem;
    border-radius: var(--radius-xs);
    border: 1px solid var(--line-soft);
    background: var(--surface-2);
}
dt { font-size: .72rem; font-weight: 700; color: var(--muted); margin-bottom: .18rem; }
dd { margin: 0; font-weight: 700; font-size: .9rem; color: var(--text); }

/* ─── BADGE ──────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .2rem .55rem;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 700;
    border: 1px solid transparent;
}
.badge.danger  { color: #7a2e2e; background: var(--danger-bg);  border-color: rgba(200,79,79,.2); }
.badge.accent  { color: #6b3e00; background: var(--accent-bg);  border-color: rgba(239,178,58,.3); }
:root[data-theme="dark"] .badge.danger { color: #f09090; }
:root[data-theme="dark"] .badge.accent { color: var(--accent); }
.badge-stack { display: flex; gap: .3rem; flex-wrap: wrap; }

/* ─── DATA TABLE ─────────────────────────────────────────────── */
.table-wrap {
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}
.data-table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
    font-size: .875rem;
}
.data-table th {
    padding: .65rem .8rem;
    background: var(--surface-2);
    color: var(--text-2);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
    text-align: left;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
.data-table td {
    padding: .7rem .8rem;
    border-bottom: 1px solid var(--line-soft);
    vertical-align: middle;
}
.data-table tbody tr { cursor: pointer; transition: background .12s; }
.data-table tbody tr:hover { background: var(--accent-bg); }
.data-table tbody tr:last-child td { border-bottom: none; }
.subtle-line { color: var(--muted); font-size: .72rem; margin-top: .1rem; }

/* Score pill in table */
.score-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    padding: .18rem .55rem;
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 800;
    border: 1.5px solid currentColor;
}
.score-pill.elite    { color: #334155; background: #ffffff; border-color: #cbd5e1; }
.score-pill.strong   { color: #223047; background: #e9eef5; border-color: #9fafc2; }
.score-pill.stable   { color: #5a9cf8; background: rgba(52,120,246,.14); }
.score-pill.risk     { color: #ef7f7f; background: rgba(216,92,74,.14); }
.score-pill.critical { color: #efb23a; background: rgba(215,167,40,.14); }
:root[data-theme="dark"] .score-pill.elite    { color: #f4f4f4; background: rgba(244,244,244,.12); border-color: currentColor; }
:root[data-theme="dark"] .score-pill.strong   { color: #dceaf6; background: rgba(46,52,66,.28); border-color: currentColor; }

/* ─── PROFILE LAYOUT ─────────────────────────────────────────── */
.profile-layout {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: .85rem;
    align-items: start;
}
.profile-summary { position: sticky; top: 1rem; }

/* ─── TASK CARDS ─────────────────────────────────────────────── */
.task-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: .85rem;
}
.task-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: .6rem;
    margin-bottom: .7rem;
}
.task-card-header h3 { font-size: 1.1rem; }
.review-score {
    padding: .25rem .65rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface-2);
    font-weight: 800;
    font-size: .8rem;
    white-space: nowrap;
    color: var(--text-2);
}
.reviewers-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .6rem;
    margin-bottom: .7rem;
}
.reviewers-grid h4 { font-size: .75rem; margin-bottom: .15rem; }
.task-comment { color: var(--muted); font-size: .8rem; margin: 0; }
.answer-box {
    margin: .4rem 0;
    white-space: pre-wrap;
    font-size: .8rem;
    background: var(--surface-2);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-xs);
    padding: .65rem .75rem;
    color: var(--text-2);
    min-height: 52px;
}
.attachment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: .5rem;
}
.attachment-card {
    display: grid;
    gap: .35rem;
    padding: .5rem;
    border-radius: var(--radius-xs);
    border: 1px solid var(--line-soft);
    background: var(--surface-2);
}
.attachment-card img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    border-radius: 5px;
}

/* ─── UPLOAD ─────────────────────────────────────────────────── */
.upload-form {
    display: flex;
    gap: .5rem;
    align-items: center;
    flex-wrap: wrap;
    margin-top: .6rem;
}
.file-field {
    display: flex;
    align-items: center;
    gap: .5rem;
    border: 1px solid var(--line);
    background: var(--surface-2);
    border-radius: var(--radius-xs);
    padding: .4rem .65rem;
    flex: 1;
}
.file-field input { display: none; }
.file-field-button {
    display: inline-flex;
    align-items: center;
    padding: .25rem .6rem;
    border-radius: 5px;
    background: var(--surface-3);
    border: 1px solid var(--line);
    font-size: .78rem;
    font-weight: 700;
    color: var(--text-2);
    cursor: pointer;
    white-space: nowrap;
}
.file-field-name { color: var(--muted); font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ─── TASK MINI / PILLS ──────────────────────────────────────── */
.task-mini-list { display: grid; gap: .4rem; margin-bottom: .75rem; }
.task-pill {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .45rem .7rem;
    border-radius: var(--radius-xs);
    border: 1px solid var(--line-soft);
    background: var(--surface-2);
    font-size: .82rem;
    cursor: pointer;
    transition: background .13s;
    text-align: left;
    color: var(--text);
}
.task-pill:hover { background: var(--accent-bg); }
.task-pill > span:first-child { color: var(--text-2); }
.task-pill strong { font-weight: 700; font-size: .85rem; }

/* ─── SETTINGS ───────────────────────────────────────────────── */
.settings-layout {
    display: grid;
    grid-template-columns: minmax(420px, 1.2fr) minmax(320px, .8fr);
    grid-template-areas:
        "import general"
        "tasks criteria";
    gap: 1.1rem;
    align-items: stretch;
}
.settings-import-panel { grid-area: import; }
.settings-general-panel { grid-area: general; }
.settings-tasks-panel { grid-area: tasks; }
.settings-criteria-panel { grid-area: criteria; }
.settings-list, .stack-form { display: grid; gap: 1rem; }
.stack-form label { display: grid; gap: .45rem; font-size: .875rem; color: var(--text-2); font-weight: 600; }
.settings-inline-btn {
    width: fit-content;
    height: 40px;
    padding: 0 1rem;
}
.settings-general-label {
    display: grid;
    gap: .38rem;
    margin-top: .1rem;
}
.settings-general-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: .55rem;
}
.settings-number-input {
    width: 100%;
    height: 40px;
    padding: 0 .75rem;
    text-align: center;
}
.settings-import-result { margin-top: .5rem; }
.settings-file-button { cursor: pointer; }
.settings-import-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: .55rem;
}
.settings-import-submit {
    height: 40px;
    padding: 0 1rem;
}
.settings-hero {
    background: linear-gradient(135deg, rgba(239,178,58,.1), rgba(15,76,92,.07));
    border-color: var(--line-soft);
    padding: .5rem .8rem;
    width: 100%;
    justify-self: stretch;
}
.settings-hero-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    flex-wrap: wrap;
}
.settings-hero-copy-wrap {
    flex: 1 1 60ch;
    min-width: 240px;
}
.settings-hero-title {
    font-size: .96rem;
    margin-bottom: .12rem;
}
.settings-hero-copy {
    margin: 0;
    font-size: .78rem;
    line-height: 1.32;
    color: var(--muted);
}
.settings-hero-btn {
    flex-shrink: 0;
    font-size: .82rem;
    padding: .44rem .9rem;
    height: 36px;
}
.settings-hero-result {
    margin-top: .5rem;
    border-color: rgba(43,156,111,.35);
    background: var(--success-bg);
    color: var(--success);
    font-weight: 600;
}
.task-settings-row {
    display: grid;
    grid-template-columns: 56px 1fr 92px auto;
    gap: .75rem;
    align-items: center;
    padding: .45rem .55rem;
    border-radius: var(--radius-xs);
    border: 1px solid transparent;
    background: var(--surface-2);
}
.task-settings-row:hover { border-color: var(--line-soft); }
.task-settings-index {
    font-size: .82rem;
    color: var(--text-2);
    justify-self: center;
    white-space: nowrap;
}
.task-settings-score { text-align: center; }
.task-settings-save { min-width: 88px; }
.criterion-create-form {
    display: grid;
    grid-template-columns: 1fr 96px auto;
    gap: .75rem;
    margin-bottom: .9rem;
    align-items: end;
}
.criterion-create-label {
    font-size: .875rem;
    font-weight: 600;
    display: grid;
    gap: .45rem;
}
.criterion-create-label-score { width: 100%; }
.criterion-create-submit {
    white-space: nowrap;
    height: 38px;
}
.criterion-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: .75rem;
    padding: .85rem 1rem;
    border-radius: var(--radius-xs);
    border: 1px solid var(--line-soft);
    background: var(--surface-2);
    align-items: center;
}
.criterion-fields {
    display: grid;
    grid-template-columns: 1fr 80px 70px;
    gap: .65rem;
}
.criterion-actions { display: flex; gap: .5rem; }
#criterion-create-form {
    align-items: end;
}
.criterion-empty {
    color: var(--muted);
    font-size: .85rem;
    padding: .4rem 0;
    margin: 0;
}

/* ─── RESULT BOX ─────────────────────────────────────────────── */
.result-box {
    padding: .7rem .8rem;
    border-radius: var(--radius-xs);
    border: 1px solid var(--line-soft);
    background: var(--surface-2);
    font-size: .82rem;
    min-height: 48px;
    color: var(--text-2);
}

/* ─── TASK SUMMARY (tasks page) ──────────────────────────────── */
.task-summary-list { display: grid; gap: .5rem; }
.task-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .8rem;
    padding: .7rem .8rem;
    border-radius: var(--radius-xs);
    border: 1px solid var(--line-soft);
    background: var(--surface-2);
}
.task-summary-row h3 { font-size: .9rem; }
.summary-actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.summary-chip {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .3rem .65rem;
    border-radius: 999px;
    background: var(--surface-3);
    border: 1px solid var(--line);
    color: var(--text-2);
    font-size: .78rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .13s, color .13s;
}
.summary-chip:hover { background: var(--accent-bg); color: var(--accent-d); }

/* ─── TASKS PAGE 2026 LAYOUT ───────────────────────────────── */
.tasks-page,
.profile-page {
    display: grid;
    gap: 1.25rem;
}

.tasks-page-header,
.profile-page-header {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 1rem;
}

.tasks-page-header h2,
.profile-page-header h2 {
    font-size: clamp(2rem, 3vw, 3rem);
    color: var(--feature-card-text);
    letter-spacing: -.04em;
}

.tasks-summary-card,
.profile-hero-card,
.profile-task-card {
    position: relative;
    overflow: hidden;
    background: var(--feature-card-bg);
    border: 1px solid var(--feature-card-border);
    border-radius: var(--radius);
    box-shadow: var(--feature-card-shadow);
}

.tasks-summary-card {
    padding: 1.45rem 1.5rem;
}

.tasks-summary-section {
    display: grid;
    gap: .7rem;
}

.tasks-summary-section-title {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
}

.tasks-summary-section-title h3 {
    color: var(--feature-card-text);
    font-size: 1.2rem;
}

.task-summary-card-row {
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr);
    gap: 1.5rem;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid var(--feature-card-soft-border);
}

.task-count-summary-row {
    grid-template-columns: 260px minmax(0, 1fr);
}

.task-summary-card-row:first-child { padding-top: .45rem; }
.task-summary-card-row:last-child {
    padding-bottom: .2rem;
    border-bottom: none;
}

.task-summary-copy h3,
.profile-task-heading h3,
.profile-hero-copy h3 {
    color: var(--feature-card-text);
}

.task-summary-copy h3 {
    font-size: 1.15rem;
    margin-bottom: .2rem;
}

.task-summary-copy p:last-child {
    margin: 0;
    color: var(--feature-card-muted);
    font-size: .92rem;
}

.task-summary-bars {
    display: grid;
    gap: .55rem;
}

.task-summary-progress {
    display: flex;
    height: 14px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--feature-progress-track);
}

.task-progress-segment.complete { background: var(--feature-progress-complete); }
.task-progress-segment.partial { background: var(--feature-progress-partial); }
.task-progress-segment.zero { background: var(--feature-progress-zero); }

.task-summary-chips {
    display: flex;
    flex-wrap: wrap;
    gap: .55rem;
}

.task-summary-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 999px;
    padding: .44rem 1rem;
    font-size: .86rem;
    cursor: pointer;
    transition: transform .14s ease, filter .14s ease;
}

.task-summary-chip:hover {
    transform: translateY(-1px);
    filter: brightness(1.08);
}

.task-summary-chip.complete {
    color: var(--feature-chip-complete-text);
    background: var(--feature-chip-complete-bg);
}

.task-summary-chip.partial {
    color: var(--feature-chip-partial-text);
    background: var(--feature-chip-partial-bg);
}

.task-summary-chip.zero {
    color: var(--feature-chip-zero-text);
    background: var(--feature-chip-zero-bg);
}

.task-catalog-panel {
    padding: 1.35rem 1.4rem;
}

.task-catalog-list,
.task-reference-list {
    display: grid;
    gap: 1rem;
}

.task-catalog-card,
.task-reference-card {
    display: grid;
    gap: .85rem;
    padding: 1rem 1.05rem;
    border-radius: var(--radius);
    border: 1px solid var(--line-soft);
    background: var(--surface-2);
}

.task-catalog-head,
.task-reference-head {
    display: flex;
    justify-content: space-between;
    gap: .8rem;
    align-items: flex-start;
}

.task-catalog-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    justify-content: flex-end;
}

.task-catalog-form {
    display: grid;
    gap: .8rem;
}

.task-catalog-form label {
    display: grid;
    gap: .35rem;
}

.task-catalog-form textarea {
    min-height: 180px;
    resize: vertical;
}

.task-catalog-readonly,
.rich-text-block {
    color: var(--text);
    white-space: normal;
    line-height: 1.55;
}

.profile-back-link {
    color: var(--feature-card-muted);
    font-size: .9rem;
}

.profile-header-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: .75rem;
}

.profile-back-link:hover { color: var(--feature-card-text); }

.profile-hero-card {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) auto;
    gap: 1rem;
    padding: 1.35rem 1.45rem;
}

.profile-hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: .65rem;
    margin: .95rem 0 .8rem;
}

.profile-hero-pill-detail {
    justify-content: flex-start;
    min-width: 180px;
}

.profile-hero-pill-gender {
    min-width: 140px;
}

.profile-detail-grid {
    display: grid;
    grid-template-columns: 360px minmax(280px, 360px);
    grid-template-areas:
        "metrics achievement"
        "note note";
    gap: .8rem;
    align-items: start;
    margin-top: .85rem;
}

.profile-side-card {
    padding: .95rem 1rem;
    background: var(--feature-card-subtle);
    border: 1px solid var(--feature-card-soft-border);
    border-radius: var(--radius);
}

.profile-side-card .eyebrow {
    margin-bottom: .45rem;
}

.profile-side-card-body {
    min-height: 48px;
    color: var(--feature-card-text);
    line-height: 1.55;
    white-space: pre-wrap;
}

.profile-achievement-card .profile-side-card-body {
    min-height: 72px;
}

.profile-note-card-footer {
    margin-top: .8rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
}

.profile-note-card-footer small,
.profile-side-card small {
    color: var(--feature-card-muted);
}

.profile-detail-grid .profile-metrics-grid {
    grid-area: metrics;
}

.profile-detail-grid .profile-achievement-card {
    grid-area: achievement;
    height: 100%;
    box-sizing: border-box;
    display: grid;
    align-content: start;
}

.profile-note-card-wide {
    grid-area: note;
    margin-top: .2rem;
}

.profile-hero-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0 1rem;
    border-radius: 999px;
    background: var(--feature-card-subtle);
    color: var(--feature-card-text);
    font-size: .88rem;
    white-space: nowrap;
}

.profile-hero-pill.wide {
    min-width: 224px;
    justify-content: flex-start;
}

.profile-hero-pill.accent {
    background: var(--feature-chip-partial-bg);
    color: var(--feature-chip-partial-text);
}

.profile-hero-pill.danger {
    background: var(--feature-chip-zero-bg);
    color: var(--feature-chip-zero-text);
}

.profile-metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .6rem;
}

.profile-metric-pill,
.profile-merit-card {
    background: var(--feature-card-subtle);
    border-radius: var(--radius);
    padding: .8rem .95rem;
}

.profile-metric-pill span,
.profile-merit-card span,
.profile-merit-card small,
.profile-reviewer-note,
.profile-answer-box,
.profile-attachment-tile span {
    color: var(--feature-card-muted);
}

.profile-metric-pill span {
    display: block;
    margin-bottom: .18rem;
    font-size: .82rem;
}

.profile-metric-pill strong,
.profile-merit-card strong,
.profile-reviewer-grid h4,
.profile-answer-block h4,
.profile-task-heading h3,
.profile-task-meta p,
.profile-task-meta h4 {
    color: var(--feature-card-text);
}

.profile-metric-pill strong {
    font-size: 1.5rem;
}

.profile-merit-card {
    display: grid;
    gap: .2rem;
    margin-top: .8rem;
    max-width: 360px;
}

.profile-merit-card strong {
    font-size: 1.05rem;
}

.profile-merit-card small {
    font-size: .8rem;
}

.profile-page .profile-page-header:has(.profile-back-link:only-child) {
    justify-content: flex-end;
}

@media (max-width: 760px) {
    .profile-hero-pill-city {
        grid-column: auto;
    }

    .profile-detail-grid {
        grid-template-columns: 1fr;
        grid-template-areas:
            "metrics"
            "achievement"
            "note";
    }

    .profile-note-card-footer {
        align-items: stretch;
    }

    .profile-note-card-footer .primary-btn,
    .profile-note-card-footer .ghost-btn {
        width: 100%;
    }
}

.profile-ring-strip {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.score-ring-card {
    display: grid;
    justify-items: center;
    gap: .55rem;
}

.score-ring-card span {
    color: var(--feature-card-muted);
    font-size: .82rem;
}

.score-ring {
    --ring-progress: 0%;
    width: 176px;
    height: 176px;
    position: relative;
    display: grid;
    place-items: center;
    border-radius: 50%;
    isolation: isolate;
}

.score-ring::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background:
        conic-gradient(
            var(--score-ring-progress) 0 var(--ring-progress),
            var(--score-ring-progress-soft) var(--ring-progress) 100%
        );
    box-shadow:
        inset 0 0 0 1px rgba(255,255,255,.18),
        0 16px 32px var(--score-ring-progress-shadow);
}

.score-ring-inner {
    position: absolute;
    inset: 14px;
    border-radius: 50%;
    background: var(--score-ring-inner-bg);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.42),
        0 10px 22px rgba(84, 64, 34, 0.08);
}

.score-ring-content {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: grid;
    place-items: center;
    align-content: center;
    color: var(--score-ring-inner-text);
    font-family: "Sora","Inter",sans-serif;
    text-align: center;
    gap: .4rem;
}

.score-ring-content strong {
    font-size: 2.65rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -.04em;
}

.score-ring-content small {
    color: var(--score-ring-inner-muted);
    font-size: .82rem;
    font-weight: 600;
    line-height: 1;
}

.profile-task-stack {
    display: grid;
    gap: 1.25rem;
}

.profile-task-card {
    display: grid;
    grid-template-columns: 290px minmax(0, 1fr);
    gap: 1.25rem;
    padding: 1.2rem;
}

.profile-task-meta {
    display: grid;
    align-content: start;
    gap: .9rem;
}

.profile-task-heading {
    display: flex;
    align-items: start;
    justify-content: flex-start;
    gap: .75rem;
}

.profile-task-heading h3 {
    font-size: 2.1rem;
    letter-spacing: -.04em;
}

.profile-reviewer-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .9rem;
}

.profile-reviewer-grid h4,
.profile-task-statement-block h4,
.profile-answer-block h4 {
    margin: 0 0 .2rem;
    font-size: .98rem;
}

.profile-reviewer-grid p {
    margin: 0;
}

.profile-reviewer-note {
    margin-top: .18rem;
    font-size: .88rem;
    line-height: 1.4;
}

.profile-task-statement-block,
.profile-answer-block {
    display: grid;
    gap: .45rem;
}

.profile-task-statement-box,
.profile-answer-box {
    margin: 0;
    padding: 1rem;
    border: none;
    border-radius: var(--radius);
    background: var(--feature-card-soft);
    font-size: .9rem;
    line-height: 1.5;
}

.profile-task-statement-box {
    min-height: 92px;
    color: var(--text);
    white-space: pre-wrap;
}

.profile-answer-box {
    min-height: 148px;
    white-space: pre-wrap;
    line-height: 1.45;
}

.profile-attachment-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.profile-attachment-tile {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 320px;
    border-radius: var(--radius);
    background: var(--feature-card-soft);
    overflow: hidden;
}

.profile-attachment-tile {
    width: 100%;
    padding: 0;
    border: 1px solid var(--feature-card-soft-border);
    cursor: zoom-in;
    appearance: none;
    user-select: none;
    -webkit-user-drag: none;
}

.profile-attachment-tile:focus-visible {
    outline: 2px solid rgba(130, 190, 255, .9);
    outline-offset: 3px;
}

.profile-attachment-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}


/* ─── MODAL ──────────────────────────────────────────────────── */
.list-modal {
    border: none;
    background: transparent;
    padding: 1rem;
    width: min(580px, 100%);
}
.list-modal::backdrop { background: rgba(8,24,38,.5); backdrop-filter: blur(3px); }
.modal-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1rem;
    box-shadow: var(--shadow);
    width: 100%;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: .8rem;
    margin-bottom: .85rem;
}
.modal-header h3 { font-size: 1rem; }
.modal-body { max-height: 66vh; overflow-y: auto; }
.modal-list { display: grid; gap: .4rem; }
.modal-link {
    display: flex;
    justify-content: space-between;
    gap: .8rem;
    padding: .65rem .8rem;
    border-radius: var(--radius-xs);
    border: 1px solid var(--line-soft);
    background: var(--surface-2);
    cursor: pointer;
    font-size: .875rem;
    transition: background .12s;
}
.modal-link:hover { background: var(--accent-bg); }

.attachment-viewer-modal {
    border: none;
    background: transparent;
    padding: 1rem;
    width: min(1120px, 100%);
}

.attachment-viewer-modal::backdrop {
    background: rgba(2, 10, 16, .84);
    backdrop-filter: blur(8px);
}

.attachment-viewer-card {
    display: grid;
    gap: 1rem;
    background: rgba(6, 18, 28, .96);
    border: 1px solid rgba(118, 152, 180, .18);
    border-radius: 24px;
    padding: 1rem;
    box-shadow: 0 30px 70px rgba(0, 0, 0, .35);
}

.attachment-viewer-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.attachment-viewer-actions {
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
}

.attachment-viewer-stage {
    position: relative;
    min-height: min(72vh, 820px);
    border-radius: 20px;
    border: 1px solid rgba(118, 152, 180, .12);
    background:
        radial-gradient(circle at top, rgba(130, 190, 255, .1), transparent 34%),
        linear-gradient(180deg, rgba(7, 18, 27, .94), rgba(5, 13, 20, .98));
    overflow: hidden;
    display: grid;
    place-items: center;
    user-select: none;
    align-content: stretch;
}

.attachment-viewer-placeholder {
    color: rgba(228, 237, 245, .84);
    font-size: .95rem;
    text-align: center;
}

.attachment-viewer-toolbar {
    position: absolute;
    top: 1rem;
    left: 1rem;
    right: 1rem;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    pointer-events: none;
}

.attachment-viewer-zoom-controls {
    display: inline-flex;
    gap: .5rem;
    pointer-events: auto;
}

.attachment-viewer-zoom-btn {
    min-width: 64px;
    padding-inline: .85rem;
    border-radius: 999px;
    background: rgba(6, 18, 28, .84);
}

.attachment-viewer-hint {
    padding: .45rem .8rem;
    border-radius: 999px;
    background: rgba(6, 18, 28, .74);
    color: rgba(228, 237, 245, .78);
    font-size: .78rem;
    text-align: right;
}

.attachment-viewer-frame {
    position: relative;
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    padding: 4rem 1rem 1rem;
    user-select: none;
    cursor: zoom-in;
}

.attachment-viewer-frame::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg, rgba(255,255,255,.05), transparent 30%),
        radial-gradient(circle at bottom right, rgba(130, 190, 255, .08), transparent 35%);
    pointer-events: none;
}

.attachment-viewer-image {
    position: relative;
    max-width: 100%;
    max-height: min(68vh, 760px);
    border-radius: 16px;
    box-shadow: 0 18px 48px rgba(0, 0, 0, .4);
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
    transform-origin: center center;
    transition: transform .14s ease-out;
    will-change: transform;
}

.attachment-viewer-frame.is-zoomed {
    cursor: grab;
}

.attachment-viewer-frame.is-zoomed:active {
    cursor: grabbing;
}

/* ─── SWITCHER ───────────────────────────────────────────────── */
.switcher {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .38rem .65rem;
    border-radius: var(--radius-xs);
    border: 1px solid var(--line);
    background: var(--surface-2);
    font-weight: 700;
    font-size: .82rem;
    color: var(--text-2);
    cursor: pointer;
}
.switcher input[type="checkbox"] { width: 15px; height: 15px; margin: 0; padding: 0; cursor: pointer; }

/* ─── DONUT CHART LABELS ─────────────────────────────────────── */
.donut-score {
    font-family: "Sora","Inter",sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    fill: var(--text);
}
.donut-label { font-size: .75rem; fill: var(--muted); }
.target-date-label { font-size: 11px; font-weight: 700; fill: var(--muted); }
.profile-donut, .mini-donut { min-height: 200px; display: flex; align-items: center; justify-content: center; }

/* ─── EMPTY STATE ─────────────────────────────────────────────── */
.empty-state {
    display: grid;
    place-items: center;
    min-height: 180px;
    text-align: center;
    color: var(--muted);
    padding: 2rem;
}
.empty-state h3 { font-size: 1rem; margin-bottom: .4rem; }
.empty-state p  { font-size: .85rem; margin: 0; }

/* ─── LOGIN ──────────────────────────────────────────────────── */
.login-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    overflow-y: auto;
    background: var(--bg-page);
    display: grid;
    place-items: center;
    padding: 2rem;
}
.login-card {
    width: min(920px, 100%);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    overflow: hidden;
}
.login-intro {
    padding: 2.5rem 2.5rem 2.5rem;
    background: linear-gradient(160deg,
        rgba(239,178,58,.1) 0%,
        rgba(15,76,92,.08) 100%);
    border-right: 1px solid var(--line-soft);
}
.login-intro h1 { font-size: clamp(2rem,4vw,3.2rem); margin-bottom: .75rem; }
.login-copy { color: var(--muted); font-size: .9rem; line-height: 1.7; max-width: 30rem; }
.login-form { padding: 2.5rem; display: grid; gap: .85rem; align-content: start; }
.login-form label { display: grid; gap: .3rem; font-size: .82rem; font-weight: 600; color: var(--text-2); }
.form-error { color: var(--danger); font-size: .8rem; margin: 0; }

.compact-empty {
    min-height: 120px;
    padding: 1.2rem;
}

.inline-empty {
    margin-top: 1rem;
}

.interview-workspace-stack {
    display: grid;
    gap: 1rem;
    align-content: start;
}

.tab-bar {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
    align-items: flex-start;
    align-self: start;
}
.tab-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: .45rem .8rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-xs);
    background: var(--surface-2);
    color: var(--text-2);
    font-size: .84rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .14s, color .14s, border-color .14s;
}
.tab-btn:hover {
    background: var(--sidebar-hover-bg);
    color: var(--text);
}
.tab-btn.active {
    background: var(--navy);
    border-color: var(--navy);
    color: #fff;
}
:root[data-theme="dark"] .tab-btn.active {
    background: var(--navy-2);
    color: var(--bg-page);
}

.interviews-layout {
    display: grid;
    grid-template-columns: 340px minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
    align-content: start;
}

.examiner-layout {
    grid-template-columns: 320px minmax(0, 1fr);
}

.interviews-sidebar {
    display: grid;
    gap: .9rem;
    position: sticky;
    top: 0;
}

.interview-filter-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .6rem;
}

.interview-filter-row.single-filter {
    grid-template-columns: 1fr;
}

.interview-card-list,
.interview-history-list,
.interview-score-table,
.interview-score-inputs {
    display: grid;
    gap: .75rem;
}

.interview-card {
    width: 100%;
    text-align: left;
    display: grid;
    gap: .55rem;
    padding: .9rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: var(--surface-2);
    cursor: pointer;
    transition: transform .14s, border-color .14s, box-shadow .14s;
}

.interview-card:hover {
    transform: translateY(-1px);
    border-color: rgba(204,138,33,.35);
    box-shadow: var(--shadow-sm);
}

.interview-card.active {
    background: var(--accent-bg);
    border-color: rgba(204,138,33,.45);
}

.interview-card-head,
.interview-history-head,
.interview-editor-head,
.interview-action-row,
.interview-score-row {
    display: flex;
    justify-content: space-between;
    gap: .8rem;
    align-items: flex-start;
}

.interview-card-head strong,
.interview-history-head h3,
.interview-editor-head h2 {
    font-size: 1rem;
}

.interview-card-head span,
.interview-card-date,
.interview-card-meta,
.interview-history-meta,
.interview-score-row span,
.interview-note,
.interview-editor-head p,
.interview-examiner-option small {
    color: var(--muted);
}

.interview-card-meta,
.interview-history-meta,
.interview-examiner-chips,
.interview-history-examiners {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.interview-card-meta-secondary {
    justify-content: space-between;
    color: var(--muted);
    font-size: .85rem;
}

.interview-progress {
    height: 6px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(31,35,42,.08);
}

.interview-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, rgba(204,138,33,.55), rgba(204,138,33,.92));
}

.interview-editor {
    display: grid;
    gap: 1rem;
}

.interview-editor-status {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.interview-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .75rem;
}

.interview-summary-grid article {
    display: grid;
    gap: .2rem;
    padding: .9rem 1rem;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    border: 1px solid var(--line-soft);
}

.interview-summary-grid span {
    color: var(--muted);
    font-size: .78rem;
}

.interview-summary-grid strong {
    font-size: .98rem;
}

.interview-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .8rem;
}

.interview-editor label,
.interview-score-field {
    display: grid;
    gap: .35rem;
}

.interview-editor textarea {
    min-height: 108px;
    resize: vertical;
}

.interview-event-log {
    display: grid;
    gap: .85rem;
    margin-top: .25rem;
    padding-top: .3rem;
    border-top: 1px solid var(--line-soft);
}

.interview-event-list {
    display: grid;
    gap: .75rem;
}

.interview-event-card {
    display: grid;
    gap: .55rem;
    padding: .9rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line-soft);
    background: var(--surface-2);
}

.interview-event-head {
    display: flex;
    justify-content: space-between;
    gap: .8rem;
    align-items: flex-start;
}

.interview-event-head p {
    margin: .2rem 0 0;
    color: var(--muted);
    font-size: .88rem;
}

.interview-event-payload {
    display: grid;
    gap: .35rem;
}

.interview-event-payload-row {
    display: flex;
    justify-content: space-between;
    gap: .8rem;
    align-items: flex-start;
    font-size: .9rem;
}

.interview-event-payload-row span {
    color: var(--muted);
}

.interview-examiners-fieldset {
    margin: 0;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    display: grid;
    gap: .8rem;
}

.interview-examiners-fieldset legend {
    padding: 0 .35rem;
    font-weight: 700;
}

.interview-examiner-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: .7rem;
}

.interview-examiner-option {
    display: grid;
    gap: .2rem;
    padding: .8rem .9rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: var(--surface-2);
}

.interview-examiner-option input {
    width: auto;
    margin: 0 0 .25rem;
}

.interview-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
    align-items: center;
}

.interview-score-progress {
    display: flex;
    justify-content: space-between;
    gap: .8rem;
    align-items: center;
    padding: .85rem 1rem;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
}

.interview-score-progress strong {
    display: block;
    font-size: 1rem;
}

.interview-score-progress span:not(.status-badge) {
    color: var(--muted);
    font-size: .9rem;
}

.interview-inline-hint {
    margin: 0;
    color: var(--muted);
    font-size: .9rem;
}

.interview-score-summary h3 {
    margin: 0 0 .7rem;
    font-size: 1rem;
}

.interview-score-row,
.interview-history-card {
    padding: .9rem 1rem;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    border: 1px solid var(--line-soft);
}

.interview-score-row-right {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.interview-score-field {
    padding: .95rem 1rem;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    border: 1px solid var(--line-soft);
}

.interview-score-field-head {
    display: flex;
    justify-content: space-between;
    gap: .6rem;
    align-items: flex-start;
}

.interview-score-options,
.interview-history-comments {
    display: grid;
    gap: .55rem;
}

.interview-score-option {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: .6rem;
    align-items: center;
    padding: .7rem .8rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: var(--surface-3);
}

.interview-score-option.selected {
    border-color: rgba(204,138,33,.55);
    background: var(--accent-bg);
}

.interview-score-option input {
    width: auto;
    margin: 0;
}

.interview-score-manual label {
    display: grid;
    gap: .35rem;
}

.interview-score-manual input {
    width: 100%;
}

.interview-score-presets {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.interview-score-field textarea {
    min-height: 84px;
    resize: vertical;
}

.interview-score-field small {
    color: var(--muted);
}

.interview-score-comment,
.interview-history-comment p {
    margin: .35rem 0 0;
    color: var(--muted);
    line-height: 1.45;
}

.interview-history-comment {
    padding: .8rem .9rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line-soft);
    background: var(--surface-3);
}

.interview-history-comment span {
    display: block;
    margin-top: .15rem;
    color: var(--muted);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .35rem .7rem;
    border-radius: 999px;
    font-size: .76rem;
    font-weight: 700;
    white-space: nowrap;
    background: var(--surface-3);
    color: var(--text-2);
}

.status-badge.success {
    background: var(--success-bg);
    color: var(--success);
}

.status-badge.danger {
    background: var(--danger-bg);
    color: var(--danger);
}

.status-badge.accent {
    background: var(--accent-bg);
    color: var(--accent-d);
}

.status-badge.muted {
    background: var(--surface-3);
    color: var(--muted);
}

.interview-history-card {
    display: grid;
    gap: .7rem;
}

.interview-history-actions {
    display: flex;
    justify-content: flex-start;
}

.interview-note {
    margin: 0;
    line-height: 1.5;
}

.standalone-note {
    padding: .85rem 1rem;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    border: 1px solid var(--line-soft);
}

.interview-days-layout {
    grid-template-columns: 360px minmax(0, 1fr);
}

.interview-day-create-form,
.interview-day-detail-form,
.interview-day-queue-block,
.rating-workspace {
    display: grid;
    gap: .85rem;
}

.interview-day-hint {
    display: flex;
    align-items: center;
    padding: .9rem 1rem;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    border: 1px dashed var(--line);
    color: var(--muted);
}

.day-queue-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-sm);
}

.day-queue-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 960px;
}

.day-queue-table th,
.day-queue-table td {
    padding: .85rem .75rem;
    border-bottom: 1px solid var(--line-soft);
    text-align: left;
    vertical-align: top;
}

.day-queue-table th {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
    background: var(--surface-2);
}

.day-queue-table tbody tr:last-child td {
    border-bottom: none;
}

.day-queue-position,
.day-queue-person,
.day-queue-status,
.queue-timer {
    display: grid;
    gap: .2rem;
}

.day-queue-position small,
.day-queue-person small,
.day-queue-status small,
.queue-timer small {
    color: var(--muted);
}

.link-btn {
    padding: 0;
    border: none;
    background: none;
    color: var(--navy-2);
    font-weight: 700;
    text-align: left;
    cursor: pointer;
}

.link-btn:hover {
    color: var(--accent-d);
}

.table-flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.table-flag input,
.appeal-flag-stack input {
    width: auto;
    margin: 0;
}

.appeal-flag-stack {
    display: grid;
    gap: .35rem;
}

.appeal-flag-stack label {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    color: var(--text-2);
}

.queue-timer strong {
    color: var(--text);
}

.queue-timer.danger strong {
    color: var(--danger);
}

.day-queue-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
}

.rating-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .75rem;
}

.rating-summary-grid article {
    display: grid;
    gap: .2rem;
    padding: .9rem 1rem;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    border: 1px solid var(--line-soft);
}

.rating-summary-grid span {
    color: var(--muted);
    font-size: .78rem;
}

.rating-threshold-row td {
    background: rgba(199, 108, 98, 0.08);
    color: var(--danger);
    font-weight: 700;
}

.below-threshold td {
    background: rgba(199, 108, 98, 0.06);
}

/* ─── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 1200px) {
    .dashboard-grid, .profile-layout { grid-template-columns: 1fr; }
    .profile-hero-card,
    .profile-task-card,
    .task-summary-card-row { grid-template-columns: 1fr; }
    .interview-days-layout,
    .interviews-layout,
    .examiner-layout,
    .rating-summary-grid,
    .interview-summary-grid,
    .interview-form-grid { grid-template-columns: 1fr; }
    .profile-ring-strip { justify-content: flex-start; flex-wrap: wrap; }
    .settings-layout {
        grid-template-columns: 1fr;
        grid-template-areas:
            "import"
            "general"
            "tasks"
            "criteria";
    }
    .settings-import-panel,
    .settings-general-panel { padding: .85rem; }
    .settings-hero { width: 100%; }
    .profile-summary { position: static; }
    .task-grid { grid-template-columns: 1fr; }
    .metric-row { grid-template-columns: repeat(2, 1fr); }
    .task-catalog-head,
    .task-reference-head,
    .interview-event-head,
    .interview-event-payload-row { flex-direction: column; }
}
@media (max-width: 900px) {
    .app-shell { grid-template-columns: 1fr; }
    .tasks-page-header,
    .profile-page-header { align-items: start; flex-direction: column; }
    .tasks-summary-section-title {
        align-items: start;
        flex-direction: column;
    }
    .tasks-page-header h2,
    .profile-page-header h2 { font-size: 1.8rem; }
    .profile-hero-pill.wide { min-width: 0; width: 100%; }
    .profile-attachment-grid { grid-template-columns: 1fr; }
    .profile-attachment-tile { min-height: 240px; }
    .sidebar-shell {
        position: static;
        height: auto;
        width: 100%;
        max-width: 100%;
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        align-items: center;
        padding: .5rem .7rem;
        gap: .5rem;
        overflow: hidden;
    }
    .sidebar-brand { padding: .3rem .4rem; border-bottom: none; border-right: 1px solid var(--sidebar-border); }
    .sidebar-brand .eyebrow { display: none; }
    .sidebar-brand h2 { font-size: 1rem; }
    .sidebar-theme { display: none; }
    .main-nav {
        grid-column: 1 / -1;
        width: 100%;
        min-width: 0;
        flex-direction: row;
        flex-wrap: wrap;
        flex: none;
        padding: .1rem 0 0;
        gap: .25rem;
        overflow: visible;
    }
    .main-nav a {
        white-space: nowrap;
        font-size: .78rem;
        min-height: 40px;
        padding: .45rem .65rem;
        flex: 1 1 calc(50% - .25rem);
        justify-content: flex-start;
    }
    .main-nav a.active::before { display: none; }
    .sidebar-user {
        grid-column: 3;
        margin-left: 0;
        padding: .2rem;
        display: flex;
        justify-self: end;
        max-width: 132px;
        border-top: none;
    }
    .sidebar-user-info { display: none; }
    .sidebar-user-name, .sidebar-user-role { display: none; }
    .sidebar-logout {
        grid-column: auto;
        min-height: 38px;
    }
    .workspace-shell { padding: .75rem; }
    .attachment-viewer-header {
        flex-direction: column;
        align-items: stretch;
    }
    .attachment-viewer-actions {
        width: 100%;
    }
    .day-queue-actions {
        min-width: 180px;
    }
}
@media (max-width: 640px) {
    .task-grid, .settings-layout, .info-grid, .reviewers-grid { grid-template-columns: 1fr; }
    .tasks-summary-card,
    .profile-hero-card,
    .profile-task-card,
    .task-catalog-panel { padding: 1rem; }
    .profile-metrics-grid,
    .profile-reviewer-grid,
    .profile-attachment-grid { grid-template-columns: 1fr; }
    .task-summary-chips { flex-direction: column; align-items: stretch; }
    .score-ring { width: 140px; height: 140px; }
    .score-ring-inner { inset: 12px; }
    .score-ring-content strong { font-size: 2.45rem; }
    .score-ring-content small { font-size: .76rem; }
    .login-card { grid-template-columns: 1fr; }
    .login-intro { display: none; }
    .detail-hero { grid-template-columns: 1fr; }
    .task-settings-row, .criterion-fields { grid-template-columns: 1fr; }
    #criterion-create-form { grid-template-columns: 1fr; }
    .settings-import-form { grid-template-columns: 1fr; }
    .settings-import-submit { justify-self: start; }
    .settings-general-controls {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr;
    }
    .settings-number-input {
        width: 100%;
        max-width: none;
    }
    .settings-inline-btn {
        justify-self: start;
    }
    .task-settings-index { justify-self: start; }
    .task-settings-save { justify-self: start; }
    .filter-row {
        display: grid;
        grid-template-columns: 1fr;
    }
    .filter-row input[type="search"],
    .filter-row select,
    .filter-select {
        width: 100%;
        flex: none;
    }
    .chart-controls { flex-direction: column; align-items: stretch; }
    .chart-controls .ctrl-sep { display: none; }
    .chart-controls select,
    .chart-controls input[type="search"],
    .chart-controls .segmented,
    .chart-controls .switcher {
        width: 100%;
        flex: 0 0 auto;
    }
    .export-btn { margin-left: 0; }
    .metric-row { grid-template-columns: 1fr; }
    .page-title { font-size: 1rem; }
    .panel { padding: 1rem; }
    .data-table { min-width: 720px; }
    .users-action-cell {
        white-space: normal;
        min-width: 180px;
    }
    .attachment-viewer-stage { min-height: 60vh; }
    .attachment-viewer-actions > * { flex: 1 1 auto; }
    .attachment-viewer-toolbar {
        position: static;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        padding: 1rem 1rem 0;
    }
    .attachment-viewer-hint { text-align: left; }
}

@media print {
    .profile-attachment-grid,
    .attachment-viewer-modal {
        display: none !important;
    }
}

/* ─── DARK MODE OVERRIDES ────────────────────────────────────── */
:root[data-theme="dark"] .metric-card { background: var(--surface-2); }
:root[data-theme="dark"] .data-table th { background: var(--surface-3); }
:root[data-theme="dark"] .data-table tbody tr:hover { background: var(--accent-bg); }
:root[data-theme="dark"] .info-grid div { background: var(--surface-3); }
:root[data-theme="dark"] .attachment-card { background: var(--surface-3); }
:root[data-theme="dark"] .answer-box { background: var(--surface-3); }
:root[data-theme="dark"] .result-box { background: var(--surface-3); }
:root[data-theme="dark"] .modal-card { background: var(--surface); }
:root[data-theme="dark"] .modal-link { background: var(--surface-3); }
:root[data-theme="dark"] .criterion-row { background: var(--surface-3); }
:root[data-theme="dark"] .task-summary-row { background: var(--surface-3); }
:root[data-theme="dark"] .chart-controls { background: var(--surface-3); }

/* ─────────────────────────────────────────────
   Sunburst interactive — added 2026-04-08
───────────────────────────────────────────── */

/* Segment hover glow (ported from v1.0.1) */
@keyframes segment-pulse {
    0%, 100% { filter: brightness(0.6); }
    50%       { filter: brightness(1.0); }
}
#dashboard-chart path.sidebar-highlight,
#dashboard-chart path.joint-hover {
    animation: segment-pulse 1s ease-in-out infinite;
}

/* All segments are pointer by default in new implementation */
#dashboard-chart path {
    cursor: pointer;
}

/* Center circle and text */
.sunburst-center {
    transition: fill 0.2s;
}
.sunburst-center.has-parent {
    cursor: pointer !important;
}
.sunburst-center-val {
    font-size: 28px;
    fill: var(--sunburst-center-text, var(--text, #f4f3ee));
    font-family: "Manrope", sans-serif;
    font-weight: 400;
}
.sunburst-center-unit {
    font-size: 13px;
    fill: var(--sunburst-center-unit, var(--muted, #95a6b9));
}

/* Breadcrumbs */
.sunburst-breadcrumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 2px;
    padding: 0 0 10px;
    min-height: 22px;
}
.sunburst-crumb {
    font-size: 12px;
    color: var(--muted, #95a6b9);
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
    white-space: nowrap;
}
.sunburst-crumb:hover {
    color: var(--text, #f4f3ee);
    background: rgba(255,255,255,0.06);
}
.sunburst-crumb.active {
    color: var(--text, #f4f3ee);
    cursor: default;
}
.sunburst-crumb.active:hover {
    background: transparent;
}
.sunburst-crumb-sep {
    font-size: 11px;
    color: rgba(255,255,255,0.25);
    user-select: none;
}

/* Side panel fade transition */
.sunburst-panel-fading {
    opacity: 0;
    transition: opacity 0.09s;
}

/* Node info panel (depth 1/2 hover) */
.sunburst-node-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sunburst-node-title {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.sunburst-node-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.sunburst-node-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text, #f4f3ee);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sunburst-node-count {
    font-size: 15px;
    font-weight: 600;
    color: var(--text, #f4f3ee);
    flex-shrink: 0;
}
.sunburst-item-list {
    list-style: none;
    margin: 0 0 12px;
    padding: 0;
}
.sunburst-item-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 6px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    cursor: pointer;
    font-size: 13px;
    border-radius: 6px;
    margin-bottom: 1px;
    transition: background 0.12s;
}
.sunburst-item-list li:hover {
    background: rgba(255,255,255,0.05);
}
.sunburst-item-left {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    color: var(--text, #f4f3ee);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sunburst-item-right {
    display: flex;
    align-items: baseline;
    gap: 3px;
    flex-shrink: 0;
    margin-left: 8px;
}
.sunburst-item-val {
    font-size: 13px;
    font-weight: 600;
    color: var(--text, #f4f3ee);
}
.sunburst-item-unit {
    font-size: 11px;
    color: var(--muted, #95a6b9);
}
.sunburst-summary-box {
    margin-top: 10px;
    padding: 10px 12px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
}
.sunburst-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-size: 12px;
}
.sunburst-summary-row:last-child {
    border-bottom: none;
}
.sunburst-summary-label {
    color: var(--muted, #95a6b9);
}
.sunburst-summary-val {
    font-weight: 600;
    color: var(--text, #f4f3ee);
}

/* Panel idle state */
.sunburst-idle-hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 40px 20px;
    color: var(--muted, #95a6b9);
    font-size: 13px;
    text-align: center;
    line-height: 1.6;
    opacity: 0.7;
}
.sunburst-idle-hint svg {
    opacity: 0.4;
}

/* Groups distribution */
.groups-workspace {
    padding: .75rem 1rem 1.5rem;
}
.groups-controls {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.groups-group-card {
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 10px;
    overflow: hidden;
}
.groups-group-head {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .65rem 1rem;
    background: rgba(255,255,255,.03);
    border-bottom: 1px solid rgba(255,255,255,.06);
    font-size: 14px;
}
.groups-table {
    margin: 0;
}
.groups-female-row td {
    background: rgba(180,80,180,.08);
}

/* Bonus points inline form */
.bonus-points-panel {
    padding: 1rem 1.25rem;
}
.bonus-points-form {
    display: flex;
    align-items: flex-end;
    gap: .75rem;
    flex-wrap: wrap;
    margin-top: .6rem;
}
.bonus-points-form label {
    display: flex;
    flex-direction: column;
    gap: .3rem;
    font-size: 13px;
    color: var(--muted, #95a6b9);
}
.bonus-points-form input[type="number"] {
    width: 120px;
}

/* Threshold chips */
.threshold-chips {
    display: flex;
    gap: .4rem;
    flex-wrap: wrap;
    padding: .3rem 0 .5rem;
}
.threshold-chip {
    min-height: 36px;
    padding: .4rem .8rem;
    border-radius: 999px;
    font-size: .82rem;
    font-weight: 700;
    border: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--text-2);
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
}
.threshold-chip:hover {
    background: var(--sidebar-hover-bg);
    color: var(--text);
}
.threshold-chip.active {
    background: var(--navy);
    border-color: var(--navy);
    color: #fff;
}
:root[data-theme="dark"] .threshold-chip.active {
    background: var(--navy-2);
    border-color: var(--navy-2);
    color: var(--bg-page);
}

/* Timer bar */
.timer-bar-wrap {
    margin: .6rem 0 .8rem;
    padding: .55rem .75rem;
    background: var(--surface-2);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-sm);
}
.timer-bar-wrap.timer-overdue {
    border-color: rgba(239,68,68,.4);
    background: rgba(239,68,68,.06);
}
.timer-bar-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--muted, #95a6b9);
    margin-bottom: .35rem;
}
.timer-overdue .timer-bar-labels {
    color: #f87171;
}
.timer-bar-meta {
    display: block;
    margin-top: .45rem;
    color: var(--muted);
    font-size: .9rem;
}
.timer-bar-track {
    height: 6px;
    background: var(--surface-3);
    border-radius: 4px;
    overflow: hidden;
}
.timer-bar-fill {
    height: 100%;
    background: var(--accent, #6c63ff);
    border-radius: 4px;
    transition: width .3s ease;
}
.timer-overdue .timer-bar-fill {
    background: #ef4444;
}

/* ─── Users / Sessions management page ───────────────────────────────────── */
.users-page {
    max-width: 1100px;
    width: 100%;
    min-width: 0;
}
.users-create-form {
    padding: 1rem 1.25rem 1.25rem;
    border-top: 1px solid var(--line-soft);
}
.users-create-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: .75rem;
    margin-bottom: 1rem;
}
.users-create-grid label {
    display: flex;
    flex-direction: column;
    gap: .3rem;
    font-size: 13px;
    color: var(--muted, #95a6b9);
}
.users-create-grid label input,
.users-create-grid label select {
    margin-top: 0;
}
.users-edit-form {
    padding: .75rem 1rem;
    background: var(--surface-2);
    border-radius: var(--radius-xs);
}
.users-action-cell {
    white-space: nowrap;
    display: flex;
    gap: .4rem;
    align-items: center;
    flex-wrap: wrap;
}
.user-row-inactive td {
    opacity: .55;
}

/* Small buttons */
.btn-sm {
    min-height: 34px;
    padding: .35rem .7rem;
    font-size: .78rem;
    border-radius: var(--radius-xs);
}

/* Danger variant for ghost-btn */
.ghost-btn.btn-danger {
    color: #f87171;
    border-color: rgba(248,113,113,.35);
}
.ghost-btn.btn-danger:hover {
    background: rgba(248,113,113,.1);
    border-color: rgba(248,113,113,.6);
    color: #fca5a5;
}

/* Danger chip */
.legend-chip.chip-danger {
    background: rgba(239,68,68,.12);
    color: #f87171;
    border-color: rgba(239,68,68,.3);
}

/* ─── Audit log ───────────────────────────────────────────────────────────── */
.audit-log-panel {
    overflow: hidden;
}
.audit-log-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.audit-log-entry {
    padding: .65rem 1.25rem;
    border-bottom: 1px solid var(--line-soft);
}
.audit-log-entry:last-child {
    border-bottom: none;
}
.audit-log-meta {
    display: flex;
    align-items: center;
    gap: .6rem;
    flex-wrap: wrap;
    font-size: 13px;
}
.audit-log-action {
    font-weight: 600;
    color: var(--text);
}
.audit-log-who {
    color: var(--accent-d);
    font-size: 12px;
}
.audit-log-time {
    color: var(--muted);
    font-size: 12px;
    margin-left: auto;
}
.audit-log-details {
    margin-top: .4rem;
}
.audit-log-details summary {
    font-size: 12px;
    color: var(--muted);
    cursor: pointer;
    user-select: none;
}
.audit-log-payload {
    margin: .4rem 0 0;
    padding: .5rem .75rem;
    background: var(--surface-2);
    border-radius: var(--radius-xs);
    font-size: 11px;
    color: var(--text-2);
    overflow-x: auto;
    white-space: pre;
    max-height: 200px;
    overflow-y: auto;
}

/* ─── Print utilities ─────────────────────────────────────────────────────── */
.print-only { display: none !important; }

/* ─── @media print — interview day queue ─────────────────────────────────── */
@media print {
    /* Show hidden print-only elements */
    .print-only { display: block !important; }

    /* Hide everything that isn't the queue */
    .no-print,
    #login-screen,
    .sidebar-shell,
    .app-notice,
    .interviews-sidebar,
    .interview-day-create-form,
    .interview-day-detail-form,
    .interview-editor-head,
    .interview-summary-grid,
    .interview-day-queue-block .panel-header,
    .day-queue-actions,
    .table-flag,
    .appeal-flag-stack,
    .queue-timer { display: none !important; }

    /* Reset page chrome */
    * { box-shadow: none !important; }
    body { background: #fff; color: #000; font-family: serif; font-size: 11pt; }

    /* Make the main content area fill the page */
    .app-shell { display: block !important; padding: 0; }
    .page-root { padding: 0; }
    .interviews-layout { display: block; }
    .interview-day-workspace { padding: 0; border: none; }
    .interview-day-queue-block { padding: 0; }

    /* Print header */
    .print-queue-header { margin-bottom: 1rem; }
    .print-queue-header h1 { font-size: 16pt; margin: 0 0 .25rem; color: #000; }
    .print-queue-header p { font-size: 10pt; margin: 0; color: #333; }

    /* Queue table */
    .day-queue-table-wrap { overflow: visible; }
    .day-queue-table {
        width: 100%;
        border-collapse: collapse;
        color: #000;
        font-size: 10pt;
    }
    .day-queue-table th,
    .day-queue-table td {
        border: 1px solid #999;
        padding: .3rem .5rem;
        text-align: left;
        vertical-align: top;
    }
    .day-queue-table th { background: #eee; font-weight: bold; }

    /* Hide the Status/Timer/Actions columns (th:nth-child / td:nth-child) */
    /* Columns: 1=№ 2=Абитуриент 3=Статус 4=Допущен 5=Приглашён 6=Явился 7=Апелляции 8=Таймер 9=Действия */
    .day-queue-table th:nth-child(3),
    .day-queue-table td:nth-child(3),
    .day-queue-table th:nth-child(8),
    .day-queue-table td:nth-child(8),
    .day-queue-table th:nth-child(9),
    .day-queue-table td:nth-child(9) { display: none; }

    /* Checkboxes — show as simple □/■ */
    .day-queue-table input[type="checkbox"] { width: 14px; height: 14px; }

    /* Person cell */
    .day-queue-person button { color: #000; text-decoration: none; font-weight: bold; }
    .day-queue-person small { display: block; color: #555; font-size: 9pt; }
}
