/* Design tokens — shared palette derived from the CAO-module gold standard
   (MudBlazor default indigo). Used by the versioned-detail building blocks and
   any hand-rolled surfaces (e.g. the employment section on the employee detail). */
:root {
    --ind: #594ae2;
    --ind-dark: #4636c9;
    --ind-soft: #ece9fb;
    --ind-line: #d6cff5;
    --success: #5cb85c;
    --warn: #ff9800;
    --ink: #2c2c2c;
    --muted: #6b6b6b;
    --line: #e0e0e0;
    --bg: #f4f5f7;
    --card: #ffffff;
    --shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 1px 2px rgba(0, 0, 0, .08);
    --radius: 8px;
}

html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* Content canvas: light grey behind the white cards so they lift off the page
   (cao-module.html look). Appbar/drawer keep their own backgrounds.
   min-height fills the viewport so the grey runs all the way down on short pages. */
.mud-main-content {
    background-color: var(--bg);
    min-height: 100vh;
}

/* Page-header breadcrumbs (design system): small, muted, with indigo links and a
   bold ink current item. Global because MudBreadcrumbs is a child component that
   scoped/::deep CSS can't reach. */
.mud-breadcrumbs.mud-typography-body1 {
    font-size: 13px;
}

.mud-breadcrumbs .mud-breadcrumb-item a {
    color: var(--muted) !important;
}

.mud-breadcrumbs .mud-breadcrumb-item:not(.mud-disabled) a {
    color: var(--ind-dark) !important;
}

.mud-breadcrumbs .mud-breadcrumb-item:last-child a {
    color: var(--ink) !important;
    font-weight: 500;
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2Zy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NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

.markup h3 {
    margin-top: 1rem;
}

.markup ul {
    list-style-position: inside;
}

#components-reconnect-modal {
    color: #212121 !important;
    background-color: #ffffff !important;
}

.clickable-rows .mud-table-row {
    cursor: pointer;
}

/* ===== OrgAdminSelector — gecombineerd organisatie + administratie appbar-control =====
   Globaal (niet scoped): MudPopover-content wordt naar de popover-provider geteleporteerd,
   waardoor component-scoped .razor.css het niet bereikt. ctx-prefix houdt het geïsoleerd. */
