/* ─── Minlink Design Tokens ─────────────────────────────────────────────── */
:root {
    --navy:     #254358;
    --steel:    #3E78A4;
    --slate:    #7C8488;
    --charcoal: #575755;
    --white:    #FFFFFF;

    --navy-dark:   #1a3042;
    --steel-light: #5b96c0;
    --bg-light:    #f5f7f9;
    --bg-mid:      #eef1f4;
    --border:      #d4dce4;

    --font: 'Montserrat', sans-serif;
    --transition: 0.25s ease;
}

/* ─── Dark mode token overrides ──────────────────────────────────────────── */
.ml-layout.dark {
    --navy:    #e7eef4;
    --steel:   #5ab4e8;
    --slate:   rgba(255,255,255,.52);
    --charcoal: #d0dde8;
    --bg-light: #112433;
    --bg-mid:   #152c3c;
    --border:   rgba(255,255,255,.10);
}

html, body {
    font-family: var(--font);
    background-color: var(--bg-light);
    color: var(--charcoal);
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: var(--steel);
    transition: color var(--transition);
}

a:hover, .btn-link:hover {
    color: var(--navy);
}

.btn-primary {
    color: var(--white);
    background-color: var(--steel);
    border-color: var(--navy);
    transition: background-color var(--transition), border-color var(--transition);
}

.btn-primary:hover {
    background-color: var(--navy);
    border-color: var(--navy-dark);
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem var(--white), 0 0 0 0.25rem var(--steel-light);
}

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--steel);
}

.invalid {
    outline: 1px solid #b71c1c;
}

.validation-message {
    color: #b71c1c;
}

#blazor-error-ui {
    color-scheme: light only;
    background: var(--bg-mid);
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

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

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.splash {
    position: fixed;
    inset: 0;
    background: linear-gradient(150deg, #1a3042 0%, #254358 55%, #1e3d54 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Montserrat', 'Helvetica Neue', sans-serif;
    z-index: 9999;
}

.splash-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
}

.splash-logo {
    width: 150px;
    height: auto;
    display: block;
    animation: splashPulse 2s ease-in-out infinite alternate;
}

@keyframes splashPulse {
    from { opacity: 0.65; transform: scale(0.96); }
    to   { opacity: 1;    transform: scale(1); }
}

.splash-tagline {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.35);
}

.splash-bar-wrap {
    width: 160px;
    height: 2px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    overflow: hidden;
}

.splash-bar-fill {
    height: 100%;
    border-radius: 2px;
    background: #3E78A4;
    width: var(--blazor-load-percentage, 0%);
    transition: width 0.15s ease;
}

code {
    color: var(--navy);
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* ─── Force Montserrat on ALL MudBlazor components ─────────────────────── */
/* MudTheme Typography generates the --mud-typography-*-family CSS variables,
   but this rule acts as a safety net for any component that inlines Roboto. */
.mud-typography,
.mud-button-root,
.mud-icon-button,
.mud-nav-link,
.mud-nav-group-title,
.mud-drawer-header,
.mud-appbar .mud-toolbar-root,
.mud-chip-content,
.mud-chip,
.mud-table-cell,
.mud-table-head-cell,
.mud-input,
.mud-input-root,
.mud-input-label,
.mud-select-input,
.mud-menu-item,
.mud-list-item-text,
.mud-dialog-title,
.mud-dialog-content,
.mud-snackbar,
.mud-paper p,
.mud-card-header-content,
.mud-tab-panel,
.mud-tabs-header,
.mud-breadcrumbs,
.mud-tooltip-root {
    font-family: var(--font) !important;
}

/* ── Admin: MudTable global polish ──────────────────────────────── */
.mud-table .mud-table-head .mud-table-cell {
    font-size: .7rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: .07em !important;
    color: #7C8488 !important;
    background: #fafbfc !important;
    border-bottom: 2px solid #e6edf3 !important;
    padding: 11px 16px !important;
}

.mud-table .mud-table-body .mud-table-cell {
    padding: 11px 16px !important;
    border-bottom: 1px solid #f3f6f9 !important;
    font-size: .88rem !important;
}

.mud-table .mud-table-body .mud-table-row:last-child > .mud-table-cell {
    border-bottom: none !important;
}

/* MudTable dark mode (admin) */
.al-root.dark .mud-table .mud-table-head .mud-table-cell {
    color: rgba(255,255,255,.40) !important;
    background: #1a3347 !important;
    border-bottom-color: rgba(255,255,255,.08) !important;
}
.al-root.dark .mud-table .mud-table-body .mud-table-cell {
    border-bottom-color: rgba(255,255,255,.05) !important;
    color: rgba(255,255,255,.82) !important;
}
.al-root.dark .mud-table-root { background: transparent !important; }
.al-root.dark .mud-table-body .mud-table-row:hover > td { background: rgba(255,255,255,.04) !important; }

/* ── Admin page utility classes ─────────────────────────────────── */
.ap-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.ap-eyebrow {
    font-size: .62rem;
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: #3E78A4;
    margin-bottom: 4px;
}

.ap-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: #254358;
    line-height: 1.2;
    margin-bottom: 3px;
}

