/**
 * AIME Hub — Design Pass #2 (GHL-Style Dark Sidebar + Light Screen Workspace Shell)
 * Cloned from Realtor Hub Makeover with Educator Teal Accent (#14B8A6)
 */

:root {
  /* Light Workspace Surface Tokens */
  --shell-bg: #F3F4F6;
  --shell-surface: #FFFFFF;
  --shell-surface-subtle: #F9FAFB;
  --shell-surface-hover: #F3F4F6;
  --shell-border: #E5E7EB;
  --shell-border-strong: #D1D5DB;

  /* Dark Sidebar Tokens */
  --sidebar-bg: #111827;
  --sidebar-bg-elevated: #1F2937;
  --sidebar-hover: rgba(255, 255, 255, 0.07);
  --sidebar-active: #0D9488;
  --sidebar-active-soft: rgba(20, 184, 166, 0.18);
  --sidebar-border: rgba(255, 255, 255, 0.08);
  --sidebar-text: #F9FAFB;
  --sidebar-text-muted: #9CA3AF;

  /* Typography & Ink */
  --ink-primary: #111827;
  --ink-secondary: #4B5563;
  --ink-muted: #6B7280;

  /* Educator Brand Accents */
  --brand-primary: #0D9488;
  --brand-primary-hover: #0F766E;
  --brand-primary-soft: #CCFBF1;
  --brand-gold: #D97706;
  --brand-gold-soft: #FEF3C7;
  --brand-emerald: #059669;
  --brand-emerald-soft: #ECFDF5;
  --brand-purple: #7C3AED;
  --brand-purple-soft: #F5F3FF;
  --brand-teal: #14B8A6;

  /* Layout Metrics */
  --sidebar-width: 248px;
  --topbar-height: 60px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-card: 0 1px 3px rgba(17, 24, 39, 0.06), 0 1px 2px rgba(17, 24, 39, 0.04);
  --shadow-card-hover: 0 10px 24px -4px rgba(17, 24, 39, 0.08), 0 4px 8px -2px rgba(17, 24, 39, 0.04);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--shell-bg) !important;
  color: var(--ink-primary) !important;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

body::before {
  display: none !important;
}

.ghl-app-shell {
  display: flex;
  min-height: 100vh;
  width: 100%;
  background: var(--shell-bg);
}

.ghl-sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 200;
  border-right: 1px solid var(--sidebar-border);
  user-select: none;
  transition: transform 0.25s ease;
}

.ghl-sidebar-brand {
  height: var(--topbar-height);
  padding: 0 1.15rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--sidebar-border);
}

.ghl-brand-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--sidebar-text);
}

.ghl-brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, #14B8A6 0%, #0D9488 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 1rem;
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(20, 184, 166, 0.45);
  flex-shrink: 0;
}

.ghl-brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.ghl-brand-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  color: #FFFFFF;
  letter-spacing: -0.01em;
}

.ghl-brand-subtitle {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #5EEAD4;
}

.ghl-location-switcher {
  margin: 0.85rem 0.85rem 0.5rem;
  padding: 0.6rem 0.75rem;
  background: var(--sidebar-bg-elevated);
  border: 1px solid var(--sidebar-border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.ghl-location-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #14B8A6;
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.25);
  flex-shrink: 0;
}

.ghl-location-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.ghl-location-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: #F9FAFB;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ghl-location-plan {
  font-size: 0.68rem;
  color: var(--sidebar-text-muted);
}

.ghl-sidebar-nav {
  flex: 1;
  padding: 0.5rem 0.75rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.ghl-nav-section-label {
  padding: 0.75rem 0.6rem 0.35rem;
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6B7280;
}

.ghl-nav-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  color: #D1D5DB;
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 500;
  transition: all 0.15s ease;
}

.ghl-nav-item:hover {
  background: var(--sidebar-hover);
  color: #FFFFFF;
}

.ghl-nav-item.active {
  background: var(--sidebar-active);
  color: #FFFFFF;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(13, 148, 136, 0.4);
}

.ghl-nav-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.ghl-nav-badge {
  margin-left: auto;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #E5E7EB;
}

