/* =========================================================================
   Components (ours). Prefer whitespace and hairlines over boxes: a "panel"
   is used only when content needs a frame (charts, tables, forms, lists).
   ========================================================================= */

/* ---------- Panels & sections ---------- */
.panel { background: var(--panel); border-radius: var(--r-lg); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .95rem 1.15rem; border-bottom: 1px solid var(--line); }
.panel-head h2, .panel-head h3, .panel-title { font-size: var(--t-base); font-weight: 650; margin: 0; display: flex; align-items: center; gap: .5rem; }
.panel-head .sub { font-size: var(--t-xs); color: var(--ink-3); font-weight: 500; }
.panel-body { padding: 1.15rem; }
.panel-foot { padding: .7rem 1.15rem; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: .75rem; font-size: var(--t-sm); color: var(--ink-3); }
.panel-flush > :last-child { border-bottom-left-radius: var(--r-lg); border-bottom-right-radius: var(--r-lg); }
.section { margin-top: 2rem; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: .85rem; }
.section-title { font-size: var(--t-md); font-weight: 650; margin: 0; }
.section-sub { font-size: var(--t-sm); color: var(--ink-3); margin: .15rem 0 0; }
.link-more { font-size: var(--t-sm); font-weight: 600; display: inline-flex; align-items: center; gap: .25rem; }
.grid-2 { display: grid; gap: 1.25rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { display: grid; gap: 1.25rem; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-main { display: grid; gap: 1.25rem; grid-template-columns: minmax(0, 1fr) 22rem; align-items: start; }
@media (max-width: 1199.98px) { .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-main { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 767.98px) { .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); } }

/* ---------- KPI strip: one frame, many numbers ---------- */
.kpis { display: grid; grid-template-columns: repeat(var(--kpi-cols, 4), minmax(0, 1fr)); gap: .85rem; }
.kpi { padding: 1rem 1.1rem 1.1rem; position: relative; min-width: 0; color: inherit; text-decoration: none !important; display: block; text-align: center; background: var(--panel); border-radius: var(--r-lg); transition: background-color var(--dur); }
a.kpi:hover { background: var(--raised); color: inherit; }
.kpi-label { font-size: var(--t-sm); color: var(--ink-3); font-weight: 500; display: flex; align-items: center; justify-content: space-between; gap: .5rem; min-height: 1.75rem; text-align: left; }
.kpi-ico { width: 1.75rem; height: 1.75rem; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-size: .85rem; }
.kpi-value { font-size: 1.9rem; font-weight: 650; letter-spacing: -.025em; line-height: 1.15; margin-top: .55rem; color: var(--ink); }
.kpi-value small { font-size: var(--t-sm); font-weight: 600; color: var(--ink-3); letter-spacing: 0; margin-left: .15rem; }
.kpi-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .3rem .5rem; margin-top: .35rem; font-size: var(--t-xs); color: var(--ink-3); min-height: 1.2rem; }
.kpi .spark { position: absolute; right: 1rem; bottom: 1rem; width: 4.5rem; height: 1.4rem; }
.kpi-alert { box-shadow: inset 0 0 0 1.5px var(--warn); }
@media (max-width: 991.98px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.delta { white-space: nowrap; display: inline-flex; align-items: center; gap: .15rem; font-size: var(--t-xs); font-weight: 650; padding: .05rem .35rem; border-radius: var(--r-pill); }
.delta-good { color: var(--ok); background: var(--ok-soft); } .delta-bad { color: var(--bad); background: var(--bad-soft); } .delta-flat { color: var(--ink-3); background: var(--mute-soft); }

/* ---------- Data table ---------- */
.dt-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.dt-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; padding: .75rem .9rem; border-bottom: 1px solid var(--line); }
.dt-toolbar .grow { flex: 1 1 14rem; min-width: 0; }
.dt-toolbar .form-control, .dt-toolbar .form-select { min-height: 2.2rem; padding-top: .38rem; padding-bottom: .38rem; font-size: var(--t-sm); box-shadow: none; }
.dt-scroll { overflow: auto; max-height: var(--dt-max, none); }
.dt { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--t-sm); }
.dt thead th { position: sticky; top: 0; z-index: 2; background: var(--raised); color: var(--ink-3); font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; text-align: left; padding: .6rem 1rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.dt thead th:first-child { border-top-left-radius: var(--r-lg); } .dt thead th:last-child { border-top-right-radius: var(--r-lg); }
.dt-toolbar + .dt-scroll .dt thead th { border-radius: 0; }
.dt tbody td { padding: .72rem 1rem; border-bottom: 1px solid var(--line); vertical-align: middle; color: var(--ink); }
.dt tbody tr:last-child td { border-bottom: 0; }
.dt tbody tr { transition: background-color var(--dur); }
.dt tbody tr:hover td { background: var(--raised); }
.dt tbody tr.is-selected td { background: var(--brand-soft); }
.dt .end, .dt th.end { text-align: right; }
.dt .shrink { width: 1%; white-space: nowrap; }
.dt .muted { color: var(--ink-3); }
.dt .primary-cell { font-weight: 600; color: var(--ink); }
.dt .primary-cell a { color: var(--ink); }
.dt .primary-cell a:hover { color: var(--brand); }
.dt .sub { display: block; font-size: var(--t-xs); color: var(--ink-3); font-weight: 450; margin-top: .1rem; }
.dt th[data-sort] { cursor: pointer; user-select: none; }
.dt th[data-sort]:hover { color: var(--ink); }
.dt th[data-sort]::after { font-family: "bootstrap-icons"; content: "\F127"; margin-left: .35rem; font-size: .7rem; opacity: .35; }
.dt th[aria-sort="ascending"]::after { content: "\F148"; opacity: 1; color: var(--brand); }
.dt th[aria-sort="descending"]::after { content: "\F128"; opacity: 1; color: var(--brand); }
.dt .check { width: 2.6rem; padding-right: 0; }
.dt-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; padding: .65rem .9rem; border-top: 1px solid var(--line); font-size: var(--t-sm); color: var(--ink-3); }
.dt-empty td { padding: 0 !important; }
.row-actions { display: flex; justify-content: flex-end; align-items: center; gap: .35rem; }
.person { display: flex; align-items: center; gap: .65rem; min-width: 0; }
.person-name { font-weight: 600; color: var(--ink); line-height: 1.25; }
.person-name a { color: inherit; }
.person-sub { font-size: var(--t-xs); color: var(--ink-3); }
.bulkbar { position: sticky; bottom: 1rem; z-index: 5; display: none; align-items: center; gap: .75rem; margin: .75rem auto 0; width: fit-content; max-width: 100%; padding: .55rem .6rem .55rem 1rem; background: var(--ink); color: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-3); animation: pop var(--dur) var(--ease); }
.bulkbar.is-visible { display: flex; }
.bulkbar .count { font-weight: 650; font-size: var(--t-sm); }
.bulkbar .btn-quiet { --bs-btn-color: var(--surface); --bs-btn-hover-bg: color-mix(in srgb, var(--surface) 14%, transparent); --bs-btn-hover-color: var(--surface); }
@media (max-width: 767.98px) {
    .dt-cards thead { display: none; }
    .dt-cards, .dt-cards tbody, .dt-cards tr, .dt-cards td { display: block; width: 100%; }
    .dt-cards tr { padding: .85rem 1rem; border-bottom: 1px solid var(--line); }
    .dt-cards tbody tr:last-child { border-bottom: 0; }
    .dt-cards td { border: 0 !important; padding: .2rem 0 !important; display: flex; justify-content: space-between; align-items: center; gap: 1rem; text-align: right; }
    .dt-cards td::before { content: attr(data-label); font-size: var(--t-xs); font-weight: 600; color: var(--ink-3); text-align: left; text-transform: none; }
    .dt-cards td.primary-cell { display: block; text-align: left; font-size: var(--t-base); padding-bottom: .4rem !important; }
    .dt-cards td.primary-cell::before, .dt-cards td.check::before, .dt-cards td.actions::before, .dt-cards td[data-label=""]::before { content: none; }
    .dt-cards td.actions { justify-content: flex-start; padding-top: .55rem !important; }
    .dt-cards td.check { position: absolute; right: 1rem; width: auto; }
    .dt-cards tr { position: relative; }
    .dt-cards tbody tr:hover td { background: transparent; }
}

