/* ==========================================================================
   components.css — Shared UI components (status pills, compressor svg, tables,
   forms, toasts). Kept theme-driven via the tokens in theme.css.
   ========================================================================== */

/* ---------------- Compressor SVG ---------------- */
.compressor-svg {
    width: 100%;
    height: auto;
    max-width: 140px;
    display: block;
}

/* ---------------- Status pill ---------------- */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    padding: 2px var(--sp-3);
    border-radius: 999px;
    font-size: var(--fs-xs);
    font-weight: 600;
    letter-spacing: 0.02em;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-pill--gray   { background: var(--status-gray-dim);   color: var(--status-gray); }
.status-pill--green  { background: var(--status-green-dim);  color: var(--status-green); }
.status-pill--yellow { background: var(--status-yellow-dim); color: var(--status-yellow); }
.status-pill--red    { background: var(--status-red-dim);    color: var(--status-red); }

.status-dot--gray   { background: var(--status-gray); }
.status-dot--green  { background: var(--status-green); }
.status-dot--yellow { background: var(--status-yellow); }
.status-dot--red    { background: var(--status-red); }

/* ---------------- Forms ---------------- */
.field {
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
    margin-bottom: var(--sp-4);
}

.field label {
    font-size: var(--fs-sm);
    color: var(--text-muted);
    font-weight: 500;
}

/* Groups a run of fields inside a modal (the preventive thresholds). */
.modal-subtitle {
    font-size: var(--fs-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin: var(--sp-5) 0 var(--sp-3);
    padding-top: var(--sp-3);
    border-top: 1px solid var(--border-soft);
}

.input,
.select {
    width: 100%;
    padding: var(--sp-3);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit;
    font-size: var(--fs-sm);
    transition: border-color var(--transition);
}

.input:focus,
.select:focus {
    border-color: var(--accent);
    outline: none;
}

/* ---------------- Table ---------------- */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--fs-sm);
}

.table th,
.table td {
    text-align: left;
    padding: var(--sp-3);
    border-bottom: 1px solid var(--border-soft);
}

.table th {
    color: var(--text-muted);
    font-weight: 600;
    font-size: var(--fs-xs);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ---------------- Toast ---------------- */
.toast-host {
    position: fixed;
    bottom: var(--sp-5);
    right: var(--sp-5);
    z-index: 60;
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
}

.toast {
    padding: var(--sp-3) var(--sp-4);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    font-size: var(--fs-sm);
    max-width: 320px;
}

.toast--error {
    border-color: var(--status-red);
    color: var(--status-red);
}

.toast--success {
    border-color: var(--status-green);
    color: var(--status-green);
}

/* ---------------- Empty state ---------------- */
.empty {
    text-align: center;
    padding: var(--sp-8) var(--sp-4);
    color: var(--text-muted);
}

/* ---------------- Modal ---------------- */
.modal-host {
    display: none;
}

.modal-host.is-open {
    display: block;
}

.modal__backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 50;
}

.modal {
    position: fixed;
    z-index: 51;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: calc(100% - 2rem);
    max-width: 460px;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--sp-4) var(--sp-5);
    border-bottom: 1px solid var(--border-soft);
}

.modal__title {
    font-size: var(--fs-lg);
    font-weight: 600;
    margin: 0;
}

.modal__close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    line-height: 1;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
}

.modal__close:hover {
    background: var(--surface-2);
    color: var(--text);
}

.modal__body {
    padding: var(--sp-5);
}

.modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--sp-2);
    padding: var(--sp-4) var(--sp-5);
    border-top: 1px solid var(--border-soft);
}

/* ---------------- Page header with action ---------------- */
.page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--sp-4);
    margin-bottom: var(--sp-5);
    flex-wrap: wrap;
}

.page-head .page-title,
.page-head .page-subtitle {
    margin-bottom: 0;
}

