/* =====================================================================
   The Realtor's AIME — GHL-Style App Shell
   Dark persistent left sidebar (#111827) + gold active accent (#DAA643)
   Light main workspace (#F8FAFC / #FFFFFF) + high-contrast dark text (#0F172A)
   ===================================================================== */

:root {
  --ghl-sidebar-w: 268px;
  --ghl-sidebar-bg: #111827;
  --ghl-sidebar-bg-deep: #0B1120;
  --ghl-sidebar-border: #1E293B;
  --ghl-sidebar-text: #CBD5E1;
  --ghl-sidebar-muted: #94A3B8;
  --ghl-sidebar-dim: #64748B;
  --ghl-gold: #DAA643;
  --ghl-gold-bright: #FFD963;
  --ghl-gold-ink: #9A6A27;
  --ghl-gold-grad: linear-gradient(135deg, #F5DF98 0%, #DAA643 55%, #C68F2C 100%);
  --ghl-main-bg: #F8FAFC;
  --ghl-card-bg: #FFFFFF;
  --ghl-card-subtle: #F1F5F9;
  --ghl-border: #E2E8F0;
  --ghl-border-strong: #CBD5E1;
  --ghl-ink: #0F172A;
  --ghl-ink-body: #1E293B;
  --ghl-ink-muted: #475569;
  --ghl-ink-subtle: #64748B;
  --ghl-shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --ghl-shadow-md: 0 6px 20px rgba(15, 23, 42, 0.07), 0 2px 6px rgba(15, 23, 42, 0.04);
  --ghl-sans: 'Figtree', 'Montserrat', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --ghl-serif: 'Instrument Serif', 'Playfair Display', Georgia, serif;
}

html {
  background: var(--ghl-main-bg) !important;
  color-scheme: light;
}

body.ghl-shell {
  margin: 0 !important;
  padding: 0 0 0 var(--ghl-sidebar-w) !important;
  min-height: 100vh;
  background: var(--ghl-main-bg) !important;
  color: var(--ghl-ink) !important;
  font-size: 15.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

body.ghl-shell::before {
  display: none !important;
}

/* Hide legacy top headers & floating back-pills superseded by the persistent GHL sidebar */
body.ghl-shell .site-header,
body.ghl-shell .aime-hub-page .hub-header,
body.ghl-shell a[href="/member-hub"][style*="position:fixed"] {
  display: none !important;
}

/* ==================== DARK LEFT SIDEBAR ==================== */
.ghl-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--ghl-sidebar-w);
  background: linear-gradient(180deg, var(--ghl-sidebar-bg) 0%, var(--ghl-sidebar-bg-deep) 100%);
  border-right: 1px solid var(--ghl-sidebar-border);
  color: #F8FAFC;
  font-family: var(--ghl-sans);
  display: flex;
  flex-direction: column;
  z-index: 1050;
  overflow: hidden;
  box-shadow: 4px 0 24px rgba(15, 23, 42, 0.08);
}

.ghl-sidebar * {
  box-sizing: border-box;
}

.ghl-sb-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 18px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-decoration: none !important;
  color: #F8FAFC !important;
  flex-shrink: 0;
}

.ghl-sb-logo-box {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(218, 166, 67, 0.14);
  border: 1px solid rgba(218, 166, 67, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.ghl-sb-logo-box img {
  width: 30px;
  height: 30px;
  object-fit: contain;
  display: block;
}

.ghl-sb-brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.18;
}

.ghl-sb-brand-title {
  font-family: var(--ghl-serif);
  font-size: 18px;
  font-weight: 600;
  color: #FFFFFF;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ghl-sb-brand-sub {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ghl-gold);
  margin-top: 2px;
}

.ghl-sb-close {
  display: none;
  margin-left: auto;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: #CBD5E1;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

/* Scrollable nav area */
.ghl-sb-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 12px 10px 16px;
  scrollbar-width: thin;
  scrollbar-color: #334155 transparent;
}

.ghl-sb-scroll::-webkit-scrollbar {
  width: 5px;
}

.ghl-sb-scroll::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 99px;
}