/* ---------- Segmented control & filter chips ---------- */
.seg { display: inline-flex; padding: .2rem; background: var(--sunken); border-radius: var(--r); gap: .15rem; flex-wrap: wrap; }
.seg a, .seg button, .seg label { display: inline-flex; align-items: center; gap: .4rem; padding: .32rem .7rem; border-radius: 7px; font-size: var(--t-sm); font-weight: 600; color: var(--ink-3); text-decoration: none !important; border: 0; background: transparent; cursor: pointer; white-space: nowrap; transition: background-color var(--dur), color var(--dur), box-shadow var(--dur); }
.seg a:hover, .seg label:hover { color: var(--ink); }
.seg .active, .seg input:checked + label { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg input:focus-visible + label { outline: 2px solid var(--brand); }
.seg .count { font-size: .68rem; font-weight: 700; color: var(--ink-3); }
.chip { display: inline-flex; align-items: center; gap: .35rem; padding: .25rem .6rem; border-radius: var(--r-pill); background: var(--sunken); color: var(--ink-2); font-size: var(--t-xs); font-weight: 600; }
.chip a { color: inherit; display: inline-grid; }

/* ---------- Radio cards (choose a leave type, a period…) ---------- */
.rcards { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); }
.fiscal-custom { display: none; }
.fiscal-choice:has(#fy-custom:checked) .fiscal-custom { display: flex; }
.rcard { position: relative; }
.rcard input { position: absolute; opacity: 0; }
.rcard label { display: block; height: 100%; padding: .8rem .9rem; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); cursor: pointer; transition: border-color var(--dur), box-shadow var(--dur), background-color var(--dur); }
.rcard label:hover { border-color: var(--ink-3); }
.rcard input:checked + label { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand), 0 0 0 4px var(--focus); background: color-mix(in srgb, var(--brand-soft) 45%, var(--surface)); }
.rcard input:focus-visible + label { outline: 2px solid var(--brand); outline-offset: 2px; }
.rcard-title { font-weight: 650; display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.rcard-meta { font-size: var(--t-xs); color: var(--ink-3); margin-top: .2rem; }
.rcard input:checked + label .rcard-title::after { font-family: "bootstrap-icons"; content: "\F26A"; color: var(--brand); }

/* ---------- Avatars ---------- */
.avatar { width: 2rem; height: 2rem; border-radius: 50%; display: inline-grid; place-items: center; font-size: .72rem; font-weight: 700; letter-spacing: .02em; flex: none; color: var(--av-ink); background: var(--av-bg); }
.avatar-sm { width: 1.6rem; height: 1.6rem; font-size: .62rem; }
.avatar-lg { width: 2.75rem; height: 2.75rem; font-size: .9rem; }
.avatar-xl { width: 3.75rem; height: 3.75rem; font-size: 1.15rem; }
.av-0 { --av-bg: #dcefe9; --av-ink: #0b5a4d; } .av-1 { --av-bg: #e1ecfb; --av-ink: #1b4f9c; } .av-2 { --av-bg: #fbecd7; --av-ink: #8a4f06; } .av-3 { --av-bg: #ece6f8; --av-ink: #5b3fa3; }
.av-4 { --av-bg: #f9e3e5; --av-ink: #a3313b; } .av-5 { --av-bg: #e2f2e4; --av-ink: #2f6b3a; } .av-6 { --av-bg: #e6eef0; --av-ink: #2d5662; } .av-7 { --av-bg: #f3e8dc; --av-ink: #7a4a1f; }
[data-bs-theme="dark"] .avatar { --av-bg: color-mix(in srgb, var(--av-ink) 30%, #131a17); --av-ink: #e9eeeb; }
.avatar-stack { display: inline-flex; }
.avatar-stack .avatar { box-shadow: 0 0 0 2px var(--surface); }
.avatar-stack .avatar + .avatar { margin-left: -.45rem; }

/* ---------- Progress, rings, meters ---------- */
.ring { width: 3.6rem; height: 3.6rem; flex: none; }
.ring .track { stroke: var(--sunken); }
.ring .fill { stroke: var(--brand); stroke-linecap: round; transform-origin: 50% 50%; transform: rotate(-90deg); animation: ring-in 700ms var(--ease) both; }
.ring text { fill: var(--ink); font-size: 8.5px; font-weight: 700; font-family: var(--font); }
@keyframes ring-in { from { stroke-dasharray: 0 200; } }
.meter { height: .45rem; border-radius: var(--r-pill); background: var(--sunken); overflow: hidden; display: flex; }
.meter > span { display: block; height: 100%; }
.meter .m-used { background: var(--ink-3); } .meter .m-pending { background: var(--warn); } .meter .m-free { background: var(--brand); }
progress.bar { appearance: none; -webkit-appearance: none; width: 100%; height: .45rem; border: 0; border-radius: var(--r-pill); background: var(--sunken); overflow: hidden; display: block; }
progress.bar::-webkit-progress-bar { background: var(--sunken); border-radius: var(--r-pill); }
progress.bar::-webkit-progress-value { background: var(--brand); border-radius: var(--r-pill); transition: width .6s var(--ease); }
progress.bar::-moz-progress-bar { background: var(--brand); border-radius: var(--r-pill); }
progress.bar.warn::-webkit-progress-value { background: var(--warn); } progress.bar.warn::-moz-progress-bar { background: var(--warn); }
progress.bar.bad::-webkit-progress-value { background: var(--bad); } progress.bar.bad::-moz-progress-bar { background: var(--bad); }
.legend { display: flex; flex-wrap: wrap; gap: .4rem 1rem; font-size: var(--t-xs); color: var(--ink-3); }
.legend .dot { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; margin-right: .35rem; vertical-align: -.02em; }

/* ---------- Charts (SVG) ---------- */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-dasharray: 2 4; }
.chart .ax { fill: var(--ink-3); font-size: 11px; font-family: var(--font); }
.chart .val { fill: var(--ink-2); font-size: 11px; font-weight: 650; font-family: var(--font); }
.chart .bar { fill: var(--c1); transition: opacity var(--dur); }
.chart .bar:hover { opacity: .8; }
.chart .bar-zero { fill: var(--line-strong); }
.chart .cmp { fill: none; stroke: var(--c3); stroke-width: 2; stroke-dasharray: 4 4; stroke-linejoin: round; }
.chart .area-stop-a { stop-color: var(--c1); stop-opacity: .22; }
.chart .area-stop-b { stop-color: var(--c1); stop-opacity: 0; }
.chart .area-line { fill: none; stroke: var(--c1); stroke-width: 2.5; stroke-linecap: round; }
.chart .area-rule { stroke: var(--line-strong); }
.chart .area-dot { fill: var(--c1); stroke: var(--panel); stroke-width: 2; }
.chart .area-hit { fill: transparent; }
.chart-scroll { overflow-x: auto; }
.chart-scroll .chart { min-width: 520px; }
.donut { width: 9.5rem; height: 9.5rem; flex: none; }
.donut-track { stroke: var(--sunken); }
.donut-seg { transition: opacity var(--dur); }
.donut-seg:hover { opacity: .8; }
.seg-1 { stroke: var(--c1); } .seg-2 { stroke: var(--c2); } .seg-3 { stroke: var(--c3); } .seg-4 { stroke: var(--c4); } .seg-5 { stroke: var(--c5); } .seg-6 { stroke: var(--c6); }
.dot-1 { background: var(--c1); } .dot-2 { background: var(--c2); } .dot-3 { background: var(--c3); } .dot-4 { background: var(--c4); } .dot-5 { background: var(--c5); } .dot-6 { background: var(--c6); }
.donut-center { fill: var(--ink); font-size: 6.5px; font-weight: 700; font-family: var(--font); }
.spark polyline { fill: none; stroke: var(--brand); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.donut-wrap { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.donut-legend .dot { flex: none; width: .6rem; height: .6rem; border-radius: 50%; }
.donut-legend .pct { color: var(--ink-3); font-weight: 400; margin-left: .5rem; }

/* Overview: centred heading over a KPI row, then trend + breakdown */
.overview-charts { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: .85rem; }
.overview-charts > .panel { display: flex; flex-direction: column; }
.overview-charts .panel-body { flex: 1; display: grid; align-content: center; }
@media (max-width: 1199.98px) { .overview-charts { grid-template-columns: minmax(0, 1fr); } }
.panel-chart .panel-head { position: relative; display: block; text-align: center; border-bottom: 0; padding: 1.25rem 1.15rem .35rem; }
.panel-chart .panel-head h3 { justify-content: center; font-size: var(--t-md); font-weight: 550; }
.panel-chart .panel-head .sub { display: block; font-size: var(--t-sm); margin-top: .15rem; }
.panel-chart .panel-head .legend { justify-content: center; margin-top: .4rem; }
.panel-link { position: absolute; top: 1.3rem; right: 1.15rem; font-size: var(--t-sm); }
.donut-legend { list-style: none; padding: 0; margin: 0; display: grid; gap: .45rem; font-size: var(--t-sm); flex: 1; min-width: 10rem; }
.donut-legend li { display: flex; align-items: center; gap: .5rem; }
.donut-legend .v { margin-left: auto; font-weight: 650; font-variant-numeric: tabular-nums; }
.hbar { display: grid; grid-template-columns: minmax(6rem, 10rem) minmax(0, 1fr) 3.5rem; align-items: center; gap: .75rem; font-size: var(--t-sm); padding: .3rem 0; }
.hbar .v { text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; }

/* ---------- Empty, skeleton ---------- */
.empty { text-align: center; padding: 2.5rem 1.25rem; max-width: 26rem; margin: 0 auto; }
.empty-art { width: 3.5rem; height: 3.5rem; border-radius: 1rem; margin: 0 auto .9rem; display: grid; place-items: center; font-size: 1.45rem; color: var(--brand); background: var(--brand-soft); position: relative; }
.empty-art::after { content: ""; position: absolute; inset: -6px; border-radius: 1.3rem; border: 1px dashed color-mix(in srgb, var(--brand) 30%, transparent); }
.empty-title { font-size: var(--t-base); font-weight: 650; margin: 0 0 .3rem; }
.empty-text { font-size: var(--t-sm); color: var(--ink-3); margin: 0; }
.empty-actions { margin-top: 1rem; display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; }
.sk { display: block; border-radius: var(--r-sm); background: linear-gradient(90deg, var(--sunken) 0%, color-mix(in srgb, var(--sunken) 40%, var(--surface)) 50%, var(--sunken) 100%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
.sk-line { height: .7rem; margin: .35rem 0; } .sk-line.w-60 { width: 60%; } .sk-line.w-40 { width: 40%; } .sk-circle { width: 2rem; height: 2rem; border-radius: 50%; flex: none; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- Toasts ---------- */
.toast-region { position: fixed; z-index: 2000; top: calc(var(--top-h) + .5rem); right: 1rem; display: grid; gap: .5rem; width: min(24rem, calc(100vw - 2rem)); pointer-events: none; }
.toastx { pointer-events: auto; display: flex; gap: .7rem; align-items: flex-start; padding: .8rem .85rem .8rem 1rem; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-3); position: relative; overflow: hidden; animation: toast-in 240ms var(--ease); }
.toastx .ico { font-size: 1.1rem; line-height: 1.35; }
.toastx.ok .ico { color: var(--ok); } .toastx.bad .ico { color: var(--bad); } .toastx.info .ico { color: var(--info); }
.toastx .msg { flex: 1; font-size: var(--t-sm); font-weight: 550; line-height: 1.45; overflow-wrap: anywhere; }
.toastx .close { border: 0; background: transparent; color: var(--ink-3); padding: 0 .1rem; line-height: 1; font-size: 1.1rem; }
.toastx .close:hover { color: var(--ink); }
.toastx.ok::after { content: ""; position: absolute; left: 0; bottom: 0; height: 2px; background: var(--ok); animation: toast-timer 6s linear forwards; }
.toastx.is-leaving { animation: toast-out 200ms var(--ease) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(16px); } }
@keyframes toast-timer { from { width: 100%; } to { width: 0; } }
@media (max-width: 767.98px) { .toast-region { top: auto; bottom: calc(var(--bottom-h) + .75rem + env(safe-area-inset-bottom)); right: .75rem; left: .75rem; width: auto; } }

/* ---------- Dialogs (native <dialog>) ---------- */
dialog.dlg { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 0; width: min(28rem, calc(100vw - 2rem)); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-3); }
dialog.dlg[open] { animation: dlg-in 200ms var(--ease); }
dialog.dlg::backdrop { background: rgba(10, 16, 14, .45); backdrop-filter: blur(2px); animation: fade-in 200ms var(--ease); }
@keyframes dlg-in { from { opacity: 0; transform: translateY(8px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.dlg-body { padding: 1.35rem 1.35rem 1rem; display: flex; gap: 1rem; }
.dlg-icon { width: 2.6rem; height: 2.6rem; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 1.2rem; background: var(--brand-soft); color: var(--brand); }
.dlg-danger .dlg-icon { background: var(--bad-soft); color: var(--bad); }
.dlg-title { font-size: var(--t-md); font-weight: 650; margin: .1rem 0 .3rem; }
.dlg-text { font-size: var(--t-sm); color: var(--ink-2); margin: 0; }
.dlg-foot { display: flex; justify-content: flex-end; gap: .5rem; padding: .85rem 1.35rem 1.2rem; }
.dlg-wide { width: min(40rem, calc(100vw - 2rem)); }

/* ---------- Command palette ---------- */
dialog.cmdk { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 0; margin: 12vh auto auto; width: min(38rem, calc(100vw - 2rem)); max-height: 70vh; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-3); overflow: hidden; }
dialog.cmdk[open] { display: flex; flex-direction: column; animation: dlg-in 180ms var(--ease); }
dialog.cmdk::backdrop { background: rgba(10, 16, 14, .4); backdrop-filter: blur(2px); }
.cmdk-input { display: flex; align-items: center; gap: .65rem; padding: .9rem 1.1rem; border-bottom: 1px solid var(--line); }
.cmdk-input .bi { color: var(--ink-3); font-size: 1.05rem; }
.cmdk-input input { flex: 1; border: 0; outline: 0; background: transparent; font-size: var(--t-md); color: var(--ink); min-width: 0; }
.cmdk-list { overflow-y: auto; padding: .4rem; flex: 1; }
.cmdk-group { font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); padding: .6rem .7rem .3rem; }
.cmdk-item { display: flex; align-items: center; gap: .7rem; padding: .55rem .7rem; border-radius: var(--r-sm); color: var(--ink); text-decoration: none !important; font-size: var(--t-sm); cursor: pointer; }
.cmdk-item .bi { color: var(--ink-3); width: 1.1rem; text-align: center; }
.cmdk-item .hint { margin-left: auto; font-size: var(--t-xs); color: var(--ink-3); }
.cmdk-item[aria-selected="true"] { background: var(--brand-soft); color: var(--brand-ink); }
.cmdk-item[aria-selected="true"] .bi { color: var(--brand); }
.cmdk-empty { padding: 2rem 1rem; text-align: center; color: var(--ink-3); font-size: var(--t-sm); }
.cmdk-foot { display: flex; gap: 1rem; padding: .55rem 1.1rem; border-top: 1px solid var(--line); font-size: var(--t-xs); color: var(--ink-3); background: var(--raised); }
.shortcut-list { display: grid; grid-template-columns: 1fr auto; gap: .6rem 1.5rem; font-size: var(--t-sm); margin: 0; }
.shortcut-list dt { font-weight: 500; color: var(--ink-2); } .shortcut-list dd { margin: 0; text-align: right; }

/* ---------- Notification peek ---------- */
.peek { width: min(23rem, calc(100vw - 1.5rem)); padding: 0 !important; overflow: hidden; }
.peek-head { display: flex; align-items: center; justify-content: space-between; padding: .75rem 1rem; border-bottom: 1px solid var(--line); }
.peek-head strong { font-size: var(--t-sm); }
.peek-list { max-height: 22rem; overflow-y: auto; }
.peek-item { display: flex; gap: .65rem; padding: .7rem 1rem; color: var(--ink); text-decoration: none !important; border-bottom: 1px solid var(--line); position: relative; }
.peek-item:hover { background: var(--raised); color: var(--ink); }
.peek-item.unread::before { content: ""; position: absolute; left: .4rem; top: 1.1rem; width: .4rem; height: .4rem; border-radius: 50%; background: var(--brand); }
.peek-item .t { font-size: var(--t-sm); font-weight: 650; line-height: 1.3; }
.peek-item .m { font-size: var(--t-xs); color: var(--ink-3); margin-top: .1rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.peek-item .w { font-size: .68rem; color: var(--ink-3); margin-top: .2rem; }
.peek-foot { display: block; text-align: center; padding: .6rem; font-size: var(--t-sm); font-weight: 600; background: var(--raised); }
.ico-chip { width: 2rem; height: 2rem; border-radius: .6rem; display: grid; place-items: center; flex: none; font-size: .95rem; background: var(--mute-soft); color: var(--mute); }
.ico-chip.ok { background: var(--ok-soft); color: var(--ok); } .ico-chip.warn { background: var(--warn-soft); color: var(--warn); } .ico-chip.bad { background: var(--bad-soft); color: var(--bad); } .ico-chip.info { background: var(--info-soft); color: var(--info); } .ico-chip.brand { background: var(--brand-soft); color: var(--brand); }

/* ---------- Timeline (approval steps, activity) ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.tl-item { position: relative; display: flex; gap: .85rem; padding-bottom: 1.15rem; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before { content: ""; position: absolute; left: .95rem; top: 2.1rem; bottom: .2rem; width: 2px; background: var(--line); border-radius: 2px; }
.tl-item:last-child::before { display: none; }
.tl-dot { width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: .9rem; background: var(--mute-soft); color: var(--mute); position: relative; z-index: 1; box-shadow: 0 0 0 4px var(--surface); }
.tl-ok .tl-dot { background: var(--ok-soft); color: var(--ok); } .tl-bad .tl-dot { background: var(--bad-soft); color: var(--bad); }
.tl-warn .tl-dot { background: var(--warn-soft); color: var(--warn); } .tl-brand .tl-dot { background: var(--brand-soft); color: var(--brand); }
.tl-body { flex: 1; min-width: 0; padding-top: .15rem; }
.tl-title { font-weight: 600; font-size: var(--t-sm); line-height: 1.35; }
.tl-meta { font-size: var(--t-xs); color: var(--ink-3); margin-top: .1rem; }
.tl-note { margin-top: .45rem; padding: .5rem .75rem; background: var(--raised); border: 1px solid var(--line); border-radius: var(--r-sm); font-size: var(--t-sm); color: var(--ink-2); }

/* ---------- Detail list & meta ---------- */
.dl { display: grid; grid-template-columns: minmax(8rem, 12rem) minmax(0, 1fr); gap: .7rem 1.25rem; margin: 0; font-size: var(--t-sm); }
.dl dt { color: var(--ink-3); font-weight: 550; } .dl dd { margin: 0; color: var(--ink); }
@media (max-width: 575.98px) { .dl { grid-template-columns: minmax(0, 1fr); gap: .15rem; } .dl dd { margin-bottom: .6rem; } }
.meta-row { display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; font-size: var(--t-sm); color: var(--ink-3); }
.meta-row > span { display: inline-flex; align-items: center; gap: .35rem; }

/* ---------- Forms: sections and sticky actions ---------- */
.form-section { display: grid; grid-template-columns: minmax(0, 17rem) minmax(0, 1fr); gap: 1.5rem 3rem; padding: 1.75rem 0; border-top: 1px solid var(--line); }
.form-section:first-of-type { border-top: 0; padding-top: .25rem; }
.form-section-aside h2 { font-size: var(--t-base); font-weight: 650; margin: 0 0 .3rem; }
.form-section-aside p { font-size: var(--t-sm); color: var(--ink-3); margin: 0; }
.form-section-body { display: grid; gap: 1.1rem; max-width: 40rem; }
.field-row { display: grid; gap: 1rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field-row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 991.98px) { .form-section { grid-template-columns: minmax(0, 1fr); gap: 1rem; } }
@media (max-width: 575.98px) { .field-row, .field-row-3 { grid-template-columns: minmax(0, 1fr); } }
.form-actions { display: flex; align-items: center; gap: .6rem; padding-top: 1.25rem; border-top: 1px solid var(--line); margin-top: .5rem; }
.form-actions .spacer { flex: 1; }
.sticky-actions { position: sticky; bottom: 0; z-index: 10; margin: 1.5rem calc(-1 * var(--page-px, 2rem)) -4rem; padding: .85rem var(--page-px, 2rem); background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); border-top: 1px solid var(--line); display: flex; align-items: center; gap: .6rem; }
.sticky-actions .note { font-size: var(--t-xs); color: var(--ink-3); margin-right: auto; }
@media (max-width: 767.98px) { .sticky-actions { bottom: calc(var(--bottom-h) + env(safe-area-inset-bottom)); margin: 1.25rem calc(-1 * var(--page-px)) 0; padding: .7rem var(--page-px); } .sticky-actions .btn { flex: 1; } .sticky-actions .note { display: none; } }
.switch-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: .85rem 0; border-top: 1px solid var(--line); }
.switch-row:first-child { border-top: 0; padding-top: 0; }
.switch-row .t { font-weight: 600; font-size: var(--t-sm); } .switch-row .d { font-size: var(--t-xs); color: var(--ink-3); margin-top: .1rem; }
.switch-row .form-check { margin: 0; padding: 0; } .switch-row .form-switch .form-check-input { margin: .1rem 0 0; float: none; }

/* ---------- Checklist (onboarding) ---------- */
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: flex; align-items: center; gap: .75rem; padding: .7rem 0; border-top: 1px solid var(--line); font-size: var(--t-sm); }
.checklist li:first-child { border-top: 0; }
.checklist .tick { width: 1.45rem; height: 1.45rem; border-radius: 50%; border: 1.5px dashed var(--line-strong); display: grid; place-items: center; flex: none; color: transparent; font-size: .8rem; }
.checklist .done .tick { border: 0; background: var(--ok); color: #fff; }
[data-bs-theme="dark"] .checklist .done .tick { color: #04210f; }
.checklist .done .label { color: var(--ink-3); text-decoration: line-through; }
.checklist .label { flex: 1; font-weight: 550; }

/* width steps for meters (CSP forbids style attributes) */
.pw-0 { width: 0%; } .pw-5 { width: 5%; } .pw-10 { width: 10%; } .pw-15 { width: 15%; } .pw-20 { width: 20%; } .pw-25 { width: 25%; } .pw-30 { width: 30%; } .pw-35 { width: 35%; } .pw-40 { width: 40%; } .pw-45 { width: 45%; } .pw-50 { width: 50%; } .pw-55 { width: 55%; } .pw-60 { width: 60%; } .pw-65 { width: 65%; } .pw-70 { width: 70%; } .pw-75 { width: 75%; } .pw-80 { width: 80%; } .pw-85 { width: 85%; } .pw-90 { width: 90%; } .pw-95 { width: 95%; } .pw-100 { width: 100%; } 
.kpis-3 { --kpi-cols: 3; } .kpis-4 { --kpi-cols: 4; } .kpis-2 { --kpi-cols: 2; } .kpis-5 { --kpi-cols: 5; } .kpis-6 { --kpi-cols: 6; }
@media (max-width: 1399.98px) { .kpis-6 { --kpi-cols: 3; } }
.dot-warn { background: var(--warn); } .dot-bad { background: var(--bad); } .dot-mute { background: var(--line-strong); } .dot-info { background: var(--info); } .dot-ok { background: var(--ok); } .dot-plan { background: transparent; border: 1px dashed var(--brand); }
.min-w-0 { min-width: 0; }
.empty-sm .empty { padding: 1.5rem 1rem; } .empty-sm .empty-art { width: 2.75rem; height: 2.75rem; font-size: 1.15rem; margin-bottom: .6rem; }
.border-brand { border-color: var(--brand) !important; box-shadow: 0 0 0 1px var(--brand); }
details.disclosure > summary { list-style: none; cursor: pointer; border-bottom: 0; }
details.disclosure > summary::-webkit-details-marker { display: none; }
details.disclosure > summary::after { font-family: "bootstrap-icons"; content: "\F282"; color: var(--ink-3); transition: transform var(--dur); margin-left: .5rem; }
details.disclosure[open] > summary { border-bottom: 1px solid var(--line); }
details.disclosure[open] > summary::after { transform: rotate(180deg); }
details.disclosure > summary .sub { margin-left: auto; }
.plan-card { transition: border-color var(--dur), box-shadow var(--dur), transform var(--dur); } .plan-card:hover { border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); box-shadow: var(--shadow-2); transform: translateY(-1px); }
.codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: .5rem; }
.codes code { display: block; text-align: center; padding: .5rem; font-size: var(--t-sm); letter-spacing: .08em; background: var(--raised); color: var(--ink); border: 1px dashed var(--line-strong); }
.qr-box { display: inline-block; padding: .75rem; background: #fff; border: 1px solid var(--line); border-radius: var(--r); }
.qr-box svg { display: block; width: 168px; height: 168px; }
.tl-dot { font-weight: 700; font-size: var(--t-sm); }
.grid-main .sticky-actions { margin: 1.5rem 0 0; border: 1px solid var(--line); border-radius: var(--r-lg); padding: .75rem 1rem; box-shadow: var(--shadow-2); }
@media (max-width: 767.98px) { .grid-main .sticky-actions { margin: 1.25rem 0 0; } }
.grid-main > *, .grid-2 > *, .grid-3 > * { min-width: 0; }
.panel { min-width: 0; }
.is-past { background: var(--raised); } .is-past .t { color: var(--ink-2); } .is-past .date-tile { background: var(--mute-soft); }
.btn.disabled, .btn:disabled { opacity: 1; color: var(--ink-3) !important; }
.btn-primary.disabled, .btn-primary:disabled { background: var(--sunken); border-color: var(--line); }

/* ---------- Date-range picker ---------- */
[data-daterange] { position: relative; }
[data-daterange] { position: relative; }
.drp { position: absolute; z-index: 1050; top: calc(100% + .35rem); left: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-3); padding: .75rem; animation: pop var(--dur) var(--ease); }
.drp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .35rem; }
.drp-hint { font-size: var(--t-xs); color: var(--ink-3); font-weight: 600; }
.drp-months { display: flex; gap: 1.25rem; }
.drp-title { font-weight: 650; font-size: var(--t-sm); text-align: center; margin-bottom: .35rem; }
.drp-grid { display: grid; grid-template-columns: repeat(7, 2.15rem); gap: 2px; }
.drp-dow { font-size: .66rem; font-weight: 700; color: var(--ink-3); text-align: center; padding: .2rem 0; }
.drp-day { height: 2.1rem; border: 0; border-radius: 7px; background: transparent; color: var(--ink); font-size: var(--t-sm); font-variant-numeric: tabular-nums; position: relative; }
.drp-day:hover:not(:disabled) { background: var(--sunken); }
.drp-day:disabled { color: var(--line-strong); }
.drp-day.is-off { color: var(--ink-3); background: repeating-linear-gradient(-45deg, transparent, transparent 3px, color-mix(in srgb, var(--sunken) 80%, transparent) 3px, color-mix(in srgb, var(--sunken) 80%, transparent) 6px); }
.drp-day.is-hol { color: var(--info); font-weight: 700; }
.drp-day.is-hol::after { content: ""; position: absolute; bottom: .25rem; left: 50%; width: .3rem; height: .3rem; margin-left: -.15rem; border-radius: 50%; background: var(--info); }
.drp-day.is-today { box-shadow: inset 0 0 0 1.5px var(--brand); }
.drp-day.in-range { background: var(--brand-soft); border-radius: 0; color: var(--brand-ink); }
.drp-day.is-start, .drp-day.is-end { background: var(--brand); color: #fff; border-radius: 7px; }
[data-bs-theme="dark"] .drp-day.is-start, [data-bs-theme="dark"] .drp-day.is-end { color: #0b1a33; }
.drp-foot { display: flex; align-items: center; gap: 1rem; margin-top: .5rem; padding-top: .5rem; border-top: 1px solid var(--line); font-size: var(--t-xs); color: var(--ink-3); }
.drp-foot .dot { display: inline-block; width: .5rem; height: .5rem; border-radius: 50%; margin-right: .35rem; vertical-align: middle; }
.drp-key-hol { background: var(--info); } .drp-key-off { background: var(--line-strong); }
@media (max-width: 767.98px) { .drp { position: fixed; left: .75rem; right: .75rem; top: auto; bottom: calc(var(--bottom-h) + .75rem); } .drp-months > :last-child { display: none; } .drp-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); } }

/* A lone card in a 2-up grid takes the full row instead of leaving half of it empty. */
.grid-2 > :only-child { grid-column: 1 / -1; }
/* Panel titles stay on one line; the side note wraps instead of squeezing the title. */
.panel-head { flex-wrap: wrap; }
.panel-head > h2, .panel-head > h3 { flex-shrink: 0; }
.panel-head > .sub { flex: 1 1 10rem; text-align: right; }
.panel-chart .panel-head > .sub { text-align: inherit; }

/* Profile photos inside avatars */
.avatar.has-photo { background: var(--sunken); overflow: hidden; }
.avatar.has-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-xxl { width: 6rem; height: 6rem; font-size: 1.9rem; }

/* Weekend and holiday days can't be picked as a first or last day */
.field-error[hidden] { display: none; }
.drp-day:disabled { cursor: not-allowed; }
.drp-day.is-hol:disabled, .drp-day.is-off:disabled { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--ink-3) 50%, transparent); }
.drp-day.in-range:disabled { opacity: .75; }
.drp-day.is-hol:disabled { text-decoration-color: currentColor; opacity: .8; }

/* Date boxes use the app's calendar (weekends and holidays greyed out), not the browser's */
input[type="date"].date-ours { cursor: pointer; }
input[type="date"].date-ours::-webkit-calendar-picker-indicator { cursor: pointer; }
.date-snapped { animation: date-snap 900ms var(--ease, ease) 1; }
@keyframes date-snap { 0% { background-color: var(--brand-soft); } 100% { background-color: var(--surface); } }
@media (prefers-reduced-motion: reduce) { .date-snapped { animation: none; } }

/* Blackout days in the calendar */
.drp-day.is-black { color: var(--bad); background: var(--bad-soft); text-decoration: line-through; }
.drp-key-black { background: var(--bad); }

/* Password rules, ticked off live (app.js) */
.pw-rules { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .3rem .9rem; margin: .6rem 0 0; padding: 0; list-style: none; font-size: var(--t-xs); color: var(--ink-3); }
.pw-rules li { display: flex; align-items: center; gap: .4rem; }
.pw-rules li::before { content: ""; width: .95rem; height: .95rem; flex: none; border: 1.5px solid var(--line-strong); border-radius: 50%; }
.pw-rules li.ok { color: var(--ok); }
.pw-rules li.ok::before { border-color: var(--ok); background: var(--ok) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat; }
@media (max-width: 420px) { .pw-rules { grid-template-columns: 1fr; } }

/* Announcement banner on the dashboard: same quiet panel style as the rest, brand chip for the icon. */
.ann-banner { display: flex; align-items: center; gap: .75rem; padding: .75rem 1rem; background: var(--bs-body-bg); border: 1px solid var(--bs-border-color); border-radius: var(--radius, .75rem); }
.ann-banner .ann-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.ann-banner .ann-text span { color: var(--bs-secondary-color); font-size: .875rem; }
@media (max-width: 575.98px) { .ann-banner { flex-wrap: wrap; } .ann-banner .ann-text { flex-basis: calc(100% - 3rem); } }
.ann-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: 0 1rem; }
