/*
 * ═══════════════════════════════════════════════════════════════════════
 *  PROJECTBB ADMIN — PREMIUM DARK THEME
 *  Linear / Stripe-inspired. Glassmorphism. Indigo → Cyan gradient accent.
 *  Hand-rolled (no Vite/Tailwind build pipeline in this project).
 *  Loaded via PanelsRenderHook::HEAD_END in AdminPanelProvider.
 * ═══════════════════════════════════════════════════════════════════════
 *
 *  Sections:
 *    1. Design tokens (CSS variables)
 *    2. Tailwind utility shim (used by LiveCommand / RedirectFlows etc.)
 *    3. Filament panel overrides (sidebar, topbar, cards, tables, widgets)
 *    4. Custom components (kpi card, hero, premium login)
 *    5. Animations + scrollbar polish
 */

/* ═══ 1. DESIGN TOKENS ═══════════════════════════════════════════════ */
:root {
    /* Surfaces */
    --bb-bg-0: #07080d;          /* page void */
    --bb-bg-1: #0c0e16;          /* main surface */
    --bb-bg-2: #11141d;          /* elevated card */
    --bb-bg-3: #171b27;          /* hover */
    --bb-bg-4: #1f2533;          /* active */
    --bb-line: rgba(99, 102, 241, 0.08);
    --bb-line-strong: rgba(99, 102, 241, 0.18);

    /* Text */
    --bb-text-0: #f4f5fb;
    --bb-text-1: #cfd2e0;
    --bb-text-2: #8d92a8;
    --bb-text-3: #5f6478;

    /* Brand accent gradient */
    --bb-accent-from: #6366f1;   /* indigo-500 */
    --bb-accent-to:   #06b6d4;   /* cyan-500 */
    --bb-accent-glow: rgba(99, 102, 241, 0.45);

    /* Status */
    --bb-success: #10b981;
    --bb-info:    #06b6d4;
    --bb-warn:    #f59e0b;
    --bb-danger:  #ef4444;

    /* Geometry */
    --bb-radius-sm: 8px;
    --bb-radius:    12px;
    --bb-radius-lg: 16px;
    --bb-radius-xl: 22px;

    /* Shadows */
    --bb-shadow-sm: 0 1px 0 rgba(255,255,255,0.04) inset, 0 1px 2px rgba(0,0,0,0.35);
    --bb-shadow:    0 1px 0 rgba(255,255,255,0.05) inset, 0 8px 24px -8px rgba(0,0,0,0.55);
    --bb-shadow-lg: 0 1px 0 rgba(255,255,255,0.05) inset, 0 24px 60px -20px rgba(0,0,0,0.7);
    --bb-glow:      0 0 0 1px rgba(99,102,241,0.35), 0 8px 28px -6px rgba(99,102,241,0.5);
}

/* ═══ 2. TAILWIND UTILITY SHIM ═══════════════════════════════════════ */
/* Utilities used by existing pages (LiveCommand, RedirectFlows, widgets).
 * These class names must remain stable — DO NOT remove. */

/* widths */
.w-2     { width: 0.5rem; } .w-2\.5  { width: 0.625rem; }
.w-3     { width: 0.75rem; } .w-3\.5  { width: 0.875rem; }
.w-4     { width: 1rem; } .w-5     { width: 1.25rem; }
.w-6     { width: 1.5rem; } .w-8     { width: 2rem; }
.w-10    { width: 2.5rem; } .w-12    { width: 3rem; }
.w-16    { width: 4rem; } .w-px    { width: 1px; }
.w-full  { width: 100%; } .w-auto  { width: auto; } .w-fit   { width: fit-content; }
.min-w-0     { min-width: 0; }
.min-w-\[18px\] { min-width: 18px; }
.max-w-\[180px\] { max-width: 180px; }
.max-w-\[200px\] { max-width: 200px; }
.max-w-\[300px\] { max-width: 300px; }

/* heights */
.h-2     { height: 0.5rem; } .h-2\.5  { height: 0.625rem; }
.h-3     { height: 0.75rem; } .h-3\.5  { height: 0.875rem; }
.h-4     { height: 1rem; } .h-5     { height: 1.25rem; }
.h-6     { height: 1.5rem; } .h-8     { height: 2rem; }
.h-10    { height: 2.5rem; } .h-12    { height: 3rem; }
.h-16    { height: 4rem; } .h-full  { height: 100%; }
.min-h-\[200px\] { min-height: 200px; }
.max-h-64        { max-height: 16rem; }
.max-h-96        { max-height: 24rem; }
.max-h-\[400px\] { max-height: 400px; }

/* flex / grid */
.flex { display: flex; } .inline-flex { display: inline-flex; }
.inline-block { display: inline-block; } .block { display: block; }
.hidden { display: none; } .grid { display: grid; }
.flex-1 { flex: 1 1 0; } .flex-wrap { flex-wrap: wrap; }
.shrink-0 { flex-shrink: 0; }
.items-center { align-items: center; } .items-start  { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0,1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.col-span-2 { grid-column: span 2 / span 2; }

@media (min-width: 640px) {
    .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (min-width: 1024px) {
    .lg\:col-span-1 { grid-column: span 1 / span 1; }
    .lg\:col-span-2 { grid-column: span 2 / span 2; }
    .lg\:col-span-3 { grid-column: span 3 / span 3; }
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
    .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
}

/* spacing */
.gap-1 { gap: 0.25rem; } .gap-1\.5 { gap: 0.375rem; }
.gap-2 { gap: 0.5rem; } .gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; } .gap-6 { gap: 1.5rem; }
.gap-x-4 { column-gap: 1rem; } .gap-y-1 { row-gap: 0.25rem; }
.space-y-1 > * + * { margin-top: 0.25rem; }
.space-y-1\.5 > * + * { margin-top: 0.375rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.mb-1\.5 { margin-bottom: 0.375rem; } .mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; } .mb-4 { margin-bottom: 1rem; } .mb-6 { margin-bottom: 1.5rem; }
.mt-1 { margin-top: 0.25rem; } .mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; } .mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; } .mt-8 { margin-top: 2rem; }
.ml-2 { margin-left: 0.5rem; } .ml-auto { margin-left: auto; }
.mx-auto { margin-left: auto; margin-right: auto; }
.p-2 { padding: 0.5rem; } .p-3 { padding: 0.75rem; } .p-4 { padding: 1rem; }
.px-1\.5 { padding-inline: 0.375rem; } .px-2 { padding-inline: 0.5rem; }
.px-2\.5 { padding-inline: 0.625rem; } .px-3 { padding-inline: 0.75rem; }
.px-4 { padding-inline: 1rem; }
.py-0\.5 { padding-block: 0.125rem; } .py-1 { padding-block: 0.25rem; }
.py-1\.5 { padding-block: 0.375rem; } .py-2 { padding-block: 0.5rem; }
.py-3 { padding-block: 0.75rem; } .py-4 { padding-block: 1rem; }
.py-8 { padding-block: 2rem; } .py-12 { padding-block: 3rem; }
.pt-2 { padding-top: 0.5rem; } .pt-4 { padding-top: 1rem; }