.ghl-sb-section-lbl {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ghl-sidebar-dim);
  padding: 12px 12px 6px;
  margin: 0;
}

.ghl-sb-section-lbl:first-child {
  padding-top: 4px;
}

.ghl-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ghl-nav-row {
  display: flex;
  align-items: center;
  border-radius: 9px;
  border-left: 3px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.ghl-nav-row:hover {
  background: rgba(255, 255, 255, 0.06);
}

.ghl-nav-row.active {
  background: rgba(218, 166, 67, 0.16);
  border-left-color: var(--ghl-gold);
}

.ghl-nav-row.group-active:not(.active) {
  background: rgba(218, 166, 67, 0.08);
  border-left-color: rgba(218, 166, 67, 0.55);
}

.ghl-nav-link {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9.5px 11px;
  color: var(--ghl-sidebar-text) !important;
  text-decoration: none !important;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
  background: none;
  border: 0;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}

.ghl-nav-row:hover .ghl-nav-link {
  color: #FFFFFF !important;
}

.ghl-nav-row.active .ghl-nav-link {
  color: #FFFFFF !important;
  font-weight: 600;
}

.ghl-nav-row.group-active .ghl-nav-link {
  color: #F8FAFC !important;
  font-weight: 600;
}

.ghl-nav-ico {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--ghl-sidebar-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ghl-nav-ico svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ghl-nav-row:hover .ghl-nav-ico {
  color: #E2E8F0;
}

.ghl-nav-row.active .ghl-nav-ico,
.ghl-nav-row.group-active .ghl-nav-ico {
  color: var(--ghl-gold-bright);
}

.ghl-nav-text {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ghl-nav-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  border-radius: 99px;
  background: rgba(218, 166, 67, 0.18);
  color: var(--ghl-gold-bright);
  border: 1px solid rgba(218, 166, 67, 0.35);
  flex-shrink: 0;
}

.ghl-nav-ext {
  font-size: 11px;
  color: var(--ghl-sidebar-dim);
  flex-shrink: 0;
}

.ghl-nav-toggle {
  width: 32px;
  height: 34px;
  flex-shrink: 0;
  background: none;
  border: 0;
  color: var(--ghl-sidebar-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  margin-right: 4px;
  transition: color 0.15s, background 0.15s;
}

.ghl-nav-toggle:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.08);
}

.ghl-nav-caret {
  font-size: 11px;
  transition: transform 0.2s ease;
  display: inline-block;
}

.ghl-nav-group.open .ghl-nav-caret {
  transform: rotate(180deg);
  color: var(--ghl-gold-bright);
}

/* Submenu items (Tools & Apps) */
.ghl-subnav {
  list-style: none;
  margin: 2px 0 6px 19px;
  padding: 2px 0 2px 10px;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  display: none;
  flex-direction: column;
  gap: 2px;
}

.ghl-nav-group.open .ghl-subnav {
  display: flex;
}

.ghl-subnav a,
.ghl-subnav .ghl-subnav-soon {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6.5px 10px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ghl-sidebar-muted) !important;
  text-decoration: none !important;
  line-height: 1.3;
  transition: background 0.14s, color 0.14s;
}

.ghl-subnav a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #FFFFFF !important;
}

.ghl-subnav a.active {
  background: rgba(218, 166, 67, 0.18);
  color: var(--ghl-gold-bright) !important;
  font-weight: 600;
}

.ghl-subnav a.active::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ghl-gold-bright);
  flex-shrink: 0;
}

.ghl-subnav-label {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ghl-subnav-soon {
  opacity: 0.58;
  cursor: default;
}

.ghl-subnav-soon em {
  font-style: normal;
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ghl-gold);
  flex-shrink: 0;
}

/* Sidebar Footer */
.ghl-sb-footer {
  padding: 12px 12px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(11, 17, 32, 0.7);
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.ghl-upgrade-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(218, 166, 67, 0.42);
  background: rgba(218, 166, 67, 0.1);
  color: #FFFBEB !important;
  text-decoration: none !important;
  font-size: 13px;
  font-weight: 600;
  transition: background 0.18s, border-color 0.18s, transform 0.15s;
}

