/* Admin Dashboard Theme — one set of tokens, derived from Radzen's semantic palette variables, so the
   chrome follows the theme stylesheet ThemeSvc loads (standard / standard-dark). Dark-only FinCopy tokens
   (FC.Com fincopy.css) key off html[data-fc-theme="standard-dark"], which fc-theme.js sets with the sheet. */

/* Force body text/background to follow Radzen's palette CSS variables
   (set by Radzen theme stylesheet). bootstrap-reboot.css applies
   `body { color: var(--bs-body-color); }` which would otherwise
   bleed dark grey into every RadzenText whose Color modifier resolves to
   "inherit", making dashboard headings unreadable in dark mode. */
html, body {
    color: var(--rz-text-color);
    background-color: var(--rz-body-background-color);
}

/* Plain anchor links take the link ink (brand block below), readable on both backgrounds; the primary FILL colour
   reads 2.8:1 as text on the dark surface. */
a, .btn-link {
    color: var(--rz-link-color);
}

/* Brand-coloured tokens DERIVE from Radzen's palette CSS variables —
   never hardcode hex here. Radzen theme stylesheet rebroadcasts those vars on
   every palette change, so the ThemeConfig drawer's colour pickers now
   actually flow through to sidebar/cards/dashboard accents instead of
   only the components that consume `Color="Color.Primary"` directly.

   `rgb(from <colour> r g b / <alpha>)` lets us derive translucent
   variants without hard-coding the RGB triple (was the old
   `rgba(99, 102, 241, 0.10)` baked-in primary). Supported in
   Chromium 111+, Firefox 113+, Safari 16.4+. */
:root {
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 44px;
    --adm-rail-open-width: 340px;
    --adm-rail-mini-width: 46px;
    --topbar-height: 64px;
    --card-border-radius: 8px;
    --transition-speed: 0.3s;
    --fc-overlay-scrim: rgba(0, 0, 0, 0.5);
    /* T709: the admin's stacking order, low to high. The page chrome sits under every overlay: the menu 5, the top bar 10,
       the alerts rail 45, the phone menu's scrim 55 and the menu itself 60 (fincopy.css). Then drawers, the admin modals
       (AIBotAdminModal, the API key dialog), the theme drawer, FC.Com's trade sheets (1400, 1420) and AIBot overlay (1500),
       Radzen's dialogs (html:root below: a confirm opened from any of those lands on it) and Radzen's toasts. Radzen's
       dropdown, tooltip and menu lists set 2000 inline and stay above all of them. */
    --adm-z-drawer: 1100;
    --adm-z-modal: 1150;
    --adm-z-panel: 1200;
    --adm-z-toast: 1700;
    --fc-shadow-low: 0 -1px 2px rgba(0, 0, 0, 0.2);
    --fc-shadow-card: 0 8px 32px rgba(0, 0, 0, 0.1);
    --fc-shadow-menu: 0 4px 16px rgba(0, 0, 0, 0.2);
    --fc-shadow-drawer: -4px 0 16px rgba(0, 0, 0, 0.18);
    --fc-shadow-drag: 0 6px 18px rgba(0, 0, 0, 0.18);
    --fc-border-subtle: var(--adm-line);
    --fc-handle-color: var(--rz-text-secondary-color);
    --fc-selection-tint: color-mix(in srgb, var(--rz-primary) 10%, transparent);

    /* Brand — pure aliases on Radzen palette. */
    --primary-color:   var(--rz-primary);
    --secondary-color: var(--rz-secondary);
    --success-color:   var(--rz-success);
    --warning-color:   var(--rz-warning);
    --error-color:     var(--rz-danger);
    --info-color:      var(--rz-info);
    --dark-color:      var(--rz-text-title-color);

    /* Surfaces (T705, operator 2026-11-11: "full light mode (even sidebars) and vice versa").
       Only Radzen's SEMANTIC tokens flip with the theme. Its base scale does not: standard-dark keeps
       --rz-base-50 … --rz-base-300 near-white, so a surface painted with a base step stays light in dark mode, and
       --rz-sidebar-background-color is near-black in BOTH themes. Every chrome surface takes one of these. */
    --adm-surface:        var(--rz-base-background-color);
    --adm-surface-raised: var(--rz-card-background-color);
    --adm-surface-sunken: var(--rz-body-background-color);
    --adm-surface-tint:   color-mix(in srgb, var(--rz-text-color) 5%, var(--rz-base-background-color));
    --adm-hover:          color-mix(in srgb, var(--rz-text-color) 8%, transparent);
    --adm-ink:            var(--rz-text-color);
    --adm-ink-title:      var(--rz-text-title-color);
    --adm-ink-muted:      var(--rz-text-secondary-color);
    /* The separator line. Radzen's standard themes define no --rz-border-color (only its old "dark" theme does), so a
       border written with it was invalid and drew nothing. The text ink at 16% reads in both themes. */
    --adm-line:           color-mix(in srgb, var(--rz-text-color) 16%, transparent);
    --fc-surface-muted:   var(--adm-surface-tint);

    --content-bg:     var(--adm-surface-sunken);
    --surface-bg:     var(--adm-surface);
    --text-primary:   var(--adm-ink);
    --text-secondary: var(--adm-ink-muted);

    /* T709 Q350-B: today's page grounds, named once. Radzen's own (standard --rz-base-100, standard-dark --rz-base-900)
       painted the page before; these paint it now (below), and Theme Config shows them as the Page rows' defaults. */
    --adm-page-light: #f4f5f9;
    --adm-page-dark:  #19191a;
    /* Each sidebar's background in the mode on screen (dark mode below), read by the sidebar rules and Theme Config. */
    --adm-sidebar-light-bg: var(--rz-white);
    --adm-sidebar-dark-bg:  var(--rz-base-900);

    /* Sidebar — the light sidebar of light mode: the page's own surface and ink, as Radzen's standard sheet sets them
       (white, base-800 ink, base-700 sections). T709: written from those steps, not from the page's tokens, so a picked
       page background never moves the sidebar. The active item is the primary tint with its on-tint ink. */
    --sidebar-bg:              var(--adm-sidebar-light-bg);
    --sidebar-text:            var(--rz-base-800);
    --sidebar-section:         var(--rz-base-700);
    --sidebar-search-bg:       color-mix(in srgb, var(--rz-base-800) 5%, var(--sidebar-bg));
    --sidebar-hover:           color-mix(in srgb, var(--rz-base-800) 8%, transparent);
    --sidebar-active-bg:       color-mix(in srgb, var(--fc-accent) 14%, transparent);
    --sidebar-active-fg:       var(--fc-accent-hover);
    --sidebar-active-bar:      var(--fc-accent);
    --sidebar-group-active-bg: color-mix(in srgb, var(--fc-accent) 6%, transparent);
    --sidebar-divider:         color-mix(in srgb, var(--rz-base-800) 16%, transparent);
}
html[data-fc-theme="standard"] { --rz-body-background-color: var(--adm-page-light); }
html[data-fc-theme="standard-dark"] { --rz-body-background-color: var(--adm-page-dark); --adm-sidebar-light-bg: var(--rz-base-50); }

