/* Admin application theme, layered on Bootstrap's dark mode. */

[data-bs-theme="dark"] {
    --bs-body-bg: transparent;
    --bs-body-color: var(--fx-text);
    --bs-secondary-color: var(--fx-muted);
    --bs-border-color: var(--fx-line);
    --bs-primary: #22e6ff;
    --bs-primary-rgb: 34, 230, 255;
    --bs-link-color: var(--fx-cyan);
    --bs-link-hover-color: #9df4ff;
    --bs-link-color-rgb: 34, 230, 255;
    --bs-link-hover-color-rgb: 157, 244, 255;
    --bs-font-sans-serif: var(--fx-body);
}

.fx-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1040;
    width: 260px;
    display: flex;
    flex-direction: column;
    padding: 1.1rem .85rem;
    background: rgba(8, 11, 28, .78);
    backdrop-filter: blur(18px);
    border-right: 1px solid var(--fx-line);
    transition: transform .3s ease;
    overflow-y: auto;
}

.fx-brand { display: flex; align-items: center; gap: .7rem; padding: .3rem .5rem 1.2rem; color: inherit; text-decoration: none; }
.fx-brand img { width: 40px; height: 40px; }
.fx-brand strong { font-family: var(--fx-display); font-size: 1.05rem; letter-spacing: .08em; display: block; }
.fx-brand small { color: var(--fx-muted); font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; }

.fx-nav { list-style: none; margin: 0; padding: 0; flex: 1; display: flex; flex-direction: column; gap: .2rem; }

.fx-nav a, .fx-nav button {
    position: relative;
    display: flex;
    align-items: center;
    gap: .75rem;
    width: 100%;
    padding: .62rem .85rem;
    border: 0;
    border-radius: 12px;
    background: none;
    color: var(--fx-muted);
    font: inherit;
    text-decoration: none;
    overflow: hidden;
    transition: color .2s, background .2s, transform .2s;
}
.fx-nav i { font-size: 1.1rem; transition: filter .2s, transform .2s; }
.fx-nav a:hover, .fx-nav button:hover { color: var(--fx-text); background: rgba(34, 230, 255, .07); transform: translateX(3px); }
.fx-nav a:hover i { transform: scale(1.14); filter: drop-shadow(0 0 6px var(--fx-cyan)); }
.fx-nav a.active { color: #fff; background: linear-gradient(90deg, rgba(34, 230, 255, .2), rgba(139, 92, 246, .12)); }
.fx-nav a.active i { color: var(--fx-cyan); filter: drop-shadow(0 0 8px var(--fx-cyan)); }
.fx-nav a.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 18%;
    bottom: 18%;
    width: 3px;
    border-radius: 3px;
    background: var(--fx-cyan);
    box-shadow: 0 0 12px var(--fx-cyan);
}
.fx-nav .fx-nav-scan { color: var(--fx-green); }
.fx-nav-sep { height: 1px; margin: .55rem .4rem; background: var(--fx-line); }

/* No z-index here: it would trap Bootstrap modals beneath their own backdrop. */
.fx-main { margin-left: 260px; min-height: 100vh; display: flex; flex-direction: column; position: relative; }

.fx-topbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: .7rem 1.5rem;
    background: rgba(6, 8, 22, .6);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--fx-line);
}
.fx-topbar h1 { font-family: var(--fx-display); font-size: 1.05rem; font-weight: 600; letter-spacing: .06em; margin: 0; }
.fx-clock { font-family: var(--fx-display); font-size: .78rem; color: var(--fx-cyan); letter-spacing: .1em; text-shadow: 0 0 10px rgba(34, 230, 255, .6); }
.fx-menu-btn { display: none; }
.fx-content { padding: 1.5rem; flex: 1; }
.fx-backdrop-click { display: none; }

.fx-userchip { display: flex; align-items: center; gap: .55rem; padding: .25rem .7rem .25rem .3rem; border: 1px solid var(--fx-line); border-radius: 999px; background: rgba(255, 255, 255, .04); color: inherit; }
.fx-userchip:hover { border-color: var(--fx-cyan); }

