/* MS Cost Overview — Autotaalglas Nederland B.V. house style on the Radzen "standard" theme.
   Palette (from the Autotaalglas brand): DonkerBlauw #002960, MiddenBlauw #003C85, LichtBlauw #0089C5,
   AccentBlauw #00D5E2, Rood #E40520, WebsiteGrijs #EFEFED. Type: Barlow / Barlow Semi Condensed. */

:root {
    --atg-navy: #002960;
    --atg-blue: #003c85;
    --atg-sky: #0089c5;
    --atg-glass: #00d5e2;
    --atg-red: #e40520;
    --atg-grey: #efefed;
    --surface: #ffffff;
    --ink: #13202f;
    --ink-2: #4a5566;
    --ink-3: #5d6573;
    /* Text links: the brand's light blue is too light for text (3.9:1 on white); this darker step passes WCAG AA. */
    --link: #00699a;
    --line: #dcdfe3;
    --line-soft: #e8eaec;
    --heading: var(--atg-navy);
    --hover: #f5f7f9;
    --good-ink: #1b5e20;
    --good-bg: #e6f4ea;
    --warn-ink: #7a4b00;
    --warn-bg: #fff4d6;
    --bad-ink: #a1141c;
    --bad-bg: #fde7e9;
    --neutral-ink: #3c4a5c;
    --neutral-bg: #e8edf3;
    --radius-panel: 14px;
    --radius-control: 8px;
    --font-ui: "Barlow", "Segoe UI", system-ui, sans-serif;
    --font-display: "Barlow Semi Condensed", "Barlow", "Segoe UI", system-ui, sans-serif;

    /* Radzen theme tokens */
    --rz-primary: var(--atg-blue);
    --rz-primary-light: #1a5299;
    --rz-primary-lighter: rgba(0, 60, 133, 0.10);
    --rz-primary-dark: var(--atg-navy);
    --rz-primary-darker: #001d45;
    --rz-on-primary: #ffffff;
    --rz-secondary: var(--atg-sky);
    --rz-danger: var(--atg-red);
    --rz-link-color: var(--link);
    --rz-success: #007a3d;
    --rz-text-font-family: var(--font-ui);
    --rz-body-background-color: var(--atg-grey);
    --rz-base-background-color: var(--atg-grey);
    --rz-text-color: var(--ink);
    --rz-border-radius: var(--radius-control);
    --rz-series-1: var(--atg-sky);
    --rz-border-normal: 1px solid #c3c9d0;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    background: var(--atg-grey);
    color: var(--ink);
    font-family: var(--font-ui);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--link);
}

:focus-visible {
    outline: 3px solid var(--atg-glass);
    outline-offset: 2px;
}

h1, h2, h3 {
    font-family: var(--font-display);
    color: var(--heading);
    line-height: 1.15;
    margin: 0;
}

h1 {
    font-size: 2rem;
    font-weight: 700;
}

h2 {
    font-size: 1.35rem;
    font-weight: 600;
}

.muted {
    color: var(--ink-3);
}

/* ---- Shell: navy rail + content ---------------------------------------------------------- */

.shell {
    display: grid;
    grid-template-columns: 248px 1fr;
    min-height: 100vh;
}

.rail {
    background: var(--atg-navy);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    padding: 20px 14px;
    position: sticky;
    top: 0;
    height: 100vh;
}

.brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 6px 8px 24px;
}

/* The Autotaalglas logo (white version, for the navy rail). */
.brand-logo {
    display: block;
    width: 168px;
    max-width: 100%;
    height: auto;
}

.brand-app {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: rgba(255, 255, 255, 0.72);
}

/* A pane of glass: the one decorative element, echoing the company's trade. */
.brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--atg-sky) 0%, var(--atg-blue) 55%, var(--atg-navy) 100%);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25), inset 10px 8px 0 -6px rgba(0, 213, 226, 0.55);
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 600;
}

.brand-org {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.65);
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-control);
    color: rgba(255, 255, 255, 0.78);
    text-decoration: none;
    font-weight: 500;
    position: relative;
}

    .nav-item:hover {
        background: rgba(255, 255, 255, 0.07);
        color: #ffffff;
    }

    .nav-item.active {
        background: rgba(255, 255, 255, 0.10);
        color: #ffffff;
    }

        .nav-item.active::before {
            content: "";
            position: absolute;
            left: -14px;
            top: 8px;
            bottom: 8px;
            width: 4px;
            border-radius: 0 4px 4px 0;
            background: var(--atg-glass);
        }

    .nav-item .rzi {
        font-size: 1.25rem;
    }

.nav-help {
    margin-top: auto;
}

.nav-count {
    margin-left: auto;
    min-width: 22px;
    padding: 0 7px;
    border-radius: 11px;
    background: var(--atg-red);
    color: #ffffff;
    font-size: 0.78rem;
    font-weight: 600;
    text-align: center;
    line-height: 22px;
}

.rail-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 8px 0;
    margin-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.rail-user-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.rail-user-name {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rail-user-role {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
}

.avatar {
    width: 36px;
    height: 36px;
    flex: none;
    border-radius: 50%;
    display: inline-grid;
    place-items: center;
    background: var(--atg-blue);
    color: #ffffff;
    font-weight: 600;
    font-size: 0.85rem;
}

.rail .avatar {
    background: #00699a;
}

.icon-button {
    border: 0;
    background: transparent;
    color: inherit;
    width: 34px;
    height: 34px;
    border-radius: var(--radius-control);
    display: inline-grid;
    place-items: center;
    cursor: pointer;
}

    .icon-button:hover:not(:disabled) {
        background: rgba(0, 41, 96, 0.08);
    }

    .rail .icon-button:hover {
        background: rgba(255, 255, 255, 0.1);
    }

    .icon-button:disabled {
        opacity: 0.35;
        cursor: default;
    }

.content {
    padding: 32px clamp(16px, 4vw, 48px) 64px;
    max-width: 1680px;
    width: 100%;
}

.state-panel {
    max-width: 560px;
    margin: 12vh auto 0;
    text-align: center;
    display: grid;
    gap: 12px;
    justify-items: center;
}

/* ---- Page header ------------------------------------------------------------------------- */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 24px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.page-intro {
    margin: 8px 0 0;
    color: var(--ink-2);
    max-width: 68ch;
}

.page-header-side {
    display: flex;
    align-items: center;
    gap: 16px;
}

.help-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    text-decoration: none;
}

    .help-link:hover {
        text-decoration: underline;
    }

.year-switch {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 2px 4px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.05rem;
}

/* ---- Surfaces ---------------------------------------------------------------------------- */

.surface {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-panel);
    padding: 24px;
    margin-bottom: 20px;
}

/* ---- Year strip (the signature element) ------------------------------------------------- */

.strip-surface {
    padding: 24px 24px 16px;
}

.year-strip {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 6px;
}