/* ---------------- Badges ---------------- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px var(--sp-2);
    border-radius: var(--radius-sm);
    font-size: var(--fs-xs);
    font-weight: 600;
    border: 1px solid var(--border);
    color: var(--text-muted);
}

.badge--role-superadmin { color: var(--accent); border-color: var(--accent); }
.badge--role-admin      { color: var(--status-yellow); border-color: var(--status-yellow); }
.badge--role-operador   { color: var(--text-muted); }

.badge--active   { color: var(--status-green); border-color: var(--status-green); }
.badge--inactive { color: var(--status-red);   border-color: var(--status-red); }

/* Event log: something started going wrong / went back to normal / neither.
   Same colour language as the status tokens, applied to a past event. */
.badge--event-start { color: var(--status-red);   border-color: var(--status-red); }
.badge--event-end   { color: var(--status-green); border-color: var(--status-green); }
.badge--event-info  { color: var(--text-muted); }
/* A preventive episode still open. */
.badge--event-open  { color: var(--status-yellow); border-color: var(--status-yellow); }

/* ---------------- Card header with action (event history) ---------------- */
.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-4);
    margin-bottom: var(--sp-4);
    flex-wrap: wrap;
}

/* .section-title carries its own bottom margin; inside a card head the flex
   gap already spaces it. */
.card-head .section-title {
    margin: 0;
}

/* The two logs are stacked; only this page's cards get the gap (elsewhere cards
   live in grids that space themselves). */
.event-card + .event-card {
    margin-top: var(--sp-5);
}

/* Identifiers read as data, not prose. */
td.mono {
    font-family: var(--font-mono);
    color: var(--text-muted);
}

/* ---------------- Row actions ---------------- */
.row-actions {
    display: flex;
    gap: var(--sp-2);
    flex-wrap: wrap;
}

.btn--sm {
    padding: var(--sp-1) var(--sp-3);
    font-size: var(--fs-xs);
}

/* ---------------- Checkbox list (compressor assignment) ---------------- */
.check-list {
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: var(--sp-2);
}

.check-item {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-2) var(--sp-3);
    border-radius: var(--radius-sm);
}

.check-item:hover {
    background: var(--surface-2);
}

.check-item input {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
}

/* ---------------- Responsive table -> cards on mobile ---------------- */
@media (max-width: 720px) {
    .table--responsive thead {
        display: none;
    }
    .table--responsive tr {
        display: block;
        border: 1px solid var(--border);
        border-radius: var(--radius);
        margin-bottom: var(--sp-3);
        padding: var(--sp-2);
    }
    .table--responsive td {
        display: flex;
        justify-content: space-between;
        gap: var(--sp-4);
        border: none;
        padding: var(--sp-2) var(--sp-3);
    }
    .table--responsive td::before {
        content: attr(data-label);
        color: var(--text-muted);
        font-size: var(--fs-xs);
        text-transform: uppercase;
        letter-spacing: 0.04em;
        font-weight: 600;
    }
    .table--responsive td.row-actions-cell {
        justify-content: flex-start;
    }
    .table--responsive td.row-actions-cell::before {
        content: none;
    }
}

/* ---------------- Panel (home) ---------------- */
/* The "atualizado às" stamp, shared with the compressor page. */
.panel-toolbar__meta {
    font-size: var(--fs-xs);
    color: var(--text-faint);
}

/* Home head: "Início" with the refresh icon beside it, then the subtitle and
   the "atualizado às" stamp stacked under it. */
.panel-head {
    margin-bottom: var(--sp-5);
}

.panel-head__line {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
}

.panel-head__line .page-title {
    margin: 0;
}

.panel-head .page-subtitle {
    margin: var(--sp-2) 0 0;
}

.panel-head__meta {
    display: block;
    margin-top: var(--sp-1);
}

.compressor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--sp-4);
}

.compressor-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--sp-4);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--sp-3);
    cursor: pointer;
    transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
    position: relative;
}

.compressor-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.compressor-card__svg {
    width: 100%;
    display: flex;
    justify-content: center;
}

