/* ===========================================================================
   prism-theme.css — Prism Design System theme layer for the Innovation Gateway
   ---------------------------------------------------------------------------
   Loaded LAST (after bootstrap, prism-components.css, site.css) so its :root
   token overrides win over the Prism.Components.Razor v1.0.0 package defaults
   (--primary:#0066cc, system fonts) and Bootstrap defaults.

   Tokens extracted from the newer Prism theme used by mocks.prismbenadmin.net.
   Scope: the gateway's own Razor pages only — downstream SPAs are untouched.
   =========================================================================== */

/* ---- 1. Self-hosted fonts -------------------------------------------------
   Open Sans v44 ships as a single variable woff2 (weights 300-800).
   Lato is static (400 + 700). Files live in ../lib/fonts/. */
@font-face {
    font-family: "Open Sans";
    font-style: normal;
    font-weight: 300 800;
    font-display: swap;
    src: url(../lib/fonts/open-sans.woff2) format("woff2");
}
@font-face {
    font-family: "Lato";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url(../lib/fonts/lato-400.woff2) format("woff2");
}
@font-face {
    font-family: "Lato";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url(../lib/fonts/lato-700.woff2) format("woff2");
}

/* ---- 2. Design tokens (override Prism package + Bootstrap) ----------------- */
:root {
    --primary: #0f5cf5;
    --primary-hover: #276df6;
    --primary-focus: #0849c9;
    --primary-text: #063798;
    --primary-ghost: #f0f5fe;
    --primary-thin: #f8faff;

    --gray100: #f9f9f9;
    --gray200: #f3f3f4;
    --gray300: #dcdee0;
    --gray400: #c1c5c8;
    --gray500: #697077;
    --gray600: #2a3742;
    --gray700: #192128;

    --success: #21b787;
    --warning: #faaa4b;
    --help: #562a88;
    --info: #0f5cf5;

    --border-radius: .375rem;
    --card-border-radius: .75rem;
    --box-shadow: 0 .125rem .375rem 0 rgba(0, 0, 0, .1);

    --font-family: "Open Sans", "Helvetica Neue", Arial, sans-serif;
    --font-family-header: "Lato", "Open Sans", "Helvetica Neue", Arial, sans-serif;

    /* Sidebar geometry + overlay (theme-local) */
    --app-sidebar-width: 260px;
    --app-overlay-bg: rgba(25, 33, 40, .92); /* gray700 @ .92 */

    /* Remap Bootstrap's primary so utilities (.text-primary, .bg-primary,
       .btn-outline-primary, focus rings) follow the Prism blue. */
    --bs-primary: #0f5cf5;
    --bs-primary-rgb: 15, 92, 245;
    --bs-link-color: var(--primary);
    --bs-link-color-rgb: 15, 92, 245;
    --bs-link-hover-color: var(--primary-focus);
}

/* ---- 3. Typography -------------------------------------------------------- */
body {
    font-family: var(--font-family);
    color: var(--gray700);
    background-color: var(--gray100);
}
h1, h2, h3, h4, h5, h6,
.app-sidebar__brand,
.app-topbar__brand {
    font-family: var(--font-family-header);
}

/* ---- 4. Bootstrap component remap ----------------------------------------- */
.btn-primary {
    --bs-btn-bg: var(--primary);
    --bs-btn-border-color: var(--primary);
    --bs-btn-hover-bg: var(--primary-hover);
    --bs-btn-hover-border-color: var(--primary-hover);
    --bs-btn-active-bg: var(--primary-focus);
    --bs-btn-active-border-color: var(--primary-focus);
    --bs-btn-disabled-bg: var(--primary);
    --bs-btn-disabled-border-color: var(--primary);
    --bs-btn-focus-shadow-rgb: 15, 92, 245;
}
a {
    color: var(--primary);
}
a:hover {
    color: var(--primary-focus);
}

/* Cards: soft Prism radius + subtle shadow, light border */
.card {
    border-radius: var(--card-border-radius);
    border-color: var(--gray300);
}
.card.shadow-sm {
    box-shadow: var(--box-shadow) !important;
}

/* Brand-colored decorative icons / accents (replaces inline color:#2c3e50) */
.text-brand {
    color: var(--primary);
}