.month {
    appearance: none;
    border: 1px solid transparent;
    background: transparent;
    border-radius: 12px;
    padding: 8px 4px 10px;
    display: grid;
    grid-template-rows: auto 160px auto 20px;
    gap: 6px;
    justify-items: center;
    cursor: pointer;
    font: inherit;
    color: var(--ink);
    transition: background-color 120ms ease, border-color 120ms ease;
}

    .month:hover:not(:disabled) {
        background: var(--hover);
    }

    .month.is-selected {
        background: rgba(0, 137, 197, 0.07);
        border-color: var(--atg-sky);
        box-shadow: 0 0 0 3px rgba(0, 213, 226, 0.35);
    }

    .month.is-future {
        cursor: default;
        color: var(--ink-3);
    }

.month-value {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.92rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.month-track {
    width: 100%;
    max-width: 44px;
    height: 160px;
    display: flex;
    align-items: flex-end;
    border-bottom: 2px solid var(--line);
}

.month-bar {
    width: 100%;
    border-radius: 6px 6px 0 0;
    background: var(--atg-sky);
    min-height: 2px;
}

.month.is-selected .month-bar {
    background: var(--atg-blue);
}

.month.is-future .month-track {
    border-bottom-style: dashed;
}

.month-name {
    font-weight: 500;
    text-transform: lowercase;
}

.month-flags {
    display: flex;
    gap: 4px;
    align-items: center;
    height: 20px;
}

.flag-running {
    font-size: 0.72rem;
    color: var(--ink-3);
}

.strip-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--line-soft);
    color: var(--ink-2);
    flex-wrap: wrap;
}

.text-button {
    border: 0;
    background: none;
    padding: 0;
    font: inherit;
    font-weight: 500;
    color: var(--link);
    cursor: pointer;
    text-decoration: none;
}

    .text-button:hover {
        text-decoration: underline;
    }

.skeleton-strip, .skeleton-rows {
    height: 240px;
    border-radius: 12px;
    background: linear-gradient(90deg, var(--line-soft) 0%, var(--hover) 50%, var(--line-soft) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite linear;
}

.skeleton-rows {
    height: 180px;
}

/* A KPI value that is still loading: about the height of the value, so the card does not jump. */
.skeleton-line {
    display: block;
    width: 60%;
    height: 1.9rem;
    margin: 4px 0;
    border-radius: 6px;
    background: linear-gradient(90deg, var(--line-soft) 0%, var(--hover) 50%, var(--line-soft) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite linear;
}

@media (prefers-reduced-motion: reduce) {
    .skeleton-strip, .skeleton-rows, .skeleton-line {
        animation: none;
    }
}

@keyframes shimmer {
    to {
        background-position: -200% 0;
    }
}

/* ---- Export panel ----------------------------------------------------------------------- */

.export-panel {
    display: grid;
    gap: 20px;
    border-top: 4px solid var(--atg-blue);
}

.export-summary h2 {
    font-size: 1.7rem;
}

    .export-summary h2::first-letter {
        text-transform: uppercase;
    }

.figures {
    display: flex;
    gap: 40px;
    margin: 14px 0 0;
    flex-wrap: wrap;
}

    .figures div {
        display: flex;
        flex-direction: column-reverse;
    }

    .figures dt {
        color: var(--ink-3);
        font-size: 0.85rem;
    }

    .figures dd {
        margin: 0;
        font-family: var(--font-display);
        font-size: 1.6rem;
        font-weight: 600;
        color: var(--heading);
        font-variant-numeric: tabular-nums;
    }

/* Block layout so inline markup (strong, a) flows as text; the icon sits in the left padding. */
.notice {
    display: block;
    position: relative;
    margin: 14px 0 0;
    padding: 10px 14px 10px 40px;
    border-radius: var(--radius-control);
    background: rgba(228, 5, 32, 0.06);
    color: var(--ink);
}

    .notice .rzi {
        color: var(--atg-red);
    }

.parts {
    border: 0;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

    .parts legend {
        font-weight: 600;
        margin-bottom: 10px;
        padding: 0;
    }

.chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    cursor: pointer;
    user-select: none;
    background: var(--surface);
}

    .chip input {
        accent-color: var(--atg-blue);
        margin: 0;
    }

    .chip.is-on {
        border-color: var(--atg-blue);
        background: rgba(0, 60, 133, 0.06);
    }

    .chip:has(input:focus-visible) {
        outline: 3px solid var(--atg-glass);
        outline-offset: 2px;
    }

.export-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* ---- Lists ------------------------------------------------------------------------------ */

.recent {
    margin-top: 28px;
}

    .recent h2 {
        margin-bottom: 12px;
    }

.export-list {
    list-style: none;
    margin: 0 0 12px;
    padding: 0;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-panel);
}

    .export-list li + li {
        border-top: 1px solid var(--line-soft);
    }

    .export-list a {
        display: grid;
        grid-template-columns: minmax(180px, 1fr) 2fr auto;
        gap: 16px;
        align-items: center;
        padding: 14px 20px;
        text-decoration: none;
        color: var(--ink);
    }

        .export-list a:hover {
            background: var(--hover);
        }

.export-period {
    font-weight: 600;
}

    .export-period::first-letter {
        text-transform: uppercase;
    }

.export-total {
    font-family: var(--font-display);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.form-grid {
    display: grid;
    gap: 18px;
}

.fields {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

    .fields > * {
        min-width: 200px;
    }

/* ---- Warnings --------------------------------------------------------------------------- */

.filter-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.filter {
    border: 1px solid var(--line);
    background: var(--surface);
    border-radius: 999px;
    padding: 7px 14px;
    font: inherit;
    font-weight: 500;
    cursor: pointer;
    color: var(--ink-2);
}

    .filter.is-active {
        background: var(--atg-navy);
        border-color: var(--atg-navy);
        color: #ffffff;
    }

.filter-count {
    font-variant-numeric: tabular-nums;
    opacity: 0.75;
    margin-left: 4px;
}

.people {
    list-style: none;
    margin: 0 0 24px;
    padding: 0;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-panel);
}

.person {
    display: grid;
    grid-template-columns: auto minmax(220px, 2fr) minmax(180px, 1.4fr) 110px 128px;
    gap: 18px;
    align-items: center;
    padding: 16px 20px;
}

    .person + .person {
        border-top: 1px solid var(--line-soft);
    }

.person-name {
    font-weight: 600;
}

.person-sub {
    color: var(--ink-3);
    font-size: 0.88rem;
    overflow-wrap: anywhere;
}

.person-history {
    color: var(--ink-3);
    font-size: 0.82rem;
    margin-top: 2px;
}

.person-tags, .side-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 500;
}

.tag-problem {
    background: rgba(228, 5, 32, 0.08);
    color: var(--bad-ink);
    border: 1px solid rgba(228, 5, 32, 0.35);
}

.tag-info {
    background: var(--neutral-bg);
    color: var(--ink-2);
    border: 1px solid var(--line);
}

.person-facts {
    font-size: 0.9rem;
    color: var(--ink-2);
}

.fact-label {
    display: inline-block;
    min-width: 64px;
    color: var(--ink-3);
}

.person-cost {
    font-family: var(--font-display);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.empty {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--ink-2);
}

    .empty .rzi {
        color: var(--atg-sky);
        font-size: 1.8rem;
    }

.license-issues ul {
    margin: 12px 0;
    padding-left: 20px;
}

/* ---- Side panel (user edit) ------------------------------------------------------------ */

.side-form {
    display: grid;
    gap: 16px;
}

    .side-form .muted {
        margin: -8px 0 0;
        overflow-wrap: anywhere;
    }

.explain {
    display: flex;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--radius-control);
    background: rgba(0, 137, 197, 0.07);
    color: var(--ink-2);
    font-size: 0.92rem;
}

    .explain p {
        margin: 0;
    }

    .explain .rzi {
        color: var(--atg-sky);
    }

