/* ============================================================
   On the Road Again Lending — LAYOUT (L5 shells)
   PublicShell / BorrowerShell / OfficerShell chrome.
   ============================================================ */

/* ---------- Public header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 90;
  background: color-mix(in srgb, var(--gray-50) 88%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--gray-200);
}
.site-header .inner {
  max-width: var(--container); margin: 0 auto;
  height: var(--header-h);
  padding: 0 var(--sp-6);
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-6);
}
.site-nav { display: flex; align-items: center; gap: var(--sp-2); }
.site-nav a {
  padding: 9px 15px;
  border-radius: var(--r-pill);
  font-size: var(--fs-sm);
  font-weight: 550;
  color: var(--navy-800);
  text-decoration: none;
  white-space: nowrap;   /* a pill that wraps onto two lines reads as two links */
  transition: background-color var(--dur-fast) ease;
}
.site-nav a:hover { background: var(--navy-050); text-decoration: none; }
.site-nav a.active { background: var(--navy-050); font-weight: 650; }
.header-actions { display: flex; align-items: center; gap: var(--sp-3); }
.mobile-menu-btn { display: none; padding: 8px; border-radius: var(--r-sm); }

/* Five links fit at full padding from about 1,040px wide. Below that they
   tighten, and below 980px the menu button takes over (measured, v1.23). */
@media (max-width: 1100px) {
  .site-nav { gap: 2px; }
  .site-nav a { padding: 9px 10px; }
}

@media (max-width: 980px) {
  .site-nav, .header-actions .btn-secondary { display: none; }
  .mobile-menu-btn { display: grid; place-items: center; }
  .mobile-nav {
    display: none;
    position: fixed; inset: var(--header-h) 0 auto 0; z-index: 89;
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    box-shadow: var(--shadow-lg);
    padding: var(--sp-4) var(--sp-6) var(--sp-6);
  }
  .mobile-nav.open { display: block; }
  .mobile-nav a { display: block; padding: 13px 8px; font-weight: 600; color: var(--navy-900); border-bottom: 1px solid var(--gray-100); text-decoration: none; }
}
@media (min-width: 981px) { .mobile-nav { display: none !important; } }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--navy-950);
  color: var(--text-inverse-dim);
  margin-top: var(--sp-24);
  font-size: var(--fs-sm);
}
.site-footer .inner { max-width: var(--container); margin: 0 auto; padding: var(--sp-16) var(--sp-6) var(--sp-8); }
.site-footer h5 { color: var(--text-inverse); font-size: var(--fs-sm); font-weight: 650; margin-bottom: var(--sp-4); letter-spacing: 0.04em; text-transform: uppercase; font-family: var(--font-body); }
.site-footer a { color: var(--text-inverse-dim); display: block; padding: 5px 0; text-decoration: none; }
.site-footer a:hover { color: var(--text-inverse); }
.footer-legal {
  border-top: 1px solid var(--navy-800);
  margin-top: var(--sp-10); padding-top: var(--sp-6);
  font-size: var(--fs-xs); line-height: 1.7; color: var(--text-inverse-faint);
}
/* Links inside the legal lines read as links in a sentence, not as footer rows. */
.footer-legal a { display: inline; padding: 0; color: var(--text-inverse-dim); text-decoration: underline; text-underline-offset: 2px; }

/* ---------- App shell (portal & admin) ---------- */
.app-shell { display: flex; min-height: 100vh; }
/* Light sidebar: the Meridian signature on portal and officer screens. */
.app-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--white);
  color: var(--text-secondary);
  border-right: 1px solid var(--gray-200);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  padding: var(--sp-6) var(--sp-4);
}
.app-sidebar .brand-row { padding: 0 var(--sp-3) var(--sp-6); }
.app-sidebar nav { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.app-sidebar nav a {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: 11px 14px;
  border-radius: var(--r-sm);
  color: var(--text-secondary);
  font-size: var(--fs-sm);
  font-weight: 550;
  text-decoration: none;
  transition: background-color var(--dur-fast) ease, color var(--dur-fast) ease;
}
.app-sidebar nav a svg { flex-shrink: 0; opacity: 0.85; }
.app-sidebar nav a:hover { background: var(--gray-100); color: var(--navy-900); text-decoration: none; }
.app-sidebar nav a.active { background: var(--blue-050); color: var(--blue-700); font-weight: 650; }
.app-sidebar nav a.active svg { opacity: 1; }
.app-sidebar nav a:focus-visible { outline: 2px solid var(--blue-600); outline-offset: -2px; }

/* Group headings, so six items read as three jobs rather than a list. */
.nav-group-label {
  display: block; margin: var(--sp-5) 0 var(--sp-2); padding: 0 14px;
  font-size: var(--fs-2xs); font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-tertiary);
}
.app-sidebar nav > .nav-group-label:first-child { margin-top: var(--sp-2); }

