/* ============================================================================
   AVALME Â· TAILUX â†’ MUDBLAZOR BRIDGE
   Component-level overrides that adapt MudBlazor's stock styles to the
   design design system. The CSS variable definitions (--mud-palette-*,
   --color-*, --av-status-*, --radius-*, etc.) live in the design tokens stylesheet â€”
   this file ONLY consumes tokens via var() and writes rules against
   MudBlazor / scope class selectors.

   Loaded AFTER the design tokens stylesheet and MudBlazor's own CSS, BEFORE avalme.css,
   so it wins by source order at equal specificity.

   Sections:
     1. Card Skin (Brecha 2) â€” data-card-skin reskins MudCard.
     2. Density (Brecha 3) â€” data-density="compact" tightens heights.
     (Plus the .bp-tm-demo task-manager scope, .bp-tm-demo-tabs, etc.)
   ============================================================================ */


/* â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€
   1. CARD SKIN
   data-card-skin on <html> reskins every MudCard / elevated MudPaper.
   "shadow" (default) keeps MudBlazor's default look.
   "bordered" replaces shadow with a 1px border.
   "filled" drops shadow and uses surface-2 fill.
   We exclude .mud-popover, .mud-menu and similar floating surfaces so menus
   keep their elevation regardless of skin.
   â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */

[data-card-skin="bordered"] .mud-card,
[data-card-skin="bordered"] .styled-table.mud-paper,
[data-card-skin="bordered"] .mud-paper.bp-card {
    box-shadow: none !important;
    border: 1px solid var(--color-gray-200);
}

html.dark[data-card-skin="bordered"] .mud-card,
html.dark[data-card-skin="bordered"] .styled-table.mud-paper,
html.dark[data-card-skin="bordered"] .mud-paper.bp-card {
    border-color: var(--color-dark-500);
}

[data-card-skin="filled"] .mud-card,
[data-card-skin="filled"] .styled-table.mud-paper,
[data-card-skin="filled"] .mud-paper.bp-card {
    box-shadow: none !important;
    background-color: var(--color-gray-100) !important;
    border: 1px solid transparent;
}

html.dark[data-card-skin="filled"] .mud-card,
html.dark[data-card-skin="filled"] .styled-table.mud-paper,
html.dark[data-card-skin="filled"] .mud-paper.bp-card {
    background-color: var(--color-dark-600) !important;
}

/* shadow skin â€” default. No overrides; MudCard keeps its built-in elevation. */


/* â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€
   2.b BORDER RADIUS NORMALIZATION
   BpAdminDashboardTheme.cs sets DefaultBorderRadius = 3px which makes inputs
   and cards look square. design uses rounded-lg (8px). Override component
   radii to match the design feel without touching the C# theme (other places
   may still want 3px). Order: override AFTER MudBlazor's own rules because
   MudBlazor sets these via inline runtime style.
   â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */

/* Inputs (text fields, selects, autocomplete, date pickers, numeric fields) */
.mud-input.mud-input-outlined,
.mud-input.mud-input-filled,
.mud-input-control .mud-input-outlined-border,
.mud-input-slot.mud-input-root-outlined,
.mud-select .mud-input-root-outlined,
.mud-autocomplete .mud-input-root-outlined,
.mud-picker-input .mud-input-root-outlined {
    border-radius: var(--radius-lg) !important;
}

/* The fieldset that draws the outline in MudBlazor outlined inputs */
.mud-input-outlined-border {
    border-radius: var(--radius-lg) !important;
}

/* Buttons (default + filled + outlined) */
.mud-button-root:not(.mud-icon-button):not(.mud-fab) {
    border-radius: var(--radius-lg) !important;
}

/* Cards / Paper at default elevation */
.mud-card,
.mud-paper {
    border-radius: var(--radius-lg) !important;
}

    /* Popovers and floating surfaces â€” keep them slightly tighter */
    .mud-popover,
    .mud-menu .mud-popover,
    .mud-list .mud-popover {
        border-radius: var(--radius-md) !important;
    }

/* Chips */
.mud-chip {
    border-radius: var(--radius-sm) !important;
}

    .mud-chip.mud-chip-pill {
        border-radius: var(--radius-full) !important;
    }

/* Alerts */
.mud-alert {
    border-radius: var(--radius-lg) !important;
}

/* Dialogs */
.mud-dialog {
    border-radius: var(--radius-lg) !important;
}


/* â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€
   2. DENSITY
   data-density="compact" (default) tightens heights and paddings on the
   interactive primitives. "comfortable" matches MudBlazor's stock spacing;
   no overrides needed for that case.
   â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */

/* Buttons */
[data-density="compact"] .mud-button-root:not(.mud-icon-button):not(.mud-fab) {
    min-height: 32px;
    padding: 4px 16px;
    font-size: 13px;
    line-height: 1.4;
}

[data-density="compact"] .mud-button-root.mud-button-size-small:not(.mud-icon-button) {
    min-height: 28px;
    padding: 2px 12px;
    font-size: 12px;
}

/* Icon buttons */
[data-density="compact"] .mud-icon-button.mud-icon-button-size-medium {
    width: 36px;
    height: 36px;
}

[data-density="compact"] .mud-icon-button.mud-icon-button-size-small {
    width: 28px;
    height: 28px;
}

/* Inputs (outlined / filled) */
[data-density="compact"] .mud-input-control .mud-input-root.mud-input-outlined,
[data-density="compact"] .mud-input-control .mud-input-root.mud-input-filled {
    min-height: 36px;
}

[data-density="compact"] .mud-input.mud-input-outlined input,
[data-density="compact"] .mud-input.mud-input-filled input {
    padding-top: 8px;
    padding-bottom: 8px;
}

/* Tables â€” ensure compact rows even when Dense="false" wasn't set per call. */
[data-density="compact"] .mud-table .mud-table-row {
    height: 36px;
}

[data-density="compact"] .mud-table .mud-table-cell {
    padding: 6px 12px;
    line-height: 1.4;
}

[data-density="compact"] .mud-table .mud-table-head .mud-table-row,
[data-density="compact"] .mud-table .mud-table-head .mud-table-cell {
    height: 32px;
    padding-top: 4px;
    padding-bottom: 4px;
}

/* Toolbars / app bar */
[data-density="compact"] .mud-toolbar {
    min-height: 48px;
}

[data-density="compact"] .mud-appbar.mud-appbar-dense .mud-toolbar {
    min-height: 48px;
}

/* Tabs */
[data-density="compact"] .mud-tabs .mud-tab {
    min-height: 40px !important;
    padding: 8px 16px !important;
}

/* List items */
[data-density="compact"] .mud-list .mud-list-item {
    min-height: 36px;
    padding-top: 4px;
    padding-bottom: 4px;
}

/* Chips */
[data-density="compact"] .mud-chip.mud-chip-size-medium {
    height: 28px;
    font-size: 12px;
}

[data-density="compact"] .mud-chip.mud-chip-size-small {
    height: 22px;
    font-size: 11px;
}

/* Comfortable â€” explicit overrides mostly to UNDO compact when the user picks
   it on a screen that defaults to dense styled-table etc. */
[data-density="comfortable"] .mud-table .mud-table-row {
    height: 48px;
}

[data-density="comfortable"] .mud-table .mud-table-cell {
    padding: 12px 20px;
}


/* â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€
   4. .bp-tm-demo SCOPE â€” design task-manager template replica.
   The page uses MudBlazor primitives (MudCard, MudButton, MudChip, MudCheckBox,
   MudExpansionPanels, MudTabs, MudTextField, MudIconButton, MudAvatar) â€” the
   rules below override Mud's internal chrome (.mud-card, .mud-chip-root, etc.)
   so the visual matches avalme-task-manager.html exactly.
   Every value resolves to a semantic token so the theme picker flips
   this page too. Per-persona avatar gradients are the only HEX kept (av-1
   tan/beige), intentionally isolated.
   Anti-pattern check: no inline Style in the .razor; no raw <table>/<button>
   for things Mud already provides.
   â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */

.bp-tm-demo {
    font-family: var(--font-sans);
    color: var(--color-gray-800);
}

    .bp-tm-demo button {
        font-family: inherit;
        cursor: pointer;
        border: none;
        background: none;
        color: inherit;
        padding: 0;
    }

    .bp-tm-demo *, .bp-tm-demo *::before, .bp-tm-demo *::after {
        box-sizing: border-box;
    }

/* â”€â”€â”€ Page header â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.bp-tm-demo-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.bp-tm-demo-title-block {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    flex: 1;
}

.bp-tm-demo-title-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--color-primary-500) 0%, var(--color-primary-700) 100%);
    color: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 14px -3px rgb(from var(--color-primary-600) r g b / 0.40);
}

    .bp-tm-demo-title-icon .mud-icon-root { color: var(--color-white); }

.bp-tm-demo-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--color-gray-900);
    letter-spacing: -0.025em;
    line-height: 1.15;
    margin: 0;
}

html.dark .bp-tm-demo-title { color: var(--color-dark-50); }

.bp-tm-demo-subtitle {
    font-size: 13px;
    color: var(--color-gray-500);
    margin: 5px 0 0;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

html.dark .bp-tm-demo-subtitle { color: var(--color-dark-300); }

.bp-tm-demo-dot-sep { color: var(--color-gray-300); font-weight: 700; }

.bp-tm-demo-online {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--color-success-darker);
    font-weight: 600;
}

    .bp-tm-demo-online::before {
        content: '';
        width: 7px;
        height: 7px;
        border-radius: 50%;
        background: var(--color-success);
        box-shadow: 0 0 0 0 rgb(from var(--color-success) r g b / 0.6);
        animation: bp-tm-pulse-green 2s infinite;
    }

@keyframes bp-tm-pulse-green {
    0%   { box-shadow: 0 0 0 0 rgb(from var(--color-success) r g b / 0.6); }
    70%  { box-shadow: 0 0 0 7px rgb(from var(--color-success) r g b / 0); }
    100% { box-shadow: 0 0 0 0 rgb(from var(--color-success) r g b / 0); }
}

.bp-tm-demo-page-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* â”€â”€â”€ Buttons â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.bp-tm-demo-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 14px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 12.5px;
    transition: all 0.15s;
    border: 1px solid transparent;
    white-space: nowrap;
    line-height: 1;
}

    .bp-tm-demo-btn .mud-icon-root { width: 14px; height: 14px; }

.bp-tm-demo-btn-primary {
    background: var(--color-primary-600);
    color: var(--color-white);
    box-shadow: 0 4px 12px rgb(from var(--color-primary-600) r g b / 0.25);
}

    .bp-tm-demo-btn-primary:hover {
        background: var(--color-primary-700);
        transform: translateY(-1px);
        box-shadow: 0 6px 16px rgb(from var(--color-primary-600) r g b / 0.30);
    }

    .bp-tm-demo-btn-primary .mud-icon-root { color: var(--color-white); }

.bp-tm-demo-btn-secondary {
    background: var(--color-white);
    color: var(--color-gray-700);
    border-color: var(--color-gray-200);
}

    .bp-tm-demo-btn-secondary:hover {
        background: var(--color-gray-50);
        border-color: var(--color-gray-300);
        color: var(--color-gray-900);
    }

html.dark .bp-tm-demo-btn-secondary {
    background: var(--color-dark-700);
    color: var(--color-dark-100);
    border-color: var(--color-dark-500);
}

    html.dark .bp-tm-demo-btn-secondary:hover {
        background: var(--color-dark-600);
        border-color: var(--color-dark-400);
    }

/* â”€â”€â”€ Page header (MudStack root) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
/* Vertical rhythm between the page header and the KPI grid below. */
.bp-tm-demo-header { margin-bottom: 20px; }

/* â”€â”€â”€ KPI grid â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
/* Layout is handled by MudGrid (xs/sm/md). We only add bottom margin so the
   view-bar card sits below the KPIs with proper rhythm. */
.bp-tm-demo-kpi-grid { margin-bottom: 20px !important; }

.bp-tm-demo-kpi-card {
    background: var(--color-white);
    border: 1px solid var(--color-gray-200);
    border-radius: 14px;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: all 0.18s ease;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

html.dark .bp-tm-demo-kpi-card {
    background: var(--color-dark-700);
    border-color: var(--color-dark-500);
}

    .bp-tm-demo-kpi-card:hover {
        border-color: var(--color-primary-300);
        transform: translateY(-2px);
        box-shadow: 0 8px 24px rgb(from var(--color-primary-700) r g b / 0.10), 0 2px 6px rgba(0, 0, 0, 0.05);
    }

    .bp-tm-demo-kpi-card::after {
        content: '';
        position: absolute;
        top: 0; left: 0; right: 0;
        height: 3px;
        background: var(--bp-tm-accent, var(--color-primary-600));
        opacity: 0.85;
        border-radius: 14px 14px 0 0;
    }

.bp-tm-demo-kpi-today    { --bp-tm-accent: var(--color-primary-600); --bp-tm-accent-bg: var(--color-primary-50);  --bp-tm-accent-fg: var(--color-primary-700); }
.bp-tm-demo-kpi-overdue  { --bp-tm-accent: var(--color-error);       --bp-tm-accent-bg: rgb(from var(--color-error)   r g b / 0.10); --bp-tm-accent-fg: var(--color-error-darker); }
.bp-tm-demo-kpi-completed{ --bp-tm-accent: var(--color-success);     --bp-tm-accent-bg: rgb(from var(--color-success) r g b / 0.10); --bp-tm-accent-fg: var(--color-success-darker); }
.bp-tm-demo-kpi-team     { --bp-tm-accent: var(--color-info);        --bp-tm-accent-bg: rgb(from var(--color-info)    r g b / 0.10); --bp-tm-accent-fg: var(--color-info-darker); }

html.dark .bp-tm-demo-kpi-today { --bp-tm-accent-bg: rgb(from var(--color-primary-500) r g b / 0.15); --bp-tm-accent-fg: var(--color-primary-300); }

.bp-tm-demo-kpi-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.bp-tm-demo-kpi-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--bp-tm-accent-bg);
    color: var(--bp-tm-accent-fg);
    display: flex;
    align-items: center;
    justify-content: center;
}

    .bp-tm-demo-kpi-icon .mud-icon-root { color: var(--bp-tm-accent-fg); width: 20px; height: 20px; }

.bp-tm-demo-kpi-trend {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 7px;
    border-radius: 5px;
    font-family: var(--font-mono);
    line-height: 1;
}

.bp-tm-demo-kpi-trend.is-up   { background: rgb(from var(--color-success) r g b / 0.10); color: var(--color-success-darker); }
.bp-tm-demo-kpi-trend.is-down { background: rgb(from var(--color-error)   r g b / 0.10); color: var(--color-error-darker);   }
.bp-tm-demo-kpi-trend.is-flat { background: var(--color-gray-100);                       color: var(--color-gray-700);       }

html.dark .bp-tm-demo-kpi-trend.is-flat { background: var(--color-dark-600); color: var(--color-dark-200); }

.bp-tm-demo-kpi-value {
    font-size: 30px;
    font-weight: 800;
    color: var(--color-gray-900);
    letter-spacing: -0.03em;
    font-family: var(--font-mono);
    line-height: 1;
    margin: 0;
}

html.dark .bp-tm-demo-kpi-value { color: var(--color-dark-50); }

.bp-tm-demo-kpi-label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--color-gray-700);
    margin: 0;
}

html.dark .bp-tm-demo-kpi-label { color: var(--color-dark-100); }