.side-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 8px;
}

/* ---- Help ------------------------------------------------------------------------------- */

.help-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 32px;
    align-items: start;
}

.help-toc {
    position: sticky;
    top: 24px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-panel);
}

    .help-toc a {
        padding: 6px 10px;
        border-radius: 6px;
        text-decoration: none;
        color: var(--ink-2);
    }

        .help-toc a:hover {
            background: var(--hover);
            color: var(--heading);
        }

.help-body {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-panel);
    padding: 8px 32px 24px;
    max-width: 76ch;
}

    .help-body section {
        padding: 24px 0;
        scroll-margin-top: 16px;
    }

        .help-body section + section {
            border-top: 1px solid var(--line-soft);
        }

    .help-body h2 {
        margin-bottom: 10px;
    }

    .help-body li {
        margin-bottom: 6px;
    }

.help-list dt {
    font-weight: 600;
    margin-top: 10px;
}

.help-list dd {
    margin: 2px 0 0;
    color: var(--ink-2);
}

/* ---- Radzen fine-tuning ---------------------------------------------------------------- */

.rz-button {
    font-family: var(--font-ui);
    font-weight: 600;
    border-radius: var(--radius-control);
}

.rz-card {
    border-radius: var(--radius-panel);
    border: 1px solid var(--line);
    box-shadow: none;
}

.rz-datatable, .rz-grid-table {
    font-family: var(--font-ui);
}

/* Dialog titles in the display face. */
.rz-dialog-side-title, .rz-dialog-title {
    font-family: var(--font-display);
    font-size: 1.45rem;
    font-weight: 600;
    color: var(--heading);
}

.missing {
    color: var(--bad-ink);
    font-weight: 500;
}

/* ---- Blazor error UI -------------------------------------------------------------------- */

#blazor-error-ui {
    background: #fff4f4;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.loading-progress {
    position: absolute;
    display: block;
    width: 6rem;
    height: 6rem;
    inset: 30vh 0 auto 0;
    margin: 0 auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.5rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: var(--atg-blue);
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(30vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Laden");
    }

/* ---- Responsive & motion --------------------------------------------------------------- */

@media (max-width: 900px) {
    /* minmax(0, ...) so a wide child (the menu row) scrolls inside instead of widening the page. */
    .shell,
    .shell.finny-open {
        grid-template-columns: minmax(0, 1fr);
    }

    .rail {
        position: static;
        height: auto;
        padding: 12px;
        min-width: 0;
    }

    .nav {
        flex-direction: row;
        overflow-x: auto;
    }

    .nav-item span:not(.nav-count) {
        white-space: nowrap;
    }

    .nav-item.active::before {
        display: none;
    }

    .nav-help {
        margin-top: 0;
    }

    .rail-user {
        display: none;
    }

    .year-strip {
        grid-template-columns: repeat(6, minmax(0, 1fr));
        row-gap: 12px;
    }

    .month {
        grid-template-rows: auto 100px auto 20px;
    }

    .month-track {
        height: 100px;
    }

    .person {
        grid-template-columns: auto 1fr;
    }

    .person-facts, .person-cost, .person-actions {
        grid-column: 2;
    }

    .help-layout {
        grid-template-columns: 1fr;
    }

    .help-toc {
        position: static;
    }

    .export-list a {
        grid-template-columns: 1fr auto;
    }

        .export-list a .muted {
            display: none;
        }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
}

/* ---- Small page helpers ------------------------------------------------------------------ */

.section-title {
    margin: 28px 0 12px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
}

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

    .kpis > div {
        display: flex;
        flex-direction: column;
        padding: 14px 16px;
        background: var(--surface);
        border: 1px solid var(--line);
        border-radius: var(--radius-panel);
    }

.kpi-value {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--heading);
    font-variant-numeric: tabular-nums;
}

.kpi-label {
    font-size: 0.85rem;
    color: var(--ink-3);
}

.export-ready {
    border-top: 4px solid var(--atg-blue);
}

table.simple {
    width: 100%;
    border-collapse: collapse;
}

    table.simple td {
        padding: 6px 8px;
        border-bottom: 1px solid var(--line-soft);
    }

.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* --- Warnings: savings, quiet notices, details ------------------------------------------- */

.saving-banner {
    display: flex;
    gap: 14px;
    align-items: center;
    margin: 0 0 16px;
    padding: 14px 18px;
    border-radius: var(--radius-panel);
    background: var(--surface);
    border-left: 4px solid var(--atg-sky);
}

    .saving-banner > .rzi {
        font-size: 2rem;
        color: var(--atg-sky);
    }

.saving-amount {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--heading);
    font-variant-numeric: tabular-nums;
}

.notice-quiet {
    background: rgba(0, 137, 197, 0.08);
    margin: 0 0 14px;
}

    .notice-quiet .rzi {
        color: var(--atg-sky);
    }

.field-hint {
    margin: 4px 0 12px;
    font-size: 0.85rem;
    color: var(--ink-3);
}

.field-error {
    margin: 4px 0 0;
    font-size: 0.9rem;
    color: var(--atg-red);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* --- Settings ------------------------------------------------------------------------------ */

.settings-section {
    padding: 20px 24px;
    margin-bottom: 16px;
    max-width: 820px;
}

    .settings-section h2 {
        margin: 0 0 6px;
        font-size: 1.2rem;
    }

    .settings-section > p.muted {
        margin: 0 0 14px;
        max-width: 68ch;
    }

.mail-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 12px;
    padding: 0;
    list-style: none;
}

.mail-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 6px 4px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--atg-grey);
}

    .mail-chip > .rzi {
        font-size: 1rem;
        color: var(--ink-3);
    }

