/* ===========================================================================
   Glossy — the IAAM skin
   ---------------------------------------------------------------------------
   A reading of the Glossy dashboard in IAAM's own navy (#2d4a8a) rather than
   the template's indigo: a deep gradient ground, translucent panels edged in
   white, and bright accent tiles.

   Two things are deliberately NOT copied from the template.

   1. The template is Bootstrap and this panel is Filament/Tailwind, so this is
      a skin over Filament's own semantics rather than a transplant. Every rule
      here hangs off a .fi-* class Filament actually emits.

   2. The template has no dense data table — every page in it is cards. This
      panel's real work is lists: 3,041 fee rows, the members' register, the
      abstracts. White text on 10%-white glass is fine behind a headline and
      poor behind forty rows of data, so tables get a denser, darker surface
      of their own. The chrome is glossy; the data stays readable.

   Scoped to .fi.dark. Filament's light mode is left to Filament.
   ========================================================================= */

.fi.dark {
    /* The ground. Three stops of the brand, deepest at the bottom. */
    --gl-deep:    #0b1229;
    --gl-mid:     #14224c;
    --gl-brand:   #2d4a8a;
    --gl-bloom:   #4a6fc4;

    /* Glass. The template's figure is 10% white on both fill and edge. */
    --gl-glass:   rgba(255, 255, 255, 0.075);
    --gl-glass-2: rgba(255, 255, 255, 0.11);
    --gl-line:    rgba(255, 255, 255, 0.13);
    --gl-line-2:  rgba(255, 255, 255, 0.2);

    /*
     * Data surfaces. Denser and darker than the glass, so a column of
     * numbers has something solid behind it. This is the one place the
     * template is overruled on purpose.
     */
    --gl-data:    rgba(8, 14, 34, 0.76);
    --gl-data-2:  rgba(11, 19, 44, 0.9);

    --gl-ink:     #edf2fc;
    --gl-muted:   #b4c4e4;   /* 7.4:1 on the ground — checked, not guessed */

    --gl-radius:  14px;
}

/* ------------------------------------------------------------- the ground */

.fi.dark body.fi-body {
    background:
        radial-gradient(1100px 760px at 14% -12%, rgba(74, 111, 196, 0.42), transparent 62%),
        radial-gradient(900px 680px at 102% -4%,  rgba(45, 74, 138, 0.55),  transparent 58%),
        linear-gradient(162deg, var(--gl-deep) 0%, var(--gl-mid) 48%, #1b2f68 100%);
    background-attachment: fixed;
    color: var(--gl-ink);
}

/*
 * The grain. An inline SVG rather than the template's noise-bg.png: no extra
 * request, nothing to 404 when assets are rebuilt, and no binary in the repo.
 * Fixed and non-interactive so it never eats a click.
 */
.fi.dark body.fi-body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.22;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
}

/* Everything the app draws sits above the grain. */
.fi.dark .fi-layout,
.fi.dark .fi-topbar,
.fi.dark .fi-sidebar { position: relative; z-index: 1; }

/* ------------------------------------------------------------ the sidebar */

.fi.dark .fi-sidebar {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.045) 100%);
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    border-right: 1px solid var(--gl-line);
}

.fi.dark .fi-sidebar-header {
    background: transparent;
    border-bottom: 1px solid var(--gl-line);
    box-shadow: none;
}

.fi.dark .fi-sidebar-group-label {
    color: #9fb3d8;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.fi.dark .fi-sidebar-item-btn {
    border-radius: 10px;
    color: #d3dff5;
    transition: background-color .15s ease, color .15s ease;
}

