/* blueC Compact Sign-in theme */

:root {
    --bbs-navy: #1C3262;
    --bbs-w: 240px;      /* open sidebar */
    --bbs-rail: 32px;    /* collapsed sidebar: a 28px menu button, above WCAG 2.2's 24px minimum target */
    --bbs-ease: cubic-bezier(.2, .7, .2, 1);
    --bs-primary: #1C3262;
    --bs-primary-rgb: 28, 50, 98;
    --bs-link-color: #1C3262;
    --bs-link-color-rgb: 28, 50, 98;
    --bs-link-hover-color: #14244a;
    --bs-link-hover-color-rgb: 20, 36, 74;
}

.btn-primary {
    --bs-btn-bg: #1C3262; --bs-btn-border-color: #1C3262;
    --bs-btn-hover-bg: #172a53; --bs-btn-hover-border-color: #172a53;
    --bs-btn-active-bg: #14244a; --bs-btn-active-border-color: #14244a;
    --bs-btn-disabled-bg: #1C3262; --bs-btn-disabled-border-color: #1C3262;
    --bs-btn-focus-shadow-rgb: 62, 80, 122;
}

.btn-outline-primary {
    --bs-btn-color: #1C3262; --bs-btn-border-color: #1C3262;
    --bs-btn-hover-bg: #1C3262; --bs-btn-hover-border-color: #1C3262;
    --bs-btn-active-bg: #1C3262; --bs-btn-active-border-color: #1C3262;
    --bs-btn-disabled-color: #1C3262; --bs-btn-disabled-border-color: #1C3262;
}

/* Dark (Theme.js sets data-bs-theme="dark" while the OS is set to dark; Bootstrap 5.3 does the rest).
   Navy text is 1.2:1 on Bootstrap's dark page (#212529), so links and outline buttons use the theme's
   light blue #8fb4ff (7.5:1), with navy text on it when filled (6.0:1). Filled navy buttons, the
   sidebar and the sign-in screen stay navy. */
[data-bs-theme=dark] {
    --bs-link-color: #8fb4ff;
    --bs-link-color-rgb: 143, 180, 255;
    --bs-link-hover-color: #b5ceff;
    --bs-link-hover-color-rgb: 181, 206, 255;
}

[data-bs-theme=dark] .btn-outline-primary {
    --bs-btn-color: #8fb4ff; --bs-btn-border-color: #8fb4ff;
    --bs-btn-hover-color: #1C3262; --bs-btn-hover-bg: #8fb4ff; --bs-btn-hover-border-color: #8fb4ff;
    --bs-btn-active-color: #1C3262; --bs-btn-active-bg: #8fb4ff; --bs-btn-active-border-color: #8fb4ff;
    --bs-btn-disabled-color: #8fb4ff; --bs-btn-disabled-border-color: #8fb4ff;
}

body { margin: 0; }

/* Hidden while the blueButler sign-in check runs (Theme.js removes this). */
html.bbs-gating body { visibility: hidden; }

/* Layout */

.bbs-shell { display: flex; min-height: 100vh; }

.bbs-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    flex: 0 0 var(--bbs-w);
    width: var(--bbs-w);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bbs-navy);
    color: #fff;
    /* Above Bootstrap's offcanvas backdrop (1040) so the control panel, which Oqtane renders
       inside the sidebar, stays clickable. */
    z-index: 1046;
    transition: flex-basis .22s var(--bbs-ease), width .22s var(--bbs-ease);
}

html.bbs-collapsed .bbs-sidebar { flex-basis: var(--bbs-rail); width: var(--bbs-rail); }

.bbs-main { flex: 1 1 auto; min-width: 0; }

.bbs-content { padding-top: 1rem; padding-bottom: 1rem; }

/* Sidebar header: menu button + logo */

.bbs-head { flex: none; display: flex; align-items: center; gap: 8px; height: 56px; padding: 0 6px; transition: padding .22s var(--bbs-ease); }
html.bbs-collapsed .bbs-head { padding: 0 2px; }

