/*
 * The admin panel's own stylesheet (docs/ux.md, "Motion and colour"). Plain CSS with no
 * build: the panel ships Filament's prebuilt CSS and nothing compiled, so every class
 * here is hand-written and starts with bavn-. Linked once from the HEAD_END render hook
 * (components/panel-head), after Filament's own CSS, with its filemtime as the cache-buster.
 *
 * What it holds, in order: the tones (one colour per page, App\Filament\Support\PageTone),
 * the page chrome each tone colours (header band, icon chip, top borders, sidebar), the
 * dashboard (greeting band, checklist, numbers, this week), the custom pages' cards, two
 * table fixes, and the motion, which prefers-reduced-motion switches off at the end.
 *
 * Rules kept here: only transform and opacity animate (never a layout property); motion
 * runs on first paint only (Livewire morphs keep the elements, so it does not replay);
 * table rows never move; tones colour the chrome, never the controls (primary buttons
 * stay navy); light and dark mode both (Filament puts .dark on <html>).
 */

/* ---------- Tones ---------- */

:root {
    --bavn-ease: cubic-bezier(.2, .7, .2, 1);
    --bavn-navy: #0b1730;

    /* Base colour, its lighter partner for gradients, and an ink dark enough for text and icons. */
    --bavn-flame: #ff7a1a;   --bavn-flame-2: #ffb547;   --bavn-flame-ink: #c2410c;
    --bavn-sky: #4f9dff;     --bavn-sky-2: #8ec5ff;     --bavn-sky-ink: #1d64d8;
    --bavn-violet: #8b5cf6;  --bavn-violet-2: #c4b5fd;  --bavn-violet-ink: #6d28d9;
    --bavn-rose: #f43f5e;    --bavn-rose-2: #fda4af;    --bavn-rose-ink: #be123c;
    --bavn-teal: #14b8a6;    --bavn-teal-2: #5eead4;    --bavn-teal-ink: #0f766e;
    --bavn-emerald: #10b981; --bavn-emerald-2: #6ee7b7; --bavn-emerald-ink: #047857;
    --bavn-amber: #f59e0b;   --bavn-amber-2: #fcd34d;   --bavn-amber-ink: #b45309;
    --bavn-fuchsia: #d946ef; --bavn-fuchsia-2: #f0abfc; --bavn-fuchsia-ink: #a21caf;
    --bavn-indigo: #6366f1;  --bavn-indigo-2: #a5b4fc;  --bavn-indigo-ink: #4338ca;
}

.dark {
    --bavn-flame-ink: #ffa057;
    --bavn-sky-ink: #8ec5ff;
    --bavn-violet-ink: #c4b5fd;
    --bavn-rose-ink: #fda4af;
    --bavn-teal-ink: #5eead4;
    --bavn-emerald-ink: #6ee7b7;
    --bavn-amber-ink: #fcd34d;
    --bavn-fuchsia-ink: #f0abfc;
    --bavn-indigo-ink: #a5b4fc;
}

/*
 * A page takes its tone from the marker at the top of its content
 * (<span class="bavn-tone" data-tone="sky" hidden>, CONTENT_START or SIMPLE_PAGE_START);
 * a stat, a checklist step or a tile names its own with data-tone.
 */
[data-tone="flame"],   :is(.fi-main, .fi-simple-page):has(> .bavn-tone[data-tone="flame"])   { --bavn-c: var(--bavn-flame);   --bavn-c2: var(--bavn-flame-2);   --bavn-ink: var(--bavn-flame-ink); }
[data-tone="sky"],     :is(.fi-main, .fi-simple-page):has(> .bavn-tone[data-tone="sky"])     { --bavn-c: var(--bavn-sky);     --bavn-c2: var(--bavn-sky-2);     --bavn-ink: var(--bavn-sky-ink); }
[data-tone="violet"],  :is(.fi-main, .fi-simple-page):has(> .bavn-tone[data-tone="violet"])  { --bavn-c: var(--bavn-violet);  --bavn-c2: var(--bavn-violet-2);  --bavn-ink: var(--bavn-violet-ink); }
[data-tone="rose"],    :is(.fi-main, .fi-simple-page):has(> .bavn-tone[data-tone="rose"])    { --bavn-c: var(--bavn-rose);    --bavn-c2: var(--bavn-rose-2);    --bavn-ink: var(--bavn-rose-ink); }
[data-tone="teal"],    :is(.fi-main, .fi-simple-page):has(> .bavn-tone[data-tone="teal"])    { --bavn-c: var(--bavn-teal);    --bavn-c2: var(--bavn-teal-2);    --bavn-ink: var(--bavn-teal-ink); }
[data-tone="emerald"], :is(.fi-main, .fi-simple-page):has(> .bavn-tone[data-tone="emerald"]) { --bavn-c: var(--bavn-emerald); --bavn-c2: var(--bavn-emerald-2); --bavn-ink: var(--bavn-emerald-ink); }
[data-tone="amber"],   :is(.fi-main, .fi-simple-page):has(> .bavn-tone[data-tone="amber"])   { --bavn-c: var(--bavn-amber);   --bavn-c2: var(--bavn-amber-2);   --bavn-ink: var(--bavn-amber-ink); }
[data-tone="fuchsia"], :is(.fi-main, .fi-simple-page):has(> .bavn-tone[data-tone="fuchsia"]) { --bavn-c: var(--bavn-fuchsia); --bavn-c2: var(--bavn-fuchsia-2); --bavn-ink: var(--bavn-fuchsia-ink); }
[data-tone="indigo"],  :is(.fi-main, .fi-simple-page):has(> .bavn-tone[data-tone="indigo"])  { --bavn-c: var(--bavn-indigo);  --bavn-c2: var(--bavn-indigo-2);  --bavn-ink: var(--bavn-indigo-ink); }

