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

/* ===== ImpactCircle brand tokens (Vibrant Style Guide) ===== */
:root {
  --color-primary: #0066ff;
  --color-secondary: #00c853;
  --color-highlight: #ffd600;
  --color-coral: #ff4f6d;
  --color-purple: #8e24aa;
  --color-cyan: #00b8d9;
  --color-orange: #ff8a00;
  --color-navy: #071a3d;
  --color-text: #334155;
  --color-muted: #64748b;
  --color-bg: #f2f8ff;
  --color-white: #ffffff;
  --color-soft-green: #effff6;
  --color-soft-blue: #eaf4ff;
  --color-soft-yellow: #fff9d6;

  --primary: var(--color-primary);
  --primary-dark: #0052cc;
  --primary-light: #e6f0ff;
  --accent: var(--color-cyan);
  --success: var(--color-secondary);
  --success-light: var(--color-soft-green);
  --danger: #dc2626;
  --danger-light: #fee2e2;
  --warning: #c2410c;
  --warning-light: #fff1e0;
  --info: var(--color-cyan);
  --info-light: #e0f7fa;
  --bg: var(--color-bg);
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: rgba(0, 102, 255, 0.08);
  --border-dark: #cbd5e1;
  --text: var(--color-text);
  --text-muted: var(--color-muted);
  --text-light: #94a3b8;

  --radius: 16px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 999px;
  --shadow-sm: 0 1px 2px rgba(7, 26, 61, 0.05);
  --shadow-card: 0 12px 30px rgba(7, 26, 61, 0.08);
  --shadow: var(--shadow-card);
  --shadow-md: 0 12px 30px rgba(7, 26, 61, 0.1);
  --shadow-lg: 0 20px 50px rgba(7, 26, 61, 0.12);
  --shadow-button: 0 10px 25px rgba(0, 102, 255, 0.25);

  /* Style guide §4 — use via utilities / hero bands */
  --gradient-hero: linear-gradient(135deg, #0066ff 0%, #00c853 60%, #ffd600 100%);
  --gradient-button: linear-gradient(135deg, #ff4f6d 0%, #ff8a00 100%);
  --gradient-impact: linear-gradient(135deg, #8e24aa 0%, #00b8d9 100%);

  --nav-height: 58px;
  --sidebar-width: 240px;
  --sidebar-rail-width: 72px;
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }

/* Custom scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-dark); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* Focus visible */
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
body {
  font-family: 'Inter', 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
ul { list-style: none; }

/* ===== Typography (guide §5 — Inter / Poppins) ===== */
h1, h2, h3, h4 {
  color: var(--color-navy);
  font-family: 'Poppins', 'Inter', system-ui, Arial, sans-serif;
}
h1 { font-size: clamp(2.25rem, 4vw, 2.75rem); font-weight: 700; line-height: 1.15; }
h2 { font-size: clamp(1.75rem, 3vw, 2.125rem); font-weight: 700; line-height: 1.2; }
h3 { font-size: clamp(1.25rem, 2vw, 1.75rem); font-weight: 600; line-height: 1.25; }
h4 { font-size: 1.125rem; font-weight: 600; }
p { margin-bottom: 0.75rem; font-size: 1rem; color: var(--text); }
p:last-child { margin-bottom: 0; }
small { font-size: 0.8125rem; color: var(--text-muted); }

/* ===== Layout ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.container-sm { max-width: 720px; margin: 0 auto; padding: 0 1.5rem; }
.page-content { padding-top: calc(var(--nav-height) + 1.5rem); padding-bottom: 3rem; }
.page-content { flex: 1 0 auto; }

/* ===== Navbar ===== */
#navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-height);
  background: #ffffff;
  box-shadow: 0 4px 20px rgba(7, 26, 61, 0.06);
  border-bottom: 1px solid var(--border-dark);
}
.nav-inner {
  max-width: 1440px; margin: 0 auto; padding: 0 1.25rem;
  height: 100%; display: flex; align-items: center;
  justify-content: space-between; gap: 1rem;
}
.nav-brand {
  display: flex; align-items: center;
  text-decoration: none;
  flex-shrink: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: none;
}
.nav-logo {
  height: 42px;
  width: auto;
  display: block;
  object-fit: contain;
}
/* Nav links — compact sizing to fit 9 public links on one row */
.nav-links {
  display: flex; align-items: center;
  gap: 0.1rem;
  flex: 1 1 auto;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a {
  color: var(--color-navy);
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 500;
  transition: all 0.15s;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.nav-links a:hover { background: var(--primary-light); color: var(--primary); text-decoration: none; }
.nav-links a.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.nav-right { display: flex; align-items: center; gap: 0.75rem; flex-shrink: 0; }
.nav-right .btn-secondary {
  background: var(--surface);
  color: var(--primary);
  border-color: var(--primary);
}
.nav-right .btn-secondary:hover { background: var(--primary-light); }
.nav-right .btn-primary {
  background: var(--primary);
  border-color: var(--primary);
}
.nav-bell { position: relative; cursor: pointer; color: var(--text-muted); font-size: 1.1rem; line-height: 1; }
.nav-bell:hover { color: var(--color-navy); }
.bell-badge {
  position: absolute; top: -5px; right: -5px;
  background: var(--danger); color: white;
  font-size: 0.6rem; font-weight: 700;
  width: 16px; height: 16px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.nav-user {
  display: flex; align-items: center; gap: 0.625rem;
  padding: 0.3rem 0.625rem 0.3rem 0.4rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.18);
}
.nav-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(255,255,255,0.25); color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.8rem; flex-shrink: 0;
}

/* Logged-in app shell: white top bar beside a light sidebar */
.has-sidebar #navbar {
  left: var(--sidebar-width);
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  box-shadow: none;
}
.has-sidebar.sidebar-collapsed #navbar { left: var(--sidebar-rail-width); }
.has-sidebar #navbar .nav-inner {
  max-width: none;
  padding: 0 1.5rem;
}
.has-sidebar #navbar .nav-brand { display: none; }
.has-sidebar .nav-right { margin-left: auto; }
.has-sidebar .nav-user {
  background: transparent;
  border: none;
  padding: 0;
}
.has-sidebar .nav-avatar {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid rgba(0, 102, 255, 0.22);
}
.has-sidebar .nav-bell { color: #64748b; }
.has-sidebar .nav-bell:hover { color: #0f172a; }
.has-sidebar .nav-hamburger { color: #0f172a; }
/* Hamburger — hidden on desktop */
.nav-hamburger {
  display: none; background: none; border: none; color: var(--color-navy);
  cursor: pointer; padding: 0.4rem; border-radius: var(--radius-sm);
  flex-shrink: 0; line-height: 0;
}
.nav-hamburger:hover { background: var(--primary-light); }

/* Mobile slide-down menu */
.nav-mobile-menu {
  display: none; flex-direction: column;
  position: fixed; top: var(--nav-height); left: 0; right: 0;
  background: #ffffff;
  padding: 0.75rem 1rem 1.25rem;
  gap: 0.25rem;
  z-index: 99;
  box-shadow: var(--shadow-md);
  border-bottom: 1px solid var(--border-dark);
  max-height: calc(100vh - var(--nav-height));
  overflow-y: auto;
}
.nav-mobile-menu.open { display: flex; }
.nav-mobile-menu a {
  color: var(--color-navy);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.15s;
}
.nav-mobile-menu a:hover,
.nav-mobile-menu a.active { background: var(--primary-light); color: var(--primary); }
/* Divider before auth links in mobile menu */
.nav-mobile-menu .nav-mobile-divider {
  height: 1px; background: var(--border-dark); margin: 0.5rem 0;
}
/* Auth buttons inside mobile menu */
.nav-mobile-menu .nav-mobile-auth {
  display: flex; gap: 0.75rem; padding: 0.5rem 0 0;
}
.nav-mobile-menu .nav-mobile-auth a {
  flex: 1; text-align: center; padding: 0.65rem;
  font-weight: 600; border-radius: var(--radius-sm);
}
.nav-mobile-menu .nav-mobile-auth a.btn-primary { background: var(--primary); color: white; }
.nav-mobile-menu .nav-mobile-auth a.btn-outline { background: var(--surface); color: var(--primary); border: 1px solid var(--primary); }

/* Responsive: show hamburger, hide inline links below 1024px */
@media (max-width: 1023px) {
  .nav-links { display: none; }
  .nav-right .btn { display: none; }
  .nav-hamburger { display: flex; align-items: center; justify-content: center; }
}

/* ===== Glass Public Nav ===== */

/* Override nav-height for public pages so page-content offsets correctly */
body.public-page {
  --nav-height: 80px;
  --gn-text: var(--color-navy);
  --gn-text-muted: var(--color-muted);
  --gn-text-hover: var(--color-primary);
  font-family: 'Inter', 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}

/* The #navbar wrapper becomes transparent; the glass container is inside it */
#navbar.glass-mode {
  height: auto;
  background: transparent;
  box-shadow: none;
  padding: 10px 16px;
}

/* Floating glass container — white / frosted (public) */
.glass-nav {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(18px) saturate(1.35);
  -webkit-backdrop-filter: blur(18px) saturate(1.35);
  border: 1px solid rgba(0, 102, 255, 0.12);
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(7, 26, 61, 0.06), 0 1px 0 rgba(255, 255, 255, 0.9) inset;
  /* Mount animation start state */
  opacity: 0;
  transform: translateY(-20px);
  transition: opacity 700ms cubic-bezier(0.16, 1, 0.3, 1),
              transform 700ms cubic-bezier(0.16, 1, 0.3, 1);
}
.glass-nav.mounted { opacity: 1; transform: translateY(0); }

/* Decorative blurred orbs */
.gn-orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 1500ms cubic-bezier(0.16, 1, 0.3, 1),
              transform 1500ms cubic-bezier(0.16, 1, 0.3, 1);
}
.glass-nav.mounted .gn-orb { transform: scale(1); }
.gn-orb-l {
  width: 80px; height: 80px;
  background: rgba(0, 102, 255, 0.08);
  filter: blur(40px);
  top: -20px; left: -10px;
}
.glass-nav.mounted .gn-orb-l { opacity: 1; }
.gn-orb-r {
  width: 60px; height: 60px;
  background: rgba(0, 200, 83, 0.12);
  filter: blur(30px);
  top: -15px; right: -10px;
}
.glass-nav.mounted .gn-orb-r { opacity: 1; }

/* Inner flex row */
.gn-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  padding: 10px 20px;
  gap: 12px;
}

/* Brand / logo */
.gn-brand {
  display: flex; align-items: center;
  text-decoration: none; flex-shrink: 0;
}
.gn-brand:hover { text-decoration: none; }
.gn-logo-img {
  height: 52px;
  width: auto;
  display: block;
  object-fit: contain;
}

/* Desktop links row */
.gn-links {
  display: flex; align-items: center; gap: 2px;
  flex: 1; justify-content: center;
}

/* Shared initial state — animated via keyframe */
.gn-link,
.gn-trigger {
  opacity: 0;
  animation: gn-item-in 500ms cubic-bezier(0.16, 1, 0.3, 1) var(--ld, 150ms) both;
}

.gn-link {
  color: var(--color-navy);
  font-size: 15px; font-weight: 600;
  letter-spacing: -0.01em;
  padding: 8px 14px;
  border-radius: 10px;
  text-decoration: none;
  transition: color 150ms, background 150ms;
  white-space: nowrap;
}
.gn-link:hover         { color: var(--gn-text-hover); background: rgba(0, 102, 255, 0.1); text-decoration: none; }
.gn-link.active        { color: var(--color-navy); background: rgba(0, 102, 255, 0.14); }

/* Dropdown parent */
.gn-item { position: relative; }

.gn-trigger {
  display: flex; align-items: center; gap: 5px;
  color: var(--color-navy);
  font-size: 15px; font-weight: 600;
  letter-spacing: -0.01em;
  padding: 8px 14px;
  border-radius: 10px;
  background: none; border: none; cursor: pointer;
  font-family: inherit;
  transition: color 150ms, background 150ms;
  white-space: nowrap;
}
.gn-trigger:hover                  { color: var(--gn-text-hover); background: rgba(0, 102, 255, 0.1); }
.gn-item.open  > .gn-trigger,
.gn-trigger.active                 { color: var(--color-navy); background: rgba(0, 102, 255, 0.14); }

.gn-chevron { transition: transform 200ms; flex-shrink: 0; }
.gn-item.open .gn-chevron { transform: rotate(180deg); }

/* Dropdown panel */
.gn-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(-8px) scale(0.96);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border: 1px solid rgba(0, 102, 255, 0.2);
  border-radius: 12px;
  padding: 6px;
  min-width: 240px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms cubic-bezier(0.16, 1, 0.3, 1),
              transform 200ms cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 500;
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.12), 0 2px 8px rgba(15, 23, 42, 0.06);
}
.gn-item.open .gn-dropdown {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
  pointer-events: all;
}

