@import '/_content/Microsoft.FluentUI.AspNetCore.Components/css/reboot.css';

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif;
    font-size: 14px;
    color: #111827;
    background: #f9fafb;
    height: 100dvh;
}

/* ── App shell ─────────────────────────────────────── */
.al-root { display: flex; flex-direction: column; height: 100dvh; }

.al-header {
    display: flex;
    align-items: center;
    height: 52px;
    background: white;
    border-bottom: 1px solid #e5e7eb;
    padding: 0 20px;
    flex-shrink: 0;
    gap: 12px;
}

.al-brand { display: flex; align-items: center; gap: 9px; text-decoration: none; }
.al-brand-icon {
    width: 28px; height: 28px;
    background: #6366f1; border-radius: 7px;
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 13px; font-weight: 800; flex-shrink: 0;
}
.al-brand-name { font-size: 15px; font-weight: 700; color: #111827; letter-spacing: -.02em; }
.al-spacer { flex: 1; }

.al-company-badge {
    display: flex; align-items: center; gap: 6px;
    padding: 4px 10px;
    background: #f3f4f6; border: 1px solid #e5e7eb; border-radius: 6px;
    font-size: 12px; color: #4b5563; font-weight: 500;
}
.al-company-dot { width: 6px; height: 6px; border-radius: 50%; background: #22c55e; flex-shrink: 0; }

/* Company switcher (native <details> dropdown) */
.al-company-switch { position: relative; }
.al-company-switch > summary { list-style: none; cursor: pointer; user-select: none; }
.al-company-switch > summary::-webkit-details-marker { display: none; }
.al-company-badge-btn { transition: background 0.12s, border-color 0.12s; }
.al-company-badge-btn:hover { background: #e5e7eb; border-color: #d1d5db; }
.al-company-current { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.al-company-caret { color: #9ca3af; transition: transform 0.15s; flex-shrink: 0; }
.al-company-switch[open] > summary .al-company-caret { transform: rotate(180deg); }

.al-company-menu {
    position: absolute; top: calc(100% + 6px); right: 0; z-index: 100;
    min-width: 240px; max-height: 360px; overflow-y: auto;
    background: #fff; border: 1px solid #e5e7eb; border-radius: 10px;
    box-shadow: 0 10px 30px -8px rgba(0,0,0,0.18), 0 2px 6px -2px rgba(0,0,0,0.08);
    padding: 6px;
}
.al-company-menu-head {
    font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
    color: #9ca3af; padding: 6px 10px 8px;
}
.al-company-item {
    display: flex; align-items: center; gap: 9px;
    padding: 8px 10px; border-radius: 7px; text-decoration: none;
    color: #374151; transition: background 0.1s;
}
.al-company-item:hover { background: #f3f4f6; }
.al-company-item-on { background: #f9fafb; }
.al-company-item-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.al-company-item-name { font-size: 13px; font-weight: 500; color: #18181b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.al-company-item-id { font-size: 11px; color: #9ca3af; font-family: ui-monospace, Consolas, monospace; }
.al-company-check { color: #22c55e; flex-shrink: 0; }

.al-body { display: flex; flex: 1; overflow: hidden; }

.al-main { flex: 1; overflow-y: auto; background: #f9fafb; padding: 20px 24px; }

.al-footer {
    display: flex; align-items: center; height: 36px;
    background: white; border-top: 1px solid #e5e7eb;
    padding: 0 20px; flex-shrink: 0;
    font-size: 11.5px; color: #9ca3af;
}

/* ── Error / Blazor UI ──────────────────────────────── */
#blazor-error-ui {
    background: lightyellow;
    bottom: 0; box-shadow: 0 -1px 2px rgba(0,0,0,.2);
    display: none; left: 0;
    padding: 0.6rem 1.25rem 0.7rem;
    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: #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}
.blazor-error-boundary::before { content: "An error has occurred. "; }

.loading-progress {
    position: relative; display: block;
    width: 8rem; height: 8rem;
    margin: 20vh auto 1rem;
}
.loading-progress circle {
    fill: none; stroke: #e0e0e0; stroke-width: 0.6rem;
    transform-origin: 50% 50%; transform: rotate(-90deg);
}
.loading-progress circle:last-child {
    stroke: #6366f1;
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}
.loading-progress-text {
    position: absolute; text-align: center; font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}
.loading-progress-text:after { content: var(--blazor-load-percentage-text, "Loading"); }

/* ── Mobile hamburger ───────────────────────────────── */
.al-hamburger {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    border: none; background: none; cursor: pointer;
    border-radius: 7px; color: #374151; margin-left: 4px;
}
.al-hamburger:hover { background: #f3f4f6; }

@media (max-width: 767px) {
    .al-hamburger { display: flex; }
    .al-main { padding: 14px 16px; }
}



/*body {
    --body-font: "Segoe UI Variable", "Segoe UI", sans-serif;
    font-family: var(--body-font);
    font-size: var(--type-ramp-base-font-size);
    line-height: var(--type-ramp-base-line-height);
    margin: 0;
}*/

body {
    margin: 0;
    padding: 0;
    height: 100vh;
    font-family: var(--body-font);
    font-size: var(--type-ramp-base-font-size);
    font-size: 13px;
    line-height: var(--type-ramp-base-line-height);
    font-weight: var(--font-weight);
    color: var(--neutral-foreground-rest);
    background: var(--neutral-fill-layer-rest);
}


:root {
    /* Light theme variables */
    --bg-color: #fafafa;
    --container-bg: white;
    --header-bg: #F0F2F6;
    --header-color: #0E1117;
    --text-color: #31333F;
    --border-color: #E6E9EF;
    --hover-bg: #F8F9FB;
    --row-alt-bg: #FAFAFA;
    --shadow-color: rgba(0, 0, 0, 0.1);
}

/* Dark theme variables */
[data-theme="dark"] {
    --bg-color: #0E1117;
    --container-bg: #1E2025;
    --header-bg: #262730;
    --header-color: #FAFAFA;
    --text-color: #E6E9EF;
    --border-color: #3B3F4B;
    --hover-bg: #2D303A;
    --row-alt-bg: #262730;
    --shadow-color: rgba(0, 0, 0, 0.3);
}



.navmenu-icon {
    display: none;
}

.main {
    min-height: calc(100dvh - 86px);
    color: var(--neutral-foreground-rest);
    align-items: stretch !important;
}

.body-content {
    align-self: stretch;
    height: calc(100dvh - 86px) !important;
    display: flex;
    background-color: #e7e7e7;
}

.content {
    padding: 0.5rem 1.5rem;
    align-self: stretch !important;
    width: 100%;
}

.manage {
    width: 100dvw;
}

footer {
    background: var(--neutral-layer-4);
    color: var(--neutral-foreground-rest);
    align-items: center;
    padding: 10px 10px;
}

    footer a {
        color: var(--neutral-foreground-rest);
        text-decoration: none;
    }

        footer a:focus {
            outline: 1px dashed;
            outline-offset: 3px;
        }

        footer a:hover {
            text-decoration: underline;
        }

.alert {
    border: 1px dashed var(--accent-fill-rest);
    padding: 5px;
}


#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    margin: 20px 0;
}

    #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::before {
        content: "An error has occurred. "
    }

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

code {
    color: #c02d76;
}

@media (max-width: 600px) {
    .header-gutters {
        margin: 0.5rem 3rem 0.5rem 1.5rem !important;
    }

    [dir="rtl"] .header-gutters {
        margin: 0.5rem 1.5rem 0.5rem 3rem !important;
    }

    .main {
        flex-direction: column !important;
        row-gap: 0 !important;
    }

    nav.sitenav {
        width: 100%;
        height: 100%;
    }

    #main-menu {
        width: 100% !important;
    }

        #main-menu > div:first-child:is(.expander) {
            display: none;
        }

    .navmenu {
        width: 100%;
    }

    #navmenu-toggle {
        appearance: none;
    }

        #navmenu-toggle ~ nav {
            display: none;
        }

        #navmenu-toggle:checked ~ nav {
            display: block;
        }

    .navmenu-icon {
        cursor: pointer;
        z-index: 10;
        display: block;
        position: absolute;
        top: 15px;
        left: unset;
        right: 20px;
        width: 20px;
        height: 20px;
        border: none;
    }

    [dir="rtl"] .navmenu-icon {
        left: 20px;
        right: unset;
    }
}



.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
}
/* ── Datasets Redesign (shadcn-inspired) ────────────── */

.ds-page { display: flex; flex-direction: column; gap: 1.5rem; }

.ds-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.ds-title { font-size: 1.5rem; font-weight: 600; color: #18181b; margin: 0 0 0.25rem 0; letter-spacing: -0.025em; }
.ds-subtitle { font-size: 0.875rem; color: #71717a; margin: 0; }

.ds-card { background: #ffffff; border: 1px solid #e4e4e7; border-radius: 0.5rem; overflow: hidden; }
.ds-card-toolbar { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 1rem; border-bottom: 1px solid #e4e4e7; }
.ds-search-wrap { position: relative; flex: 1; max-width: 320px; }
.ds-search-icon { position: absolute; left: 0.625rem; top: 50%; transform: translateY(-50%); color: #71717a; pointer-events: none; }
.ds-search { width: 100%; padding: 0.4375rem 0.75rem 0.4375rem 2.125rem; font-size: 0.875rem; border: 1px solid #e4e4e7; border-radius: 0.375rem; background: #ffffff; color: #18181b; outline: none; transition: border-color 0.15s, box-shadow 0.15s; }
.ds-search:focus { border-color: #18181b; box-shadow: 0 0 0 2px rgba(24,24,27,0.1); }

.ds-table-wrap { overflow-x: auto; }
.ds-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.ds-th { padding: 0.625rem 1rem; text-align: left; font-size: 0.75rem; font-weight: 500; color: #71717a; border-bottom: 1px solid #e4e4e7; white-space: nowrap; background: #fafafa; user-select: none; }
.ds-th-sortable { cursor: pointer; }
.ds-th-sortable:hover { color: #18181b; }
.ds-th span, .ds-th svg { vertical-align: middle; }
.ds-th-actions { text-align: right; }
.ds-tr { border-bottom: 1px solid #f4f4f5; transition: background 0.1s; }
.ds-tr:last-child { border-bottom: none; }
.ds-tr:hover { background: #fafafa; }
.ds-td { padding: 0.75rem 1rem; color: #18181b; vertical-align: middle; }
.ds-stat { font-size: 0.75rem; color: #52525b; font-variant-numeric: tabular-nums; }
.ds-td-name { font-weight: 500; }
.ds-dataset-name { display: block; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-dataset-desc { display: block; max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #71717a; }
.ds-td-date { color: #71717a; white-space: nowrap; }
.ds-td-actions-cell { text-align: right; }
.ds-actions { display: flex; align-items: center; justify-content: flex-end; gap: 0.25rem; }
.ds-tr-clickable { cursor: pointer; }

/* Right-click row context menu (datasets/tables lists) — mirrors the row's own action buttons. */
.ctx-backdrop { position: fixed; inset: 0; z-index: 900; background: transparent; }
.ctx-menu {
    position: fixed; z-index: 901; min-width: 200px; background: #fff; border: 1px solid #e4e4e7;
    border-radius: 10px; box-shadow: 0 12px 32px rgba(0,0,0,0.16), 0 2px 8px rgba(0,0,0,0.06);
    padding: 0.3rem; overflow: hidden;
}
.ctx-item {
    display: flex; align-items: center; gap: 0.55rem; width: 100%; text-align: left; background: none;
    border: none; padding: 0.5rem 0.6rem; border-radius: 6px; font-size: 0.8125rem; color: #27272a;
    cursor: pointer; white-space: nowrap;
}
.ctx-item:hover { background: #f4f4f5; }
.ctx-item svg { flex-shrink: 0; color: #71717a; }
.ctx-item-danger { color: #b91c1c; }
.ctx-item-danger svg { color: #b91c1c; }
.ctx-item-danger:hover { background: #fef2f2; }
.ctx-sep { height: 1px; background: #f4f4f5; margin: 0.25rem 0.3rem; }

.ds-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 5rem 0; gap: 0.75rem; color: #71717a; font-size: 0.875rem; }
.ds-spinner { width: 28px; height: 28px; border: 2px solid #e4e4e7; border-top-color: #18181b; border-radius: 50%; animation: ds-spin 0.7s linear infinite; display: inline-block; }
@keyframes ds-spin { to { transform: rotate(360deg); } }

.ds-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 5rem 0; gap: 0.75rem; text-align: center; }
.ds-empty-icon { color: #d4d4d8; margin-bottom: 0.25rem; }
.ds-empty-title { font-size: 0.9375rem; font-weight: 600; color: #18181b; margin: 0; }
.ds-empty-sub { font-size: 0.875rem; color: #71717a; margin: 0; max-width: 320px; }

.ds-pagination { display: flex; align-items: center; justify-content: space-between; padding: 0.625rem 1rem; border-top: 1px solid #e4e4e7; font-size: 0.8125rem; color: #71717a; }
.ds-page-btns { display: flex; align-items: center; gap: 0.25rem; }

.btn { display: inline-flex !important; align-items: center !important; gap: 0.375rem; padding: 0 0.875rem !important; height: 2.25rem; font-size: 0.875rem !important; font-weight: 500 !important; border-radius: 0.375rem !important; border: 1px solid transparent !important; cursor: pointer; transition: background 0.15s, border-color 0.15s, color 0.15s; font-family: inherit; white-space: nowrap; text-decoration: none !important; }
.btn:focus-visible { outline: 2px solid #18181b; outline-offset: 2px; }
.btn:disabled { opacity: 0.5; pointer-events: none; }
.btn-default { background: #18181b !important; color: #ffffff !important; border-color: #18181b !important; }
.btn-default:hover { background: #27272a !important; }
.btn-outline { background: transparent !important; color: #18181b !important; border-color: #e4e4e7 !important; }
.btn-outline:hover { background: #f4f4f5 !important; }
.btn-ghost { background: transparent !important; color: #18181b !important; border-color: transparent !important; }
.btn-ghost:hover { background: #f4f4f5 !important; }
.btn-destructive { background: #ef4444 !important; color: #ffffff !important; border-color: #ef4444 !important; }
.btn-destructive:hover { background: #dc2626 !important; }

.btn-icon { display: inline-flex !important; align-items: center !important; justify-content: center !important; width: 2rem; height: 2rem; border-radius: 0.375rem !important; border: 1px solid transparent !important; background: transparent !important; cursor: pointer; color: #71717a; transition: background 0.15s, color 0.15s; padding: 0 !important; }
.btn-icon:hover { background: #f4f4f5 !important; color: #18181b; }
.btn-icon-open:hover { color: #16a34a !important; }
.btn-icon-share:hover { color: #3b82f6 !important; }
.btn-icon-edit:hover { color: #6366f1 !important; }
.btn-icon-delete:hover { color: #ef4444 !important; }

.btn-page { display: inline-flex !important; align-items: center !important; justify-content: center !important; min-width: 2rem; height: 2rem; padding: 0 0.375rem !important; border-radius: 0.375rem !important; border: 1px solid transparent !important; background: transparent !important; color: #71717a; font-size: 0.8125rem; cursor: pointer; transition: background 0.15s, color 0.15s; font-family: inherit; }
.btn-page:hover:not(:disabled) { background: #f4f4f5 !important; color: #18181b; }
.btn-page-active { background: #18181b !important; color: #ffffff !important; border-color: #18181b !important; }
.btn-page:disabled { opacity: 0.4; cursor: default; }

.ds-form-page { max-width: 760px; }
.ds-form-card { background: #ffffff; border: 1px solid #e4e4e7; border-radius: 0.5rem; padding: 1.5rem; }
.ds-breadcrumb { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8125rem; color: #71717a; margin-bottom: 1.25rem; }
.ds-breadcrumb a { color: #71717a; text-decoration: none !important; }
.ds-breadcrumb a:hover { color: #18181b; }
.ds-breadcrumb-sep { color: #d4d4d8; }

.ds-field { display: flex; flex-direction: column; gap: 0.375rem; margin-bottom: 1.25rem; }
.ds-field:last-child { margin-bottom: 0; }
.ds-label { font-size: 0.875rem; font-weight: 500; color: #18181b; }
.ds-input, .ds-textarea { width: 100%; padding: 0.4375rem 0.75rem !important; font-size: 0.875rem !important; border: 1px solid #e4e4e7 !important; border-radius: 0.375rem !important; background: #ffffff !important; color: #18181b !important; outline: none; font-family: inherit; transition: border-color 0.15s, box-shadow 0.15s; box-shadow: none !important; }
.ds-input:focus, .ds-textarea:focus { border-color: #18181b !important; box-shadow: 0 0 0 2px rgba(24,24,27,0.1) !important; }
.ds-input::placeholder, .ds-textarea::placeholder { color: #a1a1aa; }
.ds-textarea { resize: vertical; min-height: 100px; line-height: 1.5; }
.ds-hint { font-size: 0.75rem; color: #71717a; }
.ds-error { font-size: 0.75rem; color: #ef4444; display: block; }
.ds-form-actions { display: flex; align-items: center; gap: 0.75rem; padding-top: 1.25rem; border-top: 1px solid #f4f4f5; margin-top: 0.25rem; }
.ds-section-title { font-size: 1rem; font-weight: 600; color: #18181b; margin: 0 0 1rem 0; }

.ds-form-layout { display: grid; grid-template-columns: 1fr 260px; gap: 1.5rem; align-items: start; }
@media (max-width: 768px) { .ds-form-layout { grid-template-columns: 1fr; } }

.ds-tip-card { background: #fafafa; border: 1px solid #e4e4e7; border-radius: 0.5rem; padding: 1rem; margin-bottom: 0.75rem; border-left: 3px solid #6366f1; }
.ds-tip-card:last-child { margin-bottom: 0; }
.ds-tip-title { font-size: 0.875rem; font-weight: 600; color: #18181b; margin: 0 0 0.375rem 0; }
.ds-tip-text { font-size: 0.8125rem; color: #71717a; margin: 0; line-height: 1.5; }

.ds-badge { display: inline-flex; align-items: center; padding: 0.125rem 0.5rem; font-size: 0.75rem; font-weight: 500; border-radius: 9999px; border: 1px solid; }
.ds-badge-viewer { background: #f0fdf4; color: #16a34a; border-color: #bbf7d0; }
.ds-badge-editor { background: #eff6ff; color: #2563eb; border-color: #bfdbfe; }
.ds-badge-admin { background: #fdf4ff; color: #9333ea; border-color: #e9d5ff; }

.ds-modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 1rem; animation: ds-fade-in 0.15s ease; }
@keyframes ds-fade-in { from { opacity: 0; } to { opacity: 1; } }
.ds-modal { background: #ffffff; border: 1px solid #e4e4e7; border-radius: 0.5rem; width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; animation: ds-slide-in 0.15s ease; }
@keyframes ds-slide-in { from { transform: translateY(-8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.ds-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 1.25rem 1.5rem; border-bottom: 1px solid #e4e4e7; }
.ds-modal-title { font-size: 1rem; font-weight: 600; color: #18181b; margin: 0; }
.ds-modal-close { display: flex; align-items: center; justify-content: center; width: 1.75rem; height: 1.75rem; border-radius: 0.375rem; border: none !important; background: transparent !important; color: #71717a; cursor: pointer; transition: background 0.15s, color 0.15s; padding: 0 !important; }
.ds-modal-close:hover { background: #f4f4f5 !important; color: #18181b; }
.ds-modal-body { padding: 1.5rem; display: flex; flex-direction: column; gap: 1rem; }
.ds-modal-footer { display: flex; gap: 0.75rem; padding-top: 1rem; }
.ds-divider { border: none; border-top: 1px solid #e4e4e7; margin: 0.5rem 0; }
.ds-select { width: 100%; padding: 0.4375rem 0.75rem !important; font-size: 0.875rem !important; border: 1px solid #e4e4e7 !important; border-radius: 0.375rem !important; background: #ffffff !important; color: #18181b !important; outline: none; font-family: inherit; cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s; }
.ds-select:focus { border-color: #18181b !important; box-shadow: 0 0 0 2px rgba(24,24,27,0.1) !important; }
.ds-user-row { display: flex; align-items: center; justify-content: space-between; padding: 0.75rem; border: 1px solid #e4e4e7; border-radius: 0.5rem; gap: 0.5rem; }
.ds-user-email { font-size: 0.875rem; font-weight: 500; color: #18181b; }
.ds-user-meta { font-size: 0.75rem; color: #71717a; }

/* -- Tables Redesign extras -------------------------------- */

.ds-col-grid-header,
.ds-col-grid-row {
    display: grid;
    grid-template-columns: 2fr 1.5fr 80px 1.5fr 44px;
    gap: 0.75rem;
    align-items: center;
    padding: 0.625rem 1rem;
}

.ds-col-grid-header {
    background: #fafafa;
    border-bottom: 1px solid #e4e4e7;
    font-size: 0.75rem;
    font-weight: 500;
    color: #71717a;
}

.ds-col-grid-row {
    border-bottom: 1px solid #f4f4f5;
}

.ds-col-grid-row:last-child {
    border-bottom: none;
}

.ds-col-grid-row:hover {
    background: #fafafa;
}

.ds-columns-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 0;
    gap: 0.75rem;
    text-align: center;
    border: 2px dashed #e4e4e7;
    border-radius: 0.5rem;
    background: #fafafa;
}

.ds-checkbox-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
}

.ds-checkbox {
    width: 1rem;
    height: 1rem;
    cursor: pointer;
    accent-color: #18181b;
}

@media (max-width: 640px) {
    .ds-col-grid-header,
    .ds-col-grid-row {
        grid-template-columns: 1fr 1fr 40px;
    }
    .ds-col-grid-header span:nth-child(n+3),
    .ds-col-grid-row > *:nth-child(n+3) {
        display: none;
    }
}

/* ── Import Redesign extras ─────────────────────────── */

.ds-stepper { display: flex; align-items: flex-start; gap: 0; margin-bottom: 2rem; }
.ds-step { display: flex; flex-direction: column; align-items: center; flex: 1; position: relative; }
.ds-step:not(:last-child)::after { content: ''; position: absolute; top: 14px; left: 50%; width: 100%; height: 2px; background: #e4e4e7; z-index: 0; }
.ds-step:not(:last-child).ds-step-done::after { background: #18181b; }
.ds-step-circle { width: 28px; height: 28px; border-radius: 50%; border: 2px solid #e4e4e7; background: #ffffff; display: flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 600; color: #71717a; z-index: 1; position: relative; transition: all 0.2s; flex-shrink: 0; }
.ds-step-active .ds-step-circle { border-color: #18181b; background: #18181b; color: #ffffff; }
.ds-step-done .ds-step-circle { border-color: #18181b; background: #18181b; color: #ffffff; }
.ds-step-label { font-size: 0.75rem; font-weight: 500; color: #71717a; margin-top: 0.375rem; text-align: center; white-space: nowrap; }
.ds-step-active .ds-step-label { color: #18181b; font-weight: 600; }
.ds-step-done .ds-step-label { color: #71717a; }

.ds-dropzone { border: 2px dashed #e4e4e7; border-radius: 0.5rem; background: #fafafa; cursor: pointer; transition: border-color 0.15s, background 0.15s; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 3rem 2rem; text-align: center; min-height: 200px; position: relative; }
.ds-dropzone:hover, .ds-dropzone.drag-over { border-color: #18181b; background: #f4f4f5; }
.ds-dropzone-success { border-color: #16a34a; background: #f0fdf4; }
.ds-dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.ds-dropzone-icon { color: #d4d4d8; margin-bottom: 0.75rem; }
.ds-dropzone-success .ds-dropzone-icon { color: #16a34a; }
.ds-dropzone-title { font-size: 0.9375rem; font-weight: 600; color: #18181b; margin: 0 0 0.25rem 0; }
.ds-dropzone-sub { font-size: 0.875rem; color: #71717a; margin: 0; }

.ds-tag { display: inline-flex; align-items: center; padding: 0.25rem 0.625rem; background: #f4f4f5; border: 1px solid #e4e4e7; border-radius: 0.375rem; font-size: 0.8125rem; color: #18181b; font-weight: 500; }

.ds-info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
@media (max-width: 640px) { .ds-info-grid { grid-template-columns: 1fr; } }
.ds-info-item { font-size: 0.8125rem; color: #71717a; }
.ds-info-item strong { color: #18181b; display: block; font-weight: 500; margin-bottom: 0.125rem; }

.ds-step-nav { display: flex; align-items: center; justify-content: space-between; padding-top: 1.25rem; border-top: 1px solid #f4f4f5; margin-top: 1.5rem; }

/* ── ViewData / DynamicTable / CommentsSidebar extras ── */

/* Table toolbar */
.dv-toolbar { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.875rem; }
.dv-search-wrap { position: relative; flex: 1; min-width: 160px; max-width: 280px; }
.dv-search-wrap svg { position: absolute; left: 0.625rem; top: 50%; transform: translateY(-50%); color: #71717a; pointer-events: none; }
.dv-search-wrap input { padding-left: 2rem !important; }
.dv-row-count { margin-left: auto; font-size: 0.8125rem; color: #71717a; white-space: nowrap; }

/* Sortable column headers */
.dv-th-sortable { cursor: pointer; user-select: none; }
.dv-th-sortable:hover { background: #f0f0f0; }
.dv-sort-icon { display: inline-flex; align-items: center; margin-left: 0.25rem; opacity: 0.45; }
.dv-th-sortable.active .dv-sort-icon { opacity: 1; }

/* Data table wrapper */
.dv-table-wrap { flex: 1; overflow: auto; border: 1px solid #e4e4e7; border-radius: 0.5rem; }
.dv-table-outer { height: 100%; display: flex; flex-direction: column; background: #fff; border-radius: 0.5rem; border: 1px solid #e4e4e7; padding: 1rem; overflow: hidden; }

/* Badge for filter count */
.dv-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #18181b; color: #fff; font-size: 0.6875rem; font-weight: 600; margin-left: 0.375rem; }

/* Comments sidebar */
.dv-comments-panel { width: 340px; flex-shrink: 0; display: flex; flex-direction: column; border-left: 1px solid #e4e4e7; background: #fafafa; overflow: hidden; }
.dv-comments-header { padding: 0.875rem 1rem; border-bottom: 1px solid #e4e4e7; background: #fff; flex-shrink: 0; }
.dv-comments-list { flex: 1; overflow-y: auto; padding: 0.75rem; }
.dv-comments-footer { padding: 0.75rem 1rem; border-top: 1px solid #e4e4e7; background: #fff; flex-shrink: 0; }
.dv-comment-item { background: #fff; border: 1px solid #e4e4e7; border-radius: 0.5rem; padding: 0.75rem; margin-bottom: 0.625rem; }
.dv-comment-avatar { width: 28px; height: 28px; border-radius: 50%; background: #18181b; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 600; flex-shrink: 0; }
.dv-textarea { width: 100%; min-height: 72px; padding: 0.5rem 0.75rem; border: 1px solid #e4e4e7; border-radius: 0.375rem; font-size: 0.875rem; font-family: inherit; resize: vertical; outline: none; transition: border-color 0.15s; }
.dv-textarea:focus { border-color: #18181b; box-shadow: 0 0 0 2px rgba(24,24,27,0.06); }

/* Dropdown menu (comment actions) */
.dv-dropdown-wrap { position: relative; }
.dv-dropdown-menu { position: absolute; right: 0; top: 100%; z-index: 50; min-width: 130px; background: #fff; border: 1px solid #e4e4e7; border-radius: 0.375rem; box-shadow: 0 4px 12px rgba(0,0,0,0.08); padding: 0.25rem; display: none; }
.dv-dropdown-wrap.open .dv-dropdown-menu { display: block; }
.dv-dropdown-item { display: flex; align-items: center; gap: 0.5rem; width: 100%; padding: 0.4375rem 0.625rem; font-size: 0.875rem; color: #18181b; background: none; border: none; border-radius: 0.25rem; cursor: pointer; text-align: left; white-space: nowrap; }
.dv-dropdown-item:hover { background: #f4f4f5; }
.dv-dropdown-item.danger { color: #ef4444; }
.dv-dropdown-item.danger:hover { background: #fef2f2; }

/* Mention dropdown */
.dv-mention-dropdown { position: absolute; left: 0; right: 0; bottom: calc(100% + 4px); z-index: 50; background: #fff; border: 1px solid #e4e4e7; border-radius: 0.375rem; box-shadow: 0 4px 12px rgba(0,0,0,0.08); max-height: 200px; overflow-y: auto; }
.dv-mention-item { padding: 0.5rem 0.75rem; cursor: pointer; border-bottom: 1px solid #f4f4f5; }
.dv-mention-item:hover { background: #f4f4f5; }
.dv-mention-item:last-child { border-bottom: none; }

/* ── Account / Manage Redesign ──────────────────────── */
.acct-shell { max-width: 940px; margin: 0 auto; padding: 4px 0 48px; }
.acct-page-head { margin-bottom: 1.5rem; }
.acct-page-title { font-size: 1.5rem; font-weight: 600; color: #18181b; margin: 0 0 0.25rem 0; letter-spacing: -0.025em; }
.acct-page-sub { font-size: 0.875rem; color: #71717a; margin: 0; }

.acct-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 1.5rem; align-items: start; }

.acct-nav { display: flex; flex-direction: column; gap: 2px; background: #ffffff; border: 1px solid #e4e4e7; border-radius: 0.5rem; padding: 0.5rem; position: sticky; top: 8px; }
.acct-nav-link { display: flex; align-items: center; gap: 0.625rem; padding: 0.5rem 0.625rem; border-radius: 0.375rem; font-size: 0.875rem; font-weight: 500; color: #52525b; text-decoration: none !important; cursor: pointer; transition: background 0.15s, color 0.15s; }
.acct-nav-link:hover { background: #f4f4f5; color: #18181b; }
.acct-nav-link.active { background: #18181b; color: #ffffff; }
.acct-nav-link svg { flex-shrink: 0; opacity: 0.85; }

.acct-content { min-width: 0; }

.acct-profile-card { overflow: hidden; }
.acct-hero { display: flex; align-items: center; gap: 1rem; padding: 1.25rem 1.5rem; background: linear-gradient(135deg, #f5f3ff 0%, #faf5ff 100%); border-bottom: 1px solid #e4e4e7; }
.acct-avatar { width: 56px; height: 56px; border-radius: 50%; background: #6366f1; color: #ffffff; display: flex; align-items: center; justify-content: center; font-size: 1.25rem; font-weight: 700; flex-shrink: 0; letter-spacing: 0.01em; box-shadow: 0 2px 6px rgba(99,102,241,0.35); }
.acct-hero-name { font-size: 1.0625rem; font-weight: 600; color: #18181b; margin: 0; }
.acct-hero-meta { font-size: 0.8125rem; color: #71717a; margin: 0.1875rem 0 0 0; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.acct-verified { display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.0625rem 0.4375rem; border-radius: 9999px; font-size: 0.6875rem; font-weight: 600; border: 1px solid; }
.acct-verified.ok { background: #f0fdf4; color: #16a34a; border-color: #bbf7d0; }
.acct-verified.no { background: #fef2f2; color: #dc2626; border-color: #fecaca; }

.acct-body { padding: 1.5rem; }
.acct-card-title { font-size: 1rem; font-weight: 600; margin: 0 0 0.25rem 0; color: #18181b; }
.acct-card-desc { font-size: 0.8125rem; color: #71717a; margin: 0 0 1.25rem 0; }

.acct-input-locked { background: #fafafa !important; color: #a1a1aa !important; cursor: not-allowed; }
.acct-form-actions { display: flex; align-items: center; gap: 0.75rem; padding-top: 1.25rem; border-top: 1px solid #f4f4f5; margin-top: 1.5rem; }

.acct-alert { display: flex; align-items: flex-start; gap: 0.625rem; padding: 0.75rem 1rem; border-radius: 0.5rem; font-size: 0.875rem; margin-bottom: 1.25rem; border: 1px solid; line-height: 1.45; }
.acct-alert svg { flex-shrink: 0; margin-top: 1px; }
.acct-alert.success { background: #f0fdf4; border-color: #bbf7d0; color: #15803d; }
.acct-alert.danger { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }

@media (max-width: 768px) {
    .acct-layout { grid-template-columns: 1fr; }
    .acct-nav { position: static; flex-direction: row; flex-wrap: wrap; }
    .acct-nav-link { flex: 1 1 auto; justify-content: center; }
}

/* Manage sub-page cards, prose, alerts, validation */
.acct-section-pad { padding: 1.5rem; }
.acct-prose { font-size: 0.875rem; color: #52525b; line-height: 1.55; margin: 0 0 1rem 0; }
.acct-prose:last-child { margin-bottom: 0; }
.acct-prose strong { color: #18181b; font-weight: 600; }
.acct-prose a, .acct-link { color: #6366f1; text-decoration: none; font-weight: 500; }
.acct-prose a:hover, .acct-link:hover { text-decoration: underline; }

.acct-btn-block { width: 100%; justify-content: center; }
.acct-btn-row { display: flex; flex-wrap: wrap; gap: 0.625rem; align-items: center; }
.acct-divider { border: none; border-top: 1px solid #f4f4f5; margin: 1.5rem 0; }

.acct-alert.warning { background: #fffbeb; border-color: #fde68a; color: #b45309; }
.acct-alert.info { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }
.acct-alert p { margin: 0; }
.acct-alert p + p { margin-top: 0.375rem; }
.acct-alert a { color: inherit; font-weight: 600; text-decoration: underline; }

.validation-errors { list-style: none; margin: 0 0 1rem 0; padding: 0; }
.validation-errors li { font-size: 0.8125rem; color: #dc2626; padding-left: 1.1rem; position: relative; }
.validation-errors li::before { content: "•"; position: absolute; left: 0.25rem; }

/* Key / code display */
.acct-key { display: inline-flex; align-items: center; padding: 0.25rem 0.5rem; background: #f4f4f5; border: 1px solid #e4e4e7; border-radius: 0.375rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.8125rem; color: #18181b; font-weight: 600; letter-spacing: 0.02em; }
.acct-steps { margin: 0; padding-left: 1.25rem; display: flex; flex-direction: column; gap: 1rem; }
.acct-steps > li { font-size: 0.875rem; color: #52525b; line-height: 1.55; }
.acct-qr { margin: 0.75rem 0; }

.acct-codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.5rem; margin-top: 0.5rem; }
.acct-codes code { display: block; text-align: center; padding: 0.5rem; background: #fafafa; border: 1px solid #e4e4e7; border-radius: 0.375rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.875rem; font-weight: 600; color: #18181b; letter-spacing: 0.04em; }
@media (max-width: 480px) { .acct-codes { grid-template-columns: 1fr; } }

/* ═══════════════════════════════════════════════════════════════════════
   DARK THEME
   Activated by [data-theme="dark"] on <html>. That attribute is set before
   first paint in App.razor and mirrored at runtime from <FluentDesignTheme>
   by the ThemeToggle component (see Application.Client/Layout/ThemeToggle.razor).
   Fluent UI web components darken via their own design tokens; the rules
   below cover the app's own custom markup, which uses hardcoded light colors.

   Palette:
     page      #0e1117   surface   #181a20   subtle    #1e222b
     hover     #20242c   border    #2b303b   border-·  #23272f
     text      #f3f4f6   muted     #9aa1ac   faint     #4b515e
     accent    #818cf8   input-bg  #12141a
   ═══════════════════════════════════════════════════════════════════════ */
[data-theme="dark"] { color-scheme: dark; }

[data-theme="dark"] body { color: #e6e9ef; background: #0e1117; }

/* ── App shell ──────────────────────────────────────────────────────── */
[data-theme="dark"] .al-header,
[data-theme="dark"] .al-footer { background: #161821; border-color: #262a33; }
[data-theme="dark"] .al-brand-name { color: #f3f4f6; }
[data-theme="dark"] .al-main { background: #0e1117; }
[data-theme="dark"] .al-hamburger { color: #cbd0da; }
[data-theme="dark"] .al-hamburger:hover { background: #22262f; }
[data-theme="dark"] .al-company-badge { background: #22262f; border-color: #2b303b; color: #c5cad4; }
[data-theme="dark"] .al-company-badge-btn:hover { background: #2b303b; border-color: #3a4150; }
[data-theme="dark"] .al-company-caret { color: #8b909c; }
[data-theme="dark"] .al-company-menu { background: #181a20; border-color: #2b303b; box-shadow: 0 10px 30px -8px rgba(0,0,0,0.6), 0 2px 6px -2px rgba(0,0,0,0.4); }
[data-theme="dark"] .al-company-menu-head { color: #8b909c; }
[data-theme="dark"] .al-company-item { color: #d5d9e0; }
[data-theme="dark"] .al-company-item:hover { background: #22262f; }
[data-theme="dark"] .al-company-item-on { background: #20242c; }
[data-theme="dark"] .al-company-item-name { color: #f3f4f6; }
[data-theme="dark"] .al-company-item-id { color: #8b909c; }

/* ── Error UI ───────────────────────────────────────────────────────── */
[data-theme="dark"] #blazor-error-ui { background: #3a2f00; color: #fde68a; }

/* ── Datasets / Tables (ds-*) ───────────────────────────────────────── */
[data-theme="dark"] .ds-title,
[data-theme="dark"] .ds-td,
[data-theme="dark"] .ds-td-name,
[data-theme="dark"] .ds-empty-title,
[data-theme="dark"] .ds-section-title,
[data-theme="dark"] .ds-label,
[data-theme="dark"] .ds-modal-title,
[data-theme="dark"] .ds-user-email,
[data-theme="dark"] .ds-tip-title,
[data-theme="dark"] .ds-dropzone-title { color: #f3f4f6; }
[data-theme="dark"] .ds-subtitle,
[data-theme="dark"] .ds-stat,
[data-theme="dark"] .ds-dataset-desc,
[data-theme="dark"] .ds-td-date,
[data-theme="dark"] .ds-search-icon,
[data-theme="dark"] .ds-hint,
[data-theme="dark"] .ds-empty-sub,
[data-theme="dark"] .ds-pagination,
[data-theme="dark"] .ds-tip-text,
[data-theme="dark"] .ds-info-item,
[data-theme="dark"] .ds-user-meta,
[data-theme="dark"] .ds-dropzone-sub { color: #9aa1ac; }
[data-theme="dark"] .ds-card,
[data-theme="dark"] .ds-form-card,
[data-theme="dark"] .ds-modal { background: #181a20; border-color: #2b303b; }
[data-theme="dark"] .ds-card-toolbar,
[data-theme="dark"] .ds-modal-header,
[data-theme="dark"] .ds-pagination { border-color: #2b303b; }
[data-theme="dark"] .ds-th,
[data-theme="dark"] .ds-col-grid-header { background: #1e222b; border-color: #2b303b; color: #9aa1ac; }
[data-theme="dark"] .ds-tr,
[data-theme="dark"] .ds-col-grid-row { border-color: #23272f; }
[data-theme="dark"] .ds-tr:hover,
[data-theme="dark"] .ds-col-grid-row:hover { background: #20242c; }
[data-theme="dark"] .ds-th-sortable:hover { color: #f3f4f6; }
[data-theme="dark"] .ds-search,
[data-theme="dark"] .ds-input,
[data-theme="dark"] .ds-textarea,
[data-theme="dark"] .ds-select { background: #12141a !important; border-color: #2b303b !important; color: #f3f4f6 !important; }
[data-theme="dark"] .ds-search::placeholder,
[data-theme="dark"] .ds-input::placeholder,
[data-theme="dark"] .ds-textarea::placeholder { color: #6b7280; }
[data-theme="dark"] .ds-search:focus,
[data-theme="dark"] .ds-input:focus,
[data-theme="dark"] .ds-textarea:focus,
[data-theme="dark"] .ds-select:focus { border-color: #818cf8 !important; box-shadow: 0 0 0 2px rgba(129,140,248,0.25) !important; }
[data-theme="dark"] .ds-spinner { border-color: #2b303b; border-top-color: #e6e9ef; }
[data-theme="dark"] .ds-empty-icon,
[data-theme="dark"] .ds-dropzone-icon,
[data-theme="dark"] .ds-breadcrumb-sep { color: #4b515e; }
[data-theme="dark"] .ds-tip-card,
[data-theme="dark"] .ds-dropzone,
[data-theme="dark"] .ds-columns-empty,
[data-theme="dark"] .ds-tag { background: #1e222b; border-color: #2b303b; }
[data-theme="dark"] .ds-tag { color: #f3f4f6; }
[data-theme="dark"] .ds-dropzone:hover,
[data-theme="dark"] .ds-dropzone.drag-over { background: #20242c; border-color: #818cf8; }
[data-theme="dark"] .ds-breadcrumb { color: #9aa1ac; }
[data-theme="dark"] .ds-breadcrumb a { color: #9aa1ac; }
[data-theme="dark"] .ds-breadcrumb a:hover { color: #f3f4f6; }
[data-theme="dark"] .ds-checkbox { accent-color: #818cf8; }
[data-theme="dark"] .ds-step-circle { background: #181a20; border-color: #2b303b; color: #9aa1ac; }
[data-theme="dark"] .ds-step:not(:last-child)::after { background: #2b303b; }
[data-theme="dark"] .ds-step-active .ds-step-circle,
[data-theme="dark"] .ds-step-done .ds-step-circle { background: #818cf8; border-color: #818cf8; color: #0e1117; }
[data-theme="dark"] .ds-step-active .ds-step-label { color: #f3f4f6; }
[data-theme="dark"] .ds-step-label { color: #9aa1ac; }
[data-theme="dark"] .ds-step:not(:last-child).ds-step-done::after { background: #818cf8; }
[data-theme="dark"] .ds-modal-backdrop { background: rgba(0,0,0,0.65); }
[data-theme="dark"] .ds-modal-close { color: #9aa1ac; }
[data-theme="dark"] .ds-modal-close:hover { background: #262b34 !important; color: #f3f4f6; }
[data-theme="dark"] .ds-divider,
[data-theme="dark"] .ds-form-actions,
[data-theme="dark"] .ds-step-nav,
[data-theme="dark"] .ds-col-grid-header { border-color: #23272f; }
[data-theme="dark"] .ds-col-grid-row { border-color: #23272f; }
[data-theme="dark"] .ds-user-row { border-color: #2b303b; }
[data-theme="dark"] .ds-badge-viewer { background: rgba(34,197,94,0.15); color: #4ade80; border-color: rgba(34,197,94,0.35); }
[data-theme="dark"] .ds-badge-editor { background: rgba(59,130,246,0.15); color: #60a5fa; border-color: rgba(59,130,246,0.35); }
[data-theme="dark"] .ds-badge-admin { background: rgba(168,85,247,0.15); color: #c084fc; border-color: rgba(168,85,247,0.35); }

/* ── Buttons (btn-*) ────────────────────────────────────────────────── */
[data-theme="dark"] .btn-default { background: #e6e9ef !important; color: #12141a !important; border-color: #e6e9ef !important; }
[data-theme="dark"] .btn-default:hover { background: #cfd4dd !important; }
[data-theme="dark"] .btn-outline { color: #e6e9ef !important; border-color: #2b303b !important; }
[data-theme="dark"] .btn-outline:hover { background: #20242c !important; }
[data-theme="dark"] .btn-ghost { color: #e6e9ef !important; }
[data-theme="dark"] .btn-ghost:hover { background: #20242c !important; }
[data-theme="dark"] .btn-icon { color: #9aa1ac; }
[data-theme="dark"] .btn-icon:hover { background: #20242c !important; color: #f3f4f6; }
[data-theme="dark"] .btn-page { color: #9aa1ac; }
[data-theme="dark"] .btn-page:hover:not(:disabled) { background: #20242c !important; color: #f3f4f6; }
[data-theme="dark"] .btn-page-active { background: #e6e9ef !important; color: #12141a !important; border-color: #e6e9ef !important; }
[data-theme="dark"] .btn:focus-visible { outline-color: #818cf8; }

/* ── Row context menu (ctx-*) ───────────────────────────────────────── */
[data-theme="dark"] .ctx-menu { background: #181a20; border-color: #2b303b; box-shadow: 0 12px 32px rgba(0,0,0,0.6); }
[data-theme="dark"] .ctx-item { color: #e6e9ef; }
[data-theme="dark"] .ctx-item:hover { background: #20242c; }
[data-theme="dark"] .ctx-item svg { color: #9aa1ac; }
[data-theme="dark"] .ctx-item-danger,
[data-theme="dark"] .ctx-item-danger svg { color: #f87171; }
[data-theme="dark"] .ctx-item-danger:hover { background: rgba(248,113,113,0.12); }
[data-theme="dark"] .ctx-sep { background: #23272f; }

/* ── Data view / comments (dv-*) ────────────────────────────────────── */
[data-theme="dark"] .dv-row-count,
[data-theme="dark"] .dv-search-wrap svg { color: #9aa1ac; }
[data-theme="dark"] .dv-th-sortable:hover { background: #20242c; }
[data-theme="dark"] .dv-table-wrap,
[data-theme="dark"] .dv-table-outer { background: #181a20; border-color: #2b303b; }
[data-theme="dark"] .dv-badge { background: #e6e9ef; color: #12141a; }
[data-theme="dark"] .dv-comments-panel { background: #14161c; border-color: #2b303b; }
[data-theme="dark"] .dv-comments-header,
[data-theme="dark"] .dv-comments-footer,
[data-theme="dark"] .dv-comment-item { background: #181a20; border-color: #2b303b; }
[data-theme="dark"] .dv-textarea { background: #12141a; border-color: #2b303b; color: #f3f4f6; }
[data-theme="dark"] .dv-textarea:focus { border-color: #818cf8; }
[data-theme="dark"] .dv-dropdown-menu,
[data-theme="dark"] .dv-mention-dropdown { background: #181a20; border-color: #2b303b; box-shadow: 0 4px 12px rgba(0,0,0,0.5); }
[data-theme="dark"] .dv-dropdown-item { color: #e6e9ef; }
[data-theme="dark"] .dv-dropdown-item:hover,
[data-theme="dark"] .dv-mention-item:hover { background: #20242c; }
[data-theme="dark"] .dv-mention-item { border-color: #23272f; }
[data-theme="dark"] .dv-dropdown-item.danger { color: #f87171; }
[data-theme="dark"] .dv-dropdown-item.danger:hover { background: rgba(248,113,113,0.12); }

/* ── Account / Manage (acct-*) ──────────────────────────────────────── */
[data-theme="dark"] .acct-page-title,
[data-theme="dark"] .acct-card-title,
[data-theme="dark"] .acct-hero-name,
[data-theme="dark"] .acct-prose strong { color: #f3f4f6; }
[data-theme="dark"] .acct-page-sub,
[data-theme="dark"] .acct-card-desc,
[data-theme="dark"] .acct-hero-meta,
[data-theme="dark"] .acct-prose,
[data-theme="dark"] .acct-steps > li { color: #9aa1ac; }
[data-theme="dark"] .acct-nav,
[data-theme="dark"] .acct-body,
[data-theme="dark"] .acct-profile-card { background: #181a20; border-color: #2b303b; }
[data-theme="dark"] .acct-nav-link { color: #c5cad4; }
[data-theme="dark"] .acct-nav-link:hover { background: #20242c; color: #f3f4f6; }
[data-theme="dark"] .acct-nav-link.active { background: #e6e9ef; color: #12141a; }
[data-theme="dark"] .acct-hero { background: linear-gradient(135deg, #1e1b34 0%, #241a33 100%); border-color: #2b303b; }
[data-theme="dark"] .acct-input-locked { background: #14161c !important; color: #6b7280 !important; }
[data-theme="dark"] .acct-form-actions,
[data-theme="dark"] .acct-divider { border-color: #23272f; }
[data-theme="dark"] .acct-prose a,
[data-theme="dark"] .acct-link { color: #818cf8; }
[data-theme="dark"] .acct-key,
[data-theme="dark"] .acct-codes code { background: #1e222b; border-color: #2b303b; color: #f3f4f6; }
[data-theme="dark"] .acct-verified.ok { background: rgba(34,197,94,0.15); color: #4ade80; border-color: rgba(34,197,94,0.35); }
[data-theme="dark"] .acct-verified.no { background: rgba(239,68,68,0.15); color: #f87171; border-color: rgba(239,68,68,0.35); }
[data-theme="dark"] .acct-alert.success { background: rgba(34,197,94,0.12); border-color: rgba(34,197,94,0.3); color: #86efac; }
[data-theme="dark"] .acct-alert.danger { background: rgba(239,68,68,0.12); border-color: rgba(239,68,68,0.3); color: #fca5a5; }
[data-theme="dark"] .acct-alert.warning { background: rgba(245,158,11,0.12); border-color: rgba(245,158,11,0.3); color: #fcd34d; }
[data-theme="dark"] .acct-alert.info { background: rgba(59,130,246,0.12); border-color: rgba(59,130,246,0.3); color: #93c5fd; }
[data-theme="dark"] .validation-errors li { color: #fca5a5; }

/* ── Misc ───────────────────────────────────────────────────────────── */
[data-theme="dark"] code { color: #f0a6c8; }
[data-theme="dark"] .grid-container { color: inherit; }

/* ── AG Grid (Quartz theme) ─────────────────────────────────────────────
   Third-party grid themed via its own CSS custom properties. Covers every
   .ag-theme-quartz instance (e.g. ViewData); page-scoped grids that set
   their own vars keep winning on specificity. Cell text set from JS
   cellStyle (e.g. aggridDailyInventory.js) is not reachable from CSS. */
[data-theme="dark"] .ag-theme-quartz {
    --ag-background-color: #181a20;
    --ag-foreground-color: #e6e9ef;
    --ag-header-background-color: #1e222b;
    --ag-header-foreground-color: #9aa1ac;
    --ag-border-color: #2b303b;
    --ag-row-border-color: #23272f;
    --ag-row-hover-color: #20242c;
    --ag-odd-row-background-color: #14161c;
    --ag-control-panel-background-color: #181a20;
    --ag-subtle-text-color: #9aa1ac;
    --ag-input-background-color: #12141a;
    --ag-input-border-color: #2b303b;
    --ag-selected-row-background-color: rgba(129,140,248,0.14);
    --ag-modal-overlay-background-color: rgba(14,17,23,0.6);
    color-scheme: dark;
}

/* ── Tailwind utility dark net ──────────────────────────────────────────
   The app loads Tailwind via CDN; several pages are built from color
   utilities. This catches any stragglers not covered by page-scoped rules
   (which have higher specificity and still win where present). Only neutral
   greys/white are remapped — semantic colored utilities (red/green/…) keep
   their hue. */
[data-theme="dark"] .bg-white { background-color: #181a20 !important; }
[data-theme="dark"] .bg-gray-50 { background-color: #14161c !important; }
[data-theme="dark"] .bg-gray-100 { background-color: #1e222b !important; }
[data-theme="dark"] .text-gray-900,
[data-theme="dark"] .text-gray-800,
[data-theme="dark"] .text-gray-700 { color: #f3f4f6 !important; }
[data-theme="dark"] .text-gray-600,
[data-theme="dark"] .text-gray-500 { color: #9aa1ac !important; }
[data-theme="dark"] .text-gray-400,
[data-theme="dark"] .text-gray-300 { color: #6b7280 !important; }
[data-theme="dark"] .border-gray-100,
[data-theme="dark"] .border-gray-200,
[data-theme="dark"] .border-gray-300 { border-color: #2b303b !important; }
[data-theme="dark"] .divide-gray-100 > :not([hidden]) ~ :not([hidden]),
[data-theme="dark"] .divide-gray-200 > :not([hidden]) ~ :not([hidden]) { border-color: #2b303b !important; }
/* ═══════════════════════════════════════════════════════════════════
   APP LAUNCHER (waffle)
   Shared across identity / chat / backend / relay. Only the token
   mapping in `.fb-launcher` differs per app -- everything below it is
   identical, so it can be diffed across repos. Class names are
   namespaced fb-launcher-* to stay clear of Bootstrap's .dropdown-menu.
═══════════════════════════════════════════════════════════════════ */

.fb-launcher {
  --fbl-surface:    var(--container-bg);
  --fbl-border:     var(--border-color);
  --fbl-text:       var(--text-color);
  /* backend has no muted-text token; this matches the .al-* header greys. */
  --fbl-muted:      #6b7280;
  --fbl-hover:      var(--hover-bg);
  /* Brand indigo, same as .al-brand-icon. */
  --fbl-accent:     #6366f1;
  --fbl-radius:     12px;
  --fbl-shadow:     0 12px 32px -4px rgba(0, 0, 0, 0.18);

  position: relative;
  display: inline-flex;
}


.fb-launcher-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-md, 8px);
  background: transparent;
  color: var(--fbl-muted);
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}

.fb-launcher-btn:hover,
.fb-launcher-btn.is-open {
  background: var(--fbl-hover);
  border-color: var(--fbl-border);
  color: var(--fbl-text);
}

.fb-launcher-btn:focus-visible {
  outline: 2px solid var(--fbl-accent);
  outline-offset: 2px;
}

.fb-launcher-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: transparent;
  border: none;
  padding: 0;
  cursor: default;
}

.fb-launcher-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 50;
  width: 380px;
  max-width: calc(100vw - 24px);
  padding: 10px;
  background: var(--fbl-surface);
  border: 1px solid var(--fbl-border);
  border-radius: var(--fbl-radius);
  box-shadow: var(--fbl-shadow);
}

.fb-launcher-head {
  padding: 2px 6px 8px;
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fbl-muted);
}

.fb-launcher-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
}

.fb-launcher-tile {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px;
  border-radius: var(--radius-md, 8px);
  text-decoration: none !important;
  color: var(--fbl-text);
  transition: background 120ms ease;
}

a.fb-launcher-tile:hover {
  background: var(--fbl-hover);
}

a.fb-launcher-tile:focus-visible {
  outline: 2px solid var(--fbl-accent);
  outline-offset: -2px;
}

.fb-launcher-tile.is-current {
  background: var(--fbl-hover);
  cursor: default;
}

.fb-launcher-tile.is-unavailable {
  cursor: default;
  opacity: 0.5;
}

.fb-launcher-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md, 8px);
  /* Fallback tint for browsers without color-mix(); the inline style overrides both. */
  background: var(--fbl-hover);
  color: var(--fbl-accent);
  font-size: 15px;
}

.fb-launcher-monogram {
  font-family: var(--font-display, sans-serif);
  font-size: 14px;
  font-weight: 700;
}

.fb-launcher-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.fb-launcher-name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--fbl-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fb-launcher-desc {
  font-size: 11px;
  line-height: 1.3;
  color: var(--fbl-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fb-launcher-here {
  position: absolute;
  top: 6px;
  right: 7px;
  font-family: var(--font-mono, monospace);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fbl-muted);
}

.fb-launcher-empty {
  padding: 18px 10px 20px;
  text-align: center;
  font-size: 12px;
  line-height: 1.6;
  color: var(--fbl-muted);
}

/* Skeleton */
.fb-launcher-tile.is-skeleton .fb-launcher-icon,
.fb-launcher-tile.is-skeleton .fb-launcher-name,
.fb-launcher-tile.is-skeleton .fb-launcher-desc {
  background: var(--fbl-hover);
  border-radius: 4px;
  animation: fb-launcher-pulse 1.4s ease-in-out infinite;
}

.fb-launcher-tile.is-skeleton .fb-launcher-icon { border-radius: var(--radius-md, 8px); }
.fb-launcher-tile.is-skeleton .fb-launcher-name { width: 74px; height: 10px; }
.fb-launcher-tile.is-skeleton .fb-launcher-desc { width: 52px; height: 8px; margin-top: 4px; }

@keyframes fb-launcher-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.45; }
}

@media (prefers-reduced-motion: reduce) {
  .fb-launcher-tile.is-skeleton .fb-launcher-icon,
  .fb-launcher-tile.is-skeleton .fb-launcher-name,
  .fb-launcher-tile.is-skeleton .fb-launcher-desc { animation: none; }
}

@media (max-width: 560px) {
  .fb-launcher-panel { width: 300px; padding: 8px; }
  .fb-launcher-grid  { grid-template-columns: minmax(0, 1fr); }
}


/* ── First-load splash ─────────────────────────────────────────────────
   Shown while the WebAssembly runtime downloads (wwwroot/Application.lib.module.js). The fill
   width comes straight from --blazor-load-percentage, which Blazor sets on <html>. Colors follow
   the app shell: indigo brand mark, light/dark via the theme tokens above. */
.wasm-splash {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px;
    background: var(--bg-color, #fafafa);
    color: var(--text-color, #31333F);
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif;
    opacity: 1;
    transition: opacity 0.2s ease;
}

    .wasm-splash.is-done {
        opacity: 0;
        pointer-events: none;
    }

.wasm-splash-mark {
    width: 44px;
    height: 44px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    background: #6366f1;
    color: #fff;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -.02em;
    box-shadow: 0 8px 20px -8px rgba(99, 102, 241, 0.6);
}

.wasm-splash-title {
    font-size: 15px;
    font-weight: 600;
}

.wasm-splash-track {
    width: min(240px, 70vw);
    height: 4px;
    border-radius: 999px;
    background: var(--border-color, #E6E9EF);
    overflow: hidden;
}

.wasm-splash-fill {
    height: 100%;
    width: var(--blazor-load-percentage, 0%);
    border-radius: inherit;
    background: #6366f1;
    transition: width 0.15s ease-out;
}

.wasm-splash-detail {
    font-size: 12px;
    color: #6b7280;
    font-variant-numeric: tabular-nums;
    min-height: 1.4em;
}

.wasm-splash-slow {
    display: none;
    max-width: 280px;
    text-align: center;
    font-size: 12px;
    color: #6b7280;
}

    .wasm-splash.is-slow .wasm-splash-slow {
        display: block;
    }

    .wasm-splash-slow button {
        margin-left: 4px;
        padding: 0;
        border: 0;
        background: none;
        color: #6366f1;
        font: inherit;
        text-decoration: underline;
        cursor: pointer;
    }

[data-theme="dark"] .wasm-splash-detail,
[data-theme="dark"] .wasm-splash-slow {
    color: #9aa1ac;
}

@media (prefers-reduced-motion: reduce) {
    .wasm-splash,
    .wasm-splash-fill {
        transition: none;
    }
}