.bp-tm-demo-kpi-meta {
    font-size: 11px;
    color: var(--color-gray-500);
    margin: 2px 0 0;
}

    .bp-tm-demo-kpi-meta b {
        font-weight: 700;
        color: var(--color-gray-700);
        font-family: var(--font-mono);
    }

html.dark .bp-tm-demo-kpi-meta { color: var(--color-dark-300); }
html.dark .bp-tm-demo-kpi-meta b { color: var(--color-dark-100); }

/* â”€â”€â”€ View bar wrapper â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.bp-tm-demo-view-bar {
    background: var(--color-white);
    border: 1px solid var(--color-gray-200);
    border-radius: 14px;
    overflow: hidden;
}

html.dark .bp-tm-demo-view-bar {
    background: var(--color-dark-700);
    border-color: var(--color-dark-500);
}

/* All tab + tab-count + sync-dot rules now live further below under
   `.bp-tm-demo .mud-tabs.bp-tm-demo-tabs ...` (the MudBlazor-wrapped variant).
   The old HTML-primitive rules that lived here were causing the centered
   layout â€” `display: flex; align-items: center; padding: 0 14px;` was being
   applied to <MudTabs Class="bp-tm-demo-tabs">, fighting the actual MudTabs
   internals. */

/* â”€â”€â”€ Filter bar â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.bp-tm-demo-filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px;
    flex-wrap: wrap;
    background: var(--color-gray-50);
    border-bottom: 1px solid var(--color-gray-100);
}

html.dark .bp-tm-demo-filter-bar { background: var(--color-dark-800); border-bottom-color: var(--color-dark-600); }

.bp-tm-demo-filter-search {
    display: flex;
    gap: 8px;
    background: var(--color-white);
    border: 1px solid var(--color-gray-200);
    border-radius: 10px;
    padding: 8px 12px;
    flex: 1;
    min-width: 240px;
    max-width: 340px;
    transition: all 0.15s;
}

html.dark .bp-tm-demo-filter-search { background: var(--color-dark-700); border-color: var(--color-dark-500); }

    .bp-tm-demo-filter-search:focus-within {
        border-color: var(--color-primary-500);
        box-shadow: 0 0 0 3px var(--color-primary-100);
    }

    html.dark .bp-tm-demo-filter-search:focus-within {
        box-shadow: 0 0 0 3px rgb(from var(--color-primary-500) r g b / 0.20);
    }

    .bp-tm-demo-filter-search input {
        border: none;
        outline: none;
        background: none;
        flex: 1;
        font-size: 12.5px;
        color: var(--color-gray-800);
        min-width: 0;
        font-family: inherit;
        padding: 0;
    }

    html.dark .bp-tm-demo-filter-search input { color: var(--color-dark-50); }

    .bp-tm-demo-filter-search input::placeholder { color: var(--color-gray-400); }

    .bp-tm-demo-filter-search .mud-icon-root {
        color: var(--color-gray-400);
        flex-shrink: 0;
        width: 15px;
        height: 15px;
    }

.bp-tm-demo-filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--color-white);
    border: 1px solid var(--color-gray-200);
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-gray-700);
    transition: all 0.15s;
    line-height: 1;
}

html.dark .bp-tm-demo-filter-pill { background: var(--color-dark-700); border-color: var(--color-dark-500); color: var(--color-dark-100); }

    .bp-tm-demo-filter-pill:hover {
        border-color: var(--color-primary-300);
        color: var(--color-primary-700);
        background: var(--color-primary-50);
    }

    .bp-tm-demo-filter-pill.has-value {
        border-color: var(--color-primary-400);
        background: var(--color-primary-50);
        color: var(--color-primary-700);
    }

    html.dark .bp-tm-demo-filter-pill.has-value {
        background: rgb(from var(--color-primary-500) r g b / 0.12);
        border-color: var(--color-primary-500);
        color: var(--color-primary-300);
    }

    .bp-tm-demo-filter-pill .lbl-key { color: var(--color-gray-500); font-weight: 500; }

    html.dark .bp-tm-demo-filter-pill .lbl-key { color: var(--color-dark-300); }

    .bp-tm-demo-filter-pill .lbl-val { color: var(--color-gray-800); font-weight: 700; }

    html.dark .bp-tm-demo-filter-pill .lbl-val { color: var(--color-dark-50); }

    .bp-tm-demo-filter-pill.has-value .lbl-val { color: var(--color-primary-700); }

    html.dark .bp-tm-demo-filter-pill.has-value .lbl-val { color: var(--color-primary-300); }

    .bp-tm-demo-filter-pill .mud-icon-root { width: 13px; height: 13px; color: currentColor; }

    .bp-tm-demo-filter-pill .chev { color: var(--color-gray-400); margin-left: 2px; }

.bp-tm-demo-filter-spacer { flex: 1; }

/* â”€â”€â”€ Date groups + task list â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.bp-tm-demo-task-list { display: flex; flex-direction: column; }

.bp-tm-demo-date-group { border-bottom: 1px solid var(--color-gray-100); }

.bp-tm-demo-date-group:last-child { border-bottom: none; }

html.dark .bp-tm-demo-date-group { border-bottom-color: var(--color-dark-600); }

.bp-tm-demo-date-group-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 18px;
    background: var(--color-white);
    user-select: none;
    transition: background 0.12s;
    width: 100%;
    text-align: left;
}

html.dark .bp-tm-demo-date-group-header { background: var(--color-dark-700); }

    .bp-tm-demo-date-group-header:hover { background: var(--color-gray-50); }

    html.dark .bp-tm-demo-date-group-header:hover { background: var(--color-dark-600); }

.bp-tm-demo-chevron {
    color: var(--color-gray-500) !important;
    transition: transform 0.18s ease;
    flex-shrink: 0;
    width: 18px !important;
    height: 18px !important;
}

.bp-tm-demo-date-group.is-collapsed .bp-tm-demo-chevron { transform: rotate(-90deg); }

.bp-tm-demo-group-title { display: flex; align-items: baseline; gap: 10px; }

.bp-tm-demo-group-date {
    font-size: 14px;
    font-weight: 700;
    color: var(--color-gray-900);
    letter-spacing: -0.01em;
}

html.dark .bp-tm-demo-group-date { color: var(--color-dark-50); }

.bp-tm-demo-group-day { font-size: 12.5px; font-weight: 500; color: var(--color-gray-500); }

html.dark .bp-tm-demo-group-day { color: var(--color-dark-300); }

.bp-tm-demo-today-badge {
    display: inline-flex;
    align-items: center;
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 2px 7px;
    border-radius: 5px;
    background: var(--color-primary-600);
    color: var(--color-white);
    line-height: 1;
}

.bp-tm-demo-group-count {
    font-size: 11px;
    font-weight: 700;
    font-family: var(--font-mono);
    padding: 2px 7px;
    border-radius: 5px;
    background: var(--color-gray-100);
    color: var(--color-gray-600);
    line-height: 1;
}

html.dark .bp-tm-demo-group-count { background: var(--color-dark-600); color: var(--color-dark-200); }

.bp-tm-demo-group-spacer { flex: 1; }

.bp-tm-demo-group-add {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 10px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--color-primary-700);
    border-radius: 7px;
    transition: background 0.12s;
    line-height: 1;
}

    .bp-tm-demo-group-add:hover { background: var(--color-primary-100); }

html.dark .bp-tm-demo-group-add { color: var(--color-primary-300); }

    html.dark .bp-tm-demo-group-add:hover { background: rgb(from var(--color-primary-500) r g b / 0.15); }

    .bp-tm-demo-group-add .mud-icon-root { width: 11px; height: 11px; }

.bp-tm-demo-date-group-body { display: flex; flex-direction: column; }

.bp-tm-demo-date-group.is-collapsed .bp-tm-demo-date-group-body { display: none; }

/* â”€â”€â”€ Task row â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.bp-tm-demo-task-row {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) 130px 170px 110px 100px 36px;
    align-items: center;
    gap: 14px;
    padding: 13px 18px;
    border-top: 1px solid var(--color-gray-100);
    background: var(--color-white);
    cursor: pointer;
    transition: background 0.12s;
    position: relative;
}

html.dark .bp-tm-demo-task-row { background: var(--color-dark-700); border-top-color: var(--color-dark-600); }

    .bp-tm-demo-task-row:first-child { border-top: none; }

    .bp-tm-demo-task-row:hover { background: var(--color-primary-50); }

    html.dark .bp-tm-demo-task-row:hover { background: rgb(from var(--color-primary-500) r g b / 0.10); }

    .bp-tm-demo-task-row:hover .bp-tm-demo-actions-btn { opacity: 1; }

    .bp-tm-demo-task-row::after {
        content: '';
        position: absolute;
        left: 0; top: 8px; bottom: 8px;
        width: 2px;
        border-radius: 0 2px 2px 0;
        background: var(--bp-tm-row-accent, transparent);
        opacity: 0.6;
    }

.bp-tm-demo-task-row[data-status="overdue"]     { --bp-tm-row-accent: var(--color-error); }
.bp-tm-demo-task-row[data-status="in-progress"] { --bp-tm-row-accent: var(--color-info); }
.bp-tm-demo-task-row[data-status="pending"]     { --bp-tm-row-accent: var(--color-warning); }
.bp-tm-demo-task-row[data-status="completed"]   { --bp-tm-row-accent: var(--color-success); }

/* Custom checkbox */
.bp-tm-demo-check {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    border: 2px solid var(--color-gray-300);
    background: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s;
}

html.dark .bp-tm-demo-check { background: var(--color-dark-700); border-color: var(--color-dark-450); }

    .bp-tm-demo-check:hover { border-color: var(--color-primary-500); }

    .bp-tm-demo-check.is-checked {
        background: var(--color-primary-600);
        border-color: var(--color-primary-600);
    }

        .bp-tm-demo-check.is-checked .mud-icon-root {
            color: var(--color-white) !important;
            width: 11px !important;
            height: 11px !important;
        }

    .bp-tm-demo-check:not(.is-checked) .mud-icon-root { display: none; }

/* Body */
.bp-tm-demo-task-body { min-width: 0; display: flex; flex-direction: column; gap: 3px; }

.bp-tm-demo-task-title {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--color-gray-900);
    letter-spacing: -0.005em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}

html.dark .bp-tm-demo-task-title { color: var(--color-dark-50); }

.bp-tm-demo-task-row[data-status="completed"] .bp-tm-demo-task-title {
    color: var(--color-gray-500);
    text-decoration: line-through;
    text-decoration-thickness: 1.5px;
    text-decoration-color: var(--color-gray-400);
}

.bp-tm-demo-ctx-pill {
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
    flex-shrink: 0;
    background: var(--color-primary-100);
    color: var(--color-primary-700);
    font-family: var(--font-mono);
    line-height: 1;
}

html.dark .bp-tm-demo-ctx-pill { background: rgb(from var(--color-primary-500) r g b / 0.15); color: var(--color-primary-300); }

.bp-tm-demo-task-desc {
    font-size: 12px;
    color: var(--color-gray-500);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

html.dark .bp-tm-demo-task-desc { color: var(--color-dark-300); }

/* Due time */
.bp-tm-demo-task-due {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--color-gray-600);
    font-weight: 500;
}

html.dark .bp-tm-demo-task-due { color: var(--color-dark-200); }

    .bp-tm-demo-task-due .mud-icon-root { color: var(--color-gray-400); flex-shrink: 0; width: 13px; height: 13px; }

    .bp-tm-demo-task-due.is-overdue { color: var(--color-error-darker); font-weight: 700; }
    .bp-tm-demo-task-due.is-overdue .mud-icon-root { color: var(--color-error); }

    .bp-tm-demo-task-due.is-soon { color: var(--color-warning-darker); font-weight: 600; }
    .bp-tm-demo-task-due.is-soon .mud-icon-root { color: var(--color-warning); }

    .bp-tm-demo-task-due.is-completed { color: var(--color-success-darker); }
    .bp-tm-demo-task-due.is-completed .mud-icon-root { color: var(--color-success); }

/* Assignee */
.bp-tm-demo-task-assignee { display: flex; align-items: center; gap: 8px; min-width: 0; }

.bp-tm-demo-av {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-white);
    font-weight: 700;
    font-size: 11px;
    border: 2px solid var(--color-white);
    box-shadow: 0 0 0 1px var(--color-gray-200);
}

html.dark .bp-tm-demo-av { border-color: var(--color-dark-700); box-shadow: 0 0 0 1px var(--color-dark-500); }

/* Per-persona avatar gradients. Mostly token-driven; av-1 keeps a tan/beige
   fixed because the design palette doesn't have an equivalent neutral warm. */
.bp-tm-demo-av.av-1 { background: linear-gradient(135deg, #d4a574, #a87c54); }
.bp-tm-demo-av.av-2 { background: linear-gradient(135deg, var(--color-primary-500), var(--color-primary-700)); }
.bp-tm-demo-av.av-3 { background: linear-gradient(135deg, var(--color-success-light), var(--color-success-darker)); }
.bp-tm-demo-av.av-4 { background: linear-gradient(135deg, var(--color-warning-light), var(--color-warning-darker)); }
.bp-tm-demo-av.av-5 { background: linear-gradient(135deg, var(--color-info-light),    var(--color-info-darker));    }
.bp-tm-demo-av.av-6 { background: linear-gradient(135deg, var(--color-error-light),   var(--color-error-darker));   }

.bp-tm-demo-assignee-name {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--color-gray-700);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

html.dark .bp-tm-demo-assignee-name { color: var(--color-dark-100); }

/* Status badge */
.bp-tm-demo-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 4px 9px;
    border-radius: 6px;
    white-space: nowrap;
    line-height: 1;
}

.bp-tm-demo-status-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }

.bp-tm-demo-status.is-pending     { background: rgb(from var(--color-warning) r g b / 0.12); color: var(--color-warning-darker); }
.bp-tm-demo-status.is-pending     .bp-tm-demo-status-dot { background: var(--color-warning); }

.bp-tm-demo-status.is-in-progress { background: rgb(from var(--color-info) r g b / 0.12); color: var(--color-info-darker); }
.bp-tm-demo-status.is-in-progress .bp-tm-demo-status-dot {
    background: var(--color-info);
    box-shadow: 0 0 0 3px rgb(from var(--color-info) r g b / 0.18);
    animation: bp-tm-pulse-blue 2s infinite;
}

@keyframes bp-tm-pulse-blue {
    0%   { box-shadow: 0 0 0 0 rgb(from var(--color-info) r g b / 0.4); }
    70%  { box-shadow: 0 0 0 5px rgb(from var(--color-info) r g b / 0); }
    100% { box-shadow: 0 0 0 0 rgb(from var(--color-info) r g b / 0); }
}

.bp-tm-demo-status.is-completed { background: rgb(from var(--color-success) r g b / 0.12); color: var(--color-success-darker); }
.bp-tm-demo-status.is-completed .bp-tm-demo-status-dot { background: var(--color-success); }

.bp-tm-demo-status.is-overdue { background: rgb(from var(--color-error) r g b / 0.12); color: var(--color-error-darker); }
.bp-tm-demo-status.is-overdue .bp-tm-demo-status-dot { background: var(--color-error); }

/* Priority badge */
.bp-tm-demo-priority {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 4px 8px;
    border-radius: 6px;
    line-height: 1;
}

    .bp-tm-demo-priority .mud-icon-root { width: 10px; height: 10px; }