.chip-remove {
    display: inline-grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--ink-2);
    cursor: pointer;
}

    .chip-remove:hover {
        background: rgba(228, 5, 32, 0.10);
        color: var(--atg-red);
    }

    .chip-remove .rzi {
        font-size: 1rem;
    }

.inline-add {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

    .inline-add .grow {
        flex: 1 1 280px;
    }

.narrow {
    width: 160px;
}

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

.departments-text {
    width: 100%;
    font-family: var(--font-ui);
}

.list-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 6px;
}

.page-actions {
    display: flex;
    gap: 14px;
    align-items: center;
    margin: 4px 0 32px;
}

/* --- Departments trend --------------------------------------------------------------------- */

.table-wrap {
    overflow-x: auto;
    padding: 0;
}

.trend {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.92rem;
}

    .trend th,
    .trend td {
        padding: 9px 10px;
        border-bottom: 1px solid var(--line-soft);
        white-space: nowrap;
    }

    .trend thead th {
        font-weight: 600;
        color: var(--ink-2);
        background: var(--surface);
        position: sticky;
        top: 0;
    }

    .trend .trend-name {
        text-align: left;
        font-weight: 600;
        position: sticky;
        left: 0;
        background: var(--surface);
        min-width: 200px;
        white-space: normal;
    }

    .trend td.cell {
        border-left: 2px solid var(--surface);
        color: var(--ink);
    }

    .trend tfoot th,
    .trend tfoot td {
        font-weight: 700;
        border-bottom: 0;
        border-top: 2px solid var(--line);
    }

    .trend .change {
        color: var(--ink);
    }

        .trend .change .rzi {
            font-size: 0.95rem;
            vertical-align: -2px;
            color: var(--ink-3);
        }

.search {
    min-width: 260px;
}

/* --- Month changes ------------------------------------------------------------------------- */

.changes-panel {
    padding: 20px 24px;
    margin-top: 16px;
}

    .changes-panel h2 {
        margin: 0 0 8px;
        font-size: 1.2rem;
    }

.changes-summary {
    margin: 0 0 12px;
}

.changes {
    margin: 0 0 8px;
    padding: 0;
    list-style: none;
}

    .changes li + li {
        border-top: 1px solid var(--line-soft);
    }

    .changes summary {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 8px 0;
        cursor: pointer;
        list-style: none;
    }

        .changes summary::-webkit-details-marker {
            display: none;
        }

        .changes summary .rzi {
            color: var(--ink-3);
        }

.change-text {
    flex: 1;
}

.change-amount {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.change-users {
    margin: 0 0 10px 34px;
    color: var(--ink-2);
    font-size: 0.9rem;
}

.skeleton-rows.short {
    height: 80px;
}

@media (max-width: 900px) {
    .settings-section,
    .changes-panel {
        padding: 16px;
    }

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

/* --- Actions: waivers and revoke ---------------------------------------------------------- */

.person-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
}

.person.waiver {
    grid-template-columns: auto minmax(220px, 2fr) minmax(180px, 1.4fr) minmax(160px, 1fr) 128px;
}

.avatar-quiet {
    background: var(--atg-grey);
    color: var(--ink-3);
}

.filter-quiet .rzi {
    font-size: 1rem;
    vertical-align: -3px;
}

.revoke-list {
    border: 0;
    margin: 0 0 12px;
    padding: 0;
}

.revoke-license {
    padding: 10px 0;
    border-bottom: 1px solid var(--line-soft);
}

.revoke-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 4px;
}

.revoke-path {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 4px 0 4px 4px;
    cursor: pointer;
}

    .revoke-path input {
        margin-top: 3px;
    }

    .revoke-path.is-blocked {
        color: var(--ink-3);
        cursor: not-allowed;
    }

.revoke-note {
    display: block;
    font-size: 0.85rem;
    color: var(--ink-3);
}

.confirm {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin: 12px 0;
    font-weight: 600;
}

    .confirm input {
        margin-top: 4px;
    }

.result-line {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    margin: 6px 0;
}

    .result-line.ok .rzi {
        color: var(--good-ink);
    }

    .result-line.failed .rzi {
        color: var(--atg-red);
    }

ul.change-users {
    list-style: none;
    padding-left: 0;
}

    ul.change-users li {
        padding: 1px 0;
    }

@media (max-width: 900px) {
    .person.waiver {
        grid-template-columns: auto 1fr;
    }

    .person-actions {
        flex-direction: row;
        flex-wrap: wrap;
    }
}

/* --- Rights matrix ------------------------------------------------------------------------- */

.rights-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.persona-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.persona-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-control);
    background: var(--surface);
    color: var(--ink);
    text-align: left;
    cursor: pointer;
}

    .persona-card.is-active {
        border-color: var(--atg-blue);
        box-shadow: inset 4px 0 0 var(--atg-blue);
    }

.persona-name {
    font-weight: 600;
}

.persona-meta {
    font-size: 0.85rem;
    color: var(--ink-3);
}

.persona-editor {
    padding: 20px 24px;
}

.editor-head,
.group-picker {
    display: flex;
    gap: 12px;
    align-items: center;
}

    .editor-head .grow,
    .group-picker .grow {
        flex: 1;
    }

.scope-choice {
    border: 0;
    margin: 12px 0 8px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

    .scope-choice legend {
        font-weight: 600;
        margin-bottom: 6px;
    }

.departments-pick {
    width: 100%;
}

.matrix {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

    .matrix th,
    .matrix td {
        padding: 8px 10px;
        border-bottom: 1px solid var(--line-soft);
        text-align: left;
        vertical-align: top;
    }

    .matrix thead th {
        font-weight: 600;
        color: var(--ink-2);
    }

    .matrix .matrix-col {
        width: 96px;
        text-align: center;
    }

    .matrix input[type=checkbox] {
        width: 18px;
        height: 18px;
        cursor: pointer;
    }

.matrix-feature {
    display: block;
    font-weight: 600;
}

.matrix-desc {
    display: block;
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--ink-3);
}

.matrix-shortcuts {
    display: flex;
    gap: 16px;
    margin: 8px 0;
}

@media (max-width: 900px) {
    .rights-layout {
        grid-template-columns: 1fr;
    }

    .matrix .matrix-col {
        width: auto;
    }
}

/* --- Contracts ------------------------------------------------------------------------------ */

.contract-kpis {
    margin: 0 0 16px;
}

.renewals {
    padding: 16px 20px;
    margin-bottom: 16px;
    border-left: 4px solid var(--atg-red);
}

    .renewals h2 {
        display: flex;
        gap: 8px;
        align-items: center;
        margin: 0 0 8px;
        font-size: 1.1rem;
    }

    .renewals ul {
        margin: 0;
        padding-left: 18px;
    }

.contracts {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

    .contracts th,
    .contracts td {
        padding: 10px 12px;
        border-bottom: 1px solid var(--line-soft);
        text-align: left;
        vertical-align: top;
    }

    .contracts thead th {
        font-weight: 600;
        color: var(--ink-2);
    }

    .contracts .num {
        text-align: right;
        white-space: nowrap;
    }

    .contracts tfoot th,
    .contracts tfoot td {
        font-weight: 700;
        border-top: 2px solid var(--line);
        border-bottom: 0;
    }

.contract-name {
    display: block;
    font-weight: 600;
}

.contract-meta {
    display: block;
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--ink-3);
}

.estimate {
    color: var(--ink-3);
    margin-left: 2px;
}

.row-actions {
    width: 48px;
    text-align: right;
}

.fx-list {
    margin: 0 0 12px;
    padding-left: 18px;
}

.form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0 12px;
}

    .form-grid > *,
    .side-form .rz-form-field {
        min-width: 0;
        width: 100%;
    }