/* ---------- Page chrome ---------- */

/* The header on a soft band of the page's colour. Text on it keeps Filament's colours (≥ 4.5:1).
   No isolation, z-index or overflow here: the Help slide-over and header-action dropdowns render INSIDE
   .fi-header, and a stacking context (or clipping) on it traps them under the topbar and the page. */
.fi-main:has(> .bavn-tone) .fi-header {
    position: relative;
    padding: 1rem 1.25rem;
    border-radius: 1rem;
    background-image: linear-gradient(105deg,
        color-mix(in srgb, var(--bavn-c) 15%, transparent) 0%,
        color-mix(in srgb, var(--bavn-c) 6%, transparent) 50%,
        color-mix(in srgb, var(--bavn-c) 2%, transparent) 100%);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bavn-c) 18%, transparent);
}
/* A faint dot grid at the band's far end, the landing page's texture. It comes first in tree order and
   the header's children are positioned too (both without z-index), so they paint over it. */
.fi-main:has(> .bavn-tone) .fi-header > * { position: relative; }
.fi-main:has(> .bavn-tone) .fi-header::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background-image: radial-gradient(color-mix(in srgb, var(--bavn-c) 45%, transparent) 1px, transparent 1.3px);
    background-size: 18px 18px;
    -webkit-mask-image: linear-gradient(100deg, transparent 45%, #000 100%);
    mask-image: linear-gradient(100deg, transparent 45%, #000 100%);
    opacity: .5;
}
.dark .fi-main:has(> .bavn-tone) .fi-header {
    background-image: linear-gradient(105deg,
        color-mix(in srgb, var(--bavn-c) 20%, transparent) 0%,
        color-mix(in srgb, var(--bavn-c) 7%, transparent) 50%,
        color-mix(in srgb, var(--bavn-c) 2%, transparent) 100%);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bavn-c) 24%, transparent);
}