.compressor-card__name {
    font-weight: 600;
    font-size: var(--fs-sm);
    text-align: center;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.compressor-card__comm {
    font-size: var(--fs-xs);
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* status accent strip at the top of the card */
.compressor-card__strip {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: var(--radius) var(--radius) 0 0;
}

.strip--gray   { background: var(--status-gray); }
.strip--green  { background: var(--status-green); }
.strip--yellow { background: var(--status-yellow); }
.strip--red    { background: var(--status-red); }

/* ---------------- Alarm layer on the panel card ----------------
   Independent from the strip above, which is the communication status: the
   border, the badge and the red line say the last stored sample has a fault
   bit set. Hover keeps the red border (the generic hover rule is more specific,
   hence the explicit :hover here). */
.compressor-card--alarm,
.compressor-card--alarm:hover {
    border-color: var(--status-red);
}

.compressor-card--alarm {
    background: linear-gradient(var(--status-red-dim), var(--status-red-dim)), var(--surface);
}

.alarm-badge {
    position: absolute;
    top: var(--sp-2);
    left: var(--sp-2);
    display: inline-flex;
    align-items: center;
    gap: 2px;
    background: var(--status-red);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 2px var(--sp-2);
    border-radius: var(--radius-sm);
    z-index: 2;
}

.compressor-card__alarms {
    width: 100%;
    text-align: center;
    font-size: var(--fs-xs);
    font-weight: 600;
    color: var(--status-red);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Preventive alarm (pressure below / temperature above the compressor's own
   thresholds, decided by the backend): the same layer in yellow. A fault bit
   paints red instead — view_home.js never sets both classes at once. */
.compressor-card--warning,
.compressor-card--warning:hover {
    border-color: var(--status-yellow);
}

.compressor-card--warning {
    background: linear-gradient(var(--status-yellow-dim), var(--status-yellow-dim)), var(--surface);
}

.alarm-badge--warning {
    background: var(--status-yellow);
    color: #1c1c1c;
}

.compressor-card__alarms--warning {
    color: var(--status-yellow);
}

/* Both carry a display of their own, so [hidden] has to be spelled out. */
.alarm-badge[hidden],
.compressor-card__alarms[hidden] {
    display: none;
}

/* ---------------- Unlisted badge (panel + equipment) ---------------- */
.unlisted-badge {
    position: absolute;
    top: var(--sp-2);
    right: var(--sp-2);
    background: var(--status-red);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 2px var(--sp-2);
    border-radius: var(--radius-sm);
    z-index: 2;
}

.badge--unlisted {
    color: var(--status-red);
    border-color: var(--status-red);
}

/* ---------------- Compressor detail ---------------- */
.section-title {
    font-size: var(--fs-base);
    font-weight: 600;
    margin: 0 0 var(--sp-4);
    color: var(--text);
}

/* Header: info block on the left, export card on the right. */
.compressor-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--sp-4);
    margin-bottom: var(--sp-5);
    flex-wrap: wrap;
}

.compressor-head__info {
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
}

.compressor-head__info .page-title,
.compressor-head__info .page-subtitle {
    margin: 0;
}

/* Name and communication pill on the same line. */
.compressor-head__line {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    flex-wrap: wrap;
}

.compressor-head__info .page-subtitle {
    cursor: default;
}

/* Name, "última leitura", the "atualizado às" stamp and then Voltar/Atualizar,
   each on its own line in the info column. */
.compressor-head__info .row-actions {
    align-items: center;
}

.export-card {
    padding: var(--sp-4);
    min-width: 280px;
}

.export-card .section-title {
    margin-bottom: var(--sp-3);
}

.export-row {
    display: flex;
    align-items: flex-end;
    gap: var(--sp-3);
    flex-wrap: wrap;
}

.field--inline {
    margin-bottom: 0;
}

.field--inline .input {
    width: auto;
}

/* Two columns: left stacks Valores + Estados; right is Alarmes. */
.detail-tables {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-4);
    align-items: start;
}

.detail-col {
    display: flex;
    flex-direction: column;
    gap: var(--sp-4);
    min-width: 0;
}

.detail-table td {
    padding: var(--sp-3);
}

.detail-table td.detail-value {
    text-align: right;
    color: var(--text);
    font-weight: 500;
}

/* Active alarm: fault bit = 1. Red tint + red text + a red bar on the left,
   so it reads as an alarm even for a color-blind eye or a printed page. */