/* Glass cards with a cursor-following spotlight. */
.fx-card {
    position: relative;
    background: var(--fx-surface);
    border: 1px solid var(--fx-line);
    border-radius: 18px;
    backdrop-filter: blur(14px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, .35);
}
.fx-card::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), rgba(34, 230, 255, .1), transparent 70%);
    opacity: 0;
    transition: opacity .25s;
    pointer-events: none;
}
.fx-card:hover::after { opacity: 1; }
.fx-card-body { padding: 1.2rem 1.3rem; position: relative; z-index: 2; }
.fx-card-title { font-family: var(--fx-display); font-size: .82rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--fx-muted); margin: 0 0 .9rem; }

.fx-stat { height: 100%; transform-style: preserve-3d; transition: transform .15s ease-out, box-shadow .25s; }
.fx-stat:hover { box-shadow: 0 16px 50px rgba(34, 230, 255, .16); }
.fx-stat .fx-stat-icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 13px;
    font-size: 1.25rem;
    color: var(--tone);
    background: color-mix(in srgb, var(--tone) 14%, transparent);
    box-shadow: 0 0 18px color-mix(in srgb, var(--tone) 35%, transparent);
}
.fx-stat .fx-stat-value { font-family: var(--fx-display); font-size: 1.6rem; font-weight: 700; margin-top: .75rem; line-height: 1.15; overflow-wrap: anywhere; text-shadow: 0 0 18px color-mix(in srgb, var(--tone) 50%, transparent); }
.fx-stat .fx-stat-label { color: var(--fx-muted); font-size: .84rem; margin-top: .2rem; }
.fx-tone-cyan { --tone: var(--fx-cyan); }
.fx-tone-green { --tone: var(--fx-green); }
.fx-tone-red { --tone: var(--fx-red); }
.fx-tone-violet { --tone: #a78bfa; }
.fx-tone-amber { --tone: var(--fx-amber); }
.fx-tone-pink { --tone: var(--fx-magenta); }

.fx-reveal { animation: fx-rise .55s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i, 0) * 60ms); }

@keyframes fx-rise {
    from { opacity: 0; transform: translateY(16px) scale(.985); }
}

/* Attendance bars and the membership gauge. */
.fx-bars { display: flex; align-items: flex-end; gap: .6rem; height: 150px; }
.fx-bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: .3rem; height: 100%; font-size: .72rem; color: var(--fx-muted); }
.fx-bar b { font-family: var(--fx-display); font-size: .72rem; color: var(--fx-text); }
.fx-bar span {
    display: block;
    width: 100%;
    max-width: 34px;
    min-height: 3px;
    height: var(--h);
    border-radius: 7px 7px 2px 2px;
    background: linear-gradient(to top, var(--fx-violet), var(--fx-cyan));
    box-shadow: 0 0 14px rgba(34, 230, 255, .45);
    animation: fx-bar-grow .9s cubic-bezier(.2, .8, .2, 1) both;
    transform-origin: bottom;
}

@keyframes fx-bar-grow {
    from { transform: scaleY(0); }
}

.fx-gauge { position: relative; width: 130px; height: 130px; margin: 0 auto; }
.fx-gauge svg { transform: rotate(-90deg); filter: drop-shadow(0 0 7px rgba(61, 255, 168, .55)); }
.fx-gauge circle { fill: none; stroke-width: 9; }
.fx-gauge .track { stroke: rgba(255, 255, 255, .08); }
.fx-gauge .value { stroke: var(--fx-green); stroke-linecap: round; stroke-dasharray: var(--dash) 283; animation: fx-gauge 1.3s ease-out both; }
.fx-gauge div { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; font-family: var(--fx-display); font-size: 1.3rem; font-weight: 700; }

@keyframes fx-gauge {
    from { stroke-dasharray: 0 283; }
}

