:root {
    --fx-bg: #f3f6f3;
    --fx-surface: #ffffff;
    --fx-border: #e2ebe4;
    --fx-text: #0f172a;
    --fx-muted: #64748b;
    --fx-accent: #00a34d;
    --fx-accent-2: #d4ff00;
    --fx-sidebar: #050505;
    --fx-sidebar-text: #cbd5e1;
    --fx-radius: 14px;
    --fx-shadow: 0 10px 30px rgba(15, 23, 42, .06);
}

[data-bs-theme="dark"] {
    --fx-bg: #0a0a0a;
    --fx-surface: #121212;
    --fx-border: #243044;
    --fx-text: #e2e8f0;
    --fx-muted: #94a3b8;
    --fx-sidebar: #000000;
    --fx-shadow: 0 10px 30px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }

body.fx-body {
    margin: 0;
    font-family: "DM Sans", system-ui, sans-serif;
    background:
        radial-gradient(1200px 500px at 10% -10%, rgba(0, 163, 77, .14), transparent 55%),
        radial-gradient(900px 400px at 100% 0%, rgba(212, 255, 0, .08), transparent 50%),
        var(--fx-bg);
    color: var(--fx-text);
    min-height: 100vh;
}

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

.fx-sidebar {
    width: 260px;
    background: linear-gradient(180deg, var(--fx-sidebar), #101827 80%);
    color: var(--fx-sidebar-text);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 1030;
}

.fx-brand-logo {
    display: block;
    width: 100%;
    max-width: 196px;
    height: auto;
}

.fx-auth-logo-wrap {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    width: fit-content;
    max-width: 100%;
}

.fx-auth-logo {
    display: block;
    width: min(280px, 78vw);
    height: auto;
    margin-inline: auto;
    filter: drop-shadow(0 10px 28px rgba(0, 163, 77, .22));
}

.fx-brand-title {
    color: #fff;
    font-weight: 700;
    letter-spacing: .02em;
    line-height: 1.1;
}

.fx-brand-sub {
    font-size: .72rem;
    color: #94a3b8;
}

.fx-nav-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .7rem .9rem;
    border-radius: 10px;
    color: #94a3b8;
    text-decoration: none;
    margin-bottom: .25rem;
    transition: .15s ease;
}

.fx-nav-link:hover,
.fx-nav-link.active {
    background: rgba(255,255,255,.08);
    color: #fff;
}

.fx-nav-link.active {
    box-shadow: inset 3px 0 0 var(--fx-accent-2);
}

.fx-main { min-width: 0; }

.fx-topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background: color-mix(in srgb, var(--fx-bg) 80%, transparent);
    border-bottom: 1px solid var(--fx-border);
    min-height: 74px;
}

.fx-page-title {
    font-size: 1.25rem;
    font-weight: 700;
}

.fx-page-sub { font-size: .85rem; }

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

.fx-stat {
    padding: 1.1rem 1.2rem;
}

.fx-stat .label {
    color: var(--fx-muted);
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.fx-stat .value {
    font-size: 1.7rem;
    font-weight: 700;
    font-family: "JetBrains Mono", monospace;
    margin-top: .2rem;
}

.fx-table thead th {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--fx-muted);
    border-bottom-color: var(--fx-border) !important;
}

.btn-primary {
    background: linear-gradient(135deg, #00a34d, #007a39);
    border: none;
}

.btn-primary:hover { background: #007a39; }

.form-control, .form-select {
    border-radius: 10px;
    border-color: var(--fx-border);
    background: var(--fx-surface);
    color: var(--fx-text);
}

.fx-auth-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 2rem 1.25rem;
    background:
        radial-gradient(ellipse 80% 50% at 15% -10%, rgba(0, 163, 77, .28), transparent 55%),
        radial-gradient(ellipse 60% 40% at 95% 10%, rgba(212, 255, 0, .16), transparent 50%),
        radial-gradient(ellipse 50% 40% at 50% 110%, rgba(0, 163, 77, .12), transparent 55%),
        linear-gradient(165deg, #f7faf7 0%, #eef5ef 45%, #e4efe6 100%);
    position: relative;
    overflow: hidden;
}

.fx-auth-wrap::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(15, 23, 42, .035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15, 23, 42, .035) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 20%, transparent 75%);
    pointer-events: none;
}

body.fx-auth-body {
    margin: 0;
    min-height: 100vh;
    font-family: "DM Sans", system-ui, sans-serif;
    color: #0f172a;
}

.fx-auth-panel {
    position: relative;
    z-index: 1;
    width: min(440px, 100%);
    animation: fxAuthIn .55s ease both;
}

@keyframes fxAuthIn {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
}

.fx-auth-brand { margin-bottom: 1.75rem; }

.fx-auth-tagline {
    margin-top: .85rem;
    font-size: .82rem;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #5b6b63;
    font-weight: 600;
}

.fx-auth-form {
    background: #fff;
    border: 1px solid rgba(0, 163, 77, .12);
    border-radius: 20px;
    padding: 1.75rem 1.5rem 1.5rem;
    box-shadow:
        0 1px 0 rgba(255,255,255,.8) inset,
        0 18px 50px rgba(15, 23, 42, .08);
}

.fx-auth-title {
    font-family: Syne, "DM Sans", sans-serif;
    font-weight: 800;
    font-size: 1.55rem;
    letter-spacing: -.02em;
    margin: 0 0 .25rem;
    color: #0b1a12;
}

.fx-auth-sub {
    color: #64748b;
    font-size: .92rem;
    margin-bottom: 1.35rem;
}

.fx-login-form .form-label {
    font-weight: 600;
    font-size: .88rem;
    color: #334155;
}

.fx-login-form .form-control-lg {
    border-radius: 12px;
    border-color: #d7e3db;
    padding: .7rem 1rem;
    font-size: 1rem;
    background: #fbfcfb;
}

.fx-login-form .form-control-lg:focus {
    border-color: #00a34d;
    box-shadow: 0 0 0 .25rem rgba(0, 163, 77, .18);
    background: #fff;
}

.fx-auth-link {
    color: #007a39;
    text-decoration: none;
    font-weight: 600;
}

.fx-auth-link:hover {
    color: #00a34d;
    text-decoration: underline;
}

.fx-auth-submit {
    border-radius: 12px;
    font-weight: 700;
    letter-spacing: .02em;
    padding: .85rem 1rem;
    box-shadow: 0 10px 24px rgba(0, 163, 77, .28);
}

.fx-auth-foot {
    margin-top: 1.25rem;
    font-size: .78rem;
    color: #7a8a82;
}

.fx-auth-card {
    width: 100%;
    max-width: 420px;
    background: rgba(255,255,255,.96);
    border-radius: 18px;
    padding: 2rem;
    box-shadow: 0 25px 60px rgba(0,0,0,.35);
}

[data-bs-theme="dark"] .fx-auth-card {
    background: #121a2b;
    color: #e2e8f0;
}

.fx-qr-preview {
    max-width: 420px;
    width: 100%;
    height: auto;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

@media (max-width: 991.98px) {
    .fx-sidebar {
        position: fixed;
        left: -280px;
        transition: .2s ease;
    }
    .fx-sidebar.open { left: 0; }
}

@media (max-width: 575.98px) {
    .fx-auth-form { padding: 1.35rem 1.15rem; }
    .fx-auth-logo { width: min(240px, 82vw); }
}