.detail-table tr.is-alarm td {
    background: var(--status-red-dim);
    color: var(--status-red);
    font-weight: 600;
}

.detail-table tr.is-alarm td:first-child {
    box-shadow: inset 3px 0 0 var(--status-red);
}

.detail-table tr.is-alarm td.detail-value {
    color: var(--status-red);
}

/* Count of active alarms, next to the "Alarmes" section title. */
.alarm-count {
    display: inline-block;
    margin-left: var(--sp-2);
    padding: 2px var(--sp-2);
    border-radius: var(--radius-sm);
    background: var(--status-red);
    color: #fff;
    font-size: var(--fs-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    vertical-align: middle;
}

/* ---------------- Segmented control (layout switch) ---------------- */
.seg {
    display: inline-flex;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    overflow: hidden;
}

.seg__btn {
    padding: var(--sp-3) var(--sp-4);
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: var(--fs-sm);
    font-weight: 500;
    transition: background var(--transition), color var(--transition);
}

.seg__btn + .seg__btn {
    border-left: 1px solid var(--border);
}

.seg__btn:hover {
    background: var(--surface-2);
    color: var(--text);
}

.seg__btn.is-active {
    background: var(--accent-soft);
    color: var(--accent);
}

/* ---------------- Compressor detail: "Disponibilidade" timeline ----------------
   One bar per local day, green online / red offline / gray no data. The
   colours are the status tokens, so they read like the rest of the page. */
.uptime-card {
    margin-top: var(--sp-4);
}

.uptime__controls {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    flex-wrap: wrap;
}

.uptime__date {
    width: auto;
    padding: var(--sp-2) var(--sp-3);
}

.uptime__controls .seg__btn {
    padding: var(--sp-2) var(--sp-3);
}

.uptime__summary {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2) var(--sp-5);
    margin-bottom: var(--sp-3);
    font-size: var(--fs-sm);
    color: var(--text-muted);
}

.uptime__stat {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
}

.uptime__stat strong {
    color: var(--text);
    font-weight: 600;
}

.uptime__muted {
    color: var(--text-faint);
}

.uptime__rows {
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
}

.uptime__row {
    display: grid;
    grid-template-columns: 1fr;
    align-items: center;
    gap: var(--sp-3);
}

.uptime__row--week {
    grid-template-columns: 5.5rem 1fr;
}

.uptime__day {
    font-family: var(--font-mono);
    font-size: var(--fs-xs);
    color: var(--text-muted);
    white-space: nowrap;
}

.uptime__bar {
    display: flex;
    height: 22px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--surface-2);
}

.uptime__seg {
    height: 100%;
    flex: 0 0 auto;
}

/* A two-minute outage is a sliver of a day; keep it visible. */
.uptime__seg--offline {
    min-width: 2px;
}

.uptime__seg--online  { background: var(--status-green); }
.uptime__seg--offline { background: var(--status-red); }
.uptime__seg--unknown { background: var(--status-gray-dim); }
.uptime__seg--future  { background: transparent; }

.uptime__ticks {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-faint);
}

.uptime__legend {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-4);
    margin-top: var(--sp-3);
    font-size: var(--fs-xs);
    color: var(--text-muted);
}

.uptime__legend-item {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
}

.uptime__swatch {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 2px;
    border: 1px solid var(--border);
}

@media (max-width: 720px) {
    .uptime__row--week {
        grid-template-columns: 4.5rem 1fr;
    }
}

/* ---------------- Compressor detail: "Painel" layout ---------------- */
.panel-layout {
    display: flex;
    flex-direction: column;
    gap: var(--sp-4);
}

/* KPI tiles: pressão, temperatura, corrente, estado. */
.kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--sp-4);
}

.kpi {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--sp-4) var(--sp-5);
    display: flex;
    flex-direction: column;
    gap: var(--sp-1);
    min-width: 0;
}

