@import url('https://fonts.googleapis.com/css2?family=Merriweather:wght@400;700&family=Raleway:wght@400;500;600;700;800&display=swap');

/* Portside Hub shell: the shared sidebar for the CRM and every app.
   Palette: gold #d3c30c background, navy #11324d text (gray #6b7280 is too faint on this gold, about 2.7:1, so it is not used for text here), black where it used to be white.
   Accents: teal #499292, amber #eab308, cream #f5f6e8, #ededed, #fafbfc. */

/* Sign-in guard: nothing is shown until hub-shell.js confirms a signed-in admin session (fails closed:
   if the script or the check fails, the page simply stays blank). */
html:not(.hub-authed) { background: #fff; }

/* Brand type across the whole Hub: Raleway for text and every control, Merriweather for titles (set per page).
   Loaded here so every page that shows the sidebar gets the fonts; no system or Arial-style fonts. */
html.hub-shell-on body, html.hub-shell-on button, html.hub-shell-on input, html.hub-shell-on select, html.hub-shell-on textarea,
html.hub-shell-on .ql-container, html.hub-shell-on .ql-editor, html.hub-shell-on .ql-tooltip, html.hub-shell-on .ql-snow .ql-picker { font-family: 'Raleway', sans-serif; }
html:not(.hub-authed) body,
html:not(.hub-authed) #hub-shell,
html:not(.hub-authed) #hub-topbar,
html:not(.hub-authed) #hub-scrim { visibility: hidden !important; }
#hub-gate-msg { position: fixed; top: 0; left: 0; right: 0; padding: 48px 24px; text-align: center; font: 15px/1.5 'Raleway', sans-serif; color: #11324d; }

#hub-shell, #hub-topbar, #hub-scrim { font-family: Raleway, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif; }
#hub-shell *, #hub-topbar * { box-sizing: border-box; }

#hub-shell {
  position: fixed; top: 0; left: 0; bottom: 0; width: 288px; z-index: 900;
  display: flex; flex-direction: column;
  background: #d3c30c; color: #11324d; font-size: 14px; line-height: 1.35;
}
.hs-brand { padding: 32px 16px 20px 24px; display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.hs-brand a { display: block; flex: 1; min-width: 0; text-decoration: none; }

/* collapse / expand toggle buttons (desktop only) */
.hs-collapse, .hs-reopen {
  display: grid; place-items: center; width: 34px; height: 34px; flex-shrink: 0; padding: 0;
  border: 0; border-radius: 8px; background: transparent; color: #11324d; cursor: pointer;
  transition: background .12s, color .12s;
}
.hs-collapse:hover { background: rgba(17, 50, 77, .12); color: #000; }
.hs-collapse svg, .hs-reopen svg { width: 18px; height: 18px; }
.hs-collapse:focus-visible, .hs-reopen:focus-visible { outline: 2px solid #11324d; outline-offset: 1px; }
.hs-reopen { display: none; position: fixed; top: 12px; left: 12px; z-index: 899; background: #d3c30c; color: #11324d; box-shadow: 0 2px 8px rgba(17, 50, 77, .3); }
.hs-reopen:hover { background: #eab308; color: #000; }
.hs-brand p { margin: 0 0 4px; font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: #11324d; }
.hs-brand h1 { margin: 0; font-family: Merriweather, Georgia, serif; font-size: 18px; font-weight: 700; line-height: 1.2; color: #000; }

.hs-nav { flex: 1; overflow-y: auto; padding: 0 12px 16px; scrollbar-width: thin; scrollbar-color: rgba(17, 50, 77, .3) transparent; }
.hs-group + .hs-group { margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(17, 50, 77, .18); }

/* standalone top-level item (Firm Dashboard), styled like the website admin's Web Inquiries Inbox */
.hs-primary-wrap { padding: 2px 0 8px; }
.hs-primary {
  display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-left: 2px solid transparent; border-radius: 8px;
  background: rgba(17, 50, 77, .08); color: #11324d; font-size: 15px; font-weight: 700; text-decoration: none;
  transition: background .12s, color .12s;
}
.hs-primary span { flex: 1; min-width: 0; }
.hs-primary:hover { background: rgba(17, 50, 77, .14); color: #000; }
.hs-primary.is-active { background: #f5f6e8; border-left-color: #499292; color: #000; }
.hs-primary:focus-visible { outline: 2px solid #11324d; outline-offset: 1px; }
.hs-primary .hs-ico { color: inherit; opacity: .9; }
.hs-primary + .hs-primary { margin-top: 6px; }
.hs-badge { margin-left: auto; min-width: 22px; padding: 1px 8px; border-radius: 999px; background: #11324d; color: #f5f6e8; font-size: 11.5px; font-weight: 700; text-align: center; line-height: 1.5; }

/* top-level accordion header */
.hs-head {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border: 0; border-radius: 8px;
  background: transparent; cursor: pointer; text-align: left; font: inherit;
  font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #11324d;
  transition: background .15s;
}
.hs-head:hover { background: rgba(17, 50, 77, .1); }
.hs-head span { flex: 1; }
.hs-ico { width: 16px; height: 16px; flex-shrink: 0; }
.hs-chev { width: 14px; height: 14px; flex-shrink: 0; transition: transform .15s; }
[aria-expanded="true"] > .hs-chev, [aria-expanded="true"] .hs-chev { transform: rotate(90deg); }

.hs-list, .hs-sublist { list-style: none; margin: 4px 0 0; padding: 0; }
.hs-list[hidden], .hs-sublist[hidden] { display: none; }
.hs-sublist { margin-top: 2px; }

/* links and nested headers; --d is the nesting depth */
.hs-item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  margin: 1px 0; padding: 8px 12px 8px calc(22px + var(--d, 1) * 14px);
  border: 0; border-left: 2px solid transparent; border-radius: 8px; background: transparent;
  color: #11324d; font: inherit; font-size: 14px; text-align: left; text-decoration: none; cursor: pointer;
  transition: background .12s, color .12s;
}
.hs-item span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hs-item:hover { background: rgba(17, 50, 77, .12); color: #000; }
.hs-item.is-active { background: #f5f6e8; border-left-color: #499292; color: #000; font-weight: 600; }
.hs-subhead { color: #11324d; font-weight: 600; }
.hs-subrow .hs-sublink { color: #11324d; font-weight: 600; }
.hs-ext { width: 13px; height: 13px; flex-shrink: 0; opacity: .7; }
.hs-empty { padding: 6px 12px 6px calc(22px + var(--d, 2) * 14px); font-size: 12px; color: #11324d; }

/* Form Builder: label is a link, chevron is a separate toggle */
.hs-subrow { display: flex; align-items: center; }
.hs-subrow .hs-sublink { flex: 1; width: auto; }
.hs-chevbtn { display: grid; place-items: center; width: 32px; height: 32px; margin-left: 2px; border: 0; border-radius: 8px; background: transparent; color: #11324d; cursor: pointer; }
.hs-chevbtn:hover { background: rgba(17, 50, 77, .12); color: #000; }

.hs-head:focus-visible, .hs-item:focus-visible, .hs-chevbtn:focus-visible, .hs-logout:focus-visible, .hs-burger:focus-visible { outline: 2px solid #11324d; outline-offset: 1px; }

.hs-foot { padding: 14px 24px; border-top: 1px solid rgba(17, 50, 77, .18); display: flex; justify-content: flex-end; min-height: 52px; }
.hs-foot:empty { display: none; }
.hs-logout { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: #11324d; font: inherit; font-size: 12px; cursor: pointer; }
.hs-logout:hover { color: #000; }
.hs-logout svg { width: 14px; height: 14px; }

/* ---- page offset: apps get the sidebar as left padding (the CRM layout already reserves 18rem itself) ---- */
html.hub-shell-on:not(.hub-crm) body { padding-left: 288px; background: #ededed; }

/* per-app layout tweaks now that each app's own sidebar is gone */
html.hub-shell-on .adm-shell { grid-template-columns: 1fr; }
html.hub-shell-on .pa-shell { grid-template-columns: 1fr; }
html.hub-shell-on .pa-bar { left: 288px; }

/* ---- desktop collapsed: sidebar slides away, content takes the full width ---- */
@media (min-width: 768px) {
  #hub-shell { transition: transform .2s ease, visibility 0s; }
  html.hub-shell-on:not(.hub-crm) body { transition: padding-left .2s ease; }
  .md\:ml-72 { transition: margin-left .2s ease; }

  html.hs-collapsed #hub-shell { transform: translateX(-100%); visibility: hidden; transition: transform .2s ease, visibility 0s .2s; }
  html.hs-collapsed.hub-shell-on:not(.hub-crm) body { padding-left: 0; }
  html.hs-collapsed.hub-shell-on .pa-bar { left: 0; }
  html.hs-collapsed.hub-shell-on .md\:ml-72 { margin-left: 0; } /* CRM app reserves 18rem for the sidebar */
  html.hs-collapsed.hub-shell-on .hs-reopen { display: grid; }
}
@media (max-width: 767px) { .hs-collapse, .hs-reopen { display: none !important; } }

/* ---- mobile: top bar + slide-in drawer ---- */
#hub-topbar { display: none; }
#hub-scrim { display: none; }
@media (max-width: 767px) {
  #hub-topbar {
    display: flex; position: fixed; top: 0; left: 0; right: 0; height: 64px; z-index: 960;
    align-items: center; gap: 12px; padding: 0 12px; background: #d3c30c; border-bottom: 3px solid #499292;
  }
  .hs-burger { display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 8px; background: transparent; color: #000; cursor: pointer; }
  .hs-burger:hover { background: rgba(17, 50, 77, .12); }
  .hs-burger svg { width: 22px; height: 22px; }
  .hs-topbrand { color: #000; text-decoration: none; font-weight: 700; font-size: 15px; }

  #hub-shell { top: 64px; width: min(320px, 86vw); transform: translateX(-100%); transition: transform .2s ease; z-index: 950; }
  html.hs-drawer #hub-shell { transform: none; }
  html.hs-drawer #hub-scrim { display: block; position: fixed; top: 64px; right: 0; bottom: 0; left: 0; background: rgba(0, 0, 0, .45); z-index: 940; }
  .hs-brand { display: none; }
  .hs-nav { padding-top: 12px; }

  html.hub-shell-on:not(.hub-crm) body { padding-left: 0; padding-top: 64px; }
  html.hub-shell-on .pa-bar { left: 0; }
}

@media print {
  #hub-shell, #hub-topbar, #hub-scrim, .hs-reopen { display: none !important; }
  html.hub-shell-on:not(.hub-crm) body { padding: 0; }
}
@media (prefers-reduced-motion: reduce) { #hub-shell, .hs-chev, html.hub-shell-on body, .md\:ml-72 { transition: none !important; } }