.ap-subtitle { font-size: .83rem; color: #7C8488; }

.ap-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 0 18px; height: 40px;
    border-radius: 999px;
    background: #3E78A4; color: white;
    font-size: .83rem; font-weight: 700;
    border: none; cursor: pointer;
    font-family: var(--font);
    transition: background .16s;
    white-space: nowrap;
}
.ap-btn:hover { background: #5b96c0; }

/* ── Admin stats grid ────────────────────────────────────────────── */
.ap-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
    max-width: 900px;
}

.ap-stat {
    background: #fff;
    border: 1px solid #e6edf3;
    border-radius: 14px;
    padding: 16px 18px;
    transition: box-shadow .16s, transform .16s;
}

.ap-stat:hover { box-shadow: 0 6px 22px rgba(37,67,88,.09); transform: translateY(-1px); }

.ap-stat-icon {
    width: 36px; height: 36px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 10px;
}

.ap-stat-num {
    font-size: 1.85rem; font-weight: 800;
    color: #254358; line-height: 1;
    margin-bottom: 4px;
}

.ap-stat-label {
    font-size: .7rem; font-weight: 700;
    color: #7C8488;
    text-transform: uppercase; letter-spacing: .07em;
}

/* ── Search bar ─────────────────────────────────────────────────── */
.ap-search {
    background: #fff;
    border: 1px solid #e6edf3;
    border-radius: 14px;
    padding: 10px 16px;
    margin-bottom: 18px;
    display: flex; align-items: center; gap: 12px;
    flex-wrap: wrap;
}

/* ── Table wrapper ──────────────────────────────────────────────── */
.ap-table {
    background: #fff;
    border: 1px solid #e6edf3;
    border-radius: 16px;
    overflow-x: auto;
}

