/*
  The application frame: the header (☰, the eyes and BUS AACHOOKI, agency, bell, help and account), the deep navy agency menu (groups that
  open and close, the desktop icon rail, the phone drawer), the breadcrumb trail and the footer, on the #F5F8FC page. Loaded after
  partner-theme.css, so these win over its lighter theme. sidebar.js sets html.sidebar-is-collapsed and each group's .is-closed.
*/

:root {
  --shell-navy: #071B35;
  --shell-navy-2: #0C2648;
  --shell-blue: #0866F5;
  --shell-page: #F5F8FC;
  --shell-line: #E3E9F2;
  --page: var(--shell-page);
  --bs-body-bg: var(--shell-page);
}

/* ---------- Page: a plain light background and one white content surface ---------- */

body { background: var(--shell-page); }
body::before { display: none; }
.app-main {
  background: #FFFFFF; border: 1px solid var(--shell-line);
  box-shadow: 0 1px 2px rgba(7, 27, 53, 0.04), 0 8px 24px rgba(7, 27, 53, 0.05);
}

/* ---------- Header: white, with a hairline below ---------- */

.topbar { background: rgba(255, 255, 255, 0.97); border-bottom: 1px solid var(--shell-line); box-shadow: 0 1px 3px rgba(7, 27, 53, 0.04); }
.topbar::after { display: none; }
.topbar .icon-button { border-color: var(--shell-line); color: var(--shell-navy); }
.topbar .icon-button:hover { background: #EEF4FE; border-color: #C9DBF8; color: var(--shell-blue); }
.topbar-help .icon { width: 1.2rem; height: 1.2rem; }
.topbar-badge { background: var(--shell-blue); color: #FFFFFF; }
.agency-switch { background: #FFFFFF; border-color: var(--shell-line); }
.agency-switch:hover { border-color: #C9DBF8; }

.account-button {
  display: inline-flex; align-items: center; gap: 0.5rem; max-width: 15rem; padding: 0.2rem 0.55rem 0.2rem 0.2rem;
  border: 1px solid var(--shell-line); border-radius: 999px; background: #FFFFFF; color: var(--shell-navy); font-weight: 600; font-size: 0.875rem;
}
.account-button:hover, .account-button[aria-expanded="true"] { border-color: #C9DBF8; background: #F7FAFF; }
.account-button:focus-visible { outline: 2px solid var(--shell-blue); outline-offset: 2px; }
.account-button .avatar {
  display: inline-flex; align-items: center; justify-content: center; flex: none; width: 2rem; height: 2rem;
  background: var(--shell-blue); color: #FFFFFF; border: 0; box-shadow: none; font-size: 0.75rem;
}
.account-button__name { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-button__caret { display: inline-flex; color: #4A5568; }
.account-button__caret .icon { width: 0.9rem; height: 0.9rem; }
@media (max-width: 991.98px) { .account-button__name, .account-button__caret { display: none; } .account-button { padding: 0.2rem; } }
/*
  Phones: ☰, the eyes and the name, the bell, the account button and the decorative pair of eyes must fit on one line. Help moves to the
  account menu (it is there on every size) and the gaps close up a little.
*/
@media (max-width: 575.98px) {
  .topbar-help { display: none; }
  .topbar, .topbar__end, .topbar__actions { gap: 0.4rem; }
  .account-button .avatar { width: 1.9rem; height: 1.9rem; }
}
/* The narrowest phones (360px and below 380px): a little less space everywhere, so nothing touches. */
@media (max-width: 379.98px) {
  .topbar, .topbar__end, .topbar__actions { gap: 0.25rem; }
  .topbar .menu-toggle, .topbar .topbar-bell { width: 2.25rem; height: 2.25rem; }
}
.account-menu .dropdown-item { display: flex; align-items: center; gap: 0.6rem; }
.account-menu .dropdown-item .icon { width: 1rem; height: 1rem; color: #4A5568; }
.account-menu .dropdown-item:hover { background: #EEF4FE; }
.account-menu .dropdown-item:hover .icon { color: var(--shell-blue); }

/* ---------- Header: ☰, then the BUS AACH(eyes)KI wordmark (styled in the shared brand-eyes.css) ---------- */

.menu-toggle { flex: none; }
@media (max-width: 419.98px) { .partner-chip { display: none; } }

/* ---------- The menu: deep navy, white names, the current page in royal blue ---------- */

/*
  The navy is painted as a background image on purpose: from 992px Bootstrap's .offcanvas-lg sets background-color: transparent !important,
  which would leave the white names on the light page. An image layer isn't affected by that rule.
*/
.sidebar {
  --bs-offcanvas-bg: var(--shell-navy);
  background: linear-gradient(180deg, var(--shell-navy) 0%, #0A2242 100%);
  border-right: 1px solid var(--shell-navy-2); color: #FFFFFF; scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}
@media (min-width: 992px) { .sidebar { backdrop-filter: none; } }
.sidebar .offcanvas-header { border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.sidebar__agency { color: #FFFFFF; }
.sidebar .btn-close { filter: invert(1) grayscale(1) brightness(2); }
.sidebar__group, .sidebar__section .sidebar__group { color: rgba(255, 255, 255, 0.6); }
.sidebar__group::before { display: none; }
.sidebar__section .sidebar__link { color: rgba(255, 255, 255, 0.82); }
.sidebar__section .sidebar__link .icon { color: rgba(255, 255, 255, 0.72); opacity: 1; }
.sidebar__section .sidebar__link:hover { background: rgba(255, 255, 255, 0.08); color: #FFFFFF; }
.sidebar__section .sidebar__link:hover .icon { color: #FFFFFF; }
.sidebar__section .sidebar__link:focus-visible { outline: 2px solid #7FB2FF; outline-offset: 1px; }
.sidebar__section .sidebar__link.is-current {
  background: var(--shell-blue); color: #FFFFFF; font-weight: 650; box-shadow: 0 6px 16px rgba(8, 102, 245, 0.35);
}
.sidebar__section .sidebar__link.is-current::before { display: none; }
.sidebar__section .sidebar__link.is-current .icon { color: #FFFFFF; }
.sidebar__soon { color: #FFD8A8; background: rgba(255, 138, 0, 0.16); border-color: rgba(255, 138, 0, 0.35); }

/* ---------- Menu groups ---------- */

button.sidebar__group {
  width: calc(100% - 1.5rem); padding: 0.2rem 0; border: 0; background: none; cursor: pointer; text-align: left;
  border-radius: var(--radius-sm);
}
button.sidebar__group:hover { color: #FFFFFF; }
button.sidebar__group:focus-visible { outline: 2px solid #7FB2FF; outline-offset: 2px; }
.sidebar__group-title { flex: 1 1 auto; }
.sidebar__chevron { display: inline-flex; margin-left: auto; transition: transform 0.15s ease; }
.sidebar__chevron .icon { width: 0.9rem; height: 0.9rem; }
.sidebar__section.is-closed .sidebar__chevron { transform: rotate(-90deg); }
.sidebar__section.is-closed .sidebar__list { display: none; }
/* Space between groups; the first sits close to the top. */
.sidebar__section + .sidebar__section > .sidebar__group { margin-top: 1.1rem; }

/* ---------- Desktop: the icon rail ---------- */

@media (min-width: 992px) {
  .sidebar { transition: width 0.2s ease; }
  .sidebar-is-collapsed .sidebar { width: 4.75rem; overflow-x: hidden; }
  .sidebar-is-collapsed .sidebar__body { padding: 0.75rem 0.6rem 2rem; }
  .sidebar-is-collapsed .sidebar__group { display: none; }
  .sidebar-is-collapsed .sidebar__section + .sidebar__section { margin-top: 0.5rem; padding-top: 0.5rem; border-top: 1px solid rgba(255, 255, 255, 0.1); }
  /* Every icon shows in the rail, whichever groups are closed when it is wide. */
  .sidebar-is-collapsed .sidebar__section.is-closed .sidebar__list { display: block; }
  .sidebar-is-collapsed .sidebar__link { justify-content: center; padding: 0.6rem 0; }
  .sidebar-is-collapsed .sidebar__link .icon { width: 1.25rem; height: 1.25rem; }
  .sidebar-is-collapsed .sidebar__soon { display: none; }
  /* Hidden from sight but still read out, so each link keeps its name for screen readers. */
  .sidebar-is-collapsed .sidebar__text {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar, .sidebar__chevron { transition: none; }
}

/* ---------- Breadcrumbs ---------- */

.crumbs { margin: -0.25rem 0 1.25rem; }
.crumbs__list { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem; margin: 0; padding: 0; list-style: none; font-size: 0.8125rem; }
.crumbs__item { display: inline-flex; align-items: center; gap: 0.25rem; min-width: 0; }
.crumbs__link { color: var(--c-blue-text, #0A4FC0); font-weight: 550; text-decoration: none; border-radius: 4px; }
.crumbs__link:hover { text-decoration: underline; }
.crumbs__sep { display: inline-flex; color: var(--text-muted); }
.crumbs__sep .icon { width: 0.85rem; height: 0.85rem; }
.crumbs__current { color: var(--text); font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 22rem; }

/*
  ---------- Footer: deep navy like the menu, sticky ----------
  It stays at the bottom of the window while the page scrolls (position: sticky inside the content column, so it never covers the menu),
  and sits in its normal place once the page ends. Only the copyright, centred. Messages (toasts) rise above it.
*/

:root { --footer-height: 2.75rem; }
.app-footer {
  position: sticky; bottom: 0; z-index: 1020;
  display: flex; align-items: center; justify-content: center; min-height: calc(var(--footer-height) + var(--safe-bottom));
  margin-top: 1.5rem; border: 0;
  padding: 0.5rem max(1.25rem, var(--safe-right)) calc(0.5rem + var(--safe-bottom)) max(1.25rem, var(--safe-left));
  background: linear-gradient(180deg, var(--shell-navy) 0%, #0A2242 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 -6px 18px rgba(7, 27, 53, 0.12);
  font-size: 0.8125rem;
}
.page-auth .app-footer { border-top: 1px solid rgba(255, 255, 255, 0.06); }
.app-footer__copy { margin: 0; text-align: center; color: rgba(255, 255, 255, 0.85); font-weight: 600; letter-spacing: 0.04em; }
.toast-stack { bottom: calc(max(1rem, var(--safe-bottom)) + var(--footer-height)); }

/* ---------- Help page ---------- */

.help-steps { margin: 0; padding-left: 1.25rem; display: grid; gap: 0.6rem; }
.help-steps a { font-weight: 650; }
