/* Project Management Dashboard - one stylesheet, no external fonts or CDNs (CSP: style-src 'self'). */
:root {
    --bg: #f4f6f9;
    --card: #ffffff;
    --ink: #172033;
    --ink-2: #4a5568;
    --muted: #7a8599;
    --line: #e3e7ee;
    --brand: #0f766e;
    --brand-ink: #ffffff;
    --good: #15803d;   --good-bg: #e7f6ec;
    --warn: #b45309;   --warn-bg: #fdf3e2;
    --bad: #b91c1c;    --bad-bg: #fdecec;
    --info: #1d4ed8;   --info-bg: #e8effd;
    --na: #94a3b8;
    --radius: 10px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
}
* { box-sizing: border-box; }
html { font-size: 14px; }
body {
    margin: 0; background: var(--bg); color: var(--ink);
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.45;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; margin: 0 0 .25rem; letter-spacing: -.01em; }
h2 { font-size: 1.05rem; margin: 0 0 .75rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.na { color: var(--na); font-style: italic; }
.bad { color: var(--bad); }
.inline { display: inline; margin: 0; }

/* ---------- header */
.topbar { background: #0b1f2e; color: #e7edf3; position: sticky; top: 0; z-index: 10; box-shadow: 0 2px 6px rgba(0,0,0,.15); }
.topbar-inner { max-width: 1480px; margin: 0 auto; padding: .65rem 1.25rem; display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: .65rem; }
.brand-mark { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: var(--brand); color: #fff; font-weight: 700; font-size: .85rem; }
.brand-name { font-weight: 650; }
.brand-sub { font-size: .78rem; color: #9fb2c3; }
.env { padding: .25rem .65rem; border-radius: 999px; font-size: .78rem; font-weight: 650; letter-spacing: .02em; }
.env-internet { background: #fde8e8; color: #9b1c1c; }
.env-intranet { background: #dff3ea; color: #0b6b45; }
.env-dev { background: #e8eefc; color: #2948a8; }
.nav { display: flex; gap: .25rem; }
.nav a { color: #c9d6e2; padding: .4rem .75rem; border-radius: 6px; font-weight: 550; }
.nav a:hover { background: rgba(255,255,255,.08); text-decoration: none; }
.nav a.active { background: rgba(255,255,255,.14); color: #fff; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.refreshed { display: flex; flex-direction: column; font-size: .82rem; text-align: right; }
.refreshed .muted { color: #9fb2c3; }
.user { display: flex; align-items: center; gap: .5rem; }
.user-name { font-weight: 600; }
.sources { max-width: 1480px; margin: 0 auto; padding: 0 1.25rem .55rem; display: flex; gap: .5rem; flex-wrap: wrap; }
.source { display: inline-flex; align-items: center; gap: .4rem; font-size: .78rem; padding: .2rem .6rem; border-radius: 999px; background: rgba(255,255,255,.07); color: #cfdbe6; }
.source .dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; }
.source.down { background: rgba(239, 68, 68, .18); color: #fecaca; }
.source.down .dot { background: #ef4444; }
.source .muted { color: #f8b4b4; }

/* ---------- buttons, forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; padding: .45rem .9rem; border-radius: 7px; border: 1px solid transparent; font: inherit; font-weight: 600; cursor: pointer; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: #0c5f59; }
.btn-primary:disabled { opacity: .7; cursor: progress; }
.btn-ghost { background: transparent; color: inherit; border-color: rgba(127,140,160,.45); }
.topbar .btn-ghost { color: #e7edf3; }
.btn-ghost:hover { background: rgba(127,140,160,.12); }
.btn-block { width: 100%; }
input, select { font: inherit; padding: .5rem .6rem; border: 1px solid #cfd6e0; border-radius: 7px; background: #fff; color: var(--ink); min-width: 0; }
input:focus, select:focus { outline: 2px solid rgba(15,118,110,.35); border-color: var(--brand); }
label { display: block; font-size: .78rem; font-weight: 600; color: var(--ink-2); margin-bottom: .25rem; }

/* ---------- layout */
.page { max-width: 1480px; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; }
.back { font-size: .85rem; display: inline-block; margin-bottom: .35rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.1rem 1.25rem; margin-bottom: 1rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.grid-2 > .card { margin-bottom: 0; }
.grid-2 { margin-bottom: 1rem; }
.alert { padding: .7rem .9rem; border-radius: 8px; margin-bottom: 1rem; border: 1px solid transparent; }
.alert-warn { background: var(--warn-bg); color: #7a3e06; border-color: #f6d9a8; }
.alert-bad { background: var(--bad-bg); color: #8f1515; border-color: #f5c2c2; }
.alert-info { background: var(--info-bg); color: #1e3a8a; border-color: #c8d7fb; }

/* ---------- KPIs */
.kpi-group { margin-bottom: 1.25rem; }
.kpi-group h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: .5rem; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .75rem; }
.kpi { background: var(--card); border: 1px solid var(--line); border-left: 4px solid #cbd5e1; border-radius: var(--radius); padding: .85rem 1rem; box-shadow: var(--shadow); }
.kpi-title { font-size: .82rem; color: var(--ink-2); font-weight: 600; }
.kpi-value { font-size: 1.6rem; font-weight: 700; margin: .2rem 0; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.kpi-basis { font-size: .75rem; color: var(--muted); }
.kpi-note { font-size: .75rem; color: var(--warn); margin-top: .2rem; }
.kpi.tone-good { border-left-color: var(--good); }
.kpi.tone-warn { border-left-color: #f59e0b; }
.kpi.tone-bad { border-left-color: var(--bad); }
.kpi.tone-na { border-left-color: var(--na); }
.kpi.tone-na .kpi-value { color: var(--na); font-size: 1.15rem; font-style: italic; font-weight: 600; }

/* ---------- badges & status colours */
.badge { display: inline-block; padding: .12rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 650; white-space: nowrap; background: #eef1f5; color: var(--ink-2); }
.badge.tone-good { background: var(--good-bg); color: var(--good); }
.badge.tone-warn { background: var(--warn-bg); color: var(--warn); }
.badge.tone-bad { background: var(--bad-bg); color: var(--bad); }
.st-ontrack { fill: #16a34a; background: #16a34a; }
.st-inprogress { fill: #3b82f6; background: #3b82f6; }
.st-atrisk { fill: #f59e0b; background: #f59e0b; }
.st-delayed { fill: #dc2626; background: #dc2626; }
.st-onhold { fill: #a855f7; background: #a855f7; }
.st-completed { fill: #0f766e; background: #0f766e; }
.st-presale { fill: #64748b; background: #64748b; }
.st-closed { fill: #334155; background: #334155; }
.st-notavailable { fill: #cbd5e1; background: #cbd5e1; }
.mix { width: 100%; height: 36px; border-radius: 6px; overflow: hidden; display: block; }
.legend { list-style: none; padding: 0; margin: .75rem 0 0; display: flex; flex-wrap: wrap; gap: .4rem 1rem; }
.legend a { color: var(--ink); display: inline-flex; align-items: center; gap: .35rem; }
.swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* ---------- tables */
.table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.table th, .table td { padding: .55rem .6rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table th { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 650; background: #fafbfc; white-space: nowrap; }
.table tfoot th { color: var(--ink); text-transform: none; font-size: .9rem; background: #f6f8fa; }
.table .num { text-align: right; }
.table.compact th, .table.compact td { padding: .45rem .55rem; }
.table tbody tr:hover { background: #f8fafc; }
.table-scroll { overflow-x: auto; }
.table-card { padding: 0; }
.table-card .pager, .table-card .legend-note { padding: .75rem 1.25rem; }
.projects td { white-space: nowrap; }
.projects td:nth-child(2) { white-space: normal; min-width: 180px; }
tr.clickable { cursor: pointer; }
.code { font-family: Consolas, "Cascadia Mono", monospace; font-size: .85rem; }
.empty { text-align: center; color: var(--muted); padding: 2rem !important; }
.sort { color: inherit; }
.sort.asc::after { content: " ▲"; }
.sort.desc::after { content: " ▼"; }
progress { width: 70px; height: 8px; vertical-align: middle; accent-color: var(--brand); }
.pager { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; border-top: 1px solid var(--line); }
.pager .btn { padding: .3rem .65rem; }

/* ---------- filters */
.filters { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; }
.filters .field { display: flex; flex-direction: column; }
.filters .grow { flex: 1 1 240px; }
.filters .actions { flex-direction: row; gap: .4rem; }

/* ---------- project overview */
.summary-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .5rem; margin-bottom: 1rem; }
.summary-strip > div { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .65rem .85rem; box-shadow: var(--shadow); }
.summary-strip span { display: block; font-size: .75rem; color: var(--muted); font-weight: 600; }
.summary-strip strong { font-size: 1.05rem; }
.num-tag { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: #e6f2f1; color: var(--brand); font-size: .78rem; margin-right: .35rem; }
.facts { display: grid; grid-template-columns: minmax(150px, 40%) 1fr; gap: .35rem .9rem; margin: 0; }
.facts dt { color: var(--muted); font-size: .85rem; }
.facts dd { margin: 0; font-weight: 550; }
details.forms { margin-top: .75rem; }
details.forms summary { cursor: pointer; font-weight: 600; color: var(--brand); }
.gantt { width: 100%; min-width: 760px; height: auto; display: block; }
.gantt .tick { stroke: #eef1f5; stroke-width: 1; }
.gantt .tick-label { font-size: 10px; fill: var(--muted); }
.gantt .row-label { font-size: 12px; fill: var(--ink); }
.gantt .bar.planned { fill: #94a3b8; }
.gantt .bar.actual { fill: #0f766e; }
.gantt .bar.forecast { fill: #f59e0b; }
.gantt .today { stroke: #dc2626; stroke-width: 1.5; stroke-dasharray: 4 3; }
.gantt-legend { display: flex; gap: 1rem; align-items: center; font-size: .82rem; color: var(--ink-2); margin-bottom: .5rem; flex-wrap: wrap; }
.gantt-legend .sw { display: inline-block; width: 18px; height: 7px; border-radius: 2px; margin-right: .3rem; }
.gantt-legend .sw.planned { background: #94a3b8; }
.gantt-legend .sw.actual { background: #0f766e; }
.gantt-legend .sw.forecast { background: #f59e0b; }
.gantt-legend .sw.today { background: #dc2626; height: 2px; }

/* ---------- sign in */
main.plain { min-height: 100vh; display: grid; place-items: center; padding: 1rem; background: linear-gradient(160deg, #0b1f2e 0%, #12384a 100%); }
.login-wrap { width: 100%; display: grid; place-items: center; }
.login { width: 100%; max-width: 400px; padding: 1.75rem; }
.login h1 { font-size: 1.25rem; margin: 1rem 0; }
.login input { width: 100%; margin-bottom: .9rem; }
.login-brand .brand-sub { color: var(--muted); }

/* ---------- small screens */
@media (max-width: 900px) {
    .grid-2 { grid-template-columns: 1fr; }
    .topbar-right { margin-left: 0; width: 100%; justify-content: space-between; }
    .refreshed { text-align: left; }
    .facts { grid-template-columns: 1fr; }
    .facts dt { margin-top: .35rem; }
}

/* =====================================================================================================================
   Central Dashboard additions - same palette and components as above (navy #0b1f2e, teal brand #0f766e, cards, kpis,
   tables, badges); a sidebar replaces the top navigation. No inline styles anywhere (CSP style-src 'self').
   ===================================================================================================================== */
:root {
    --src-crm: #2a78d6;
    --src-presale: #eb6834;
    --src-tt: #1baf7a;
    --side-w: 248px;
}

/* ---------- shell: sidebar + main */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: var(--side-w); flex: 0 0 var(--side-w); background: #0b1f2e; color: #c9d6e2; display: flex; flex-direction: column;
           position: sticky; top: 0; height: 100vh; overflow-y: auto; border-right: 1px solid rgba(255,255,255,.06); z-index: 20; }
.side-brand { padding: 1rem 1.1rem; border-bottom: 1px solid rgba(255,255,255,.07); }
.side-nav { display: flex; flex-direction: column; gap: .15rem; padding: .75rem .6rem; flex: 1 1 auto; }
.side-nav a, .side-logout button { display: flex; align-items: center; gap: .65rem; color: #c9d6e2; padding: .55rem .7rem; border-radius: 7px;
           font-weight: 550; text-decoration: none; background: none; border: 0; font: inherit; font-weight: 550; width: 100%; text-align: left; cursor: pointer; }
.side-nav a:hover, .side-logout button:hover { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }
.side-nav a.active { background: rgba(15,118,110,.38); color: #fff; box-shadow: inset 3px 0 0 #2dd4bf; }
.side-nav svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; opacity: .9; }
.side-section { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: #7f93a6; padding: .9rem .7rem .3rem; }
.side-logout { margin: 0; }
.side-user { display: flex; align-items: center; gap: .6rem; padding: .85rem 1rem; border-top: 1px solid rgba(255,255,255,.07); }
.side-user .user-name { color: #fff; font-size: .9rem; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: #fff; font-weight: 700; flex: none; }
.main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.main .topbar-inner { max-width: none; padding: .55rem 1.25rem; }
.main .sources { max-width: none; margin: 0; padding: 0; }
.source.idle { background: rgba(255,255,255,.05); color: #9fb2c3; }
.source.idle .dot { background: #94a3b8; }
.src-word { opacity: .85; }
.menu-toggle { display: none; background: transparent; border: 1px solid rgba(255,255,255,.2); border-radius: 7px; padding: .3rem .4rem; color: #fff; cursor: pointer; }
.menu-toggle svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; display: block; }
.side-scrim { display: none; }
.app-footer { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: .85rem 1.25rem; font-size: .78rem; color: var(--muted); border-top: 1px solid var(--line); margin-top: auto; }
@media (max-width: 1100px) {
    .sidebar { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-100%); transition: transform .2s ease; box-shadow: 4px 0 18px rgba(0,0,0,.25); }
    body.menu-open .sidebar { transform: none; }
    body.menu-open .side-scrim { display: block; position: fixed; inset: 0; background: rgba(11,31,46,.45); z-index: 15; }
    .menu-toggle { display: inline-block; }
}
@media (max-width: 640px) {
    .src-word { display: none; }
    .refreshed { display: none; }
    .page { padding: 1rem .8rem 2rem; }
    .page-head { flex-direction: column; }
    h1 { font-size: 1.35rem; }
}

/* ---------- KPI rows: fixed column counts so a group never leaves a lone card */
.kpis.kpis-5, .kpis.kpis-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 760px) { .kpis.kpis-5, .kpis.kpis-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .kpis.kpis-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (min-width: 1500px) { .kpis.kpis-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (max-width: 380px) { .kpis.kpis-5, .kpis.kpis-6 { grid-template-columns: 1fr; } }
.kpi-link { color: inherit; display: block; transition: box-shadow .15s, transform .15s; }
.kpi-link:hover { text-decoration: none; box-shadow: 0 4px 14px rgba(16,24,40,.10); transform: translateY(-1px); }
.kpi.tone-crm { border-left-color: var(--src-crm); }
.kpi.tone-presale { border-left-color: var(--src-presale); }
.kpi.tone-tt { border-left-color: var(--src-tt); }
.kpi.tone-neutral { border-left-color: var(--brand); }
.group-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.group-head h2 { display: flex; align-items: center; gap: .45rem; }
.group-note { margin: .5rem 0 0; }
.src-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.src-crm { background: var(--src-crm); }
.src-presale { background: var(--src-presale); }
.src-tt { background: var(--src-tt); }

/* ---------- cards, grids, misc */
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.grid-3 > .card { margin-bottom: 0; }
@media (max-width: 1100px) { .grid-3 { grid-template-columns: 1fr; } }
.card h2 .muted { font-weight: 500; }
.card-pad { padding: 1.1rem 1.25rem 0; }
.table-card h2.card-pad { margin-bottom: .75rem; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: .5rem; }
.card-head h2 { margin: 0; }
.mt { margin-top: 1rem; }
.head-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.alert-good { background: var(--good-bg); color: #14532d; border-color: #bfe5cb; }
.empty-box { text-align: center; color: var(--muted); padding: 2.2rem 1rem; border: 1px dashed var(--line); border-radius: 8px; background: #fafbfc; }
.row-muted td { color: #8a94a6; }
.badge.tone-critical { background: var(--bad-bg); color: var(--bad); }
.badge.tone-info { background: var(--info-bg); color: var(--info); }
.badge.tone-muted { background: #f1f3f6; color: #6b7280; }
.badge + .badge { margin-left: .25rem; }
.na.warn { color: var(--warn); }
.summary-strip.compact-strip { margin: .75rem 0 0; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.flow { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: .5rem; margin-bottom: .75rem; }
.flow-step { background: #f6f8fa; border: 1px solid var(--line); border-radius: 8px; padding: .65rem .8rem; }
.flow-step strong { display: block; font-size: 1.35rem; }
.flow-step span { font-size: .78rem; color: var(--ink-2); }
.flow-step.strong { background: #e6f2f1; border-color: #b9dcd8; }
.systems { display: flex; gap: .2rem; margin-top: .2rem; cursor: help; }
.sys { font-size: .64rem; font-weight: 700; padding: 0 .3rem; border-radius: 4px; background: #eef1f5; color: #a3adbb; }
.sys.on { background: #e6f2f1; color: var(--brand); }
.integrated td { white-space: nowrap; }
.integrated td:nth-child(2) { white-space: normal; min-width: 170px; }
table progress { width: 80px; }
.sort-link { color: inherit; text-decoration: none; }
.sort-link:hover { color: var(--brand); text-decoration: none; }
.sort-link i { display: none; }
.sort-link[aria-sort="ascending"]::after { content: " ▲"; }
.sort-link[aria-sort="descending"]::after { content: " ▼"; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.inline-form { display: flex; gap: .4rem; align-items: center; margin: 0; }

/* ---------- charts */
.chart-wrap { position: relative; width: 100%; }
.chart-wrap.h-md { height: 280px; }
.chart-wrap.h-sm { height: 210px; }
.chart-wrap.h-lg { height: 360px; }

/* ---------- reports index */
.report-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: .9rem; }
.report-card { display: flex; flex-direction: column; gap: .4rem; min-height: 150px; }
.report-title { font-size: 1rem; color: var(--ink); }
.report-text { flex: 1 1 auto; font-size: .85rem; }
.report-go { color: var(--brand); font-weight: 600; font-size: .85rem; }

/* ---------- forms: sign-in, change password, users */
.check { display: flex; align-items: center; gap: .45rem; font-weight: 500; color: var(--ink-2); font-size: .85rem; margin: .1rem 0 .9rem; }
.check input { width: auto; margin: 0; }
.filters .check-field { justify-content: flex-end; }
.filters .check-field .check { margin: 0 0 .55rem; }
.pw-field { position: relative; margin-bottom: .9rem; }
.pw-field input { width: 100%; padding-right: 4.2rem; margin-bottom: 0 !important; }
.pw-toggle { position: absolute; right: .35rem; top: 50%; transform: translateY(-50%); background: #eef1f5; border: 0; border-radius: 5px; padding: .25rem .55rem;
             font: inherit; font-size: .78rem; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.pw-toggle:hover { background: #e2e7ee; }
.login .remember { margin-top: -.2rem; }
.login .remember .muted { font-weight: 400; }
.form-card { max-width: 560px; }
.form-card.wide { max-width: none; }
.form-card input, .form-card select { width: 100%; margin-bottom: .9rem; }
.form-card .pw-field input { margin-bottom: 0; }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 1rem; }
@media (max-width: 900px) { .form-grid { grid-template-columns: 1fr; } }
.form-grid .check-field { display: flex; align-items: center; }
.form-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .25rem; }
.row-actions { white-space: nowrap; text-align: right; }
.row-actions .btn { padding: .3rem .65rem; }
.btn.danger { color: var(--bad); border-color: #f2c6c6; }
.btn.danger:hover { background: var(--bad-bg); }

/* ---------- loading overlay */
.loading { position: fixed; inset: 0; z-index: 50; display: none; place-items: center; background: rgba(244,246,249,.55); }
.loading.show { display: grid; }
.loading-box { display: flex; align-items: center; gap: .7rem; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: .8rem 1.1rem; box-shadow: var(--shadow); font-weight: 600; color: var(--ink-2); }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 3px solid #cfe7e4; border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } .kpi-link, .sidebar { transition: none; } }
@media print { .sidebar, .topbar, .filters, .pager, .app-footer { display: none !important; } }