.usage-title {
    margin: 12px 0 2px;
    font-size: 1rem;
}

.usage-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

    .usage-grid label {
        display: flex;
        flex-direction: column;
        gap: 2px;
        font-size: 0.85rem;
        color: var(--ink-2);
    }

    .usage-grid input {
        width: 100%;
        box-sizing: border-box;
        padding: 6px 8px;
        border: 1px solid var(--line);
        border-radius: var(--radius-control);
        font: inherit;
        text-align: right;
    }

.side-actions .grow {
    flex: 1;
}

@media (max-width: 900px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

    .usage-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* --- Azure ---------------------------------------------------------------------------------- */

.kpi-value.small {
    font-size: 1.1rem;
}

.basis {
    display: inline-block;
    margin-left: 6px;
    padding: 0 6px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    vertical-align: 1px;
}

.basis-estimate {
    background: var(--atg-grey);
    color: var(--ink-2);
}

.basis-actual {
    background: rgba(0, 60, 133, 0.10);
    color: var(--atg-blue);
}

.trend tr.is-off th,
.trend tr.is-off td {
    color: var(--ink-3);
}

.link-button {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--ink);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
}

    .link-button .rzi {
        font-size: 1.1rem;
        color: var(--ink-3);
    }

.detail-row td {
    background: var(--atg-grey);
    white-space: normal;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

    .detail-grid h3 {
        margin: 0 0 6px;
        font-size: 0.95rem;
    }

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

    .lines li {
        display: flex;
        justify-content: space-between;
        gap: 12px;
        padding: 3px 0;
        border-bottom: 1px solid var(--line-soft);
    }

@media (max-width: 900px) {
    .detail-grid {
        grid-template-columns: 1fr;
    }
}

.notice > .rzi:first-child {
    position: absolute;
    left: 14px;
    top: 10px;
}

/* Budget */
.budget-status {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    margin-bottom: 16px;
    border-radius: 8px;
    background: var(--surface);
    border-left: 4px solid var(--ink-3);
}

.budget-status.is-approved {
    border-left-color: var(--good, #2e7d32);
}

.budget-status strong {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    margin-right: 6px;
}

.budget-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.budget-section {
    margin-top: 24px;
}

.budget-section-head {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 24px;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 8px;
}

.budget-section-head .section-title {
    margin: 0;
}

.budget-section-head .field-hint {
    margin: 2px 0 0;
    max-width: 60ch;
}

.budget-uplift {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    font-size: 0.9rem;
}

.budget-section-total {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-size: 0.9rem;
}

.budget-section-total strong {
    font-size: 1.25rem;
}

.budget-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.budget-table th, .budget-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--line, #e3e3e3);
    text-align: left;
    vertical-align: top;
}

.budget-table thead th {
    font-weight: 600;
    color: var(--ink-2);
    white-space: nowrap;
}

.budget-table .num {
    text-align: right;
    white-space: nowrap;
}

.budget-table tr.is-off td, .budget-table tr.is-off th {
    color: var(--ink-3);
}

.budget-table tr.is-off .budget-name > span:first-child {
    text-decoration: line-through;
}

.budget-name {
    min-width: 220px;
    font-weight: 500;
}

.budget-basis {
    display: block;
    color: var(--ink-3);
    font-size: 0.8rem;
    font-weight: 400;
}

.budget-table input, .budget-table select, .budget-uplift input, .budget-percent input, .budget-note {
    font: inherit;
    padding: 4px 6px;
    border: 1px solid var(--line, #cfcfcf);
    border-radius: 4px;
    background: var(--surface, #fff);
    color: inherit;
}

.budget-table input[type=number], .budget-uplift input, .budget-percent input {
    width: 5.5em;
    text-align: right;
}

.budget-table input.budget-amount {
    width: 8em;
}

.budget-table input.budget-text {
    width: 100%;
    min-width: 12em;
}

.budget-seats, .budget-manual {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
    margin-top: 4px;
}

.budget-percent {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    white-space: nowrap;
    font-weight: 400;
}

.budget-note {
    width: 100%;
    max-width: 80ch;
}

/* Budget against actual: icon + percentage, never colour alone */
.budget-badge {
    display: inline-flex;
    gap: 2px;
    align-items: center;
    margin-left: 6px;
    padding: 1px 6px 1px 3px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
    vertical-align: middle;
    line-height: 1.4;
}

.budget-badge .rzi {
    font-size: 1rem;
}

.budget-under {
    color: var(--good-ink);
    background: var(--good-bg);
}

.budget-near {
    color: var(--warn-ink);
    background: var(--warn-bg);
}

.budget-over {
    color: var(--bad-ink);
    background: var(--bad-bg);
}

.budget-unbudgeted {
    color: var(--neutral-ink);
    background: var(--neutral-bg);
}

/* Background jobs on Status: icon + text, never colour alone */
.job-state {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    font-weight: 600;
    white-space: nowrap;
}

.job-state .rzi {
    font-size: 1.1rem;
}

.job-ok {
    color: var(--good-ink);
}

.job-running, .job-notyetrun {
    color: var(--neutral-ink);
}

.job-late {
    color: var(--warn-ink);
}

.job-failed, .job-interrupted, .job-error {
    color: var(--bad-ink);
}

/* The grid shows the start of an error; the full text is in the job's history (click the job) */
.job-error-short {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: pre-line;
}

.job-runs {
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
}

.job-run {
    padding: 10px 0;
    border-top: 1px solid var(--line-soft);
}

.job-run-head {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 8px;
    align-items: center;
}

.job-run-summary {
    margin: 4px 0 0;
    color: var(--ink-2);
}

.job-run-error {
    margin: 6px 0 0;
    padding: 8px 10px;
    border-radius: var(--radius-control);
    background: var(--hover);
    color: var(--bad-ink);
    font: 0.85rem/1.4 ui-monospace, SFMono-Regular, Consolas, monospace;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

/* Contract people picker */
.people-picker {
    margin: 12px 0;
}

.person-chips, .people-results {
    list-style: none;
    margin: 8px 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.person-chips li {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px 4px 2px 10px;
    border-radius: 999px;
    background: var(--surface-2, #eef2f8);
    font-size: 0.88rem;
}

.people-results {
    flex-direction: column;
    gap: 2px;
}

.people-results .link-button {
    display: flex;
    gap: 8px;
    align-items: center;
    text-align: left;
    width: 100%;
}

.people-search .rz-textbox {
    width: 100%;
}

.charge-split th, .charge-split td {
    font-weight: 400;
    color: var(--ink-2);
}

/* Budget and forecast per department */
.budget-table {
    width: auto;
    min-width: 640px;
}

.budget-table .central-row th,
.budget-table .central-row td {
    font-style: italic;
    border-top: 1px solid var(--border, #d9dee5);
}

.forecast-note {
    white-space: nowrap;
}

/* ---- Hubs and dashboard (2026-11 redesign) ----------------------------------------------- */

:root {
    /* Categorical chart slots 1–3 (validated palette, dataviz skill): licenses, contracts, Azure. */
    --viz-1: #2a78d6;
    --viz-2: #eb6834;
    --viz-3: #1baf7a;
}

.hub-header {
    margin-bottom: 12px;
}

.hub-tabs.rz-tabview {
    background: transparent;
    border: 0;
    box-shadow: none;
}

.hub-tabs .rz-tabview-nav {
    background: transparent;
    border-bottom: 1px solid var(--line);
    gap: 4px;
    margin-bottom: 20px;
}

.hub-tabs .rz-tabview-nav li a {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.02rem;
}

.hub-tabs .rz-tabview-panels {
    background: transparent;
    padding: 0;
}

.page-header.embedded {
    margin-bottom: 16px;
    align-items: center;
}

.page-header.embedded .page-intro {
    margin: 0;
}

.dash-row {
    margin-bottom: 16px;
}

.dash-card {
    display: block;
    height: 100%;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-panel);
    padding: 20px 22px;
    color: var(--ink);
}

.dash-card-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 12px;
}

.dash-card-head h2 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.15rem;
    color: var(--heading);
}

.dash-card-head a {
    font-size: 0.9rem;
    text-decoration: none;
}

.kpi-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-decoration: none;
}

.kpi-card-label {
    color: var(--ink-2);
    font-weight: 600;
    font-size: 0.9rem;
}

.kpi-card-value {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-display);
    font-size: 1.9rem;
    font-weight: 700;
    color: var(--heading);
    line-height: 1.15;
}

.kpi-card-sub {
    color: var(--ink-3);
    font-size: 0.88rem;
}

.kpi-link:hover {
    border-color: var(--atg-sky);
}

.kpi-attention {
    border-left: 4px solid var(--atg-red);
}

.ok-icon {
    color: var(--good-ink);
}

.bad-icon {
    color: var(--bad-ink);
}

.muted-icon {
    color: var(--ink-3);
}

.month-chart {
    height: 280px;
    width: 100%;
}

.split-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 14px;
}

.split-line {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.95rem;
}

.split-line a {
    text-decoration: none;
    font-weight: 600;
}

.split-bar {
    height: 8px;
    border-radius: 4px;
    background: var(--line-soft);
    margin-top: 6px;
    overflow: hidden;
}

.split-bar span {
    display: block;
    height: 100%;
    border-radius: 4px;
}

.split-total {
    margin: 16px 0 0;
}

.dash-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.93rem;
}