/* The page's icon in a chip before its heading (PAGE_HEADER_HEADING_BEFORE), beside the heading and subheading. */
.fi-header > div:first-child:has(> .bavn-chip) {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: .9rem;
    align-items: center;
}
.fi-header > div:first-child:has(> .bavn-chip) > .fi-breadcrumbs { grid-column: 1 / -1; margin-bottom: .5rem; }
.fi-header > div:first-child:has(> .bavn-chip) > :is(.fi-header-heading, .fi-header-subheading) { grid-column: 2; }
.fi-header-has-subheading > div:first-child > .bavn-chip { grid-row: span 2; }
.bavn-chip {
    display: inline-grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: .85rem;
    color: var(--bavn-ink);
    background-image: linear-gradient(135deg,
        color-mix(in srgb, var(--bavn-c) 22%, #fff),
        color-mix(in srgb, var(--bavn-c2) 16%, #fff));
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bavn-c) 32%, transparent), 0 8px 18px -10px var(--bavn-c);
}
.dark .bavn-chip {
    background-image: linear-gradient(135deg,
        color-mix(in srgb, var(--bavn-c) 30%, transparent),
        color-mix(in srgb, var(--bavn-c2) 12%, transparent));
}
.bavn-chip > .fi-icon { width: 1.4rem; height: 1.4rem; }

/* Beside the chip, the heading block is taller than Filament's: keep the actions level with it. */
@media (min-width: 40rem) {
    .fi-main:has(> .bavn-tone) .fi-header-actions-ctn { align-self: center; }
}
/* On a phone the band is tighter, and a long Help link and the page's button wrap rather than squeeze. */
@media (max-width: 39.99rem) {
    .fi-main:has(> .bavn-tone) .fi-header { padding: .9rem 1rem; }
    .fi-main:has(> .bavn-tone) .fi-header-actions-ctn { flex-wrap: wrap; row-gap: .6rem; }
}

/* The dashboard's greeting band carries its colour: its header stays plain, with the chip. */
.fi-main:has(> .bavn-tone) .fi-page:has(.bavn-hero-widget) .fi-header { padding: 0; border-radius: 0; background-image: none; box-shadow: none; }
.fi-main:has(> .bavn-tone) .fi-page:has(.bavn-hero-widget) .fi-header::before { content: none; }

/* Breadcrumbs a shade darker on the band, to keep them at 4.5:1 on its tint. */
.fi-main:has(> .bavn-tone) .fi-header .fi-breadcrumbs-item-label:not(:where(.dark *)) { color: var(--gray-600); }

/* The live one-liner under the heading: smaller than Filament's lead text. */
.fi-main:has(> .bavn-tone) .fi-header-subheading {
    margin-top: .2rem;
    font-size: .95rem;
    line-height: 1.4;
    font-variant-numeric: tabular-nums;
}

/* A 3 px accent across the top of every section and table, and the custom pages' cards. */
:is(.fi-main, .fi-simple-page):has(> .bavn-tone) :is(.fi-section:not(.fi-section-not-contained), .fi-ta-ctn):not(.fi-modal *) {
    border-top: 3px solid var(--bavn-c);
}

/* A simple page with no sections of its own (Register organization): the accent on its card. */
.fi-simple-main:has(.bavn-tone):not(:has(.fi-section)) { border-top: 3px solid var(--bavn-indigo); }

/*
 * Sign-in, signup, password reset and email confirmation (PageTone: flame): the landing's
 * navy behind the card, with its two glows drifting, and the card's flame accent. CSS only.
 * The navy is the body's background (it fills the window); the glows are fixed pseudo-elements
 * at z-index -1, painted over that and under everything else. Nothing on an ancestor of the
 * card: the Help slide-over and the modals render inside it, and a stacking context, clipping
 * or transform there would trap them.
 */
.fi-simple-main:has(.fi-simple-page > .bavn-tone[data-tone="flame"]) { border-top: 3px solid var(--bavn-flame); }
.fi-body:has(.fi-simple-page > .bavn-tone[data-tone="flame"]) {
    background-color: var(--bavn-navy);
    background-image: linear-gradient(125deg, #0a1630 0%, #0f2147 50%, #1b2550 78%, #3a2235 100%);
}
.fi-simple-layout:has(.fi-simple-page > .bavn-tone[data-tone="flame"])::before,
.fi-simple-layout:has(.fi-simple-page > .bavn-tone[data-tone="flame"])::after {
    content: "";
    position: fixed;
    z-index: -1;
    width: 560px;
    height: 560px;
    border-radius: 50%;
    pointer-events: none;
}
.fi-simple-layout:has(.fi-simple-page > .bavn-tone[data-tone="flame"])::before { top: -260px; right: -160px; background: radial-gradient(closest-side, rgb(255 122 26 / .42), transparent); }
.fi-simple-layout:has(.fi-simple-page > .bavn-tone[data-tone="flame"])::after { bottom: -300px; left: -200px; background: radial-gradient(closest-side, rgb(79 157 255 / .36), transparent); }

/* The custom pages' cards (Members, Billing, AI assistant): a Filament section's surface. */
.bavn-card {
    padding: 1rem 1.15rem;
    border-radius: .85rem;
    background-color: #fff;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / .08), 0 0 0 1px rgb(15 23 42 / .06);
    border-top: 3px solid var(--bavn-c, var(--gray-300));
}
.dark .bavn-card {
    background-color: var(--gray-900);
    box-shadow: 0 0 0 1px rgb(255 255 255 / .1);
}

/* The tone's gradient on progress bars (setup checklist, plan usage). */
.bavn-progress {
    height: .5rem;
    border-radius: 999px;
    overflow: hidden;
    background-color: color-mix(in srgb, var(--bavn-c, #94a3b8) 15%, rgb(148 163 184 / .18));
}
.bavn-progress-fill {
    height: 100%;
    border-radius: inherit;
    background-image: linear-gradient(90deg, var(--bavn-c2, #cbd5e1), var(--bavn-c, #64748b));
    transform-origin: left center;
}
.bavn-progress-fill[data-over] { background-image: linear-gradient(90deg, #f87171, #dc2626); }

/*
 * The sidebar: each page's icon in its tone, and the page you are on on a tinted ground
 * with a 3 px bar. By link: the dashboard is the first item (Filament sorts it first).
 */
.fi-sidebar-nav .fi-sidebar-group:first-child .fi-sidebar-item:first-child > .fi-sidebar-item-btn { --bavn-c: var(--bavn-flame); --bavn-ink: var(--bavn-flame-ink); }
.fi-sidebar-nav .fi-sidebar-item-btn[href$="/targets"]      { --bavn-c: var(--bavn-sky);     --bavn-ink: var(--bavn-sky-ink); }
.fi-sidebar-nav .fi-sidebar-item-btn[href$="/scans"]        { --bavn-c: var(--bavn-violet);  --bavn-ink: var(--bavn-violet-ink); }
.fi-sidebar-nav .fi-sidebar-item-btn[href$="/findings"]     { --bavn-c: var(--bavn-rose);    --bavn-ink: var(--bavn-rose-ink); }
.fi-sidebar-nav .fi-sidebar-item-btn[href$="/agents"]       { --bavn-c: var(--bavn-teal);    --bavn-ink: var(--bavn-teal-ink); }
.fi-sidebar-nav .fi-sidebar-item-btn[href$="/members"]      { --bavn-c: var(--bavn-emerald); --bavn-ink: var(--bavn-emerald-ink); }
.fi-sidebar-nav .fi-sidebar-item-btn[href$="/billing"]      { --bavn-c: var(--bavn-amber);   --bavn-ink: var(--bavn-amber-ink); }
.fi-sidebar-nav .fi-sidebar-item-btn[href$="/ai-assistant"] { --bavn-c: var(--bavn-fuchsia); --bavn-ink: var(--bavn-fuchsia-ink); }
.fi-sidebar-nav .fi-sidebar-item > .fi-sidebar-item-btn > .fi-icon { color: var(--bavn-ink, var(--gray-400)); }
.fi-sidebar-nav .fi-sidebar-item.fi-active > .fi-sidebar-item-btn {
    background-color: color-mix(in srgb, var(--bavn-c, var(--gray-400)) 13%, transparent);
    box-shadow: inset 3px 0 0 var(--bavn-c, var(--gray-400));
}
.dark .fi-sidebar-nav .fi-sidebar-item.fi-active > .fi-sidebar-item-btn {
    background-color: color-mix(in srgb, var(--bavn-c, var(--gray-400)) 20%, transparent);
}

/* ---------- The dashboard ---------- */

@font-face {
    font-family: "Archivo";
    font-style: normal;
    font-weight: 800;
    font-display: swap;
    src: url("/fonts/bavn/archivo-latin-800-normal.woff2") format("woff2");
}

/* The greeting band: the landing page's navy and flame, a dot grid and two drifting glows. */
.bavn-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
    align-items: center;
    gap: 1.75rem 2.5rem;
    padding: 2rem 2.25rem;
    border-radius: 1.25rem;
    color: #fff;
    background-color: var(--bavn-navy);
    background-image: linear-gradient(125deg, #0a1630 0%, #0f2147 50%, #1b2550 78%, #3a2235 100%);
    box-shadow: 0 26px 50px -30px rgb(11 23 48 / .75), inset 0 0 0 1px rgb(255 255 255 / .06);
}
.dark .bavn-hero { box-shadow: 0 26px 50px -30px rgb(0 0 0 / .8), inset 0 0 0 1px rgb(255 255 255 / .1); }
.bavn-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    opacity: .4;
    background-image: radial-gradient(rgb(255 255 255 / .5) 1px, transparent 1.3px);
    background-size: 22px 22px;
    -webkit-mask-image: radial-gradient(ellipse 60% 85% at 78% 40%, #000 10%, transparent 72%);
    mask-image: radial-gradient(ellipse 60% 85% at 78% 40%, #000 10%, transparent 72%);
}
.bavn-hero::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 3px;
    background-image: linear-gradient(90deg, transparent, var(--bavn-flame-2) 30%, var(--bavn-flame) 70%, transparent);
    opacity: .85;
}
.bavn-orb { position: absolute; z-index: -2; width: 460px; height: 460px; border-radius: 50%; pointer-events: none; }
.bavn-orb-a { top: -230px; right: -110px; background: radial-gradient(closest-side, rgb(255 122 26 / .44), transparent); }
.bavn-orb-b { bottom: -280px; left: -150px; background: radial-gradient(closest-side, rgb(79 157 255 / .38), transparent); }

.bavn-hero-main { min-width: 0; }
.bavn-hero-eyebrow {
    display: flex;
    align-items: center;
    gap: .55rem;
    margin: 0;
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #d8e2f3;
    overflow-wrap: anywhere;
}
.bavn-hero-dot { flex: none; width: .55rem; height: .55rem; border-radius: 50%; background: var(--bavn-hero-state, #8ec5ff); box-shadow: 0 0 0 4px color-mix(in srgb, var(--bavn-hero-state, #8ec5ff) 25%, transparent), 0 0 14px var(--bavn-hero-state, #8ec5ff); }
.bavn-hero[data-posture="new"]       { --bavn-hero-state: #8ec5ff; }
.bavn-hero[data-posture="attention"] { --bavn-hero-state: #ff7a59; }
.bavn-hero[data-posture="open"]      { --bavn-hero-state: #fcd34d; }
.bavn-hero[data-posture="stale"]     { --bavn-hero-state: #fcd34d; }
.bavn-hero[data-posture="clear"]     { --bavn-hero-state: #6ee7b7; }
.bavn-hero-greeting {
    margin: .55rem 0 .45rem;
    font-family: Archivo, "Arial Narrow", Inter, system-ui, sans-serif;
    font-weight: 800;
    font-size: clamp(1.65rem, 2.6vw, 2.3rem);
    line-height: 1.1;
    letter-spacing: -.02em;
    color: #fff;
}
.bavn-hero-sentence { margin: 0; max-width: 54ch; font-size: 1.08rem; line-height: 1.5; color: #dde6f5; }
.bavn-hero-cta {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    margin-top: 1.2rem;
    padding: .65rem 1.05rem .65rem 1.15rem;
    border-radius: .7rem;
    font-weight: 600;
    font-size: .95rem;
    color: #1a0f00;
    background-image: linear-gradient(135deg, var(--bavn-flame-2), var(--bavn-flame));
    box-shadow: 0 12px 26px -12px rgb(255 122 26 / .9), inset 0 1px 0 rgb(255 255 255 / .35);
    transition: transform .2s var(--bavn-ease), box-shadow .2s var(--bavn-ease);
}
.bavn-hero-cta:hover { transform: translateY(-2px); box-shadow: 0 16px 30px -12px rgb(255 122 26 / .95), inset 0 1px 0 rgb(255 255 255 / .35); }
.bavn-hero-cta:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.bavn-hero-cta > .fi-icon { width: 1rem; height: 1rem; transition: transform .2s var(--bavn-ease); }
.bavn-hero-cta:hover > .fi-icon { transform: translateX(2px); }
.bavn-hero-side { min-width: 0; width: 100%; max-width: 36rem; justify-self: end; }

/* Three counts, each glowing in its own colour. */
.bavn-hero-numbers { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; }
.bavn-hero-number {
    --bavn-glow: #8ec5ff;
    display: flex;
    flex-direction: column;
    gap: .2rem;
    min-width: 0;
    padding: .95rem 1rem;
    border-radius: .9rem;
    background-color: rgb(255 255 255 / .07);
    box-shadow: inset 0 0 0 1px rgb(255 255 255 / .12), inset 0 2px 0 color-mix(in srgb, var(--bavn-glow) 70%, transparent);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    transition: transform .2s var(--bavn-ease), background-color .2s var(--bavn-ease);
}
.bavn-hero-number:hover { transform: translateY(-2px); background-color: rgb(255 255 255 / .1); }
.bavn-hero-number:nth-child(2) { --bavn-glow: #ffb547; }
.bavn-hero-number:nth-child(3) { --bavn-glow: #6ee7b7; }
.bavn-hero-number-value {
    font-family: Archivo, "Arial Narrow", Inter, system-ui, sans-serif;
    font-weight: 800;
    font-size: 2rem;
    line-height: 1.05;
    font-variant-numeric: tabular-nums;
    color: #fff;
    text-shadow: 0 0 22px color-mix(in srgb, var(--bavn-glow) 75%, transparent);
}
.bavn-hero-number-label { font-size: .8rem; line-height: 1.3; color: #dbe4f4; overflow-wrap: break-word; }

/* A new organization's three steps to its first scan; the line between them fills as they are done. */
.bavn-journey { position: relative; }
.bavn-journey-track {
    position: absolute;
    top: 1.125rem;
    left: 16.667%;
    right: 16.667%;
    height: 3px;
    margin-top: -1.5px;
    border-radius: 999px;
    background-color: rgb(255 255 255 / .18);
}
.bavn-journey-fill {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background-image: linear-gradient(90deg, var(--bavn-flame-2), var(--bavn-flame));
    transform-origin: left center;
    transform: scaleX(var(--bavn-fill, 0));
}
.bavn-journey-steps { position: relative; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
.bavn-journey-step { display: flex; flex-direction: column; align-items: center; gap: .55rem; text-align: center; min-width: 0; }
.bavn-journey-mark {
    display: grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    font-weight: 700;
    font-size: .95rem;
    color: #fff;
    background-color: #13244a;
    box-shadow: inset 0 0 0 2px rgb(255 255 255 / .3);
}
.bavn-journey-mark > .fi-icon { width: 1.15rem; height: 1.15rem; }
.bavn-journey-step[data-done="true"] .bavn-journey-mark {
    color: #1a0f00;
    background-image: linear-gradient(135deg, var(--bavn-flame-2), var(--bavn-flame));
    box-shadow: 0 0 18px rgb(255 122 26 / .55);
}
.bavn-journey-step[aria-current="step"] .bavn-journey-mark {
    background-color: #1a2f5e;
    box-shadow: inset 0 0 0 2px #fff, 0 0 0 5px rgb(255 255 255 / .12), 0 0 22px rgb(142 197 255 / .55);
}
.bavn-journey-label { font-size: .85rem; font-weight: 600; line-height: 1.3; color: #dde6f5; overflow-wrap: break-word; }
.bavn-journey-step[data-done="true"] .bavn-journey-label { color: #d3ddef; }

/* Laid out by the band's own width (the sidebar may be open or folded), not the window's. */
.bavn-hero-widget { container-type: inline-size; }
@container (max-width: 56rem) {
    .bavn-hero { grid-template-columns: minmax(0, 1fr); }
    .bavn-hero-side { max-width: none; justify-self: stretch; }
    /* One column puts the text under the flame glow: a smaller one, further off the corner. */
    .bavn-orb-a { width: 340px; height: 340px; top: -230px; right: -170px; }
}
@container (max-width: 32rem) {
    .bavn-hero { padding: 1.5rem 1.25rem 1.6rem; gap: 1.5rem; border-radius: 1rem; }
    .bavn-hero-numbers { gap: .5rem; }
    .bavn-hero-number { padding: .75rem .7rem; }
    .bavn-hero-number-value { font-size: 1.6rem; }
    .bavn-hero-cta { width: 100%; justify-content: center; }
}

/* The chart and This week share a row at xl: both cards run to its foot. */
.fi-page:has(.bavn-hero-widget) :is(.fi-wi-chart, .bavn-this-week) > .fi-section { height: 100%; }

/* Each dashboard widget has its own accent along its top. */
.bavn-checklist, .bavn-hero-widget { --bavn-c: var(--bavn-flame); --bavn-c2: var(--bavn-flame-2); --bavn-ink: var(--bavn-flame-ink); }
.fi-page:has(.bavn-hero-widget) .fi-wi-chart { --bavn-c: var(--bavn-rose); }
.bavn-this-week { --bavn-c: var(--bavn-sky); --bavn-c2: var(--bavn-sky-2); --bavn-ink: var(--bavn-sky-ink); }
.fi-page:has(.bavn-hero-widget) .fi-wi-table { --bavn-c: var(--bavn-violet); }

/* The headline numbers: an icon chip, a top border and the sparkline in the number's own colour. */
.fi-wi-stats-overview-stat[data-tone] { border-top: 3px solid var(--bavn-c); }
.fi-wi-stats-overview-stat[data-tone] .fi-wi-stats-overview-stat-label-ctn > .fi-icon {
    box-sizing: border-box;
    flex: none;
    width: 2.1rem;
    height: 2.1rem;
    padding: .45rem;
    border-radius: .65rem;
    color: var(--bavn-ink);
    background-color: color-mix(in srgb, var(--bavn-c) 14%, transparent);
}
.fi-wi-stats-overview-stat[data-tone] .fi-wi-stats-overview-stat-label { font-weight: 600; }
.fi-wi-stats-overview-stat[data-tone] .fi-wi-stats-overview-stat-chart .fi-wi-stats-overview-stat-chart-border-color { color: var(--bavn-c); }
.fi-wi-stats-overview-stat[data-tone] .fi-wi-stats-overview-stat-chart .fi-wi-stats-overview-stat-chart-bg-color { color: color-mix(in srgb, var(--bavn-c) 16%, transparent); }

/* The setup checklist: what is left, each step in its colour; done steps fold into one line. */
.bavn-check-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .25rem 1rem; }
.bavn-check-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .85rem; min-width: 0; }
.bavn-check-title h2 { margin: 0; font-size: 1.05rem; font-weight: 700; }
.bavn-check-title span { font-size: .875rem; color: var(--gray-600); font-variant-numeric: tabular-nums; }
.dark .bavn-check-title span { color: var(--gray-400); }
.bavn-checklist .bavn-progress { margin: .7rem 0 .85rem; }
.bavn-check-fold {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    margin: 0 0 .75rem;
    padding: .3rem .75rem;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    font-size: .8rem;
    font-weight: 600;
    color: var(--bavn-emerald-ink);
    background-color: color-mix(in srgb, var(--bavn-emerald) 13%, transparent);
}
.bavn-check-fold:hover { background-color: color-mix(in srgb, var(--bavn-emerald) 20%, transparent); }
.bavn-check-fold > .fi-icon { width: .9rem; height: .9rem; }
.bavn-check-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: .6rem .75rem;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
}
.bavn-check-step {
    display: flex;
    align-items: flex-start;
    gap: .8rem;
    padding: .75rem .85rem;
    border-radius: .85rem;
    box-shadow: inset 0 0 0 1px rgb(148 163 184 / .28);
}
.bavn-check-step[data-next] {
    background-color: color-mix(in srgb, var(--bavn-flame) 7%, transparent);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bavn-flame) 45%, transparent);
}
.bavn-check-icon {
    flex: none;
    display: grid;
    place-items: center;
    width: 2.1rem;
    height: 2.1rem;
    border-radius: .65rem;
    color: var(--bavn-ink);
    background-color: color-mix(in srgb, var(--bavn-c) 15%, transparent);
}
.bavn-check-icon > .fi-icon { width: 1.15rem; height: 1.15rem; }
.bavn-check-step[data-done="true"] .bavn-check-icon { color: #fff; background-color: var(--bavn-emerald-ink); }
.dark .bavn-check-step[data-done="true"] .bavn-check-icon { color: #052e1f; background-color: var(--bavn-emerald-2); }
.bavn-check-step[data-done="true"] .bavn-check-step-title { color: var(--gray-500); }
.bavn-check-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.bavn-check-step-title { font-weight: 600; line-height: 1.35; }
.bavn-check-text p { margin: .15rem 0 0; font-size: .85rem; line-height: 1.45; color: var(--gray-600); }
.dark .bavn-check-text p { color: var(--gray-400); }
.bavn-check-note {
    display: inline-block;
    margin-left: .4rem;
    padding: .05rem .45rem;
    border-radius: 999px;
    border: 1px solid rgb(148 163 184 / .5);
    font-size: .72rem;
    font-weight: 500;
    color: var(--gray-600);
}
.dark .bavn-check-note { color: var(--gray-300); }

/* This week: the week's changes as three tiles, then the scans coming up. */
.bavn-week-changes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .65rem; }
.bavn-week-tile {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    min-width: 0;
    padding: .8rem .9rem;
    border-radius: .85rem;
    color: inherit;
    background-color: color-mix(in srgb, var(--bavn-c) 9%, transparent);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bavn-c) 24%, transparent);
    transition: transform .2s var(--bavn-ease), box-shadow .2s var(--bavn-ease);
}
a.bavn-week-tile:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bavn-c) 40%, transparent), 0 10px 20px -14px var(--bavn-c); }
.bavn-week-value { font-size: 1.7rem; font-weight: 700; line-height: 1.1; color: var(--bavn-ink); font-variant-numeric: tabular-nums; }
.bavn-week-label { font-size: .8rem; line-height: 1.3; color: var(--gray-600); overflow-wrap: anywhere; }
.dark .bavn-week-label { color: var(--gray-400); }
.bavn-week-heading { margin: 1.25rem 0 .55rem; font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--gray-500); }
.dark .bavn-week-heading { color: var(--gray-400); }
.bavn-week-next { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.bavn-week-scan { display: flex; align-items: center; gap: .75rem; min-width: 0; padding: .55rem .65rem; border-radius: .75rem; box-shadow: inset 0 0 0 1px rgb(148 163 184 / .28); }
.bavn-week-scan-icon { flex: none; display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: .6rem; color: var(--bavn-violet-ink); background-color: color-mix(in srgb, var(--bavn-violet) 14%, transparent); }
.bavn-week-scan-icon > .fi-icon { width: 1.1rem; height: 1.1rem; }
.bavn-week-scan-what { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.bavn-week-scan-target { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bavn-week-scan-type { font-size: .8rem; color: var(--gray-500); }
.dark .bavn-week-scan-type { color: var(--gray-400); }
.bavn-week-scan-when { flex: none; font-size: .85rem; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--gray-700); }
.dark .bavn-week-scan-when { color: var(--gray-200); }
.bavn-week-empty { margin: 0; font-size: .9rem; color: var(--gray-600); }
.dark .bavn-week-empty { color: var(--gray-400); }

/* ---------- Custom pages ---------- */

/* Billing: the plan you are on stays calm; the one picked to buy is lit in the page's colour. */
.bavn-plan-card { position: relative; }
.bavn-plan-card[data-current] { box-shadow: 0 0 0 2px var(--gray-400), 0 1px 3px 0 rgb(0 0 0 / .08); }
.dark .bavn-plan-card[data-current] { box-shadow: 0 0 0 2px var(--gray-500); }
.bavn-plan-card[data-selected] {
    background-image: linear-gradient(180deg, color-mix(in srgb, var(--bavn-c) 10%, transparent), transparent 55%);
    box-shadow: 0 0 0 2px var(--bavn-c), 0 18px 34px -20px var(--bavn-c);
}
.bavn-plan-tag { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .72rem; font-weight: 600; letter-spacing: .02em; white-space: nowrap; }
.bavn-plan-tag[data-kind="current"] { color: var(--gray-700); background-color: rgb(148 163 184 / .22); }
.dark .bavn-plan-tag[data-kind="current"] { color: var(--gray-200); }
.bavn-plan-tag[data-kind="selected"] { color: #1a0f00; background-image: linear-gradient(135deg, var(--bavn-c2), var(--bavn-c)); }
.bavn-usage-bar { margin-top: .3rem; }
.bavn-usage-bar.bavn-progress { height: .35rem; }

/* Your account: the way back to the organization (a simple page has no sidebar). */
.bavn-back { display: inline-flex; align-items: center; gap: .35rem; margin: 0 0 .25rem; font-size: .875rem; font-weight: 600; }
.bavn-back > .fi-icon { width: 1rem; height: 1rem; }

/* ---------- Tables ---------- */

/*
 * A toolbar's actions box holds only the bulk actions, hidden (x-cloak, then x-show) until
 * a row is picked. Empty, Filament still gives it a 36 px row of its own on a phone, above
 * the search box: hide it while nothing in it shows.
 */
.fi-ta-header-toolbar > .fi-ta-actions:not(:has(> :not([style*="display: none"], [x-cloak]))) { display: none; }

/* The filter button's count, only when a filter is on (TableLayout::defaults puts the count on the button). */
.fi-icon-btn[data-active-filters="0"] > .fi-icon-btn-badge-ctn { display: none; }

/* ---------- Motion ---------- */

@keyframes bavn-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes bavn-fill { from { transform: scaleX(0); } }
@keyframes bavn-drift-a { to { transform: translate(-60px, 50px) scale(1.12); } }
@keyframes bavn-drift-b { to { transform: translate(70px, -40px) scale(.9); } }

/* The header first, then each block of the page, 70 ms apart. Rows inside a table never move. */
.fi-main:has(> .bavn-tone) .fi-header,
.fi-simple-page:has(> .bavn-tone) .fi-simple-page-content,
.fi-main:has(> .bavn-tone) .fi-page-content .fi-wi-widget:not(.fi-modal *),
.fi-main:has(> .bavn-tone) .fi-page-content .fi-ta:not(.fi-wi-widget *, .fi-modal *),
.fi-main:has(> .bavn-tone) .fi-page-content .fi-sc-section:not(.fi-wi-widget *, .fi-sc-section *, .fi-modal *),
.fi-main:has(> .bavn-tone) .fi-page-content .bavn-card:not(.fi-modal *) {
    animation: bavn-rise .55s var(--bavn-ease) backwards;
    animation-delay: .07s;
}
.fi-main:has(> .bavn-tone) .fi-header { animation-delay: 0s; }
.fi-main:has(> .bavn-tone) .fi-page-content .fi-sc-liberated:nth-child(2) > .fi-wi-widget,
.fi-main:has(> .bavn-tone) .fi-page-content .fi-grid-col:nth-child(2) > .fi-sc-component > .fi-sc-section,
.fi-main:has(> .bavn-tone) .fi-page-content .bavn-card:nth-child(2) { animation-delay: .14s; }
.fi-main:has(> .bavn-tone) .fi-page-content .fi-sc-liberated:nth-child(3) > .fi-wi-widget,
.fi-main:has(> .bavn-tone) .fi-page-content .fi-grid-col:nth-child(3) > .fi-sc-component > .fi-sc-section,
.fi-main:has(> .bavn-tone) .fi-page-content .bavn-card:nth-child(3),
.fi-main:has(> .bavn-tone) .fi-page-content .fi-ta:not(.fi-wi-widget *, .fi-modal *) { animation-delay: .21s; }
.fi-main:has(> .bavn-tone) .fi-page-content .fi-sc-liberated:nth-child(4) > .fi-wi-widget,
.fi-main:has(> .bavn-tone) .fi-page-content .fi-grid-col:nth-child(4) > .fi-sc-component > .fi-sc-section,
.fi-main:has(> .bavn-tone) .fi-page-content .bavn-card:nth-child(4) { animation-delay: .28s; }
.fi-main:has(> .bavn-tone) .fi-page-content .fi-sc-liberated:nth-child(5) > .fi-wi-widget,
.fi-main:has(> .bavn-tone) .fi-page-content .bavn-card:nth-child(5) { animation-delay: .35s; }
.fi-main:has(> .bavn-tone) .fi-page-content .fi-sc-liberated:nth-child(n+6) > .fi-wi-widget,
.fi-main:has(> .bavn-tone) .fi-page-content .bavn-card:nth-child(n+6) { animation-delay: .42s; }

/* The headline numbers and the plan cards lift a little under the pointer. */
.fi-wi-stats-overview-stat[data-tone], .bavn-plan-card { transition: transform .2s var(--bavn-ease), box-shadow .2s var(--bavn-ease); }
.fi-wi-stats-overview-stat[data-tone]:hover, .bavn-plan-card:hover { transform: translateY(-2px); }
.fi-wi-stats-overview-stat[data-tone]:hover { box-shadow: 0 12px 24px -16px var(--bavn-c), 0 0 0 1px rgb(15 23 42 / .06); }

/* Bars fill once; the glows drift slowly, on the greeting band and behind the sign-in card. */
.bavn-progress-fill, .bavn-journey-fill { animation: bavn-fill .9s var(--bavn-ease) .35s backwards; }
.bavn-orb-a { animation: bavn-drift-a 18s ease-in-out infinite alternate; }
.bavn-orb-b { animation: bavn-drift-b 22s ease-in-out infinite alternate; }
.fi-simple-layout:has(.fi-simple-page > .bavn-tone[data-tone="flame"])::before { animation: bavn-drift-a 18s ease-in-out infinite alternate; }
.fi-simple-layout:has(.fi-simple-page > .bavn-tone[data-tone="flame"])::after { animation: bavn-drift-b 22s ease-in-out infinite alternate; }

@media (prefers-reduced-motion: reduce) {
    .fi-main:has(> .bavn-tone) .fi-header,
    .fi-simple-page:has(> .bavn-tone) .fi-simple-page-content,
    .fi-main:has(> .bavn-tone) .fi-page-content .fi-wi-widget,
    .fi-main:has(> .bavn-tone) .fi-page-content .fi-ta,
    .fi-main:has(> .bavn-tone) .fi-page-content .fi-sc-section,
    .fi-main:has(> .bavn-tone) .fi-page-content .bavn-card,
    .bavn-progress-fill,
    .bavn-journey-fill,
    .bavn-orb,
    .fi-simple-layout::before,
    .fi-simple-layout::after {
        animation: none !important;
    }
    .fi-wi-stats-overview-stat[data-tone], .bavn-plan-card, .bavn-hero-cta, .bavn-hero-cta > .fi-icon, .bavn-hero-number, .bavn-week-tile {
        transition: none !important;
    }
    .fi-wi-stats-overview-stat[data-tone]:hover, .bavn-plan-card:hover, .bavn-hero-cta:hover, .bavn-hero-cta:hover > .fi-icon, .bavn-hero-number:hover, a.bavn-week-tile:hover {
        transform: none !important;
    }
}