.ghl-nav-item.active .ghl-nav-badge {
  background: rgba(255, 255, 255, 0.24);
  color: #FFFFFF;
}

.ghl-sidebar-footer {
  padding: 0.85rem;
  border-top: 1px solid var(--sidebar-border);
  background: rgba(15, 23, 42, 0.6);
}

.ghl-sidebar-cta {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.8rem;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.22), rgba(13, 148, 136, 0.16));
  border: 1px solid rgba(94, 234, 212, 0.3);
}

.ghl-sidebar-cta-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: #F9FAFB;
}

.ghl-sidebar-cta-sub {
  font-size: 0.7rem;
  color: #9CA3AF;
  line-height: 1.35;
}

.ghl-sidebar-cta-btn {
  margin-top: 0.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.48rem 0.75rem;
  border-radius: 6px;
  background: #0D9488;
  color: #FFFFFF;
  font-size: 0.76rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s ease;
}

.ghl-sidebar-cta-btn:hover {
  background: #0F766E;
}

.ghl-main-wrapper {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--shell-bg);
}

.ghl-topbar {
  height: var(--topbar-height);
  background: var(--shell-surface);
  border-bottom: 1px solid var(--shell-border);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 150;
}

.ghl-topbar-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.ghl-mobile-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--shell-border);
  border-radius: 6px;
  padding: 0.4rem 0.55rem;
  font-size: 1.1rem;
  color: var(--ink-primary);
  cursor: pointer;
}

.ghl-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  color: var(--ink-muted);
}

.ghl-breadcrumbs strong {
  color: var(--ink-primary);
  font-weight: 600;
}

.ghl-topbar-right {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.ghl-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--shell-border);
  background: var(--shell-surface);
  color: var(--ink-secondary);
  transition: all 0.15s ease;
}

.ghl-pill-btn:hover {
  background: var(--shell-surface-hover);
  color: var(--ink-primary);
  border-color: var(--shell-border-strong);
}

.ghl-pill-btn.primary {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #FFFFFF;
}

.ghl-pill-btn.primary:hover {
  background: var(--brand-primary-hover);
}

.ghl-workspace {
  flex: 1;
  padding: 1.75rem 2rem 3rem;
  max-width: 1360px;
  width: 100%;
  margin: 0 auto;
}

.ghl-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.ghl-page-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--ink-primary);
  margin: 0 0 0.3rem;
  letter-spacing: -0.02em;
}

.ghl-page-subtitle {
  font-size: 0.92rem;
  color: var(--ink-secondary);
  margin: 0;
  max-width: 720px;
  line-height: 1.5;
}

.ghl-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.ghl-stat-card {
  background: var(--shell-surface);
  border: 1px solid var(--shell-border);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.25rem;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.ghl-stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ghl-stat-label {
  font-size: 0.76rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
}

.ghl-stat-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
}

.ghl-stat-value {
  font-family: 'Outfit', sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--ink-primary);
  line-height: 1.15;
}

.ghl-stat-meta {
  font-size: 0.76rem;
  color: var(--ink-muted);
}

.ghl-card {
  background: var(--shell-surface);
  border: 1px solid var(--shell-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 1.35rem;
}

.ghl-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--shell-border);
}

.ghl-card-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink-primary);
  margin: 0;
}

.ghl-card-subtitle {
  font-size: 0.82rem;
  color: var(--ink-muted);
  margin: 0.15rem 0 0;
}

.ghl-privacy-banner {
  background: #FEF3C7;
  border: 1px solid #F59E0B;
  color: #92400E;
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}

@media (max-width: 1024px) {
  .ghl-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 820px) {
  .ghl-sidebar {
    transform: translateX(-100%);
  }
  .ghl-sidebar.open {
    transform: translateX(0);
  }
  .ghl-main-wrapper {
    margin-left: 0;
  }
  .ghl-mobile-toggle {
    display: inline-flex;
  }
  .ghl-workspace {
    padding: 1.25rem 1rem 2.5rem;
  }
}

@media (max-width: 540px) {
  .ghl-stats-grid {
    grid-template-columns: 1fr;
  }
}