/* The admin can keep a dark navigation rail independently from the page mode. */
.admin-layout.fc-sidebar-dark {
    --sidebar-bg: var(--adm-sidebar-dark-bg);
    --sidebar-text: var(--rz-base-50);
    --sidebar-section: var(--rz-base-200);
    --sidebar-search-bg: color-mix(in srgb, var(--rz-base-50) 9%, var(--sidebar-bg));
    --sidebar-hover: color-mix(in srgb, var(--rz-base-50) 9%, transparent);
    --sidebar-active-bg: color-mix(in srgb, var(--rz-primary) 24%, var(--sidebar-bg));
    --sidebar-active-fg: var(--rz-base-50);
    --sidebar-active-bar: var(--rz-primary-light);
    --sidebar-group-active-bg: color-mix(in srgb, var(--rz-primary) 12%, transparent);
    --sidebar-divider: color-mix(in srgb, var(--rz-base-50) 20%, transparent);
}

/* A light navigation rail remains available while the app uses the dark Radzen theme. */
.admin-layout.standard-dark:not(.fc-sidebar-dark) {
    --sidebar-bg: var(--adm-sidebar-light-bg);
    --sidebar-text: var(--rz-base-900);
    --sidebar-section: var(--rz-base-700);
    --sidebar-search-bg: var(--rz-base-100);
    --sidebar-hover: color-mix(in srgb, var(--rz-base-900) 6%, transparent);
    --sidebar-active-bg: color-mix(in srgb, var(--rz-primary) 14%, var(--rz-base-50));
    --sidebar-active-fg: var(--rz-base-900);
    --sidebar-active-bar: var(--rz-primary);
    --sidebar-group-active-bg: color-mix(in srgb, var(--rz-primary) 6%, transparent);
    --sidebar-divider: color-mix(in srgb, var(--rz-base-900) 20%, transparent);
}
/* The sidebar's head and foot rules take its own divider, whichever sidebar and background is on screen. */
.admin-layout .adm-menu-head,
.admin-layout .adm-menu-foot { border-color: var(--sidebar-divider); }