.ctx-wrap { position: relative; margin-right: 16px; }
/* MudIcon (SVG) volgt de tekstkleur van zijn context binnen dit control */
.ctx-btn .mud-icon-root, .ctx-pop .mud-icon-root { fill: currentColor; }
.ctx-btn { display: flex; align-items: center; gap: 10px; background: rgba(255, 255, 255, .10);
    border: 1px solid rgba(255, 255, 255, .45); border-radius: 8px; padding: 6px 10px 6px 12px;
    cursor: pointer; color: #fff; font-family: inherit; max-width: 420px; text-transform: none; }
.ctx-btn:hover { background: rgba(255, 255, 255, .18); }
.ctx-btn.open { background: rgba(255, 255, 255, .20); }
.ctx-btn .ctx-lead { font-size: 22px; }
.ctx-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; text-align: left; }
.ctx-org { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctx-adm { font-size: 12px; font-weight: 400; opacity: .85; white-space: nowrap; overflow: hidden;
    text-overflow: ellipsis; display: flex; align-items: center; gap: 5px; }
.ctx-adm .ctx-warn-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: #ffb3b3;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, .35); }
.ctx-adm .ctx-warn-ico { flex: none; font-size: 15px; color: #ffb3b3; }
.ctx-btn.invalid { border-color: rgba(255, 179, 179, .85); }
.ctx-chev { font-size: 20px; margin-left: 2px; transition: transform .15s; }
.ctx-btn.open .ctx-chev { transform: rotate(180deg); }

/* popover-paneel — twee kolommen; MudBlazor-palette-vars = dark-mode-proof */
.ctx-pop { background: var(--mud-palette-surface); color: var(--mud-palette-text-primary);
    border-radius: 8px; min-width: 720px; max-width: calc(100vw - 24px); overflow: hidden; }
.ctx-cols { display: grid; grid-template-columns: minmax(240px, 1fr) minmax(360px, 1.4fr); }
.ctx-col { padding: 8px 0; }
.ctx-col + .ctx-col { border-left: 1px solid var(--mud-palette-lines-default); }
.ctx-colhead { font-size: 12px; text-transform: uppercase; letter-spacing: .5px;
    color: var(--mud-palette-text-secondary); font-weight: 500; padding: 8px 16px 6px;
    display: flex; align-items: center; gap: 6px; }
.ctx-colhead .ctx-ro-tag { margin-left: auto; text-transform: none; letter-spacing: 0; font-weight: 400;
    font-size: 11px; color: var(--mud-palette-text-secondary); font-style: italic; }
.ctx-search { display: flex; align-items: center; gap: 6px; margin: 2px 12px 8px; padding: 6px 10px;
    border: 1px solid var(--mud-palette-lines-default); border-radius: 6px; }
.ctx-search:focus-within { border-color: var(--mud-palette-primary); }
.ctx-search .ctx-search-ico { font-size: 18px; color: var(--mud-palette-text-secondary); }
.ctx-search input { border: none; outline: none; background: transparent; font-family: inherit;
    font-size: 13px; width: 100%; color: var(--mud-palette-text-primary); }
.ctx-list { max-height: 300px; overflow-y: auto; }
.ctx-opt { display: flex; align-items: flex-start; gap: 10px; padding: 11px 16px; cursor: pointer;
    font-size: 14px; color: var(--mud-palette-text-primary); }
.ctx-opt > .ctx-opt-ico { font-size: 20px; color: var(--mud-palette-text-secondary); margin-top: 1px; }
.ctx-opt:hover { background: var(--mud-palette-action-default-hover); }
.ctx-opt.active { background: var(--mud-palette-primary-hover); color: var(--mud-palette-primary); font-weight: 500; }
.ctx-opt.active > .ctx-opt-ico { color: var(--mud-palette-primary); }
.ctx-opt .ctx-check { margin-left: auto; font-size: 18px; color: var(--mud-palette-primary);
    visibility: hidden; margin-top: 1px; }
.ctx-opt.selected .ctx-check { visibility: visible; }
.ctx-opt.readonly { cursor: default; }
.ctx-opt.readonly:hover { background: var(--mud-palette-primary-hover); }
.ctx-opt-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; padding-right: 8px; }
.ctx-opt-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctx-opt-num { font-size: 11.5px; font-weight: 400; color: var(--mud-palette-text-secondary); margin-top: 2px; }
.ctx-opt.active .ctx-opt-num { color: var(--mud-palette-primary); opacity: .8; }
.ctx-opt-warn { display: flex; align-items: flex-start; gap: 6px; font-size: 12px; font-weight: 500;
    line-height: 1.4; color: var(--mud-palette-error); margin-top: 7px; }
.ctx-opt-warn .ctx-opt-warn-ico { flex: none; font-size: 15px; color: var(--mud-palette-error); margin-top: 1px; }
.ctx-opt-warn .ctx-opt-warn-txt { min-width: 0; }
.ctx-opt.invalid { cursor: not-allowed; opacity: .85; }
.ctx-opt.invalid .ctx-opt-name { color: var(--mud-palette-text-secondary); }
.ctx-opt.invalid .ctx-opt-num { color: var(--mud-palette-error); }
.ctx-opt.invalid > .ctx-opt-ico { color: var(--mud-palette-action-disabled); }
.ctx-opt.invalid:hover { background: transparent; }
.ctx-opt.invalid .ctx-check { display: none; }
.ctx-opt-fix { font-size: 11px; font-weight: 400; color: var(--mud-palette-text-secondary);
    margin-top: 4px; font-style: italic; }
.ctx-empty { padding: 22px 16px; color: var(--mud-palette-text-secondary); font-size: 13px; text-align: center; }
.ctx-foot { border-top: 1px solid var(--mud-palette-lines-default); padding: 9px 16px; font-size: 12px;
    color: var(--mud-palette-text-secondary); background: var(--mud-palette-background-grey);
    display: flex; align-items: center; gap: 6px; }
.ctx-foot .ctx-foot-ico { font-size: 16px; }
.ctx-foot.warn .ctx-foot-txt { color: var(--mud-palette-warning-darken); }
.ctx-foot.warn .ctx-foot-ico { color: var(--mud-palette-warning); }
.ctx-foot.err { background: var(--mud-palette-error-hover); }
.ctx-foot.err .ctx-foot-ico, .ctx-foot.err .ctx-foot-txt { color: var(--mud-palette-error); }
.ctx-overlay.mud-overlay .mud-overlay-scrim { background: transparent; }

@media (max-width: 900px) {
    .ctx-text { display: none; }
    .ctx-btn { max-width: none; padding: 8px 8px 8px 10px; gap: 4px; }
    .ctx-pop { min-width: 0; width: calc(100vw - 24px); max-width: calc(100vw - 24px); }
    .ctx-cols { grid-template-columns: 1fr; }
    .ctx-col + .ctx-col { border-left: none; border-top: 1px solid var(--mud-palette-lines-default); }
    .ctx-list { max-height: 220px; }
}

/* App-wide overview-grid styling (cao-module table look). Scoped to .mud-data-grid so
   inline MudTable editors (e.g. CAO parameters, pension age table) keep their own look. */
.mud-data-grid .mud-table-head .mud-table-cell {
    border-bottom: 2px solid var(--line);
}

.mud-data-grid .mud-table-head .column-header {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: var(--muted);
    font-weight: 500;
}

.mud-data-grid .mud-table-body .mud-table-cell {
    border-bottom: 1px solid var(--line);
}

.mud-data-grid .mud-table-body .mud-table-row:hover > .mud-table-cell {
    background-color: #f6f5fd;
}

/* Payslip page-break section — on-screen marker (the actual break is print-only, below) */
.payslip-page-break {
    display: flex;
    align-items: center;
    justify-content: center;
    border-top: 2px dashed var(--ind-line);
    margin: 8px 0;
    height: 0;
}

.payslip-page-break__label {
    transform: translateY(-50%);
    background: var(--card);
    padding: 0 10px;
    font-size: 0.7rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
}

/* PDF export — print only the rendered payslip and honour page breaks.
   Triggered by the PDF button on /administration/payslips (window.print → "Save as PDF"). */
@media print {
    /* margin:0 leaves no room for the browser's auto date/URL header & footer, so they disappear.
       The readable page margin is applied as padding on the payslip below instead. */
    @page {
        margin: 0;
    }

    /* Hide the application chrome; show only the isolated payslip area. */
    .mud-appbar,
    .mud-drawer,
    .mud-drawer-mini,
    .mud-overlay {
        display: none !important;
    }

    .mud-main-content {
        margin: 0 !important;
        padding: 0 !important;
    }

    body * {
        visibility: hidden;
    }

    #payslip-print-area,
    #payslip-print-area * {
        visibility: visible;
    }

    #payslip-print-area {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }

    /* Strip the on-screen "paper on a desk" chrome so the content fills the printed page. */
    #payslip-print-area .payslip-stage {
        background: none !important;
        padding: 0 !important;
        border-radius: 0 !important;
        overflow: visible !important;
    }

    #payslip-print-area .payslip-paper {
        max-width: none !important;
        width: 100% !important;
        min-height: 0 !important;
        padding: 14mm !important;
        box-shadow: none !important;
        border-radius: 0 !important;
    }

    /* The page-break section forces the following content onto a new page. */
    .payslip-page-break {
        border: 0 !important;
        margin: 0 !important;
        height: 0 !important;
        break-before: page;
        page-break-before: always;
    }

    .payslip-page-break__label {
        display: none !important;
    }
}