.kpi__label {
    font-size: var(--fs-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.kpi__value {
    font-size: var(--fs-xl);
    font-weight: 700;
    line-height: 1.2;
    display: flex;
    align-items: baseline;
    gap: var(--sp-2);
    overflow: hidden;
    text-overflow: ellipsis;
}

/* "sem leitura" in place of a number: smaller and muted, so an absent value
   never looks like a measured one. */
.kpi__value--empty {
    font-size: var(--fs-base);
    font-weight: 500;
    color: var(--text-faint);
}

.kpi__unit {
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--text-muted);
}

.kpi__sub {
    font-size: var(--fs-xs);
    color: var(--text-faint);
}

/* Preventive alarm on the pressure / temperature tile: yellow border, tint,
   value and sub-line, so the tile reads as "watch this" rather than "broken". */
.kpi--warning {
    border-color: var(--status-yellow);
    background: linear-gradient(var(--status-yellow-dim), var(--status-yellow-dim)), var(--surface);
}

.kpi--warning .kpi__value,
.kpi--warning .kpi__sub {
    color: var(--status-yellow);
}

.kpi--warning .kpi__sub {
    font-weight: 600;
}

/* The state tile carries a dot instead of a number, so it aligns on centers. */
.kpi--state .kpi__value {
    align-items: center;
    font-size: var(--fs-lg);
    letter-spacing: 0.02em;
}

.kpi--state .status-dot {
    width: 10px;
    height: 10px;
}

/* Beats the .kpi--state size above, which is more specific than the token. */
.kpi--state .kpi__value--empty {
    font-size: var(--fs-base);
}

/* Two columns: left stacks Operacional + Manutenção; right is Alarmes. */
.panel-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-4);
    align-items: start;
}

.panel-col {
    display: flex;
    flex-direction: column;
    gap: var(--sp-4);
    min-width: 0;
}

/* Label/value rows, the card-friendly stand-in for a two-column table. */
.stat-list {
    display: flex;
    flex-direction: column;
}

.stat-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--sp-4);
    padding: var(--sp-2) var(--sp-1);
    border-bottom: 1px solid var(--border-soft);
    font-size: var(--fs-sm);
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-row__label {
    color: var(--text-muted);
    min-width: 0;
}

.stat-row__value {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    text-align: right;
    white-space: nowrap;
}

/* Active fault: same red language as the table layout (tint, red text and a
   bar on the left), so both layouts read alike. */
.stat-row.is-alarm {
    background: var(--status-red-dim);
    box-shadow: inset 3px 0 0 var(--status-red);
    font-weight: 600;
}

.stat-row.is-alarm .stat-row__label,
.stat-row.is-alarm .stat-row__value {
    color: var(--status-red);
}

/* One-line verdict above the alarm list. */
.alarm-summary {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    margin-bottom: var(--sp-3);
    padding: var(--sp-2) var(--sp-3);
    border-radius: var(--radius-sm);
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--text-muted);
    background: var(--surface-2);
}

.alarm-summary.is-ok {
    color: var(--status-green);
    background: var(--status-green-dim);
}

.alarm-summary.is-alarm {
    color: var(--status-red);
    background: var(--status-red-dim);
}

/* Manutenção: hours since the service against its interval. */
.maint-list {
    display: flex;
    flex-direction: column;
    gap: var(--sp-4);
}

.maint__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--sp-4);
    font-size: var(--fs-sm);
    margin-bottom: var(--sp-2);
}

.maint__label {
    color: var(--text-muted);
}

.maint__value {
    white-space: nowrap;
    font-weight: 500;
}

.maint__value--yellow { color: var(--status-yellow); }
.maint__value--red    { color: var(--status-red); }

.maint__bar {
    height: 8px;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--border-soft);
    overflow: hidden;
}

.maint__fill {
    height: 100%;
    border-radius: 999px;
    transition: width var(--transition);
}

.maint__fill--gray   { background: var(--status-gray); }
.maint__fill--green  { background: var(--status-green); }
.maint__fill--yellow { background: var(--status-yellow); }
.maint__fill--red    { background: var(--status-red); }

/* Stack everything on mobile. */
@media (max-width: 820px) {
    .detail-tables,
    .panel-grid {
        grid-template-columns: 1fr;
    }
    .export-card {
        width: 100%;
    }
}
