:root {
    --fx-bg: #09090b;
    --fx-bg-elevated: #111113;
    --fx-surface: #18181b;
    --fx-surface-hover: #1f1f23;
    --fx-border: #27272a;
    --fx-border-strong: #3f3f46;
    --fx-text: #fafafa;
    --fx-text-muted: #a1a1aa;
    --fx-text-dim: #94a3b8;
    --fx-accent: #f97316;
    --fx-accent-hover: #fb923c;
    --fx-accent-muted: rgba(249, 115, 22, 0.12);
    --fx-success: #22c55e;
    --fx-danger: #ef4444;
    --fx-warning: #eab308;
    --fx-radius: 4px;
    --fx-sidebar-width: 240px;
    --fx-font: "IBM Plex Sans", system-ui, sans-serif;
}

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

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    background: var(--fx-bg);
    color: var(--fx-text);
    font-family: var(--fx-font);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--fx-accent);
    text-decoration: none;
}

a:hover {
    color: var(--fx-accent-hover);
}

.fx-shell {
    display: flex;
    min-height: 100vh;
}

.fx-sidebar {
    width: var(--fx-sidebar-width);
    background: var(--fx-bg-elevated);
    border-right: 1px solid var(--fx-border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.fx-sidebar-brand {
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--fx-border);
}

.fx-sidebar-brand a {
    color: var(--fx-text);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-decoration: none;
}

.fx-sidebar-brand span {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    font-weight: 500;
    color: var(--fx-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.fx-nav {
    padding: 12px 8px;
    flex: 1;
}

.fx-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    color: var(--fx-text-muted);
    border-radius: var(--fx-radius);
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
}

.fx-nav a:hover {
    background: var(--fx-surface);
    color: var(--fx-text);
}

.fx-nav a.active {
    background: var(--fx-accent-muted);
    color: var(--fx-accent);
}

.fx-sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--fx-border);
    font-size: 12px;
    color: var(--fx-text-dim);
}

.fx-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.fx-topbar {
    height: 56px;
    border-bottom: 1px solid var(--fx-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    background: var(--fx-bg-elevated);
}

.fx-topbar-title {
    font-size: 15px;
    font-weight: 600;
}

.fx-topbar-user {
    font-size: 13px;
    color: var(--fx-text-muted);
}

.fx-content {
    padding: 24px;
    flex: 1;
}

.fx-content:focus,
.fx-content:focus-visible {
    outline: none;
}

.fx-page-header {
    margin-bottom: 24px;
}

.fx-page-header h1 {
    margin: 0 0 6px;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.fx-page-header p {
    margin: 0;
    color: var(--fx-text-muted);
}

.fx-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.fx-card {
    background: var(--fx-surface);
    border: 1px solid var(--fx-border);
    border-radius: var(--fx-radius);
    padding: 20px;
}

.fx-card-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--fx-text-dim);
    margin-bottom: 8px;
}

.fx-card-value {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.fx-card-value.success {
    color: var(--fx-success);
}

.fx-card-value.danger {
    color: var(--fx-danger);
}

.fx-card-value.warning {
    color: var(--fx-warning);
}

.fx-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--fx-radius);
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.fx-btn-primary {
    background: var(--fx-accent);
    color: #000;
    border-color: var(--fx-accent);
}

.fx-btn-primary:hover {
    background: var(--fx-accent-hover);
    border-color: var(--fx-accent-hover);
}

.fx-btn-ghost {
    background: transparent;
    color: var(--fx-text-muted);
    border-color: var(--fx-border);
}

.fx-btn-ghost:hover {
    background: var(--fx-surface);
    color: var(--fx-text);
    border-color: var(--fx-border-strong);
}

.fx-btn-danger {
    background: rgba(248, 113, 113, 0.1);
    color: #fca5a5;
    border-color: rgba(248, 113, 113, 0.45);
}

.fx-btn-danger:hover:not(:disabled) {
    background: rgba(248, 113, 113, 0.2);
    color: #fecaca;
    border-color: rgba(248, 113, 113, 0.65);
}

.fx-btn-danger:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.fx-btn-link {
    background: none;
    border: none;
    color: var(--fx-accent);
    padding: 0;
    font-weight: 500;
    cursor: pointer;
}