/* Dropdown items */
.gn-dd-item {
  display: flex; flex-direction: column; gap: 3px;
  padding: 10px 13px;
  border-radius: 8px;
  text-decoration: none;
  transition: background 150ms;
}
.gn-dd-item:hover  { background: rgba(0, 102, 255, 0.08); text-decoration: none; }
.gn-dd-item.active { background: rgba(0, 102, 255, 0.12); }
.gn-dd-title { font-size: 14px; font-weight: 600; color: var(--color-navy); line-height: 1.25; }
.gn-dd-desc  { font-size: 12px; color: #64748b; line-height: 1.35; margin-top: 2px; }

/* Auth buttons */
.gn-auth {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
  opacity: 0;
  animation: gn-item-in 600ms cubic-bezier(0.16, 1, 0.3, 1) 400ms both;
}
.gn-btn-outline {
  color: var(--color-navy);
  font-size: 14px; font-weight: 600;
  letter-spacing: -0.01em;
  padding: 10px 18px;
  border-radius: var(--radius-full);
  border: 1.5px solid rgba(7, 26, 61, 0.2);
  background: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  transition: background 150ms, color 150ms, border-color 150ms;
  white-space: nowrap;
  display: inline-block;
}
.gn-btn-outline:hover { background: rgba(0, 102, 255, 0.08); color: var(--primary); border-color: var(--primary); text-decoration: none; }
/* Navbar primary CTA — guide §13 (Electric Blue, not full gradient) */
.gn-btn-cta {
  color: #fff;
  font-size: 15px; font-weight: 700;
  letter-spacing: -0.01em;
  padding: 10px 22px;
  border-radius: var(--radius-full);
  border: none;
  background: var(--color-primary);
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
  white-space: nowrap;
  display: inline-block;
  box-shadow: 0 6px 20px rgba(0, 102, 255, 0.28);
}
.gn-btn-cta:hover {
  background: var(--primary-dark);
  text-decoration: none;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: var(--shadow-button);
}

/* Hamburger (mobile only) */
.gn-hamburger {
  display: none;
  background: none; border: none;
  color: var(--color-navy);
  cursor: pointer; padding: 8px;
  border-radius: 10px;
  transition: background 150ms, color 150ms;
  flex-shrink: 0; line-height: 0;
}
.gn-hamburger:hover { background: rgba(0, 102, 255, 0.12); color: var(--color-navy); }

/* Mobile slide-down menu — frosted white to match nav */
.gm-menu {
  display: none; flex-direction: column;
  max-width: 1200px; margin: 6px auto 0;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(18px) saturate(1.35);
  -webkit-backdrop-filter: blur(18px) saturate(1.35);
  border: 1px solid rgba(0, 102, 255, 0.2);
  border-radius: 14px;
  padding: 8px;
  gap: 2px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.1);
  max-height: calc(100vh - 80px);
  overflow-y: auto;
}
.gm-menu.open { display: flex; }

