/******************************************************************************
 * AEGIS — general application chrome (authenticated pages)
 *
 * Loaded after admidio.css. EVERYTHING here is scoped under
 *     body.admidio:not(:has(.aeg-hud))
 * so it styles the authenticated app (navbar, sidebar, cards, tables, forms)
 * but NEVER the immersive login / system-message pages (which carry .aeg-hud
 * and are handled by aegis-hud.css).
 *
 * The body also carries data-bs-theme="dark" (Bootstrap 5.3 native dark mode),
 * which supplies well-tested dark defaults for all Bootstrap components; the
 * rules below layer the S.H.I.E.L.D. cyan/glass accents on top.
 *
 * Reversible: switch the Admidio theme back to `simple`, or remove this file
 * and its <link> from index.tpl / index.reduced.tpl.
 *****************************************************************************/

/* ---- Palette + backdrop ------------------------------------------------- */
body.admidio:not(:has(.aeg-hud)) {
    --aeg-bg-0: #070d15;
    --aeg-bg-1: #0b1622;
    --aeg-surface: rgba(15, 26, 39, 0.72);
    --aeg-surface-2: rgba(11, 20, 31, 0.86);
    --aeg-edge: rgba(120, 176, 214, 0.24);
    --aeg-edge-bright: #57d6ef;
    --aeg-cyan: #3fbdf0;
    --aeg-cyan-soft: #7fd6ef;
    --aeg-text: #dce8f4;
    --aeg-text-dim: #93a9be;
    --aeg-muted: #5f7c96;
    --aeg-amber: #f5a623;
    --aeg-danger: #ff5b52;
    --aeg-success: #35d6a4;

    /* Bootstrap surface + accent variables */
    --bs-body-bg: #08111b;
    --bs-body-color: var(--aeg-text);
    --bs-emphasis-color: #ffffff;
    --bs-secondary-color: var(--aeg-text-dim);
    --bs-border-color: var(--aeg-edge);
    --bs-primary: var(--aeg-cyan);
    --bs-primary-rgb: 63, 189, 240;
    --bs-link-color: var(--aeg-cyan-soft);
    --bs-link-color-rgb: 127, 214, 239;
    --bs-link-hover-color: #ffffff;
    --bs-focus-ring-color: rgba(63, 189, 240, 0.4);

    color: var(--aeg-text);
    background:
        radial-gradient(1100px 600px at 12% -8%, rgba(30, 78, 112, 0.22), transparent 60%),
        linear-gradient(180deg, var(--aeg-bg-1) 0%, var(--aeg-bg-0) 100%) fixed;
    -webkit-font-smoothing: antialiased;
}
body.admidio:not(:has(.aeg-hud)) ::selection { background: rgba(63, 189, 240, 0.28); }

/* ---- Top navbar --------------------------------------------------------- */
body.admidio:not(:has(.aeg-hud)) #adm_main_navbar {
    background: linear-gradient(180deg, rgba(13, 24, 37, 0.92), rgba(9, 17, 27, 0.92));
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--aeg-edge);
    box-shadow: 0 1px 0 rgba(63, 189, 240, 0.14), 0 8px 24px -16px rgba(0, 0, 0, 0.8);
    color: var(--aeg-text);
}
body.admidio:not(:has(.aeg-hud)) #adm_headline_organization,
body.admidio:not(:has(.aeg-hud)) #adm_headline_membership {
    color: var(--aeg-text); font-weight: 600; letter-spacing: 0.06em;
}
body.admidio:not(:has(.aeg-hud)) #adm_main_navbar .nav-link { color: var(--aeg-text-dim); }
body.admidio:not(:has(.aeg-hud)) #adm_main_navbar .nav-link:hover { color: var(--aeg-cyan-soft); }
body.admidio:not(:has(.aeg-hud)) #adm_profile_photo { box-shadow: 0 0 0 1px var(--aeg-edge), 0 0 10px -2px rgba(63, 189, 240, 0.5); }