.fx-form .fx-field input[disabled] {
    opacity: 0.7;
    cursor: not-allowed;
}

.fx-field-hint {
    margin: 6px 0 0;
    font-size: 12px;
    color: var(--fx-text-muted);
}

.fx-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.fx-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--fx-text-muted);
    letter-spacing: 0.01em;
}

.fx-field input {
    width: 100%;
    padding: 10px 12px;
    background: var(--fx-bg);
    border: 1px solid var(--fx-border);
    border-radius: var(--fx-radius);
    color: var(--fx-text);
    font-family: inherit;
    font-size: 14px;
}

.fx-field input:focus {
    outline: none;
    border-color: var(--fx-accent);
    box-shadow: 0 0 0 3px var(--fx-accent-muted);
}

.fx-error {
    padding: 10px 12px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--fx-radius);
    color: #fca5a5;
    font-size: 13px;
}

.fx-success {
    padding: 10px 12px;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: var(--fx-radius);
    color: #86efac;
    font-size: 13px;
    margin-bottom: 16px;
}

.fx-auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(ellipse at top, rgba(249, 115, 22, 0.08), transparent 50%),
        var(--fx-bg);
}

/* Auth forge — must live in critical CSS (App.razor); layout HeadContent is unreliable for login. */
.fx-auth-forge {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 24px;
    position: relative;
    background: #07080c;
    color: #f1f5f9;
}

.fx-auth-forge::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 90% 60% at 15% -10%, rgba(232, 163, 23, 0.12), transparent 55%),
        radial-gradient(ellipse 70% 50% at 95% 10%, rgba(34, 211, 238, 0.06), transparent 50%);
}

.fx-auth-forge .fx-auth-card {
    position: relative;
    z-index: 1;
    max-width: 440px;
    padding: 36px;
    border-radius: 20px;
    border: 1px solid rgba(232, 163, 23, 0.18);
    background: rgba(18, 24, 32, 0.92);
    backdrop-filter: blur(16px);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
}

.fx-auth-forge .fx-auth-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: #f1f5f9;
}

.fx-auth-forge .fx-auth-brand span {
    color: #f1f5f9;
}

.fx-auth-forge .fx-auth-brand .fx-brand-mark {
    border-radius: 8px;
}

.fx-auth-forge .fx-auth-card h1 {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.fx-auth-forge .fx-field input {
    background: rgba(7, 8, 12, 0.65);
    border-color: rgba(148, 163, 184, 0.18);
}

.fx-auth-forge .fx-btn-primary {
    background: linear-gradient(135deg, #f5c042 0%, #e8a317 100%);
    color: #0a0a0a;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    box-shadow: 0 4px 16px rgba(232, 163, 23, 0.25);
}

.fx-auth-forge .fx-btn-primary:hover {
    box-shadow: 0 6px 20px rgba(232, 163, 23, 0.35);
}

.fx-auth-forge a {
    color: #e8a317;
}

.fx-auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--fx-surface);
    border: 1px solid var(--fx-border);
    border-radius: var(--fx-radius);
    padding: 32px;
}

.fx-auth-card h1 {
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.fx-auth-card .subtitle {
    margin: 0 0 24px;
    color: var(--fx-text-muted);
    font-size: 14px;
}

.fx-auth-footer {
    margin-top: 20px;
    text-align: center;
    font-size: 13px;
    color: var(--fx-text-muted);
}

.fx-badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: var(--fx-radius);
    background: var(--fx-accent-muted);
    color: var(--fx-accent);
}

/* Skip link — visually hidden until focused */
.fx-skip-link {
    position: absolute;
    left: 12px;
    top: 0;
    z-index: 10000;
    padding: 10px 14px;
    border-radius: 0 0 8px 8px;
    background: #e8a317;
    color: #0c0f16;
    font-weight: 700;
    font-size: 13px;
    text-decoration: none;
    transform: translateY(-120%);
    transition: transform 0.15s ease;
}

.fx-skip-link:focus,
.fx-skip-link:focus-visible {
    transform: translateY(0);
    outline: 2px solid #f1f5f9;
    outline-offset: 2px;
}

