/* Global design tokens and host-level visual behavior. Feature patterns remain in app.css. */
:root {
    --app-font-family: "IBM Plex Sans Variable", "IBM Plex Sans", "Segoe UI", sans-serif;
    --app-canvas: #08111f;
    --app-canvas-raised: #0d1828;
    --app-bg:
        radial-gradient(circle at 4% -10%, rgba(45, 212, 191, 0.11), transparent 28rem),
        radial-gradient(circle at 100% 0%, rgba(59, 130, 246, 0.06), transparent 24rem),
        linear-gradient(160deg, var(--app-canvas) 0%, #0a1423 52%, var(--app-canvas-raised) 100%);
    --app-text: #f8fafc;
    --app-text-soft: #cbd5e1;
    --app-text-muted: #91a0b5;
    --app-accent: #2dd4bf;
    --app-accent-strong: #14b8a6;
    --app-positive: #34d399;
    --app-negative: #fb7185;
    --app-warning: #fbbf24;
    --app-info: #60a5fa;
    --app-border: rgba(148, 163, 184, 0.14);
    --app-border-strong: rgba(148, 163, 184, 0.22);
    --app-required-marker: #f87171;
    --app-drawer-bg: rgba(10, 20, 34, 0.96);
    --app-topbar-bg: rgba(8, 17, 31, 0.84);
    --app-surface: rgba(16, 27, 45, 0.94);
    --app-surface-strong: #152238;
    --app-surface-soft: rgba(19, 32, 52, 0.74);
    --app-surface-alt: rgba(255, 255, 255, 0.055);
    --app-hover-surface: rgba(35, 52, 76, 0.82);
    --app-nav-link: #cbd5e1;
    --app-nav-hover-text: #e2e8f0;
    --app-nav-active-text: #f8fafc;
    --app-grid-header: #17263b;
    --app-grid-row: rgba(16, 27, 45, 0.82);
    --app-grid-row-hover: rgba(45, 212, 191, 0.08);
    --app-menu-bg: #142137;
    --app-dialog-bg: #142137;
    --app-dialog-title-bg: #17263b;
    --app-chip-bg: rgba(20, 33, 55, 0.94);
    --app-chip-bg-light: rgba(255, 255, 255, 0.94);
    --app-chip-border: rgba(103, 232, 249, 0.18);
    --app-chip-border-light: rgba(148, 163, 184, 0.28);
    --app-chip-color: #e2e8f0;
    --app-control-radius: 12px;
    --app-panel-radius: 16px;
    --app-panel-shadow: 0 16px 36px rgba(2, 6, 23, 0.22);
    --app-shadow: rgba(2, 6, 23, 0.48);
    --app-focus-ring: rgba(45, 212, 191, 0.46);
    --app-skeleton-surface: rgba(19, 32, 52, 0.82);
    --app-skeleton-surface-soft: rgba(255, 255, 255, 0.04);
    --app-skeleton-border: rgba(148, 163, 184, 0.13);
    --app-skeleton-grid-template: minmax(0, 1fr);
    --app-skeleton-grid-gap: 1rem;
    --app-skeleton-table-min-width: 42rem;
    --app-navigation-level: 0;
}

body.theme-light {
    --app-canvas: #f6f8fb;
    --app-canvas-raised: #eef3f8;
    --app-bg:
        radial-gradient(circle at 2% -8%, rgba(13, 148, 136, 0.09), transparent 26rem),
        radial-gradient(circle at 100% 0%, rgba(59, 130, 246, 0.045), transparent 22rem),
        linear-gradient(160deg, var(--app-canvas) 0%, #f7f9fc 52%, var(--app-canvas-raised) 100%);
    --app-text: #0f172a;
    --app-text-soft: #334155;
    --app-text-muted: #64748b;
    --app-accent: #0f766e;
    --app-accent-strong: #0f766e;
    --app-positive: #059669;
    --app-negative: #e11d48;
    --app-warning: #b45309;
    --app-info: #2563eb;
    --app-border: rgba(148, 163, 184, 0.18);
    --app-border-strong: rgba(148, 163, 184, 0.24);
    --app-required-marker: #dc2626;
    --app-drawer-bg: rgba(248, 250, 252, 0.96);
    --app-topbar-bg: rgba(255, 255, 255, 0.88);
    --app-surface: rgba(255, 255, 255, 0.96);
    --app-surface-strong: #ffffff;
    --app-surface-soft: rgba(248, 250, 252, 0.96);
    --app-surface-alt: rgba(15, 23, 42, 0.04);
    --app-hover-surface: rgba(241, 245, 249, 0.95);
    --app-nav-link: #334155;
    --app-nav-hover-text: #0f172a;
    --app-nav-active-text: #0f172a;
    --app-grid-header: #f1f5f9;
    --app-grid-row: rgba(255, 255, 255, 0.94);
    --app-grid-row-hover: rgba(15, 118, 110, 0.06);
    --app-menu-bg: rgba(255, 255, 255, 0.98);
    --app-dialog-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(241, 245, 249, 0.98));
    --app-dialog-title-bg: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(237, 243, 249, 0.96));
    --app-chip-color: #0f172a;
    --app-panel-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
    --app-shadow: rgba(15, 23, 42, 0.12);
    --app-focus-ring: rgba(15, 118, 110, 0.38);
    --app-skeleton-surface: rgba(255, 255, 255, 0.9);
    --app-skeleton-surface-soft: rgba(15, 23, 42, 0.035);
    --app-skeleton-border: rgba(148, 163, 184, 0.2);
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family: var(--app-font-family);
    background: var(--app-bg);
    color: var(--app-text);
    font-kerning: normal;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
}

body.app-shell {
    min-height: 100vh;
}

body.app-theme-pending {
    visibility: hidden;
}

body.app-startup-transitioning {
    overflow-x: hidden;
}

:where(a, button, input, textarea, select, [tabindex]:not([tabindex="-1"])):focus-visible {
    outline: 2px solid var(--app-focus-ring) !important;
    outline-offset: 3px !important;
}

/*
 * MudBlazor's outlined fields own their focused border. Applying the host-level
 * focus outline to the native slot as well produces a second, floating border
 * on text, numeric, select and date controls. Keep one clear focus treatment:
 * the component border for Mud fields, the host ring for native controls.
 */
.mud-input-control :where(input, textarea, .mud-input-slot, .mud-select-input):focus-visible {
    outline: none !important;
    outline-offset: 0 !important;
}