.bp-tm-demo-priority.is-high   { background: rgb(from var(--color-error)   r g b / 0.12); color: var(--color-error-darker); }
.bp-tm-demo-priority.is-medium { background: rgb(from var(--color-warning) r g b / 0.12); color: var(--color-warning-darker); }
.bp-tm-demo-priority.is-low    { background: var(--color-gray-100);                       color: var(--color-gray-600); }

html.dark .bp-tm-demo-priority.is-low { background: var(--color-dark-600); color: var(--color-dark-200); }

/* Actions button */
.bp-tm-demo-actions-btn {
    width: 30px;
    height: 30px;
    border-radius: 7px;
    color: var(--color-gray-500);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.15s;
}

    .bp-tm-demo-actions-btn:hover {
        background: var(--color-gray-100);
        color: var(--color-primary-700);
        opacity: 1 !important;
    }

    html.dark .bp-tm-demo-actions-btn:hover { background: var(--color-dark-600); color: var(--color-primary-300); }

    .bp-tm-demo-actions-btn .mud-icon-root { width: 14px; height: 14px; }

/* â”€â”€â”€ Responsive â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
@media (max-width: 1280px) {
    .bp-tm-demo .bp-tm-demo-kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .bp-tm-demo .bp-tm-demo-task-row {
        grid-template-columns: 32px minmax(0, 1fr) 110px 150px 100px 90px 32px;
        gap: 10px;
        padding: 12px 14px;
    }
}

@media (max-width: 900px) {
    .bp-tm-demo .bp-tm-demo-kpi-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .bp-tm-demo .bp-tm-demo-task-row {
        grid-template-columns: 28px minmax(0, 1fr) 90px 32px;
        gap: 10px;
    }
        .bp-tm-demo .bp-tm-demo-task-row > .bp-tm-demo-task-due,
        .bp-tm-demo .bp-tm-demo-task-row > .bp-tm-demo-task-assignee,
        .bp-tm-demo .bp-tm-demo-task-row > .bp-tm-demo-priority { display: none; }
}


/* â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€
   .bp-tm-demo overrides on Mud chrome.
   These selectors target the components rendered inside the demo and
   force the design. They never leak outside .bp-tm-demo.
   â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */

/* Header â€” title icon is a MudPaper square instead of an HTML div */
.bp-tm-demo .bp-tm-demo-title-icon.mud-paper {
    width: 46px;
    height: 46px;
    border-radius: 12px !important;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--color-primary-500) 0%, var(--color-primary-700) 100%) !important;
    color: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 14px -3px rgb(from var(--color-primary-600) r g b / 0.40) !important;
    border: none !important;
}

    .bp-tm-demo .bp-tm-demo-title-icon .mud-icon-root {
        color: var(--color-white);
        width: 22px !important;
        height: 22px !important;
    }

.bp-tm-demo .bp-tm-demo-subtitle-text { color: var(--color-gray-500); }
html.dark .bp-tm-demo .bp-tm-demo-subtitle-text { color: var(--color-dark-300); }

/* Online indicator â€” text + leading pulse dot via ::before */
.bp-tm-demo .bp-tm-demo-online {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--color-success-darker) !important;
    font-weight: 600;
}

    .bp-tm-demo .bp-tm-demo-online::before {
        content: '';
        width: 7px;
        height: 7px;
        border-radius: 50%;
        background: var(--color-success);
        box-shadow: 0 0 0 0 rgb(from var(--color-success) r g b / 0.6);
        animation: bp-tm-pulse-green 2s infinite;
        flex-shrink: 0;
    }

/* MudButton overrides â€” design pill button look */
.bp-tm-demo .mud-button-root.bp-tm-demo-btn {
    border-radius: 10px !important;
    padding: 9px 14px !important;
    font-size: 12.5px !important;
    font-weight: 600 !important;
    text-transform: none !important;
    line-height: 1 !important;
    min-height: unset !important;
    height: 38px;
    gap: 7px;
}

.bp-tm-demo .mud-button-root.bp-tm-demo-btn-primary.mud-button-filled {
    background-color: var(--color-primary-600) !important;
    color: var(--color-white) !important;
    border: 1px solid transparent !important;
    box-shadow: 0 4px 12px rgb(from var(--color-primary-600) r g b / 0.25) !important;
}

    .bp-tm-demo .mud-button-root.bp-tm-demo-btn-primary.mud-button-filled:hover {
        background-color: var(--color-primary-700) !important;
        transform: translateY(-1px);
        box-shadow: 0 6px 16px rgb(from var(--color-primary-600) r g b / 0.30) !important;
    }

    .bp-tm-demo .mud-button-root.bp-tm-demo-btn-primary .mud-icon-root,
    .bp-tm-demo .mud-button-root.bp-tm-demo-btn-primary {
        color: var(--color-white) !important;
    }

/* Outlined / secondary buttons in the page header */
.bp-tm-demo .mud-button-root.bp-tm-demo-btn-secondary.mud-button-outlined {
    background-color: var(--color-white) !important;
    color: var(--color-gray-700) !important;
    border: 1px solid var(--color-gray-200) !important;
}

    .bp-tm-demo .mud-button-root.bp-tm-demo-btn-secondary.mud-button-outlined:hover {
        background-color: var(--color-gray-50) !important;
        border-color: var(--color-gray-300) !important;
        color: var(--color-gray-900) !important;
    }

html.dark .bp-tm-demo .mud-button-root.bp-tm-demo-btn-secondary.mud-button-outlined {
    background-color: var(--color-dark-700) !important;
    color: var(--color-dark-100) !important;
    border-color: var(--color-dark-500) !important;
}

    html.dark .bp-tm-demo .mud-button-root.bp-tm-demo-btn-secondary.mud-button-outlined:hover {
        background-color: var(--color-dark-600) !important;
        border-color: var(--color-dark-400) !important;
    }

    .bp-tm-demo .mud-button-root.bp-tm-demo-btn-secondary .mud-icon-root {
        color: var(--color-gray-600) !important;
    }

    html.dark .bp-tm-demo .mud-button-root.bp-tm-demo-btn-secondary .mud-icon-root {
        color: var(--color-dark-200) !important;
    }

/* Filter pill buttons */
.bp-tm-demo .mud-button-root.bp-tm-demo-filter-pill.mud-button-outlined {
    border-radius: 10px !important;
    padding: 0 12px !important;
    height: 38px;
    font-size: 12px !important;
    font-weight: 600 !important;
    text-transform: none !important;
    line-height: 1 !important;
    min-height: unset !important;
    background-color: var(--color-white) !important;
    border: 1px solid var(--color-gray-200) !important;
    color: var(--color-gray-700) !important;
    gap: 6px;
}

html.dark .bp-tm-demo .mud-button-root.bp-tm-demo-filter-pill.mud-button-outlined {
    background-color: var(--color-dark-700) !important;
    border-color: var(--color-dark-500) !important;
    color: var(--color-dark-100) !important;
}

    .bp-tm-demo .mud-button-root.bp-tm-demo-filter-pill.mud-button-outlined:hover {
        border-color: var(--color-primary-300) !important;
        color: var(--color-primary-700) !important;
        background-color: var(--color-primary-50) !important;
    }

    .bp-tm-demo .mud-button-root.bp-tm-demo-filter-pill.has-value {
        border-color: var(--color-primary-400) !important;
        background-color: var(--color-primary-50) !important;
        color: var(--color-primary-700) !important;
    }

    html.dark .bp-tm-demo .mud-button-root.bp-tm-demo-filter-pill.has-value {
        background-color: rgb(from var(--color-primary-500) r g b / 0.12) !important;
        border-color: var(--color-primary-500) !important;
        color: var(--color-primary-300) !important;
    }

    .bp-tm-demo .bp-tm-demo-filter-pill .bp-tm-demo-filter-key {
        color: var(--color-gray-500);
        font-weight: 500;
        margin-right: 4px;
    }

    .bp-tm-demo .bp-tm-demo-filter-pill.has-value .bp-tm-demo-filter-key { color: inherit; opacity: 0.7; }
    html.dark .bp-tm-demo .bp-tm-demo-filter-pill .bp-tm-demo-filter-key { color: var(--color-dark-300); }

    .bp-tm-demo .bp-tm-demo-filter-pill .bp-tm-demo-filter-val {
        color: var(--color-gray-900);
        font-weight: 700;
    }

    html.dark .bp-tm-demo .bp-tm-demo-filter-pill .bp-tm-demo-filter-val { color: var(--color-dark-50); }
    .bp-tm-demo .bp-tm-demo-filter-pill.has-value .bp-tm-demo-filter-val { color: inherit; }

/* MudCard overrides â€” design 14px radius for KPI + view-bar */
.bp-tm-demo .mud-card.bp-tm-demo-kpi-card,
.bp-tm-demo .mud-card.bp-tm-demo-view-bar {
    border-radius: 14px !important;
    border-color: var(--color-gray-200);
    background-color: var(--color-white);
}

html.dark .bp-tm-demo .mud-card.bp-tm-demo-kpi-card,
html.dark .bp-tm-demo .mud-card.bp-tm-demo-view-bar {
    background-color: var(--color-dark-700);
    border-color: var(--color-dark-500);
}

.bp-tm-demo .mud-card.bp-tm-demo-kpi-card { padding: 0; transition: all 0.18s ease; cursor: pointer; }

    .bp-tm-demo .mud-card.bp-tm-demo-kpi-card:hover {
        border-color: var(--color-primary-300) !important;
        transform: translateY(-2px);
        box-shadow: 0 8px 24px rgb(from var(--color-primary-700) r g b / 0.10), 0 2px 6px rgba(0, 0, 0, 0.05);
    }

    .bp-tm-demo .mud-card.bp-tm-demo-kpi-card .mud-card-content { padding: 18px 20px; }

/* KPI icon â€” MudPaper rounded square */
.bp-tm-demo .bp-tm-demo-kpi-icon.mud-paper {
    width: 38px !important;
    height: 38px !important;
    border-radius: 10px !important;
    background-color: var(--bp-tm-accent-bg) !important;
    color: var(--bp-tm-accent-fg);
    display: flex !important;
    align-items: center;
    justify-content: center;
    border: none !important;
    box-shadow: none !important;
}

    .bp-tm-demo .bp-tm-demo-kpi-icon .mud-icon-root {
        color: var(--bp-tm-accent-fg) !important;
        width: 20px !important;
        height: 20px !important;
    }

/* MudChip overrides â€” strip Mud's pill chrome to match design compact badges */
.bp-tm-demo .mud-chip {
    text-transform: none;
    letter-spacing: 0;
}

/* Trend chip (â–² 2 / â–¼ 1 / â€” 0) */
.bp-tm-demo .mud-chip.bp-tm-demo-kpi-trend {
    height: auto !important;
    min-height: 0 !important;
    padding: 3px 7px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    border-radius: 5px !important;
    font-family: var(--font-mono);
    line-height: 1;
    margin: 0;
    background-color: transparent !important;
    color: inherit !important;
}

.bp-tm-demo .mud-chip.bp-tm-demo-kpi-trend.is-up {
    background-color: rgb(from var(--color-success) r g b / 0.10) !important;
    color: var(--color-success-darker) !important;
}

.bp-tm-demo .mud-chip.bp-tm-demo-kpi-trend.is-down {
    background-color: rgb(from var(--color-error) r g b / 0.10) !important;
    color: var(--color-error-darker) !important;
}

.bp-tm-demo .mud-chip.bp-tm-demo-kpi-trend.is-flat {
    background-color: var(--color-gray-100) !important;
    color: var(--color-gray-700) !important;
}

html.dark .bp-tm-demo .mud-chip.bp-tm-demo-kpi-trend.is-flat {
    background-color: var(--color-dark-600) !important;
    color: var(--color-dark-200) !important;
}

/* KPI value / label / meta typography */
.bp-tm-demo .bp-tm-demo-kpi-value.mud-typography {
    font-size: 30px !important;
    font-weight: 800 !important;
    color: var(--color-gray-900);
    letter-spacing: -0.03em;
    font-family: var(--font-mono) !important;
    line-height: 1 !important;
    margin: 0 !important;
}

html.dark .bp-tm-demo .bp-tm-demo-kpi-value.mud-typography { color: var(--color-dark-50); }

.bp-tm-demo .bp-tm-demo-kpi-label.mud-typography {
    font-size: 12.5px !important;
    font-weight: 600 !important;
    color: var(--color-gray-700);
    margin-top: 8px !important;
}

html.dark .bp-tm-demo .bp-tm-demo-kpi-label.mud-typography { color: var(--color-dark-100); }

.bp-tm-demo .bp-tm-demo-kpi-meta.mud-typography {
    font-size: 11px !important;
    color: var(--color-gray-500);
    margin-top: 2px !important;
}

    .bp-tm-demo .bp-tm-demo-kpi-meta b {
        font-weight: 700;
        color: var(--color-gray-700);
        font-family: var(--font-mono);
    }

html.dark .bp-tm-demo .bp-tm-demo-kpi-meta b { color: var(--color-dark-100); }

/* MudCard view-bar wrapper â€” relative so the absolute calendar-sync chip
   anchors to its top-right edge. */
.bp-tm-demo .mud-card.bp-tm-demo-view-bar { overflow: hidden; position: relative; }

/* MudTabs â€” design: left-aligned tabs, no per-tab background in any
   state, only a 3-px primary-600 slider underline on active. The panel
   content has zero outer padding so task rows sit flush with the card edges. */
.bp-tm-demo .mud-tabs.bp-tm-demo-tabs,
.bp-tm-demo .mud-tabs.bp-tm-demo-tabs .mud-tabs-toolbar,
.bp-tm-demo .mud-tabs.bp-tm-demo-tabs .mud-tabs-tabbar-wrapper,
.bp-tm-demo .mud-tabs.bp-tm-demo-tabs .mud-tabs-tabbar-inner,
.bp-tm-demo .mud-tabs.bp-tm-demo-tabs .mud-tabs-panels,
.bp-tm-demo .mud-tabs.bp-tm-demo-tabs .mud-tabs-panels-inner {
    background: transparent !important;
    box-shadow: none !important;
}

/* Toolbar â€” full-width border-bottom (no internal horizontal padding so the
   line spans the entire card edge to edge). Indentation lives on the first
   tab via margin-left. */
.bp-tm-demo .mud-tabs.bp-tm-demo-tabs .mud-tabs-toolbar {
    min-height: 0;
    padding: 0 !important;
    border-bottom: 1px solid var(--color-gray-100);
}

html.dark .bp-tm-demo .mud-tabs.bp-tm-demo-tabs .mud-tabs-toolbar {
    border-bottom-color: var(--color-dark-600);
}

/* Left-align the tabs across every possible MudBlazor 9 wrapper class.
   MudTabs centers by default and the exact wrapper name has shifted between
   minor versions (mud-tabs-tabbar, -content, -inner) â€” selecting all of them
   keeps this robust. */
.bp-tm-demo .mud-tabs.bp-tm-demo-tabs .mud-tabs-tabbar,
.bp-tm-demo .mud-tabs.bp-tm-demo-tabs .mud-tabs-tabbar-wrapper,
.bp-tm-demo .mud-tabs.bp-tm-demo-tabs .mud-tabs-tabbar-content,
.bp-tm-demo .mud-tabs.bp-tm-demo-tabs .mud-tabs-tabbar-inner {
    justify-content: flex-start !important;
}

/* Indent the first tab so it doesn't touch the card edge. */
.bp-tm-demo .mud-tabs.bp-tm-demo-tabs .mud-tab:first-of-type {
    margin-left: 14px;
}

