/* Dashboard page, scoped: Bootstrap and the invoicing pages use the same element names. */

:root {
    --series-1: #2a78d6;
    --series-2: #eb6834;
    --series-3: #1baf7a;
    --series-4: #eda100;
    --series-5: #e87ba4;
}
:root[data-bs-theme="dark"] {
    --series-1: #3987e5;
    --series-2: #d95926;
    --series-3: #199e70;
    --series-4: #c98500;
    --series-5: #d55181;
}

.stats { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; }
.stats > * { min-width: 0; }
.stats h3 { font-size: .95rem; margin-top: 1.25rem; color: var(--ink-2); }
.stats p { margin: .25rem 0 .75rem; }
.stats .page-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: .5rem; }
.stats .hint { margin-top: .25rem; color: var(--ink-2); font-size: .875rem; }

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    min-width: 0;
}

.grid-2, .grid-3 { display: grid; gap: 1rem; }
@media (min-width: 900px) {
    .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.label { color: var(--ink-2); font-size: .875rem; }
.value { font-size: 1.6rem; font-weight: 600; margin-top: .15rem; }

.tiles { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.tiles .tile.stat-card { padding: 1rem; }
.stats .compare { display: grid; grid-template-columns: 3rem 1fr auto; gap: .5rem; margin-top: .15rem; font-variant-numeric: tabular-nums; }
.stats .compare + .compare { margin-top: 0; }
.stats .compare span:nth-child(2) { text-align: right; }
@media (min-width: 1000px) {
    /* 7 tiles: 4 on the first row, 3 wider ones on the second */
    .overview { grid-template-columns: repeat(12, minmax(0, 1fr)); }
    .overview .tile { grid-column: span 3; }
    .overview .tile:nth-child(n+5) { grid-column: span 4; }
}
.table-wrap { overflow-x: auto; }
.stats table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.stats th, .stats td { padding: .45rem .6rem; text-align: left; border-bottom: 1px solid var(--grid); white-space: nowrap; }
.stats thead th { color: var(--ink-2); font-weight: 500; font-size: .8rem; }
.stats tbody th { font-weight: 500; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.strong { font-weight: 600; }
table.compact th, table.compact td { padding: .4rem .25rem; }
.chart { margin: 0 0 .5rem; }
.chart figcaption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.chart-canvas { position: relative; height: 240px; }
.chart-canvas-tall { height: 300px; }

.share { display: flex; align-items: center; gap: 1rem; }
.stats .share th { white-space: normal; }
.share-canvas { position: relative; width: 120px; height: 120px; flex: none; }
.stats .share table { flex: 1 1 170px; width: auto; min-width: 0; }
.swatch { display: inline-block; width: .7rem; height: .7rem; border-radius: 3px; margin-right: .45rem; vertical-align: baseline; }

.vat-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem; margin-bottom: .75rem; }
.vat-head h2 { margin: 0; }
.stats .vat .status-pill { white-space: normal; }
.vat-bar { position: relative; height: .7rem; margin-bottom: .75rem; border-radius: 999px; background: var(--soft); overflow: hidden; }
.vat-bar-projection { position: absolute; inset: 0 auto 0 0; border-right: 2px dashed var(--ink-2); }
.vat-bar-fill { position: absolute; inset: 0 auto 0 0; background: var(--series-1); border-radius: 999px; }
.vat-bar-mark { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--critical-ink); }
.vat-eu { margin-top: 1.5rem; }
.vat-eu h3 { margin: 0; font-size: 1rem; color: var(--ink); }