/* ---- Sidebar menu ------------------------------------------------------- */
body.admidio:not(:has(.aeg-hud)) .admidio-sidebar {
    background: linear-gradient(180deg, rgba(11, 20, 31, 0.6), rgba(8, 15, 24, 0.6));
    border-right: 1px solid var(--aeg-edge);
}
body.admidio:not(:has(.aeg-hud)) .admidio-menu-header {
    color: var(--aeg-cyan-soft);
    text-transform: uppercase; letter-spacing: 0.18em; font-size: 0.68rem;
    opacity: 0.9; margin-top: 1rem;
}
body.admidio:not(:has(.aeg-hud)) .admidio-menu-list a.nav-link {
    color: var(--aeg-text-dim);
    border-radius: 8px; margin: 1px 0; padding: 0.5rem 0.7rem;
    border-left: 2px solid transparent;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
body.admidio:not(:has(.aeg-hud)) .admidio-menu-list a.nav-link i { color: var(--aeg-cyan); margin-right: 0.55rem; }
body.admidio:not(:has(.aeg-hud)) .admidio-menu-list a.nav-link:hover {
    background: rgba(63, 189, 240, 0.10);
    color: #ffffff; border-left-color: var(--aeg-edge-bright);
}
body.admidio:not(:has(.aeg-hud)) .admidio-menu-list a.nav-link.active {
    background: rgba(63, 189, 240, 0.16); color: #ffffff; border-left-color: var(--aeg-cyan);
}

/* ---- Breadcrumb + content header --------------------------------------- */
body.admidio:not(:has(.aeg-hud)) .admidio-breadcrumb .breadcrumb { background: transparent; }
body.admidio:not(:has(.aeg-hud)) .breadcrumb-item,
body.admidio:not(:has(.aeg-hud)) .breadcrumb-item a { color: var(--aeg-text-dim); }
body.admidio:not(:has(.aeg-hud)) .breadcrumb-item.active { color: var(--aeg-cyan-soft); }
body.admidio:not(:has(.aeg-hud)) .breadcrumb-item + .breadcrumb-item::before { color: var(--aeg-muted); }
body.admidio:not(:has(.aeg-hud)) .admidio-module-headline {
    color: #ffffff; font-weight: 600; letter-spacing: 0.03em;
    padding-left: 0.75rem; border-left: 3px solid var(--aeg-cyan);
}

/* ---- Cards = glass panels ---------------------------------------------- */
body.admidio:not(:has(.aeg-hud)) .card {
    background: linear-gradient(180deg, var(--aeg-surface), var(--aeg-surface-2));
    border: 1px solid var(--aeg-edge);
    border-radius: 12px;
    box-shadow: 0 18px 50px -30px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(63, 189, 240, 0.05) inset;
    color: var(--aeg-text);
}
body.admidio:not(:has(.aeg-hud)) .card-header {
    background: rgba(63, 189, 240, 0.06);
    border-bottom: 1px solid var(--aeg-edge);
    color: #ffffff; font-weight: 600; letter-spacing: 0.02em;
}
body.admidio:not(:has(.aeg-hud)) .card-header .bi { color: var(--aeg-cyan); }
body.admidio:not(:has(.aeg-hud)) .card-footer {
    background: rgba(8, 15, 24, 0.5); border-top: 1px solid var(--aeg-edge); color: var(--aeg-text-dim);
}

/* ---- Tables ------------------------------------------------------------- */
body.admidio:not(:has(.aeg-hud)) .table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--aeg-text);
    --bs-table-border-color: var(--aeg-edge);
    --bs-table-striped-bg: rgba(63, 189, 240, 0.04);
    --bs-table-striped-color: var(--aeg-text);
    --bs-table-hover-bg: rgba(63, 189, 240, 0.10);
    --bs-table-hover-color: #ffffff;
}
body.admidio:not(:has(.aeg-hud)) .table thead th,
body.admidio:not(:has(.aeg-hud)) .table th {
    color: var(--aeg-cyan-soft);
    text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.78rem;
    border-bottom: 1px solid var(--aeg-edge);
    background: rgba(63, 189, 240, 0.05);
}
body.admidio:not(:has(.aeg-hud)) .table td { border-color: rgba(120, 176, 214, 0.14); }
body.admidio:not(:has(.aeg-hud)) .table-responsive { border-radius: 12px; }

/* ---- Forms -------------------------------------------------------------- */
body.admidio:not(:has(.aeg-hud)) .form-label { color: var(--aeg-text-dim); font-weight: 500; }
body.admidio:not(:has(.aeg-hud)) .form-control,
body.admidio:not(:has(.aeg-hud)) .form-select {
    background: rgba(6, 13, 21, 0.7);
    border: 1px solid var(--aeg-edge);
    color: var(--aeg-text);
    border-radius: 8px;
}
body.admidio:not(:has(.aeg-hud)) .form-control::placeholder { color: var(--aeg-muted); }
body.admidio:not(:has(.aeg-hud)) .form-control:focus,
body.admidio:not(:has(.aeg-hud)) .form-select:focus {
    background: rgba(8, 17, 27, 0.9);
    border-color: var(--aeg-edge-bright);
    box-shadow: 0 0 0 3px rgba(63, 189, 240, 0.2);
    color: var(--aeg-text);
}
body.admidio:not(:has(.aeg-hud)) .input-group-text {
    background: rgba(63, 189, 240, 0.08); border: 1px solid var(--aeg-edge); color: var(--aeg-cyan-soft);
}

