/* Light Glass for the signed-in IAAM panels. Filament owns the layout, form
   state and breakpoints. This sheet supplies the shared surface and type. */
html:not(.dark) body.fi-body-has-navigation:is(.fi-panel-admin, .fi-panel-delegate) {
    --lg-ink: #152c52;
    --lg-body: #405674;
    --lg-blue: #2d4a8a;
    --lg-tint: #dfe9f8;
    --lg-line: #c8d8eb;
    --lg-control: #f8fbff;
    --lg-primary: linear-gradient(135deg, #4267a8, var(--lg-blue));
    --lg-panel: linear-gradient(145deg, rgb(255 255 255 / 95%), rgb(242 248 255 / 58%));
    --lg-rim: rgb(255 255 255 / 94%);
    --lg-shadow: inset 0 0 0 1px var(--lg-rim), 0 13px 28px -12px rgb(52 78 117 / 27%);
    --lg-radius: 1.25rem;

    color: var(--lg-ink);
    background: radial-gradient(ellipse at 28% 5%, rgb(255 255 255 / 83%), transparent 58%),
        linear-gradient(138deg, #eef5fb, #d8e6f3 58%, #c7dbee);
    background-attachment: fixed;

    & :is(.fi-layout, .fi-main-ctn, .fi-main) {
        background: transparent;
    }

    & .fi-topbar {
        border-bottom: 1px solid var(--lg-rim);
        background: rgb(246 250 255 / 90%);
        box-shadow: 0 4px 18px rgb(52 78 117 / 7%);
        backdrop-filter: blur(16px);
    }

    & .fi-topbar > nav {
        background: transparent;
        box-shadow: none;
    }

    & :is(.fi-sidebar, .fi-sidebar-header) {
        border-color: var(--lg-rim) !important;
        color: var(--lg-ink);
    }

    & .fi-sidebar {
        background: #ebf3fc !important;
        scrollbar-color: #b3c6e0 transparent;
    }

    & .fi-sidebar-header {
        background: transparent !important;
    }

    & :is(.fi-logo, .admin-brand, .delegate-brand) {
        color: var(--lg-ink) !important;
    }

    /*
     * No white chip on a pale sidebar.
     *
     * The mark is a transparent PNG whose artwork is dark navy. Against
     * the old blue sidebar it needed a white disc behind it to stay
     * legible — that is what .delegate-brand img and .admin-brand img
     * still set. On this background the disc is not keeping anything
     * legible: it is a white plate behind a logo that reads perfectly
     * well on its own, and because the radius here squared it off, it
     * read as a box rather than a badge.
     *
     * Scoped to html:not(.dark), so the dark panels keep the chip they
     * do still need.
     */
    & :is(.admin-brand, .delegate-brand) img {
        background: transparent;
        padding: 0;
        object-fit: contain;
    }

    & .fi-sidebar :is(.fi-sidebar-item-label, .fi-sidebar-item-icon, .fi-sidebar-group-label),
    & .fi-sidebar :is(.fi-icon-btn, .fi-sidebar-group-collapse-btn) {
        color: var(--lg-body) !important;
    }

    & .fi-sidebar .fi-sidebar-item-btn {
        border-radius: 0.625rem;
    }

    /*
     * The padlock on a locked row.
     *
     * filament-delegate.css draws it in #fff, and says why: "The sidebar
     * is navy in both themes, so white is safe in both." That stopped
     * being true the moment this stylesheet made the sidebar pale — a
     * white padlock on #ebf3fc is a padlock nobody can see, and being
     * legible at a glance is the only thing a padlock is for.
     */
    & .fi-sidebar-item-btn[href*="#lock-"]::after {
        background-color: var(--lg-body);
    }

    & .fi-sidebar .fi-sidebar-item:not(.fi-active) .fi-sidebar-item-btn:hover,
    & .fi-sidebar :is(.fi-sidebar-group-btn, .fi-icon-btn):hover {
        background: var(--lg-tint) !important;
        color: var(--lg-ink) !important;
        transform: none;
    }

    & .fi-sidebar .fi-sidebar-item.fi-active > .fi-sidebar-item-btn {
        background: var(--lg-primary) !important;
        box-shadow: inset 0 1px 0 rgb(255 255 255 / 24%);
    }

    & .fi-sidebar .fi-sidebar-item.fi-active > .fi-sidebar-item-btn::before {
        content: none;
    }

    & .fi-sidebar .fi-sidebar-item.fi-active > .fi-sidebar-item-btn :is(.fi-sidebar-item-label, .fi-sidebar-item-icon) {
        color: #fff !important;
    }

    & .fi-sidebar :is(.admin-signout button, .delegate-cta) {
        color: var(--lg-blue) !important;
        background: var(--lg-control);
        border: 1px solid var(--lg-line);
        border-radius: 0.625rem;
        box-shadow: none;
    }

    & :is(.fi-header-heading, .delegate-greeting h1) {
        color: var(--lg-ink);
        font-size: clamp(1.75rem, 1.25rem + 1.4vw, 2.65rem);
        font-weight: 500;
        letter-spacing: -0.025em;
        line-height: 1.15;
    }

    & :is(.fi-header-subheading, .fi-breadcrumbs-item-label, .delegate-greeting p, .dash-note) {
        color: var(--lg-body);
    }

    & :is(.fi-section:not(.fi-section-not-contained), .fi-ta-ctn, .fi-wi-stats-overview-stat,
        .dash-card, .dash-standing, .delegate-greeting, .dashboard-announcement) {
        border: 0;
        border-radius: var(--lg-radius);
        background: var(--lg-panel);
        box-shadow: var(--lg-shadow);
    }

    & :is(.fi-section-header, .fi-section-content-ctn, .fi-ta-header-toolbar, .fi-ta-pagination) {
        border-color: var(--lg-line);
    }

    & :is(.fi-ta-table thead, .fi-ta-header-toolbar) {
        background: rgb(244 249 255 / 68%);
    }

    & .fi-ta-row:hover {
        background: rgb(223 233 248 / 60%);
    }

    & :is(.fi-section-header-heading, .fi-ta-header-cell-label, .dash-card h2) {
        color: var(--lg-ink);
    }

    & .fi-wi-stats-overview-stat-value {
        color: var(--lg-ink);
        font-weight: 500;
        font-variant-numeric: tabular-nums;
    }

    & .fi-input-wrp:not(.fi-invalid) {
        background: var(--lg-control);
        box-shadow: inset 0 0 0 1px #adbfda;
    }

    & .fi-input-wrp:not(.fi-invalid):focus-within {
        box-shadow: inset 0 0 0 2px var(--lg-blue);
    }

    & :is(.fi-btn.fi-color-primary, .dash-btn:not(.dash-btn-quiet)) {
        border-radius: 0.625rem;
        background: var(--lg-primary);
        color: #fff;
    }

    & :is(.fi-btn.fi-color-primary, .dash-btn:not(.dash-btn-quiet)):hover {
        background: #243d75;
    }

    & :is(.dash-btn-quiet, .delegate-cta:hover) {
        background: var(--lg-control);
        border-color: var(--lg-line);
        color: var(--lg-blue);
    }

    & :is(.fi-sidebar-item-btn, .fi-btn, .dash-btn, .dash-quiet-link):focus-visible {
        outline: 2px solid var(--lg-blue);
        outline-offset: 3px;
    }

    & .delegate-events-aside:not(.is-collapsed) {
        background: #f5f9ff;
        border-inline-start-color: var(--lg-line);
    }

    & .delegate-rail-toggle {
        background: var(--lg-control);
        border-color: var(--lg-line);
        color: var(--lg-blue);
    }

    & .delegate-greeting {
        margin: 0;
        padding: clamp(1.25rem, 3vw, 2rem);
        text-align: start;
    }

    & .dash-card h2 {
        font-size: 1.2rem;
        font-weight: 600;
    }

    & :is(.dash-card p, .dash-standing, .dash-standing-until, .dash-standing-meta, .dash-standing-meta strong,
        .dash-standing-profile-head a, .dash-standing-profile-tip) {
        color: var(--lg-body);
    }

    & .dash-standing-label {
        color: var(--lg-ink);
    }

    & :is(.dash-pill, .iaam-decision-badge, .iaam-decision-cell .fi-badge) {
        background: var(--lg-tint);
        color: var(--lg-blue);
    }

    @media (min-width: 64rem) {
        & .fi-sidebar {
            top: 5rem;
            height: calc(100dvh - 6rem);
            margin-block: 1rem;
            margin-inline-start: 1rem;
            border: 1px solid var(--lg-rim) !important;
            border-radius: var(--lg-radius);
            background: var(--lg-panel) !important;
            box-shadow: var(--lg-shadow);
        }
    }
}

.iaam-dashboard-next {
    margin-block-end: 1rem;
}

.iaam-decision-badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 0.375rem;
    background: rgb(45 74 138 / 16%);
    color: #2d4a8a;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.25rem;
}

.dark .iaam-decision-badge {
    background: #233962;
    color: #d2e1ff;
}

.iaam-dashboard-submissions {
    margin-block-start: 0.5rem;
}

.iaam-dashboard-submission {
    display: grid;
    gap: 0.75rem;
    padding-block: 1rem;
    border-block-start: 1px solid var(--lg-line, #455570);

    & + & {
        padding-block-end: 0;
    }

    & h3 {
        font-size: 1.05rem;
        font-weight: 600;
        overflow-wrap: anywhere;
    }

    & .dash-btn {
        justify-self: start;
        min-height: 2.75rem;
    }
}

.iaam-dashboard-submission-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.iaam-recent-abstracts {
    display: grid;
    gap: 0.75rem;
    font-size: 0.9375rem;

    & li {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
        gap: 0.5rem 1rem;
        padding-block-end: 0.75rem;
        border-block-end: 1px solid var(--lg-line, #455570);
    }

    & li:last-child {
        padding-block-end: 0;
        border-block-end: 0;
    }

    & .iaam-recent-abstract-meta {
        display: block;
        color: var(--lg-body, currentColor);
        font-size: 0.8125rem;
    }
}
