/* UI uplift Phase 1: Stratum's own styles, driven by the design tokens MainLayout writes as CSS
   variables on :root (ThemeTokens.CssVariables). The fallbacks below match the defaults, so a page
   outside MainLayout still looks right. */

:root {
    --stratum-font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --stratum-heading-font: var(--stratum-font);
    --stratum-radius: 8px;
    --stratum-card-shadow: 0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.06);
}

/* ── Read-only values: label above, value as plain text (no input box) ───────────── */
.stratum-readonly {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    padding: 2px 0 6px;
}

.stratum-readonly-label {
    font-size: .75rem;
    line-height: 1.3;
    color: var(--mud-palette-text-secondary);
}

.stratum-readonly-value {
    font-size: .95rem;
    line-height: 1.45;
    color: var(--mud-palette-text-primary);
    white-space: pre-line;
    overflow-wrap: anywhere;
}

    .stratum-readonly-value.is-empty {
        color: var(--mud-palette-text-disabled);
    }

/* ── Panels (Form / Table) ───────────────────────────────────────────────────────── */
.stratum-panel {
    border-radius: var(--stratum-radius) !important;
}

    .stratum-panel.stratum-panel-flat {
        border: 0 !important;
        box-shadow: none !important;
        background: transparent !important;
    }

/* ── Tables ──────────────────────────────────────────────────────────────────────── */
.stratum-table .mud-table-head .mud-table-cell {
    font-weight: 600;
    font-size: .8rem;
    color: var(--mud-palette-text-secondary);
    white-space: nowrap;
}

.stratum-table .stratum-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.stratum-table .mud-table-head .mud-table-cell.stratum-num .mud-table-sort-label {
    flex-direction: row-reverse;
}

.stratum-table-empty {
    padding: 24px 16px;
    text-align: center;
    color: var(--mud-palette-text-secondary);
}

/* ── Debug mode strip ────────────────────────────────────────────────────────────── */
.stratum-debug-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 16px;
    font-size: .8rem;
    background: var(--mud-palette-warning-lighten);
    color: var(--mud-palette-warning-text);
    border-bottom: 1px solid var(--mud-palette-warning);
}

/* Phase 3: tab labels in sentence case, like the buttons (MudTabs uppercases them on its own). */
.mud-tabs .mud-tab { text-transform: none; letter-spacing: normal; }

/* UI uplift restyle: a read-only field in an editable form reads as fixed -- filled, no outline. */
.stratum-ro .mud-input.mud-input-outlined { background: var(--mud-palette-background-grey); border-radius: var(--stratum-radius, 8px); }
.stratum-ro .mud-input-outlined-border { border-color: transparent !important; }
.stratum-ro input, .stratum-ro textarea { color: var(--mud-palette-text-primary); cursor: default; }

/* UI uplift restyle: Application Layout "Field Labels = Above" -- the label sits over the box, not in its border. */
.stratum-labels-above .mud-input-control.mud-input-outlined-with-label { margin-top: 22px; }
.stratum-labels-above .mud-input-label-outlined.mud-input-label-inputcontrol {
    transform: translate(0, -23px) scale(1) !important; left: 0 !important; padding: 0 !important;
    background: transparent !important; font-size: .85rem; font-weight: 500; color: var(--mud-palette-text-primary);
}
.stratum-labels-above .mud-input-outlined-border legend { max-width: 0 !important; width: 0 !important; padding: 0 !important; }
.stratum-labels-above .mud-input-control.mud-input-error .mud-input-label-outlined { color: var(--mud-palette-error); }