.dash-table th,
.dash-table td {
    padding: 7px 6px;
    border-bottom: 1px solid var(--line-soft);
    text-align: left;
}

.dash-table thead th {
    color: var(--ink-3);
    font-weight: 600;
    font-size: 0.85rem;
}

.dash-table .num {
    text-align: right;
    white-space: nowrap;
}

.dash-table .central-row th,
.dash-table .central-row td {
    font-style: italic;
}

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

.renewal-list li {
    display: grid;
    grid-template-columns: auto 1fr auto;
    column-gap: 10px;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--line-soft);
}

.renewal-name {
    font-weight: 600;
}

.renewal-when {
    grid-column: 2;
    color: var(--ink-3);
    font-size: 0.85rem;
}

.renewal-amount {
    grid-column: 3;
    grid-row: 1 / span 2;
    white-space: nowrap;
}

.hub-tabs .rz-tabview-panels,
.hub-tabs .rz-tabview-panel {
    background: transparent;
    border: 0;
    padding: 0;
    box-shadow: none;
}

.export-dialog {
    display: grid;
    gap: 14px;
}

.export-dialog fieldset {
    border: 0;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.export-dialog legend {
    font-weight: 600;
    margin-bottom: 6px;
}

.export-dialog .chip input[type=radio] {
    margin: 0 4px 0 0;
}

.export-dialog-sum,
.export-dialog-note {
    margin: 0;
}


/* ---- Dark mode ----------------------------------------------------------------------------
   wwwroot/js/theme.js resolves the choice (System / Light / Dark, default System) to data-theme on <html>
   and swaps the Radzen base theme; these tokens follow. The rail keeps the brand navy. */

:root[data-theme="dark"] {
    color-scheme: dark;
    --atg-grey: #0e141c;
    --surface: #161f2a;
    --ink: #e4e9ef;
    --ink-2: #b3bdc9;
    --ink-3: #8a96a4;
    --line: #2b3746;
    --line-soft: #212b37;
    --heading: #d3e4fb;
    --hover: #1d2733;
    --good-ink: #8fd6a0;
    --good-bg: rgba(46, 160, 67, 0.16);
    --warn-ink: #f0c36a;
    --warn-bg: rgba(210, 153, 34, 0.18);
    --bad-ink: #ff9a9a;
    --bad-bg: rgba(228, 5, 32, 0.20);
    --neutral-ink: #b3bdc9;
    --neutral-bg: rgba(139, 152, 168, 0.16);
    --viz-1: #3987e5;
    --viz-2: #d95926;
    --viz-3: #199e70;

    /* White text on the primary button needs 4.5:1; #2f6fbb gives 5.1:1 and still stands out from the surface. */
    --rz-primary: #2f6fbb;
    --rz-primary-light: #3f86d8;
    --rz-primary-lighter: rgba(63, 134, 216, 0.18);
    --rz-primary-dark: #285f9f;
    --rz-primary-darker: #255a98;
    --rz-link-color: #5ec3f0;
    --link: #5ec3f0;
    --rz-body-background-color: var(--atg-grey);
    --rz-base-background-color: var(--atg-grey);
    --rz-text-color: var(--ink);
    --rz-border-normal: 1px solid #3a4756;
}

:root[data-theme="dark"] .chip.is-on,
:root[data-theme="dark"] .basis-actual,
:root[data-theme="dark"] .notice-quiet,
:root[data-theme="dark"] .explain,
:root[data-theme="dark"] .month.is-selected {
    background: rgba(94, 195, 240, 0.12);
}

:root[data-theme="dark"] .notice:not(.notice-quiet) {
    background: rgba(228, 5, 32, 0.14);
}

:root[data-theme="dark"] #blazor-error-ui {
    background: #3a1a1d;
    color: var(--ink);
}

