html, body {
    font-family: 'Inter', 'IBM Plex Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* ── Right angles everywhere ─────────────────────────────────────────────
   The theme sets --mud-default-borderradius to 0, which covers most surfaces,
   but MudBlazor hardcodes pill/rounded shapes on a number of components. Flatten
   them here so nothing renders a rounded corner. */
:root {
    --mud-default-borderradius: 0px;
}
.mud-paper, .mud-card, .mud-button-root, .mud-button, .mud-icon-button, .mud-fab,
.mud-input, .mud-input-slot, .mud-input-control-input-container, .mud-select,
.mud-table, .mud-table-container, .mud-alert, .mud-chip, .mud-list, .mud-menu-list,
.mud-popover, .mud-list-item, .mud-nav-link, .mud-avatar, .mud-tabs-toolbar, .mud-tab,
.mud-snackbar, .mud-tooltip, .mud-progress-linear, .mud-progress-linear-bar,
.mud-expansion-panels, .mud-expansion-panel, .mud-drawer, .mud-dialog, .mud-card-content,
.mud-badge, .mud-picker, .mud-picker-container, .mud-toggle-item, .mud-toggle-group,
.mud-checkbox .mud-icon-root {
    border-radius: 0 !important;
}
/* Switches and slider thumbs stay round on purpose — a toggle reads as a toggle because
   of its pill track and circular knob; squaring them looked broken. */

/* ── Brand lockup (square mark + text wordmark) ─────────────────────────── */
.brand-logo {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    line-height: 1;
}
.brand-mark {
    height: var(--brand-mark, 30px);
    width: var(--brand-mark, 30px);
    display: block;
}
.brand-wordmark {
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    font-weight: 600;
    font-size: var(--brand-size, 22px);
    letter-spacing: -0.015em;
    line-height: 1;
    color: var(--mud-palette-text-primary);
}
.brand-accent {
    color: var(--mud-palette-primary);
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #0071c1;
}

.btn-primary {
    color: #fff;
    background-color: #0E7C8A;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto 0 auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #0E7C8A;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

code {
    color: #c02d76;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}
/* SidePanel (MudDrawer-based edit panel): header / scrollable body / pinned footer. */
.side-panel-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
}
.side-panel-header {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    border-bottom: 1px solid var(--mud-palette-divider);
    flex: 0 0 auto;
}
.side-panel-body {
    padding: 16px;
    overflow-y: auto;
    flex: 1 1 auto;
}
.side-panel-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--mud-palette-divider);
    flex: 0 0 auto;
}

/* ── Summary panel: hero band with a stat strip and a share bar ─────────────
   Shared by the dashboard and the car cost report. An accent rule on top, an
   eyebrow-labelled title block, a row of figures separated by hairlines, and an
   optional stacked bar splitting a total by share. Hairlines come from a 1px flex
   gap showing the divider colour through, so the cells stay aligned however many
   wrap onto a row. */
.panel {
    border-top: 3px solid var(--mud-palette-primary);
}
.panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 16px 20px 14px;
}
.eyebrow {
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.09em;
    font-weight: 600;
    color: var(--mud-palette-text-secondary);
}
.panel-title {
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-top: 2px;
}
/* The one figure a panel exists to show (net worth), larger than the strip below. */
.panel-hero {
    font-size: clamp(1.9rem, 4vw, 2.8rem);
    font-weight: 600;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
    margin-top: 4px;
}
.panel-sub {
    font-size: 0.8rem;
    color: var(--mud-palette-text-secondary);
    font-variant-numeric: tabular-nums;
    margin-top: 3px;
}
/* Monospaced badge (a licence plate, a period) sitting opposite the title. */
.panel-badge {
    font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    padding: 5px 10px;
    border: 1px solid var(--mud-palette-divider);
    color: var(--mud-palette-text-secondary);
    white-space: nowrap;
}

/* Stat strip. Flex rather than grid so the cells stretch to fill whatever row they
   wrap onto — a grid would leave the trailing cells of a short last row showing the
   divider colour through as an empty block. */
.stat-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 1px;
    background: var(--mud-palette-divider);
    border-top: 1px solid var(--mud-palette-divider);
    border-bottom: 1px solid var(--mud-palette-divider);
}
.stat {
    flex: 1 1 165px;
    min-width: 0;
    background: var(--mud-palette-surface);
    padding: 14px 20px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.stat-label {
    text-transform: uppercase;
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    color: var(--mud-palette-text-secondary);
    white-space: nowrap;
}
.stat-value {
    /* Shrinks with the viewport so a long figure ("16.565,40 €") never breaks onto
       a second line and knocks the cells out of alignment. */
    font-size: clamp(1.05rem, 1.7vw, 1.4rem);
    font-weight: 600;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    line-height: 1.15;
    white-space: nowrap;
}
/* The figures a panel is really about (the rates on the car report). */
.stat-value.is-accent {
    color: var(--mud-palette-primary);
}
.stat-value.is-positive {
    color: var(--mud-palette-success);
}
.stat-value.is-negative {
    color: var(--mud-palette-error);
}
/* A secondary figure under the main one (a delta, a percentage). */
.stat-note {
    font-size: 0.74rem;
    color: var(--mud-palette-text-secondary);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* Share breakdown: a single stacked bar plus its legend. */
.share {
    padding: 16px 20px 18px;
}
.share-bar {
    display: flex;
    height: 12px;
    width: 100%;
    margin-top: 10px;
    background: var(--mud-palette-divider);
}
.share-seg + .share-seg {
    border-left: 1px solid var(--mud-palette-surface);
}
.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 20px;
    margin-top: 12px;
    font-size: 0.8rem;
}
.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}
.legend-swatch {
    width: 10px;
    height: 10px;
    flex: 0 0 auto;
}
.legend-pct {
    color: var(--mud-palette-text-secondary);
    font-variant-numeric: tabular-nums;
}