/* Strip every form of background that legacy + Mud apply to a tab. Legacy
   uses `background: var(--clp-primary)` (shorthand) on .mud-tab-active, which
   would beat a `background-color` override â€” so we force the shorthand here. */
.bp-tm-demo .mud-tabs.bp-tm-demo-tabs .mud-tab,
.bp-tm-demo .mud-tabs.bp-tm-demo-tabs .mud-tab:hover,
.bp-tm-demo .mud-tabs.bp-tm-demo-tabs .mud-tab:focus,
.bp-tm-demo .mud-tabs.bp-tm-demo-tabs .mud-tab:focus-visible,
.bp-tm-demo .mud-tabs.bp-tm-demo-tabs .mud-tab:active,
.bp-tm-demo .mud-tabs.bp-tm-demo-tabs .mud-tab.mud-tab-active,
.bp-tm-demo .mud-tabs.bp-tm-demo-tabs .mud-tab.mud-tab-active:hover,
.bp-tm-demo .mud-tabs.bp-tm-demo-tabs .mud-tab.mud-tab-active:focus {
    background: transparent !important;
    background-color: transparent !important;
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
    margin: 0 !important;
}

/* The legacy file also reassigns padding/margin/border-radius on .mud-tab â€”
   restore them to the design. Bottom padding is zero so the 3-px primary
   slider sits flush against the toolbar's border-bottom line, exactly like
   the design template. */
.bp-tm-demo .mud-tabs.bp-tm-demo-tabs .mud-tab {
    padding: 14px 16px 0px 16px !important;
}

/* Mud injects an absolute ::before on hovered/active tabs as a tinted overlay.
   Hide it so the tab stays visually flat. */
.bp-tm-demo .mud-tabs.bp-tm-demo-tabs .mud-tab::before,
.bp-tm-demo .mud-tabs.bp-tm-demo-tabs .mud-tab::after {
    display: none !important;
}

.bp-tm-demo .mud-tabs.bp-tm-demo-tabs .mud-tab .mud-ripple,
.bp-tm-demo .mud-tabs.bp-tm-demo-tabs .mud-tab .mud-ripple-visual {
    background-color: transparent !important;
}

/* Tab typography. Padding mirrors the rule above (zero bottom so the slider
   sits flush against the toolbar's border-bottom). */
.bp-tm-demo .mud-tabs.bp-tm-demo-tabs .mud-tab {
    font-size: 13px !important;
    font-weight: 600 !important;
    color: var(--color-gray-600) !important;
    text-transform: none !important;
    padding: 14px 16px 0px 16px !important;
    min-width: 0 !important;
    min-height: 0 !important;
    border-radius: 0 !important;
}

    .bp-tm-demo .mud-tabs.bp-tm-demo-tabs .mud-tab .mud-icon-root { color: inherit !important; }

html.dark .bp-tm-demo .mud-tabs.bp-tm-demo-tabs .mud-tab { color: var(--color-dark-300) !important; }

.bp-tm-demo .mud-tabs.bp-tm-demo-tabs .mud-tab:hover { color: var(--color-gray-900) !important; }
html.dark .bp-tm-demo .mud-tabs.bp-tm-demo-tabs .mud-tab:hover { color: var(--color-dark-50) !important; }

.bp-tm-demo .mud-tabs.bp-tm-demo-tabs .mud-tab.mud-tab-active,
.bp-tm-demo .mud-tabs.bp-tm-demo-tabs .mud-tab.mud-tab-active:hover {
    color: var(--color-primary-700) !important;
}

html.dark .bp-tm-demo .mud-tabs.bp-tm-demo-tabs .mud-tab.mud-tab-active,
html.dark .bp-tm-demo .mud-tabs.bp-tm-demo-tabs .mud-tab.mud-tab-active:hover {
    color: var(--color-primary-300) !important;
}

/* The 3-px underline. avalme-legacy.css hides the slider globally with
   `.mud-tabs .mud-tab-slider { display: none !important; }`; we have to force
   it back on inside the demo scope. */
.bp-tm-demo .mud-tabs.bp-tm-demo-tabs .mud-tab-slider {
    display: block !important;
    background-color: var(--color-primary-600) !important;
    height: 3px !important;
}

html.dark .bp-tm-demo .mud-tabs.bp-tm-demo-tabs .mud-tab-slider {
    background-color: var(--color-primary-500) !important;
}

/* Tab panels + collapse wrappers â€” strip ALL padding/margin AND force
   width: 100% so task rows actually touch the card edges. Without
   width: 100% the panel inherits a smaller box from MudTabs internals and
   leaves a left/right gutter. The row itself owns its 13px 18px padding. */
.bp-tm-demo .mud-tabs.bp-tm-demo-tabs .mud-tabs-panels,
.bp-tm-demo .mud-tabs.bp-tm-demo-tabs .mud-tabpanel,
.bp-tm-demo .mud-tabs.bp-tm-demo-tabs .mud-tabpanel > div {
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
}

/* Calendar synced chip â€” absolute, top-right of the view-bar card so it sits
   in line with the tab strip without interfering with MudTabs internals. */
.bp-tm-demo .mud-chip.bp-tm-demo-calendar-sync {
    position: absolute !important;
    top: 14px;
    right: 14px;
    z-index: 2;
    background-color: rgb(from var(--color-success) r g b / 0.10) !important;
    color: var(--color-success-darker) !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    padding: 5px 10px !important;
    border-radius: 8px !important;
    height: auto !important;
    min-height: 0 !important;
    text-transform: none !important;
    letter-spacing: 0;
    margin: 0;
}

    .bp-tm-demo .mud-chip.bp-tm-demo-calendar-sync .mud-chip-icon {
        color: var(--color-success) !important;
        width: 8px !important;
        height: 8px !important;
        margin-right: 2px;
    }

html.dark .bp-tm-demo .mud-chip.bp-tm-demo-calendar-sync {
    background-color: rgb(from var(--color-success-light) r g b / 0.15) !important;
    color: var(--color-success-light) !important;
}

/* Filter bar */
.bp-tm-demo .bp-tm-demo-filter-bar {
    padding: 14px;
    background-color: var(--color-gray-50);
    border-bottom: 1px solid var(--color-gray-100);
}

html.dark .bp-tm-demo .bp-tm-demo-filter-bar {
    background-color: var(--color-dark-800);
    border-bottom-color: var(--color-dark-600);
}

/* MudTextField search â€” pill matching the filter buttons (38px height, 10px radius).
   `flex-basis: 100%` forces the search onto its own row inside the wrapping
   filter bar; the filter pills (Sort/Assignee/Priority/Status + Add Task)
   then wrap to the next line, matching the design template layout. Without
   this, the search would only take leftover space (â‰ˆ280px) and leave a
   visual gap before the pills wrapped. */
.bp-tm-demo .mud-input-control.bp-tm-demo-filter-search {
    flex: 1 1 100%;
    min-width: 240px;
    margin: 0 !important;
}

    .bp-tm-demo .bp-tm-demo-filter-search .mud-input.mud-input-outlined {
        border-radius: 10px !important;
        background-color: var(--color-white);
        height: 38px;
        min-height: 38px;
    }

    html.dark .bp-tm-demo .bp-tm-demo-filter-search .mud-input.mud-input-outlined {
        background-color: var(--color-dark-700);
    }

        .bp-tm-demo .bp-tm-demo-filter-search .mud-input.mud-input-outlined input {
            font-size: 12.5px !important;
            padding-top: 8px !important;
            padding-bottom: 8px !important;
        }

        .bp-tm-demo .bp-tm-demo-filter-search .mud-input.mud-input-outlined input::placeholder {
            color: var(--color-gray-400);
            opacity: 1;
        }

        .bp-tm-demo .bp-tm-demo-filter-search .mud-input-outlined-border {
            border-color: var(--color-gray-200) !important;
        }

        html.dark .bp-tm-demo .bp-tm-demo-filter-search .mud-input-outlined-border {
            border-color: var(--color-dark-500) !important;
        }

        .bp-tm-demo .bp-tm-demo-filter-search .mud-input-adornment .mud-icon-root {
            color: var(--color-gray-400);
            width: 15px !important;
            height: 15px !important;
        }

/* Empty state for Board / Calendar tab panels */
.bp-tm-demo .bp-tm-demo-empty {
    text-align: center;
    color: var(--color-gray-500);
    gap: 8px;
}

html.dark .bp-tm-demo .bp-tm-demo-empty { color: var(--color-dark-300); }

    .bp-tm-demo .bp-tm-demo-empty .mud-icon-root {
        width: 48px !important;
        height: 48px !important;
        color: var(--color-gray-400);
    }

    html.dark .bp-tm-demo .bp-tm-demo-empty .mud-icon-root { color: var(--color-dark-400); }

/* MudExpansionPanels (date groups) â€” strip default chrome */
.bp-tm-demo .mud-expansion-panels.bp-tm-demo-groups {
    box-shadow: none !important;
    background: transparent;
}

    .bp-tm-demo .mud-expansion-panels.bp-tm-demo-groups .mud-expand-panel {
        background-color: var(--color-white) !important;
        border-bottom: 1px solid var(--color-gray-100) !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }

    html.dark .bp-tm-demo .mud-expansion-panels.bp-tm-demo-groups .mud-expand-panel {
        background-color: var(--color-dark-700) !important;
        border-bottom-color: var(--color-dark-600) !important;
    }

    .bp-tm-demo .mud-expansion-panels.bp-tm-demo-groups .mud-expand-panel:last-child { border-bottom: none !important; }

    .bp-tm-demo .mud-expand-panel .mud-expand-panel-header {
        padding: 13px 18px !important;
    }

        .bp-tm-demo .mud-expand-panel .mud-expand-panel-header:hover {
            background-color: var(--color-gray-50);
        }

        html.dark .bp-tm-demo .mud-expand-panel .mud-expand-panel-header:hover {
            background-color: var(--color-dark-600);
        }

    /* Strip every padding/margin from the collapse internals. MudExpansionPanel
       wraps its body in mud-collapse-container > mud-collapse-wrapper >
       mud-collapse-wrapper-inner â€” each layer can have its own padding. */
    .bp-tm-demo .mud-expand-panel .mud-expand-panel-content,
    .bp-tm-demo .mud-expand-panel .mud-collapse-container,
    .bp-tm-demo .mud-expand-panel .mud-collapse-wrapper,
    .bp-tm-demo .mud-expand-panel .mud-collapse-wrapper-inner,
    .bp-tm-demo .mud-expand-panel .mud-expand-panel-content > * {
        padding: 0 !important;
        margin: 0 !important;
    }

/* Date-group title content typography */
.bp-tm-demo .bp-tm-demo-group-date.mud-typography {
    font-size: 14px !important;
    font-weight: 700 !important;
    color: var(--color-gray-900);
    letter-spacing: -0.01em;
    margin: 0 !important;
}

html.dark .bp-tm-demo .bp-tm-demo-group-date.mud-typography { color: var(--color-dark-50); }

.bp-tm-demo .bp-tm-demo-group-day.mud-typography {
    font-size: 12.5px !important;
    color: var(--color-gray-500);
    font-weight: 500;
    margin: 0 !important;
}

html.dark .bp-tm-demo .bp-tm-demo-group-day.mud-typography { color: var(--color-dark-300); }

/* TODAY badge chip */
.bp-tm-demo .mud-chip.bp-tm-demo-today-badge {
    background-color: var(--color-primary-600) !important;
    color: var(--color-white) !important;
    font-size: 9.5px !important;
    font-weight: 800 !important;
    letter-spacing: 0.06em !important;
    text-transform: uppercase !important;
    padding: 3px 8px !important;
    border-radius: 5px !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0;
}

/* Group count chip */
.bp-tm-demo .mud-chip.bp-tm-demo-group-count {
    background-color: var(--color-gray-100) !important;
    color: var(--color-gray-600) !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    padding: 3px 8px !important;
    border-radius: 5px !important;
    height: auto !important;
    min-height: 0 !important;
    font-family: var(--font-mono) !important;
    text-transform: none !important;
    letter-spacing: 0;
    margin: 0;
}

html.dark .bp-tm-demo .mud-chip.bp-tm-demo-group-count {
    background-color: var(--color-dark-600) !important;
    color: var(--color-dark-200) !important;
}

/* Group "Add task" inline button */
.bp-tm-demo .mud-button-root.bp-tm-demo-group-add {
    text-transform: none !important;
    font-size: 11.5px !important;
    font-weight: 600 !important;
    padding: 6px 10px !important;
    min-height: 0 !important;
    border-radius: 7px !important;
}

/* Task row â€” MudPaper grid */
.bp-tm-demo .mud-paper.bp-tm-demo-task-row {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) 130px 170px 110px 100px 36px;
    align-items: center;
    gap: 14px;
    padding: 13px 18px !important;
    background-color: var(--color-white) !important;
    border-top: 1px solid var(--color-gray-100);
    cursor: pointer;
    transition: background 0.12s;
    position: relative;
    border-radius: 0 !important;
}

html.dark .bp-tm-demo .mud-paper.bp-tm-demo-task-row {
    background-color: var(--color-dark-700) !important;
    border-top-color: var(--color-dark-600);
}

    .bp-tm-demo .mud-paper.bp-tm-demo-task-row:hover { background-color: var(--color-primary-50) !important; }
    html.dark .bp-tm-demo .mud-paper.bp-tm-demo-task-row:hover { background-color: rgb(from var(--color-primary-500) r g b / 0.10) !important; }

    .bp-tm-demo .mud-paper.bp-tm-demo-task-row:hover .bp-tm-demo-actions-btn { opacity: 1; }

    .bp-tm-demo .mud-paper.bp-tm-demo-task-row::after {
        content: '';
        position: absolute;
        left: 0; top: 8px; bottom: 8px;
        width: 2px;
        border-radius: 0 2px 2px 0;
        background: var(--bp-tm-row-accent, transparent);
        opacity: 0.6;
    }

    .bp-tm-demo .mud-paper.bp-tm-demo-task-row[data-status="overdue"]     { --bp-tm-row-accent: var(--color-error); }
    .bp-tm-demo .mud-paper.bp-tm-demo-task-row[data-status="in-progress"] { --bp-tm-row-accent: var(--color-info); }
    .bp-tm-demo .mud-paper.bp-tm-demo-task-row[data-status="pending"]     { --bp-tm-row-accent: var(--color-warning); }
    .bp-tm-demo .mud-paper.bp-tm-demo-task-row[data-status="completed"]   { --bp-tm-row-accent: var(--color-success); }

/* Custom checkbox â€” MudCheckBox shrunk + squared */
.bp-tm-demo .mud-checkbox.bp-tm-demo-check { margin: 0; padding: 0; }

    .bp-tm-demo .mud-checkbox.bp-tm-demo-check .mud-icon-button { padding: 0 !important; width: 18px; height: 18px; }
    .bp-tm-demo .mud-checkbox.bp-tm-demo-check .mud-icon-root { width: 18px !important; height: 18px !important; }

/* Title + ctx chip */
.bp-tm-demo .bp-tm-demo-task-body { min-width: 0; gap: 3px; }

.bp-tm-demo .bp-tm-demo-task-title.mud-typography {
    font-size: 13.5px !important;
    font-weight: 600 !important;
    color: var(--color-gray-900);
    letter-spacing: -0.005em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin: 0 !important;
    min-width: 0;
}

html.dark .bp-tm-demo .bp-tm-demo-task-title.mud-typography { color: var(--color-dark-50); }