.bbs-toggle {
    position: relative;
    flex: none;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: rgba(255, 255, 255, .9);
    cursor: pointer;
    transition: background-color .15s, width .22s var(--bbs-ease), height .22s var(--bbs-ease);
}
html.bbs-collapsed .bbs-toggle { width: 28px; height: 28px; border-radius: 8px; }
/* Site admin's needs-attention badge, repeated on ☰ while collapsed hides the Site admin shield. */
.bbs-toggle-dot { display: none; position: absolute; top: 2px; right: 2px; width: 8px; height: 8px; border-radius: 50%; background: #ffc400; box-shadow: 0 0 0 2px var(--bbs-navy); }
html.bbs-collapsed .bbs-toggle-dot { display: block; }
.bbs-toggle:hover { background: rgba(255, 255, 255, .12); color: #fff; }
/* Keyboard focus: #8fb4ff on navy is 6.0:1 (WCAG 1.4.11 needs 3:1). Page links replace Bootstrap's
   faint blue glow, which is 1.3:1 on navy. */
.bbs-toggle:focus-visible,
.bbs-account-button:focus-visible,
.bbs-splash-admin:focus-visible,
.bbs-admin-link:focus-visible,
.bbs-nav .nav-link:focus-visible { outline: 2px solid #8fb4ff; outline-offset: 2px; box-shadow: none; }
.bbs-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

.bbs-logo { min-width: 0; overflow: hidden; white-space: nowrap; transition: opacity .15s; }
.bbs-logo img { max-height: 34px; max-width: 170px; }
.bbs-logo .navbar-brand { color: #fff; font-size: 1rem; font-weight: 600; margin: 0; padding: 0; }

/* Everything below the header (hidden when collapsed) */

.bbs-panel {
    flex: 1;
    min-height: 0;
    width: var(--bbs-w);
    display: flex;
    flex-direction: column;
    transition: opacity .15s, visibility .15s;
}

html.bbs-collapsed .bbs-panel,
html.bbs-collapsed .bbs-logo { opacity: 0; visibility: hidden; pointer-events: none; }

/* blueButler account: "Sign in to blueButler" while signed out; while signed in, the account row
   (avatar initial + username), which opens in place in the sidebar's navy. */

.bbs-account { padding: 0 8px 8px; }
html.bbs-bb-in .bbs-account-signin,
html:not(.bbs-bb-in) [data-bbs-account] { display: none !important; }

.bbs-account-button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 6px 8px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #fff;
    font-size: .92rem;
    text-align: left;
    cursor: pointer;
    transition: background-color .15s;
}
.bbs-account-button:hover,
html.bbs-account-open [data-bbs-account] { background: rgba(255, 255, 255, .1); }
.bbs-account-button svg,
.bbs-account-item svg { flex: none; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.bbs-account-signin .bbs-account-icon { margin: 0 3px; } /* lines up with the 24px avatar */
.bbs-account-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bbs-account-caret { opacity: .7; transition: transform .15s; }
html.bbs-account-open .bbs-account-caret { transform: rotate(180deg); }

.bbs-avatar {
    flex: none;
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, .2);
    font-size: .75rem;
    font-weight: 700;
    line-height: 1;
}
.bbs-account-button .bbs-avatar svg { width: 14px; height: 14px; }
html.bbs-bb-named .bbs-avatar svg,
html:not(.bbs-bb-named) .bbs-avatar-initial { display: none; }

.bbs-account-menu { display: none; margin-top: 4px; padding: 4px; border-radius: 8px; background: rgba(0, 0, 0, .18); }
html.bbs-account-open .bbs-account-menu { display: block; }
/* "Signed in as" with the full username below it, never cut off (Primer: wrap rather than truncate). */
.bbs-account-who { margin: 0; padding: 4px 8px 6px; color: rgba(255, 255, 255, .6); font-size: .78rem; }
.bbs-account-who-name { display: block; color: #fff; font-size: .85rem; overflow-wrap: anywhere; }
.bbs-account-who-name:empty { display: none; }
.bbs-account-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 7px 8px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #fff;
    font-size: .9rem;
    text-align: left;
    cursor: pointer;
}
.bbs-account-item:hover { background: rgba(255, 255, 255, .1); }
.bbs-account-item:focus-visible { background: rgba(255, 255, 255, .1); outline: 2px solid #8fb4ff; outline-offset: -2px; }

/* Sign-in splash (page needs a blueButler session and there is none) */

.bbs-splash { display: none; }
html.bbs-needs-signin .bbs-splash {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--bbs-navy);
    color: #fff;
}
html.bbs-needs-signin .bbs-shell { visibility: hidden; }
html.bbs-needs-signin body { overflow: hidden; }
.bbs-splash-card { width: 100%; max-width: 360px; text-align: center; }
.bbs-splash-logo { margin-bottom: 28px; }
.bbs-splash-logo img,
.bbs-signin-logo img { max-height: 40px; max-width: 220px; }
.bbs-splash-logo .navbar-brand,
.bbs-signin-logo .navbar-brand { color: #fff; font-size: 1.2rem; font-weight: 600; }
.bbs-splash h1 { margin: 0 0 8px; font-size: 1.5rem; font-weight: 600; }
.bbs-splash p { margin: 0 0 24px; color: rgba(255, 255, 255, .75); }
.bbs-splash-button {
    width: 100%;
    min-height: 46px;
    padding: 10px 16px;
    border: 0;
    border-radius: 8px;
    background: #fff;
    color: var(--bbs-navy);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color .15s;
}
.bbs-splash-button:hover { background: #e9eef7; }
.bbs-splash-button:focus-visible { outline: 3px solid #8fb4ff; outline-offset: 3px; }
.bbs-splash .bbs-splash-note { margin: 14px 0 0; min-height: 1.4em; font-size: .85rem; color: rgba(255, 255, 255, .7); }
.bbs-splash-admin {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 8px;
    border-radius: 6px;
    color: rgba(255, 255, 255, .55); /* 4.9:1 on navy; WCAG 1.4.3 needs 4.5:1 */
    font-size: .75rem;
    text-decoration: none;
    white-space: nowrap;
}

/* Menu */

.bbs-nav { flex: 1; min-height: 0; overflow-x: hidden; overflow-y: auto; padding: 4px 8px 12px; }
.bbs-nav .app-menu-toggler { display: none; }
.bbs-nav .navbar-collapse { display: block !important; }
.bbs-nav .nav { flex-direction: column; flex-wrap: nowrap; }
.bbs-nav .nav-item { padding: 0 !important; margin-bottom: 2px; }
.bbs-nav .nav-link {
    display: block;
    padding: 8px 12px;
    border-radius: 8px;
    color: rgba(255, 255, 255, .82);
    font-size: .92rem;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background-color .15s, color .15s;
}
.bbs-nav .nav-link:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.bbs-nav .nav-link.active { background: rgba(255, 255, 255, .18); color: #fff; font-weight: 600; }
.bbs-nav .nav-link .oi { width: 1.4rem; opacity: .9; }

/* "Site admin" (Oqtane account and editing tools, folded behind a shield icon) */

.bbs-admin { flex: none; padding: 6px 12px 10px; }
.bbs-admin-link {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: rgba(255, 255, 255, .5);
    text-decoration: none;
    cursor: pointer;
}
.bbs-splash-admin:hover,
.bbs-admin-link:hover { color: rgba(255, 255, 255, .85); background: rgba(255, 255, 255, .08); }
html.bbs-admin-open .bbs-admin-link { color: rgba(255, 255, 255, .85); background: rgba(255, 255, 255, .08); }

/* Lucide "shield-user" icon (lucide-static 0.479.0), used under the ISC License:
   Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT).
   All other copyright (c) for Lucide are held by Lucide Contributors 2022.
   Permission to use, copy, modify, and/or distribute this software for any purpose with or without
   fee is hereby granted, provided that the above copyright notice and this permission notice appear
   in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
   REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
   EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
   DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
   NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
   THIS SOFTWARE. */
.bbs-admin-icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Needs-attention badge on the shield (SignIn.AdminNotice) */
.bbs-admin-dot { position: absolute; top: 4px; right: 4px; width: 8px; height: 8px; border-radius: 50%; background: #ffc400; box-shadow: 0 0 0 2px var(--bbs-navy); }
.bbs-admin-notice { margin: 0; padding: 8px 10px; border-radius: 6px; background: rgba(255, 196, 0, .15); color: #ffe7a3; font-size: .8rem; line-height: 1.4; }

.bbs-admin-panel { display: none; gap: 8px; padding: 10px 0 2px; border-top: 1px solid rgba(255, 255, 255, .14); margin-top: 6px; }
html.bbs-admin-open .bbs-admin-panel { display: grid; }
.bbs-admin-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.bbs-admin-row:empty { display: none; }
.bbs-admin .app-form-inline { display: inline-flex; margin: 0; }
.bbs-admin .btn { margin: 0 !important; }
.bbs-user {
    margin-right: auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #fff;
    font-size: .9rem;
    font-weight: 600;
    text-decoration: none;
}
.bbs-user:hover { color: #fff; text-decoration: underline; }

.bbs-backdrop { display: none; }

/* "Sign-in (no menu)" layout: sign-in pages without site navigation */

.bbs-signin-layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 48px 16px;
    background: var(--bbs-navy);
}
.bbs-signin-logo { margin-bottom: 28px; text-align: center; }
.bbs-signin-card {
    width: 100%;
    max-width: 460px;
    padding: 28px 24px;
    border-radius: 12px;
    background: var(--bs-body-bg); /* white, or Bootstrap's dark #212529 in dark */
    box-shadow: 0 12px 32px rgba(0, 0, 0, .25);
}
.bbs-signin-card:empty { display: none; }

/* Login forms on the sign-in pages (the blueButler Login module's form and Oqtane's login), scoped to
   this layout so no other form on the site changes. Bootstrap's defaults on white are too faint for
   WCAG 1.4.11 (3:1 for a box's boundary and focus): border 1.3:1, focused border 2.1:1, glow 1.4:1. */
.bbs-signin-layout .form-control,
.bbs-signin-layout .form-select,
.bbs-signin-layout .form-check-input { border-color: #868e96; } /* 3.3:1 on white */
.bbs-signin-layout .form-control,
.bbs-signin-layout .form-select { padding-top: 10px; padding-bottom: 10px; border-radius: 8px; } /* 46px, like the buttons */
.bbs-signin-layout .form-control:focus,
.bbs-signin-layout .form-select:focus,
.bbs-signin-layout .form-check-input:focus { border-color: var(--bbs-navy); box-shadow: none; outline: 2px solid var(--bbs-navy); outline-offset: 0; } /* 12.5:1 */
/* Same height and corners as the sign-in screen's "Sign in to blueButler" button (46px, 8px). */
.bbs-signin-layout .btn { --bs-btn-padding-y: 10px; --bs-btn-border-radius: 8px; }
.bbs-signin-layout .btn:focus-visible { box-shadow: none; outline: 2px solid var(--bbs-navy); outline-offset: 2px; }
/* Dark: the borders stay #868e96 (4.6:1 on #212529); focus is the light blue (7.5:1). */
[data-bs-theme=dark] .bbs-signin-layout .form-control:focus,
[data-bs-theme=dark] .bbs-signin-layout .form-select:focus,
[data-bs-theme=dark] .bbs-signin-layout .form-check-input:focus { border-color: #8fb4ff; outline-color: #8fb4ff; }
[data-bs-theme=dark] .bbs-signin-layout .btn:focus-visible { outline-color: #8fb4ff; }

/* Modules */

.bbs-module { position: relative; }
.bbs-module-head { display: flex; align-items: center; gap: 8px; }
.bbs-module-title { font-size: 1.35rem; margin: 0 0 .75rem; }

/* Narrow screens: the collapsed rail stays on the left; opening the menu slides it over the page. */

@media (max-width: 767.98px) {
    .bbs-shell { padding-left: var(--bbs-rail); }
    .bbs-sidebar { position: fixed; left: 0; top: 0; bottom: 0; height: auto; box-shadow: 0 0 24px rgba(0, 0, 0, .25); }
    html.bbs-collapsed .bbs-sidebar { box-shadow: none; }
    html:not(.bbs-collapsed) .bbs-backdrop { display: block; position: fixed; inset: 0; z-index: 1045; background: rgba(16, 24, 40, .35); }
}

@media (prefers-reduced-motion: reduce) {
    .bbs-sidebar, .bbs-head, .bbs-panel, .bbs-logo, .bbs-toggle, .bbs-nav .nav-link,
    .bbs-account-button, .bbs-account-caret, .bbs-splash-button { transition: none; }
}