/* How much work is waiting, without opening the screen. */
.nav-count {
  margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: var(--r-pill);
  background: var(--gray-100); color: var(--text-secondary);
  font-size: var(--fs-2xs); font-weight: 700; text-align: center; font-variant-numeric: tabular-nums;
}
.nav-count.is-warning { background: var(--status-warning-bg); color: var(--status-warning-fg); }
.app-sidebar nav a.active .nav-count { background: var(--white); color: var(--blue-700); }

.app-sidebar .sidebar-footer { padding-top: var(--sp-3); border-top: 1px solid var(--gray-200); }
.sidebar-help {
  display: flex; align-items: center; gap: var(--sp-3); padding: 11px 14px; margin-bottom: var(--sp-2);
  border-radius: var(--r-sm); color: var(--text-secondary);
  font-size: var(--fs-sm); font-weight: 550; text-decoration: none;
  transition: background-color var(--dur-fast) ease, color var(--dur-fast) ease;
}
.sidebar-help:hover { background: var(--gray-100); color: var(--navy-900); text-decoration: none; }
.sidebar-help svg { flex: none; opacity: .85; }
.sidebar-user { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-2) var(--sp-3); }
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--blue-600);
  color: var(--text-on-action); font-weight: 650; font-size: var(--fs-xs);
  display: grid; place-items: center; flex-shrink: 0;
}
.avatar.avatar-amber { background: var(--amber-500); color: var(--navy-950); }

/* The portal and officer screens sit on white, not on the page grey. Cards
   and rows carry hairlines, so the surface does not need a tint to separate
   them, and a bright canvas suits a product people read figures on. */
.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--white); }
.app-topbar {
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4);
  padding: 0 var(--sp-8);
  background: color-mix(in srgb, var(--white) 90%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--gray-200);
  position: sticky; top: 0; z-index: 50;
}
/* Wide monitors were leaving a third of the row unused with the content
   capped at 1220. Still bounded so text lines never run to the bezel. */
.app-content { padding: var(--sp-8); max-width: 1440px; width: 100%; margin: 0 auto; }

.sidebar-toggle { display: none; }
@media (max-width: 960px) {
  .app-sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 100;
    transform: translateX(-100%);
    transition: transform var(--dur-slow) var(--ease-drawer);
    box-shadow: var(--shadow-lg);
  }
  .app-sidebar.open { transform: translateX(0); }
  .sidebar-toggle { display: grid; place-items: center; padding: 8px; border-radius: var(--r-sm); }
  .sidebar-scrim {
    position: fixed; inset: 0; z-index: 99;
    background: color-mix(in srgb, var(--navy-950) 50%, transparent);
    opacity: 0; pointer-events: none;
    transition: opacity var(--dur-med) ease;
  }
  .sidebar-scrim.show { opacity: 1; pointer-events: auto; }
  .app-content { padding: var(--sp-5); }
  .app-topbar { padding: 0 var(--sp-5); }
  /* The screen name is the only thing in this row that can give way.
     Without this it holds its full width and pushes the page sideways
     on a narrow phone. */
  .app-topbar > strong { flex: 1 1 auto; min-width: 0; overflow: hidden;
                         text-overflow: ellipsis; white-space: nowrap; }
}


/* ---------- Public hero (index) ---------- */
.hero { position:relative; overflow:hidden; padding:72px 0 96px; }
.hero::before { content:''; position:absolute; top:-320px; right:-280px; width:780px; height:780px; border-radius:50%;
  background:radial-gradient(circle, color-mix(in srgb, var(--blue-600) 10%, transparent) 0%, transparent 62%); pointer-events:none; }
.hero h1 { font-size:var(--fs-hero); font-weight:560; margin-top:18px; }
.hero .two-col { align-items:center; gap:var(--sp-16); }
@media (max-width:960px){ .hero { padding:48px 0 64px; } }

/* ---- Sidebar user block ---- */
.sidebar-user > div { min-width:0; }
.sidebar-user strong { display:block; font-size:var(--fs-sm); color:var(--navy-900); line-height:1.2; }
.sidebar-user span { display:block; font-size:var(--fs-xs); color:var(--text-tertiary); }
.sidebar-user a { color:var(--text-tertiary); display:grid; place-items:center; }
.sidebar-user a:hover { color:var(--navy-900); }

/* ---- Header at phone width ----
   "On the Road Again Lending" is a long wordmark. Rather than let it wrap to
   three lines, the descriptor drops away below 480px and the name sits on one. */
@media (max-width: 620px) {
  .site-header .inner { padding: 0 var(--sp-4); gap: var(--sp-3); }
  .site-header .logo svg { width: 30px; height: 30px; }
  .site-header .logo span span:first-child { font-size: 15px !important; }
  .site-header .logo span span:last-child { font-size: 8px !important; letter-spacing: 0.18em !important; }
}
@media (max-width: 420px) {
  .site-header .logo span span:last-child { display: none; }
  .site-header .header-actions .btn-primary { padding-inline: 12px; }
}