:root[data-theme="dark"] .rz-chart text {
    fill: var(--ink-2);
}

/* Theme switch in the rail: aligned with the menu items, icons only (names as tooltip) */
.theme-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 0 0 12px;
    padding: 6px 4px 6px 12px;
    color: rgba(255, 255, 255, 0.78);
    font-weight: 500;
}

.theme-label {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.theme-label .rzi {
    font-size: inherit;
}

.theme-switch {
    display: inline-flex;
    gap: 2px;
    padding: 2px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
}

.theme-switch button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 26px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: rgba(255, 255, 255, 0.62);
    cursor: pointer;
}

.theme-switch button:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.theme-switch button.is-on {
    background: rgba(255, 255, 255, 0.20);
    color: #ffffff;
}

.theme-switch button:focus-visible {
    outline: 2px solid var(--atg-glass);
    outline-offset: 1px;
}

.theme-switch .rzi {
    font-size: 1.05rem;
}


/* ---- Azure savings ----------------------------------------------------------------------- */

.kpi-unit {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--ink-3);
}

.kpi-small {
    font-size: 1.4rem;
}

.savings-teaser {
    height: auto;
    margin-bottom: 16px;
}

.savings-teaser .kpi-card-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.savings-step {
    margin-top: 20px;
}

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

.savings-card {
    height: auto;
}

.savings-card.is-handled {
    opacity: 0.7;
}

.savings-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

.savings-head h3 {
    margin: 0;
    font-size: 1.05rem;
    color: var(--heading);
}

.savings-where {
    margin: 2px 0 0;
    font-size: 0.88rem;
}

.savings-amount {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    white-space: nowrap;
}

.savings-amount strong {
    font-family: var(--font-display);
    font-size: 1.3rem;
    color: var(--heading);
}

.savings-basis {
    margin: 10px 0;
    color: var(--ink-2);
    max-width: 110ch;
}

.savings-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    font-size: 0.85rem;
}

.savings-decision,
.savings-realized {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 10px 0 0;
    font-size: 0.92rem;
}

.savings-realized {
    color: var(--good-ink);
}

.savings-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--line-soft);
}

.savings-note {
    flex: 1 1 240px;
    min-width: 200px;
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-control);
    background: var(--surface);
    color: var(--ink);
    font: inherit;
}


/* ---- Export schedules -------------------------------------------------------------------- */

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

.schedule-card {
    height: auto;
}

.schedule-card h3 {
    display: flex;
    gap: 8px;
    align-items: center;
}

.schedule-facts {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 6px 12px;
    margin: 12px 0 0;
    font-size: 0.92rem;
}

.schedule-facts dt {
    color: var(--ink-3);
}

.schedule-facts dd {
    margin: 0;
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.schedule-dialog {
    display: grid;
    gap: 16px;
}

.schedule-dialog fieldset {
    border: 0;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.schedule-dialog fieldset.parts,
.schedule-dialog fieldset.period-choice {
    display: flex;
    flex-wrap: wrap;
}

.schedule-dialog legend {
    font-weight: 600;
    margin-bottom: 6px;
}

.schedule-dialog label {
    display: grid;
    gap: 4px;
}

.schedule-dialog .chip {
    display: inline-flex;
}

.schedule-name {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 16px;
    align-items: end;
}

.switch-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 6px;
}

.check-line {
    display: flex !important;
    align-items: center;
    gap: 8px;
}

.form-row {
    display: flex;
    gap: 16px;
    align-items: end;
    flex-wrap: wrap;
}

.schedule-describe {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 8px;
}

.text-input {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-control);
    background: var(--surface);
    color: var(--ink);
    font: inherit;
}

.day-input {
    width: 90px;
}

.dept-recipients td {
    padding: 4px 6px 4px 0;
    border-bottom: 0;
}

/* ---------- Finny (assistant panel on the right) ---------- */
.shell.finny-open {
    grid-template-columns: 248px minmax(0, 1fr) 400px;
}

.finny-toggle {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 40;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 18px 8px 8px;
    border: 0;
    border-radius: 999px;
    background: var(--atg-navy);
    color: #ffffff;
    font: 600 1rem var(--font-ui);
    box-shadow: 0 6px 20px rgba(0, 41, 96, 0.28);
    cursor: pointer;
}

.finny-toggle:hover {
    background: var(--atg-blue);
}

.finny-toggle:focus-visible {
    outline: 3px solid var(--atg-glass);
    outline-offset: 2px;
}

.finny-toggle.is-open {
    display: none;
}

.finny-mark {
    display: block;
    width: 34px;
    height: 34px;
    flex: none;
}

.finny-panel {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border-left: 1px solid var(--line);
    min-width: 0;
}

.finny-panel[hidden] {
    display: none;
}

.finny-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 16px 12px;
    border-bottom: 1px solid var(--line-soft);
}

