/* ══ Utilities ═══════════════════════════════════════════════════════════════════════════════
   The global aura-* classes pages use on elements MudBlazor renders (tables, tabs), which a
   component's scoped CSS can never reach, plus numerals, identifiers and the inset panel. */

/* Cards stacked down a page. A page gives its children no gap and a card has no margin, so
   without this two cards touch (the Event pages and Contact settings pages did). */
.aura-stack {
    display: flex;
    flex-direction: column;
    gap: var(--aura-space-page);
    min-width: 0;
}

/* Tables. The table is its own card: a hairline frame, the inset surface behind a quiet header
   row, tabular numerals so money lines up. --flush drops the frame for a table that already
   sits inside a SectionCard. */
.mud-table.aura-table {
    border: 1px solid var(--aura-line);
    border-radius: var(--aura-radius-card);
    background-color: var(--aura-surface);
    box-shadow: var(--aura-shadow-card);
    overflow: hidden;
}

.mud-table.aura-table.aura-table--flush {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background-color: transparent;
}

/* The head is quiet: small secondary words on the table's own surface over a hairline, so the
   rows carry the weight. A plain MudSimpleTable gets the same. */
.mud-table.aura-table .mud-table-head .mud-table-cell,
.mud-simple-table.aura-table table thead th {
    background-color: var(--aura-surface);
    color: var(--mud-palette-text-secondary);
    font-size: var(--aura-text-xs);
    font-weight: var(--aura-weight-strong);
    border-bottom: 1px solid var(--aura-line);
    white-space: nowrap;
}

.mud-table.aura-table.mud-table-dense .mud-table-body .mud-table-cell {
    padding-block: 8px;
}

/* A selected row (RowClassFunc → aura-row-selected): the accent's tint and a bar at its leading
   edge, so the choice reads even where the tint is faint. */
.mud-table.aura-table .aura-row-selected {
    background-color: var(--aura-selected);
    box-shadow: inset 3px 0 0 var(--mud-palette-primary);
}

/* A table walked with the keys (aura-table--keys; aura-ui.js moves focus between the rows' links):
   the row holding focus wears the selected tint and the bar at its edge, so where the keyboard is
   reads as clearly as a pointer's hover. */
.mud-table.aura-table--keys .mud-table-body > .mud-table-row:has(:focus-visible) {
    background-color: var(--aura-selected);
    box-shadow: inset 3px 0 0 var(--mud-palette-primary);
}

.mud-table.aura-table .mud-table-cell,
.mud-simple-table.aura-table table td {
    font-variant-numeric: tabular-nums;
}

.mud-table.aura-table .mud-table-foot .mud-table-cell {
    font-weight: 600;
    border-top: 1px solid var(--aura-line);
}

.mud-table.aura-table .mud-table-pagination {
    border-top: 1px solid var(--aura-line);
}

/* A row's icon actions — RowActionButton and RowActionsMenu side by side. Each wraps its button
   in a span over a tooltip or a menu root, and those sat on different baselines: the edit or run
   button rode a few pixels above the menu beside it. */
.aura-row-action {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
}

.aura-row-action > .mud-tooltip-root,
.aura-row-action > .mud-menu {
    display: inline-flex;
    align-items: center;
}

/* Numbers and identifiers. aura-num replaces the inline text-align:right on money columns and
   the text-right class, which MudBlazor 9 does not define. */
.aura-num {
    text-align: right !important;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.aura-mono {
    font-family: var(--aura-font-mono);
    font-size: 0.9em;
}

.aura-strong {
    font-weight: 600;
}

.aura-muted {
    color: var(--mud-palette-text-secondary);
}

.aura-center {
    text-align: center;
}

.aura-nowrap {
    white-space: nowrap;
}

/* An inset panel inside a card: a note, an explanation, an address block, a meta line. */
.aura-inset {
    padding: 10px 14px;
    border-radius: var(--aura-radius-control);
    background-color: var(--aura-surface-inset);
}

/* Tabs: an underline strip, not a raised bar. */
.mud-tabs.aura-tabs > .mud-tabs-tabbar {
    background-color: transparent;
    border-radius: 0;
    border-bottom: 1px solid var(--aura-line);
}

.mud-tabs.aura-tabs .mud-tab {
    min-width: 0;
    padding-inline: 16px;
    font-weight: 500;
    color: var(--mud-palette-text-secondary);
}

.mud-tabs.aura-tabs .mud-tab.mud-tab-active {
    color: var(--mud-palette-primary);
}

.mud-tabs.aura-tabs .mud-tabs-panels {
    padding-top: var(--aura-space-page);
}

/* MudBlazor 9 activator wrapper for MudFileUpload dropzones. CustomContent replaced
   ActivatorContent and no longer opens the picker itself, so the dropzone is wrapped in a
   clickable element that calls OpenFilePickerAsync. Shared because four pages use it, and
   scoped CSS could not reach it from all of them. */
.upload-activator {
    display: block;
    cursor: pointer;
}

/* The composable dashboard grid Home renders. Global because it was a page-level <style>
   block. 24 columns and 50px rows MUST stay in sync with UserDashboardBuilder's .builder-grid,
   the tile validator's upper bound and the data-grid-row-height dashboard-grid.js reads. */
.user-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(24, 1fr);
    gap: var(--aura-space-stack);
    grid-auto-rows: 50px;
}

.user-dashboard-cell {
    display: flex;
    min-height: 0;
    overflow: hidden;
}

@media (max-width: 768px) {
    .user-dashboard-grid {
        grid-template-columns: 1fr;
    }

    .user-dashboard-cell {
        grid-column: 1 / -1 !important;
        grid-row: auto !important;
    }
}

/* Set by dashboard-grid.js on a builder tile while it is dragged or resized. Global because
   script, not markup, writes the class, so a scoped rule could never match it. */
.mud-layout .builder-tile-moving,
.mud-layout .builder-tile-resizing {
    border-color: var(--mud-palette-primary) !important;
    box-shadow: var(--aura-shadow-raised);
    opacity: 0.92;
    z-index: 10;
}

/* An email or statement preview, sandboxed in an iframe. The paper it is read on is white in
   either theme, so the frame is too — the preview's own styles assume it. */
.aura-preview-frame {
    display: block;
    width: 100%;
    height: 620px;
    border: 1px solid var(--aura-line);
    border-radius: var(--aura-radius-control);
    background-color: var(--mud-palette-white);
}