/* borders */
.border    { border-width: 1px; border-style: solid; }
.border-b  { border-bottom-width: 1px; border-bottom-style: solid; }
.border-gray-700    { border-color: rgb(55, 65, 81); }
.border-gray-700\/50 { border-color: rgba(55, 65, 81, 0.5); }
.border-gray-500\/40 { border-color: rgba(107, 114, 128, 0.4); }
.border-gray-600\/30 { border-color: rgba(75, 85, 99, 0.3); }
.border-danger-500\/30 { border-color: color-mix(in srgb, var(--danger-500) 30%, transparent); }
.border-danger-500\/40 { border-color: color-mix(in srgb, var(--danger-500) 40%, transparent); }

/* rounded */
.rounded      { border-radius: 0.25rem; }
.rounded-lg   { border-radius: 0.5rem; }
.rounded-xl   { border-radius: 0.75rem; }
.rounded-full { border-radius: 9999px; }

/* colors (text + bg) */
.text-white { color: #fff; }
.text-gray-200 { color: rgb(229, 231, 235); }
.text-gray-300 { color: rgb(209, 213, 219); }
.text-gray-400 { color: rgb(156, 163, 175); }
.text-gray-500 { color: rgb(107, 114, 128); }
.text-danger-400 { color: color-mix(in srgb, var(--danger-500) 80%, white); }
.text-success-600 { color: color-mix(in srgb, var(--success-500) 80%, black); }
.text-success-400 { color: color-mix(in srgb, var(--success-500) 80%, white); }
.text-info-400 { color: color-mix(in srgb, var(--info-500) 80%, white); }
.text-warning-400 { color: color-mix(in srgb, var(--warning-500) 80%, white); }

.bg-blue-500 { background-color: rgb(59, 130, 246); }
.bg-gray-100 { background-color: rgb(243, 244, 246); }
.bg-gray-600 { background-color: rgb(75, 85, 99); }
.bg-gray-600\/20 { background-color: rgba(75, 85, 99, 0.2); }
.bg-gray-800 { background-color: rgb(31, 41, 55); }
.bg-gray-900 { background-color: rgb(17, 24, 39); }
.bg-danger-500 { background-color: var(--danger-500); }
.bg-danger-500\/15 { background-color: color-mix(in srgb, var(--danger-500) 15%, transparent); }
.bg-danger-500\/20 { background-color: color-mix(in srgb, var(--danger-500) 20%, transparent); }
.bg-success-500 { background-color: var(--success-500); }
.bg-success-500\/15 { background-color: color-mix(in srgb, var(--success-500) 15%, transparent); }
.bg-success-500\/20 { background-color: color-mix(in srgb, var(--success-500) 20%, transparent); }
.bg-warning-500 { background-color: var(--warning-500); }
.bg-warning-500\/15 { background-color: color-mix(in srgb, var(--warning-500) 15%, transparent); }
.bg-warning-500\/20 { background-color: color-mix(in srgb, var(--warning-500) 20%, transparent); }
.bg-info-500\/15 { background-color: color-mix(in srgb, var(--info-500) 15%, transparent); }
.bg-info-500\/20 { background-color: color-mix(in srgb, var(--info-500) 20%, transparent); }
.bg-primary-500 { background-color: var(--primary-500); }
.bg-primary-500\/10 { background-color: color-mix(in srgb, var(--primary-500) 10%, transparent); }
.bg-yellow-600\/20 { background-color: rgba(202, 138, 4, 0.2); }
.bg-white\/5  { background-color: rgba(255,255,255,0.05); }
.bg-white\/\[2\%\] { background-color: rgba(255,255,255,0.02); }
.bg-white\/\[3\%\] { background-color: rgba(255,255,255,0.03); }

.dark\:bg-gray-800 { background-color: rgb(31, 41, 55); }
@media (prefers-color-scheme: dark) {
    .dark\:bg-gray-800 { background-color: rgb(31, 41, 55); }
    .dark\:hover\:bg-gray-700:hover { background-color: rgb(55, 65, 81); }
}

/* hover variants */
.hover\:bg-gray-100:hover { background-color: rgb(243, 244, 246); }
.hover\:bg-gray-200:hover { background-color: rgb(229, 231, 235); }
.hover\:bg-gray-600\/30:hover { background-color: rgba(75, 85, 99, 0.3); }
.hover\:bg-gray-700\/30:hover { background-color: rgba(55, 65, 81, 0.3); }
.hover\:bg-yellow-600\/30:hover { background-color: rgba(202, 138, 4, 0.3); }
.hover\:bg-primary-600:hover { background-color: color-mix(in srgb, var(--primary-500) 80%, black); }
.hover\:bg-danger-500\/30:hover { background-color: color-mix(in srgb, var(--danger-500) 30%, transparent); }
.hover\:bg-white\/5:hover { background-color: rgba(255,255,255,0.05); }
.hover\:text-gray-200:hover { color: rgb(229, 231, 235); }
.hover\:text-primary-300:hover { color: color-mix(in srgb, var(--primary-500) 70%, white); }
.hover\:text-white:hover { color: #fff; }
.hover\:underline:hover { text-decoration-line: underline; }

/* text sizes / weight */
.text-\[10px\] { font-size: 10px; }
.text-\[11px\] { font-size: 11px; }
.text-base { font-size: 1rem; line-height: 1.5; }
.text-center { text-align: center; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }
.font-normal { font-weight: 400; }
.font-mono { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; }
.italic { font-style: italic; }
.tracking-wider { letter-spacing: 0.05em; }
.uppercase { text-transform: uppercase; }
.leading-none { line-height: 1; }
.leading-relaxed { line-height: 1.625; }

/* layout / misc */
.relative { position: relative; } .absolute { position: absolute; }
.right-0  { right: 0; }
.top-1, .-top-1   { top: 0.25rem; }
.right-1, .-right-1 { right: 0.25rem; }
.-right-1 { right: -0.25rem; }
.-top-1   { top: -0.25rem; }
.z-50 { z-index: 50; }
.overflow-hidden { overflow: hidden; }
.overflow-x-auto { overflow-x: auto; }
.overflow-y-auto { overflow-y: auto; }
.shadow-2xl { box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25); }
.opacity-70 { opacity: 0.7; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.whitespace-pre-wrap { white-space: pre-wrap; }
.transition { transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter; transition-duration: 150ms; }

/* SVG icon sane default sizing */
.fi-main svg:not([width]):not([height]),
.fi-page svg:not([width]):not([height]) {
    width: 1.25rem;
    height: 1.25rem;
}
.fi-page [class*="w-"][class*="h-"] svg {
    width: 100%;
    height: 100%;
}

/* ═══ 3. FILAMENT PANEL OVERRIDES ════════════════════════════════════ */

/* Base body — deep void with subtle aurora glow */
html.dark, html.dark body, .fi-body {
    background:
        radial-gradient(1200px 600px at 88% -10%, rgba(6,182,212,0.08), transparent 60%),
        radial-gradient(900px 500px at -10% 110%, rgba(99,102,241,0.10), transparent 55%),
        var(--bb-bg-0) !important;
    color: var(--bb-text-1) !important;
    font-feature-settings: "cv11", "ss01", "ss03";
    -webkit-font-smoothing: antialiased;
}

/* Main content layer */
.fi-main {
    background: transparent !important;
}

/* ─── Sidebar ─────────────────────────────────────────────────────── */
.fi-sidebar {
    background: linear-gradient(180deg, rgba(12,14,22,0.95), rgba(7,8,13,0.98)) !important;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-right: 1px solid var(--bb-line) !important;
    box-shadow: inset -1px 0 0 rgba(255,255,255,0.02);
}

.fi-sidebar-header {
    background: transparent !important;
    border-bottom: 1px solid var(--bb-line) !important;
    padding: 1.25rem 1.25rem !important;
}

.fi-sidebar-nav-groups {
    padding: 0.5rem 0.5rem !important;
    gap: 0.25rem !important;
}

.fi-sidebar-group-label {
    color: var(--bb-text-3) !important;
    font-size: 10.5px !important;
    font-weight: 600 !important;
    letter-spacing: 0.12em !important;
    text-transform: uppercase !important;
    padding: 1rem 0.875rem 0.5rem !important;
}

.fi-sidebar-item {
    margin: 1px 0 !important;
}

.fi-sidebar-item-button {
    border-radius: 10px !important;
    padding: 0.55rem 0.75rem !important;
    color: var(--bb-text-2) !important;
    font-weight: 500 !important;
    font-size: 13.5px !important;
    transition: all 160ms cubic-bezier(0.4, 0, 0.2, 1) !important;
    border: 1px solid transparent !important;
    position: relative;
}

.fi-sidebar-item-button:hover {
    background: rgba(255,255,255,0.025) !important;
    color: var(--bb-text-0) !important;
    border-color: var(--bb-line) !important;
}

.fi-sidebar-item-button .fi-sidebar-item-icon {
    color: var(--bb-text-3) !important;
    transition: color 160ms ease !important;
}
.fi-sidebar-item-button:hover .fi-sidebar-item-icon {
    color: var(--bb-accent-from) !important;
}

/* Active sidebar item — glowing gradient bar */
.fi-sidebar-item-active > .fi-sidebar-item-button {
    background: linear-gradient(90deg, rgba(99,102,241,0.15), rgba(6,182,212,0.05)) !important;
    color: var(--bb-text-0) !important;
    border-color: var(--bb-line-strong) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 2px 8px -2px rgba(99,102,241,0.25) !important;
}
.fi-sidebar-item-active > .fi-sidebar-item-button::before {
    content: '';
    position: absolute;
    left: -0.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: linear-gradient(180deg, var(--bb-accent-from), var(--bb-accent-to));
    border-radius: 0 3px 3px 0;
    box-shadow: 0 0 12px var(--bb-accent-glow);
}
.fi-sidebar-item-active > .fi-sidebar-item-button .fi-sidebar-item-icon {
    color: var(--bb-accent-from) !important;
    filter: drop-shadow(0 0 6px var(--bb-accent-glow));
}

/* Brand logo area */
.fi-logo {
    font-family: 'Inter', system-ui, sans-serif !important;
    font-weight: 800 !important;
    font-size: 17px !important;
    letter-spacing: -0.02em !important;
    background: linear-gradient(135deg, var(--bb-text-0) 0%, var(--bb-accent-from) 50%, var(--bb-accent-to) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent !important;
}

/* ─── Topbar ─────────────────────────────────────────────────────── */
.fi-topbar {
    background: rgba(7,8,13,0.65) !important;
    backdrop-filter: blur(24px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
    border-bottom: 1px solid var(--bb-line) !important;
}

.fi-topbar > nav {
    background: transparent !important;
}

.fi-breadcrumbs-item, .fi-breadcrumbs a {
    color: var(--bb-text-2) !important;
    font-size: 13px !important;
    font-weight: 500 !important;
}
.fi-breadcrumbs-item:last-child {
    color: var(--bb-text-0) !important;
}

/* Global search */
.fi-global-search-field input {
    background: rgba(255,255,255,0.025) !important;
    border: 1px solid var(--bb-line) !important;
    border-radius: 10px !important;
    color: var(--bb-text-1) !important;
    font-size: 13.5px !important;
    transition: all 150ms ease !important;
}
.fi-global-search-field input:focus {
    border-color: var(--bb-accent-from) !important;
    box-shadow: 0 0 0 4px rgba(99,102,241,0.12) !important;
    background: rgba(255,255,255,0.04) !important;
}
.fi-global-search-field input::placeholder { color: var(--bb-text-3) !important; }

/* ─── Page header ─────────────────────────────────────────────────── */
.fi-header {
    padding: 1.75rem 0 1.25rem !important;
    border-bottom: 1px solid var(--bb-line) !important;
    margin-bottom: 1.75rem !important;
}

.fi-header-heading {
    font-size: 28px !important;
    font-weight: 700 !important;
    letter-spacing: -0.025em !important;
    color: var(--bb-text-0) !important;
    line-height: 1.15 !important;
}

.fi-header-subheading {
    color: var(--bb-text-2) !important;
    font-size: 14px !important;
    margin-top: 0.35rem !important;
}

/* ─── Cards / Sections ────────────────────────────────────────────── */
.fi-section, .fi-wi-stats-overview-stat, .fi-fo-component-ctn {
    background: linear-gradient(180deg, var(--bb-bg-2), var(--bb-bg-1)) !important;
    border: 1px solid var(--bb-line) !important;
    border-radius: var(--bb-radius-lg) !important;
    box-shadow: var(--bb-shadow) !important;
    transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease !important;
}

.fi-section:hover {
    border-color: var(--bb-line-strong) !important;
}

.fi-section-header {
    border-bottom: 1px solid var(--bb-line) !important;
    padding: 1.1rem 1.5rem !important;
}

.fi-section-header-heading {
    color: var(--bb-text-0) !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    letter-spacing: -0.01em !important;
}

.fi-section-content {
    padding: 1.5rem !important;
}

/* ─── Tables ──────────────────────────────────────────────────────── */
.fi-ta {
    background: linear-gradient(180deg, var(--bb-bg-2), var(--bb-bg-1)) !important;
    border: 1px solid var(--bb-line) !important;
    border-radius: var(--bb-radius-lg) !important;
    overflow: hidden !important;
    box-shadow: var(--bb-shadow) !important;
}

.fi-ta-header {
    background: rgba(255,255,255,0.012) !important;
    border-bottom: 1px solid var(--bb-line) !important;
    padding: 1rem 1.25rem !important;
}

.fi-ta-header-cell, .fi-ta thead th {
    background: transparent !important;
    color: var(--bb-text-3) !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    letter-spacing: 0.06em !important;
    text-transform: uppercase !important;
    padding: 0.85rem 1rem !important;
    border-bottom: 1px solid var(--bb-line) !important;
}

.fi-ta-row {
    border-bottom: 1px solid rgba(99,102,241,0.04) !important;
    transition: background 120ms ease !important;
}
.fi-ta-row:hover {
    background: rgba(99,102,241,0.025) !important;
}
.fi-ta-row:last-child { border-bottom: none !important; }

.fi-ta-cell, .fi-ta tbody td {
    color: var(--bb-text-1) !important;
    font-size: 13.5px !important;
    padding: 0.9rem 1rem !important;
}

.fi-ta-text { color: var(--bb-text-1) !important; }
.fi-ta-text-item-label { color: var(--bb-text-2) !important; font-size: 12px !important; }

/* Pagination */
.fi-pagination {
    background: rgba(255,255,255,0.012) !important;
    border-top: 1px solid var(--bb-line) !important;
    padding: 0.85rem 1.25rem !important;
}

/* ─── Buttons ─────────────────────────────────────────────────────── */
.fi-btn {
    font-weight: 600 !important;
    letter-spacing: -0.005em !important;
    transition: all 160ms cubic-bezier(0.4, 0, 0.2, 1) !important;
    border-radius: 9px !important;
}

/* Primary — gradient with glow */
.fi-btn-color-primary, .fi-ac-action.fi-btn-color-primary {
    background: linear-gradient(135deg, var(--bb-accent-from), #4f46e5) !important;
    color: #fff !important;
    border: 1px solid rgba(255,255,255,0.08) !important;
    box-shadow: 0 1px 0 rgba(255,255,255,0.18) inset, 0 6px 18px -6px var(--bb-accent-glow) !important;
}
.fi-btn-color-primary:hover {
    background: linear-gradient(135deg, #7c7ff5, #6366f1) !important;
    transform: translateY(-1px);
    box-shadow: 0 1px 0 rgba(255,255,255,0.22) inset, 0 10px 24px -6px var(--bb-accent-glow) !important;
}

/* Secondary */
.fi-btn-color-gray {
    background: rgba(255,255,255,0.035) !important;
    color: var(--bb-text-1) !important;
    border: 1px solid var(--bb-line) !important;
}
.fi-btn-color-gray:hover {
    background: rgba(255,255,255,0.06) !important;
    border-color: var(--bb-line-strong) !important;
}

/* ─── Form inputs ─────────────────────────────────────────────────── */
.fi-input, .fi-input-wrp input, .fi-input-wrp textarea, .fi-input-wrp select,
.fi-fo-text-input input, .fi-fo-textarea textarea, .fi-fo-select select {
    background: rgba(255,255,255,0.02) !important;
    border: 1px solid var(--bb-line) !important;
    border-radius: 9px !important;
    color: var(--bb-text-0) !important;
    font-size: 13.5px !important;
    transition: all 150ms ease !important;
}
.fi-input:focus, .fi-input-wrp input:focus, .fi-input-wrp textarea:focus,
.fi-fo-text-input input:focus, .fi-fo-textarea textarea:focus {
    border-color: var(--bb-accent-from) !important;
    box-shadow: 0 0 0 4px rgba(99,102,241,0.12) !important;
    background: rgba(255,255,255,0.035) !important;
    outline: none !important;
}
.fi-input::placeholder, .fi-input-wrp input::placeholder {
    color: var(--bb-text-3) !important;
}

.fi-fo-field-wrp-label, label.fi-fo-field-wrp-label {
    color: var(--bb-text-2) !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    letter-spacing: 0.01em !important;
    text-transform: none !important;
}

/* ─── Badges ──────────────────────────────────────────────────────── */
.fi-badge {
    border-radius: 6px !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    letter-spacing: 0.02em !important;
    padding: 0.2rem 0.55rem !important;
    border: 1px solid transparent !important;
}

.fi-color-success, .fi-badge.fi-color-success {
    background: rgba(16, 185, 129, 0.13) !important;
    color: #34d399 !important;
    border-color: rgba(16, 185, 129, 0.25) !important;
}
.fi-color-danger, .fi-badge.fi-color-danger {
    background: rgba(239, 68, 68, 0.13) !important;
    color: #f87171 !important;
    border-color: rgba(239, 68, 68, 0.25) !important;
}
.fi-color-warning, .fi-badge.fi-color-warning {
    background: rgba(245, 158, 11, 0.13) !important;
    color: #fbbf24 !important;
    border-color: rgba(245, 158, 11, 0.25) !important;
}
.fi-color-info, .fi-badge.fi-color-info {
    background: rgba(6, 182, 212, 0.13) !important;
    color: #22d3ee !important;
    border-color: rgba(6, 182, 212, 0.25) !important;
}

/* ─── Stats Overview Widget (KPI cards) ──────────────────────────── */
.fi-wi-stats-overview-stat {
    padding: 1.5rem !important;
    position: relative;
    overflow: hidden;
}
.fi-wi-stats-overview-stat::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--bb-accent-from), transparent);
    opacity: 0.5;
}
.fi-wi-stats-overview-stat::after {
    content: '';
    position: absolute;
    top: -60px; right: -60px;
    width: 180px; height: 180px;
    background: radial-gradient(circle, rgba(99,102,241,0.12), transparent 65%);
    pointer-events: none;
}
.fi-wi-stats-overview-stat-label {
    color: var(--bb-text-3) !important;
    font-size: 11.5px !important;
    font-weight: 600 !important;
    letter-spacing: 0.08em !important;
    text-transform: uppercase !important;
}
.fi-wi-stats-overview-stat-value {
    color: var(--bb-text-0) !important;
    font-size: 32px !important;
    font-weight: 700 !important;
    letter-spacing: -0.02em !important;
    font-variant-numeric: tabular-nums !important;
    margin-top: 0.4rem !important;
}
.fi-wi-stats-overview-stat-description {
    color: var(--bb-text-2) !important;
    font-size: 12.5px !important;
    margin-top: 0.5rem !important;
}

/* ─── Modals ──────────────────────────────────────────────────────── */
.fi-modal-window {
    background: linear-gradient(180deg, var(--bb-bg-2), var(--bb-bg-1)) !important;
    border: 1px solid var(--bb-line-strong) !important;
    border-radius: var(--bb-radius-xl) !important;
    box-shadow: var(--bb-shadow-lg) !important;
}

/* ─── Notifications ───────────────────────────────────────────────── */
.fi-no-notification {
    background: linear-gradient(180deg, var(--bb-bg-2), var(--bb-bg-1)) !important;
    border: 1px solid var(--bb-line-strong) !important;
    border-radius: var(--bb-radius) !important;
    box-shadow: var(--bb-shadow-lg) !important;
    color: var(--bb-text-1) !important;
}

/* ═══ 4. CUSTOM COMPONENTS ═══════════════════════════════════════════ */

/* Premium KPI tile (for custom widgets if you want) */
.bb-kpi {
    position: relative;
    padding: 1.5rem;
    background: linear-gradient(180deg, var(--bb-bg-2), var(--bb-bg-1));
    border: 1px solid var(--bb-line);
    border-radius: var(--bb-radius-lg);
    box-shadow: var(--bb-shadow);
    overflow: hidden;
}
.bb-kpi__label {
    color: var(--bb-text-3);
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.bb-kpi__value {
    color: var(--bb-text-0);
    font-size: 34px;
    font-weight: 700;
    letter-spacing: -0.025em;
    font-variant-numeric: tabular-nums;
    margin-top: 0.5rem;
}
.bb-kpi__delta {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.6rem;
    font-size: 12px;
    font-weight: 600;
    color: var(--bb-success);
}
.bb-kpi__delta--down { color: var(--bb-danger); }

/* Premium login screen */
.fi-simple-layout {
    background:
        radial-gradient(1400px 700px at 50% -10%, rgba(99,102,241,0.18), transparent 55%),
        radial-gradient(800px 500px at 10% 110%, rgba(6,182,212,0.15), transparent 50%),
        radial-gradient(900px 500px at 90% 90%, rgba(168,85,247,0.10), transparent 55%),
        var(--bb-bg-0) !important;
    position: relative;
    overflow: hidden;
}

.fi-simple-layout::before {
    content: '';
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(99,102,241,0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99,102,241,0.04) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
    pointer-events: none;
}

.fi-simple-main {
    background: linear-gradient(180deg, rgba(17,20,29,0.85), rgba(12,14,22,0.95)) !important;
    border: 1px solid var(--bb-line-strong) !important;
    border-radius: var(--bb-radius-xl) !important;
    backdrop-filter: blur(28px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(28px) saturate(180%) !important;
    box-shadow:
        0 1px 0 rgba(255,255,255,0.06) inset,
        0 30px 80px -20px rgba(0,0,0,0.75),
        0 0 0 1px rgba(99,102,241,0.10) !important;
    padding: 2.5rem 2.25rem !important;
    position: relative;
    z-index: 1;
}

.fi-simple-header {
    text-align: center !important;
    margin-bottom: 1.75rem !important;
}
.fi-simple-header-heading {
    font-size: 26px !important;
    font-weight: 700 !important;
    letter-spacing: -0.025em !important;
    background: linear-gradient(135deg, var(--bb-text-0) 0%, var(--bb-accent-from) 60%, var(--bb-accent-to) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent !important;
}
.fi-simple-header-subheading {
    color: var(--bb-text-2) !important;
    font-size: 13.5px !important;
    margin-top: 0.4rem !important;
}

/* ═══ 5. ANIMATIONS + SCROLLBAR ══════════════════════════════════════ */

.animate-pulse { animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes bbFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.fi-main > div, .fi-section, .fi-wi-stats-overview-stat {
    animation: bbFadeIn 0.45s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}
.fi-wi-stats-overview-stat:nth-child(1) { animation-delay: 0.00s; }
.fi-wi-stats-overview-stat:nth-child(2) { animation-delay: 0.06s; }
.fi-wi-stats-overview-stat:nth-child(3) { animation-delay: 0.12s; }
.fi-wi-stats-overview-stat:nth-child(4) { animation-delay: 0.18s; }

@keyframes bbShimmer {
    0%   { background-position: -200% 0; }
    100% { background-position:  200% 0; }
}

/* Sleek scrollbars */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(99,102,241,0.3) transparent;
}
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
    background: rgba(99,102,241,0.25);
    border-radius: 8px;
    border: 2px solid transparent;
    background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover {
    background: rgba(99,102,241,0.45);
    background-clip: content-box;
}

/* Text selection */
::selection {
    background: rgba(99,102,241,0.35);
    color: var(--bb-text-0);
}

/* Inter font via system fallback (already loaded by Filament if ->font('Inter') set) */
.fi-body, .fi-main, .fi-sidebar, .fi-topbar {
    font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif !important;
    font-feature-settings: "cv11", "ss01", "ss03";
}

/* Mono for code-ish content */
.fi-ta-text.font-mono, .fi-fo-text-input input[type="text"][data-mono],
code, kbd, samp, pre {
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
}

/* ═══════════════════════════════════════════════════════════════════
 * PHASE 2 — Activity feed, Top targets, Funnel donut, Command palette
 * Added after the base theme. All `bb-*` prefixed to avoid collisions.
 * ═══════════════════════════════════════════════════════════════════ */

/* ─── Activity Feed ──────────────────────────────────────────────── */
.bb-feed-controls {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.bb-feed-control-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--bb-line);
    color: var(--bb-text-2);
    cursor: pointer;
    transition: all 160ms ease;
}
.bb-feed-control-btn:hover {
    background: rgba(255,255,255,0.07);
    color: var(--bb-text-0);
    border-color: var(--bb-line-strong);
}
.bb-feed-control-btn--muted {
    color: var(--bb-warn);
    border-color: rgba(245,158,11,0.3);
    background: rgba(245,158,11,0.08);
}
.bb-feed-filter {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--bb-line);
    color: var(--bb-text-1);
    border-radius: 8px;
    padding: 0.35rem 0.75rem;
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all 160ms ease;
}
.bb-feed-filter:focus {
    outline: none;
    border-color: var(--bb-accent-from);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}
.bb-feed-filter option { background: var(--bb-bg-2); color: var(--bb-text-1); }

.bb-feed {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 520px;
    overflow-y: auto;
    padding-right: 4px;
}

.bb-feed-empty {
    text-align: center;
    color: var(--bb-text-3);
    padding: 3rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}
.bb-feed-empty p { font-size: 13px; margin: 0; }

.bb-feed-item {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0.75rem 0.9rem;
    background: rgba(255,255,255,0.015);
    border: 1px solid var(--bb-line);
    border-left: 3px solid var(--bb-text-3);
    border-radius: 10px;
    transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}
.bb-feed-item:hover {
    background: rgba(255,255,255,0.035);
    border-color: var(--bb-line-strong);
}

.bb-feed-item--low      { border-left-color: rgba(141, 146, 168, 0.6); }
.bb-feed-item--medium   { border-left-color: var(--bb-info); }
.bb-feed-item--high     { border-left-color: var(--bb-warn); background: rgba(245,158,11,0.03); }
.bb-feed-item--critical {
    border-left-color: var(--bb-danger);
    background: linear-gradient(90deg, rgba(239,68,68,0.05), transparent 60%);
}

.bb-feed-item__rail {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(99,102,241,0.08);
    color: var(--bb-accent-from);
}
.bb-feed-item__rail svg { width: 16px; height: 16px; }

.bb-feed-item--high .bb-feed-item__rail {
    background: rgba(245,158,11,0.12);
    color: var(--bb-warn);
}
.bb-feed-item--critical .bb-feed-item__rail {
    background: rgba(239,68,68,0.15);
    color: var(--bb-danger);
}

.bb-feed-item__body { flex: 1; min-width: 0; }
.bb-feed-item__title {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 0.2rem;
}
.bb-feed-item__type {
    color: var(--bb-text-0);
    font-size: 13.5px;
    font-weight: 600;
    letter-spacing: -0.005em;
}
.bb-feed-item__time {
    color: var(--bb-text-3);
    font-size: 11.5px;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}
.bb-feed-item__subtitle {
    color: var(--bb-text-2);
    font-size: 12.5px;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    word-break: break-all;
}

/* Entry animation — sweep glow when new */
@keyframes bbFeedGlow {
    0%   { transform: translateY(-6px); opacity: 0; box-shadow: 0 0 0 0 rgba(99,102,241,0.45); }
    20%  { transform: translateY(0);    opacity: 1; box-shadow: 0 0 0 6px rgba(99,102,241,0.15); }
    100% { transform: translateY(0);    opacity: 1; box-shadow: 0 0 0 0 rgba(99,102,241,0); }
}
.bb-feed-item--new {
    animation: bbFeedGlow 1.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.bb-feed-item--critical.bb-feed-item--new {
    animation-name: bbFeedGlowCritical;
}
@keyframes bbFeedGlowCritical {
    0%   { transform: translateY(-6px); opacity: 0; box-shadow: 0 0 0 0 rgba(239,68,68,0.55); }
    20%  { transform: translateY(0);    opacity: 1; box-shadow: 0 0 0 8px rgba(239,68,68,0.18); }
    100% { transform: translateY(0);    opacity: 1; box-shadow: 0 0 0 0 rgba(239,68,68,0); }
}

/* ─── Top Targets leaderboard ──────────────────────────────────────── */
.bb-targets {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.bb-target-row {
    display: grid;
    grid-template-columns: 28px 36px 1fr auto auto;
    align-items: center;
    gap: 0.85rem;
    padding: 0.7rem 0.85rem;
    background: rgba(255,255,255,0.015);
    border: 1px solid var(--bb-line);
    border-radius: 10px;
    transition: all 160ms ease;
}
.bb-target-row:hover {
    background: rgba(255,255,255,0.04);
    border-color: var(--bb-line-strong);
    transform: translateX(2px);
}
.bb-target-rank {
    color: var(--bb-text-3);
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
}
.bb-target-row--top1 .bb-target-rank { color: #fbbf24; }
.bb-target-row--top2 .bb-target-rank { color: #cbd5e1; }
.bb-target-row--top3 .bb-target-rank { color: #f59e0b; }

.bb-target-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, var(--bb-accent-from), var(--bb-accent-to));
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: -0.02em;
}
.bb-target-info { min-width: 0; }
.bb-target-ip {
    color: var(--bb-text-0);
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 600;
}
.bb-target-loc {
    color: var(--bb-text-2);
    font-size: 11.5px;
    margin-top: 1px;
}
.bb-target-stat {
    color: var(--bb-text-1);
    font-size: 13px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    text-align: right;
    line-height: 1.2;
}
.bb-target-stat__label {
    display: block;
    color: var(--bb-text-3);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-top: 1px;
}

/* ─── Funnel donut ────────────────────────────────────────────────── */
.bb-funnel {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 2rem;
    align-items: center;
    padding: 0.5rem;
}
@media (max-width: 640px) {
    .bb-funnel { grid-template-columns: 1fr; gap: 1rem; }
}
.bb-funnel-svg {
    width: 220px;
    height: 220px;
    transform: rotate(-90deg);
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3));
}
.bb-funnel-svg circle {
    fill: none;
    stroke-width: 18;
    transition: stroke-dashoffset 600ms cubic-bezier(0.4, 0, 0.2, 1);
}
.bb-funnel-center {
    position: relative;
}
.bb-funnel-center-text {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
.bb-funnel-center-value {
    color: var(--bb-text-0);
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}
.bb-funnel-center-label {
    color: var(--bb-text-3);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-top: 0.4rem;
}
.bb-funnel-legend {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.bb-funnel-legend-row {
    display: grid;
    grid-template-columns: 12px 1fr auto auto;
    align-items: center;
    gap: 0.8rem;
    padding: 0.45rem 0;
    border-bottom: 1px solid rgba(99,102,241,0.06);
}
.bb-funnel-legend-row:last-child { border-bottom: none; }
.bb-funnel-legend-dot {
    width: 12px; height: 12px; border-radius: 3px;
}
.bb-funnel-legend-label {
    color: var(--bb-text-1);
    font-size: 13px;
    font-weight: 500;
}
.bb-funnel-legend-value {
    color: var(--bb-text-0);
    font-size: 14px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.bb-funnel-legend-pct {
    color: var(--bb-text-3);
    font-size: 11.5px;
    font-variant-numeric: tabular-nums;
    min-width: 48px;
    text-align: right;
}

/* ─── Command Palette (⌘K) ────────────────────────────────────────── */
.bb-cmdk-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(7,8,13,0.65);
    backdrop-filter: blur(8px) saturate(140%);
    -webkit-backdrop-filter: blur(8px) saturate(140%);
    z-index: 9999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 12vh;
    animation: bbCmdkFadeIn 140ms ease;
}
@keyframes bbCmdkFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.bb-cmdk {
    width: 640px;
    max-width: 90vw;
    max-height: 70vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #11141d, #0c0e16);
    border: 1px solid var(--bb-line-strong);
    border-radius: 16px;
    box-shadow:
        0 1px 0 rgba(255,255,255,0.06) inset,
        0 30px 80px -10px rgba(0,0,0,0.75),
        0 0 0 1px rgba(99,102,241,0.12);
    overflow: hidden;
    animation: bbCmdkPop 200ms cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes bbCmdkPop {
    from { opacity: 0; transform: translateY(-12px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.bb-cmdk-search {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.95rem 1.1rem;
    border-bottom: 1px solid var(--bb-line);
}
.bb-cmdk-search svg {
    width: 18px; height: 18px;
    color: var(--bb-text-3);
    flex-shrink: 0;
}
.bb-cmdk-search input {
    flex: 1;
    background: transparent;
    border: 0;
    outline: 0;
    color: var(--bb-text-0);
    font-size: 15px;
    font-weight: 500;
}
.bb-cmdk-search input::placeholder { color: var(--bb-text-3); }
.bb-cmdk-search kbd {
    padding: 0.15rem 0.45rem;
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--bb-line);
    border-radius: 5px;
    color: var(--bb-text-2);
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
}
.bb-cmdk-list {
    overflow-y: auto;
    padding: 0.4rem;
}
.bb-cmdk-group {
    padding: 0.25rem 0;
}
.bb-cmdk-group-label {
    color: var(--bb-text-3);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.5rem 0.85rem 0.35rem;
}
.bb-cmdk-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.55rem 0.85rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background 100ms ease;
}
.bb-cmdk-item:hover,
.bb-cmdk-item.bb-cmdk-item--active {
    background: linear-gradient(90deg, rgba(99,102,241,0.15), rgba(6,182,212,0.05));
}
.bb-cmdk-item__icon {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.04);
    color: var(--bb-text-2);
    flex-shrink: 0;
}
.bb-cmdk-item__icon svg { width: 14px; height: 14px; }
.bb-cmdk-item.bb-cmdk-item--active .bb-cmdk-item__icon {
    background: rgba(99,102,241,0.15);
    color: var(--bb-accent-from);
}
.bb-cmdk-item__label {
    flex: 1;
    color: var(--bb-text-1);
    font-size: 13.5px;
    font-weight: 500;
}
.bb-cmdk-item.bb-cmdk-item--active .bb-cmdk-item__label { color: var(--bb-text-0); }
.bb-cmdk-item__hint {
    color: var(--bb-text-3);
    font-size: 11px;
    font-family: 'JetBrains Mono', monospace;
}
.bb-cmdk-empty {
    padding: 2.5rem 1rem;
    text-align: center;
    color: var(--bb-text-3);
    font-size: 13px;
}
.bb-cmdk-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.55rem 0.95rem;
    border-top: 1px solid var(--bb-line);
    font-size: 11px;
    color: var(--bb-text-3);
}
.bb-cmdk-footer kbd {
    padding: 0.1rem 0.4rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--bb-line);
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10.5px;
    color: var(--bb-text-2);
}

/* ─── LiveCommand polish overlays ────────────────────────────────── */
.bb-live-card {
    background: linear-gradient(180deg, var(--bb-bg-2), var(--bb-bg-1));
    border: 1px solid var(--bb-line);
    border-radius: var(--bb-radius-lg);
    overflow: hidden;
    transition: all 160ms ease;
}
.bb-live-card:hover { border-color: var(--bb-line-strong); }
.bb-live-card--awaiting { border-left: 3px solid var(--bb-warn); }
.bb-live-card--redirect { border-left: 3px solid var(--bb-info); }
.bb-live-card--done     { border-left: 3px solid var(--bb-success); }
.bb-live-card--error    { border-left: 3px solid var(--bb-danger); }

.bb-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.bb-status-pill::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: currentColor;
    box-shadow: 0 0 0 0 currentColor;
    animation: bbPulseDot 1.6s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
.bb-status-pill--live { background: rgba(16,185,129,0.13); color: #34d399; border: 1px solid rgba(16,185,129,0.3); }
.bb-status-pill--awaiting { background: rgba(245,158,11,0.13); color: #fbbf24; border: 1px solid rgba(245,158,11,0.3); }
.bb-status-pill--done { background: rgba(6,182,212,0.13); color: #22d3ee; border: 1px solid rgba(6,182,212,0.3); }
@keyframes bbPulseDot {
    0%, 100% { box-shadow: 0 0 0 0 currentColor; opacity: 1; }
    50%      { box-shadow: 0 0 0 4px transparent; opacity: 0.5; }
}

/* ─── LiveCommand page polish (no markup changes — CSS overlay) ─── */
/* The .submission-card class is hand-rolled in live-command.blade.php.
   We give it the same premium look as our other cards. */
.submission-card {
    background: linear-gradient(180deg, var(--bb-bg-2), var(--bb-bg-1)) !important;
    border: 1px solid var(--bb-line) !important;
    border-radius: var(--bb-radius-lg) !important;
    box-shadow: var(--bb-shadow) !important;
    transition: all 180ms cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: relative;
    overflow: hidden;
}
.submission-card:hover {
    border-color: var(--bb-line-strong) !important;
    transform: translateY(-1px);
}
/* Top accent bar that flashes on .flash-updated (existing class in
   live-command). Subtle indigo gradient bar across the card top. */
.submission-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--bb-accent-from), var(--bb-accent-to), transparent);
    opacity: 0;
    transition: opacity 400ms ease;
}
.submission-card.flash-updated::before { opacity: 1; }

/* New-submission flash (existing .flash-new class on submission-row) */
@keyframes bbLiveFlashNew {
    0%   { background: rgba(99,102,241,0.18); }
    100% { background: transparent; }
}
.flash-new { animation: bbLiveFlashNew 1.4s ease-out; }

/* Per-stage left rail color on submission cards. The page already encodes
   status into a data attr — leverage it for a visual at-a-glance cue. */
.submission-card[data-status="awaiting"]    { border-left: 3px solid var(--bb-warn) !important; }
.submission-card[data-status="redirect"]    { border-left: 3px solid var(--bb-info) !important; }
.submission-card[data-status="done"]        { border-left: 3px solid var(--bb-success) !important; }
.submission-card[data-status="error"]       { border-left: 3px solid var(--bb-danger) !important; }
.submission-card[data-status="captured"]    { border-left: 3px solid var(--bb-accent-from) !important; }

/* The status legend at the top of the page — make pulse dots glow. */
.live-command-legend .animate-pulse {
    box-shadow: 0 0 8px currentColor;
}

/* Live user cards (the left sidebar of LiveCommand) */
.live-user-card {
    background: linear-gradient(180deg, var(--bb-bg-2), var(--bb-bg-1)) !important;
    border: 1px solid var(--bb-line) !important;
    border-radius: var(--bb-radius) !important;
    transition: all 160ms ease !important;
}
.live-user-card:hover {
    border-color: var(--bb-line-strong) !important;
    background: linear-gradient(180deg, var(--bb-bg-3), var(--bb-bg-2)) !important;
}

/* The "LIVE" status pill in live-command — give it our brand glow. */
.live-command-status-pill {
    box-shadow: 0 0 12px rgba(16,185,129,0.35);
}

/* ═══════════════════════════════════════════════════════════════════
 * PHASE 2.5 — Resources tables polish
 * Density + filter visibility + row action affordances applied to ALL
 * Filament resource list pages without touching any Resource class.
 * ═══════════════════════════════════════════════════════════════════ */

/* Compact row density (Linear/Stripe vibe) on resource tables. The
 * .fi-ta-row already gets our hover treatment from base theme; here we
 * tighten the vertical rhythm. */
.fi-resource-list-records-page .fi-ta-cell,
.fi-resource-list-records-page .fi-ta-row td {
    padding: 0.65rem 1rem !important;
    font-size: 13px !important;
}
.fi-resource-list-records-page .fi-ta-header-cell,
.fi-resource-list-records-page .fi-ta thead th {
    padding: 0.7rem 1rem !important;
}

/* Active filter pills — when a filter is applied, give it a visible
 * indigo glow so operators can see at a glance what's filtering. */
.fi-ta-filters-indicator,
.fi-ta-filter-indicator {
    background: linear-gradient(135deg, var(--bb-accent-from), var(--bb-accent-to)) !important;
    color: #fff !important;
    border: none !important;
    box-shadow: 0 0 8px rgba(99,102,241,0.4) !important;
}

/* Row actions: dense + icon-only feel. Filament renders row actions as
 * a flex row of buttons — collapse padding so they don't bloat the row. */
.fi-ta-actions {
    gap: 0.25rem !important;
}
.fi-ta-actions .fi-icon-btn,
.fi-ta-actions .fi-ac-btn {
    padding: 0.35rem !important;
    width: 28px !important;
    height: 28px !important;
}
.fi-ta-actions .fi-icon-btn svg,
.fi-ta-actions .fi-ac-btn svg {
    width: 14px !important;
    height: 14px !important;
}

/* Bulk action bar polish — when rows are selected, give it our gradient. */
.fi-ta-selection-indicator {
    background: linear-gradient(90deg, rgba(99,102,241,0.12), rgba(6,182,212,0.08)) !important;
    border-bottom: 1px solid var(--bb-line-strong) !important;
    color: var(--bb-text-0) !important;
    font-weight: 500 !important;
}

/* Pagination "Showing X of Y" text in mono tabular so digits line up */
.fi-pagination-records-text,
.fi-ta-pgn-records-text {
    font-family: 'JetBrains Mono', monospace !important;
    font-variant-numeric: tabular-nums !important;
    color: var(--bb-text-3) !important;
    font-size: 11.5px !important;
}

/* Searchable input on resource pages — match our brand */
.fi-ta-search-field input,
.fi-input-wrp.fi-ta-search input {
    background: rgba(255,255,255,0.025) !important;
    border: 1px solid var(--bb-line) !important;
    border-radius: 9px !important;
    color: var(--bb-text-0) !important;
    font-size: 13.5px !important;
}
.fi-ta-search-field input:focus {
    border-color: var(--bb-accent-from) !important;
    box-shadow: 0 0 0 4px rgba(99,102,241,0.12) !important;
}

/* "Create" page-header button on resource lists gets the gradient. */
.fi-resource-list-records-page .fi-header-actions .fi-ac-btn-action,
.fi-resource-list-records-page .fi-header .fi-btn-color-primary {
    background: linear-gradient(135deg, var(--bb-accent-from), #4f46e5) !important;
    color: #fff !important;
    box-shadow: 0 1px 0 rgba(255,255,255,0.18) inset, 0 6px 18px -6px var(--bb-accent-glow) !important;
}

/* Resource list — full-width on small screens (mobile admin) */
@media (max-width: 640px) {
    .fi-resource-list-records-page .fi-ta-cell,
    .fi-resource-list-records-page .fi-ta-row td { padding: 0.5rem 0.65rem !important; }
    .fi-resource-list-records-page .fi-ta-header-cell { font-size: 10px !important; padding: 0.55rem 0.65rem !important; }
    .fi-ta-actions { flex-wrap: wrap; }
}

/* Sort indicator arrow — gradient instead of plain gray */
.fi-ta-header-cell-sort-btn[aria-sort="ascending"] svg,
.fi-ta-header-cell-sort-btn[aria-sort="descending"] svg {
    color: var(--bb-accent-from) !important;
    filter: drop-shadow(0 0 4px rgba(99,102,241,0.4));
}

/* Modal action confirm buttons — danger variant gets red gradient */
.fi-modal .fi-btn-color-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    box-shadow: 0 6px 18px -6px rgba(239,68,68,0.45) !important;
}

/* ─── Sound preferences popover ───────────────────────────────────── */
.bb-sound-popover {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    width: 260px;
    background: linear-gradient(180deg, #11141d, #0c0e16);
    border: 1px solid var(--bb-line-strong);
    border-radius: 12px;
    box-shadow:
        0 1px 0 rgba(255,255,255,0.05) inset,
        0 20px 50px -10px rgba(0,0,0,0.6),
        0 0 0 1px rgba(99,102,241,0.10);
    padding: 0.85rem;
    z-index: 100;
}
.bb-sound-popover__title {
    color: var(--bb-text-3);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}
.bb-sound-popover__title--sub { margin-top: 0.85rem; }
.bb-sound-popover__row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.4rem 0.2rem;
    cursor: pointer;
    color: var(--bb-text-1);
    font-size: 12.5px;
}
.bb-sound-popover__row span:first-of-type { flex: 1; }
.bb-sound-popover__row > span:not(.bb-sound-popover__value) { font-size: 12.5px; }
.bb-sound-popover__range {
    flex: 1;
    height: 4px;
    background: rgba(255,255,255,0.08);
    border-radius: 2px;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}
.bb-sound-popover__range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: linear-gradient(135deg, var(--bb-accent-from), var(--bb-accent-to));
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.15), 0 4px 12px -2px var(--bb-accent-glow);
    cursor: pointer;
}
.bb-sound-popover__range::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: linear-gradient(135deg, var(--bb-accent-from), var(--bb-accent-to));
    border-radius: 50%;
    border: 0;
    cursor: pointer;
}
.bb-sound-popover__value {
    color: var(--bb-text-3);
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    min-width: 32px;
    text-align: right;
}
.bb-sound-popover__row input[type="checkbox"] {
    width: 14px; height: 14px;
    accent-color: var(--bb-accent-from);
    cursor: pointer;
}
.bb-sound-popover__test {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--bb-line);
    color: var(--bb-text-2);
    border-radius: 5px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10.5px;
    padding: 0.2rem 0.5rem;
    cursor: pointer;
    transition: all 120ms ease;
}
.bb-sound-popover__test:hover {
    background: rgba(99,102,241,0.15);
    color: var(--bb-text-0);
    border-color: var(--bb-accent-from);
}

/* ═══════════════════════════════════════════════════════════════════
 * PHASE 2.6 — Light mode support
 * Honour Filament's own dark/light toggle. Our dark theme is the
 * default (matches the brand). When Filament switches to light, we
 * swap the design tokens to a coherent light palette instead of
 * leaving the panel looking broken.
 * ═══════════════════════════════════════════════════════════════════ */
html:not(.dark) {
    --bb-bg-0: #f7f8fc;
    --bb-bg-1: #ffffff;
    --bb-bg-2: #ffffff;
    --bb-bg-3: #f3f4fb;
    --bb-bg-4: #e8eaf6;
    --bb-line: rgba(99, 102, 241, 0.12);
    --bb-line-strong: rgba(99, 102, 241, 0.28);
    --bb-text-0: #0c0e16;
    --bb-text-1: #2b2f42;
    --bb-text-2: #5f6478;
    --bb-text-3: #8d92a8;
    --bb-shadow-sm: 0 1px 2px rgba(13,15,30,0.06);
    --bb-shadow:    0 4px 14px -4px rgba(13,15,30,0.10);
    --bb-shadow-lg: 0 24px 60px -20px rgba(13,15,30,0.18);
}

/* Light-mode body backdrop — much softer, no aurora glow */
html:not(.dark) body, html:not(.dark) .fi-body {
    background:
        radial-gradient(1200px 600px at 88% -10%, rgba(99,102,241,0.06), transparent 60%),
        radial-gradient(900px 500px at -10% 110%, rgba(6,182,212,0.05), transparent 55%),
        var(--bb-bg-0) !important;
    color: var(--bb-text-1) !important;
}

/* Light-mode sidebar — clean white card with subtle indigo edge */
html:not(.dark) .fi-sidebar {
    background: linear-gradient(180deg, #ffffff, #f7f8fc) !important;
    border-right: 1px solid var(--bb-line) !important;
}
html:not(.dark) .fi-sidebar-item-button {
    color: var(--bb-text-2) !important;
}
html:not(.dark) .fi-sidebar-item-button:hover {
    background: rgba(99,102,241,0.05) !important;
    color: var(--bb-text-0) !important;
}
html:not(.dark) .fi-sidebar-item-active > .fi-sidebar-item-button {
    background: linear-gradient(90deg, rgba(99,102,241,0.10), rgba(6,182,212,0.04)) !important;
    color: var(--bb-text-0) !important;
}

/* Light-mode topbar */
html:not(.dark) .fi-topbar {
    background: rgba(255,255,255,0.85) !important;
    border-bottom: 1px solid var(--bb-line) !important;
}

/* Light-mode cards / sections */
html:not(.dark) .fi-section,
html:not(.dark) .fi-wi-stats-overview-stat {
    background: var(--bb-bg-1) !important;
    border: 1px solid var(--bb-line) !important;
    box-shadow: var(--bb-shadow) !important;
}

/* Light-mode tables */
html:not(.dark) .fi-ta {
    background: var(--bb-bg-1) !important;
    border: 1px solid var(--bb-line) !important;
}
html:not(.dark) .fi-ta-row:hover {
    background: rgba(99,102,241,0.04) !important;
}

/* Light-mode inputs */
html:not(.dark) .fi-input,
html:not(.dark) .fi-input-wrp input,
html:not(.dark) .fi-input-wrp textarea {
    background: var(--bb-bg-1) !important;
    border: 1px solid var(--bb-line) !important;
    color: var(--bb-text-0) !important;
}

/* Light-mode feed items — keep priority left bar but lighten background */
html:not(.dark) .bb-feed-item {
    background: var(--bb-bg-1) !important;
    border-color: var(--bb-line) !important;
}
html:not(.dark) .bb-feed-item:hover {
    background: rgba(99,102,241,0.04) !important;
}
html:not(.dark) .bb-feed-item--critical {
    background: linear-gradient(90deg, rgba(239,68,68,0.04), transparent 60%) !important;
}
html:not(.dark) .bb-feed-item--high {
    background: rgba(245,158,11,0.04) !important;
}

/* Light-mode KPI stat — soft accent */
html:not(.dark) .fi-wi-stats-overview-stat::after {
    background: radial-gradient(circle, rgba(99,102,241,0.06), transparent 65%) !important;
}

/* Light-mode command palette */
html:not(.dark) .bb-cmdk {
    background: linear-gradient(180deg, #ffffff, #f7f8fc) !important;
    border-color: var(--bb-line-strong) !important;
}
html:not(.dark) .bb-cmdk-backdrop {
    background: rgba(13,15,30,0.35) !important;
}

/* Light-mode sound popover */
html:not(.dark) .bb-sound-popover {
    background: linear-gradient(180deg, #ffffff, #f7f8fc) !important;
    border-color: var(--bb-line-strong) !important;
}

/* Light-mode target leaderboard rows */
html:not(.dark) .bb-target-row {
    background: var(--bb-bg-1) !important;
    border-color: var(--bb-line) !important;
}
html:not(.dark) .bb-target-row:hover {
    background: rgba(99,102,241,0.04) !important;
}

/* Light-mode funnel donut — ring background darker so segments pop */
html:not(.dark) .bb-funnel-svg circle:first-of-type {
    stroke: rgba(13,15,30,0.06) !important;
}

/* Light-mode brand wordmark — solid color instead of -webkit-text-fill-color trick */
html:not(.dark) .fi-logo,
html:not(.dark) .fi-simple-header-heading {
    color: var(--bb-text-0) !important;
}