.fc-trading-mark-group { display: inline-flex; align-items: center; gap: .3rem; flex-wrap: wrap; }
.fc-trading-mark { --fc-mark-ink: var(--rz-text-secondary-color); --fc-mark-bg: color-mix(in srgb, var(--fc-mark-ink) 12%, var(--adm-surface-raised)); position: relative; display: inline-flex; align-items: center; padding: .18rem .42rem; border: 1px solid color-mix(in srgb, var(--fc-mark-ink) 30%, var(--adm-line)); border-radius: 999px; background: var(--fc-mark-bg); color: var(--fc-mark-ink); font-size: .72rem; font-weight: 650; line-height: 1.2; white-space: nowrap; cursor: help; }
.fc-trading-mark-main { display: inline-flex; align-items: center; gap: .28rem; }
.fc-trading-mark svg { width: .85rem; height: .85rem; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.fc-trading-mark.tone-muted { --fc-mark-ink: var(--rz-text-secondary-color); }
.fc-trading-mark.tone-info { --fc-mark-ink: var(--rz-info); }
.fc-trading-mark.tone-ok { --fc-mark-ink: var(--rz-success); }
.fc-trading-mark.tone-warn { --fc-mark-ink: var(--rz-warning); }
.fc-trading-mark.tone-bad { --fc-mark-ink: var(--rz-danger); }
.fc-trading-mark.tone-primary { --fc-mark-ink: var(--rz-primary); }
.fc-trading-mark.tone-outline,.fc-trading-mark.tone-none { --fc-mark-ink: var(--rz-text-secondary-color); }
.fc-trading-mark:focus-visible { outline: 2px solid var(--rz-primary); outline-offset: 2px; }
.fc-trading-mark-tip { position: absolute; z-index: 3000; left: 50%; bottom: calc(100% + .4rem); display: none; width: max-content; max-width: min(22rem,80vw); padding: .55rem .65rem; transform: translateX(-50%); border: 1px solid var(--adm-line); border-radius: .5rem; background: var(--adm-surface-raised); color: var(--adm-ink); box-shadow: var(--fc-shadow-menu); font-size: .75rem; font-weight: 450; white-space: normal; }
.fc-trading-mark:hover .fc-trading-mark-tip,.fc-trading-mark:focus .fc-trading-mark-tip { display: block; }
.fc-trading-mark-tip-label { display: inline-block; margin-right: .25rem; padding: .08rem .32rem; border-radius: 999px; background: var(--fc-mark-bg); color: var(--fc-mark-ink); font-weight: 700; }
.fc-trading-counts { display: inline-flex; gap: .35rem; color: var(--rz-text-secondary-color); font-size: .72rem; }
.fc-admin-mark-stack { display: flex; flex-direction: column; align-items: flex-start; gap: .3rem; }

/* T709 Q350-B: a sidebar background picked in Theme Config (fc-theme-boot.js sets --fc-pick-rail-light /
   --fc-pick-rail-dark on <html>, with data-fc-rail-light / data-fc-rail-dark naming the pick's tone). It replaces the
   background of the sidebar it names, in both modes; the words, sections, search box, hover, active tint and dividers are
   mixed from it, the words in the ink for its ground: light on a dark pick, dark on a light pick. */
html[data-fc-rail-light] .admin-layout:not(.fc-sidebar-dark) { --sidebar-bg: var(--fc-pick-rail-light); }
html[data-fc-rail-dark] .admin-layout.fc-sidebar-dark { --sidebar-bg: var(--fc-pick-rail-dark); }
:is(html[data-fc-rail-light="dark"] .admin-layout:not(.fc-sidebar-dark), html[data-fc-rail-dark="dark"] .admin-layout.fc-sidebar-dark) {
    --adm-rail-on: var(--rz-base-50);
    --sidebar-active-bar: color-mix(in srgb, var(--fc-accent) 55%, var(--adm-rail-on));
}
:is(html[data-fc-rail-light="light"] .admin-layout:not(.fc-sidebar-dark), html[data-fc-rail-dark="light"] .admin-layout.fc-sidebar-dark) {
    --adm-rail-on: var(--rz-base-900);
    --sidebar-active-bar: var(--fc-accent);
}
:is(html[data-fc-rail-light] .admin-layout:not(.fc-sidebar-dark), html[data-fc-rail-dark] .admin-layout.fc-sidebar-dark) {
    --sidebar-text: color-mix(in srgb, var(--adm-rail-on) 90%, var(--sidebar-bg));
    --sidebar-section: color-mix(in srgb, var(--adm-rail-on) 68%, var(--sidebar-bg));
    --sidebar-search-bg: color-mix(in srgb, var(--adm-rail-on) 8%, var(--sidebar-bg));
    --sidebar-hover: color-mix(in srgb, var(--adm-rail-on) 9%, transparent);
    --sidebar-active-bg: color-mix(in srgb, var(--fc-accent) 24%, var(--sidebar-bg));
    --sidebar-active-fg: var(--adm-rail-on);
    --sidebar-group-active-bg: color-mix(in srgb, var(--fc-accent) 10%, transparent);
    --sidebar-divider: color-mix(in srgb, var(--adm-rail-on) 18%, transparent);
}
.sidebar .nav-search { color: var(--sidebar-text); background-color: var(--sidebar-search-bg); border-color: var(--sidebar-divider); }
.sidebar .nav-search::placeholder { color: var(--sidebar-section); opacity: 1; }

/* Layout */
.admin-layout {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

/* Brand: FinCopy teal (the logo's #08747D, FC.Com --fc-accent) replaces Radzen's default blue, set once through Radzen's
   primary variables so buttons, links, switches, the select bar, menu tints, the alerts tools and focus rings follow.
   html:root outranks the theme sheet's :root. Contrast: white on the teal fill 5.5:1; the on-tint ink is the darker teal
   in light (6.4:1 on its tint, 7.0:1 on white) and the light teal in dark (8.0:1 on its tint). */
html:root {
    --rz-primary: var(--fc-accent);
    --rz-primary-dark: var(--fc-accent-hover);
    --rz-primary-darker: color-mix(in srgb, var(--fc-accent-hover) 80%, black);
    --rz-primary-light: color-mix(in srgb, var(--fc-accent) 75%, white);
    --rz-primary-lighter: color-mix(in srgb, var(--fc-accent) 14%, transparent);
    --rz-on-primary: var(--fc-accent-ink);
    --rz-on-primary-dark: var(--fc-accent-ink);
    --rz-on-primary-darker: var(--fc-accent-ink);
    --rz-on-primary-lighter: var(--fc-accent-hover);
    --rz-link-color: var(--rz-on-primary-lighter);
    --rz-link-hover-color: var(--rz-on-primary-lighter);
    /* Radzen writes these two with its blue as a literal rather than through --rz-primary. */
    --rz-input-focus-shadow: 0 0 0 1px var(--rz-base-background-color), 0 0 0 3px color-mix(in srgb, var(--rz-primary-light) 45%, transparent);
    --rz-panel-menu-item-active-indicator: var(--rz-primary);
    /* UIX section 5: the selected segment is filled, not a pale tint. */
    --rz-selectbar-selected-background-color: var(--rz-primary);
    --rz-selectbar-selected-color: var(--rz-on-primary);
    /* T709: Radzen's dialogs (mask 1000, dialog 1001) sat under the drawers (1100); they go above every admin overlay. */
    --rz-dialog-mask-zindex: 1600;
    --rz-dialog-zindex: 1601;
}

/* Dark: the teal fill keeps white ink, and every place Radzen puts primary as TEXT on the dark surface takes the light
   teal (the fill colour itself reads 2.8:1 there). standard-dark also paints a Base button's icon #242527 on #3b3c3f
   (1.4:1); its own text colour reads 9:1. */
html[data-fc-theme="standard-dark"]:not([data-fc-page-dark="light"]), html[data-fc-theme="standard"][data-fc-page-light="dark"] {
    --rz-primary-light: var(--fc-accent-strong);
    --rz-primary-lighter: color-mix(in srgb, var(--fc-accent) 30%, transparent);
    --rz-on-primary-lighter: var(--fc-accent-strong);
    --rz-button-base-color: var(--rz-text-color);
}
:is(html[data-fc-theme="standard-dark"]:not([data-fc-page-dark="light"]), html[data-fc-theme="standard"][data-fc-page-light="dark"]) .rz-button.rz-variant-outlined.rz-primary.rz-shade-default { color: var(--rz-primary-light); box-shadow: inset 0 0 0 var(--rz-border-width) var(--rz-primary-light); }
:is(html[data-fc-theme="standard-dark"]:not([data-fc-page-dark="light"]), html[data-fc-theme="standard"][data-fc-page-light="dark"]) .rz-button.rz-variant-text.rz-primary.rz-shade-default { color: var(--rz-primary-light); }

/* T709 Q350-B / Q351-A: a page background picked in Theme Config (fc-theme-boot.js sets --fc-pick-page-light /
   --fc-pick-page-dark on <html> with data-fc-page-light / data-fc-page-dark naming its tone; FC.Com fincopy.css resolves
   the one for the mode on screen as --fc-page-pick). Set on <html>, where Radzen resolves its own tokens, so every Radzen
   surface that reads them follows: the page is the pick, cards (and the top bar, inputs, grids, dialogs) and raised
   surfaces are mixed from it, and the text takes the ink for its ground (light on a dark pick, dark on a light one).
   Lines, hovers and tints already mix from the text (--adm-line, --adm-hover, --adm-surface-tint). */
html:is([data-fc-theme="standard"][data-fc-page-light], [data-fc-theme="standard-dark"][data-fc-page-dark]) {
    --rz-body-background-color: var(--fc-page-pick);
    --rz-text-title-color: var(--adm-on);
    --rz-text-color: color-mix(in srgb, var(--adm-on) 86%, var(--fc-page-pick));
    --rz-text-secondary-color: color-mix(in srgb, var(--adm-on) 68%, var(--fc-page-pick));
    --rz-text-tertiary-color: color-mix(in srgb, var(--adm-on) 56%, var(--fc-page-pick));
    --rz-text-disabled-color: color-mix(in srgb, var(--adm-on) 42%, var(--fc-page-pick));
    --rz-header-background-color: var(--rz-base-background-color);
    --rz-grid-header-background-color: color-mix(in srgb, var(--adm-on) 4%, var(--rz-base-background-color));
    --rz-grid-header-sorted-background-color: var(--rz-grid-header-background-color);
    --rz-grid-frozen-cell-background-color: var(--rz-base-background-color);
    --rz-switch-background-color: color-mix(in srgb, var(--adm-on) 26%, var(--rz-base-background-color));
}
html:is([data-fc-theme="standard"][data-fc-page-light="light"], [data-fc-theme="standard-dark"][data-fc-page-dark="light"]) {
    --adm-on: var(--rz-base-900);
    --rz-base-background-color: color-mix(in srgb, var(--rz-white) 72%, var(--fc-page-pick));
}
html:is([data-fc-theme="standard"][data-fc-page-light="dark"], [data-fc-theme="standard-dark"][data-fc-page-dark="dark"]) {
    --adm-on: var(--rz-base-50);
    --rz-base-background-color: color-mix(in srgb, var(--rz-base-50) 6%, var(--fc-page-pick));
}
/* Raised and sunken surfaces. Both sheets draw the raised ones from one base step (standard base-200, standard-dark base-700:
   tabs, pager, chips, grid foot, the Base button) and the sunken ones from another (base-100 / base-800 and -900: filled
   fields, filters, flat cards, stripes). Those steps also colour the sidebars, so their users are set here one by one. */
html:is([data-fc-theme="standard"][data-fc-page-light], [data-fc-theme="standard-dark"][data-fc-page-dark]) {
    --adm-raised: color-mix(in srgb, var(--adm-on) 11%, var(--rz-base-background-color));
    --adm-sunken: color-mix(in srgb, var(--adm-on) 4%, var(--rz-base-background-color));
    --rz-tabs-tab-background-color: var(--adm-raised);
    --rz-pager-back-button-background-color: var(--adm-raised);
    --rz-pager-next-button-background-color: var(--adm-raised);
    --rz-pager-numeric-button-background-color: var(--adm-raised);
    --rz-pager-numeric-button-hover-background-color: var(--adm-raised);
    --rz-grid-foot-background-color: var(--adm-raised);
    --rz-fieldset-toggle-background-color: var(--adm-raised);
    --rz-progressbar-background-color: var(--adm-raised);
    --rz-chip-background-color: var(--adm-raised);
    --rz-button-base-background-color: var(--adm-raised);
    --rz-button-base-color: var(--rz-text-color);
    --rz-form-field-filled-background-color: var(--adm-sunken);
    --rz-grid-filter-background-color: var(--adm-sunken);
    --rz-grid-filter-buttons-background-color: var(--adm-sunken);
    --rz-card-flat-background-color: var(--adm-sunken);
    --rz-input-disabled-background-color: var(--adm-sunken);
    --rz-grid-stripe-background-color: var(--adm-sunken);
    --rz-grid-detail-template-background-color: var(--adm-sunken);
    --rz-overlay-background-color: var(--adm-sunken);
}

/* Left rail. The menu markup is NavMenu.razor (native anchors and details elements). */
.sidebar {
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    border-right: 1px solid var(--sidebar-divider);
    transition: flex-basis var(--transition-speed) ease, width var(--transition-speed) ease;
    display: flex;
    flex-direction: column;
    z-index: 5;
}

.adm-nav-menu { padding: 0 0 .25rem; color: var(--sidebar-text); }
.adm-nav-menu .rz-text-subtitle2 { color: var(--sidebar-section); font-size: .68rem; letter-spacing: .08em; }
.adm-nav-menu .nav-section { margin: .35rem 0 .15rem 1rem; line-height: 1.2; }
.adm-nav-menu .nav-divider { margin: .35rem 0; }
/* T705 (operator 2026-11-11, "more compact … so that we don't need scroll bar"): 34px rows, so the expanded menu fits a
   950px-tall window. border-box keeps the row at its min-height; Radzen's icons are .rzi (never .rz-icon). */
.nav-item, .nav-group > summary {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: .7rem;
    min-height: 2.125rem;
    padding: .2rem 1rem .2rem calc(1rem - 3px);
    line-height: 1.25;
    border-left: 3px solid transparent;
    color: var(--sidebar-text);
    font-size: .9rem;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}
.nav-group > summary { list-style: none; }
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary::after {
    content: "";
    flex: 0 0 auto;
    width: .4rem;
    height: .4rem;
    margin-left: auto;
    border-right: 2px solid var(--sidebar-section);
    border-bottom: 2px solid var(--sidebar-section);
    transform: rotate(-45deg);
    transition: transform var(--transition-speed) ease;
}
.nav-group[open] > summary::after { transform: rotate(45deg); }
.nav-item > .rzi, .nav-group > summary > .rzi { flex: 0 0 1.15rem; font-size: 1.15rem; color: var(--sidebar-section); }
.nav-item:hover, .nav-group > summary:hover { background-color: var(--sidebar-hover); color: var(--sidebar-text); }
.nav-group[open] { background-color: var(--sidebar-group-active-bg); }
.sidebar:not(.sidebar-collapsed) .nav-group .nav-item { padding-left: calc(2.25rem - 3px); }
.nav-item.active { background-color: var(--sidebar-active-bg); border-left-color: var(--sidebar-active-bar); color: var(--sidebar-active-fg); font-weight: 600; }
.nav-item.active > .rzi { color: var(--sidebar-active-fg); }
.sidebar-collapsed .nav-item, .sidebar-collapsed .nav-group > summary { justify-content: center; gap: 0; padding-inline: 0; }
.sidebar-collapsed .nav-group > summary::after { display: none; }

/* Top bar: the theme's header surface and ink in both themes. */
.admin-topbar .rz-button.rz-variant-outlined.rz-base { color: var(--rz-header-color); box-shadow: inset 0 0 0 var(--rz-border-width) var(--adm-line); }
.admin-topbar .rz-button.rz-variant-outlined.rz-base:not(.rz-state-disabled):hover { background-color: var(--adm-hover); }
.admin-profile-menu { position: relative; }
.admin-profile-menu > summary {
    display: grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background: var(--rz-primary-lighter);
    color: var(--rz-on-primary-lighter);
    font-size: .85rem;
    font-weight: 700;
    list-style: none;
    cursor: pointer;
}
.admin-profile-menu > summary::-webkit-details-marker { display: none; }
.admin-profile-popover {
    position: absolute;
    top: calc(100% + .5rem);
    right: 0;
    z-index: 30;
    display: grid;
    gap: .65rem;
    min-width: 14rem;
    padding: .85rem 1rem;
    border: 1px solid var(--adm-line);
    border-radius: .6rem;
    background: var(--adm-surface-raised);
    color: var(--adm-ink);
    box-shadow: var(--fc-shadow-menu);
    overflow-wrap: anywhere;
}
.admin-profile-popover button {
    padding: .45rem .75rem;
    border: 1px solid var(--adm-line);
    border-radius: .4rem;
    background: transparent;
    color: var(--adm-ink);
    font: inherit;
    cursor: pointer;
}
.admin-profile-popover button:hover { background: var(--adm-hover); }

/* Native admin tables (AdmDataTable): left-aligned headers on the grid header surface, one rule per row. */
.adm-table-scroll { max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; }
.adm-table { width: 100%; border-collapse: collapse; color: var(--adm-ink); font-size: .875rem; }
.adm-table th {
    padding: .55rem .75rem;
    border-bottom: 1px solid var(--adm-line);
    background: var(--rz-grid-header-background-color);
    color: var(--adm-ink-muted);
    font-size: .78rem;
    font-weight: 600;
    text-align: left;
    white-space: nowrap;
}
.adm-table td { padding: .5rem .75rem; border-bottom: 1px solid var(--adm-line); text-align: left; vertical-align: top; }
.adm-table tbody tr:last-child td { border-bottom: 0; }
.adm-table tbody tr:hover td { background: var(--adm-hover); }
.adm-table-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: .75rem; }
.adm-table-pager { display: flex; align-items: center; justify-content: flex-end; gap: .75rem; padding-top: .6rem; color: var(--adm-ink-muted); font-size: .85rem; }
.adm-table-pager button { padding: .3rem .7rem; border: 1px solid var(--adm-line); border-radius: .4rem; background: transparent; color: var(--adm-ink); font: inherit; cursor: pointer; }
.adm-table-pager button:disabled { opacity: .5; cursor: default; }

/* Theme settings drawer (Layout/ThemeConfigDrawer.razor): a right-hand panel over a scrim, on the theme's surface. */
.theme-drawer-backdrop { position: fixed; inset: 0; z-index: var(--adm-z-panel); background: var(--fc-overlay-scrim); }
.theme-drawer {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    width: min(360px, 100vw);
    background: var(--adm-surface);
    color: var(--adm-ink);
    box-shadow: var(--fc-shadow-drawer);
    outline: none;
}
.theme-drawer-header { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .85rem 1rem; border-bottom: 1px solid var(--adm-line); }
.theme-drawer-header h2 { margin: 0; color: var(--adm-ink-title); font-size: 1.05rem; font-weight: 700; }
.theme-drawer-body { display: grid; gap: .85rem; padding: 1rem; color: var(--adm-ink-muted); font-size: .9rem; }
.theme-drawer-body p { margin: 0; }
.theme-sidebar-choice, .theme-section { display: grid; gap: .65rem; padding-top: .85rem; border-top: 1px solid var(--adm-line); }
.theme-section:first-child { padding-top: 0; border-top: 0; }
.theme-sidebar-choice h3, .theme-section h3 { margin: 0; color: var(--adm-ink-title); font-size: .92rem; }
/* T709 Q350-B: a background row: its name, the colour picker, the hex value (typed or shown; muted while it is the default)
   and its reset; the section's Reset brings all four back. */
.theme-bg-rows { display: grid; gap: .5rem; }
.theme-bg-row { display: grid; grid-template-columns: minmax(0, 1fr) 2.4rem 6rem auto; align-items: center; gap: .45rem; color: var(--adm-ink); }
.theme-bg-row label { min-width: 0; overflow: hidden; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.theme-bg-swatch { box-sizing: border-box; width: 2.4rem; height: 2rem; padding: 2px; border: 1px solid var(--adm-line); border-radius: .4rem;
    background: var(--adm-surface); cursor: pointer; }
.theme-bg-swatch::-webkit-color-swatch-wrapper { padding: 0; }
.theme-bg-swatch::-webkit-color-swatch { border: 0; border-radius: .25rem; }
.theme-bg-swatch::-moz-color-swatch { border: 0; border-radius: .25rem; }
.theme-bg-hex { box-sizing: border-box; width: 100%; min-width: 0; height: 2rem; padding: 0 .45rem; border: 1px solid var(--adm-line); border-radius: .4rem;
    color: var(--adm-ink); background: var(--rz-input-background-color, var(--adm-surface)); font-family: var(--fc-mono); font-size: .8rem; }
.theme-bg-row:not(.is-picked) .theme-bg-hex { color: var(--adm-ink-muted); }
.theme-bg-swatch:focus-visible, .theme-bg-hex:focus { outline: 2px solid var(--rz-primary); outline-offset: 1px; }
.theme-bg-row .rz-button { width: 2rem; height: 2rem; min-width: 2rem; padding: 0; }
.theme-bg-reset { justify-self: end; }
.theme-sidebar-switch { display: flex; align-items: center; justify-content: space-between; gap: .75rem; color: var(--adm-ink); font-weight: 600; }

/* Drawers sit above the grid's sticky header and frozen columns (both carry z-index 1-2; --rz-sidebar-z is 1). */
.fc-admin-resizable-drawer.rz-sidebar { z-index: var(--adm-z-drawer); box-shadow: var(--fc-shadow-drawer); }
/* Radzen's toasts (z-index 1002) above the modals and drawers, so a save inside a modal still shows its result. */
html .rz-notification { z-index: var(--adm-z-toast); }

/* The admin dialog (Components/AdmApiKeyIssue.razor: .fc-dialog-backdrop > .fc-dialog > .fc-dialog-content +
   .fc-dialog-actions). It had no styles at all, so it opened as a block inside the page. A scrim over the whole window
   at the modal level, the card centred on the viewport, its body scrolling and its actions in view. */
.fc-dialog-backdrop { position: fixed; inset: 0; z-index: var(--adm-z-modal); display: grid; place-items: center; padding: 2vh 2vw; background: var(--fc-overlay-scrim); }
.fc-dialog { display: flex; flex-direction: column; width: min(40rem, 96vw); max-height: 94vh; overflow: hidden; color: var(--adm-ink); background: var(--adm-surface); border: 1px solid var(--adm-line); border-radius: 12px; box-shadow: var(--fc-shadow-menu); outline: none; }
.fc-dialog.fc-dialog-small { width: min(32rem, 96vw); }
.fc-dialog-content { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 1.1rem 1.25rem; }
.fc-dialog-actions { display: flex; flex: 0 0 auto; justify-content: flex-end; gap: .5rem; padding: .75rem 1.25rem; border-top: 1px solid var(--adm-line); background: var(--adm-surface); }

/* Stacked-cell grids (Accounts, Pairs …). Radzen lays a grid out fixed, sharing the width equally, so thirteen stacked
   columns got about 74px each and every value broke one character per line. A grid holding stacked cells sizes its
   columns to their content and scrolls sideways inside its own frame instead. */
.adm-grid-scroll .rz-grid-table:has(.fc-admin-stack) { table-layout: auto; width: max-content; min-width: 100%; }
.adm-grid-scroll .rz-grid-table:has(.fc-admin-stack) .fc-admin-stack-value { overflow-wrap: normal; white-space: nowrap; }

/* Form fields: the helper line is a caption in muted ink, the required error a caption in the danger ink. */
.rz-form-field-helper { color: var(--adm-ink-muted); font-size: .78rem; line-height: 1.35; }
/* Radzen's danger alone reads 4.2:1 on white; mixed toward the theme's ink it clears 4.5:1 in both themes. */
.adm-field-error { display: block; margin-top: .25rem; color: color-mix(in srgb, var(--rz-danger) 75%, var(--rz-text-color)); font-size: .78rem; }

/* Number fields (T709, operator 2026-11-16: FinQuest's admin settings fields). AdmNumeric right-aligns the value and shows a
   decimal at 0.000; the unit sits inside the field's border: a Prefix in a small box before the value (× a multiplier, # a
   count), a Suffix in muted ink after it at the right (%, days, USD). A number typed as text (AdmTextBox Numeric) lines up the
   same way. Digits are tabular, so a column of fields reads down its decimal points. */
.adm-numeric .rz-numeric-input, .adm-text-numeric .rz-textbox { text-align: right; font-variant-numeric: tabular-nums; }
/* A box never shrinks below its number: AdmNumeric sets --adm-num-ch, the characters of the widest value it may hold
   (Min / Max digits and the places shown), so a table cell keeps its value whole without a fixed wide box. A dense field
   (a table cell) has no up / down buttons, so it keeps no gutter for them either. */
.adm-numeric .rz-numeric { min-width: calc(var(--adm-num-ch, 8) * 1ch + 1.75rem); }
.adm-numeric .rz-numeric.rz-dense { min-width: calc(var(--adm-num-ch, 8) * 1ch + .5rem); }
.adm-numeric .rz-numeric.rz-dense .rz-numeric-input { padding-inline: .25rem; }
/* A dense field's unit sits close: a .3rem edge, a 1.25rem prefix box. */
.adm-numeric-dense .rz-form-field-content .rz-form-field-start { padding-inline: .3rem 0; }
.adm-numeric-dense .rz-form-field-content .rz-form-field-end { padding-inline: 0 .3rem; }
.adm-numeric-dense .adm-affix-box { min-width: 1.25rem; height: 1.25rem; padding: 0 .25rem; }
.adm-affix { display: inline-flex; align-items: center; justify-content: center; color: var(--adm-ink-muted); font-size: .8rem; font-weight: 600; line-height: 1; white-space: nowrap; }
.adm-affix-box { box-sizing: border-box; min-width: 1.5rem; height: 1.5rem; padding: 0 .35rem; border: 1px solid var(--adm-line); border-radius: .3rem; background: var(--adm-surface-tint); }
.adm-affix-text { padding-inline-start: .1rem; }

/* Object picker (Components/AdmObjectPicker.razor): a native input styled as a Radzen input, with its option list. */
.adm-object-picker { position: relative; display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.adm-object-picker-label { color: var(--adm-ink-muted); font-size: .78rem; font-weight: 600; }
.adm-object-picker-control { position: relative; display: flex; align-items: center; }
.adm-object-picker-input {
    box-sizing: border-box;
    width: 100%;
    height: var(--rz-input-height, 2.5rem);
    padding: 0 2rem 0 .75rem;
    border: 1px solid var(--adm-line);
    border-radius: var(--rz-input-border-radius, .25rem);
    background: var(--rz-input-background-color, var(--adm-surface));
    color: var(--adm-ink);
    font: inherit;
}
.adm-object-picker-input::placeholder { color: var(--adm-ink-muted); opacity: 1; }
.adm-object-picker-input:focus { border-color: var(--rz-primary); outline: var(--rz-outline-focus); outline-offset: 0; }
.adm-object-picker-input:disabled { opacity: .6; }
.adm-object-picker-clear { position: absolute; right: .35rem; padding: .1rem .35rem; border: 0; border-radius: .3rem; background: transparent; color: var(--adm-ink-muted); font-size: 1.1rem; line-height: 1; cursor: pointer; }
.adm-object-picker-clear:hover { background: var(--adm-hover); color: var(--adm-ink); }
.adm-object-picker-error { color: color-mix(in srgb, var(--rz-danger) 75%, var(--rz-text-color)); font-size: .78rem; }
.adm-object-picker-options {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1200;
    min-width: 100%;
    max-height: 18rem;
    margin: .25rem 0 0;
    padding: .25rem;
    overflow: auto;
    list-style: none;
    border: 1px solid var(--adm-line);
    border-radius: .45rem;
    background: var(--adm-surface-raised);
    box-shadow: var(--fc-shadow-menu);
}
.adm-object-picker-options button { display: block; width: 100%; padding: .45rem .6rem; border: 0; border-radius: .3rem; background: transparent; color: var(--adm-ink); font: inherit; text-align: left; white-space: nowrap; cursor: pointer; }
.adm-object-picker-options button:hover, .adm-object-picker-options button:focus-visible { background: var(--rz-primary-lighter); color: var(--rz-on-primary-lighter); }

/* Trading filter bar (Components/AdmTradingFilters.razor): one row of equal-height controls that wraps rather than
   clipping, on a page, at 390px and inside a drawer. A picker's label becomes its placeholder here, so every control
   is one input high. */
.fc-trading-filters { min-width: 0; max-width: 100%; margin-bottom: 1rem; row-gap: .5rem !important; }
.fc-trading-filters > * { flex: 0 1 auto; min-width: 0; max-width: 100%; }
.fc-trading-filters .adm-object-picker { flex: 1 1 13rem; max-width: 20rem; }
.fc-trading-filters .adm-object-picker-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.fc-trading-filters .rz-form-field { flex: 1 1 11rem; min-width: 8rem; max-width: 16rem; }
.fc-trading-filters .rz-selectbar { flex-wrap: wrap; }
.fc-trading-filters .rz-selectbar .rz-button, .fc-trading-filters > .rz-button { min-height: var(--rz-input-height, 2.5rem); }

/* Settings: the AIBot risk dial as one table (Pages/Settings/FcStgEdit.razor). */
.adm-dial-table th { vertical-align: bottom; white-space: normal; }
.adm-dial-table thead th { min-width: 9.5rem; max-width: 14rem; color: var(--adm-ink); }
.adm-dial-table thead th:first-child { min-width: 0; }
.adm-dial-table thead th > span { display: block; margin-top: .2rem; color: var(--adm-ink-muted); font-size: .72rem; font-weight: 400; line-height: 1.3; }
.adm-dial-table tbody th { padding: .5rem .75rem; color: var(--adm-ink); font-weight: 600; text-align: left; vertical-align: middle; white-space: nowrap; }
.adm-dial-table td { vertical-align: middle; }
.adm-dial-table .rz-form-field { width: 100%; margin: 0; }
.adm-dial-default { display: block; margin-top: .2rem; color: var(--adm-ink-muted); font-size: .72rem; }

/* Alerts rail panels scroll inside themselves. The last visible line fades out instead of being sliced by the panel's
   edge, and a bottom pad lets the final row scroll clear of the fade. The mask uses only alpha. */
.adm-rail-rows {
    -webkit-mask-image: linear-gradient(to bottom, black calc(100% - 1.75rem), transparent);
    mask-image: linear-gradient(to bottom, black calc(100% - 1.75rem), transparent);
    padding-bottom: 1.5rem !important;
}

/* A grid's own search box (the first field in its card) gets room for its placeholder. */
.rz-card > .rz-form-field:first-child { width: min(26rem, 100%); }

/* Cards and section heads */
.admin-stat { height: 100%; }
.adm-card-head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: .75rem; }
.adm-card-head > .rz-text { margin: 0; }
a.rz-link.adm-link-button {
    gap: .3rem;
    padding: .25rem .5rem;
    border-radius: .4rem;
    color: var(--rz-link-color);
    font-size: .85rem;
    font-weight: 600;
    white-space: nowrap;
}
a.rz-link.adm-link-button:hover { background: var(--rz-primary-lighter); }

/* Spacing and flex utilities. The pages kept MudBlazor's class names (pa-4, mb-3, d-flex, align-center …) through the
   T705 move to Radzen, which defines none of them, so every page lost its spacing. One step = .25rem, the scale of both
   MudBlazor and Radzen (rz-p-4 = 1rem). */
.d-flex { display: flex !important; }
.d-inline-flex { display: inline-flex !important; }
.d-block { display: block !important; }
.d-none { display: none !important; }
.flex-wrap { flex-wrap: wrap !important; }
.flex-column { flex-direction: column !important; }
.flex-grow-1 { flex-grow: 1 !important; min-width: 0; }
.align-center { align-items: center !important; }
.align-start { align-items: flex-start !important; }
.align-end { align-items: flex-end !important; }
.align-self-center { align-self: center !important; }
.justify-center { justify-content: center !important; }
.justify-end { justify-content: flex-end !important; }
.justify-space-between { justify-content: space-between !important; }
.mx-auto { margin-inline: auto !important; }
.ml-auto { margin-left: auto !important; }
.pa-0 { padding: 0rem !important; }
.pa-1 { padding: 0.25rem !important; }
.pa-2 { padding: 0.5rem !important; }
.pa-3 { padding: 0.75rem !important; }
.pa-4 { padding: 1rem !important; }
.pa-5 { padding: 1.25rem !important; }
.pa-6 { padding: 1.5rem !important; }
.pa-7 { padding: 1.75rem !important; }
.pa-8 { padding: 2rem !important; }
.pt-0 { padding-top: 0rem !important; }
.pt-1 { padding-top: 0.25rem !important; }
.pt-2 { padding-top: 0.5rem !important; }
.pt-3 { padding-top: 0.75rem !important; }
.pt-4 { padding-top: 1rem !important; }
.pt-5 { padding-top: 1.25rem !important; }
.pt-6 { padding-top: 1.5rem !important; }
.pt-7 { padding-top: 1.75rem !important; }
.pt-8 { padding-top: 2rem !important; }
.pb-0 { padding-bottom: 0rem !important; }
.pb-1 { padding-bottom: 0.25rem !important; }
.pb-2 { padding-bottom: 0.5rem !important; }
.pb-3 { padding-bottom: 0.75rem !important; }
.pb-4 { padding-bottom: 1rem !important; }
.pb-5 { padding-bottom: 1.25rem !important; }
.pb-6 { padding-bottom: 1.5rem !important; }
.pb-7 { padding-bottom: 1.75rem !important; }
.pb-8 { padding-bottom: 2rem !important; }
.pl-0 { padding-left: 0rem !important; }
.pl-1 { padding-left: 0.25rem !important; }
.pl-2 { padding-left: 0.5rem !important; }
.pl-3 { padding-left: 0.75rem !important; }
.pl-4 { padding-left: 1rem !important; }
.pl-5 { padding-left: 1.25rem !important; }
.pl-6 { padding-left: 1.5rem !important; }
.pl-7 { padding-left: 1.75rem !important; }
.pl-8 { padding-left: 2rem !important; }
.pr-0 { padding-right: 0rem !important; }
.pr-1 { padding-right: 0.25rem !important; }
.pr-2 { padding-right: 0.5rem !important; }
.pr-3 { padding-right: 0.75rem !important; }
.pr-4 { padding-right: 1rem !important; }
.pr-5 { padding-right: 1.25rem !important; }
.pr-6 { padding-right: 1.5rem !important; }
.pr-7 { padding-right: 1.75rem !important; }
.pr-8 { padding-right: 2rem !important; }
.px-0 { padding-left: 0rem !important; padding-right: 0rem !important; }
.px-1 { padding-left: 0.25rem !important; padding-right: 0.25rem !important; }
.px-2 { padding-left: 0.5rem !important; padding-right: 0.5rem !important; }
.px-3 { padding-left: 0.75rem !important; padding-right: 0.75rem !important; }
.px-4 { padding-left: 1rem !important; padding-right: 1rem !important; }
.px-5 { padding-left: 1.25rem !important; padding-right: 1.25rem !important; }
.px-6 { padding-left: 1.5rem !important; padding-right: 1.5rem !important; }
.px-7 { padding-left: 1.75rem !important; padding-right: 1.75rem !important; }
.px-8 { padding-left: 2rem !important; padding-right: 2rem !important; }
.py-0 { padding-top: 0rem !important; padding-bottom: 0rem !important; }
.py-1 { padding-top: 0.25rem !important; padding-bottom: 0.25rem !important; }
.py-2 { padding-top: 0.5rem !important; padding-bottom: 0.5rem !important; }
.py-3 { padding-top: 0.75rem !important; padding-bottom: 0.75rem !important; }
.py-4 { padding-top: 1rem !important; padding-bottom: 1rem !important; }
.py-5 { padding-top: 1.25rem !important; padding-bottom: 1.25rem !important; }
.py-6 { padding-top: 1.5rem !important; padding-bottom: 1.5rem !important; }
.py-7 { padding-top: 1.75rem !important; padding-bottom: 1.75rem !important; }
.py-8 { padding-top: 2rem !important; padding-bottom: 2rem !important; }
.ma-0 { margin: 0rem !important; }
.ma-1 { margin: 0.25rem !important; }
.ma-2 { margin: 0.5rem !important; }
.ma-3 { margin: 0.75rem !important; }
.ma-4 { margin: 1rem !important; }
.ma-5 { margin: 1.25rem !important; }
.ma-6 { margin: 1.5rem !important; }
.ma-7 { margin: 1.75rem !important; }
.ma-8 { margin: 2rem !important; }
.mt-0 { margin-top: 0rem !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 0.75rem !important; }
.mt-4 { margin-top: 1rem !important; }
.mt-5 { margin-top: 1.25rem !important; }
.mt-6 { margin-top: 1.5rem !important; }
.mt-7 { margin-top: 1.75rem !important; }
.mt-8 { margin-top: 2rem !important; }
.mb-0 { margin-bottom: 0rem !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 0.75rem !important; }
.mb-4 { margin-bottom: 1rem !important; }
.mb-5 { margin-bottom: 1.25rem !important; }
.mb-6 { margin-bottom: 1.5rem !important; }
.mb-7 { margin-bottom: 1.75rem !important; }
.mb-8 { margin-bottom: 2rem !important; }
.ml-0 { margin-left: 0rem !important; }
.ml-1 { margin-left: 0.25rem !important; }
.ml-2 { margin-left: 0.5rem !important; }
.ml-3 { margin-left: 0.75rem !important; }
.ml-4 { margin-left: 1rem !important; }
.ml-5 { margin-left: 1.25rem !important; }
.ml-6 { margin-left: 1.5rem !important; }
.ml-7 { margin-left: 1.75rem !important; }
.ml-8 { margin-left: 2rem !important; }
.mr-0 { margin-right: 0rem !important; }
.mr-1 { margin-right: 0.25rem !important; }
.mr-2 { margin-right: 0.5rem !important; }
.mr-3 { margin-right: 0.75rem !important; }
.mr-4 { margin-right: 1rem !important; }
.mr-5 { margin-right: 1.25rem !important; }
.mr-6 { margin-right: 1.5rem !important; }
.mr-7 { margin-right: 1.75rem !important; }
.mr-8 { margin-right: 2rem !important; }
.mx-0 { margin-left: 0rem !important; margin-right: 0rem !important; }
.mx-1 { margin-left: 0.25rem !important; margin-right: 0.25rem !important; }
.mx-2 { margin-left: 0.5rem !important; margin-right: 0.5rem !important; }
.mx-3 { margin-left: 0.75rem !important; margin-right: 0.75rem !important; }
.mx-4 { margin-left: 1rem !important; margin-right: 1rem !important; }
.mx-5 { margin-left: 1.25rem !important; margin-right: 1.25rem !important; }
.mx-6 { margin-left: 1.5rem !important; margin-right: 1.5rem !important; }
.mx-7 { margin-left: 1.75rem !important; margin-right: 1.75rem !important; }
.mx-8 { margin-left: 2rem !important; margin-right: 2rem !important; }
.my-0 { margin-top: 0rem !important; margin-bottom: 0rem !important; }
.my-1 { margin-top: 0.25rem !important; margin-bottom: 0.25rem !important; }
.my-2 { margin-top: 0.5rem !important; margin-bottom: 0.5rem !important; }
.my-3 { margin-top: 0.75rem !important; margin-bottom: 0.75rem !important; }
.my-4 { margin-top: 1rem !important; margin-bottom: 1rem !important; }
.my-5 { margin-top: 1.25rem !important; margin-bottom: 1.25rem !important; }
.my-6 { margin-top: 1.5rem !important; margin-bottom: 1.5rem !important; }
.my-7 { margin-top: 1.75rem !important; margin-bottom: 1.75rem !important; }
.my-8 { margin-top: 2rem !important; margin-bottom: 2rem !important; }
.gap-1 { gap: 0.25rem !important; }
.gap-2 { gap: 0.5rem !important; }
.gap-3 { gap: 0.75rem !important; }
.gap-4 { gap: 1rem !important; }
.gap-5 { gap: 1.25rem !important; }
.gap-6 { gap: 1.5rem !important; }

/* Error UI */
#blazor-error-ui {
    background-color: var(--error-color);
    color: var(--rz-on-danger);
    bottom: 0;
    box-shadow: var(--fc-shadow-low);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* Phones and narrow tablets: the left rail opens over the page from the top bar's menu button instead of taking a
   column (a 64px icon column left 300px for the page at 390px). */
@media (max-width: 960px) {
    .admin-shell-body > .sidebar {
        position: fixed;
        top: var(--topbar-height);
        bottom: 0;
        left: 0;
        z-index: 40;
        width: min(var(--sidebar-width), 85vw);
        box-shadow: var(--fc-shadow-menu);
    }

    .admin-shell-body > .sidebar.sidebar-collapsed { display: none; }

    /* The rail keeps Radzen's Expanded state true so its visible mini buttons never inherit inert. Its open state is an
       overlay at this width, with the main page still stopping before the alerts column. */
    .adm-rail.rz-sidebar.adm-rail-mini-state { transform: none !important; }
    .adm-rail.rz-sidebar.rz-sidebar-expanded:not(.adm-rail-mini-state) { box-shadow: var(--fc-shadow-drawer); max-width: calc(100vw - var(--adm-rail-mini-width)); }
    .admin-shell-body:has(> .adm-rail.rz-sidebar-expanded:not(.adm-rail-mini-state)) .admin-main-content { margin-right: var(--adm-rail-mini-width); }
}
.adm-not-found { display: grid; justify-items: start; gap: .75rem; width: min(100%, 42rem); margin: clamp(2rem, 8vh, 6rem) auto; padding: clamp(1.25rem, 4vw, 2.5rem); border: 1px solid var(--fc-line); border-radius: 1rem; color: var(--fc-ink); background: var(--fc-surface); }
.adm-not-found > span { color: var(--fc-accent-strong); font-size: .8rem; font-weight: 800; letter-spacing: .12em; }
.adm-not-found h1 { margin: 0; color: var(--fc-ink); font-size: clamp(1.8rem, 5vw, 2.6rem); }
.adm-not-found p { margin: 0; color: var(--fc-muted); line-height: 1.6; }
.adm-not-found a { display: inline-flex; align-items: center; min-height: 44px; margin-top: .25rem; padding: .5rem 1rem; border-radius: .6rem; color: var(--fc-accent-ink); background: var(--fc-accent); font-weight: 700; text-decoration: none; }