.bp-tm-demo .mud-paper.bp-tm-demo-task-row[data-status="completed"] .bp-tm-demo-task-title.mud-typography {
    color: var(--color-gray-500);
    text-decoration: line-through;
    text-decoration-thickness: 1.5px;
    text-decoration-color: var(--color-gray-400);
}

.bp-tm-demo .mud-chip.bp-tm-demo-ctx-pill {
    background-color: var(--color-primary-100) !important;
    color: var(--color-primary-700) !important;
    font-size: 9.5px !important;
    font-weight: 800 !important;
    letter-spacing: 0.05em !important;
    text-transform: uppercase !important;
    padding: 3px 6px !important;
    border-radius: 4px !important;
    height: auto !important;
    min-height: 0 !important;
    font-family: var(--font-mono) !important;
    margin: 0;
    flex-shrink: 0;
}

html.dark .bp-tm-demo .mud-chip.bp-tm-demo-ctx-pill {
    background-color: rgb(from var(--color-primary-500) r g b / 0.15) !important;
    color: var(--color-primary-300) !important;
}

.bp-tm-demo .bp-tm-demo-task-desc.mud-typography {
    font-size: 12px !important;
    color: var(--color-gray-500);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin: 0 !important;
}

html.dark .bp-tm-demo .bp-tm-demo-task-desc.mud-typography { color: var(--color-dark-300); }

/* Due time */
.bp-tm-demo .bp-tm-demo-task-due { color: var(--color-gray-600); }
html.dark .bp-tm-demo .bp-tm-demo-task-due { color: var(--color-dark-200); }

    .bp-tm-demo .bp-tm-demo-task-due .mud-icon-root {
        color: var(--color-gray-400);
        width: 13px !important;
        height: 13px !important;
        flex-shrink: 0;
    }

    .bp-tm-demo .bp-tm-demo-task-due .mud-typography {
        font-size: 12px !important;
        font-weight: 500;
        color: inherit;
        margin: 0 !important;
    }

    .bp-tm-demo .bp-tm-demo-task-due.is-overdue { color: var(--color-error-darker); font-weight: 700; }
    .bp-tm-demo .bp-tm-demo-task-due.is-overdue .mud-icon-root { color: var(--color-error); }
    .bp-tm-demo .bp-tm-demo-task-due.is-overdue .mud-typography { font-weight: 700 !important; }

    .bp-tm-demo .bp-tm-demo-task-due.is-soon { color: var(--color-warning-darker); font-weight: 600; }
    .bp-tm-demo .bp-tm-demo-task-due.is-soon .mud-icon-root { color: var(--color-warning); }
    .bp-tm-demo .bp-tm-demo-task-due.is-soon .mud-typography { font-weight: 600 !important; }

    .bp-tm-demo .bp-tm-demo-task-due.is-completed { color: var(--color-success-darker); }
    .bp-tm-demo .bp-tm-demo-task-due.is-completed .mud-icon-root { color: var(--color-success); }

/* Assignee */
.bp-tm-demo .bp-tm-demo-task-assignee { min-width: 0; }

.bp-tm-demo .mud-avatar.bp-tm-demo-av {
    width: 26px !important;
    height: 26px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    color: var(--color-white) !important;
    border: 2px solid var(--color-white);
    box-shadow: 0 0 0 1px var(--color-gray-200);
}

html.dark .bp-tm-demo .mud-avatar.bp-tm-demo-av {
    border-color: var(--color-dark-700);
    box-shadow: 0 0 0 1px var(--color-dark-500);
}

/* Per-persona avatar gradients */
.bp-tm-demo .mud-avatar.bp-tm-demo-av.av-1 { background: linear-gradient(135deg, #d4a574, #a87c54) !important; }
.bp-tm-demo .mud-avatar.bp-tm-demo-av.av-2 { background: linear-gradient(135deg, var(--color-primary-500), var(--color-primary-700)) !important; }
.bp-tm-demo .mud-avatar.bp-tm-demo-av.av-3 { background: linear-gradient(135deg, var(--color-success-light), var(--color-success-darker)) !important; }
.bp-tm-demo .mud-avatar.bp-tm-demo-av.av-4 { background: linear-gradient(135deg, var(--color-warning-light), var(--color-warning-darker)) !important; }
.bp-tm-demo .mud-avatar.bp-tm-demo-av.av-5 { background: linear-gradient(135deg, var(--color-info-light),    var(--color-info-darker)) !important;    }
.bp-tm-demo .mud-avatar.bp-tm-demo-av.av-6 { background: linear-gradient(135deg, var(--color-error-light),   var(--color-error-darker)) !important;   }

.bp-tm-demo .bp-tm-demo-assignee-name.mud-typography {
    font-size: 12.5px !important;
    font-weight: 600 !important;
    color: var(--color-gray-700);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    margin: 0 !important;
}

html.dark .bp-tm-demo .bp-tm-demo-assignee-name.mud-typography { color: var(--color-dark-100); }

/* Status badge chip */
.bp-tm-demo .mud-chip.bp-tm-demo-status {
    height: auto !important;
    min-height: 0 !important;
    padding: 4px 9px !important;
    font-size: 10.5px !important;
    font-weight: 700 !important;
    letter-spacing: 0.04em !important;
    text-transform: uppercase !important;
    border-radius: 6px !important;
    margin: 0;
}

    .bp-tm-demo .mud-chip.bp-tm-demo-status .mud-chip-icon {
        width: 6px !important;
        height: 6px !important;
        margin-right: 2px;
    }

.bp-tm-demo .mud-chip.bp-tm-demo-status.is-pending     { background-color: rgb(from var(--color-warning) r g b / 0.12) !important; color: var(--color-warning-darker) !important; }
.bp-tm-demo .mud-chip.bp-tm-demo-status.is-pending     .mud-chip-icon { color: var(--color-warning) !important; }

.bp-tm-demo .mud-chip.bp-tm-demo-status.is-in-progress { background-color: rgb(from var(--color-info) r g b / 0.12) !important; color: var(--color-info-darker) !important; }
.bp-tm-demo .mud-chip.bp-tm-demo-status.is-in-progress .mud-chip-icon {
    color: var(--color-info) !important;
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgb(from var(--color-info) r g b / 0.18);
    animation: bp-tm-pulse-blue 2s infinite;
}

@keyframes bp-tm-pulse-blue {
    0%   { box-shadow: 0 0 0 0 rgb(from var(--color-info) r g b / 0.4); }
    70%  { box-shadow: 0 0 0 5px rgb(from var(--color-info) r g b / 0); }
    100% { box-shadow: 0 0 0 0 rgb(from var(--color-info) r g b / 0); }
}

.bp-tm-demo .mud-chip.bp-tm-demo-status.is-completed { background-color: rgb(from var(--color-success) r g b / 0.12) !important; color: var(--color-success-darker) !important; }
.bp-tm-demo .mud-chip.bp-tm-demo-status.is-completed .mud-chip-icon { color: var(--color-success) !important; }

.bp-tm-demo .mud-chip.bp-tm-demo-status.is-overdue { background-color: rgb(from var(--color-error) r g b / 0.12) !important; color: var(--color-error-darker) !important; }
.bp-tm-demo .mud-chip.bp-tm-demo-status.is-overdue .mud-chip-icon { color: var(--color-error) !important; }

/* Priority badge chip */
.bp-tm-demo .mud-chip.bp-tm-demo-priority {
    height: auto !important;
    min-height: 0 !important;
    padding: 4px 8px !important;
    font-size: 10.5px !important;
    font-weight: 700 !important;
    letter-spacing: 0.04em !important;
    text-transform: uppercase !important;
    border-radius: 6px !important;
    margin: 0;
}

    .bp-tm-demo .mud-chip.bp-tm-demo-priority .mud-chip-icon {
        width: 10px !important;
        height: 10px !important;
        margin-right: 2px;
    }

.bp-tm-demo .mud-chip.bp-tm-demo-priority.is-high   { background-color: rgb(from var(--color-error) r g b / 0.12) !important; color: var(--color-error-darker) !important; }
.bp-tm-demo .mud-chip.bp-tm-demo-priority.is-high   .mud-chip-icon { color: var(--color-error) !important; }

.bp-tm-demo .mud-chip.bp-tm-demo-priority.is-medium { background-color: rgb(from var(--color-warning) r g b / 0.12) !important; color: var(--color-warning-darker) !important; }
.bp-tm-demo .mud-chip.bp-tm-demo-priority.is-medium .mud-chip-icon { color: var(--color-warning) !important; }

.bp-tm-demo .mud-chip.bp-tm-demo-priority.is-low    { background-color: var(--color-gray-100) !important; color: var(--color-gray-600) !important; }
.bp-tm-demo .mud-chip.bp-tm-demo-priority.is-low    .mud-chip-icon { color: var(--color-gray-500) !important; }

html.dark .bp-tm-demo .mud-chip.bp-tm-demo-priority.is-low { background-color: var(--color-dark-600) !important; color: var(--color-dark-200) !important; }

/* MudIconButton actions */
.bp-tm-demo .mud-icon-button.bp-tm-demo-actions-btn {
    width: 30px;
    height: 30px;
    border-radius: 7px !important;
    color: var(--color-gray-500);
    opacity: 0;
    transition: all 0.15s;
    padding: 0 !important;
}

    .bp-tm-demo .mud-icon-button.bp-tm-demo-actions-btn:hover {
        background-color: var(--color-gray-100) !important;
        color: var(--color-primary-700) !important;
        opacity: 1 !important;
    }

    html.dark .bp-tm-demo .mud-icon-button.bp-tm-demo-actions-btn:hover {
        background-color: var(--color-dark-600) !important;
        color: var(--color-primary-300) !important;
    }

    .bp-tm-demo .mud-icon-button.bp-tm-demo-actions-btn .mud-icon-root { width: 14px; height: 14px; }


/* ============================================================================
   Â§LAST  GLOBAL TYPOGRAPHY SAFETY NET â€” Force Inter on MudBlazor surfaces
   ----------------------------------------------------------------------------
   MudBlazor's bundled CSS sets `font-family: Roboto, "Helvetica Neue",
   sans-serif` on `.mud-application-layout` and a handful of typography
   primitives. We can't edit Mud's package CSS, but this file loads AFTER
   MudBlazor.min.css, so an explicit override here wins by source order.

   We re-route every visible Mud surface to `var(--font-sans)` (Inter) so the
   app inherits the design typography end-to-end. Icons, code blocks and
   monospaced cells are exempt â€” they use `var(--font-mono)` (system stack).

   Doctrine: ver "Typography" en CLAUDE.md.
   ============================================================================ */
html,
body,
.mud-application-layout,
.mud-typography,
.mud-input,
.mud-input-input,
.mud-input-label,
.mud-input-helper-text,
.mud-button-root,
.mud-button-label,
.mud-icon-button,
.mud-table,
.mud-table-cell,
.mud-list-item-text,
.mud-list-item-primary-text,
.mud-list-item-secondary-text,
.mud-card,
.mud-card-content,
.mud-card-header,
.mud-dialog,
.mud-dialog-title,
.mud-dialog-content,
.mud-dialog-actions,
.mud-tab,
.mud-tab-panel,
.mud-tabs,
.mud-tooltip,
.mud-menu,
.mud-menu-item,
.mud-select,
.mud-select-input,
.mud-chip,
.mud-paper,
.mud-toolbar,
.mud-appbar,
.mud-drawer,
.mud-drawer-header,
.mud-drawer-content,
.mud-nav-link,
.mud-nav-group,
.mud-expansion-panel,
.mud-expansion-panel-content,
.mud-expansion-panel-header,
.mud-tree-view,
.mud-tree-view-item,
.mud-form-control,
.mud-radio,
.mud-checkbox,
.mud-switch,
.mud-snackbar,
.mud-alert,
.mud-badge,
.mud-breadcrumbs,
.mud-overlay-content {
    font-family: var(--font-sans);
}

/* Monospaced exceptions â€” code, log lines, KPIs, IDs */
code,
pre,
samp,
kbd,
.mono,
.mud-typography-code {
    font-family: var(--font-mono);
}


/* ============================================================================
   Â§LAST-2  GLOBAL FORM-CONTROL FONT-SIZE â€” Force design 14 px on Mud inputs
   ----------------------------------------------------------------------------
   the baseline is `body { text-sm leading-5 }` = 14 px / 20 px (see
   `E:/Trabajo/.net/avalme/cursor/CRM/styles/base.css:15`). Form controls in
   design (`.form-input`, `.form-select`, `.form-textarea`) DO NOT set their
   own font-size â€” they inherit 14 px from body (see `app/forms/input.css`
   and `app/forms/select.css`).

   MudBlazor ships its own defaults (16 px on inputs in some variants, 14 px
   in others, plus floating-label scaling), so the form-control surface is
   visually inconsistent with design until we override.

   We lock every form-control surface in Mud at:
     â€¢ font-family: var(--font-sans)          = Inter (matches Â§LAST)
     â€¢ font-size:   var(--text-sm)            = 14 px (0.875 rem)
     â€¢ line-height: calc(var(--spacing) * 5)  = 20 px (Tailwind leading-5)

   font-family MUST be repeated here (not just left to Â§LAST) because Mud's
   `mudblazor.min.css` applies `font: inherit` (shorthand) on selectors like
   `.mud-input > textarea.mud-input-root` (specificity 0,2,1). That shorthand
   RESETS font-family to `inherit`, breaking the inheritance chain when the
   element wraps content with its own font cascade. With our `!important` on
   `font-family` directly on `.mud-input-root`, the textarea/input is bullet-
   proofed against that `font: inherit` reset.

   What this DOES NOT touch (by design):
     â€¢ Typography headings (.mud-typography-h1..h6) keep their own scale.
     â€¢ Chips (.mud-chip) â€” design badges are 12 px, handled elsewhere.
     â€¢ Buttons (.mud-button-root) â€” covered by the density rules in Â§2
       which set 12-13 px in compact mode.
     â€¢ Dialog title (.mud-dialog-title) â€” keeps its h6 scale.
   ============================================================================ */

/* â”€â”€ Inputs: text, textarea, numeric, password, email, etc. â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.mud-input-root,
.mud-input-input,
.mud-input-slot,
.mud-input-control input,
.mud-input-control textarea,

/* â”€â”€ Select / Autocomplete / Pickers (date, time, color, file) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.mud-select,
.mud-select-input,
.mud-autocomplete,
.mud-autocomplete .mud-input-input,
.mud-picker-input,
.mud-picker-input .mud-input-input,

/* â”€â”€ Labels (static + floating) and helper / error text under the input â”€â”€â”€ */
.mud-input-label,
.mud-input-label-inputcontrol,
.mud-input-label-animated,
.mud-input-outlined-label,
.mud-input-helper-text,

/* â”€â”€ Form-control wrapper (governs inherited size for children we missed) â”€â”€ */
.mud-form-control,

/* â”€â”€ Selection controls: their visible <label> text â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.mud-checkbox .mud-typography,
.mud-radio .mud-typography,
.mud-switch .mud-typography,

/* â”€â”€ Dropdown items rendered by MudSelect / MudAutocomplete / MudMenu â”€â”€â”€â”€â”€ */
.mud-list-item .mud-typography,
.mud-list-item-text,
.mud-menu-item,
.mud-select-popover .mud-list-item {
    font-family: var(--font-sans) !important;
    font-size: var(--text-sm) !important;
    line-height: calc(var(--spacing) * 5) !important;
}


/* â”€â”€â”€ Text color (typed value + dropdown items) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€
   design defines on `.form-input / .form-select / .form-textarea`:
       text-gray-800 placeholder:font-light placeholder:text-gray-600
       dark:text-dark-100 dark:placeholder:text-dark-200
   (see styles/app/forms/input.css:13 and select.css:8 of the design source).

   We mirror that here so the typed value in every Mud input â€” and the
   selectable items in dropdowns â€” uses the same design ink. Labels and
   helper text are EXCLUDED (Mud handles those with its own muted palette
   which is appropriate for floating-label / helper hints). */
.mud-input-root,
.mud-input-input,
.mud-input-slot,
.mud-input-control input,
.mud-input-control textarea,
.mud-select-input,
.mud-autocomplete .mud-input-input,
.mud-picker-input .mud-input-input,
.mud-list-item .mud-typography,
.mud-list-item-text,
.mud-menu-item,
.mud-select-popover .mud-list-item {
    color: var(--color-gray-800) !important;
}

html.dark .mud-input-root,
html.dark .mud-input-input,
html.dark .mud-input-slot,
html.dark .mud-input-control input,
html.dark .mud-input-control textarea,
html.dark .mud-select-input,
html.dark .mud-autocomplete .mud-input-input,
html.dark .mud-picker-input .mud-input-input,
html.dark .mud-list-item .mud-typography,
html.dark .mud-list-item-text,
html.dark .mud-menu-item,
html.dark .mud-select-popover .mud-list-item {
    color: var(--color-dark-100) !important;
}

/* â”€â”€â”€ Placeholder color + weight (Spec: gray-600 + font-light) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.mud-input-root::placeholder,
.mud-input-input::placeholder,
.mud-input-control input::placeholder,
.mud-input-control textarea::placeholder,
.mud-select-input::placeholder,
.mud-autocomplete .mud-input-input::placeholder,
.mud-picker-input .mud-input-input::placeholder {
    color: var(--color-gray-600) !important;
    font-weight: 300 !important;       /* placeholder:font-light */
    opacity: 1 !important;             /* override Firefox's default 0.54 opacity */
}

html.dark .mud-input-root::placeholder,
html.dark .mud-input-input::placeholder,
html.dark .mud-input-control input::placeholder,
html.dark .mud-input-control textarea::placeholder,
html.dark .mud-select-input::placeholder,
html.dark .mud-autocomplete .mud-input-input::placeholder,
html.dark .mud-picker-input .mud-input-input::placeholder {
    color: var(--color-dark-200) !important;
}


/* ============================================================================
   §LAST-3  BORDER STATE MACHINE — outlined form controls
   ----------------------------------------------------------------------------
   The Input / Select / Textarea form-control components share the EXACT
   same border cascade. The error state OVERRIDES hover/focus (priority
   by source order + specificity).

       State      | Light                | Dark
       -----------|----------------------|----------------------
       Normal     | border-gray-300      | dark:border-dark-450
       Hover      | border-gray-400      | dark:border-dark-400
       Focus      | border-primary-600   | dark:border-primary-500
       Error      | border-error         | dark:border-error-lighter
       Disabled   | border-gray-300      | dark:border-dark-500
                  | + bg-gray-150        | + dark:bg-dark-600
                  | + opacity 60 %       | + opacity 60 %

   MudBlazor's outlined input draws its border via a separate <fieldset>
   element with class `.mud-input-outlined-border` inside the `.mud-input`
   wrapper. That fieldset â€” not the input itself â€” is what we paint. The
   `.mud-input.mud-input-outlined` chain prefix gives us enough specificity
   to beat Mud's own defaults without sprinkling `!important`.

   Doctrine: see CLAUDE.md `Design Guidelines` and the validation discussion
   in `UI Guidelines/canonical-examples`.
   ============================================================================ */

/* â”€â”€ Normal state â€” border-gray-300 / dark:border-dark-450 â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.mud-input.mud-input-outlined .mud-input-outlined-border {
    border-color: var(--color-gray-300) !important;
    border-width: 1px !important;
    transition: border-color 150ms ease;
}

html.dark .mud-input.mud-input-outlined .mud-input-outlined-border {
    border-color: var(--color-dark-450) !important;
}

/* â”€â”€ Hover â€” match Mud's exact hover selector (with its :not() chain) so we
   beat it by source order at equal specificity.

   `:not(.mud-input-error)` is critical here: the :not() chain pumps the
   hover selector's specificity to (0,6,0), which beats our error+hover
   variant (0,5,0). Without this extra guard, mouse-over while in error
   state repaints the border gray-400. */
.mud-input.mud-input-outlined:not(.mud-disabled):not(:focus-within):not(.mud-input-error):hover .mud-input-outlined-border {
    border-color: var(--color-gray-400) !important;
    border-width: 1px !important;
}

html.dark .mud-input.mud-input-outlined:not(.mud-disabled):not(:focus-within):not(.mud-input-error):hover .mud-input-outlined-border {
    border-color: var(--color-dark-400) !important;
}

/* â”€â”€ Focus â€” border-primary-600 / dark:border-primary-500
   Mud's own focus rule thickens to 2px; we keep 1px (design uses 1px throughout). */
.mud-input.mud-input-outlined:focus-within > .mud-input-outlined-border,
.mud-input.mud-input-outlined.mud-input-focused .mud-input-outlined-border {
    border-color: var(--color-primary-600) !important;
    border-width: 1px !important;
}

html.dark .mud-input.mud-input-outlined:focus-within > .mud-input-outlined-border,
html.dark .mud-input.mud-input-outlined.mud-input-focused .mud-input-outlined-border {
    border-color: var(--color-primary-500) !important;
}

/* â”€â”€ Error â€” border-error / dark:border-error-lighter
   Mud's own rule is `.mud-input-error .mud-input-outlined-border` (specificity
   0,2,0) which means `.mud-input-error` is applied to a PARENT of the fieldset,
   not chained on `.mud-input` itself. To beat our (0,3,0) normal rule on the
   cascade, we list multiple specificity variants covering wherever Mud might
   place `.mud-input-error` (form-control wrapper, input-control wrapper, or
   chained on .mud-input itself). All variants â‰¥ (0,3,0) and !important. */
.mud-input-error .mud-input.mud-input-outlined .mud-input-outlined-border,
.mud-form-control.mud-input-error .mud-input-outlined-border,
.mud-input-control.mud-input-error .mud-input-outlined-border,
.mud-input.mud-input-outlined.mud-input-error .mud-input-outlined-border,
.mud-input-error.mud-input-outlined .mud-input-outlined-border,
.mud-input.mud-input-outlined.mud-input-error:hover .mud-input-outlined-border,
.mud-input.mud-input-outlined.mud-input-error:focus-within .mud-input-outlined-border,
.mud-input-error .mud-input.mud-input-outlined:hover .mud-input-outlined-border,
.mud-input-error .mud-input.mud-input-outlined:focus-within .mud-input-outlined-border {
    border-color: var(--color-error) !important;
    border-width: 1px !important;
}

html.dark .mud-input-error .mud-input.mud-input-outlined .mud-input-outlined-border,
html.dark .mud-form-control.mud-input-error .mud-input-outlined-border,
html.dark .mud-input-control.mud-input-error .mud-input-outlined-border,
html.dark .mud-input.mud-input-outlined.mud-input-error .mud-input-outlined-border,
html.dark .mud-input-error.mud-input-outlined .mud-input-outlined-border,
html.dark .mud-input.mud-input-outlined.mud-input-error:hover .mud-input-outlined-border,
html.dark .mud-input.mud-input-outlined.mud-input-error:focus-within .mud-input-outlined-border,
html.dark .mud-input-error .mud-input.mud-input-outlined:hover .mud-input-outlined-border,
html.dark .mud-input-error .mud-input.mud-input-outlined:focus-within .mud-input-outlined-border {
    border-color: var(--color-error-lighter) !important;
}

/* â”€â”€ Disabled â€” border-gray-300 + bg-gray-150 + opacity 60 % â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.mud-input.mud-input-outlined.mud-disabled .mud-input-outlined-border,
.mud-input.mud-input-outlined.mud-input-disabled .mud-input-outlined-border {
    border-color: var(--color-gray-300) !important;
    background-color: var(--color-gray-150) !important;
}

.mud-input.mud-input-outlined.mud-disabled,
.mud-input.mud-input-outlined.mud-input-disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

html.dark .mud-input.mud-input-outlined.mud-disabled .mud-input-outlined-border,
html.dark .mud-input.mud-input-outlined.mud-input-disabled .mud-input-outlined-border {
    border-color: var(--color-dark-500) !important;
    background-color: var(--color-dark-600) !important;
}

/* â”€â”€ Error helper text â€” design `mt-1 text-xs text-error dark:text-error-lighter`
   Mud renders the ErrorText as a `<p>` with `.mud-input-helper-text.mud-input-error`
   right after the input fieldset. We re-color it to match the border. */
.mud-input-helper-text.mud-input-error {
    color: var(--color-error) !important;
    font-family: var(--font-sans) !important;
    font-size: var(--text-xs, 0.75rem) !important;
    line-height: 1.4 !important;
    margin-top: 4px !important;
    font-weight: 400 !important;
    letter-spacing: 0 !important;
}

html.dark .mud-input-helper-text.mud-input-error {
    color: var(--color-error-lighter) !important;
}


/* ============================================================================
   Â§NAV-RAIL â€” design side navigation rail with hover-flyout for NavGroups
   ----------------------------------------------------------------------------
   Activated by the .av-nav-rail class on MudDrawer (see Shared/MainLayout.razor).
   The drawer toggles between two states (driven by DrawerOpen in MainLayout.cs):
     â€¢ .av-nav-rail--expanded   â†’ Width 240px, icons + labels (default desktop)
     â€¢ .av-nav-rail--collapsed  â†’ MiniWidth 64px, icons only + tooltip/flyout

   Doctrine: ver "Navigation rail" en CLAUDE.md (Mandatory UI Patterns).
   ============================================================================ */


/* â”€â”€ 1. EXPANDED STATE â€” full-width drawer with labels â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */

/* Inactive: gray-600 (light) / dark-200 (dark). MATCHES design PrimePanel.
   This OVERRIDES MudBlazor's default --mud-palette-text-primary (near-black)
   which makes the menu read as muted, not shouty. */
.av-nav-rail--expanded .mud-nav-link {
    padding-left: 16px;
    padding-right: 12px;
    border-radius: 8px;
    margin: 2px 8px;
    position: relative;
    color: var(--color-gray-600);
    transition: background-color 120ms ease, color 120ms ease;
}

html.dark .av-nav-rail--expanded .mud-nav-link {
    color: var(--color-dark-200);
}

/* Hover (not active): goes to gray-900 (darker), NOT primary. design uses
   hover for subtle emphasis â€” primary is reserved for the active state. */
.av-nav-rail--expanded .mud-nav-link:hover {
    background-color: var(--color-gray-100);
    color: var(--color-gray-900);
}

html.dark .av-nav-rail--expanded .mud-nav-link:hover {
    background-color: var(--color-dark-600);
    color: var(--color-dark-50);
}

/* Active: primary-600 (light) / primary-400 (dark). the exact tokens. */
.av-nav-rail--expanded .mud-nav-link.active,
.av-nav-rail--expanded .mud-nav-link.mud-nav-link-active {
    background-color: rgb(from var(--color-primary-500) r g b / 0.08);
    color: var(--color-primary-600);
    font-weight: 500;
}

html.dark .av-nav-rail--expanded .mud-nav-link.active,
html.dark .av-nav-rail--expanded .mud-nav-link.mud-nav-link-active {
    background-color: rgb(from var(--color-primary-400) r g b / 0.16);
    color: var(--color-primary-400);
}

/* Purple accent bar on the left of the active item (design signature) */
.av-nav-rail--expanded .mud-nav-link.active::before,
.av-nav-rail--expanded .mud-nav-link.mud-nav-link-active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    background-color: var(--color-primary-600);
    border-radius: 0 3px 3px 0;
}