.gm-link {
  color: var(--color-navy);
  font-size: 15px; font-weight: 600;
  letter-spacing: -0.01em;
  padding: 12px 14px;
  border-radius: 10px;
  text-decoration: none;
  transition: background 150ms, color 150ms;
}
.gm-link:hover,
.gm-link.active { background: rgba(0, 102, 255, 0.1); color: var(--color-navy); text-decoration: none; }

.gm-trigger {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; text-align: left;
  color: var(--color-navy);
  font-size: 15px; font-weight: 600;
  letter-spacing: -0.01em;
  font-family: inherit;
  padding: 12px 14px;
  border-radius: 10px;
  background: none; border: none; cursor: pointer;
  transition: background 150ms, color 150ms;
}
.gm-trigger:hover,
.gm-group.open .gm-trigger { background: rgba(0, 102, 255, 0.1); color: var(--color-navy); }
.gm-group.open .gn-chevron  { transform: rotate(180deg); }

.gm-sub {
  display: none; flex-direction: column;
  padding: 4px 0 4px 14px;
  margin-left: 14px;
  border-left: 1px solid rgba(0, 102, 255, 0.2);
}
.gm-group.open .gm-sub { display: flex; }

.gm-sub-link {
  color: #475569;
  font-size: 14px; font-weight: 500;
  padding: 10px 12px;
  border-radius: 8px;
  text-decoration: none;
  transition: background 150ms, color 150ms;
}
.gm-sub-link:hover,
.gm-sub-link.active { background: rgba(0, 102, 255, 0.08); color: var(--color-navy); text-decoration: none; }

.gm-auth {
  display: flex; gap: 8px;
  padding: 10px 4px 4px;
  margin-top: 4px;
  border-top: 1px solid rgba(0, 102, 255, 0.15);
}
.gm-auth .gn-btn-outline,
.gm-auth .gn-btn-cta { flex: 1; text-align: center; }

/* Mount keyframe */
@keyframes gn-item-in {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0);    }
}

/* Hero bottom — soft fade into page background (replaces asymmetric SVG wave) */
.ph-wave {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2;
  height: clamp(40px, 8vw, 72px);
  pointer-events: none;
  line-height: 0;
  background: linear-gradient(
    to bottom,
    rgba(242, 248, 255, 0) 0%,
    rgba(242, 248, 255, 0.25) 35%,
    rgba(242, 248, 255, 0.92) 78%,
    var(--bg) 100%
  );
}
.ph-wave svg {
  display: none !important;
}