/* ---- Buttons ------------------------------------------------------------ */
body.admidio:not(:has(.aeg-hud)) .btn-primary {
    border: 1px solid var(--aeg-edge-bright);
    background: linear-gradient(180deg, rgba(63, 189, 240, 0.24), rgba(38, 118, 158, 0.3));
    color: #eaf7fd; font-weight: 600; letter-spacing: 0.03em;
    box-shadow: 0 8px 22px -12px rgba(63, 189, 240, 0.7);
}
body.admidio:not(:has(.aeg-hud)) .btn-primary:hover {
    background: linear-gradient(180deg, rgba(83, 209, 255, 0.34), rgba(48, 138, 178, 0.42));
    color: #ffffff;
}
body.admidio:not(:has(.aeg-hud)) .btn-secondary {
    background: transparent; border: 1px solid var(--aeg-edge); color: var(--aeg-cyan-soft);
}
body.admidio:not(:has(.aeg-hud)) .btn-secondary:hover { border-color: var(--aeg-edge-bright); color: #fff; background: rgba(63, 189, 240, 0.08); }
body.admidio:not(:has(.aeg-hud)) .btn-link { color: var(--aeg-cyan-soft); }

/* ---- Badges, dropdowns, modals, alerts --------------------------------- */
body.admidio:not(:has(.aeg-hud)) .badge.bg-light { background: rgba(63, 189, 240, 0.16) !important; color: var(--aeg-cyan-soft) !important; }
body.admidio:not(:has(.aeg-hud)) .dropdown-menu {
    background: var(--aeg-surface-2); border: 1px solid var(--aeg-edge);
    box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.85);
}
body.admidio:not(:has(.aeg-hud)) .dropdown-item { color: var(--aeg-text-dim); }
body.admidio:not(:has(.aeg-hud)) .dropdown-item:hover { background: rgba(63, 189, 240, 0.12); color: #fff; }
body.admidio:not(:has(.aeg-hud)) .modal-content {
    background: var(--aeg-surface-2); border: 1px solid var(--aeg-edge); border-radius: 14px;
    box-shadow: 0 40px 100px -40px rgba(0, 0, 0, 0.9);
}
body.admidio:not(:has(.aeg-hud)) .modal-header,
body.admidio:not(:has(.aeg-hud)) .modal-footer { border-color: var(--aeg-edge); }

/* Alerts: cyan by default, amber the single warm accent, red for danger */
body.admidio:not(:has(.aeg-hud)) .alert {
    background: rgba(15, 26, 39, 0.7); border: 1px solid var(--aeg-edge);
    border-left: 3px solid var(--aeg-cyan); color: var(--aeg-text); border-radius: 9px;
}
body.admidio:not(:has(.aeg-hud)) .alert-success { border-left-color: var(--aeg-success); }
body.admidio:not(:has(.aeg-hud)) .alert-warning { border-left-color: var(--aeg-amber); color: #ffd78a; }
body.admidio:not(:has(.aeg-hud)) .alert-danger { border-left-color: var(--aeg-danger); color: #ffb0ab; }

/* ---- Footer ------------------------------------------------------------- */
body.admidio:not(:has(.aeg-hud)) #adm_imprint {
    color: var(--aeg-muted); border-top: 1px solid var(--aeg-edge);
    margin-top: 2rem; padding-top: 1rem; font-size: 0.82rem;
}
body.admidio:not(:has(.aeg-hud)) #adm_imprint a { color: var(--aeg-cyan-soft); }

/* ---- Links + focus (accessibility) ------------------------------------- */
body.admidio:not(:has(.aeg-hud)) a { color: var(--aeg-cyan-soft); }
body.admidio:not(:has(.aeg-hud)) a:hover { color: #ffffff; }
body.admidio:not(:has(.aeg-hud)) :focus-visible { outline: 2px solid var(--aeg-edge-bright); outline-offset: 2px; }

/* ---- Contrast hardening ------------------------------------------------
 * admidio.css forces a LIGHT palette at :root (--bs-body-bg:#fff, --bs-tertiary
 * light, etc.) which partially defeats data-bs-theme="dark". Re-assert dark
 * surfaces and fix the specific components that ship a light background so no
 * page shows white-bg / unreadable text (e.g. Documents & Files). */
body.admidio:not(:has(.aeg-hud)) {
    --bs-secondary-bg: #0f1a27;
    --bs-tertiary-bg: #0d1826;
    --bs-secondary-color: var(--aeg-text-dim);
    --bs-tertiary-color: var(--aeg-text-dim);
    --bs-tertiary: #12202f;
    --bs-tertiary-rgb: 18, 32, 47;
    --bs-emphasis-color-rgb: 255, 255, 255;
}
/* Admidio builds .alert-info as color-mix(primary 40%, white) => light blue.
   Force it to a dark cyan-tinted panel with readable text. */
body.admidio:not(:has(.aeg-hud)) .alert-info {
    background-color: rgba(63, 189, 240, 0.10) !important;
    border-color: rgba(63, 189, 240, 0.40) !important;
    color: var(--aeg-cyan-soft) !important;
}
body.admidio:not(:has(.aeg-hud)) .alert-info a { color: #ffffff; }
/* White / light utility backgrounds anywhere in the app. */
body.admidio:not(:has(.aeg-hud)) .bg-white,
body.admidio:not(:has(.aeg-hud)) .bg-body,
body.admidio:not(:has(.aeg-hud)) .bg-body-tertiary,
body.admidio:not(:has(.aeg-hud)) .bg-body-secondary,
body.admidio:not(:has(.aeg-hud)) .bg-light {
    background-color: var(--aeg-surface) !important;
    color: var(--aeg-text) !important;
}
/* Tables & DataTables wrappers: transparent over the dark page, light text. */
body.admidio:not(:has(.aeg-hud)) .dt-container,
body.admidio:not(:has(.aeg-hud)) .dataTables_wrapper,
body.admidio:not(:has(.aeg-hud)) .table-responsive {
    background-color: transparent; color: var(--aeg-text);
}
body.admidio:not(:has(.aeg-hud)) table.table,
body.admidio:not(:has(.aeg-hud)) table.table > :not(caption) > * > * {
    background-color: transparent !important;
    color: var(--aeg-text);
}
body.admidio:not(:has(.aeg-hud)) .dataTables_info,
body.admidio:not(:has(.aeg-hud)) .dataTables_length,
body.admidio:not(:has(.aeg-hud)) .dataTables_filter { color: var(--aeg-text-dim); }
/* List groups (folder/file rows, etc.). */
body.admidio:not(:has(.aeg-hud)) .list-group { background-color: transparent; }
body.admidio:not(:has(.aeg-hud)) .list-group-item {
    background-color: var(--aeg-surface);
    border-color: var(--aeg-edge);
    color: var(--aeg-text);
}
body.admidio:not(:has(.aeg-hud)) .list-group-item-action:hover {
    background-color: rgba(63, 189, 240, 0.10); color: #ffffff;
}
/* Popovers / tooltips. */
body.admidio:not(:has(.aeg-hud)) .popover,
body.admidio:not(:has(.aeg-hud)) .popover .popover-body { background-color: var(--aeg-surface-2); color: var(--aeg-text); }
body.admidio:not(:has(.aeg-hud)) .popover-header { background-color: rgba(63, 189, 240, 0.10); color: #fff; }
/* Muted / secondary helper text that admidio renders dark on light. */
body.admidio:not(:has(.aeg-hud)) .text-muted,
body.admidio:not(:has(.aeg-hud)) .text-body-secondary { color: var(--aeg-text-dim) !important; }

/* ---- Nav tabs / pagination (light touches) ----------------------------- */
body.admidio:not(:has(.aeg-hud)) .nav-tabs { border-bottom-color: var(--aeg-edge); }
body.admidio:not(:has(.aeg-hud)) .nav-tabs .nav-link { color: var(--aeg-text-dim); border: none; }
body.admidio:not(:has(.aeg-hud)) .nav-tabs .nav-link.active {
    color: #fff; background: transparent; border-bottom: 2px solid var(--aeg-cyan);
}
body.admidio:not(:has(.aeg-hud)) .page-link { background: var(--aeg-surface); border-color: var(--aeg-edge); color: var(--aeg-cyan-soft); }
body.admidio:not(:has(.aeg-hud)) .page-item.active .page-link { background: rgba(63, 189, 240, 0.22); border-color: var(--aeg-cyan); color: #fff; }

/******************************************************************************
 * GOD'S EYE SHELL v2  (2026-08-27) — native chrome, bottom command dock.
 *
 * Replaces the old top navbar + left sidebar with a fixed God's-Eye frame:
 * a slim top telemetry bar, a full-bleed stage, and a bottom command dock
 * built from the (clearance-gated) Admidio menu. Applied only on authenticated
 * app pages, which carry body.aeg-shell (set in index.tpl when $validLogin).
 * The login / message pages never get .aeg-shell, so they keep aegis-hud.css.
 *
 * Presentation only — no page logic or clearance is touched. Reversible by
 * reverting index.tpl and removing this block.
 *****************************************************************************/
body.aeg-shell {
    --aeg-tb-h: 48px;
    --aeg-dock-h: 78px;
    --aeg-font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    --aeg-font-ui: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    margin: 0;
    overflow: hidden;                 /* the stage scrolls, not the document */
    font-family: var(--aeg-font-ui);
    background: radial-gradient(1200px 720px at 72% -12%, rgba(63,189,240,.06), transparent 62%),
                linear-gradient(180deg, var(--aeg-bg-1) 0%, var(--aeg-bg-0) 100%) fixed;
}
/* Hide Admidio's native nav ONLY on the God's Eye globe page (it owns its whole
   chrome). On every other authenticated back-office page the native navbar MUST
   render so Contacts / Groups & Roles / Preferences are reachable and usable. */
body.aeg-shell:has(.aeg-cmd-shell) #adm_main_navbar,
body.aeg-shell:has(.aeg-cmd-shell) .admidio-headline-mobile-menu { display: none !important; }

/* ---- top telemetry bar -------------------------------------------------- */
.aeg-topbar {
    position: fixed; top: 0; left: 0; right: 0; height: var(--aeg-tb-h); z-index: 1030;
    display: flex; align-items: center; gap: 14px; padding: 0 12px;
    background: linear-gradient(180deg, rgba(10,18,28,.97), rgba(10,18,28,.82));
    border-bottom: 1px solid var(--aeg-edge); backdrop-filter: blur(14px);
    font-family: var(--aeg-font-mono);
}
.aeg-tb-brand { display: flex; align-items: center; gap: 8px; font-weight: 700;
    letter-spacing: .22em; font-size: .8rem; color: #eaf6ff; white-space: nowrap; }
.aeg-tb-brand img { height: 22px; width: 22px; filter: drop-shadow(0 0 6px rgba(63,189,240,.6)); }
.aeg-tb-brand small { color: var(--aeg-cyan); letter-spacing: .3em; font-size: .56rem; font-weight: 600; }
.aeg-tb-crumbs { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-size: .62rem; letter-spacing: .06em; color: var(--aeg-text-dim); }
.aeg-tb-crumbs a { color: var(--aeg-text-dim); text-decoration: none; }
.aeg-tb-crumbs a:hover { color: var(--aeg-cyan-soft); }
.aeg-tb-spacer { flex: 1 1 auto; }
.aeg-tb-tele { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2;
    font-size: .56rem; letter-spacing: .08em; color: var(--aeg-muted); }
.aeg-tb-tele b { color: var(--aeg-cyan); font-weight: 600; }
/* universal header right side: clock · clearance · power (matches the God's Eye) */
.aeg-tb-brand span { display: inline; }
.aeg-tb-id { display: flex; align-items: center; gap: 12px; font-size: .66rem; letter-spacing: .1em; white-space: nowrap; }
.aeg-tb-id .clk { color: var(--aeg-cyan); }
.aeg-tb-id .lvl { color: #f5a623; border: 1px solid rgba(245,166,35,.5); border-radius: 4px; padding: 2px 8px; }
.aeg-tb-id .lo { color: var(--aeg-text-dim); font-size: 1.05rem; text-decoration: none; display: inline-flex; align-items: center; }
.aeg-tb-id .lo:hover { color: #ff5b52; }
.aeg-modes { display: flex; gap: 4px; }
.aeg-chip { font-family: var(--aeg-font-mono); font-size: .56rem; letter-spacing: .12em;
    padding: 5px 8px; border: 1px solid var(--aeg-edge); border-radius: 5px;
    color: var(--aeg-muted); background: rgba(0,0,0,.22); cursor: pointer; }
.aeg-chip:hover { color: var(--aeg-text); }
.aeg-chip.on { color: #04121a; background: var(--aeg-cyan); border-color: var(--aeg-cyan);
    font-weight: 700; box-shadow: 0 0 12px rgba(63,189,240,.4); }
.aeg-iconbtn { display: flex; align-items: center; gap: 5px; font-family: var(--aeg-font-mono);
    font-size: .58rem; letter-spacing: .12em; padding: 6px 9px; border: 1px solid var(--aeg-edge);
    border-radius: 6px; color: var(--aeg-text-dim); background: rgba(0,0,0,.2); cursor: pointer; }
.aeg-iconbtn:hover { color: var(--aeg-cyan-soft); border-color: var(--aeg-edge-bright); }
.aeg-iconbtn.on { color: var(--aeg-cyan); background: rgba(63,189,240,.14); border-color: var(--aeg-edge-bright); }
.aeg-user { position: relative; }
.aeg-user > a img { height: 30px; width: 30px; border-radius: 50%;
    box-shadow: 0 0 0 1px var(--aeg-edge), 0 0 10px -2px rgba(63,189,240,.5); }
.aeg-user .dropdown-menu { background: var(--aeg-surface-2); border: 1px solid var(--aeg-edge);
    backdrop-filter: blur(16px); }
.aeg-user .dropdown-menu .nav-link, .aeg-user .dropdown-menu a { color: var(--aeg-text-dim); }
.aeg-user .dropdown-menu a:hover { color: var(--aeg-cyan-soft); }

/* ---- stage (the scrolling content region between the two bars) ---------- */
.aeg-stage {
    position: fixed; top: var(--aeg-tb-h); bottom: var(--aeg-dock-h); left: 0; right: 0;
    overflow-y: auto; overflow-x: hidden; scrollbar-width: thin;
}
.aeg-stage::-webkit-scrollbar { width: 8px; }
.aeg-stage::-webkit-scrollbar-thumb { background: var(--aeg-edge); border-radius: 8px; }
.aeg-stage #adm_content { padding: 16px 22px 30px; max-width: none; }
.aeg-stage .admidio-content-header { display: flex; align-items: center; gap: 12px;
    padding-left: .75rem; border-left: 3px solid var(--aeg-cyan); margin: 4px 0 16px; }
.aeg-stage .admidio-module-headline { font-family: var(--aeg-font-mono); letter-spacing: .04em;
    font-size: 1.15rem; margin: 0; color: #eef6fc; }
.aeg-stage #adm_imprint { color: var(--aeg-muted); font-size: .62rem; margin-top: 28px;
    padding-top: 12px; border-top: 1px solid var(--aeg-edge); }
.aeg-crumbs-wrap { padding: 8px 22px 0; }

/* HUD overlay: corner brackets + faint reticle over the stage */
.aeg-overlay { position: fixed; top: var(--aeg-tb-h); bottom: var(--aeg-dock-h); left: 0; right: 0;
    pointer-events: none; z-index: 900; }
.aeg-corner { position: absolute; width: 20px; height: 20px; border: 2px solid rgba(63,189,240,.42); }
.aeg-corner.tl { top: 10px; left: 10px; border-right: none; border-bottom: none; }
.aeg-corner.tr { top: 10px; right: 10px; border-left: none; border-bottom: none; }
.aeg-corner.bl { bottom: 10px; left: 10px; border-right: none; border-top: none; }
.aeg-corner.br { bottom: 10px; right: 10px; border-left: none; border-top: none; }

/* ---- bottom command dock ------------------------------------------------ */
.aeg-dock {
    position: fixed; bottom: 0; left: 0; right: 0; height: var(--aeg-dock-h); z-index: 1030;
    display: flex; align-items: center; gap: 5px; padding: 6px 12px;
    overflow-x: auto; overflow-y: hidden; scrollbar-width: thin;
    background: linear-gradient(0deg, rgba(6,10,16,.99), rgba(8,14,22,.97));
    border-top: 1px solid var(--aeg-edge);
    /* NO backdrop-filter: it made .aeg-dock a containing block, which trapped the
       position:fixed SYSTEM popover inside the dock (and its overflow clipped it),
       so the popover opened behind the page. Solid background instead. */
}
.aeg-dock::-webkit-scrollbar { height: 6px; }
.aeg-dock::-webkit-scrollbar-thumb { background: var(--aeg-edge); border-radius: 6px; }
.aeg-dock-item { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 3px;
    min-width: 62px; padding: 7px 8px; border-radius: 10px; text-decoration: none;
    color: var(--aeg-text-dim); border: 1px solid transparent; transition: .12s; position: relative; }
.aeg-dock-item i { font-size: 1.18rem; line-height: 1; }
.aeg-dock-item span { font-family: var(--aeg-font-mono); font-size: .52rem; letter-spacing: .04em;
    text-transform: uppercase; text-align: center; line-height: 1.05; max-width: 74px; }
.aeg-dock-item:hover { color: var(--aeg-text); background: rgba(63,189,240,.09);
    border-color: var(--aeg-edge); transform: translateY(-2px); }
.aeg-dock-item.active { color: var(--aeg-cyan); background: rgba(63,189,240,.15);
    border-color: var(--aeg-edge-bright); box-shadow: inset 0 0 0 1px rgba(63,189,240,.2); }
.aeg-dock-item.active::after { content: ""; position: absolute; top: -6px; left: 22%; right: 22%;
    height: 3px; border-radius: 3px; background: var(--aeg-cyan); box-shadow: 0 0 8px var(--aeg-cyan); }
.aeg-dock-item .badge { position: absolute; top: 2px; right: 8px; font-size: .5rem;
    background: var(--aeg-amber) !important; color: #100a00 !important; }
.aeg-dock-sep { flex: 0 0 auto; width: 1px; height: 40px; background: var(--aeg-edge); margin: 0 6px; }
/* system (admin) groups tucked into a details popover on the right of the dock */
.aeg-dock-sys { flex: 0 0 auto; margin-left: auto; position: relative; }
.aeg-dock-sys > summary { list-style: none; cursor: pointer; }
.aeg-dock-sys > summary::-webkit-details-marker { display: none; }
.aeg-dock-sys[open] > summary .aeg-dock-item { color: var(--aeg-cyan); }
/* position:fixed so the popover escapes the dock's overflow-x clip (was opening
   behind the page content). Anchored just above the dock, right-aligned. */
.aeg-dock-pop { position: fixed; bottom: calc(var(--aeg-dock-h) + 8px); right: 12px; z-index: 1045;
    min-width: 210px; max-height: 60vh; overflow-y: auto;
    display: flex; flex-direction: column; gap: 2px; padding: 8px;
    background: var(--aeg-surface-2); border: 1px solid var(--aeg-edge-bright); border-radius: 12px;
    backdrop-filter: blur(18px); box-shadow: 0 12px 44px rgba(0,0,0,.6); }
.aeg-dock-pop .aeg-pop-group { font-family: var(--aeg-font-mono); font-size: .5rem;
    letter-spacing: .16em; color: var(--aeg-muted); padding: 6px 8px 2px; }
.aeg-dock-pop a { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 8px;
    color: var(--aeg-text-dim); text-decoration: none; font-size: .74rem; }
.aeg-dock-pop a i { color: var(--aeg-cyan); }
.aeg-dock-pop a:hover { background: rgba(63,189,240,.1); color: var(--aeg-text); }

/* ---- sensor modes: CSS filter over the stage ---------------------------- */
body.aeg-shell.aeg-nvg  .aeg-stage { filter: brightness(1.05) saturate(1.15) sepia(.55) hue-rotate(66deg) contrast(1.05); }
body.aeg-shell.aeg-thrm .aeg-stage { filter: contrast(1.3) saturate(1.9) hue-rotate(-18deg) brightness(1.02); }
body.aeg-shell.aeg-crt  .aeg-stage { filter: contrast(1.12) brightness(1.02) saturate(1.15); }
body.aeg-shell.aeg-crt  .aeg-overlay::after { content: ""; position: absolute; inset: 0;
    background: repeating-linear-gradient(0deg, rgba(0,0,0,.14) 0 1px, transparent 1px 3px); opacity: .5; }

/* ---- HUD toggle (hide reticle overlay) ---------------------------------- */
body.aeg-shell.aeg-nohud .aeg-overlay { display: none; }

/* ---- Clean UI toggle: slide the chrome away, reveal on edge hover -------- */
body.aeg-shell.aeg-clean .aeg-topbar { transform: translateY(-100%); }
body.aeg-shell.aeg-clean .aeg-dock   { transform: translateY(100%); }
body.aeg-shell.aeg-clean .aeg-stage  { top: 0; bottom: 0; }
body.aeg-shell.aeg-clean .aeg-overlay{ top: 0; bottom: 0; }
.aeg-topbar, .aeg-dock { transition: transform .25s ease; }
body.aeg-shell.aeg-clean .aeg-topbar:hover,
body.aeg-shell.aeg-clean .aeg-reveal-top:hover + .aeg-topbar { transform: translateY(0); }
.aeg-reveal-top { position: fixed; top: 0; left: 0; right: 0; height: 6px; z-index: 1029; }
.aeg-reveal-bot { position: fixed; bottom: 0; left: 0; right: 0; height: 6px; z-index: 1029; }
body.aeg-shell:not(.aeg-clean) .aeg-reveal-top,
body.aeg-shell:not(.aeg-clean) .aeg-reveal-bot { display: none; }
body.aeg-shell.aeg-clean .aeg-reveal-bot:hover ~ .aeg-dock,
body.aeg-shell.aeg-clean .aeg-dock:hover { transform: translateY(0); }

/* ---- full-bleed spatial pages fill the stage exactly -------------------- */
body.aeg-shell #adm_content:has(.aeg-globe-page) { padding: 0; }
body.aeg-shell #adm_content:has(.aeg-globe-page) .admidio-content-header { display: none; }
body.aeg-shell #aeg-globe-wrap {
    height: calc(100vh - var(--aeg-tb-h) - var(--aeg-dock-h)) !important;
    min-height: 420px; border-radius: 0 !important; border-left: none; border-right: none; }
body.aeg-shell.aeg-clean #aeg-globe-wrap { height: 100vh !important; }
body.aeg-shell #aeg-map {
    height: calc(100vh - var(--aeg-tb-h) - var(--aeg-dock-h) - 130px) !important; min-height: 380px; }
body.aeg-shell #aeg-gsvg { height: calc(100vh - var(--aeg-tb-h) - var(--aeg-dock-h) - 150px) !important; min-height: 460px; }

@media (max-width: 820px) {
    body.aeg-shell { --aeg-dock-h: 72px; }
    /* The sensor / HUD / immersive controls stay visible at every width -- the
       top bar is meant to look the same on a laptop as on a wide display. They
       are flex:0 0 auto + nowrap below, so they compress rather than clip. */
    .aeg-tb-crumbs { display: none; }
}
/* Keep the mode controls from ever wrapping or clipping in a tight top bar. */
.aeg-topbar .aeg-tb-modes { flex: 0 0 auto; display: flex; align-items: center;
    gap: 4px; white-space: nowrap; }
.aeg-topbar .aeg-tb-modes .aeg-chip,
.aeg-topbar .aeg-tb-modes .aeg-iconbtn { flex: 0 0 auto; }
@media (prefers-reduced-motion: reduce) {
    .aeg-topbar, .aeg-dock, .aeg-dock-item { transition: none; }
}

/* =======================================================================
   God's Eye command page owns its own chrome. Hide the theme top bar and
   the content headline from FIRST PAINT (this file loads in <head>) so they
   never flash in as a SECOND "DOMESTIC INTELLIGENCE" banner, and the landing
   always renders as the single God's Eye interface.
   ======================================================================= */
body#admidio-aegis-command .aeg-topbar,
body#admidio-aegis-command .admidio-content-header,
body#admidio-aegis-command .admidio-module-headline { display: none !important; }

/* ROBUST version of the same suppression, keyed off the GLOBE SHELL being in
   the DOM rather than the body id. PagePresenter does not always stamp the
   body id as "admidio-aegis-command", so the id-only rules above can miss and
   the theme top bar renders as a SECOND identical "DOMESTIC INTELLIGENCE" bar
   over the globe (with the same NORM/NVG/THRM/CRT/HUD/IMMERSE controls). Keying
   on :has(.aeg-cmd-shell) hides the theme chrome on the command page no matter
   what the id is, so the bar can never duplicate. */
body.aeg-shell:has(.aeg-cmd-shell) .aeg-topbar,
body.aeg-shell:has(.aeg-cmd-shell) .admidio-content-header,
body.aeg-shell:has(.aeg-cmd-shell) .admidio-module-headline,
body.aeg-shell:has(.aeg-cmd-shell) #adm_imprint { display: none !important; }
/* Sensor tints hit the globe (#aeg-cmd-cesium) directly on this page. A filter
   on .aeg-stage would turn the fixed globe shell into an absolutely-positioned
   box and shove it down -- that is the "a second bar slides in when I click
   CRT" glitch. Neutralise the stage filter whenever the shell is present. */
body.aeg-shell:has(.aeg-cmd-shell) .aeg-stage { filter: none !important; }
body.aeg-shell:has(.aeg-cmd-shell) { overflow: hidden; }
body.aeg-shell:has(.aeg-cmd-shell) #adm_content { padding: 0 !important; }

/*****************************************************************************
 * AEGIS — top-bar NAVIGATION (restored 2026-08-29)
 * The God's Eye shell hides #adm_main_navbar and no longer renders the sidebar,
 * so this dropdown is the ONLY navigation on every non-command page. Styled to
 * match the old dock popover so the chrome still reads as one design.
 *****************************************************************************/
.aeg-nav { position: relative; flex: 0 0 auto; }
.aeg-nav > summary { list-style: none; cursor: pointer; }
.aeg-nav > summary::-webkit-details-marker { display: none; }
.aeg-nav > summary::marker { content: ""; }
.aeg-nav[open] > summary { color: var(--aeg-cyan); background: rgba(63,189,240,.14);
    border-color: var(--aeg-edge-bright); }
.aeg-nav-pop {
    position: absolute; top: calc(100% + 8px); left: 0; z-index: 1045;
    min-width: 250px; max-height: calc(100vh - var(--aeg-tb-h) - 24px); overflow-y: auto;
    background: var(--aeg-surface-2); border: 1px solid var(--aeg-edge); border-radius: 10px;
    box-shadow: 0 18px 44px rgba(0,0,0,.55); padding: 8px; backdrop-filter: blur(14px);
}
.aeg-nav-pop::-webkit-scrollbar { width: 8px; }
.aeg-nav-pop::-webkit-scrollbar-thumb { background: var(--aeg-edge); border-radius: 8px; }
.aeg-nav-pop .aeg-pop-group { font-family: var(--aeg-font-mono); font-size: .5rem;
    letter-spacing: .22em; text-transform: uppercase; color: var(--aeg-muted);
    padding: 10px 10px 4px; }
.aeg-nav-pop .aeg-pop-group:first-child { padding-top: 4px; }
.aeg-nav-pop a { display: flex; align-items: center; gap: 9px; padding: 8px 10px;
    border-radius: 8px; color: var(--aeg-text-dim); text-decoration: none;
    font-size: .78rem; white-space: nowrap; }
.aeg-nav-pop a i { color: var(--aeg-cyan); width: 1.05rem; text-align: center; flex: 0 0 auto; }
.aeg-nav-pop a:hover, .aeg-nav-pop a:focus-visible { background: rgba(63,189,240,.1);
    color: var(--aeg-text); outline: none; }
.aeg-nav-pop a[aria-current="page"] { color: var(--aeg-cyan); background: rgba(63,189,240,.15); }
.aeg-nav-badge { margin-left: auto; font-style: normal; font-family: var(--aeg-font-mono);
    font-size: .55rem; padding: 1px 6px; border-radius: 999px;
    background: var(--aeg-cyan); color: #04121a; }
/* IMMERSE hides the bar; make sure an open menu goes with it. */
body.aeg-shell.aeg-clean .aeg-nav[open] > .aeg-nav-pop { display: none; }