/* ── Dashboard ──────────────────────────────────────────────────────────────
   Section cards share the panel vocabulary without its accent rule: an eyebrow
   header, then hairline-separated rows of name + figure. */
.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px 12px;
    border-bottom: 1px solid var(--mud-palette-divider);
}
.section-total {
    font-size: 1.05rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}
.rows {
    display: flex;
    flex-direction: column;
}
.row-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 18px;
    border-bottom: 1px solid var(--mud-palette-divider);
}
.row-item:last-child {
    border-bottom: none;
}
.row-name {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.row-sub {
    display: block;
    font-size: 0.72rem;
    color: var(--mud-palette-text-secondary);
}
.row-value {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    white-space: nowrap;
}
.row-delta {
    font-size: 0.78rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    min-width: 84px;
    text-align: right;
}
.is-positive { color: var(--mud-palette-success); }
.is-negative { color: var(--mud-palette-error); }
.is-muted { color: var(--mud-palette-text-secondary); }

/* A wallet's share of total liquidity, drawn under its name. */
.row-meter {
    height: 3px;
    margin-top: 5px;
    background: var(--mud-palette-divider);
}
.row-meter > span {
    display: block;
    height: 100%;
    background: var(--mud-palette-primary);
}

/* ── Data checks page ─────────────────────────────────────────────────────────
   The hero's accent rule takes the colour of the worst severity found. */
.panel.panel-error   { border-top-color: var(--mud-palette-error); }
.panel.panel-warning { border-top-color: var(--mud-palette-warning); }
.panel.panel-info    { border-top-color: var(--mud-palette-info); }
.panel.panel-ok      { border-top-color: var(--mud-palette-success); }

.is-warning { color: var(--mud-palette-warning); }
.is-info    { color: var(--mud-palette-info); }

/* Severity badge: tinted, right-angled, uppercase — the "status" of a check card. */
.sev {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 3px 8px;
    border: 1px solid currentColor;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.sev-error   { color: var(--mud-palette-error); }
.sev-warning { color: var(--mud-palette-warning); }
.sev-info    { color: var(--mud-palette-info); }
.sev-ok      { color: var(--mud-palette-success); }

.check-card .section-head { align-items: center; }
.check-title {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
/* Why the check matters, in one line under its title. */
.check-why {
    padding: 8px 18px 10px;
    font-size: 0.8rem;
    color: var(--mud-palette-text-secondary);
    border-bottom: 1px solid var(--mud-palette-divider);
}
.check-item {
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
}
.check-foot {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 8px 18px;
    border-top: 1px solid var(--mud-palette-divider);
    font-size: 0.8rem;
}
.passed-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 24px;
    padding: 12px 18px 14px;
    font-size: 0.85rem;
    color: var(--mud-palette-text-secondary);
}
.passed-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}


/* ── CondoIQ ──────────────────────────────────────────────────────────────── */
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.unit-card { height: 100%; display: flex; flex-direction: column; }
.unit-card .rows { flex: 1 1 auto; }
.unit-card .row-value { text-align: right; }
/* The bill preview on the unit page. */
.summary-table { width: 100%; max-width: 520px; border-collapse: collapse; font-size: 0.9rem; }
.summary-table td { padding: 5px 4px; border-bottom: 1px solid var(--mud-palette-divider); }
.summary-table td.num { text-align: right; }
.summary-table tr.is-sub td { font-weight: 600; }
.summary-table tr.is-muted td { color: var(--mud-palette-text-secondary); }
.summary-table tr.is-total td { font-weight: 700; font-size: 1.05rem; border-top: 2px solid var(--mud-palette-text-primary); border-bottom: none; }
.preview { border-top: 1px solid var(--mud-palette-divider); padding-top: 12px; }
/* Tariff band editor rows. */
.band-row { display: grid; grid-template-columns: 1.2fr 1fr 1fr auto; gap: 8px; align-items: end; }
@media (max-width: 600px) { .band-row { grid-template-columns: 1fr 1fr; } }
/* Condominium switcher in the app bar and the current condominium's section in the menu. */
.condo-switcher-name { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-transform: none; }
@media (max-width: 600px) { .condo-switcher-name { max-width: 90px; } }
.nav-section {
    padding: 14px 16px 4px; font-size: 0.68rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--mud-palette-text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.condo-card { height: 100%; display: flex; flex-direction: column; }
.condo-card .rows { flex: 1 1 auto; }

/* Meter photo with the digits box (Components/ReadingCapture.razor). */
.meter-canvas { display: block; width: 100%; height: auto; border-radius: 6px; touch-action: none; cursor: crosshair; }
.meter-canvas.is-empty { display: none; }
.meter-photo { max-width: 100%; max-height: 70vh; display: block; margin: 0 auto; border-radius: 6px; }

/* Tenant's portal access in the unit page (Components/PortalAccess.razor). */
.portal-access { padding: 10px 20px 14px; border-top: 1px solid var(--mud-palette-lines-default); }