@media (max-width: 900px) {
  .ph-wave {
    height: clamp(56px, 14vw, 100px);
  }
}

/* Responsive: hide desktop links, show hamburger below 900px */
@media (max-width: 900px) {
  .gn-links      { display: none; }
  .gn-auth       { display: none; }
  .gn-hamburger  {
    display: flex; align-items: center; justify-content: center;
    margin-left: auto; /* push to far right */
  }
  #navbar.glass-mode { padding: 8px 12px; }
  .gn-inner { padding: 8px 16px; }
  .gn-logo-img { height: 44px; }
}

/* Notification dropdown */
.notif-wrapper { position: relative; }
.notif-panel {
  display: none; position: absolute; right: 0; top: calc(100% + 0.5rem);
  width: 360px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  max-height: 480px; overflow-y: auto; z-index: 200;
}
.notif-panel.open { display: block; }
.notif-header { padding: 1rem; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.notif-header h4 { font-size: 0.9rem; }
.notif-item { padding: 0.875rem 1rem; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.1s; }
.notif-item:hover { background: var(--bg); }
.notif-item.unread { background: var(--primary-light); }
.notif-item p { font-size: 0.825rem; color: var(--text); margin: 0 0 0.25rem; }
.notif-item small { color: var(--text-muted); }
.notif-empty { padding: 2rem; text-align: center; color: var(--text-muted); font-size: 0.875rem; }

/* ===== Cards ===== */
.card {
  background: var(--surface);
  border: 1px solid rgba(0, 102, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
}
.card-hover { transition: box-shadow 0.2s, transform 0.2s; }
.card-hover:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1rem; }
.card-title { font-size: 1.05rem; font-weight: 600; }
.card-subtitle { font-size: 0.825rem; color: var(--text-muted); margin-top: 0.125rem; }

/* ===== Buttons (guide §6; .btn-success = marketing “secondary” green CTA) ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  padding: 14px 28px;
  border-radius: var(--radius-full);
  font-size: 1rem; font-weight: 700; cursor: pointer;
  border: 1px solid transparent; transition: transform 0.15s, box-shadow 0.15s, background 0.15s, border-color 0.15s, color 0.15s;
  text-decoration: none; line-height: 1;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-sm { padding: 8px 16px; font-size: 0.875rem; border-radius: var(--radius-full); }
.btn-lg { padding: 14px 28px; font-size: 1.0625rem; }
.btn-block { width: 100%; }
.btn-primary { background: var(--primary); color: white; border-color: var(--primary); }
.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-button);
}
.btn-secondary {
  background: var(--surface);
  color: var(--primary);
  border: 1.5px solid var(--primary);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--primary-light);
  transform: translateY(-1px);
}
.btn-success { background: var(--success); color: white; border-color: var(--success); }
.btn-success:hover:not(:disabled) {
  background: #00a344;
  border-color: #00a344;
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0, 200, 83, 0.25);
}
.btn-danger { background: var(--danger); color: white; border-color: var(--danger); }
.btn-danger:hover:not(:disabled) { background: #b91c1c; }
.btn-warning { background: var(--warning); color: white; border-color: var(--warning); }
.btn-ghost { background: transparent; color: var(--text-muted); border-color: transparent; }
.btn-ghost:hover:not(:disabled) { background: var(--bg); color: var(--text); }
.btn-icon { padding: 0.5rem; border-radius: var(--radius-sm); }
.btn-highlight {
  background: linear-gradient(135deg, #ff4f6d 0%, #ff8a00 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius-full);
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(255, 79, 109, 0.3);
}
.btn-highlight:hover:not(:disabled) {
  filter: brightness(1.03);
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(255, 79, 109, 0.28);
}
.btn-outline {
  background: var(--surface);
  color: var(--primary);
  border: 1.5px solid var(--primary);
  border-radius: var(--radius-full);
  padding: 14px 28px;
  font-weight: 700;
}
.btn-outline:hover:not(:disabled) {
  background: var(--primary-light);
  transform: translateY(-1px);
}

/* ===== Forms ===== */
.form-group { margin-bottom: 1.125rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
label { display: block; font-size: 0.875rem; font-weight: 600; color: var(--text); margin-bottom: 0.375rem; }
label .required { color: var(--danger); margin-left: 2px; }
input[type="text"], input[type="email"], input[type="password"], input[type="tel"],
input[type="number"], input[type="date"], input[type="time"], input[type="url"],
select, textarea {
  width: 100%; padding: 0.875rem 1rem;
  border: 1px solid var(--border-dark); border-radius: 14px;
  font-size: 1rem; color: var(--text); background: white;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: inherit;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(0, 102, 255, 0.12);
}
input.error, select.error, textarea.error { border-color: var(--danger); }
textarea { min-height: 100px; resize: vertical; }
.form-hint { font-size: 0.775rem; color: var(--text-muted); margin-top: 0.25rem; }
.field-error { font-size: 0.775rem; color: var(--danger); margin-top: 0.25rem; display: none; }
.field-error.show { display: block; }
.form-check { display: flex; align-items: flex-start; gap: 0.5rem; margin-bottom: 0.75rem; }
.form-check input[type="checkbox"] { width: auto; margin-top: 0.125rem; accent-color: var(--primary); }
.form-check label { margin: 0; font-weight: 400; font-size: 0.875rem; }
.input-group { display: flex; }
.input-group input { border-radius: var(--radius-sm) 0 0 var(--radius-sm); flex: 1; }
.input-group .btn { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; border-left: none; }

/* File upload */
.file-upload-area {
  border: 2px dashed var(--border-dark); border-radius: var(--radius);
  padding: 2rem; text-align: center; cursor: pointer; transition: all 0.2s;
  background: var(--surface-2);
}
.file-upload-area:hover, .file-upload-area.drag-over { border-color: var(--primary); background: var(--primary-light); }
.file-upload-area input[type="file"] { display: none; }
.file-upload-icon { font-size: 2.5rem; margin-bottom: 0.5rem; }
.file-upload-text { font-size: 0.875rem; color: var(--text-muted); }
.file-upload-text strong { color: var(--primary); }

/* Tags / chip inputs */
.tags-input { display: flex; flex-wrap: wrap; gap: 0.375rem; padding: 0.375rem; border: 1px solid var(--border-dark); border-radius: var(--radius-sm); min-height: 42px; }
.tag { background: var(--primary-light); color: var(--primary); padding: 0.2rem 0.5rem; border-radius: 20px; font-size: 0.8rem; display: flex; align-items: center; gap: 0.25rem; }
.tag button { background: none; border: none; cursor: pointer; color: var(--primary); font-size: 0.9rem; line-height: 1; padding: 0; }
.tags-input input { border: none; outline: none; flex: 1; min-width: 80px; font-size: 0.875rem; padding: 0.25rem; }

/* ===== Badges ===== */
.badge {
  display: inline-flex; align-items: center; gap: 0.25rem;
  padding: 6px 12px; border-radius: var(--radius-full);
  font-size: 0.8125rem; font-weight: 700; white-space: nowrap;
}
.badge-verified { background: var(--color-soft-green); color: #00a344; }
.badge-pending { background: var(--color-soft-yellow); color: #8a6a00; }
.badge-rejected { background: #ffe8ed; color: #d91f45; }
.badge-open { background: var(--color-soft-green); color: #00a344; }
.badge-closed { background: var(--border-dark); color: var(--text-muted); }
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-info { background: #e0f7fa; color: #00838f; }
.badge-csr { background: #f3e8ff; color: #7e22ce; }
.badge-new { background: #ffe8ed; color: #d91f45; }
.badge-urgent { background: #fff1e0; color: #c2410c; }

/* Guide §8 — icon circles */
.icon-circle {
  width: 48px; height: 48px; border-radius: 50%;
  background: #f2f8ff; color: #0066ff;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 1.35rem; line-height: 1;
}
.icon-circle--green { background: #effff6; color: #00c853; }
.icon-circle--yellow { background: #fff9d6; color: #b8860b; }
.icon-circle--purple { background: #f3e8ff; color: #8e24aa; }
.icon-circle--orange { background: #fff1e0; color: #ff8a00; }
.icon-circle--coral { background: #ffe8ed; color: #ff4f6d; }
.icon-circle--cyan { background: #e0f7fa; color: #00b8d9; }

/* KPI icon colour utilities (guide §8 — brand-aligned) */
.ki-blue   { background: var(--primary-light);     color: var(--color-primary); }
.ki-green  { background: var(--color-soft-green);  color: #00a344; }
.ki-purple { background: #f3e8ff;                  color: var(--color-purple); }
.ki-orange { background: var(--warning-light);     color: var(--color-orange); }
.ki-amber  { background: var(--color-soft-yellow); color: #8a6a00; }
.ki-coral  { background: #ffe8ed;                  color: var(--color-coral); }
.ki-cyan   { background: var(--info-light);        color: var(--color-cyan); }
.ki-red    { background: var(--danger-light);      color: var(--danger); }
.ki-sky    { background: #e0f7fa;                  color: var(--color-cyan); }
.ki-teal   { background: #e0f7fa;                  color: #00838f; }

/* Points ring / dashboard highlight band (guide §15 — Electric Blue primary) */
.points-ring-wrap {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--primary-dark) 100%);
  box-shadow: 0 4px 20px rgba(0, 102, 255, 0.25);
}

/* Guide §11 — impact stat colours */
.stat-number { font-size: clamp(2.25rem, 4vw, 3rem); font-weight: 800; line-height: 1; }
.stat-number--hours { color: #0066ff; }
.stat-number--verified { color: #00c853; }
.stat-number--rewards { color: #b8860b; }
.stat-number--partners { color: #8e24aa; }
.stat-number--impact { color: #ff8a00; }

/* Verified badge (large) */
.verified-badge {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: var(--success-light); color: #00a344;
  padding: 0.5rem 1rem; border-radius: 2rem;
  font-weight: 700; font-size: 0.9rem; border: 1px solid rgba(0, 200, 83, 0.25);
}

/* ===== Alerts ===== */
.alert { padding: 0.875rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; font-size: 0.875rem; display: flex; align-items: flex-start; gap: 0.625rem; border: 1px solid transparent; }
.alert-success { background: var(--success-light); color: #14532d; border-color: #86efac; }
.alert-danger { background: var(--danger-light); color: #7f1d1d; border-color: #fca5a5; }
.alert-warning { background: var(--warning-light); color: #78350f; border-color: #fcd34d; }
.alert-info { background: var(--info-light); color: #164e63; border-color: #7dd3fc; }
.toast-container { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 1000; display: flex; flex-direction: column; gap: 0.5rem; }
.toast { padding: 0.875rem 1.25rem; border-radius: var(--radius); box-shadow: var(--shadow-lg); font-size: 0.875rem; max-width: 360px; animation: slideInRight 0.3s ease; }
.toast-success { background: var(--success); color: white; }
.toast-error { background: var(--danger); color: white; }
.toast-info { background: var(--info); color: white; }
@keyframes slideInRight { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ===== Tables ===== */
.table-wrapper { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; background: white; }
th { padding: 0.75rem 1rem; text-align: left; font-size: 0.775rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); background: var(--bg); border-bottom: 1px solid var(--border); }
td { padding: 0.875rem 1rem; font-size: 0.875rem; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface-2); }
.table-actions { display: flex; gap: 0.375rem; }

/* ===== Grid ===== */
.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

/* ===== Stat Cards ===== */
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem 1.5rem; box-shadow: var(--shadow); }
.stat-label { font-size: 0.775rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 0.5rem; }
.stat-value { font-size: 2rem; font-weight: 800; color: var(--primary); line-height: 1; }
.stat-sub { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.375rem; }
.stat-icon { font-size: 2rem; }

/* ===== Page Header ===== */
.page-header { margin-bottom: 2rem; }
.page-header h1 { font-size: clamp(2.25rem, 3.5vw, 2.75rem); font-weight: 700; }
.page-header p { color: var(--text-muted); margin-top: 0.25rem; }
.page-header-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }

/* ===== Step Progress ===== */
.step-progress { display: flex; align-items: center; gap: 0; margin-bottom: 2.5rem; }
.step-item { display: flex; flex-direction: column; align-items: center; flex: 1; position: relative; }
.step-item:not(:last-child)::after {
  content: ''; position: absolute; top: 16px; left: calc(50% + 16px); right: calc(-50% + 16px);
  height: 2px; background: var(--border-dark); z-index: 0;
}
.step-item.completed:not(:last-child)::after { background: var(--primary); }
.step-circle {
  width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--border-dark);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 700; background: white;
  position: relative; z-index: 1; transition: all 0.2s;
}
.step-item.active .step-circle { border-color: var(--primary); background: var(--primary); color: white; }
.step-item.completed .step-circle { border-color: var(--primary); background: var(--primary); color: white; }
.step-label { font-size: 0.7rem; font-weight: 600; color: var(--text-muted); margin-top: 0.375rem; text-align: center; }
.step-item.active .step-label { color: var(--primary); }
.step-panels > div { display: none; }
.step-panels > div.active { display: block; }

/* ===== Gig Cards ===== */
.gig-card {
  background: var(--surface);
  border: 1px solid rgba(0, 102, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.2s, transform 0.15s;
  cursor: pointer;
}
.gig-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.gig-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.5rem; margin-bottom: 0.75rem; }
.gig-title { font-size: 1.0625rem; font-weight: 700; color: var(--color-navy); margin-bottom: 0.25rem; }
.gig-org { font-size: 0.8rem; color: var(--text-muted); }
.gig-meta { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 0.875rem; }
.gig-meta-item { display: flex; align-items: center; gap: 0.3rem; font-size: 0.8rem; color: var(--text-muted); }
.verified-lock { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.75rem; color: var(--warning); font-weight: 600; background: var(--warning-light); padding: 0.2rem 0.5rem; border-radius: 20px; }
.cat-pill { display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.25rem 0.625rem; border-radius: 20px; font-size: 0.75rem; font-weight: 600; }

/* ===== Filters ===== */
.filters { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1.5rem; }
.filters-row { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: flex-end; }
.filter-group { display: flex; flex-direction: column; gap: 0.375rem; min-width: 150px; }
.filter-group label { font-size: 0.775rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.filter-group select, .filter-group input { font-size: 0.85rem; padding: 0.4375rem 0.75rem; }

/* ===== Empty State ===== */
.empty-state { text-align: center; padding: 4rem 2rem; color: var(--text-muted); }
.empty-icon { font-size: 3.5rem; margin-bottom: 1rem; }
.empty-state h3 { font-size: 1.1rem; color: var(--text); margin-bottom: 0.5rem; }
.empty-state p { font-size: 0.875rem; max-width: 400px; margin: 0 auto 1.5rem; }

/* ===== Loading ===== */
.spinner { display: inline-block; width: 24px; height: 24px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.7s linear infinite; }
.spinner-lg { width: 40px; height: 40px; border-width: 4px; }
.loading-overlay { display: flex; align-items: center; justify-content: center; padding: 4rem; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Modal ===== */
.modal-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 500; align-items: center; justify-content: center; padding: 1rem; }
.modal-backdrop.open { display: flex; }
.modal { background: white; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: 100%; max-width: 540px; max-height: 90vh; overflow-y: auto; animation: modalIn 0.2s ease; }
.modal-header { padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal-header h3 { font-size: 1.1rem; }
.modal-body { padding: 1.5rem; }
.modal-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 0.75rem; }
.modal-close { background: none; border: none; font-size: 1.25rem; cursor: pointer; color: var(--text-muted); padding: 0.25rem; line-height: 1; }
.modal-close:hover { color: var(--text); }
@keyframes modalIn { from { opacity: 0; transform: scale(0.95) translateY(-10px); } to { opacity: 1; transform: scale(1) translateY(0); } }

/* ===== Misc Utilities ===== */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-primary { color: var(--primary); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.font-bold { font-weight: 700; }
.font-medium { font-weight: 500; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.divider { height: 1px; background: var(--border); margin: 1.25rem 0; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

/* ===== Auth Pages ===== */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--gradient-hero); padding: 1rem; position: relative; }
.auth-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(7, 26, 61, 0.12) 0%, rgba(7, 26, 61, 0.35) 100%);
  pointer-events: none;
}
.auth-card {
  position: relative;
  z-index: 1;
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 440px;
  padding: 2.5rem;
}
.auth-logo { text-align: center; margin-bottom: 2rem; }
.auth-logo h1 { color: var(--primary); font-size: 1.75rem; }
.auth-logo p { color: var(--text-muted); font-size: 0.875rem; margin-top: 0.25rem; }
.auth-divider { display: flex; align-items: center; gap: 1rem; margin: 1.25rem 0; color: var(--text-muted); font-size: 0.8rem; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.auth-footer { text-align: center; margin-top: 1.5rem; font-size: 0.85rem; color: var(--text-muted); }

/* ===== Hero (Public dashboard) — guide §4 hero gradient + white type ===== */
.hero {
  position: relative;
  background: var(--gradient-hero);
  color: #fff;
  padding: 5rem 0 4rem;
  text-align: center;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(7, 26, 61, 0.12) 0%, rgba(7, 26, 61, 0.38) 100%);
  pointer-events: none;
}
.hero .container { position: relative; z-index: 1; }
.hero h1 { font-size: clamp(2.5rem, 5vw, 3.5rem); font-weight: 800; margin-bottom: 1rem; color: #fff; text-shadow: 0 2px 28px rgba(7, 26, 61, 0.35); }
.hero p { font-size: 1.125rem; color: rgba(255, 255, 255, 0.92); max-width: 560px; margin: 0 auto 2rem; }
.hero-stats { display: flex; justify-content: center; gap: 3rem; margin-top: 3rem; }
.hero-stat { text-align: center; }
.hero-stat-value { font-size: 2.5rem; font-weight: 800; }
.hero-stat-label { font-size: 0.875rem; opacity: 0.8; margin-top: 0.25rem; }

/* Photo heroes: global `p { color: #334155 }` made subcopy invisible on dark images */
.page-hero .ph-content p {
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5), 0 2px 16px rgba(7, 26, 61, 0.4);
}

/* ===== Section ===== */
.section { padding: 3rem 0; }
.section-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.5rem; }
.section-subtitle { color: var(--text-muted); margin-bottom: 2rem; font-size: 0.9rem; }

/* Section background utilities (guide §9) */
.bg-soft-blue   { background: #eaf4ff; }
.bg-soft-green  { background: #effff6; }
.bg-soft-yellow { background: #fff9d6; }
.bg-white       { background: #ffffff; }
.bg-navy        { background: #071a3d; color: #ffffff; }

/* ===== Responsive ===== */

/* Tablet — grids go 2-col before collapsing fully */
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  :root { --nav-height: 60px; }
  body { overflow-x: hidden; }
  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.25rem; }

  /* Navbar */
  .nav-links, .nav-right { display: none; }
  .nav-hamburger { display: flex; align-items: center; justify-content: center; }
  .nav-logo { height: 36px; }

  /* Notification panel — full-width on mobile */
  .notif-panel { width: calc(100vw - 2rem); right: 0; left: auto; max-width: 360px; }

  /* Grids */
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }

  /* Forms */
  .form-row { grid-template-columns: 1fr; }

  /* Public hero */
  .hero h1 { font-size: 2rem; }
  .hero-stats { gap: 1.5rem; flex-wrap: wrap; justify-content: center; }
  .hero-stat-value { font-size: 1.75rem; }

  /* Page layout */
  .page-header-row { flex-direction: column; align-items: flex-start; }
  .page-header-row .btn { width: 100%; justify-content: center; }

  /* Filters */
  .filters-row { flex-direction: column; }
  .filter-group { min-width: 100%; }

  /* Step progress — shrink labels */
  .step-label { font-size: 0.6rem; }

  /* Modals — full width on mobile */
  .modal { max-width: 100%; border-radius: var(--radius) var(--radius) 0 0; }
  .modal-backdrop { align-items: flex-end; padding: 0; }

  /* Tables */
  .table-wrapper { font-size: 0.8rem; }
  td, th { padding: 0.625rem 0.75rem; white-space: nowrap; }
}

@media (max-width: 480px) {
  .container { padding: 0 1rem; }
  .container-sm { padding: 0 1rem; }
  .card { padding: 1rem; }
  .auth-card { padding: 1.5rem; }
  .grid-4 { grid-template-columns: 1fr; }
  .stat-value { font-size: 1.5rem; }
  .page-content { padding-top: calc(var(--nav-height) + 1rem); }
}

/* ===== Sidebar Layout ===== */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: linear-gradient(180deg, #ffffff 0%, #f0f9ff 55%, #e0f2fe 100%);
  border-right: 1px solid rgba(0, 102, 255, 0.12);
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 120;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.25s ease, width 0.25s ease;
}
.sidebar.ready { transform: translateX(0); }
.sidebar-brand {
  height: 58px;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0 1rem;
  border-bottom: 1px solid rgba(0, 102, 255, 0.12);
  text-decoration: none;
}
.sidebar-brand:hover { text-decoration: none; }
.sidebar-brand-logo {
  height: 32px;
  width: auto;
  max-width: 118px;
  object-fit: contain;
  object-position: left center;
  display: block;
  flex-shrink: 0;
}
.sidebar-brand-text { line-height: 1.15; min-width: 0; }
.sidebar-brand-name { color: var(--color-navy); font-size: 0.9rem; font-weight: 800; letter-spacing: -0.02em; }
.sidebar-brand-sub { color: var(--primary); font-size: 0.64rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.sidebar-nav { padding: 0.75rem 0.65rem; flex: 1; }
.sidebar-section { margin-bottom: 0.25rem; }
.sidebar-section-label {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  padding: 0.85rem 0.65rem 0.45rem;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.62rem 0.75rem;
  color: #475569;
  font-size: 0.84rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: 9px;
  border-left: none;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.sidebar-link:hover { background: #ffffff; color: #0f172a; text-decoration: none; box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06); }
.sidebar-link.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.2);
}
.sidebar-link-text { min-width: 0; }
.sidebar-icon { width: 17px; height: 17px; flex-shrink: 0; }
.sidebar-badge {
  margin-left: auto;
  background: var(--danger);
  color: white;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
  line-height: 1.5;
}
.sidebar-divider { height: 1px; background: #e2e8f0; margin: 0.5rem 1.25rem; }
.sidebar-footer {
  padding: 0.85rem 1rem;
  border-top: 1px solid rgba(0, 102, 255, 0.12);
}
.sidebar-user { display: flex; align-items: center; gap: 0.625rem; }
.sidebar-user-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(145deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.875rem; flex-shrink: 0;
  border: 1px solid rgba(0, 102, 255, 0.22);
}
.sidebar-user-name { font-size: 0.8rem; font-weight: 700; color: #0f172a; line-height: 1.3; }
.sidebar-user-role { font-size: 0.68rem; color: #64748b; text-transform: capitalize; }

/* Backdrop for mobile */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 49;
}
.sidebar-backdrop.open { display: block; }

/* Layout shift when sidebar is open */
.has-sidebar #navbar .nav-links { display: none; }
.has-sidebar .page-content {
  margin-left: var(--sidebar-width);
  background: var(--bg);
}
.has-sidebar .container {
  max-width: 1440px;
  padding-left: 1.75rem;
  padding-right: 1.75rem;
}
.sidebar-toggle-desktop {
  position: fixed;
  top: 0.95rem;
  left: calc(var(--sidebar-width) - 0.75rem);
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid var(--border-dark);
  background: #fff;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow);
  z-index: 130;
  transition: left 0.2s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.sidebar-toggle-desktop:hover {
  color: var(--text);
  border-color: var(--text-light);
  background: var(--surface-2);
}
/* Desktop: collapsed = narrow icon rail (sidebar stays visible) */
@media (min-width: 901px) {
  .has-sidebar.sidebar-collapsed .page-content {
    margin-left: var(--sidebar-rail-width);
  }
  .has-sidebar.sidebar-collapsed .sidebar.ready {
    transform: translateX(0);
    width: var(--sidebar-rail-width);
  }
  .has-sidebar.sidebar-collapsed .sidebar-brand {
    justify-content: center;
    padding: 0 0.5rem;
    gap: 0;
  }
  .has-sidebar.sidebar-collapsed .sidebar-brand-logo {
    max-width: 40px;
    max-height: 28px;
    object-position: center;
  }
  .has-sidebar.sidebar-collapsed .sidebar-brand-text,
  .has-sidebar.sidebar-collapsed .sidebar-section-label,
  .has-sidebar.sidebar-collapsed .sidebar-link-text,
  .has-sidebar.sidebar-collapsed .sidebar-user-meta {
    display: none;
  }
  .has-sidebar.sidebar-collapsed .sidebar-link {
    justify-content: center;
    gap: 0;
    padding: 0.62rem 0.35rem;
  }
  .has-sidebar.sidebar-collapsed .sidebar-nav {
    padding: 0.75rem 0.35rem;
  }
  .has-sidebar.sidebar-collapsed .sidebar-footer {
    padding: 0.85rem 0.35rem;
  }
  .has-sidebar.sidebar-collapsed .sidebar-user {
    justify-content: center;
  }
  .has-sidebar.sidebar-collapsed .sidebar-toggle-desktop {
    left: calc(var(--sidebar-rail-width) - 0.75rem);
  }
}

@media (max-width: 900px) {
  .has-sidebar #navbar,
  .has-sidebar.sidebar-collapsed #navbar {
    left: 0;
  }
  .has-sidebar .page-content { margin-left: 0; }
  .sidebar.ready { transform: translateX(-100%); }
  .sidebar.ready.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .sidebar-toggle-desktop { display: none; }
}

/* Logo on dark navy backgrounds (footer, etc.) */
.logo-on-dark {
  display: inline-block;
  background: rgba(255, 255, 255, 0.97);
  padding: 0.6rem 0.85rem;
  border-radius: 10px;
  margin-bottom: 0.875rem;
  line-height: 0;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.14),
    0 0 0 1px rgba(255, 255, 255, 0.08);
}
.logo-on-dark img {
  height: 72px;
  width: auto;
  display: block;
  margin: 0;
  object-fit: contain;
}

/* Footer social icons on dark navy */
.footer-social-on-dark,
.gf-social {
  display: flex;
  gap: 0.625rem;
  margin-top: 1.25rem;
}
.footer-social-on-dark a,
.gf-social a {
  width: 34px;
  height: 34px;
  background: rgba(255, 255, 255, 0.97);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #071a3d;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(255, 255, 255, 0.08);
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.footer-social-on-dark a:hover,
.gf-social a:hover {
  background: #0066ff;
  color: #ffffff;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(0, 102, 255, 0.35);
}

/* ===== Global Footer ===== */
.global-footer {
  margin-top: 0;
  background: #071a3d;
  color: #cbd5e1;
  border-top: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.global-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.65rem 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
}
.global-footer-copy {
  font-size: 0.78rem;
  color: #94a3b8;
  text-align: center;
}
.global-footer a       { color: #cbd5e1; text-decoration: none; }
.global-footer a:hover { color: #ffd600; text-decoration: none; }

/* ===== Mobile Responsive Enhancements ===== */
@media (max-width: 768px) {
  .grid[style*="grid-template-columns:2fr 1fr"],
  .grid[style*="grid-template-columns: 2fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table {
    min-width: 600px;
  }

  .table-actions {
    flex-direction: column;
    gap: 0.25rem;
  }

  .stat-row {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 480px) {
  .page-header-row {
    gap: 0.75rem;
  }

  .page-header-row .btn {
    font-size: 0.85rem;
    padding: 0.6rem 1rem;
  }

  .modal {
    margin: 0;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
  }

  .cat-pill {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
  }
}

/* ===== Page-theme overrides (guide §15) ===== */
/* Apply via <body class="page-theme-rewards"> etc. */
body.page-theme-rewards {
  --primary: var(--color-highlight);
  --primary-dark: var(--color-orange);
  --primary-light: #fff9d6;
  --shadow-button: 0 10px 25px rgba(255, 214, 0, 0.3);
}
body.page-theme-csr {
  --primary: var(--color-purple);
  --primary-dark: #6a1b9a;
  --primary-light: #f3e8ff;
  --shadow-button: 0 10px 25px rgba(142, 36, 170, 0.25);
}
/* ===== Mobile / responsive helpers — apply consistently across pages ===== */
@media (max-width: 768px) {
  /* Page header rows should always stack vertically on phones */
  .page-header-row {
    flex-direction: column;
    align-items: stretch;
  }
  .page-header-row > div:first-child { width: 100%; }
  .page-header-row .btn { width: 100%; justify-content: center; }
  .page-header-row > div:last-of-type { flex-wrap: wrap; }

  /* Containers tighter on phones */
  .container { padding: 0 0.875rem !important; }
  .container-sm { padding: 0 0.875rem !important; }

  /* Filter bars wrap cleanly */
  .filter-bar { gap: 0.4rem; }
  .filter-bar input[type="search"] { margin-left: 0 !important; width: 100%; min-width: 0 !important; }

  /* Any nested 2-column .row2 grids collapse to one column */
  .row2 { grid-template-columns: 1fr !important; }

  /* Modals don't fight the edges */
  .modal { max-width: calc(100vw - 1rem) !important; margin: 0.5rem auto; }
  .modal-body { padding: 1rem !important; }
}

/* Wrap any table in `<div class="responsive-table">` to scroll horizontally on phones */
.responsive-table {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.responsive-table table { min-width: 560px; }

/* Tight phones: 1-column grids regardless of minmax */
@media (max-width: 540px) {
  .kpi-grid,
  .gigs-grid,
  .gig-grid,
  .stat-grid,
  .summary-strip { grid-template-columns: 1fr !important; }
  .detail-grid { grid-template-columns: 1fr !important; }
  .cal-layout { grid-template-columns: 1fr !important; }

  /* Tap targets at least 44px tall */
  .btn-sm { min-height: 38px; }
  .btn { min-height: 44px; }
}

body.page-theme-opps {
  --primary: var(--color-primary);
  --accent: var(--color-cyan);
  --primary-light: var(--color-soft-blue);
}