.ghl-upgrade-link:hover {
  background: rgba(218, 166, 67, 0.2);
  border-color: var(--ghl-gold);
}

.ghl-upgrade-link.active {
  background: var(--ghl-gold-grad);
  color: #1A1408 !important;
  border-color: transparent;
  font-weight: 700;
}

.ghl-upgrade-pill {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 99px;
  background: var(--ghl-gold-grad);
  color: #1A1408;
}

.ghl-upgrade-link.active .ghl-upgrade-pill {
  background: rgba(26, 20, 8, 0.16);
  color: #1A1408;
}

.ghl-pwa-btn {
  width: 100%;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: #F8FAFC;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}

.ghl-pwa-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* ==================== MOBILE TOPBAR & BACKDROP ==================== */
.ghl-mobile-topbar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 980;
  height: 58px;
  padding: 0 16px;
  background: var(--ghl-sidebar-bg);
  border-bottom: 1px solid var(--ghl-sidebar-border);
  color: #FFFFFF;
  font-family: var(--ghl-sans);
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ghl-hamburger {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  border: 1px solid rgba(218, 166, 67, 0.4);
  background: rgba(218, 166, 67, 0.12);
  color: var(--ghl-gold-bright);
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ghl-mobile-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #FFFFFF !important;
  text-decoration: none !important;
  font-family: var(--ghl-serif);
  font-size: 17px;
  font-weight: 600;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ghl-mobile-section-pill {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ghl-gold-bright);
  background: rgba(218, 166, 67, 0.14);
  border: 1px solid rgba(218, 166, 67, 0.3);
  padding: 4px 9px;
  border-radius: 99px;
  white-space: nowrap;
}

.ghl-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1040;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
}

.ghl-backdrop.open {
  display: block;
}

/* ==================== CONSISTENT PAGE HEADER BAR ==================== */
.ghl-page-bar {
  background: #FFFFFF;
  border-bottom: 1px solid var(--ghl-border);
  padding: 18px 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-family: var(--ghl-sans);
}

.ghl-page-bar-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.ghl-page-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ghl-gold-ink);
}

.ghl-page-title {
  font-family: var(--ghl-sans);
  font-size: 22px;
  font-weight: 700;
  color: var(--ghl-ink);
  line-height: 1.25;
  margin: 0;
  letter-spacing: -0.01em;
}

.ghl-page-bar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ghl-back-hub {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  background: #F8FAFC;
  border: 1px solid var(--ghl-border);
  color: var(--ghl-ink-body) !important;
  text-decoration: none !important;
  font-size: 13px;
  font-weight: 600;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.ghl-back-hub:hover {
  border-color: var(--ghl-gold);
  background: #FFFBEB;
  color: var(--ghl-gold-ink) !important;
}

.ghl-workspace-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 99px;
  background: #FFFBEB;
  border: 1px solid rgba(218, 166, 67, 0.4);
  color: #92400E;
  font-size: 12px;
  font-weight: 600;
}

.ghl-workspace-pill .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #16A34A;
}

/* ==================== RESPONSIVE BREAKPOINTS ==================== */
@media (min-width: 961px) {
  body.ghl-shell .aime-hub-page .modal-overlay {
    left: var(--ghl-sidebar-w);
  }
}

@media (max-width: 960px) {
  body.ghl-shell {
    padding-left: 0 !important;
  }

  .ghl-mobile-topbar {
    display: flex;
  }

  .ghl-sidebar {
    transform: translateX(-100%);
    transition: transform 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
  }

  .ghl-sidebar.open {
    transform: translateX(0);
  }

  .ghl-sb-close {
    display: inline-flex;
  }

  .ghl-page-bar {
    padding: 14px 18px;
  }

  .ghl-page-title {
    font-size: 19px;
  }
}

@media print {
  body.ghl-shell {
    padding-left: 0 !important;
    background: #FFFFFF !important;
  }

  .ghl-sidebar,
  .ghl-mobile-topbar,
  .ghl-backdrop,
  .ghl-page-bar {
    display: none !important;
  }
}