/* ===========================================================================
   5. App shell — left sidebar layout
   =========================================================================== */
.app-shell {
    display: flex;
    min-height: 100vh;
}

/* Content column. min-width:0 is required so flex children that use
   .table-responsive can shrink-and-scroll instead of forcing a page-level
   horizontal scrollbar. */
.app-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* ---- Sidebar -------------------------------------------------------------- */
.app-sidebar {
    background-color: var(--gray700);
    color: #fff;
}

/* On >=lg the sidebar is a sticky vertical rail (Bootstrap's .offcanvas-lg
   removes offcanvas behavior at that breakpoint; we only need to lay it out). */
@media (min-width: 992px) {
    .app-sidebar {
        width: var(--app-sidebar-width);
        flex: 0 0 var(--app-sidebar-width);
        position: sticky;
        top: 0;
        align-self: flex-start;
        height: 100vh;
        display: flex;
        flex-direction: column;
        /* Bootstrap's .offcanvas-lg forces `background-color: transparent !important`
           at this breakpoint (it disables offcanvas behavior on large screens).
           Re-assert the dark fill with !important or the rail shows the near-white
           body background — making the white nav text invisible. */
        background-color: var(--gray700) !important;
    }
}

.app-sidebar__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.app-sidebar__brand {
    color: #fff;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
}
.app-sidebar__brand:hover {
    color: #fff;
}

.app-sidebar__nav {
    padding: .75rem .5rem;
    margin: 0;
    overflow-y: auto;
    flex: 1 1 auto;
}
.app-sidebar__nav .nav-link {
    color: rgba(255, 255, 255, .82);
    border-radius: var(--border-radius);
    padding: .55rem .75rem;
    margin-bottom: .15rem;
    display: flex;
    align-items: center;
    gap: .65rem;
    font-size: .95rem;
}
.app-sidebar__nav .nav-link i {
    width: 1.1rem;
    text-align: center;
    flex: 0 0 auto;
}
.app-sidebar__nav .nav-link:hover {
    color: #fff;
    background-color: var(--gray600);
}
/* Active item: Prism-blue fill + left accent bar */
.app-sidebar__nav .nav-link.active {
    color: #fff;
    background-color: var(--primary);
    box-shadow: inset .2rem 0 0 0 rgba(255, 255, 255, .65);
}
.app-sidebar__group-toggle {
    cursor: pointer;
}
.app-sidebar__group-toggle .app-sidebar__caret {
    width: auto;
    font-size: .75rem;
    transition: transform .15s ease;
}
.app-sidebar__group-toggle[aria-expanded="true"] .app-sidebar__caret {
    transform: rotate(180deg);
}
/* Indented sub-nav (Logs group) */
.app-sidebar__subnav {
    padding-left: .85rem;
    margin: 0;
}
.app-sidebar__subnav .nav-link {
    font-size: .9rem;
    padding-top: .45rem;
    padding-bottom: .45rem;
}

/* ---- Sidebar footer (user menu + logout), pinned to bottom ---------------- */
.app-sidebar__footer {
    margin-top: auto;
    padding: .75rem;
    border-top: 1px solid rgba(255, 255, 255, .08);
}
.app-sidebar__user {
    color: rgba(255, 255, 255, .9);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .55rem .75rem;
    border-radius: var(--border-radius);
    width: 100%;
}
.app-sidebar__user:hover {
    color: #fff;
    background-color: var(--gray600);
}
.app-sidebar__user i {
    width: 1.1rem;
    text-align: center;
}
.app-sidebar__user-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---- Mobile top bar (hamburger), only shown < lg -------------------------- */
.app-topbar {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .5rem 1rem;
    background-color: var(--gray700);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 1030;
}
.app-topbar__toggle {
    color: #fff;
    font-size: 1.25rem;
    padding: .25rem .5rem;
    text-decoration: none;
}
.app-topbar__toggle:hover {
    color: #fff;
}
.app-topbar__brand {
    color: #fff;
    text-decoration: none;
    font-weight: 700;
}
.app-topbar__brand:hover {
    color: #fff;
}

/* ---- App-launch overlay (replaces inline rgba(44,62,80,.92)) -------------- */
.app-launch-overlay {
    background: var(--app-overlay-bg);
}
