/* ============================================================================
   calendar-grid.css — shared TABLE/GRID + ACCORDION + SECTION-HEADER styles
   ----------------------------------------------------------------------------
   Ported from the Praxis Blazor app (colors preserved) so every Calendar page
   that shows a table or a collapsible/accordion section looks consistent.
   Apply: <table class="Grid">..., wrap with <div class="GridDiv">, use
   .collapsible-group / .collapsible-group-header / .collapsible-group-content
   for accordions, and .PageHeaderLabel for section title bars.
   ============================================================================ */

/* ---- Data grid / table ---- */
.Grid {
    border-collapse: collapse;
    border: 0 none;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    width: 100%;
}

.Grid th {
    background-color: #262261;
    border: thin solid #000000;
    color: #ffffff;
    font-size: 12px;
    font-weight: bold;
    /* All column headings centered on every table (overrides per-column text-end/text-start). */
    text-align: center !important;
    padding: 6px 8px;
}

/* App-wide sticky column headers: the navy header row stays visible while the table
   body scrolls (under page / container scroll). The header keeps its solid #262261
   background so rows never show through. (Praxis sticky-header behavior.) */
.Grid thead th {
    position: sticky;
    top: 0;
    z-index: 5;
}

/* Scroll box for a grid: the TABLE body scrolls inside this box (so the page chrome —
   title / filter / buttons — stays put) while the sticky header above pins to the box
   top. Short tables (under the max-height) show no scrollbar and look unchanged. Wrap a
   .Grid table in <div class="grid-scroll">…</div> to enable it. */
.grid-scroll {
    max-height: 65vh;
    overflow: auto;
}

.Grid td {
    border: thin solid #000000;
    padding: 4px 8px;
    font-weight: bold;
}

/* Sortable headers on a navy .Grid header: keep the white text and lighten the
   background on hover (Praxis behavior) instead of turning the text blue. */
.Grid th.sortable-header {
    cursor: pointer;
    user-select: none;
}

.Grid th.sortable-header:hover {
    background-color: #383178;
    color: #ffffff;
}

.Grid th .sort-caret {
    opacity: .85;
    margin-left: .25rem;
    font-size: .8em;
}

/* Default sort affordance: any sortable column that is NOT already showing an explicit sort
   indicator (a .sort-caret span or an <i> icon) gets a faint up/down arrow, so users can tell
   the column is sortable before clicking. The :not(:has(...)) guards prevent doubling up on the
   grids/chat tables that already render their own caret. */
th.sortable-header { cursor: pointer; user-select: none; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable-header:not(:has(.sort-caret)):not(:has(i))::after,
th.sortable:not(:has(.sort-caret)):not(:has(i))::after {
    content: "\2195";
    opacity: .4;
    margin-left: .25rem;
    font-size: .8em;
    font-weight: normal;
}

/* All table text is bold EXCEPT form controls (entry boxes/dropdowns keep normal weight). */
.Grid td input,
.Grid td select,
.Grid td textarea {
    font-weight: normal;
}

.Grid tbody tr {
    background-color: #ffffff;
}

.Grid tbody tr:nth-child(even) {
    background-color: #bfdbff;
}

/* No hover background change on table rows (per request — applies to all .Grid tables). */

/* Explicit row-state classes (when alternating cannot be derived structurally) */
.GridRowStyle {
    background-color: #ffffff;
}

.GridAlternatingRowStyle {
    background-color: #bfdbff;
}

.GridSelectedRowStyle {
    background-color: #bcd7f1;
}

/* Rounded, clipped wrapper around a grid. Uses overflow:clip (not hidden) so it still
   clips the rounded corners WITHOUT becoming a scroll container — otherwise it would
   break the sticky .Grid column headers inside it. */
.GridDiv {
    border-radius: 8px;
    border: 1px solid #000000;
    margin: 3px 0;
    overflow: clip;
    text-align: left;
}

/* ---- Collapsible / accordion panels ---- */
.collapsible-group {
    margin-bottom: 10px;
}

.collapsible-group-header {
    /* WebForms .accordionHeader: light-blue bar, black Arial 12px bold, black border. */
    background-color: #bfdbff;
    color: #000000;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    padding: 8px 12px;
    font-weight: bold;
    cursor: pointer;
    border: 1px solid #000000;
    border-radius: 4px;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 8px;
    user-select: none;
}

.collapsible-group-header:hover {
    background-color: #a9cdf5;
}

.collapsible-group-header .toggle-icon {
    transition: transform 0.15s ease;
    width: 14px;
    text-align: center;
}

.collapsible-group-content {
    padding: 12px;
    border: 1px solid #000000;
    border-top: none;
    border-radius: 0 0 4px 4px;
}

/* ---- Section / page header bars ---- */
.PageHeaderLabel {
    background-color: #ADD8E6;
    border-radius: 8px;
    border: 1px solid #000000;
    color: #000000;
    display: block;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    font-weight: bold;
    margin: 10px auto;
    min-height: 20px;
    padding: 4px 8px;
    text-align: center;
    width: 100%;
}

.PageHeaderLabelMedium {
    background-color: #ADD8E6;
    border-radius: 8px;
    border: 1px solid #000000;
    color: #000000;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    font-weight: bold;
    margin: 8px auto;
    padding: 3px 8px;
    text-align: center;
}

/* ---- FinancialEntry grids + the standalone totals table ----
   Fixed column widths so the per-type account grids (inside the accordions) and the always-visible
   totals table below them line up, even though they are separate <table> elements. Columns:
   1 Account Type | 2 Account (takes remaining width) | 3 Actual | 4 Forecast | 5 Variance | 6 Budget. */
.financials-grid {
    table-layout: fixed;
}

.financials-grid th:nth-child(1),
.financials-grid td:nth-child(1) {
    width: 130px;
}

.financials-grid th:nth-child(3), .financials-grid td:nth-child(3),
.financials-grid th:nth-child(4), .financials-grid td:nth-child(4),
.financials-grid th:nth-child(5), .financials-grid td:nth-child(5),
.financials-grid th:nth-child(6), .financials-grid td:nth-child(6) {
    width: 140px;
}

/* Amount inputs fill their (now fixed-width) cell. */
.financials-grid td input {
    width: 100%;
}

/* ---- Blazor-driven multi-select dropdown (replaces Bootstrap data-bs-toggle, which does not
   initialize reliably under Blazor Server). The transparent full-screen backdrop closes the menu on an
   outside click; the menu sits one layer above it so its checkboxes stay clickable. ---- */
.dropdown-backdrop-transparent {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: transparent;
}

.dropdown-menu-above-backdrop {
    z-index: 1001;
}
