/* Management dashboards (Pages/Dashboards): full-window KPI screens in the Power BI KPI Dashboard theme
   (navy #1B3A5C bar, teal #0E8C7A accents), the same look as the AGFUND Dashboard app. Every class starts with xd-. */

:root {
    --xd-bg: #EEF2F7;
    --xd-surface: #FFFFFF;
    --xd-surface-2: #F2F5F9;
    --xd-border: #E1E7EF;
    --xd-text: #1B2A3A;
    --xd-text-2: #4B5B6E;
    --xd-text-3: #7C8A9B;
    --xd-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 2px 8px rgba(16, 24, 40, .06);
    --xd-radius: 14px;
    --xd-bar: #1B3A5C;
    --xd-teal: #0E8C7A;
    --xd-teal-soft: #E0F2EF;
    --xd-navy: #1B3A5C;
    --xd-sky: #3FA9D6;
    --xd-orange: #E66C37;
    --xd-purple: #7B4DB8;
    --xd-gold: #C99A06;
    --xd-rose: #D64576;
    --xd-slate: #6B7A90;
    --xd-red: #D64550;
    --xd-up: #1A7A4A;
    --xd-down: #C00000;
    --xd-font: Roboto, 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* ── Frame ─────────────────────────────────────────────────────────────── */

html:has(.xd-app) { background: var(--xd-bg); }
.xd-app, .xd-dialog { font-family: var(--xd-font); color: var(--xd-text); font-size: 14px; line-height: 1.4; }
.xd-app { min-height: 100vh; background: var(--xd-bg); }
/* Not Radzen's icon buttons (e.g. a drop-down's clear button is <button class="rzi">): they need the icon font */
.xd-app button:not(.rzi), .xd-dialog button:not(.rzi) { font-family: inherit; }
.xd-app h2, .xd-app h3, .xd-dialog h3 { margin: 0; font-weight: 600; color: var(--xd-text); }
.xd-app p, .xd-dialog p { margin: 0; }
.xd-app .up, .xd-dialog .up { color: var(--xd-up); }
.xd-app .down, .xd-dialog .down { color: var(--xd-down); }
.xd-muted { color: var(--xd-text-3); font-size: 13px; }
.xd-busy { opacity: .55; transition: opacity .15s; pointer-events: none; }

.xd-top {
    position: sticky; top: 0; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px;
    min-height: 64px; padding: 8px 24px; background: var(--xd-bar); color: #fff; box-shadow: 0 2px 10px rgba(10, 25, 45, .25);
}
.xd-logo { display: block; height: 32px; width: auto; }
.xd-top-title { display: flex; flex-direction: column; min-width: 0; padding-left: 18px; border-left: 1px solid rgba(255, 255, 255, .2); line-height: 1.25; }
.xd-top-title b { font-size: 17px; font-weight: 600; letter-spacing: .02em; white-space: nowrap; }
.xd-top-title span { font-size: 12px; color: rgba(255, 255, 255, .65); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xd-tabs { flex: 1; min-width: 0; display: flex; justify-content: center; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.xd-tabs::-webkit-scrollbar { display: none; }
.xd-tab {
    display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 13px; border: 0; border-radius: 10px;
    background: transparent; color: rgba(255, 255, 255, .72); font-size: 14px; font-weight: 500; white-space: nowrap; cursor: pointer;
    transition: background .15s, color .15s;
}
.xd-tab .rzi { font-size: 19px; }
.xd-tab:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.xd-tab.active { background: rgba(255, 255, 255, .14); color: #fff; box-shadow: inset 0 -3px 0 #1FC7A9; }
.xd-top-actions { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.xd-tabs + .xd-top-actions { margin-left: 0; }
.xd-icon-btn {
    display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 0; border-radius: 10px;
    background: transparent; color: rgba(255, 255, 255, .85); cursor: pointer;
}
.xd-icon-btn:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.xd-icon-btn .rzi { font-size: 22px; }
.xd-icon-btn.busy { cursor: progress; }
.xd-icon-btn.busy .rzi { animation: xd-spin 1s linear infinite; }
@keyframes xd-spin { to { rotate: 360deg; } }
@media (prefers-reduced-motion: reduce) { .xd-icon-btn.busy .rzi { animation: none; opacity: .5; } }
.xd-exit {
    display: inline-flex; align-items: center; gap: 6px; height: 38px; margin-left: 6px; padding: 0 14px 0 10px;
    border: 1px solid rgba(255, 255, 255, .38); border-radius: 10px; background: transparent; color: #fff; font-size: 14px; font-weight: 500; cursor: pointer;
}
.xd-exit:hover { background: #fff; color: var(--xd-bar); }
.xd-exit .rzi { font-size: 20px; }
/* Tabs move to their own row when they no longer fit next to the title (sooner when the page has many) */
@media (max-width: 1440px) {
    .xd-tabs.many { order: 5; flex-basis: 100%; justify-content: flex-start; margin: 0 -10px; }
    .xd-tabs.many + .xd-top-actions { margin-left: auto; }
}
@media (max-width: 760px) {
    .xd-tabs { order: 5; flex-basis: 100%; justify-content: flex-start; margin: 0 -10px; }
    .xd-tabs + .xd-top-actions { margin-left: auto; }
}
@media (max-width: 640px) {
    .xd-top { padding: 8px 12px; }
    .xd-top-title span, .xd-exit span { display: none; }
    .xd-exit { padding: 0 9px; }
}

.xd-main { max-width: 1680px; margin: 0 auto; padding: 22px 28px 40px; }
@media (max-width: 640px) { .xd-main { padding: 14px 12px 32px; } }

.xd-section-bar { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 16px; margin-bottom: 16px; }
.xd-section-bar h2 { font-size: 22px; letter-spacing: -.01em; }
.xd-sub { display: block; margin-top: 2px; font-size: 13px; color: var(--xd-text-3); }
.xd-section-tools { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.xd-heading { margin: 22px 0 12px !important; font-size: 13px !important; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--xd-text-2) !important; }
.xd-heading-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin: 22px 0 12px; }
.xd-heading-row .xd-heading { margin: 0 !important; }

.xd-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 16px;
    border: 1px solid transparent; border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer;
}
.xd-btn .rzi { font-size: 19px; }
.xd-btn.primary { background: var(--xd-teal); color: #fff; }
.xd-btn.outline { background: var(--xd-surface); border-color: var(--xd-border); color: var(--xd-text-2); }
.xd-btn.outline:hover { border-color: var(--xd-teal); color: var(--xd-teal); }
.xd-btn.ghost { background: transparent; color: var(--xd-teal); }
.xd-btn.ghost:hover { background: var(--xd-teal-soft); }
.xd-btn.block { width: 100%; margin-top: 12px; }
.xd-link-btn {
    display: inline-flex; align-items: center; gap: 4px; height: 34px; padding: 0 10px; border: 0; border-radius: 8px;
    background: transparent; color: var(--xd-teal); font-size: 13.5px; font-weight: 600; cursor: pointer;
}
.xd-link-btn:hover { background: var(--xd-teal-soft); }
.xd-link-btn:disabled { opacity: .5; cursor: default; background: transparent; }
.xd-link-btn .rzi { font-size: 18px; }

/* ── Filters ───────────────────────────────────────────────────────────── */

.xd-filters {
    margin-bottom: 16px; padding: 6px 8px;
    background: var(--xd-surface); border-radius: var(--xd-radius); box-shadow: var(--xd-shadow);
}
.xd-filters-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.xd-filters-head .xd-link-btn { margin-left: auto; }
.xd-filters-toggle {
    display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px; border: 0; border-radius: 8px;
    background: transparent; color: var(--xd-text); font-size: 13.5px; font-weight: 600; cursor: pointer;
}
.xd-filters-toggle:hover { background: var(--xd-teal-soft); }
.xd-filters-toggle .rzi { font-size: 18px; color: var(--xd-teal); }
.xd-filters-count {
    min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
    background: var(--xd-teal); color: #fff; font-size: 12px; line-height: 20px; text-align: center;
}
.xd-filters-body { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; padding: 6px 6px 6px; border-top: 1px solid var(--xd-border); margin-top: 6px; }
.xd-filter { display: flex; flex-direction: column; gap: 4px; flex: 1 1 150px; min-width: 140px; max-width: 230px; }
.xd-filter.wide { flex-basis: 240px; min-width: 220px; max-width: 320px; }
.xd-filter > span { font-size: 11.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--xd-text-3); }
.xd-filter .rz-dropdown { width: 100%; }
/* Microfinance bank: as wide as its longest name (--xd-fit) plus the clear and arrow buttons, within the screen */
.xd-filter.bank { flex: none; width: calc(var(--xd-fit, 30ch) + 72px); min-width: 220px; max-width: min(560px, calc(100vw - 56px)); }
@media (max-width: 640px) { .xd-section-tools, .xd-filter.bank { width: 100%; max-width: 100%; } }

/* ── KPI tiles ─────────────────────────────────────────────────────────── */

.xd-kpis { --xd-cols: 4; display: grid; grid-template-columns: repeat(var(--xd-cols), minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.xd-kpis.two { --xd-cols: 2; }
.xd-kpis.three { --xd-cols: 3; }
.xd-kpis.five { --xd-cols: 5; }
.xd-kpis.six { --xd-cols: 6; }
@media (max-width: 1200px) { .xd-kpis.five, .xd-kpis.six { --xd-cols: 3; } }
@media (max-width: 900px) { .xd-kpis, .xd-kpis.three { --xd-cols: 2; } }
@media (max-width: 520px) { .xd-kpis.five, .xd-kpis.six { --xd-cols: 2; } }
.xd-kpi {
    position: relative; display: flex; flex-direction: column; gap: 2px; min-width: 0; margin: 0; padding: 14px 16px 14px 18px;
    border: 0; border-radius: var(--xd-radius); background: var(--xd-surface); box-shadow: var(--xd-shadow); color: inherit; text-align: left; font: inherit;
}
.xd-kpi::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: var(--xd-teal); opacity: .8; }
.xd-kpi.link { cursor: pointer; transition: transform .12s, box-shadow .12s; }
.xd-kpi.link:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(16, 24, 40, .1); }
.xd-kpi-label { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: var(--xd-text-2); }
.xd-kpi-label span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xd-kpi-label .rzi { font-size: 18px; color: var(--xd-text-3); }
.xd-kpi.link:hover .xd-kpi-go { color: var(--xd-teal); }
.xd-kpi-value { margin-top: 2px; font-size: 26px; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.xd-kpi.alert .xd-kpi-value { color: var(--xd-down); }
.xd-kpi.alert::before { background: var(--xd-down); }
.xd-kpi-sub { font-size: 12.5px; color: var(--xd-text-3); }
/* Call to action on a KPI (Stalled projects): light red badge with a pulsing dot (the dot stays still with reduced motion) */
.xd-kpi-alert {
    display: inline-flex; align-items: center; gap: 7px; align-self: flex-start; margin-top: 6px; padding: 3px 11px 3px 9px;
    border: 1px solid color-mix(in srgb, var(--xd-red) 32%, transparent); border-radius: 999px;
    background: color-mix(in srgb, var(--xd-red) 15%, var(--xd-surface)); color: #B42318;
    font-size: 12px; font-weight: 700; letter-spacing: .02em;
}
.xd-kpi-alert i { position: relative; flex-shrink: 0; width: 7px; height: 7px; border-radius: 50%; background: var(--xd-red); }
.xd-kpi-alert i::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--xd-red); animation: xd-ping 1.6s cubic-bezier(0, 0, .2, 1) infinite; }
@keyframes xd-ping { 75%, 100% { transform: scale(2.6); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .xd-kpi-alert i::after { animation: none; } }
.xd-trend { font-size: 12.5px; font-weight: 600; }
.xd-trend span { font-weight: 400; color: var(--xd-text-3); }
.xd-trend.up { color: var(--xd-up); }
.xd-trend.down { color: var(--xd-down); }
.xd-trend.center { margin-top: 10px; text-align: center; }
.xd-spark { display: flex; align-items: flex-end; gap: 2px; height: 24px; margin: 5px 0 2px; }
.xd-spark i { flex: 1; min-height: 2px; border-radius: 2px 2px 0 0; background: var(--xd-teal); opacity: .32; }
.xd-spark i:last-child { opacity: .9; }

/* ── Cards and grid ────────────────────────────────────────────────────── */

.xd-grid { --xd-cols: 2; display: grid; grid-template-columns: repeat(var(--xd-cols), minmax(0, 1fr)); gap: 16px; }
.xd-grid.three { --xd-cols: 3; }
.xd-grid .span-2 { grid-column: span 2; }
.xd-grid .full { grid-column: 1 / -1; }
@media (max-width: 1200px) { .xd-grid.three { --xd-cols: 2; } }
@media (max-width: 800px) {
    .xd-grid, .xd-grid.three { --xd-cols: 1; }
    .xd-grid .span-2 { grid-column: auto; }
}
.xd-card { min-width: 0; padding: 16px 18px 14px; border-radius: var(--xd-radius); background: var(--xd-surface); box-shadow: var(--xd-shadow); }
.xd-card-head { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 14px; }
.xd-card-titles { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.xd-card-titles h3 { font-size: 15.5px; }
.xd-card-titles span { font-size: 12.5px; color: var(--xd-text-3); }
.xd-card-link {
    display: inline-flex; align-items: center; gap: 1px; padding: 4px 4px 4px 10px; border: 0; border-radius: 8px;
    background: transparent; color: var(--xd-teal); font-size: 13px; font-weight: 600; white-space: nowrap; cursor: pointer;
}
.xd-card-link:hover { background: var(--xd-teal-soft); }
.xd-card-link .rzi { font-size: 18px; }
.xd-empty { padding: 28px 8px; text-align: center; color: var(--xd-text-3); font-size: 13.5px; }
.xd-detail { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin-top: 10px; font-size: 13px; color: var(--xd-text-2); }
.xd-detail b { color: var(--xd-text); }
.xd-footnote { margin: 12px 4px 0 !important; font-size: 12.5px; color: var(--xd-text-3); }
.xd-mini-stats { display: flex; gap: 10px; margin-top: 14px; }
.xd-mini-stats div { flex: 1; display: flex; flex-direction: column; padding: 9px 12px; border-radius: 10px; background: var(--xd-surface-2); }
.xd-mini-stats b { font-size: 18px; font-variant-numeric: tabular-nums; }
.xd-mini-stats span { font-size: 12px; color: var(--xd-text-3); }
.xd-kv-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.xd-kv-card { display: flex; flex-direction: column; min-width: 0; padding: 12px; border-radius: 10px; background: var(--xd-surface-2); }
.xd-kv-card span { font-size: 12px; color: var(--xd-text-2); }
.xd-kv-card b { font-size: 18px; font-variant-numeric: tabular-nums; }
.xd-kv-card small { font-size: 11.5px; color: var(--xd-text-3); }

.xd-skeleton { border-radius: 8px; background: linear-gradient(90deg, #E5EAF1 0%, #F3F6F9 50%, #E5EAF1 100%); background-size: 200% 100%; animation: xd-shimmer 1.3s infinite linear; }
@keyframes xd-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.xd-state {
    display: flex; flex-direction: column; align-items: center; gap: 8px; max-width: 520px; margin: 48px auto; padding: 32px;
    border-radius: var(--xd-radius); background: var(--xd-surface); box-shadow: var(--xd-shadow); text-align: center;
}
.xd-state > .rzi { font-size: 42px; color: var(--xd-text-3); }
.xd-state p { color: var(--xd-text-2); }

/* ── Overview ──────────────────────────────────────────────────────────── */

.xd-hero {
    position: relative; overflow: hidden; padding: 24px 24px 22px 28px; border: 1px solid #DCE8E6; border-radius: 18px;
    background: linear-gradient(135deg, #FFFFFF 0%, #F3F9F8 55%, #E2F2EE 100%); box-shadow: var(--xd-shadow);
}
.xd-hero::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: linear-gradient(#1FC7A9, #00897B); }
.xd-hero-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 8px 10px; margin-bottom: 18px; }
.xd-hero-head > div { display: flex; flex-direction: column; }
.xd-hero-head h2 { font-size: 20px; letter-spacing: .08em; text-transform: uppercase; }
.xd-hero-head span { font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--xd-text-3); }
.xd-live {
    display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; white-space: nowrap;
    background: rgba(14, 140, 122, .10); color: var(--xd-teal) !important; font-weight: 600; font-size: 12px !important;
    letter-spacing: .04em !important; text-transform: none !important;
}
.xd-live i { width: 8px; height: 8px; border-radius: 50%; background: var(--xd-teal); animation: xd-pulse 1.6s infinite; }
@keyframes xd-pulse {
    0% { opacity: 1; box-shadow: 0 0 0 0 rgba(31, 199, 169, .6); }
    50% { opacity: .35; }
    70% { box-shadow: 0 0 0 8px rgba(31, 199, 169, 0); }
    100% { opacity: 1; box-shadow: 0 0 0 0 rgba(31, 199, 169, 0); }
}
.xd-hero-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1200px) { .xd-hero-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .xd-hero-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* Overview accents: each headline figure and explore card has a tone (--tone) for its icon, top line, tint and hover */
.xd-tone-teal { --tone: var(--xd-teal); }
.xd-tone-navy { --tone: #2F5A86; }
.xd-tone-green { --tone: var(--xd-up); }
.xd-tone-sky { --tone: #2B93C2; }
.xd-tone-orange { --tone: var(--xd-orange); }
.xd-tone-gold { --tone: var(--xd-gold); }
.xd-tone-purple { --tone: var(--xd-purple); }

.xd-hero-tile {
    position: relative; overflow: hidden;
    display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; margin: 0; padding: 16px;
    border: 1px solid #DCE8E6; border-radius: 14px; color: var(--xd-text); text-align: left; font: inherit;
    background: linear-gradient(160deg, rgba(255, 255, 255, .92) 55%, color-mix(in srgb, var(--tone, var(--xd-teal)) 8%, #FFFFFF));
    transition: transform .15s, box-shadow .15s, border-color .15s;
}
.xd-hero-tile::after {
    content: ""; position: absolute; top: 0; left: 16px; right: 16px; height: 3px; border-radius: 0 0 3px 3px;
    background: var(--tone, var(--xd-teal)); opacity: .6;
}
.xd-hero-tile.link { cursor: pointer; }
.xd-hero-tile.link:hover {
    transform: translateY(-2px); border-color: color-mix(in srgb, var(--tone, var(--xd-teal)) 35%, #DCE8E6);
    box-shadow: 0 8px 20px color-mix(in srgb, var(--tone, var(--xd-teal)) 16%, transparent);
}
.xd-hero-icon {
    display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; margin-bottom: 8px; border-radius: 10px;
    background: color-mix(in srgb, var(--tone, var(--xd-teal)) 12%, transparent); color: var(--tone, var(--xd-teal)); transition: background .15s, color .15s;
}
.xd-hero-tile.link:hover .xd-hero-icon { background: var(--tone, var(--xd-teal)); color: #FFFFFF; }
.xd-hero-icon .rzi { font-size: 20px; }
.xd-hero-tile b { font-size: 30px; letter-spacing: -.01em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.xd-hero-tile > span:last-child { font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--xd-text-3); }

/* Overview highlights (below Explore): the yearly chart wider than the two lists; chart over the lists, then one column,
   on smaller screens; hidden on phones */
.xd-ov-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin-top: 22px; }
.xd-ov-grid > .xd-card { display: flex; flex-direction: column; }
.xd-ov-grid .xd-donut-wrap { flex: 1; align-content: center; }
@media (max-width: 1280px) {
    .xd-ov-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .xd-ov-grid > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 800px) { .xd-ov-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .xd-ov-grid { display: none; } }

.xd-explore { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1100px) { .xd-explore { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .xd-explore { grid-template-columns: minmax(0, 1fr); } }
.xd-explore-card {
    display: flex; align-items: center; gap: 14px; margin: 0; padding: 14px 16px; border: 0; border-radius: var(--xd-radius);
    background: var(--xd-surface); box-shadow: var(--xd-shadow); color: inherit; text-align: left; font: inherit; cursor: pointer; transition: box-shadow .12s, transform .12s;
}
.xd-explore-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px color-mix(in srgb, var(--tone, #101828) 14%, transparent); }
.xd-explore-card .xd-avatar {
    background: color-mix(in srgb, var(--tone, var(--xd-teal)) 12%, transparent); color: var(--tone, var(--xd-teal)); transition: background .15s, color .15s;
}
.xd-explore-card:hover .xd-avatar { background: var(--tone, var(--xd-teal)); color: #FFFFFF; }
.xd-explore-card .xd-chev { transition: transform .15s, color .15s; }
.xd-explore-card:hover .xd-chev { transform: translateX(3px); color: var(--tone, var(--xd-teal)); }

/* Overview cards rise in, one after another (translate, so the hover lift still works) */
@keyframes xd-rise { from { opacity: 0; translate: 0 8px; } }
.xd-hero-tile, .xd-explore-card, .xd-ov-grid > .xd-card { animation: xd-rise .4s ease-out backwards; }
.xd-hero-tile:nth-child(2), .xd-explore-card:nth-child(2) { animation-delay: .05s; }
.xd-hero-tile:nth-child(3), .xd-explore-card:nth-child(3) { animation-delay: .1s; }
.xd-hero-tile:nth-child(4), .xd-explore-card:nth-child(4) { animation-delay: .15s; }
.xd-hero-tile:nth-child(5), .xd-explore-card:nth-child(5) { animation-delay: .2s; }
.xd-hero-tile:nth-child(6), .xd-explore-card:nth-child(6) { animation-delay: .25s; }
.xd-ov-grid > .xd-card { animation-delay: .3s; }
@media (prefers-reduced-motion: reduce) {
    .xd-hero-tile, .xd-explore-card, .xd-ov-grid > .xd-card { animation: none; }
    .xd-hero-tile.link:hover, .xd-explore-card:hover, .xd-explore-card:hover .xd-chev { transform: none; }
}
.xd-avatar { display: flex; flex-shrink: 0; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px; background: var(--xd-teal-soft); color: var(--xd-teal); }
.xd-avatar .rzi { font-size: 22px; }
.xd-explore-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.xd-explore-text b { font-size: 15px; font-weight: 600; }
.xd-explore-text span { font-size: 13px; color: var(--xd-text-2); }
.xd-chev { color: var(--xd-text-3); }

/* ── Bars ──────────────────────────────────────────────────────────────── */

.xd-barlist, .xd-stacked { display: flex; flex-direction: column; gap: 11px; }
.xd-bar-row { display: block; width: 100%; margin: 0; padding: 0; border: 0; background: none; color: inherit; text-align: left; font: inherit; }
.xd-bar-row.link { margin: -4px -6px; padding: 4px 6px; width: calc(100% + 12px); border-radius: 8px; cursor: pointer; }
.xd-bar-row.link:hover { background: var(--xd-surface-2); }
.xd-bar-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 4px; font-size: 13.5px; }
.xd-bar-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xd-bar-value { font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.xd-rank {
    display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; margin-right: 8px;
    border-radius: 6px; background: var(--xd-surface-2); color: var(--xd-text-2); font-size: 11.5px; font-weight: 700;
}
.xd-track { position: relative; height: 8px; border-radius: 4px; background: var(--xd-surface-2); overflow: hidden; }
.xd-track > i { display: block; height: 100%; border-radius: 4px; background: var(--xd-teal); }
.xd-track > i.up { background: var(--xd-up); }
.xd-track > i.down { background: var(--xd-down); }
.xd-bar-sub { margin-top: 3px; font-size: 12px; color: var(--xd-text-3); }
.xd-track.alloc { height: 10px; overflow: visible; }
.xd-track.alloc > i { background: var(--xd-slate); }
.xd-track.alloc > i.up { background: var(--xd-up); }
.xd-track.alloc > i.down { background: var(--xd-down); }
.xd-track.alloc em { position: absolute; top: -4px; bottom: -4px; width: 3px; margin-left: -1.5px; border-radius: 2px; background: var(--xd-text); }
.xd-stacked-track { display: flex; gap: 2px; background: none; }
.xd-stacked-track > i { display: block; flex-basis: 0; height: 100%; border-radius: 3px; }

/* Columns */
.xd-columns { display: flex; align-items: stretch; gap: 8px; }
.xd-col { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 0; padding: 0; border: 0; background: none; cursor: pointer; font: inherit; }
.xd-col-bar { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.xd-col-bar i {
    display: block; width: 100%; max-width: 64px; border-radius: 6px 6px 2px 2px; opacity: .5; transition: opacity .15s;
    background: linear-gradient(180deg, var(--xd-teal), color-mix(in srgb, var(--xd-teal) 55%, var(--xd-navy)));
}
.xd-col.active .xd-col-bar i { opacity: 1; }
.xd-col-value { font-size: 11.5px; color: var(--xd-text-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.xd-col.active .xd-col-value { color: var(--xd-text); font-weight: 600; }
.xd-col-label { font-size: 12px; color: var(--xd-text-3); }
@media (max-width: 640px) { .xd-col:not(.active) .xd-col-value { visibility: hidden; } }

/* Lines */
.xd-line-plot { position: relative; }
.xd-line-plot svg { display: block; width: 100%; height: 100%; overflow: visible; }
.xd-line-plot .grid { stroke: var(--xd-border); stroke-width: 1; vector-effect: non-scaling-stroke; }
.xd-line-plot .cursor { stroke: var(--xd-text-3); opacity: .6; vector-effect: non-scaling-stroke; }
.xd-line-axis {
    position: absolute; top: 0; bottom: 0; left: 0; z-index: 1; display: flex; flex-direction: column; justify-content: space-between;
    font-size: 11px; color: var(--xd-text-3); pointer-events: none;
}
.xd-line-axis span { padding: 0 4px; border-radius: 4px; background: color-mix(in srgb, var(--xd-surface) 82%, transparent); }
.xd-line-hit { position: absolute; inset: 0; z-index: 2; display: flex; }
.xd-line-hit button { flex: 1; margin: 0; padding: 0; border: 0; background: none; cursor: crosshair; }
.xd-line-labels { display: flex; justify-content: space-between; margin-top: 6px; font-size: 12px; color: var(--xd-text-3); }
.xd-legend-item { display: inline-flex; align-items: center; gap: 5px; }
.xd-legend-item i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; }

/* Donut and legend */
.xd-donut-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; }
.xd-donut { position: relative; flex-shrink: 0; width: 170px; height: 170px; margin: 0 auto; }
.xd-donut svg { display: block; width: 100%; height: 100%; }
.xd-donut-track { stroke: var(--xd-surface-2); }
.xd-donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; pointer-events: none; }
.xd-donut-center b { font-size: 18px; font-variant-numeric: tabular-nums; }
.xd-donut-center span { font-size: 12px; color: var(--xd-text-3); }
.xd-legend { flex: 1; min-width: 190px; display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.xd-legend li { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.xd-legend li i { flex-shrink: 0; width: 10px; height: 10px; border-radius: 3px; }
.xd-legend-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--xd-text-2); }
.xd-legend-value { font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.xd-legend-value small { margin-left: 6px; font-weight: 400; color: var(--xd-text-3); }
.xd-legend-link {
    display: flex; align-items: center; gap: 8px; width: calc(100% + 12px); margin: -3px -6px; padding: 3px 6px;
    border: 0; border-radius: 6px; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.xd-legend-link:hover { background: var(--xd-surface-2); }
.xd-legend-link i { flex-shrink: 0; width: 10px; height: 10px; border-radius: 3px; }
.xd-donut circle.link { cursor: pointer; transition: opacity .15s; }
.xd-donut circle.link:hover { opacity: .75; }
.xd-legend.inline { flex-direction: row; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 12px; }
.xd-legend.inline li { font-size: 12px; }
.xd-legend.inline .xd-legend-name { flex: none; }

/* Gauge */
.xd-gauge { position: relative; width: 100%; max-width: 250px; margin: 4px auto 0; }
.xd-gauge svg { display: block; width: 100%; }
.xd-gauge path { fill: none; stroke-width: 12; stroke-linecap: round; }
.xd-gauge-track { stroke: var(--xd-surface-2); }
.xd-gauge-text { position: absolute; left: 0; right: 0; bottom: 2px; display: flex; flex-direction: column; text-align: center; }
.xd-gauge-text b { font-size: 24px; font-variant-numeric: tabular-nums; }
.xd-gauge-text span { font-size: 12px; color: var(--xd-text-3); }

/* ── Funding map ───────────────────────────────────────────────────────── */

.xd-map { position: relative; }
.xd-map svg { display: block; width: 100%; }
.xd-land { fill: #E2E8EF; stroke: #FFFFFF; stroke-width: .6; vector-effect: non-scaling-stroke; }
.xd-land.funded { cursor: pointer; }
.xd-land-outline { fill: none; stroke: var(--xd-navy); stroke-width: 1.8; vector-effect: non-scaling-stroke; pointer-events: none; }
.xd-map-info {
    position: absolute; left: 10px; top: 10px; display: flex; flex-direction: column; gap: 1px; max-width: 300px; padding: 9px 12px;
    border-radius: 10px; background: rgba(255, 255, 255, .94); box-shadow: var(--xd-shadow); font-size: 13px; pointer-events: none;
}
.xd-map-info b { font-size: 14.5px; }
.xd-map-info span { color: var(--xd-text-2); }
.xd-map-legend { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 8px; font-size: 12px; color: var(--xd-text-3); }
.xd-map-legend i { width: 160px; height: 8px; border-radius: 4px; }

.xd-ct-search.rz-textbox { display: block; width: 100%; margin-bottom: 10px; }
.xd-ctable { display: flex; flex-direction: column; max-height: 432px; margin: 0 -6px; padding: 0 6px; overflow-y: auto; }
.xd-ct-head, .xd-ct-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 64px; gap: 4px 10px; align-items: center; }
.xd-ct-head {
    position: sticky; top: 0; z-index: 1; padding: 0 4px 8px; border-bottom: 1px solid var(--xd-border); background: var(--xd-surface);
    font-size: 11.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--xd-text-3);
}
.xd-ct-head span:not(:first-child), .xd-ct-amount, .xd-ct-count { text-align: right; }
.xd-ct-row {
    width: 100%; margin: 0; padding: 9px 4px 7px; border: 0; border-bottom: 1px solid var(--xd-border); background: transparent;
    color: inherit; text-align: left; font: inherit; cursor: pointer;
}
.xd-ct-row:hover, .xd-ct-row.hover { background: var(--xd-surface-2); }
.xd-ct-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.xd-ct-amount { font-weight: 600; color: var(--xd-teal); font-variant-numeric: tabular-nums; }
.xd-ct-count { color: var(--xd-text-2); font-variant-numeric: tabular-nums; }
.xd-ct-bar { grid-column: 1 / -1; height: 4px; border-radius: 2px; background: var(--xd-surface-2); overflow: hidden; }
.xd-ct-bar i { display: block; height: 100%; background: var(--xd-teal); opacity: .5; }

/* ── Investment ────────────────────────────────────────────────────────── */

.xd-segmented { display: inline-flex; gap: 2px; padding: 3px; border-radius: 11px; background: #DFE6EE; }
.xd-seg { height: 34px; padding: 0 16px; border: 0; border-radius: 8px; background: transparent; color: var(--xd-text-2); font-size: 14px; font-weight: 600; cursor: pointer; }
.xd-seg.active { background: var(--xd-surface); color: var(--xd-teal); box-shadow: var(--xd-shadow); }
.xd-aum {
    display: flex; flex-wrap: wrap; gap: 12px 32px; margin-bottom: 16px; padding: 18px 22px; border-radius: var(--xd-radius);
    background: linear-gradient(135deg, #2B5E6E, #17414D); box-shadow: var(--xd-shadow); color: #fff;
}
.xd-aum div { display: flex; flex-direction: column; min-width: 160px; }
.xd-aum span { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: rgba(255, 255, 255, .75); }
.xd-aum b { font-size: 28px; font-variant-numeric: tabular-nums; }
.xd-aum small { font-size: 12px; color: rgba(255, 255, 255, .7); }
.xd-returns { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1200px) { .xd-returns { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .xd-returns { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.xd-return { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 14px; border-radius: var(--xd-radius); background: var(--xd-surface); box-shadow: var(--xd-shadow); }
.xd-return-head { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.xd-return-period { font-size: 13px; font-weight: 600; color: var(--xd-text-2); }
.xd-return-note { font-size: 11px; color: var(--xd-text-3); white-space: nowrap; }
.xd-return > b { font-size: 22px; font-variant-numeric: tabular-nums; }
.xd-return-rows { display: grid; grid-template-columns: 1fr auto; row-gap: 2px; font-size: 12.5px; color: var(--xd-text-3); }
.xd-return-rows span:nth-child(even) { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.xd-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.xd-pill { height: 32px; padding: 0 14px; border: 1px solid var(--xd-border); border-radius: 16px; background: var(--xd-surface); color: var(--xd-text-2); font-size: 13px; font-weight: 600; cursor: pointer; }
.xd-pill:hover { border-color: var(--xd-teal); }
.xd-pill.active { border-color: var(--xd-teal); background: var(--xd-teal); color: #fff; }

/* ── Drill-down dialogs ────────────────────────────────────────────────── */

.xd-dialog .rz-dialog-content { background: var(--xd-surface); }
.xd-dialog-body { display: flex; flex-direction: column; min-height: 100%; }
.xd-dialog-tools { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 16px; margin: 2px 0 12px; }
.xd-dialog-tools .rz-textbox { width: 340px; max-width: 100%; }
.xd-note { display: flex; align-items: flex-start; gap: 6px; margin: 2px 0 12px !important; font-size: 12.5px; line-height: 1.45; color: var(--xd-text-2); }
.xd-note .rzi { flex-shrink: 0; margin-top: 1px; font-size: 16px; color: var(--xd-sky); }
.xd-dialog-filters { display: flex; flex-wrap: wrap; gap: 10px 12px; flex: 1; }
.xd-dialog .xd-kpis { margin-bottom: 14px; }
.xd-dialog .xd-kpi { background: var(--xd-surface-2); box-shadow: none; }
.xd-dialog .xd-kpi-value { font-size: 22px; }
.xd-dialog .xd-state { box-shadow: none; }
.xd-dialog .xd-wrap .rz-cell-data { white-space: normal; }
.xd-cell-main { display: flex; flex-direction: column; line-height: 1.3; white-space: normal; }
.xd-dialog-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.xd-rows-link .rz-data-row { cursor: pointer; }
.xd-row-go { font-size: 18px; color: var(--xd-text-3); vertical-align: middle; }
.xd-rows-link .rz-data-row:hover .xd-row-go { color: var(--xd-teal); }

/* Project detail (drill-down of the project tables) */
.xd-dialog .xd-card { box-shadow: none; border: 1px solid var(--xd-border); }
.xd-pd-head { margin: 0 0 14px; }
.xd-pd-head h2 { margin: 8px 0 2px; font-size: 20px; line-height: 1.3; }
.xd-pd-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 13px; color: var(--xd-text-2); }
.xd-pd-status { display: inline-flex; align-items: center; gap: 2px; padding: 2px 10px 2px 4px; border-radius: 12px; background: var(--xd-surface-2); font-size: 12.5px; font-weight: 600; color: var(--xd-text); }
.xd-pd-ar { margin-bottom: 4px; font-size: 15px; color: var(--xd-text-2); }
.xd-pd-org { display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--xd-text-2); }
.xd-pd-org .rzi { font-size: 18px; color: var(--xd-text-3); }
.xd-note.warn .rzi { color: #D97706; }
.xd-dl { display: grid; grid-template-columns: minmax(120px, 34%) minmax(0, 1fr); margin: 0; }
.xd-dl dt, .xd-dl dd { margin: 0; padding: 8px 0; border-top: 1px solid var(--xd-border); font-size: 13.5px; }
.xd-dl dt:first-of-type, .xd-dl dt:first-of-type + dd { border-top: 0; padding-top: 0; }
.xd-dl dt { padding-right: 12px; font-weight: 400; color: var(--xd-text-3); }
.xd-dl dd { font-weight: 500; overflow-wrap: anywhere; }
.xd-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.xd-chip { padding: 2px 8px; border-radius: 10px; background: var(--xd-teal-soft); color: var(--xd-teal); font-size: 12px; font-weight: 600; }
.xd-pd-text { margin: 0; max-height: 240px; overflow: auto; white-space: pre-line; font-size: 13.5px; line-height: 1.55; color: var(--xd-text-2); }
.xd-pd-progress { height: 8px; margin-bottom: 12px; border-radius: 4px; background: var(--xd-surface-2); overflow: hidden; }
.xd-pd-progress i { display: block; height: 100%; border-radius: 4px; background: var(--xd-teal); }
/* Project detail timeline: milestones on a line (done ✓ teal, planned outlined, overdue amber, not yet grey), vertical on narrow screens.
   The line after a done milestone is teal. */
.xd-tl { display: flex; margin: 4px 0 0; padding: 0; list-style: none; }
.xd-tl-step { position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0 4px; text-align: center; }
.xd-tl-step::after {
    content: ""; position: absolute; top: 13px; left: calc(50% + 18px); width: calc(100% - 36px); height: 2px;
    border-radius: 1px; background: var(--xd-border);
}
.xd-tl-step:last-child::after { display: none; }
.xd-tl-step.done::after { background: var(--xd-teal); }
.xd-tl-dot {
    position: relative; z-index: 1; flex-shrink: 0; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
    border: 2px solid var(--xd-border); background: var(--xd-surface); color: #fff;
}
.xd-tl-dot .rzi { font-size: 16px; font-weight: 700; }
.xd-tl-step.done .xd-tl-dot { border-color: var(--xd-teal); background: var(--xd-teal); }
.xd-tl-step.planned .xd-tl-dot { border-color: var(--xd-teal); border-style: dashed; }
.xd-tl-step.overdue .xd-tl-dot { border-color: #D97706; background: #D97706; }
.xd-tl-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.xd-tl-text b { font-size: 13px; }
.xd-tl-text span { font-size: 12.5px; color: var(--xd-text-2); font-variant-numeric: tabular-nums; }
.xd-tl-text small { font-size: 11.5px; color: var(--xd-text-3); }
.xd-tl-step.pending .xd-tl-text b, .xd-tl-step.pending .xd-tl-text span { color: var(--xd-text-3); font-weight: 500; }
.xd-tl-step.planned .xd-tl-text small { color: var(--xd-teal); }
.xd-tl-step.overdue .xd-tl-text small { color: #B45309; font-weight: 600; }
.xd-tl-progress { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--xd-border); }
.xd-tl-progress-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 6px; font-size: 13px; }
.xd-tl-progress-head span { color: var(--xd-text-3); }
.xd-tl-progress .xd-pd-progress { margin-bottom: 0; }
.xd-tl-progress.late .xd-tl-progress-head span { color: #B45309; font-weight: 600; }
.xd-tl-progress.late .xd-pd-progress i { background: #D97706; }
@media (max-width: 640px) {
    .xd-tl { flex-direction: column; }
    .xd-tl-step { flex-direction: row; align-items: flex-start; gap: 12px; padding: 0 0 16px; text-align: left; }
    .xd-tl-step::after { top: 32px; bottom: 4px; left: 13px; width: 2px; height: auto; }
    .xd-tl-text { padding-top: 4px; }
}

/* Project detail payments: one box per payment, its follow-up report (use of the payment) inside */
.xd-pays { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 12px; }
.xd-pay { display: flex; flex-direction: column; border: 1px solid var(--xd-border); border-radius: 12px; overflow: hidden; font-variant-numeric: tabular-nums; }
.xd-pay-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; }
.xd-pay-no {
    flex-shrink: 0; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
    background: var(--xd-teal-soft); color: var(--xd-teal); font-size: 13px; font-weight: 700;
}
.xd-pay-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.xd-pay-title b { font-size: 14px; }
.xd-pay-title span { font-size: 12.5px; color: var(--xd-text-3); }
.xd-pay-amount { font-size: 15px; white-space: nowrap; }
.xd-pay-fu { flex: 1; padding: 10px 14px 12px; border-top: 1px solid var(--xd-border); background: var(--xd-surface-2); }
.xd-pay-fu.pending { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--xd-text-3); }
.xd-pay-fu.pending .rzi { font-size: 16px; }
.xd-pay-fu-label { display: flex; align-items: center; gap: 5px; margin-bottom: 8px; font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--xd-text-3); }
.xd-pay-fu-label .rzi { font-size: 15px; color: var(--xd-teal); }
.xd-pay-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.xd-pay-stats > div { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.xd-pay-stats span { font-size: 12px; color: var(--xd-text-3); }
.xd-pay-stats b { font-size: 14.5px; }
.xd-pay-stats small { font-size: 12px; color: var(--xd-text-2); }
.xd-pay-bar { display: block; height: 5px; margin-top: 4px; border-radius: 3px; background: var(--xd-border); overflow: hidden; }
.xd-pay-bar i { display: block; height: 100%; border-radius: 3px; background: var(--xd-teal); }
.xd-pay-others { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--xd-border); font-size: 13px; color: var(--xd-text-2); }
.xd-pay-others > div + div { margin-top: 4px; }
/* Old project (paid before eAgfund recorded payments): its dates and total paid, with a note under them */
.xd-legacy-dl { grid-template-columns: minmax(120px, 170px) minmax(0, 1fr); }
.xd-note.xd-legacy-note { margin: 12px 0 0 !important; padding-top: 10px; border-top: 1px solid var(--xd-border); }
@media (max-width: 640px) {
    .xd-dl { grid-template-columns: minmax(0, 1fr); }
    .xd-dl dd { border-top: 0; padding-top: 0; }
    .xd-dl dt:first-of-type + dd { padding-top: 0; }
}
.xd-cell-main b { font-weight: 600; }
.xd-cell-main span { font-size: 12px; color: var(--xd-text-3); }
.xd-mark { display: inline-block; width: 18px; text-align: center; font-size: 13px; line-height: 1.6; }
.xd-mark.active { color: #22C55E; }
.xd-mark.stalled, .xd-mark.canceled { color: #EF4444; }
.xd-mark.completed { color: #ADAFB8; }
.xd-mark.pending { color: var(--xd-text-3); }
.xd-footnote .xd-mark { width: auto; }
/* Status legend under the project tables: a status filters the table, Clear shows every project */
.xd-status-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 10px -6px 0 !important; }
.xd-status-legend button {
    display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border: 1px solid transparent; border-radius: 999px;
    background: none; font: inherit; color: inherit; cursor: pointer; transition: background .15s, color .15s, opacity .15s;
}
.xd-status-legend button:hover { background: var(--xd-surface-2); color: var(--xd-text); }
.xd-status-legend button:focus-visible { outline: 2px solid var(--xd-sky); outline-offset: 1px; }
.xd-status-legend button.on { background: var(--xd-surface); border-color: var(--xd-border); color: var(--xd-text); font-weight: 600; box-shadow: var(--xd-shadow); }
.xd-status-legend.filtered button:not(.on):not(.clear) { opacity: .6; }
.xd-status-legend button.clear { color: var(--xd-sky); font-weight: 500; }
.xd-status-legend button.clear .rzi { font-size: 15px; }
.xd-task-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--xd-slate); }
.xd-task-dot.completed { background: var(--xd-teal); }
.xd-task-dot.active { background: var(--xd-sky); }
.xd-task-dot.overdue { background: var(--xd-red); }
.xd-chip { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 12px; background: var(--xd-surface-2); color: var(--xd-text-2); font-size: 12px; font-weight: 600; white-space: nowrap; }
.xd-chip.success { background: #E3F4EC; color: #1A7A4A; }
.xd-chip.danger { background: #FDE8E8; color: #B42318; }
.xd-chip.info { background: #E6F2FA; color: #1F6F99; }
