html, body { margin: 0; padding: 0; }
.h-100 { height: 100%; }
.vh-100 { height: 100vh; height: 100dvh; }

@media (min-width: 960px) {
    .kpi-card-global,
    .kpi-card-collecte {
        min-height: 134px;
    }
    .kpi-card-simple {
        min-width: 102px;
    }
}

.chart-section {
    min-height: 312px;
}

.kpi-bg-global {
    height: 100%;
    background: #1F1F1F;
    border-color: rgba(var(--mud-palette-text-primary-rgb), 0.10);
}

.kpi-bg-collecte {
    height: 100%;
    background: rgba(0, 0, 0, 0.15);
    border-color: var(--mud-palette-lines-default);
}

.kpi-bg-simple {
    height: 100%;
    background: var(--mud-palette-background-gray);
    border-color: var(--mud-palette-lines-default);
}

.kpi-budget-column {
    min-width: 8rem;
    text-align: right;
}

.kpi-badge {
    display: inline-flex;
    border-radius: 9999px;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.kpi-badge-success {
    border: 1px solid rgba(var(--mud-palette-success-rgb), 0.4);
    background: rgba(var(--mud-palette-success-rgb), 0.12);
    color: rgba(236, 253, 245, 0.96);
}

.kpi-badge-warning {
    border: 1px solid rgba(var(--mud-palette-warning-rgb), 0.3);
    background: rgba(var(--mud-palette-warning-rgb), 0.12);
    color: rgba(255, 251, 235, 0.96);
}

.kpi-badge-danger {
    border: 1px solid rgba(var(--mud-palette-error-rgb), 0.3);
    background: rgba(var(--mud-palette-error-rgb), 0.12);
    color: rgba(255, 241, 242, 0.96);
}

.kpi-pill {
    border-radius: 9999px;
    text-transform: uppercase;
    font-weight: 500;
    font-size: 0.75rem;
    letter-spacing: normal;
    padding: 0.5rem 1rem;
}

.kpi-pill-active {
    background: rgba(52, 211, 153, 0.9);
    color: #064e3b;
    border: none;
}

.kpi-pill-inactive {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.20);
}

.kpi-badge-status {
    display: inline-flex;
    border-radius: 9999px;
    padding: 0.25rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.kpi-badge-status-open {
    background: rgba(52, 211, 153, 0.15);
    color: rgba(110, 231, 183, 1);
    border: 1px solid rgba(52, 211, 153, 0.40);
}

.kpi-badge-status-muted {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.70);
    border: 1px solid rgba(255, 255, 255, 0.10);
}

.kpi-badge-status-caution {
    background: rgba(251, 191, 36, 0.10);
    color: rgba(253, 230, 138, 1);
    border: 1px solid rgba(252, 211, 77, 0.40);
}

.app-container {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.app-container.has-bottom-nav {
    padding-bottom: 4.5rem;
}

.dashboard-container {
    padding: 2rem 0 1.5rem;
}

.kpi-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    display: flex;
    background: #171717;
    border-top: 1px solid rgba(255, 255, 255, 0.10);
    padding: 0.4rem 0.5rem calc(0.4rem + env(safe-area-inset-bottom));
}

.kpi-bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    padding: 0.35rem 0.25rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.55);
}

.kpi-bottom-nav-icon {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.kpi-bottom-nav-item-active {
    color: rgba(110, 231, 183, 1);
}

.kpi-picker-card {
    display: block;
    text-decoration: none;
    padding: 0.9rem 1.1rem;
    border-radius: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.10);
}

.kpi-picker-card-name {
    color: var(--mud-palette-text-primary);
}

.kpi-picker-card-badge {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: #ffffff;
}

.kpi-picker-card-badge-outline {
    background: transparent;
    border: 1.5px solid var(--badge-color);
    color: var(--badge-color);
}

.nav-logo {
    height: 3rem;
    width: 3rem;
    border: 1px solid rgba(var(--mud-palette-success-rgb), 0.5);
    background: rgba(var(--mud-palette-success-rgb), 0.12);
}

.nav-brand-wrap {
    line-height: 1.3;
}

.nav-brand {
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.5em;
}

.nav-brand-sub {
    font-size: 0.55rem;
    letter-spacing: 0.6em;
    color: rgba(var(--mud-palette-success-rgb), 0.85);
}

.histogram-row {
    position: relative;
}

.histogram-price-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 8rem;
    pointer-events: none;
}

.histogram-bar-col {
    flex: 1 1 0;
    min-width: 0;
}

.histogram-bar-container {
    height: 8rem;
    width: 100%;
}

.histogram-bar-budget {
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    border-radius: 0.375rem;
    background: rgba(var(--mud-palette-text-primary-rgb), 0.10);
}

.histogram-bar-realized {
    position: absolute;
    inset-inline: 0.125rem;
    bottom: 0;
    border-radius: 0.375rem;
    background: rgba(var(--mud-palette-success-rgb), 0.80);
}

.histogram-bar-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    opacity: 0.4;
}

/* 12 three/four-letter labels don't fit side by side on a narrow screen and end up
   touching with no visible gap. Fall back to single-letter month initials (J F M A M
   J J A S O N D) — the tooltip on the column still carries the full month name. */
@media (max-width: 599.98px) {
    .histogram-bar-label {
        display: inline-block;
        width: 1ch;
        overflow: hidden;
        white-space: nowrap;
        letter-spacing: normal;
    }
}

.histogram-bar-percent {
    font-size: 10px;
    font-weight: 600;
}

.histogram-bar-percent-invisible {
    font-size: 10px;
    visibility: hidden;
}

.vintage-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.price-chart-svg {
    width: 100%;
    height: 12rem;
}

.vl-chart-row {
    display: flex;
    gap: 0.5rem;
}

.vl-chart-yaxis {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-end;
    height: 12rem;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.5);
    white-space: nowrap;
}

.vl-chart-col {
    flex: 1;
    min-width: 0;
}

.vl-chart-xaxis {
    position: relative;
    height: 1.1rem;
    margin-top: 0.25rem;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.5);
}

.vl-chart-xaxis span {
    position: absolute;
    transform: translateX(-50%);
    white-space: nowrap;
}

.rounded-sm {
    border-radius: 0.375rem;
}

@media (max-width: 599.98px) {
    .footer-last-update {
        margin-bottom: 1rem;
    }
}

.footer-last-update {
    margin-bottom: 1rem;
}