.finny-title {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.finny-title strong {
    font: 700 1.15rem var(--font-display);
    color: var(--heading);
}

.finny-title span {
    font-size: 0.85rem;
    color: var(--ink-3);
}

.finny-log {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.finny-intro p {
    margin: 0 0 10px;
}

.finny-examples {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.finny-examples .link-button {
    text-align: left;
}

.finny-msg {
    max-width: 92%;
    padding: 10px 14px;
    border-radius: 14px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.finny-msg p,
.finny-msg ul {
    margin: 0 0 8px;
}

.finny-msg > :last-child {
    margin-bottom: 0;
}

.finny-msg ul {
    padding-left: 18px;
}

.finny-msg.from-user {
    align-self: flex-end;
    background: var(--atg-blue);
    color: #ffffff;
    border-bottom-right-radius: 4px;
}

.finny-msg.from-finny {
    align-self: flex-start;
    background: var(--hover);
    color: var(--ink);
    border: 1px solid var(--line-soft);
    border-bottom-left-radius: 4px;
}

.finny-thinking {
    display: inline-flex;
    gap: 5px;
    padding: 14px 16px;
}

.finny-thinking span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--ink-3);
    animation: finny-dot 1.2s infinite ease-in-out;
}

.finny-thinking span:nth-child(2) {
    animation-delay: 0.15s;
}

.finny-thinking span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes finny-dot {
    0%, 80%, 100% {
        opacity: 0.3;
        transform: translateY(0);
    }

    40% {
        opacity: 1;
        transform: translateY(-3px);
    }
}

.finny-error {
    margin: 0 16px 8px;
}

.finny-input {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    padding: 12px 16px 6px;
    border-top: 1px solid var(--line-soft);
}

.finny-input textarea {
    flex: 1;
    resize: none;
    min-height: 44px;
    max-height: 160px;
}

.finny-foot {
    margin: 0;
    padding: 0 16px 14px;
    font-size: 0.8rem;
}

/* Narrower screens: the panel lies over the content instead of next to it. */
@media (max-width: 1280px) {
    .shell.finny-open {
        grid-template-columns: 248px minmax(0, 1fr);
    }

    .finny-panel {
        position: fixed;
        top: 0;
        right: 0;
        width: min(400px, 100vw);
        z-index: 50;
        box-shadow: -8px 0 28px rgba(0, 20, 50, 0.22);
    }
}

@media (max-width: 900px) {
    .shell.finny-open {
        grid-template-columns: minmax(0, 1fr);
    }

    .finny-toggle {
        right: 16px;
        bottom: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .finny-thinking span {
        animation: none;
    }
}

.finny-settings h2 {
    display: flex;
    align-items: center;
    gap: 10px;
}

.finny-settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 20px;
    align-items: end;
    margin: 8px 0 12px;
    max-width: 820px;
}

.finny-settings-grid > .switch-inline,
.finny-settings-grid > fieldset {
    grid-column: 1 / -1;
}

.finny-settings-grid fieldset {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    border: 0;
    margin: 0;
    padding: 0;
}

.finny-settings-grid legend {
    font-weight: 600;
    margin-bottom: 6px;
}

.finny-settings-grid .chip {
    display: inline-flex;
}

.finny-settings-grid .chip input[type=radio] {
    margin: 0 4px 0 0;
}

.finny-settings-grid label {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

@media (max-width: 700px) {
    .finny-settings-grid {
        grid-template-columns: 1fr;
    }
}

/* The Entra profile photo in place of the initials. */
.avatar-photo {
    object-fit: cover;
    background: var(--atg-blue);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35);
}

/* A report Finny made: open it in a new tab or download it as Excel. */
.finny-report {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    margin-top: 10px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
}

.finny-report-title {
    flex: 1;
    min-width: 0;
    font-weight: 600;
}

.finny-report-actions {
    display: inline-flex;
    gap: 6px;
}

.finny-report-button {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: transparent;
    color: var(--ink);
    font: 600 0.85rem var(--font-ui);
    cursor: pointer;
}

.finny-report-button:hover {
    background: var(--hover);
}

.finny-report-button:focus-visible {
    outline: 2px solid var(--atg-sky);
    outline-offset: 1px;
}

.finny-report-button .rzi {
    font-size: 1rem;
}

/* Thumbs under an answer. */
.finny-rate {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    font-size: 0.85rem;
}

.finny-rate .icon-button {
    width: 28px;
    height: 28px;
    color: var(--ink-3);
}

.finny-rate .icon-button .rzi {
    font-size: 1rem;
}

.finny-rate input {
    flex: 1;
    min-width: 0;
    padding: 4px 8px;
    font-size: 0.85rem;
}

.finny-usage {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin: 8px 0 16px;
}

.finny-usage .kpi-card-value {
    font-size: 1.4rem;
}

.finny-feedback-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.finny-feedback-list li {
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    padding: 10px 12px;
}

.finny-feedback-list .q {
    font-weight: 600;
}

.finny-feedback-list .a {
    color: var(--ink-2);
    white-space: pre-wrap;
    max-height: 7.5em;
    overflow: hidden;
}

.finny-prices {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 20px;
}

.finny-settings-grid > .finny-pseudo {
    grid-column: 1 / -1;
}

.finny-pseudo-note {
    margin-top: 0;
}

/* "Vraag Finny" next to a deviation. */
.section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 6px 12px;
}

.section-head h2 {
    margin-bottom: 0;
}

.ask-finny {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px 3px 4px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--ink);
    font: 600 0.8rem var(--font-ui);
    cursor: pointer;
}

.ask-finny:hover {
    background: var(--hover);
}

.ask-finny:focus-visible {
    outline: 2px solid var(--atg-sky);
    outline-offset: 1px;
}

.ask-finny img {
    width: 20px;
    height: 20px;
}

.savings-head .ask-finny {
    margin-top: 6px;
}

/* Contract from PDF (Finny). */
.contract-pdf {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px;
    margin-bottom: 16px;
    border: 1px dashed var(--line);
    border-radius: 10px;
    background: var(--hover);
}

.contract-pdf > img {
    width: 32px;
    height: 32px;
    flex: none;
}

.contract-pdf .contract-pdf-title {
    margin: 0 0 8px;
    font-weight: 600;
    color: var(--heading);
}

/* The file picker as an outlined app button (the native input is visually hidden inside it). */
.contract-pdf-pick {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    padding: 6px 14px;
    border: 1px solid var(--rz-primary);
    border-radius: var(--radius-control);
    background: var(--surface);
    color: var(--rz-primary);
    font-family: var(--font-ui);
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s;
}

    .contract-pdf-pick:hover {
        background: var(--rz-primary-lighter);
    }

    .contract-pdf-pick:has(input:focus-visible) {
        outline: 2px solid var(--rz-primary);
        outline-offset: 2px;
    }

    .contract-pdf-pick.is-busy {
        opacity: 0.6;
        cursor: progress;
    }

    .contract-pdf-pick .rzi {
        font-size: 1.15rem;
    }

.contract-pdf-file {
    margin-left: 10px;
    color: var(--ink-2);
    overflow-wrap: anywhere;
}

.contract-pdf p {
    margin: 6px 0 0;
}

/* Error boundary: one part failed, the rest of the app keeps working. */
.error-panel {
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius-panel);
    background: var(--surface);
}

.error-panel > .rzi {
    font-size: 2rem;
    color: var(--bad-ink);
}

.error-panel h2 {
    margin: 0;
}

.error-panel-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

#blazor-error-ui button.dismiss {
    background: none;
    border: 0;
    font: inherit;
    color: inherit;
}

/* Mandatory Entra fields on Instellingen. */
.mandatory-fields {
    border: 0;
    padding: 0;
    margin: 20px 0;
}

.mandatory-fields legend {
    font-weight: 600;
    margin-bottom: 4px;
}

.mandatory-group {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    align-items: start;
    gap: 8px;
    margin-top: 10px;
}

.mandatory-group-title {
    color: var(--ink-2);
    font-size: 0.9rem;
    padding-top: 8px;
}

.mandatory-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

@media (max-width: 700px) {
    .mandatory-group {
        grid-template-columns: minmax(0, 1fr);
    }
}

.side-subhead {
    margin: 8px 0 0;
    font-weight: 600;
}

/* Fixed values per office, department and company (Instellingen). */
.template-list {
    list-style: none;
    padding: 0;
    margin: 8px 0 12px;
    display: grid;
    gap: 6px;
}

.template-list li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-control);
}

.template-actions {
    margin-left: auto;
    display: flex;
}

.suggestion-hint .rzi {
    font-size: 1rem;
    vertical-align: -3px;
}