/* â”€â”€ 2. COLLAPSED STATE â€” icon rail (64px) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */

/* Allow the flyout to spill out to the right of the drawer. We override every
   potential clipping ancestor: the drawer itself, its content wrapper, the
   nav menu UL, and the nav-group LI. */
.av-nav-rail--collapsed,
.av-nav-rail--collapsed .mud-drawer-content,
.av-nav-rail--collapsed .mud-nav-menu,
.av-nav-rail--collapsed .mud-nav-group {
    overflow: visible !important;
}

/* Hide right-side decorations of TOP-LEVEL NavGroup parents only:
   â€¢ chevron (mud-nav-link-expand-icon) on the rail row
   â€¢ any secondary svg that is NOT the leading icon (catches expand markers
     that may use a different class in different Mud versions)
   â€¢ mobile-only action row that doesn't fit 64 px
   Scoped to `.nav-menu-styled > .mud-nav-group > .mud-nav-link` so nested
   NavGroup parents INSIDE flyouts keep their chevron visible as a "has
   sub-menu" indicator (see Â§3 chevron rotation). */
.av-nav-rail--collapsed .nav-menu-styled > .mud-nav-group > .mud-nav-link .mud-nav-link-expand-icon,
.av-nav-rail--collapsed .nav-menu-styled > .mud-nav-group > .mud-nav-link > svg:not(.mud-nav-link-icon),
.av-nav-rail--collapsed .nav-mobile-actions {
    display: none !important;
}

/* TOP-LEVEL NavGroup parents (direct children of nav-menu in the rail): hide
   the inline title. The icon stands in for the title, and the flyout shows
   the children. Scope is `.nav-menu-styled > .mud-nav-group` â€” NESTED
   NavGroups inside flyouts (e.g. Form 1003 inside Settings) are NOT matched
   here, so they keep their title visible alongside the chevron. */
.av-nav-rail--collapsed .nav-menu-styled > .mud-nav-group > .mud-nav-link .mud-nav-link-text {
    display: none !important;
}

/* All nav links (top-level AND NavGroup parents) get IDENTICAL geometry in
   the collapsed rail. Fixed 48 Ã— 40 box centered with 8 px lateral margin
   inside the 64 px rail. This is what guarantees vertical alignment of all
   icons regardless of whether they're a plain MudNavLink or a MudNavGroup. */
.av-nav-rail--collapsed .mud-nav-link {
    box-sizing: border-box !important;
    width: 48px !important;
    height: 40px !important;
    min-width: 48px !important;
    min-height: 40px !important;
    padding: 0 !important;
    margin: 4px 8px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 8px !important;
    position: relative !important;
    color: var(--color-gray-500);  /* design MainPanel inactive: text-gray-500 */
    transition: background-color 120ms ease, color 120ms ease;
}

html.dark .av-nav-rail--collapsed .mud-nav-link {
    color: var(--color-dark-200);
}

/* Hover in the icon rail: background tint only, color stays gray.
   Matches design MainPanel: hover:bg-primary-600/20 with no color change. */
.av-nav-rail--collapsed .mud-nav-link:hover {
    background-color: rgb(from var(--color-primary-600) r g b / 0.20);
}

html.dark .av-nav-rail--collapsed .mud-nav-link:hover {
    background-color: rgb(from var(--color-dark-300) r g b / 0.20);
}

/* Active in the icon rail: primary-600 / primary-400 â€” design exact tokens. */
.av-nav-rail--collapsed .mud-nav-link.active,
.av-nav-rail--collapsed .mud-nav-link.mud-nav-link-active {
    background-color: rgb(from var(--color-primary-600) r g b / 0.10);
    color: var(--color-primary-600);
}