.fi.dark .fi-sidebar-item-btn:hover { background: var(--gl-glass-2); color: #fff; }

/*
 * The active item is a filled pill, as in the template. Filament marks it
 * with .fi-active; the brand at full strength reads clearly against the
 * glass without needing a left-edge bar — a one-sided rule on an otherwise
 * borderless panel looks like a rendering fault.
 */
.fi.dark .fi-sidebar-item.fi-active > .fi-sidebar-item-btn,
.fi.dark .fi-sidebar-item-active > .fi-sidebar-item-btn {
    background: linear-gradient(100deg, rgba(120, 155, 235, 0.32), rgba(120, 155, 235, 0.16));
    color: #fff;
    box-shadow: inset 0 0 0 1px var(--gl-line-2);
}

.fi.dark .fi-sidebar-item-icon { color: inherit; opacity: .9; }

/* ------------------------------------------------------------- the topbar */

.fi.dark .fi-topbar,
.fi.dark .fi-topbar > nav {
    background: rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    border-bottom: 1px solid var(--gl-line);
    box-shadow: none;
}

/* -------------------------------------------------- panels, cards, widgets */

/* Not the stats wrapper: Filament marks that .fi-section "not-contained"
   because it groups the tiles rather than being a card itself, and giving it
   glass draws a second panel behind the row. */
.fi.dark .fi-section:not(.fi-section-not-contained),
.fi.dark .fi-wi-widget > .fi-section:not(.fi-section-not-contained),
.fi.dark .fi-modal-window,
.fi.dark .fi-dropdown-panel {
    background: var(--gl-glass);
    backdrop-filter: blur(16px) saturate(135%);
    -webkit-backdrop-filter: blur(16px) saturate(135%);
    border: 1px solid var(--gl-line);
    border-radius: var(--gl-radius);
    /* Elevation declared once: the edge is the elevation here, not a shadow. */
    box-shadow: none;
}

.fi.dark .fi-section-header { border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.fi.dark .fi-section-header-heading { color: var(--gl-ink); font-weight: 600; }
.fi.dark .fi-section-header-description { color: var(--gl-muted); }

/* A dropdown over glass needs to be opaque or the text behind shows through. */
.fi.dark .fi-dropdown-panel {
    background: rgba(16, 26, 56, 0.97);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
}

.fi.dark .fi-modal-window { background: rgba(14, 23, 50, 0.97); }

/* ----------------------------------------------------------- the stat row */

.fi.dark .fi-wi-stats-overview-stat {
    background: var(--gl-glass);
    backdrop-filter: blur(16px) saturate(135%);
    -webkit-backdrop-filter: blur(16px) saturate(135%);
    border: 1px solid var(--gl-line);
    border-radius: var(--gl-radius);
    box-shadow: none;
    transition: background-color .18s ease, transform .18s ease;
}

.fi.dark .fi-wi-stats-overview-stat:hover {
    background: var(--gl-glass-2);
    transform: translateY(-2px);
}

.fi.dark .fi-wi-stats-overview-stat-label { color: var(--gl-muted); }
.fi.dark .fi-wi-stats-overview-stat-value { color: #fff; font-variant-numeric: tabular-nums; }
.fi.dark .fi-wi-stats-overview-stat-description { color: var(--gl-muted); }

/* ---------------------------------------------------------------- tables  */
/*
 * Where this skin parts company with the template.
 *
 * Glass is a background effect: it borrows whatever is behind it, which on a
 * gradient means the contrast under row 40 is not the contrast under row 1.
 * For a list somebody reads all day that is the wrong trade, so the table
 * gets its own near-opaque surface and keeps the glossy frame around it.
 */
.fi.dark .fi-ta,
.fi.dark .fi-ta-ctn {
    background: var(--gl-data);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--gl-line);
    border-radius: var(--gl-radius);
    overflow: hidden;
}

.fi.dark .fi-ta-header,
.fi.dark .fi-ta-header-ctn { background: transparent; border-bottom: 1px solid var(--gl-line); }

.fi.dark .fi-ta-header-cell,
.fi.dark .fi-ta-header-cell button {
    background: var(--gl-data-2);
    color: #dbe5f8;
    font-weight: 600;
}

.fi.dark .fi-ta-row { border-color: rgba(255, 255, 255, 0.07); }
.fi.dark .fi-ta-row:hover { background: rgba(255, 255, 255, 0.045); }
.fi.dark .fi-ta-cell  { color: #e4ebf9; }
.fi.dark .fi-ta-text  { color: #e4ebf9; }
.fi.dark .fi-ta-empty-state { background: transparent; }

/*
 * The pinned actions column rides on the row, so it has to carry the row's
 * background or the cells beneath scroll through it. filament-tables.css
 * pins it; this only supplies the colour.
 */
.fi.dark .fi-ta-actions-cell,
.fi.dark .fi-ta-actions-header-cell { background: var(--gl-data-2); }

/* -------------------------------------------------------- inputs, buttons */

.fi.dark .fi-input-wrp {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid var(--gl-line);
    border-radius: 10px;
    box-shadow: none;
}

.fi.dark .fi-input-wrp:focus-within {
    border-color: rgba(145, 175, 240, 0.75);
    box-shadow: 0 0 0 3px rgba(96, 134, 220, 0.28);
}

.fi.dark .fi-input,
.fi.dark .fi-select-input { color: var(--gl-ink); }
.fi.dark .fi-input::placeholder { color: #8fa3c9; }

.fi.dark .fi-btn { border-radius: 10px; }

.fi.dark .fi-btn.fi-color-primary {
    background: linear-gradient(135deg, #3f63b8, #2d4a8a);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #fff;
}
.fi.dark .fi-btn.fi-color-primary:hover { background: linear-gradient(135deg, #4a71cc, #35559c); }

/* ------------------------------------------------------------ page chrome */

.fi.dark .fi-header-heading { color: #fff; }
.fi.dark .fi-header-subheading,
.fi.dark .fi-breadcrumbs-item-label { color: var(--gl-muted); }

.fi.dark .fi-ta-pagination,
.fi.dark .fi-pagination { background: transparent; color: var(--gl-muted); }

/* Charts sit on glass; their own canvas must not paint a block behind them. */
.fi.dark .fi-wi-chart-frame,
.fi.dark .fi-wi-chart-canvas-ctn { background: transparent; }

@media (prefers-reduced-motion: reduce) {
    .fi.dark .fi-wi-stats-overview-stat { transition: none; }
    .fi.dark .fi-wi-stats-overview-stat:hover { transform: none; }
}

/* ---------------------------------------------------------- chart colours */
/*
 * Filament reads these off marker spans rather than taking them as options,
 * so the only way to recolour a chart from CSS is to recolour the markers.
 * Its defaults are tuned for a near-black panel: on this ground the axis
 * labels came out barely legible and the gridlines not at all.
 */
.fi.dark .fi-wi-chart-text-color { color: #c6d4ef; }
.fi.dark .fi-wi-chart-grid-color { color: rgba(255, 255, 255, 0.13); }

/* ------------------------------------------- the pinned actions column    */
/*
 * filament-tables.css pins the last column and colours it from these three
 * variables. Its selectors are far more specific than anything sensible here
 * (:has() plus a child chain), so the right move is to redefine the variables
 * rather than fight the selector — the pinning logic stays its business, the
 * palette becomes this file's.
 *
 * The fill must be opaque: the column sits over the cells that scroll beneath
 * it, and anything translucent lets them show through.
 */
.fi.dark {
    --iaam-ta-pinned:       #0d1730;
    --iaam-ta-pinned-hover: #16224a;
    --iaam-ta-edge:         rgba(255, 255, 255, 0.14);
}

/* ------------------------------------- reclaiming the delegate panel      */
/*
 * filament-delegate.css predates this skin and paints two surfaces opaque:
 * the main container (#0b1220) and the sidebar (#2d4a8a !important). Both
 * were right when the panel was flat; both now cover the gradient they are
 * supposed to sit on, so the delegate side came out dark-but-not-glossy
 * while the admin side was correct.
 *
 * !important here only because the rule it answers is itself !important.
 * This file is loaded last specifically to have the final word on chrome.
 */
.fi.dark .fi-main-ctn,
.fi.dark .fi-main { background: transparent !important; }

.fi.dark .fi-sidebar {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.045) 100%) !important;
    border-inline-end: 1px solid var(--gl-line) !important;
}

/* --------------------------------------------------- the sign-in screens */
/*
 * The sign-in page was built before this skin and paints three opaque
 * layers over the ground: the page, the hero and the card. Making them
 * translucent lets the gradient carry the whole screen while keeping the
 * layout and the hexagon motif that were designed on purpose.
 *
 * The hero keeps a tint of its own — it is the dark half of the split and
 * should still read as the dark half, just not as a flat slab.
 */
.fi.dark .iaam-login { background: transparent !important; }

.fi.dark .iaam-login-intro {
    background: linear-gradient(150deg, rgba(10, 24, 62, 0.72), rgba(16, 34, 82, 0.5)) !important;
    border-inline-end: 1px solid var(--gl-line);
}

.fi.dark .iaam-login-form {
    background: var(--gl-glass) !important;
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    border: 1px solid var(--gl-line);
    border-radius: var(--gl-radius);
    box-shadow: none;
}

/* The consent bar is page chrome, not content: it keeps its own solid
   surface so it reads at the bottom of any page, glossy or not. */

/* ------------------------------------------------- one card, one elevation */
/* Same three offenders as the light sheet: the widget wrapper's shadow, the
   not-contained stats wrapper (a shadow with no card under it) and the
   content container's border under each header. The .fi-section owns the
   edge; nothing around or inside it adds a second. */
.fi.dark .fi-wi-widget { box-shadow: none; }

.fi.dark .fi-section-not-contained {
    box-shadow: none;
    border: 0;
    background: transparent;
}

.fi.dark .fi-section-content-ctn {
    border: 0;
    background: transparent;
}