/* Tables */
.table { --bs-table-bg: transparent; --bs-table-color: var(--fx-text); --bs-table-border-color: var(--fx-line); --bs-table-hover-bg: rgba(34, 230, 255, .06); --bs-table-hover-color: #fff; margin-bottom: 0; }
.table thead th { font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 600; color: var(--fx-muted); white-space: nowrap; }
.table td { vertical-align: middle; }
.table tbody tr { animation: fx-rise .4s ease both; }
.table tbody tr:nth-child(2) { animation-delay: 40ms; }
.table tbody tr:nth-child(3) { animation-delay: 80ms; }
.table tbody tr:nth-child(4) { animation-delay: 120ms; }
.table tbody tr:nth-child(n+5) { animation-delay: 160ms; }

/* Badges */
.fx-badge { display: inline-flex; align-items: center; gap: .3rem; padding: .16rem .6rem; border-radius: 999px; font-size: .72rem; font-weight: 600; border: 1px solid currentColor; white-space: nowrap; }
.fx-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 6px currentColor; }
.fx-badge-ok { color: var(--fx-green); background: rgba(61, 255, 168, .1); }
.fx-badge-info { color: var(--fx-cyan); background: rgba(34, 230, 255, .1); }
.fx-badge-warn { color: var(--fx-amber); background: rgba(255, 197, 61, .1); }
.fx-badge-bad { color: #ff7d94; background: rgba(255, 68, 102, .12); }
.fx-badge-mute { color: var(--fx-muted); background: rgba(154, 168, 204, .08); }

/* Buttons */
.btn { position: relative; overflow: hidden; border-radius: 11px; font-weight: 500; transition: transform .15s, box-shadow .2s, filter .2s; }
.btn:active { transform: scale(.97); }
.btn-primary {
    --bs-btn-color: #04121a;
    --bs-btn-hover-color: #04121a;
    --bs-btn-active-color: #04121a;
    --bs-btn-disabled-color: #04121a;
    border: 0;
    background: linear-gradient(120deg, var(--fx-cyan), #7fa5ff);
    box-shadow: 0 0 18px rgba(34, 230, 255, .35);
    font-weight: 600;
}
.btn-primary:hover, .btn-primary:focus-visible { background: linear-gradient(120deg, var(--fx-cyan), #7fa5ff); box-shadow: 0 0 28px rgba(34, 230, 255, .6); filter: brightness(1.07); }
.btn-primary::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: -70%;
    width: 45%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .55), transparent);
    transform: skewX(-20deg);
    transition: left .55s;
}
.btn-primary:hover::after { left: 130%; }
.btn-outline-light { --bs-btn-border-color: var(--fx-line); --bs-btn-color: var(--fx-text); --bs-btn-hover-bg: rgba(34, 230, 255, .1); --bs-btn-hover-border-color: var(--fx-cyan); --bs-btn-hover-color: #fff; --bs-btn-active-bg: rgba(34, 230, 255, .18); --bs-btn-active-border-color: var(--fx-cyan); --bs-btn-active-color: #fff; }

.fx-ripple { position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .35); transform: scale(0); animation: fx-ripple .6s ease-out forwards; pointer-events: none; }

@keyframes fx-ripple {
    to { transform: scale(3.4); opacity: 0; }
}

/* Forms */
.form-control, .form-select { background-color: rgba(8, 12, 30, .65); border-color: var(--fx-line); color: var(--fx-text); border-radius: 11px; }
.form-control:focus, .form-select:focus { background-color: rgba(8, 12, 30, .85); border-color: var(--fx-cyan); color: #fff; box-shadow: 0 0 0 3px rgba(34, 230, 255, .16), 0 0 18px rgba(34, 230, 255, .2); }
.form-control::placeholder { color: #6f7ca0; }
.form-control::file-selector-button { background: rgba(34, 230, 255, .12); color: var(--fx-text); }
.form-label { font-size: .84rem; color: var(--fx-muted); margin-bottom: .3rem; }
.form-select option { background: #0c1130; color: var(--fx-text); }
input[type="date"], input[type="month"] { color-scheme: dark; }

.fx-filters { display: flex; flex-wrap: wrap; gap: .6rem; align-items: end; }
.fx-filters > * { flex: 1 1 150px; min-width: 0; }
.fx-filters .fx-search { flex: 3 1 220px; }
.fx-filters .fx-filter-btn { flex: 0 0 auto; }

/* Avatars */
.fx-avatar { display: inline-grid; place-items: center; flex: none; width: var(--s, 38px); height: var(--s, 38px); border-radius: 50%; object-fit: cover; font-family: var(--fx-display); font-size: calc(var(--s, 38px) * .34); font-weight: 600; color: #fff; background: linear-gradient(135deg, var(--fx-violet), var(--fx-cyan)); box-shadow: 0 0 0 2px rgba(34, 230, 255, .35), 0 0 14px rgba(34, 230, 255, .3); }
.fx-person { display: flex; align-items: center; gap: .65rem; color: inherit; text-decoration: none; }
.fx-person:hover strong { color: var(--fx-cyan); }
.fx-person small { display: block; color: var(--fx-muted); font-size: .75rem; }

.fx-timeline { list-style: none; margin: 0; padding: 0; }
.fx-timeline li { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .55rem 0; border-bottom: 1px solid var(--fx-line); }
.fx-timeline li:last-child { border-bottom: 0; }

.fx-empty { text-align: center; padding: 2.2rem 1rem; color: var(--fx-muted); }
.fx-empty i { display: block; font-size: 2rem; margin-bottom: .4rem; color: var(--fx-violet); filter: drop-shadow(0 0 8px var(--fx-violet)); }

.fx-kv { display: grid; grid-template-columns: minmax(110px, auto) 1fr; gap: .4rem 1rem; margin: 0; }
.fx-kv dt { color: var(--fx-muted); font-weight: 400; font-size: .86rem; }
.fx-kv dd { margin: 0; overflow-wrap: anywhere; }

.fx-key { display: block; padding: .7rem; border: 1px dashed var(--fx-cyan); border-radius: 10px; color: var(--fx-cyan); background: rgba(34, 230, 255, .07); overflow-wrap: anywhere; font-size: .85rem; }

/* Modals, dropdowns, toasts, pagination, tabs */
.modal-content, .dropdown-menu { background: var(--fx-surface-strong); border: 1px solid var(--fx-line); border-radius: 16px; backdrop-filter: blur(20px); }
.modal-content { box-shadow: 0 0 60px rgba(139, 92, 246, .3); }
.modal-title { font-family: var(--fx-display); font-size: 1rem; letter-spacing: .05em; }
.dropdown-item:hover { background: rgba(34, 230, 255, .1); }
.toast { background: var(--fx-surface-strong); border: 1px solid var(--tone, var(--fx-cyan)); border-radius: 13px; box-shadow: 0 0 26px color-mix(in srgb, var(--tone, var(--fx-cyan)) 40%, transparent); backdrop-filter: blur(16px); }
.pagination { --bs-pagination-bg: rgba(8, 12, 30, .6); --bs-pagination-border-color: var(--fx-line); --bs-pagination-color: var(--fx-text); --bs-pagination-hover-bg: rgba(34, 230, 255, .12); --bs-pagination-hover-color: #fff; --bs-pagination-hover-border-color: var(--fx-line); --bs-pagination-active-bg: var(--fx-cyan); --bs-pagination-active-color: #04121a; --bs-pagination-active-border-color: var(--fx-cyan); --bs-pagination-disabled-bg: transparent; --bs-pagination-disabled-border-color: var(--fx-line); margin: 0; }
.nav-pills { --bs-nav-pills-link-active-bg: rgba(34, 230, 255, .16); --bs-nav-pills-link-active-color: var(--fx-cyan); --bs-nav-link-color: var(--fx-muted); --bs-nav-link-hover-color: var(--fx-text); gap: .3rem; }
.alert-danger { --bs-alert-bg: rgba(255, 68, 102, .12); --bs-alert-color: #ffb3c1; --bs-alert-border-color: rgba(255, 68, 102, .4); }

@media (max-width: 991.98px) {
    .fx-sidebar { transform: translateX(-100%); box-shadow: 0 0 50px rgba(0, 0, 0, .6); }
    body.fx-menu-open .fx-sidebar { transform: none; }
    body.fx-menu-open .fx-backdrop-click { display: block; position: fixed; inset: 0; z-index: 1035; background: rgba(0, 0, 0, .55); }
    .fx-main { margin-left: 0; }
    .fx-menu-btn { display: inline-flex; }
    .fx-content { padding: 1rem; }
    .fx-topbar { padding: .6rem 1rem; }
    .fx-clock { display: none; }
}