html.dark .av-nav-rail--collapsed .mud-nav-link.active,
html.dark .av-nav-rail--collapsed .mud-nav-link.mud-nav-link-active {
    background-color: rgb(from var(--color-primary-400) r g b / 0.15);
    color: var(--color-primary-400);
}

/* Purple accent bar on the LEFT of the active item â€” same design signature
   as the expanded state (Â§1), positioned just outside the icon box so it
   sits between the drawer's left edge and the icon. */
.av-nav-rail--collapsed .mud-nav-link.active::before,
.av-nav-rail--collapsed .mud-nav-link.mud-nav-link-active::before {
    content: "";
    position: absolute;
    left: -6px;
    top: 4px;
    bottom: 4px;
    width: 3px;
    background-color: var(--color-primary-600);
    border-radius: 0 3px 3px 0;
}

html.dark .av-nav-rail--collapsed .mud-nav-link.active::before,
html.dark .av-nav-rail--collapsed .mud-nav-link.mud-nav-link-active::before {
    background-color: var(--color-primary-400);
}


/* â”€â”€ 3. FLYOUT â€” show NavGroup children on hover when collapsed â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */

/*  Recursive flyout pattern. Every .mud-nav-group (top-level OR nested inside
    another flyout) gets its own absolute-positioned panel that opens to the
    right on hover. Direct-child selectors (`>`) are used everywhere so that
    hovering a parent NavGroup ONLY shows its own immediate flyout â€” it does
    NOT cascade to descendant NavGroups, which need their own hover trigger.

    Example: Settings â†’ Form 1003 â†’ (children).
      â€¢ Hover Settings  â†’ opens Settings' flyout (showing Form 1003 as a row
        with a chevron-right indicator).
      â€¢ Hover Form 1003 â†’ opens Form 1003's sub-flyout to the right.
      â€¢ Both stay open while the cursor is inside either panel (ancestor
        :hover propagates up from descendant). */


/* Make every .mud-nav-group the positioning anchor of its own flyout */
.av-nav-rail--collapsed .mud-nav-group {
    position: relative;
}

/* The native MudCollapse container becomes an absolute-positioned flyout.
   Selector uses `>` (direct child) so the rules apply at EVERY level â€” the
   top-level flyout AND any sub-flyout of nested NavGroups. */
.av-nav-rail--collapsed .mud-nav-group > .mud-collapse-container {
    position: absolute !important;
    left: 95% !important;
    top: 0 !important;
    margin-left: 4px;
    min-width: 220px;
    max-width: 280px;
    width: auto !important;
    height: auto !important;
    max-height: none !important;
    padding: 6px 0;
    background: var(--surface-1, var(--color-white));
    border: 1px solid var(--color-gray-200);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgb(0 0 0 / 0.10),
                0 2px 6px  rgb(0 0 0 / 0.05);
    /* overflow: visible (NOT auto) is mandatory so sub-flyouts of nested
       NavGroups can escape this container horizontally. Trade-off: very long
       flyouts overflow the viewport instead of scrolling. The Â§3.bis
       bottom-anchor heuristic mitigates this for last-N NavGroups. */
    overflow: visible !important;
    display: block !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateX(-4px) !important;
    /* No visibility/opacity transition for close â€” instant hide. This is
       deliberate to avoid the "click-collapse leaves flyouts dangling" bug:
       previously-expanded NavGroups must disappear immediately when the
       drawer collapses, not over a 400-520 ms transition.

       Re-entry during hover-out is handled by the row's ::after bridge
       (always interactable on the always-visible row) and the extended
       bridge for nested NavGroups (Â§3.ter). Hover-bridge UX is preserved
       because the bridge maintains :hover even during brief cursor exits. */
    transition: transform 120ms ease;
    pointer-events: none;
    z-index: 1300;
}

/* Optional escape valve: flyouts WITHOUT any nested NavGroup (most of them)
   can use vertical scroll if too tall. Uses :has() to detect â€” supported by
   every Blazor WASM target browser. For flyouts WITH nested NavGroups (e.g.
   Settings â†’ Form 1003), the rule does NOT apply, so overflow stays visible
   and the sub-flyout can escape. */
.av-nav-rail--collapsed .mud-nav-group > .mud-collapse-container:not(:has(.mud-nav-group)) {
    max-height: calc(100vh - var(--mud-appbar-height, 50px) - 24px) !important;
    overflow-x: visible !important;
    overflow-y: auto !important;
}

/* Â§3.bis â€” BOTTOM-ANCHORED FLYOUT FOR NAV-GROUPS NEAR THE END
   --------------------------------------------------------------------------
   For the last few NavGroups in the menu (those most likely to be near the
   bottom of the viewport), open the flyout UPWARD by anchoring its bottom
   to the nav-group's bottom instead of its top to the nav-group's top.
   This is a pure-CSS heuristic â€” for pixel-perfect viewport-aware flipping
   the architectural fix is JS interop with getBoundingClientRect(). */
.av-nav-rail--collapsed .mud-nav-group:nth-last-child(-n+5) > .mud-collapse-container {
    top: auto !important;
    bottom: 0 !important;
}

/* Â§3.quinquies â€” FAST-CLOSE WHEN A SIBLING NAVGROUP IS HOVERED
   --------------------------------------------------------------------------
   The 400 ms grace period exists to absorb cursor wobble between a NavGroup
   row and its own flyout. But when the cursor moves from one NavGroup to a
   DIFFERENT NavGroup, the grace would keep BOTH flyouts visible at the same
   time â€” visually confusing.

   Fix: CSS `:has()` detects "is any sibling NavGroup being hovered". When
   true, the non-hovered siblings' flyouts close FAST (80 ms), skipping the
   400 ms grace. The grace still applies when the cursor leaves to a neutral
   area (no sibling hover).

   Applied at both levels â€” top-level rail siblings, and nested NavGroups
   inside a flyout that have NavGroup siblings (rare but possible). */
.av-nav-rail--collapsed .nav-menu-styled:has(> .mud-nav-group:hover) > .mud-nav-group:not(:hover) > .mud-collapse-container,
.av-nav-rail--collapsed .mud-collapse-wrapper-inner:has(> .mud-nav-group:hover) > .mud-nav-group:not(:hover) > .mud-collapse-container {
    opacity: 0 !important;
    visibility: hidden !important;
    transition: opacity 80ms ease 0s,
                transform 80ms ease 0s,
                visibility 0s linear 80ms !important;
}

/* Show the flyout when the user hovers either the NavGroup row OR the panel
   itself. Critical: `>` (direct child) instead of descendant â€” hovering a
   parent NavGroup must NOT cascade into showing descendant NavGroups'
   flyouts. Each NavGroup level has its own independent hover trigger.

   !important on opacity/visibility beats the base rule's !important (which
   forces them off in non-hover state). Open transition is instant. */
.av-nav-rail--collapsed .mud-nav-group:hover > .mud-collapse-container,
.av-nav-rail--collapsed .mud-nav-group > .mud-collapse-container:hover {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateX(0) !important;
    pointer-events: auto;
    transition: opacity 120ms ease,
                transform 120ms ease;
}

/* Bypass the inner wrappers MudCollapse uses â€” they carry height: 0 /
   overflow: hidden when the NavGroup is "not expanded". We override ONLY
   when the parent NavGroup is hovered (so its flyout becomes visible),
   keeping nested NavGroups' wrappers collapsed until they too are hovered. */
.av-nav-rail--collapsed .mud-nav-group:hover > .mud-collapse-container > .mud-collapse-wrapper,
.av-nav-rail--collapsed .mud-nav-group > .mud-collapse-container:hover > .mud-collapse-wrapper,
.av-nav-rail--collapsed .mud-nav-group:hover > .mud-collapse-container > .mud-collapse-wrapper > .mud-collapse-wrapper-inner,
.av-nav-rail--collapsed .mud-nav-group > .mud-collapse-container:hover > .mud-collapse-wrapper > .mud-collapse-wrapper-inner {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    transform: none !important;
}

/* Transparent bridge that extends the flyout's hover area back toward the
   icon, so the cursor doesn't fall into a gap when moving from rail â†’ panel
   and accidentally close the flyout. `pointer-events: auto` overrides the
   inherited `pointer-events: none` of the hidden flyout, so the bridge zone
   triggers hover even before the panel is interactive. 16 px wide for fast
   diagonal cursor moves. */
.av-nav-rail--collapsed .mud-nav-group > .mud-collapse-container::before {
    content: "";
    position: absolute;
    left: -16px;
    top: 0;
    bottom: 0;
    width: 16px;
    background: transparent;
    pointer-events: auto;
}

html.dark .av-nav-rail--collapsed .mud-nav-group > .mud-collapse-container {
    background: var(--color-dark-700);
    border-color: var(--color-dark-500);
    box-shadow: 0 8px 24px rgb(0 0 0 / 0.30),
                0 2px 6px  rgb(0 0 0 / 0.20);
}

/* Children inside the flyout â€” full labels, no chevron, left-aligned padding.
   `display: flex` (block-level) + `width: calc(100% - 12px)` + box-sizing
   border-box makes the link FILL the parent's content area MINUS the
   horizontal margins. MudBlazor's default is `display: inline-flex` with
   `width: 100%` which still ends up content-sized in some contexts â€” the
   explicit width formula here removes that ambiguity. Result:
     â€¢ The hover background covers the full row width (not just the text).
     â€¢ `margin-left: auto` on the chevron pushes it to the right edge.
     â€¢ The 6 px lateral margin gives breathing room from the panel edges. */
.av-nav-rail--collapsed .mud-collapse-container .mud-nav-link {
    display: flex !important;
    box-sizing: border-box !important;
    width: calc(100% - 12px) !important;
    height: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    align-items: center !important;
    justify-content: flex-start !important;
    padding: 8px 14px !important;
    margin: 0 6px !important;
    border-radius: 6px !important;
    box-shadow: none !important;
}

.av-nav-rail--collapsed .mud-collapse-container .mud-nav-link .mud-nav-link-text {
    display: inline !important;
    position: static !important;
    /* IMPORTANT: do NOT force visibility / opacity here. The text must
       inherit them from the parent .mud-collapse-container â€” when the flyout
       is hidden (visibility: hidden), the text follows. If we forced
       `visibility: visible !important` here, the text would stay visible
       even when the flyout is invisible, leaking through during the
       click-collapse transition. */
    transform: none !important;
    background: transparent !important;
    color: inherit !important;
    padding: 0 !important;
    margin: 0 0 0 12px !important;
    box-shadow: none !important;
    /* aligned: same text-xs-plus (13 px) as the expanded menu items */
    font-size: var(--text-xs-plus);
    letter-spacing: 0.025em;
}

/* Nested NavGroup inside a flyout: show the expand chevron and rotate it 90Â°
   counter-clockwise so it points RIGHT (â†’) â€” the conventional "has sub-menu"
   indicator. The default ExpandIcon (KeyboardArrowDown) points down; the
   rotation makes it a sub-flyout affordance.
   The `!important` on transform beats MudBlazor's `.mud-transform` class
   that gets added on expand-state changes, so the chevron stays pointing
   right regardless of internal expand state. */
.av-nav-rail--collapsed .mud-collapse-container .mud-nav-link-expand-icon {
    display: inline-block !important;
    transform: rotate(-90deg) !important;
    color: var(--color-gray-400);
    opacity: 0.7;
    margin-left: auto;
    flex-shrink: 0;
}

html.dark .av-nav-rail--collapsed .mud-collapse-container .mud-nav-link-expand-icon {
    color: var(--color-dark-300);
}

/* Â§3.ter â€” ROW-ANCHORED HOVER BRIDGE (always interactable)
   --------------------------------------------------------------------------
   Defense-in-depth: a second bridge anchored to the parent ROW. The row is
   always visible (and the row hover triggers the same :hover up the chain),
   so this bridge is interactive in every state. */
.av-nav-rail--collapsed .mud-nav-group > .mud-nav-link::after {
    content: "";
    position: absolute;
    left: 100%;
    top: 0;
    bottom: 0;
    width: 20px;
    background: transparent;
    pointer-events: auto;
}

/* For NESTED NavGroup rows (inside a flyout, e.g. Form 1003 inside Settings):
   shift the bridge 6 px right so it starts OUTSIDE the parent flyout (the 6 px
   is the row's right margin to flyout edge), and make it wider (30 px) and
   much taller (400 px) so it covers the cursor's diagonal path from the row
   to deep sub-flyout items.

   The 6 px shift creates a gap inside the parent flyout â€” that gap is
   covered by the .mud-nav-group <li>'s natural hover area (it spans the
   full flyout width and row height), so hover continuity isn't lost.

   The tall bridge is positioned OUTSIDE the parent flyout horizontally, so
   it doesn't block sibling items inside the parent flyout. */
.av-nav-rail--collapsed .mud-collapse-container .mud-nav-group > .mud-nav-link::after {
    left: calc(100% + 6px);
    width: 30px;
    top: 0;
    bottom: auto;
    height: 400px;
}


/* â”€â”€ 4. TOOLTIP â€” top-level NavLink label as floating chip on hover â”€â”€â”€â”€â”€â”€â”€â”€ */

/* Top-level NavLinks (direct descendants of MudNavMenu, NOT inside a NavGroup)
   keep their .mud-nav-link-text in the DOM but render it as a floating tooltip
   chip to the right of the icon, shown only on hover. We use the descendant
   selector to be tolerant of any wrapping Mud applies between .mud-nav-menu
   and .mud-nav-link. */

.av-nav-rail--collapsed .mud-nav-menu > .mud-nav-link > .mud-nav-link-text {
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%) translateX(-4px);
    margin-left: 6px;
    padding: 6px 10px;
    background: var(--color-gray-900);
    color: var(--color-white);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgb(0 0 0 / 0.15);
    z-index: 1300;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 120ms ease, transform 120ms ease, visibility 120ms;
}

.av-nav-rail--collapsed .mud-nav-menu > .mud-nav-link:hover > .mud-nav-link-text {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
}

html.dark .av-nav-rail--collapsed .mud-nav-menu > .mud-nav-link > .mud-nav-link-text {
    background: var(--color-dark-50);
    color: var(--color-dark-900);
}


/* â”€â”€ 5. DRAWER VISUAL POLISH â€” skin overrides for the rail â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */

.av-nav-rail.mud-drawer {
    border-right: 1px solid var(--color-gray-200);
    box-shadow: none;
    background-color: var(--surface-1, var(--color-white));
    transition: width 180ms ease;
    /* Force the drawer to sit below the AppBar in ALL states. MudBlazor's own
       rule (`.mud-drawer-fixed.mud-drawer-mini.mud-drawer-clipped-always`)
       requires all three classes simultaneously, and the `mud-drawer-fixed`
       class is sometimes missing in Mini-Closed state â€” leaving the drawer
       at `top: 0` and the first icon clipped behind the AppBar. */
    top: var(--mud-appbar-height, 64px) !important;
    height: calc(100% - var(--mud-appbar-height, 64px)) !important;
}

html.dark .av-nav-rail.mud-drawer {
    border-right-color: var(--color-dark-500);
    background-color: var(--color-dark-700);
}


/* â”€â”€ 6. NEUTRALIZE LEGACY .nav-menu-styled RULES IN NavMenu.razor â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */

/*  Inside NavMenu.razor's scoped <style> block there are pre-rail rules that
    fight the rail skin at three points:
      1. `.nav-menu-styled { overflow-x: hidden }`  â†’ clips the flyout horizontally.
      2. `.mud-nav-link-icon { color: #6C63FF !important }`  â†’ forces every icon
         to the brand primary, so the active state cannot be distinguished and
         the rail looks visually flat (every item screams "active").
      3. `.mud-nav-group > .mud-collapse-wrapper { border-left: 4px solid;
         background: rgba(108,99,255,0.12) }`  â†’ adds a chunky purple bar around
         expanded children. Inside a flyout that frame looks misplaced.

    Touching NavMenu.razor's CSS would risk breaking the legacy expanded state
    (used elsewhere). Instead we override from here, scoped to .av-nav-rail,
    so the rules only apply when this drawer is rendered as a design rail.    */


/* 6.1 â€” Let the flyout escape the menu container horizontally.
   NOTE: this only fixes the clip from `.nav-menu-styled`. The outer
   `.mud-drawer-content` may still clip the flyout when the drawer scrolls
   vertically â€” that's a CSS limitation (overflow-y: auto forces overflow-x
   to auto too). See Â§6.6 for the mitigation strategy. */
.av-nav-rail .nav-menu-styled {
    overflow-x: visible !important;
}


/* 6.2 â€” Icons follow the same design color rules as text:
   â€¢ Inactive:  gray-600 light / dark-200 dark (PrimePanel) â€” for expanded.
                The Â§2 collapsed rules already set gray-500 on .mud-nav-link
                (the icon inherits via `color: currentColor` on the SVG).
   â€¢ Hover:     gray-900 light / dark-50 dark â€” NOT primary. design uses
                hover for subtle emphasis; primary is reserved for active.
   â€¢ Active:    primary-600 light / primary-400 dark â€” design exact tokens. */
.av-nav-rail .nav-menu-styled .mud-nav-link .mud-nav-link-icon,
.av-nav-rail .nav-menu-styled .mud-nav-group > .mud-nav-link .mud-nav-link-icon {
    color: var(--color-gray-600) !important;
    opacity: 1 !important;
}

html.dark .av-nav-rail .nav-menu-styled .mud-nav-link .mud-nav-link-icon,
html.dark .av-nav-rail .nav-menu-styled .mud-nav-group > .mud-nav-link .mud-nav-link-icon {
    color: var(--color-dark-200) !important;
}

/* Hover icon color (expanded only â€” collapsed keeps gray per design MainPanel) */
.av-nav-rail--expanded .nav-menu-styled .mud-nav-link:hover .mud-nav-link-icon,
.av-nav-rail--expanded .nav-menu-styled .mud-nav-group:hover > .mud-nav-link .mud-nav-link-icon {
    color: var(--color-gray-900) !important;
}

html.dark .av-nav-rail--expanded .nav-menu-styled .mud-nav-link:hover .mud-nav-link-icon,
html.dark .av-nav-rail--expanded .nav-menu-styled .mud-nav-group:hover > .mud-nav-link .mud-nav-link-icon {
    color: var(--color-dark-50) !important;
}

/* Active icon color (both expanded and collapsed) */
.av-nav-rail .nav-menu-styled .mud-nav-link.active .mud-nav-link-icon,
.av-nav-rail .nav-menu-styled .mud-nav-link.mud-nav-link-active .mud-nav-link-icon {
    color: var(--color-primary-600) !important;
}

html.dark .av-nav-rail .nav-menu-styled .mud-nav-link.active .mud-nav-link-icon,
html.dark .av-nav-rail .nav-menu-styled .mud-nav-link.mud-nav-link-active .mud-nav-link-icon {
    color: var(--color-primary-400) !important;
}


/* 6.3 â€” Strip the chunky purple decoration that legacy CSS adds to expanded
   NavGroup children. We replace it with the flyout's clean look (which is
   re-asserted here with extra specificity so it beats the legacy rule). */
.av-nav-rail--collapsed .nav-menu-styled .mud-nav-group .mud-collapse-wrapper,
.av-nav-rail--collapsed .nav-menu-styled .mud-nav-group .mud-collapse-wrapper-inner {
    background: transparent !important;
    border-left: none !important;
    margin: 0 !important;
    border-radius: 0 !important;
}

.av-nav-rail--collapsed .nav-menu-styled .mud-nav-group > .mud-collapse-container {
    background: var(--surface-1, var(--color-white)) !important;
    border: 1px solid var(--color-gray-200) !important;
    border-radius: 10px !important;
    margin-left: 4px !important;
    padding: 6px 0 !important;
    box-shadow: 0 8px 24px rgb(0 0 0 / 0.10),
                0 2px 6px  rgb(0 0 0 / 0.05) !important;
}

html.dark .av-nav-rail--collapsed .nav-menu-styled .mud-nav-group > .mud-collapse-container {
    background: var(--color-dark-700) !important;
    border-color: var(--color-dark-500) !important;
}


/* 6.4 â€” Slim scrollbar (Firefox + Chromium) on the rail's scroll container.
   The legacy CSS only covered Chromium via ::-webkit-scrollbar. We extend to
   Firefox via scrollbar-width / scrollbar-color, and route both to a neutral
   gray instead of the brand primary (so the scrollbar doesn't compete with
   the active-state color). */
.av-nav-rail .mud-drawer-content,
.av-nav-rail .nav-menu-styled,
.av-nav-rail--collapsed .mud-collapse-container {
    scrollbar-width: thin;
    scrollbar-color: var(--color-gray-300) transparent;
}

.av-nav-rail .mud-drawer-content::-webkit-scrollbar,
.av-nav-rail .nav-menu-styled::-webkit-scrollbar,
.av-nav-rail--collapsed .mud-collapse-container::-webkit-scrollbar {
    width: 4px;
}

.av-nav-rail .mud-drawer-content::-webkit-scrollbar-track,
.av-nav-rail .nav-menu-styled::-webkit-scrollbar-track,
.av-nav-rail--collapsed .mud-collapse-container::-webkit-scrollbar-track {
    background: transparent;
}

.av-nav-rail .mud-drawer-content::-webkit-scrollbar-thumb,
.av-nav-rail .nav-menu-styled::-webkit-scrollbar-thumb,
.av-nav-rail--collapsed .mud-collapse-container::-webkit-scrollbar-thumb {
    background: var(--color-gray-300);
    border-radius: 4px;
}

.av-nav-rail .mud-drawer-content::-webkit-scrollbar-thumb:hover,
.av-nav-rail .nav-menu-styled::-webkit-scrollbar-thumb:hover,
.av-nav-rail--collapsed .mud-collapse-container::-webkit-scrollbar-thumb:hover {
    background: var(--color-gray-400);
}

html.dark .av-nav-rail .mud-drawer-content,
html.dark .av-nav-rail .nav-menu-styled,
html.dark .av-nav-rail--collapsed .mud-collapse-container {
    scrollbar-color: var(--color-dark-400) transparent;
}

html.dark .av-nav-rail .mud-drawer-content::-webkit-scrollbar-thumb,
html.dark .av-nav-rail .nav-menu-styled::-webkit-scrollbar-thumb,
html.dark .av-nav-rail--collapsed .mud-collapse-container::-webkit-scrollbar-thumb {
    background: var(--color-dark-400);
}

html.dark .av-nav-rail .mud-drawer-content::-webkit-scrollbar-thumb:hover,
html.dark .av-nav-rail .nav-menu-styled::-webkit-scrollbar-thumb:hover,
html.dark .av-nav-rail--collapsed .mud-collapse-container::-webkit-scrollbar-thumb:hover {
    background: var(--color-dark-300);
}


/* 6.5 â€” Compact rail geometry: tighter vertical spacing so the user sees
   more items without scrolling.  40 px box + 2 px vertical margin (was 48+4),
   inset border made thinner so the smaller cell doesn't feel cramped. */
.av-nav-rail--collapsed .mud-nav-link {
    height: 40px !important;
    min-height: 40px !important;
    margin: 2px 8px !important;
}


/* 6.6 â€” CAVEAT: vertical scroll + horizontal flyout
   ----------------------------------------------------------------------------
   When the menu has more items than fit in the viewport, `.mud-drawer-content`
   uses `overflow-y: auto` to scroll. Browsers force `overflow-x` to `auto` in
   that case (CSS spec), which clips the absolutely-positioned flyout
   horizontally.

   Mitigation in this revision: tighter geometry (Â§6.5) reduces the chance the
   menu needs to scroll for a typical user permission set. If you regularly
   exceed the viewport, the right fix is to either:
     a) Wrap each MudNavGroup in a MudPopover (portals to <body>, no clipping).
     b) Use JS interop to position the flyout via `position: fixed` and
        track the parent icon's getBoundingClientRect().
   Both require .razor changes â€” out of scope for this CSS-only doctrine.    */


/* â”€â”€ 7. PARENT-ACTIVE-WHEN-CHILD-ACTIVE â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */

/*  MudBlazor doesn't propagate the active state of a child NavLink up to the
    parent NavGroup. In a collapsed rail this is a UX problem: the user has
    no visual hint of which section the active page belongs to (the parent
    icon looks just like any other icon).

    The fix is CSS `:has()`: we mark the parent NavGroup as active when ANY
    descendant NavLink inside its collapse container carries `.active` or
    `.mud-nav-link-active`. Applies in both expanded and collapsed states for
    consistency.

    Browser support: Chrome 105+, Firefox 121+, Safari 15.4+ â€” covers every
    Blazor WASM target. No JS fallback needed.                                */

.av-nav-rail .mud-nav-group:has(.mud-collapse-container .mud-nav-link.active) > .mud-nav-link,
.av-nav-rail .mud-nav-group:has(.mud-collapse-container .mud-nav-link.mud-nav-link-active) > .mud-nav-link {
    background-color: rgb(from var(--color-primary-500) r g b / 0.08);
    color: var(--color-primary-600);  /* design primary-600, not 700 */
}

html.dark .av-nav-rail .mud-nav-group:has(.mud-collapse-container .mud-nav-link.active) > .mud-nav-link,
html.dark .av-nav-rail .mud-nav-group:has(.mud-collapse-container .mud-nav-link.mud-nav-link-active) > .mud-nav-link {
    background-color: rgb(from var(--color-primary-400) r g b / 0.16);
    color: var(--color-primary-400);
}

/* Collapsed: same accent-bar signature as a direct active NavLink (Â§2). The
   ::before is anchored to the parent NavGroup's <a class="mud-nav-link"> row,
   not to the children inside the collapse container. */
.av-nav-rail--collapsed .mud-nav-group:has(.mud-collapse-container .mud-nav-link.active) > .mud-nav-link,
.av-nav-rail--collapsed .mud-nav-group:has(.mud-collapse-container .mud-nav-link.mud-nav-link-active) > .mud-nav-link {
    background-color: rgb(from var(--color-primary-500) r g b / 0.12);
}

html.dark .av-nav-rail--collapsed .mud-nav-group:has(.mud-collapse-container .mud-nav-link.active) > .mud-nav-link,
html.dark .av-nav-rail--collapsed .mud-nav-group:has(.mud-collapse-container .mud-nav-link.mud-nav-link-active) > .mud-nav-link {
    background-color: rgb(from var(--color-primary-400) r g b / 0.20);
}

.av-nav-rail--collapsed .mud-nav-group:has(.mud-collapse-container .mud-nav-link.active) > .mud-nav-link::before,
.av-nav-rail--collapsed .mud-nav-group:has(.mud-collapse-container .mud-nav-link.mud-nav-link-active) > .mud-nav-link::before {
    content: "";
    position: absolute;
    left: -6px;
    top: 4px;
    bottom: 4px;
    width: 3px;
    background-color: var(--color-primary-600);
    border-radius: 0 3px 3px 0;
}

html.dark .av-nav-rail--collapsed .mud-nav-group:has(.mud-collapse-container .mud-nav-link.active) > .mud-nav-link::before,
html.dark .av-nav-rail--collapsed .mud-nav-group:has(.mud-collapse-container .mud-nav-link.mud-nav-link-active) > .mud-nav-link::before {
    background-color: var(--color-primary-400);
}

/* Parent icon picks up the primary color when a child is the active route */
.av-nav-rail .nav-menu-styled .mud-nav-group:has(.mud-collapse-container .mud-nav-link.active) > .mud-nav-link .mud-nav-link-icon,
.av-nav-rail .nav-menu-styled .mud-nav-group:has(.mud-collapse-container .mud-nav-link.mud-nav-link-active) > .mud-nav-link .mud-nav-link-icon {
    color: var(--color-primary-600) !important;
}

html.dark .av-nav-rail .nav-menu-styled .mud-nav-group:has(.mud-collapse-container .mud-nav-link.active) > .mud-nav-link .mud-nav-link-icon,
html.dark .av-nav-rail .nav-menu-styled .mud-nav-group:has(.mud-collapse-container .mud-nav-link.mud-nav-link-active) > .mud-nav-link .mud-nav-link-icon {
    color: var(--color-primary-400) !important;
}


/* ============================================================================
   Â§APPBAR-MISC â€” MudBlazor overrides previously inline in MainLayout.razor
   ----------------------------------------------------------------------------
   These small per-component overrides were originally inside the <style>
   block of Shared/MainLayout.razor (now removed to keep .razor files free of
   inline styling per the doctrine). Two bugs from the original were fixed in
   the move:
     â€¢ `0% { opacity: 0 !important }` â€” orphan rule (only valid inside
       @@keyframes). Was silently ignored by the browser. Removed entirely.
     â€¢ `min-height: none` â€” `none` is not a valid value for `min-height`.
       Was silently ignored. Corrected to `min-height: 0`.
   ============================================================================ */

/* MudInput placeholder: smaller font on dense outlined inputs (kept for
   parity with legacy AppBar behaviour). */
.mud-input > input.mud-input-root-outlined.mud-input-root-margin-dense::placeholder {
    font-size: 12px;
}

/* Padding compensation for the bottom-fixed MudAppBar (Footer) so the page
   content never hides under it. */
.mud-main-content {
    padding-bottom: 72px !important;
}

/* Drawer chrome â€” subtle border and shadow on the main nav rail. Lives here
   (not in Â§NAV-RAIL above) because it predates the rail refactor and is
   referenced by `Class="drawer-styled"` on the MudDrawer in MainLayout. */
.drawer-styled {
    border-right: 1px solid rgba(108, 99, 255, 0.08) !important;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.04) !important;
}

/* Close button row inside the drawer (only visible on MdAndDown). */
.drawer-close-btn {
    display: flex;
    justify-content: flex-end;
    padding: 0.5rem 0.5rem 0;
}

/* Backdrop blur utility â€” used by some dialog backdrops (DialogOptions
   `BackgroundClass = "my-class-background"`). */
.my-class-background {
    backdrop-filter: blur(10px);
}

/* Dialog content padding tweak (pre-FormDialog skin override). */
.mud-dialog .mud-dialog-content {
    padding: 8px 24px 16px;
}

/* MudTab compact sizing on the toolbar â€” preserves the legacy app-wide tab
   density. */
.mud-tab.mud-ripple {
    min-width: 100px !important;
    min-height: max-content !important;
    padding: 12px 18px !important;
}

/* Toolbar reset â€” `none` (the original buggy value) is not valid for
   min-height; we use 0. */
.mud-toolbar .mud-toolbar-gutters .mud-toolbar {
    min-height: 0;
}

@media (min-width: 600px) {
    .mud-appbar .mud-toolbar-appbar {
        height: max-content;
    }
}