/* ── Status badges ──────────────────────────────────────────────── */
.ap-badge {
    display: inline-flex; align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: .7rem; font-weight: 700;
    white-space: nowrap;
}
.ap-badge-on      { background: #e8f5e9; color: #2e7d32; }
.ap-badge-off     { background: #f5f5f5; color: #9e9e9e; border: 1px solid #e0e0e0; }
.ap-badge-warning { background: #fff8e1; color: #e65100; }
.ap-badge-info    { background: #e3f2fd; color: #1565c0; }
.ap-badge-error   { background: #ffebee; color: #c62828; }
.ap-badge-purple  { background: #f3e5f5; color: #6a1b9a; }

/* ── Role tag (inline) ──────────────────────────────────────────── */
.ap-role {
    display: inline-flex; align-items: center;
    padding: 2px 8px; border-radius: 999px;
    font-size: .69rem; font-weight: 700;
    background: #eef4f9; color: #3E78A4;
    margin: 1px 2px;
}

/* ── Table action buttons ────────────────────────────────────────── */
.ap-actions { display: flex; gap: 4px; justify-content: flex-end; align-items: center; }

.ap-action {
    width: 36px; height: 36px;
    border-radius: 8px; border: 1px solid #e6edf3;
    background: transparent; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: #9e9e9e;
    transition: all .14s;
    font-family: var(--font);
}
.ap-action:hover          { background: #f5f7f9; color: #254358; border-color: #d4dce4; }
.ap-action.ap-edit:hover  { background: #e8f1f8; color: #3E78A4; border-color: #bcd0df; }
.ap-action.ap-warn:hover  { background: #fff8e1; color: #e65100; border-color: #ffe082; }
.ap-action.ap-ok:hover    { background: #e8f5e9; color: #2e7d32; border-color: #a5d6a7; }
.ap-action.ap-del:hover   { background: #ffebee; color: #c62828; border-color: #ffcdd2; }

/* icon color helpers */
.ic-blue   { background: #e8f1f8; color: #3E78A4; }
.ic-navy   { background: #e4eaf0; color: #254358; }
.ic-green  { background: #e8f5e9; color: #2e7d32; }
.ic-amber  { background: #fff8e1; color: #e65100; }
.ic-purple { background: #f3e5f5; color: #6a1b9a; }
.ic-slate  { background: #f0f4f7; color: #7C8488; }

/* ── Global dialog utilities ─────────────────────────────────────── */
.dlg-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Montserrat', sans-serif;
    font-size: 1rem;
    font-weight: 800;
    color: #254358;
}
.dlg-title-icon {
    width: 34px; height: 34px;
    border-radius: 10px;
    background: #eef4f9;
    color: #3E78A4;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.dlg-cancel-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 0 18px; height: 38px;
    border-radius: 999px;
    border: 1.5px solid #ccd6df;
    background: #fff; color: #7C8488;
    font-family: 'Montserrat', sans-serif;
    font-size: .83rem; font-weight: 700;
    cursor: pointer;
    transition: background .14s, border-color .14s, color .14s;
}
.dlg-cancel-btn:hover { background: #f0f4f8; border-color: #3E78A4; color: #254358; }
.dlg-cancel-btn:disabled { opacity: .5; cursor: not-allowed; }

.dlg-save-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 0 20px; height: 38px;
    border-radius: 999px;
    background: #3E78A4; color: #fff;
    border: none;
    font-family: 'Montserrat', sans-serif;
    font-size: .83rem; font-weight: 700;
    cursor: pointer;
    transition: background .14s;
}
.dlg-save-btn:hover { background: #5b96c0; }
.dlg-save-btn:disabled { opacity: .55; cursor: not-allowed; }

/* ════════════════════════════════════════════════════════════════════
   DARK MODE — global ap- overrides
   ═══════════════════════════════════════════════════════════════════ */

/* Stats */
.ml-layout.dark .ap-stat {
    background: #152c3c;
    border-color: rgba(255,255,255,.08);
    box-shadow: 0 2px 12px rgba(0,0,0,.2);
}
.ml-layout.dark .ap-stat:hover {
    box-shadow: 0 6px 22px rgba(0,0,0,.32);
}
.ml-layout.dark .ap-stat-num  { color: #e7eef4; }
.ml-layout.dark .ap-stat-label { color: rgba(255,255,255,.42); }

/* Icon color helpers */
.ml-layout.dark .ic-blue   { background: rgba(62,120,164,.22); color: #8bbfe0; }
.ml-layout.dark .ic-navy   { background: rgba(37,67,88,.35);   color: #9dc5dc; }
.ml-layout.dark .ic-green  { background: rgba(46,125,50,.22);  color: #81c784; }
.ml-layout.dark .ic-amber  { background: rgba(230,81,0,.22);   color: #ffb74d; }
.ml-layout.dark .ic-purple { background: rgba(106,27,154,.22); color: #ce93d8; }
.ml-layout.dark .ic-slate  { background: rgba(255,255,255,.07);color: rgba(255,255,255,.5); }

/* Search bar */
.ml-layout.dark .ap-search {
    background: #152c3c;
    border-color: rgba(255,255,255,.08);
}

/* Table wrapper */
.ml-layout.dark .ap-table {
    background: #152c3c;
    border-color: rgba(255,255,255,.08);
}

/* Status badges */
.ml-layout.dark .ap-badge-on      { background: rgba(46,125,50,.22);  color: #81c784; }
.ml-layout.dark .ap-badge-off     { background: rgba(255,255,255,.06); color: rgba(255,255,255,.4); border-color: rgba(255,255,255,.1); }
.ml-layout.dark .ap-badge-warning { background: rgba(230,81,0,.22);   color: #ffb74d; }
.ml-layout.dark .ap-badge-info    { background: rgba(21,101,192,.22);  color: #90caf9; }
.ml-layout.dark .ap-badge-error   { background: rgba(198,40,40,.22);   color: #ef9a9a; }
.ml-layout.dark .ap-badge-purple  { background: rgba(106,27,154,.22);  color: #ce93d8; }

/* Role tag */
.ml-layout.dark .ap-role { background: rgba(62,120,164,.18); color: #8bbfe0; }

/* Action buttons */
.ml-layout.dark .ap-action {
    border-color: rgba(255,255,255,.08);
    color: rgba(255,255,255,.35);
}
.ml-layout.dark .ap-action:hover          { background: rgba(255,255,255,.07); color: #c8dae6; border-color: rgba(255,255,255,.15); }
.ml-layout.dark .ap-action.ap-edit:hover  { background: rgba(62,120,164,.18);  color: #8bbfe0; border-color: rgba(62,120,164,.35); }
.ml-layout.dark .ap-action.ap-warn:hover  { background: rgba(230,81,0,.18);    color: #ffb74d; border-color: rgba(230,81,0,.35); }
.ml-layout.dark .ap-action.ap-ok:hover    { background: rgba(46,125,50,.18);   color: #81c784; border-color: rgba(46,125,50,.35); }
.ml-layout.dark .ap-action.ap-del:hover   { background: rgba(198,40,40,.18);   color: #ef9a9a; border-color: rgba(198,40,40,.35); }

/* Dialog utilities */
.ml-layout.dark .dlg-title       { color: #e7eef4; }
.ml-layout.dark .dlg-title-icon  { background: rgba(62,120,164,.22); color: #8bbfe0; }
.ml-layout.dark .dlg-cancel-btn  { background: transparent; border-color: rgba(255,255,255,.14); color: rgba(255,255,255,.55); }
.ml-layout.dark .dlg-cancel-btn:hover { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.25); color: rgba(255,255,255,.85); }
.ml-layout.dark .dlg-save-btn    { background: #3E78A4; }
.ml-layout.dark .dlg-save-btn:hover { background: #5b96c0; }

/* ════════════════════════════════════════════════════════════════════
   DARK MODE — al-root.dark (AdminLayout) equivalents
   ═══════════════════════════════════════════════════════════════════ */

.al-root.dark .ap-title    { color: #e7eef4; }
.al-root.dark .ap-subtitle { color: rgba(255,255,255,.45); }

.al-root.dark .ap-stat {
    background: #152c3c;
    border-color: rgba(255,255,255,.08);
}
.al-root.dark .ap-stat:hover { box-shadow: 0 6px 22px rgba(0,0,0,.32); }
.al-root.dark .ap-stat-num   { color: #e7eef4; }
.al-root.dark .ap-stat-label { color: rgba(255,255,255,.42); }

.al-root.dark .ic-blue   { background: rgba(62,120,164,.22); color: #8bbfe0; }
.al-root.dark .ic-navy   { background: rgba(37,67,88,.35);   color: #9dc5dc; }
.al-root.dark .ic-green  { background: rgba(46,125,50,.22);  color: #81c784; }
.al-root.dark .ic-amber  { background: rgba(230,81,0,.22);   color: #ffb74d; }
.al-root.dark .ic-purple { background: rgba(106,27,154,.22); color: #ce93d8; }
.al-root.dark .ic-slate  { background: rgba(255,255,255,.07); color: rgba(255,255,255,.5); }

.al-root.dark .ap-search {
    background: #152c3c;
    border-color: rgba(255,255,255,.08);
}

.al-root.dark .ap-table {
    background: #152c3c;
    border-color: rgba(255,255,255,.08);
}

.al-root.dark .ap-badge-on      { background: rgba(46,125,50,.22);  color: #81c784; }
.al-root.dark .ap-badge-off     { background: rgba(255,255,255,.06); color: rgba(255,255,255,.4); border-color: rgba(255,255,255,.1); }
.al-root.dark .ap-badge-warning { background: rgba(230,81,0,.22);   color: #ffb74d; }
.al-root.dark .ap-badge-info    { background: rgba(21,101,192,.22);  color: #90caf9; }
.al-root.dark .ap-badge-error   { background: rgba(198,40,40,.22);   color: #ef9a9a; }
.al-root.dark .ap-badge-purple  { background: rgba(106,27,154,.22);  color: #ce93d8; }

.al-root.dark .ap-role { background: rgba(62,120,164,.18); color: #8bbfe0; }

.al-root.dark .ap-action {
    border-color: rgba(255,255,255,.08);
    color: rgba(255,255,255,.35);
}
.al-root.dark .ap-action:hover          { background: rgba(255,255,255,.07); color: #c8dae6; border-color: rgba(255,255,255,.15); }
.al-root.dark .ap-action.ap-edit:hover  { background: rgba(62,120,164,.18);  color: #8bbfe0; border-color: rgba(62,120,164,.35); }
.al-root.dark .ap-action.ap-warn:hover  { background: rgba(230,81,0,.18);    color: #ffb74d; border-color: rgba(230,81,0,.35); }
.al-root.dark .ap-action.ap-ok:hover    { background: rgba(46,125,50,.18);   color: #81c784; border-color: rgba(46,125,50,.35); }
.al-root.dark .ap-action.ap-del:hover   { background: rgba(198,40,40,.18);   color: #ef9a9a; border-color: rgba(198,40,40,.35); }

.al-root.dark .dlg-title       { color: #e7eef4; }
.al-root.dark .dlg-title-icon  { background: rgba(62,120,164,.22); color: #8bbfe0; }
.al-root.dark .dlg-cancel-btn  { background: transparent; border-color: rgba(255,255,255,.14); color: rgba(255,255,255,.55); }
.al-root.dark .dlg-cancel-btn:hover { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.25); color: rgba(255,255,255,.85); }
.al-root.dark .dlg-save-btn         { background: #3E78A4; }
.al-root.dark .dlg-save-btn:hover   { background: #5b96c0; }

/* ── Responsive global (admin pages) ────────────────────────────── */
@media (max-width: 640px) {
    .ap-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .ap-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    .ap-stat-num { font-size: 1.5rem; }
    .ap-btn { width: 100%; justify-content: center; }
    .dlg-cancel-btn, .dlg-save-btn { padding: 0 14px; }
}

@media (max-width: 400px) {
    .ap-stats { grid-template-columns: 1fr; }
}
/* ════════════════════════════════════════════════════════════════════
   DARK MODE — per-page admin component classes (.al-root.dark)
   ═══════════════════════════════════════════════════════════════════ */

/* ── Forms (fm-) ─────────────────────────────────────────────────── */
.al-root.dark .fm-card { background: #152c3c; border-color: rgba(255,255,255,.08); }
.al-root.dark .fm-card-name { color: #e7eef4; }
.al-root.dark .fm-card-desc { color: rgba(255,255,255,.45); }
.al-root.dark .fm-card-icon { background: rgba(62,120,164,.22); }
.al-root.dark .fm-card-actions { border-top-color: rgba(255,255,255,.07); }

/* ── Flows (fl-) ─────────────────────────────────────────────────── */
.al-root.dark .fl-role-card { background: #152c3c; border-color: rgba(255,255,255,.08); }
.al-root.dark .fl-role-card:hover { border-color: rgba(255,255,255,.18); box-shadow: 0 6px 18px rgba(0,0,0,.3); }
.al-root.dark .fl-role-card.fl-role-selected { background: rgba(62,120,164,.22); border-color: #3E78A4; }
.al-root.dark .fl-role-icon { background: rgba(62,120,164,.22); }
.al-root.dark .fl-role-name { color: #e7eef4; }
.al-root.dark .fl-role-count { color: rgba(255,255,255,.45); }
.al-root.dark .fl-flow-card { background: #152c3c; border-color: rgba(255,255,255,.08); box-shadow: none; }
.al-root.dark .fl-flow-header { border-bottom-color: rgba(255,255,255,.07); }
.al-root.dark .fl-flow-footer { border-top-color: rgba(255,255,255,.07); }
.al-root.dark .fl-flow-name { color: #e7eef4; }
.al-root.dark .fl-step-item { color: rgba(255,255,255,.72); border-bottom-color: rgba(255,255,255,.07); }
.al-root.dark .fl-section-title { color: #e7eef4; }
.al-root.dark .fl-section-panel { background: #152c3c; border-color: rgba(255,255,255,.08); }
.al-root.dark .fl-del-btn { border-color: rgba(255,255,255,.1); color: rgba(255,255,255,.4); }

/* ── FlowRuns (fr-) ──────────────────────────────────────────────── */
.al-root.dark .fr-alert-card { background: #152c3c; border-color: rgba(255,255,255,.08); }
.al-root.dark .fr-panel-title b { color: #e7eef4; }
.al-root.dark .fr-progress-pct { color: rgba(255,255,255,.45); }
.al-root.dark .fr-date-normal { color: rgba(255,255,255,.45); }
.al-root.dark .fr-step-btn { border-color: rgba(255,255,255,.1); color: rgba(255,255,255,.6); background: rgba(255,255,255,.04); }
.al-root.dark .fr-step-btn:hover { background: rgba(62,120,164,.2); color: #8bbfe0; border-color: rgba(62,120,164,.4); }

/* ── FlowEdit (fe-) ──────────────────────────────────────────────── */
.al-root.dark .fe-title { color: #e7eef4; }
.al-root.dark .fe-back-btn,
.al-root.dark .fe-settings-btn,
.al-root.dark .fe-add-btn { background: #1a3347; border-color: rgba(255,255,255,.14); color: rgba(255,255,255,.8); }
.al-root.dark .fe-back-btn:hover,
.al-root.dark .fe-settings-btn:hover,
.al-root.dark .fe-add-btn:hover { background: rgba(255,255,255,.08); color: #fff; }
.al-root.dark .fe-step-card { background: #152c3c; border-color: rgba(255,255,255,.08); }
.al-root.dark .fe-step-title { color: #e7eef4; }
.al-root.dark .fe-step-desc { color: rgba(255,255,255,.45); }
.al-root.dark .fe-step-ref { color: rgba(255,255,255,.35); }
.al-root.dark .fe-preview-row { border-bottom-color: rgba(255,255,255,.07); }
.al-root.dark .fe-preview-row span { color: rgba(255,255,255,.55); }
.al-root.dark .fe-icon-btn { border-color: rgba(255,255,255,.1); color: rgba(255,255,255,.4); }
.al-root.dark .fe-icon-btn:hover { background: rgba(255,255,255,.07); color: #c8dae6; }
.al-root.dark .fe-panel { background: #152c3c; border-color: rgba(255,255,255,.08); }
.al-root.dark .fe-panel-title { color: #e7eef4; }

/* ── ChecklistEdit (ce-) ─────────────────────────────────────────── */
.al-root.dark .ce-panel { background: #152c3c; border-color: rgba(255,255,255,.08); }
.al-root.dark .ce-panel-eyebrow { color: #5ab4e8; }
.al-root.dark .ce-back-btn,
.al-root.dark .ce-add-btn { background: #1a3347; border-color: rgba(255,255,255,.14); color: rgba(255,255,255,.8); }
.al-root.dark .ce-back-btn:hover,
.al-root.dark .ce-add-btn:hover { background: rgba(255,255,255,.08); color: #fff; }
.al-root.dark .ce-item-card { background: #1a3347; border-color: rgba(255,255,255,.07); }
.al-root.dark .ce-item-title { color: #e7eef4; }
.al-root.dark .ce-item-desc { color: rgba(255,255,255,.45); }
.al-root.dark .ce-item-num { color: #5ab4e8; }
.al-root.dark .ce-icon-btn { border-color: rgba(255,255,255,.1); color: rgba(255,255,255,.4); }
.al-root.dark .ce-icon-btn:hover { background: rgba(255,255,255,.07); }

/* ── MembershipPlans (mp-) ───────────────────────────────────────── */
.al-root.dark .mp-roles-card { background: #152c3c; border-color: rgba(255,255,255,.08); }
.al-root.dark .mp-role-card { background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.1); }
.al-root.dark .mp-role-card:hover { border-color: rgba(255,255,255,.2); }
.al-root.dark .mp-role-card--selected { background: rgba(62,120,164,.22); border-color: #3E78A4; }
.al-root.dark .mp-role-name { color: #e7eef4; }
.al-root.dark .mp-role-count { color: rgba(255,255,255,.45); }
.al-root.dark .mp-plans-title { color: #e7eef4; }
.al-root.dark .mp-plan-card { background: #152c3c; border-color: rgba(255,255,255,.08); }
.al-root.dark .mp-plan-name { color: #e7eef4; }
.al-root.dark .mp-plan-desc { color: rgba(255,255,255,.45); }
.al-root.dark .mp-plan-features li { color: rgba(255,255,255,.65); }
.al-root.dark .mp-plan-price { color: #e7eef4; }
.al-root.dark .rv-section-title { color: rgba(255,255,255,.4); border-bottom-color: rgba(255,255,255,.08); }

/* ── Settings (st-) ──────────────────────────────────────────────── */
.al-root.dark .st-card { background: #152c3c; border-color: rgba(255,255,255,.08); }
.al-root.dark .st-section-title { color: #e7eef4; }
.al-root.dark .st-section-desc { color: rgba(255,255,255,.45); }
.al-root.dark .st-section-icon { background: rgba(62,120,164,.22); color: #8bbfe0; }
.al-root.dark .st-webhook-url { background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.1); color: rgba(255,255,255,.75); }
.al-root.dark .st-webhook-caption { color: rgba(255,255,255,.38); }
.al-root.dark .st-link { color: #5ab4e8; }

/* ── MeetingRequests (mr-) ───────────────────────────────────────── */
.al-root.dark .mr-chip { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.12); color: rgba(255,255,255,.72); }
.al-root.dark .mr-chip:hover { background: rgba(255,255,255,.1); }
.al-root.dark .mr-chip.active { background: rgba(62,120,164,.28); border-color: #3E78A4; color: #5ab4e8; }
.al-root.dark .mr-card { background: #152c3c; border-color: rgba(255,255,255,.08); }
.al-root.dark .mr-party-name { color: #e7eef4; }
.al-root.dark .mr-party-email,
.al-root.dark .mr-party-company,
.al-root.dark .mr-party-label { color: rgba(255,255,255,.45); }
.al-root.dark .mr-message-text { color: rgba(255,255,255,.72); }
.al-root.dark .mr-message-label { color: rgba(255,255,255,.4); }
.al-root.dark .mr-date { color: rgba(255,255,255,.45); }
.al-root.dark .mr-footer { border-top-color: rgba(255,255,255,.07); }
.al-root.dark .mr-arrow { color: rgba(255,255,255,.3); }

/* ── RoleVisibility (rv-) ────────────────────────────────────────── */
.al-root.dark .rv-card { background: #152c3c; border-color: rgba(255,255,255,.08); }
.al-root.dark .rv-helper { color: rgba(255,255,255,.45); }
.al-root.dark .rv-matrix { border-color: rgba(255,255,255,.08); }
.al-root.dark .rv-th-label,
.al-root.dark .rv-th-col { background: #1a3347; border-color: rgba(255,255,255,.08); color: rgba(255,255,255,.55); }
.al-root.dark .rv-td-row,
.al-root.dark .rv-td-cell { border-color: rgba(255,255,255,.07); }
.al-root.dark .rv-axis-label { color: rgba(255,255,255,.55); }
.al-root.dark .rv-role-chip { background: rgba(62,120,164,.2); color: #8bbfe0; border-color: rgba(62,120,164,.35); }
.al-root.dark .rv-rule-row { border-bottom-color: rgba(255,255,255,.07); }
.al-root.dark .rv-del-btn { border-color: rgba(255,255,255,.1); color: rgba(255,255,255,.4); }

/* ── Roles page (rl-/rf-) — duplicate ml-layout.dark as al-root.dark ── */
.al-root.dark .rl-role-name { color: #c8dae6; }
.al-root.dark .rl-role-code { color: rgba(255,255,255,.42); }
.al-root.dark .roles-form-card { background: #152c3c; border-color: rgba(255,255,255,.08); }
.al-root.dark .rf-card-title { color: #e7eef4; }
.al-root.dark .rf-section { color: rgba(255,255,255,.42); }
.al-root.dark .rf-section::after { background: rgba(255,255,255,.08); }
.al-root.dark .rf-cap-row { border-color: rgba(255,255,255,.07); }
.al-root.dark .rf-cap-row:hover { background: rgba(255,255,255,.05); }
.al-root.dark .rf-btn-outline { background: transparent; border-color: rgba(255,255,255,.14); color: rgba(255,255,255,.55); }
.al-root.dark .rf-btn-outline:hover { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.25); color: rgba(255,255,255,.85); }
.al-root.dark .ap-role.sys { background: rgba(62,120,164,.18); color: #8bbfe0; }

/* ── FormTemplateEdit ────────────────────────────────────────────── */
.al-root.dark .fte-panel,
.al-root.dark .field-card { background: #152c3c; border-color: rgba(255,255,255,.08); }
.al-root.dark .fte-title,
.al-root.dark .field-title { color: #e7eef4; }
.al-root.dark .fte-back-btn { background: #1a3347; border-color: rgba(255,255,255,.14); color: rgba(255,255,255,.8); }

/* ══════════════════════════════════════════════════════════
   AUTH PAGES DARK MODE  (Login · Register · ForgotPassword)
   ══════════════════════════════════════════════════════════ */

/* ── Login (lg-*) ── */
.ml-layout.dark .lg-form-panel               { background: #0e1c27; }
.ml-layout.dark .lg-card                     { background: #152c3c; border-color: rgba(255,255,255,.08); box-shadow: 0 8px 32px rgba(0,0,0,.4); }
.ml-layout.dark .lg-card-tag                 { color: #5ab4e8; border-left-color: #5ab4e8; }
.ml-layout.dark .lg-card-title               { color: #e7eef4; }
.ml-layout.dark .lg-card-sub                 { color: rgba(255,255,255,.55); }
.ml-layout.dark .lg-divider                  { border-color: rgba(255,255,255,.08) !important; }
.ml-layout.dark .lg-links a                  { color: #5ab4e8 !important; }
.ml-layout.dark .lg-links a:hover            { color: #7fcfff !important; }
.ml-layout.dark .lg-page .mud-input-control > label,
.ml-layout.dark .lg-page .mud-input-label    { color: rgba(255,255,255,.75) !important; }
.ml-layout.dark .lg-page .mud-input-outlined-border { border-color: rgba(255,255,255,.18) !important; }
.ml-layout.dark .lg-page .mud-input-slot     { background: #1a3347 !important; }
.ml-layout.dark .lg-page .mud-input-root:hover .mud-input-outlined-border,
.ml-layout.dark .lg-page .mud-input-root.mud-input-focused .mud-input-outlined-border { border-color: #5ab4e8 !important; }
.ml-layout.dark .lg-page .mud-input > input  { color: rgba(255,255,255,.88) !important; }

/* ── Register (rb-* right panel / rf-* form / role-*) ── */
.ml-layout.dark .rf-panel                    { background: #0e1c27; }
.ml-layout.dark .rf-card                     { background: #152c3c; border-color: rgba(255,255,255,.08); }
.ml-layout.dark .rf-tag                      { color: #5ab4e8; border-left-color: #5ab4e8; }
.ml-layout.dark .rf-title                    { color: #e7eef4; }
.ml-layout.dark .role-section-label          { color: rgba(255,255,255,.55); }
.ml-layout.dark .role-card                   { background: #1a3347; border-color: rgba(255,255,255,.10); }
.ml-layout.dark .role-card:hover             { border-color: #5ab4e8; background: #1e3d56; }
.ml-layout.dark .role-card.active            { background: rgba(90,180,232,.12); border-color: #5ab4e8; }
.ml-layout.dark .role-title                  { color: rgba(255,255,255,.88); }
.ml-layout.dark .role-desc                   { color: rgba(255,255,255,.50); }
.ml-layout.dark .rf-divider                  { border-color: rgba(255,255,255,.08) !important; }
.ml-layout.dark .rf-login-link               { color: rgba(255,255,255,.50); }
.ml-layout.dark .rf-login-link a             { color: #5ab4e8 !important; }
.ml-layout.dark .register-page .mud-input-control > label,
.ml-layout.dark .register-page .mud-input-label { color: rgba(255,255,255,.75) !important; }
.ml-layout.dark .register-page .mud-input-outlined-border { border-color: rgba(255,255,255,.18) !important; }
.ml-layout.dark .register-page .mud-input-slot { background: #1a3347 !important; }
.ml-layout.dark .register-page .mud-input-root:hover .mud-input-outlined-border,
.ml-layout.dark .register-page .mud-input-root.mud-input-focused .mud-input-outlined-border { border-color: #5ab4e8 !important; }
.ml-layout.dark .register-page .mud-input > input { color: rgba(255,255,255,.88) !important; }

/* ── ForgotPassword (fp-*) ── */
.ml-layout.dark .fp-form-panel               { background: #0e1c27; }
.ml-layout.dark .fp-card                     { background: #152c3c; border-color: rgba(255,255,255,.08); box-shadow: 0 8px 32px rgba(0,0,0,.4); }
.ml-layout.dark .fp-card-tag                 { color: #5ab4e8; border-left-color: #5ab4e8; }
.ml-layout.dark .fp-card-title               { color: #e7eef4; }
.ml-layout.dark .fp-card-sub                 { color: rgba(255,255,255,.55); }
.ml-layout.dark .fp-card-success-title       { color: #e7eef4; }
.ml-layout.dark .fp-card-success-sub         { color: rgba(255,255,255,.55); }
.ml-layout.dark .fp-page .mud-input-control > label,
.ml-layout.dark .fp-page .mud-input-label    { color: rgba(255,255,255,.75) !important; }
.ml-layout.dark .fp-page .mud-input-outlined-border { border-color: rgba(255,255,255,.18) !important; }
.ml-layout.dark .fp-page .mud-input-slot     { background: #1a3347 !important; }
.ml-layout.dark .fp-page .mud-input-root:hover .mud-input-outlined-border,
.ml-layout.dark .fp-page .mud-input-root.mud-input-focused .mud-input-outlined-border { border-color: #5ab4e8 !important; }
.ml-layout.dark .fp-page .mud-input > input  { color: rgba(255,255,255,.88) !important; }

/* ── MudBlazor Snackbar / Alert overrides ──────────────────────── */
.mud-snackbar-root {
    bottom: 24px !important;
    right: 24px !important;
}

.mud-snackbar {
    border-radius: 14px !important;
    box-shadow: 0 8px 32px rgba(37,67,88,.18), 0 2px 8px rgba(37,67,88,.10) !important;
    padding: 14px 18px !important;
    min-width: 280px !important;
    max-width: 400px !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    letter-spacing: 0.01em !important;
    border: 1.5px solid transparent !important;
    backdrop-filter: blur(6px) !important;
}

/* Info — brand steel blue */
.mud-snackbar.mud-theme-info {
    background: linear-gradient(135deg, #2b5f82 0%, #3E78A4 100%) !important;
    border-color: rgba(90,180,232,.30) !important;
    color: #fff !important;
}

/* Success — refined green */
.mud-snackbar.mud-theme-success {
    background: linear-gradient(135deg, #2e6b47 0%, #3a8a5a 100%) !important;
    border-color: rgba(100,200,130,.30) !important;
    color: #fff !important;
}

/* Warning — warm amber */
.mud-snackbar.mud-theme-warning {
    background: linear-gradient(135deg, #8a5a1a 0%, #c07d28 100%) !important;
    border-color: rgba(220,160,60,.30) !important;
    color: #fff !important;
}

/* Error — deep red */
.mud-snackbar.mud-theme-error {
    background: linear-gradient(135deg, #7a1f1f 0%, #a83232 100%) !important;
    border-color: rgba(220,80,80,.30) !important;
    color: #fff !important;
}

/* Close button */
.mud-snackbar .mud-snackbar-close {
    color: rgba(255,255,255,.80) !important;
    padding: 4px !important;
}
.mud-snackbar .mud-snackbar-close:hover {
    color: #fff !important;
    background: rgba(255,255,255,.12) !important;
    border-radius: 50% !important;
}

/* Message text */
.mud-snackbar .mud-snackbar-message {
    font-weight: 500 !important;
    line-height: 1.4 !important;
}

/* Action button inside snackbar */
.mud-snackbar .mud-button-root {
    color: rgba(255,255,255,.90) !important;
    font-weight: 700 !important;
    border-radius: 8px !important;
    border: 1px solid rgba(255,255,255,.30) !important;
    padding: 2px 12px !important;
}
.mud-snackbar .mud-button-root:hover {
    background: rgba(255,255,255,.15) !important;
    border-color: rgba(255,255,255,.55) !important;
}

/* Dark mode — snackbars already have colored backgrounds so
   they look fine; just ensure the container doesn't interfere */
.ml-layout.dark .mud-snackbar,
.al-root.dark .mud-snackbar {
    box-shadow: 0 8px 40px rgba(0,0,0,.40), 0 2px 10px rgba(0,0,0,.25) !important;
}
