*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Primary — boosted luminance for dark backgrounds */
  --pmax-blue: #3B82F6;
  --pmax-blue-light: rgba(59, 130, 246, 0.15);
  --pmax-blue-hover: #60A5FA;
  --pmax-blue-deep: #2563EB;

  /* Accent — slightly brighter for dark harmony */
  --pmax-red: #EF4444;
  --pmax-orange: #F59E0B;
  --pmax-yellow: #FBBF24;
  --pmax-green: #22C55E;
  --pmax-purple: #A78BFA;
  --pmax-teal: #14B8A6;

  /* Light variants — translucent tints on dark */
  --pmax-green-light: rgba(34, 197, 94, 0.12);
  --pmax-orange-light: rgba(245, 158, 11, 0.12);
  --pmax-red-light: rgba(239, 68, 68, 0.12);
  --pmax-purple-light: rgba(167, 139, 250, 0.12);
  --pmax-teal-light: rgba(20, 184, 166, 0.12);

  /* Neutrals — Professional Obsidian palette */
  --gray-50: #0B0E14;
  --gray-100: #111827;
  --gray-200: #1E293B;
  --gray-300: #242933;
  --gray-400: #5A6270;
  --gray-500: #8A919E;
  --gray-600: #B0B7C3;
  --gray-700: #D1D5DB;
  --gray-800: #E4E4E7;
  --gray-900: #FFFFFF;

  /* Surface colors for cards/panels */
  --surface: #151921;
  --surface-solid: #0D1117;
  --surface-raised: #1C2130;
  --border-subtle: #242933;

  /* Shape — darker, more pronounced shadows */
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.4), 0 1px 2px -1px rgb(0 0 0 / 0.3);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.3);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5), 0 4px 6px -4px rgb(0 0 0 / 0.4);

  /* Layout */
  --sidebar-width: 260px;
  --sidebar-collapsed: 64px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  font-size: 14px;
  line-height: 1.5;
  display: flex;
  min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-width);
  background: rgba(13, 17, 23, 0.80);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  overflow-y: auto;
  transition: width 0.25s ease;
}

.sidebar.collapsed { width: var(--sidebar-collapsed); overflow: visible; }

.sidebar-logo {
  padding: 14px 16px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
}

.sidebar-logo img { height: 28px; width: auto; flex-shrink: 0; }

.logo-divider { width: 1px; height: 24px; background: var(--gray-200); flex-shrink: 0; }

.sidebar.collapsed .logo-divider,
.sidebar.collapsed .logo-text { display: none; }

.logo-text {
  display: flex;
  flex-direction: column;
  font-family: 'Lexend Deca', sans-serif;
  min-width: 0;
}

.logo-text strong {
  font-size: 15px;
  font-weight: 800;
  color: var(--gray-900);
  letter-spacing: -0.3px;
  line-height: 1.1;
}

.logo-text span {
  font-size: 8px;
  color: var(--gray-400);
  font-weight: 500;
  letter-spacing: 1.2px;
}

/* Collapse toggle */
.sidebar-collapse-btn {
  position: absolute;
  top: 18px;
  right: -12px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 10px;
  color: var(--gray-400);
  z-index: 101;
  transition: all 0.15s;
  box-shadow: var(--shadow);
}

.sidebar-collapse-btn:hover { background: var(--gray-50); color: var(--gray-600); }
.sidebar.collapsed .sidebar-collapse-btn { transform: rotate(180deg); }

/* Nav */
.sidebar-nav {
  flex: 1;
  padding: 8px 8px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-group { margin-top: 4px; }

.nav-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 4px;
  cursor: pointer;
  user-select: none;
}

.sidebar.collapsed .nav-group-header { justify-content: center; padding: 10px 4px 4px; }
.sidebar.collapsed .nav-group-label { display: none; }
.sidebar.collapsed .nav-group-arrow { display: none; }

.nav-group-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.nav-group-arrow {
  font-size: 10px;
  color: var(--gray-300);
  transition: transform 0.2s;
}

.nav-group.collapsed .nav-group-arrow { transform: rotate(-90deg); }
.nav-group.collapsed .nav-group-items { display: none; }

.nav-group-items {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding-top: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  font-size: 13.5px;
  color: var(--gray-600);
  transition: background-color 0.15s, color 0.15s;
  text-decoration: none;
  position: relative;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar.collapsed .nav-item { padding: 8px; justify-content: center; }
.sidebar.collapsed .nav-item .nav-label,
.sidebar.collapsed .nav-item .nav-badge,
.sidebar.collapsed .nav-item .coming-soon { display: none; }

/* Collapsed tooltip */
.sidebar.collapsed .nav-item:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--gray-800);
  color: white;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  z-index: 200;
  pointer-events: none;
}

.nav-item:hover { background: var(--gray-100); color: var(--gray-800); }
.nav-item.active { background: var(--pmax-blue-light); color: var(--pmax-blue); box-shadow: inset 3px 0 0 var(--pmax-blue); }

.nav-item .icon {
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; flex-shrink: 0;
}

.nav-item .module-icon {
  width: 20px; height: 20px;
  border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex-shrink: 0;
}

.module-icon.blue { background: var(--pmax-blue-light); color: var(--pmax-blue); }
.module-icon.purple { background: var(--pmax-purple-light); color: var(--pmax-purple); }
.module-icon.teal { background: var(--pmax-teal-light); color: var(--pmax-teal); }
.module-icon.orange { background: var(--pmax-orange-light); color: var(--pmax-orange); }
.module-icon.red { background: var(--pmax-red-light); color: var(--pmax-red); }
.module-icon.green { background: var(--pmax-green-light); color: var(--pmax-green); }

.nav-badge {
  margin-left: auto;
  background: var(--pmax-blue);
  color: white;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.nav-badge.orange { background: var(--pmax-orange); }
.nav-badge.red { background: var(--pmax-red); }

.nav-item.disabled { opacity: 0.35; pointer-events: none; }

.coming-soon {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-400);
  background: var(--gray-100);
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: auto;
}

.external-icon {
  font-size: 11px;
  color: var(--gray-400);
  margin-left: auto;
}
.sidebar.collapsed .external-icon { display: none; }

/* Sidebar footer */
.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar.collapsed .sidebar-footer { justify-content: center; padding: 14px 8px; }
.sidebar.collapsed .user-info,
.sidebar.collapsed .settings-btn { display: none; }

.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--pmax-blue-light);
  color: var(--pmax-blue);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 12px; flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }
.user-info .name { font-weight: 600; font-size: 13px; color: var(--gray-800); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-info .role { font-size: 11px; color: var(--gray-400); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.settings-btn {
  padding: 4px; border: none; background: none;
  color: var(--gray-400); cursor: pointer; border-radius: 4px; font-size: 16px;
  text-decoration: none;
}
.settings-btn:hover { background: var(--gray-100); color: var(--gray-600); }

/* Login button in sidebar footer */
.login-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 8px;
  background: var(--pmax-blue); color: white;
  font-weight: 600; font-size: 13px;
  text-decoration: none; cursor: pointer;
  transition: background 0.15s;
  width: 100%;
}
.login-btn:hover { background: var(--pmax-blue-hover); }
.sidebar.collapsed .login-btn .nav-label { display: none; }

.user-section {
  display: flex; align-items: center; gap: 10px; width: 100%;
}

/* ===== MAIN ===== */
.main {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  transition: margin-left 0.25s ease;
}

body.sidebar-collapsed .main { margin-left: var(--sidebar-collapsed); }

/* ===== TOP BAR ===== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 32px;
  background: var(--surface-solid);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 50;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--gray-400);
}

.breadcrumb a { color: var(--gray-400); text-decoration: none; cursor: pointer; }
.breadcrumb a:hover { color: var(--gray-600); }
.breadcrumb .current { color: var(--gray-700); font-weight: 500; }
.breadcrumb .sep { color: var(--gray-300); }

.topbar-actions { display: flex; align-items: center; gap: 12px; }

.cmd-bar {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border-subtle);
  border-radius: 8px; padding: 6px 14px;
  cursor: pointer; min-width: 280px; height: 32px;
  transition: border-color 0.15s;
}
.cmd-bar:hover, .cmd-bar:focus { border-color: var(--gray-400); outline: none; }
.cmd-icon { font-size: 12px; color: var(--gray-400); }
.cmd-placeholder { font-size: 12px; color: var(--gray-400); flex: 1; }
.cmd-shortcut {
  font-size: 10px; font-family: 'SF Mono', Consolas, monospace;
  color: var(--gray-400); background: var(--gray-100);
  border: 1px solid var(--border-subtle); border-radius: 4px;
  padding: 1px 5px; line-height: 1.4;
}

.url-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 5px 12px;
  font-size: 12px;
  color: var(--gray-400);
  font-family: 'SF Mono', Consolas, monospace;
}

.url-bar .url-lock { color: var(--pmax-green); font-size: 11px; }
.url-bar .url-text { color: var(--gray-500); }
.url-bar .url-path { color: var(--gray-700); font-weight: 500; }

.notif-btn {
  position: relative;
  width: 36px; height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--surface-raised);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 16px; color: var(--gray-500);
}
.notif-btn:hover { background: var(--gray-200); }

.notif-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 8px; height: 8px;
  background: var(--pmax-red);
  border-radius: 50%;
  border: 2px solid var(--surface-solid);
}

/* ===== PAGE ===== */
.page {
  display: none;
  padding: 28px 32px;
  max-width: 1400px;
}
.page.active { display: block; }

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0;
}

.page-header h1 {
  font-size: 26px;
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -0.5px;
  font-family: 'Lexend Deca', sans-serif;
}

.page-header .subtitle {
  font-size: 14px;
  color: var(--gray-500);
  margin-top: 4px;
}

/* ===== MODULE TABS (Level 2) ===== */
.module-tabs {
  display: flex;
  align-items: center;
  gap: 0;
  border-bottom: 2px solid var(--gray-100);
  margin-top: 20px;
  margin-bottom: 28px;
}

.module-tab {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-500);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.module-tab:hover { color: var(--gray-700); background: var(--gray-50); }

.module-tab.active {
  color: var(--pmax-blue);
  border-bottom-color: var(--pmax-blue);
  font-weight: 600;
  text-shadow: 0 0 12px rgba(59, 130, 246, 0.4);
}

.module-tab .tab-badge {
  font-size: 10px; font-weight: 600;
  background: var(--gray-100); color: var(--gray-500);
  padding: 1px 6px; border-radius: 10px;
}

.module-tab.active .tab-badge {
  background: var(--pmax-blue-light); color: var(--pmax-blue);
}

.module-tab-icon { font-size: 13px; }

/* ===== MODULE CONTENT ===== */
.module-content { display: none; }
.module-content.active { display: block; }

/* ===== HOME — GREETING ===== */
.greeting {
  font-size: 28px; font-weight: 600;
  color: var(--gray-900);
  font-family: 'Lexend Deca', sans-serif;
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}

.greeting-sub {
  font-size: 15px; color: var(--gray-500);
  margin-bottom: 32px;
}

/* North Star Metrics */
.pulse-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

.metric-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 22px 24px;
  border: 1px solid var(--border-subtle);
  position: relative;
  overflow: hidden;
}

.metric-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}

.metric-card.blue::before { background: var(--pmax-blue); }
.metric-card.green::before { background: var(--pmax-green); }
.metric-card.orange::before { background: var(--pmax-orange); }
.metric-card.purple::before { background: var(--pmax-purple); }

.metric-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; margin-bottom: 14px;
}

.metric-icon.blue { background: var(--pmax-blue-light); color: var(--pmax-blue); }
.metric-icon.green { background: var(--pmax-green-light); color: var(--pmax-green); }
.metric-icon.orange { background: var(--pmax-orange-light); color: var(--pmax-orange); }
.metric-icon.purple { background: var(--pmax-purple-light); color: var(--pmax-purple); }

.metric-label {
  font-size: 12px; font-weight: 500;
  color: var(--gray-400); margin-bottom: 4px;
  text-transform: uppercase; letter-spacing: 0.3px;
}

.metric-value {
  font-size: 32px; font-weight: 800;
  color: var(--gray-900); letter-spacing: -1px;
  font-family: 'JetBrains Mono', 'Lexend Deca', monospace; line-height: 1.1;
}

.sparkline {
  position: absolute; bottom: 0; right: 0;
  width: 50%; height: 32px;
  opacity: 0.5;
}

.metric-trend {
  display: inline-flex;
  align-items: center; gap: 4px;
  font-size: 12px; font-weight: 600;
  margin-top: 6px; padding: 2px 8px; border-radius: 12px;
}

.metric-trend.up { background: var(--pmax-green-light); color: var(--pmax-green); }
.metric-trend.down { background: var(--pmax-red-light); color: var(--pmax-red); }
.metric-trend.flat { background: var(--gray-100); color: var(--gray-500); }

/* Module Grid */
.section-label {
  font-size: 13px; font-weight: 600;
  color: var(--gray-400); text-transform: uppercase;
  letter-spacing: 0.5px; margin-bottom: 16px;
}

.modules-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: minmax(160px, auto);
  gap: 20px;
  margin-bottom: 36px;
}

.module-card.bento-wide { grid-column: span 2; }
.module-card.bento-tall { grid-row: span 2; }

.module-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
}

.module-card:hover {
  border-color: var(--gray-400);
  box-shadow: 0 0 20px rgba(59,130,246,0.06);
  transform: translateY(-1px);
}

.module-card-header { display: flex; align-items: center; gap: 12px; }

.module-card-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 800; flex-shrink: 0;
}

.module-card-icon.blue { background: var(--pmax-blue-light); color: var(--pmax-blue); }
.module-card-icon.purple { background: var(--pmax-purple-light); color: var(--pmax-purple); }
.module-card-icon.teal { background: var(--pmax-teal-light); color: var(--pmax-teal); }
.module-card-icon.orange { background: var(--pmax-orange-light); color: var(--pmax-orange); }
.module-card-icon.green { background: var(--pmax-green-light); color: var(--pmax-green); }
.module-card-icon.red { background: var(--pmax-red-light); color: var(--pmax-red); }

.module-card-title { font-size: 15px; font-weight: 600; color: var(--gray-900); }

.module-card-desc { font-size: 13px; color: var(--gray-500); line-height: 1.5; }

.module-card-stats {
  display: flex; gap: 20px;
  padding-top: 12px;
  border-top: 1px solid var(--gray-100);
}

.module-stat { display: flex; flex-direction: column; }

.module-stat-value {
  font-size: 18px; font-weight: 700;
  color: var(--gray-800);
  font-family: 'JetBrains Mono', 'Lexend Deca', monospace;
}

.module-stat-label { font-size: 11px; color: var(--gray-400); font-weight: 500; }

.module-card .coming-badge {
  position: absolute; top: 12px; right: 12px;
  font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--gray-400); background: var(--gray-100);
  padding: 2px 8px; border-radius: 4px;
}

.module-card.disabled { opacity: 0.5; cursor: default; }
.module-card.disabled:hover { border-color: var(--border-subtle); transform: none; }

/* Agent card status glow — 2px left edge bar */
.module-card[data-agent="deal-orchestrator"] { box-shadow: inset 2px 0 0 var(--pmax-blue); }
.module-card[data-agent="pricing-agent"] { box-shadow: inset 2px 0 0 var(--pmax-green); }
.module-card[data-agent="proposal-agent"] { box-shadow: inset 2px 0 0 var(--pmax-purple); }

.module-card[data-agent="deal-orchestrator"]:hover { box-shadow: inset 2px 0 0 var(--pmax-blue), 0 0 20px rgba(59,130,246,0.06); }
.module-card[data-agent="pricing-agent"]:hover { box-shadow: inset 2px 0 0 var(--pmax-green), 0 0 20px rgba(34,197,94,0.06); }
.module-card[data-agent="proposal-agent"]:hover { box-shadow: inset 2px 0 0 var(--pmax-purple), 0 0 20px rgba(167,139,250,0.06); }

.live-status {
  display: flex; align-items: center; gap: 5px;
  font-size: 11px; font-family: 'JetBrains Mono', monospace;
  color: var(--gray-500); margin-top: 2px;
}

.live-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--pmax-green);
  animation: agent-pulse 2s ease-in-out infinite;
}

/* Activity Feed */
.activity-section {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

.activity-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
}

.activity-card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.activity-card-header h3 { font-size: 15px; font-weight: 600; color: var(--gray-800); }

.view-all { font-size: 12px; color: var(--pmax-blue); text-decoration: none; font-weight: 500; }
.view-all:hover { text-decoration: underline; }

.activity-list { padding: 4px 0; }

.activity-item {
  display: flex; gap: 12px;
  padding: 12px 20px;
  transition: background 0.1s;
}
.activity-item:hover { background: var(--gray-50); }

.activity-dot {
  width: 8px; height: 8px;
  border-radius: 50%; flex-shrink: 0;
  margin-top: 6px;
}

.activity-dot.blue { background: var(--pmax-blue); }
.activity-dot.green { background: var(--pmax-green); }
.activity-dot.orange { background: var(--pmax-orange); }
.activity-dot.red { background: var(--pmax-red); }
.activity-dot.purple { background: var(--pmax-purple); }

.activity-text { flex: 1; font-size: 13px; color: var(--gray-600); line-height: 1.5; }
.activity-text strong { color: var(--gray-800); font-weight: 600; }

.activity-time { font-size: 11px; color: var(--gray-400); white-space: nowrap; margin-top: 2px; }

.activity-module {
  font-size: 10px; font-weight: 600;
  padding: 1px 6px; border-radius: 4px; margin-left: 4px;
}

.activity-module.pricing { background: var(--pmax-blue-light); color: var(--pmax-blue); }
.activity-module.media { background: var(--pmax-orange-light); color: var(--pmax-orange); }
.activity-module.perf { background: var(--pmax-green-light); color: var(--pmax-green); }

/* Quick Links */
.quick-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px; cursor: pointer;
  transition: background 0.1s; text-decoration: none; color: inherit;
}
.quick-link:hover { background: var(--gray-50); }

.quick-link-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; flex-shrink: 0;
}

.quick-link-text { font-size: 13px; font-weight: 500; color: var(--gray-700); }
.quick-link-desc { font-size: 11px; color: var(--gray-400); }

/* ===== CROSS-MODULE ALERT ===== */
.cross-module-alert {
  background: linear-gradient(135deg, var(--pmax-blue-light) 0%, var(--pmax-purple-light) 100%);
  border: 1px solid rgba(39, 115, 255, 0.2);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 24px;
}

.cross-module-alert .alert-icon {
  width: 36px; height: 36px;
  border-radius: 8px; background: rgba(17, 24, 39, 0.8);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0; box-shadow: var(--shadow);
}

.cross-module-alert .alert-text { flex: 1; }
.cross-module-alert .alert-title { font-size: 13px; font-weight: 600; color: var(--gray-800); }
.cross-module-alert .alert-desc { font-size: 12px; color: var(--gray-500); margin-top: 1px; }

.cross-module-alert .alert-action {
  font-size: 12px; font-weight: 600; color: var(--pmax-blue);
  text-decoration: none; padding: 6px 14px; border-radius: 6px;
  background: rgba(17, 24, 39, 0.8); border: 1px solid rgba(59, 130, 246, 0.3);
  cursor: pointer; white-space: nowrap;
}
.cross-module-alert .alert-action:hover { background: var(--pmax-blue); color: var(--gray-900); }

/* ===== DEALS TABLE ===== */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 18px 20px;
  border: 1px solid var(--border-subtle);
  position: relative;
}

.stat-card .stat-value {
  font-size: 24px; font-weight: 700;
  color: var(--gray-900);
  font-family: 'JetBrains Mono', 'Lexend Deca', monospace;
}

.stat-card .stat-label { font-size: 12px; color: var(--gray-500); margin-top: 2px; }

.deals-table {
  width: 100%; background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border-subtle);
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
}

.deals-table th {
  text-align: left; padding: 12px 16px;
  font-size: 11px; font-weight: 600;
  color: var(--gray-400); text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--gray-100);
  background: var(--gray-50);
}

.deals-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-100);
  font-size: 13px;
}

.deals-table tbody tr:hover { background: var(--gray-50); cursor: pointer; }

.deal-client { display: flex; align-items: center; gap: 10px; }

.deal-avatar {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex-shrink: 0;
}

.deal-client-name { font-weight: 600; color: var(--gray-800); }
.deal-project { font-size: 11px; color: var(--gray-400); }

.score-bar-wrap { display: flex; align-items: center; gap: 8px; }

.score-bar {
  width: 60px; height: 6px;
  background: var(--gray-100);
  border-radius: 3px; overflow: hidden;
}

.score-bar-fill { height: 100%; border-radius: 3px; transition: width 0.3s; }

.score-value { font-size: 13px; font-weight: 700; min-width: 24px; }

.status-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 12px;
  font-size: 11px; font-weight: 600;
}

.status-pill.completed { background: var(--pmax-green-light); color: var(--pmax-green); box-shadow: 0 0 8px rgba(34, 197, 94, 0.15); }
.status-pill.processing { background: var(--pmax-blue-light); color: var(--pmax-blue); box-shadow: 0 0 8px rgba(59, 130, 246, 0.15); }
.status-pill.review { background: var(--pmax-orange-light); color: var(--pmax-orange); box-shadow: 0 0 8px rgba(245, 158, 11, 0.15); }
.status-pill.declined { background: var(--pmax-red-light); color: var(--pmax-red); box-shadow: 0 0 8px rgba(239, 68, 68, 0.15); }

/* ===== FORM STEPPER ===== */
.form-stepper {
  display: flex; align-items: center; gap: 0;
  margin-bottom: 28px; padding: 0 20px;
}

.step-item { display: flex; align-items: center; gap: 8px; white-space: nowrap; }

.step-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
  background: var(--gray-100); color: var(--gray-400); flex-shrink: 0;
}

.step-item.active .step-num { background: var(--pmax-blue); color: white; }
.step-item.done .step-num { background: var(--pmax-green-light); color: var(--pmax-green); }

.step-label { font-size: 13px; font-weight: 500; color: var(--gray-400); }
.step-item.active .step-label { color: var(--pmax-blue); font-weight: 600; }
.step-item.done .step-label { color: var(--pmax-green); }

.step-connector {
  flex: 1; height: 2px;
  background: var(--gray-200);
  margin: 0 12px; min-width: 20px;
}
.step-connector.done { background: var(--pmax-green); }

/* ===== FEEDBACK TAGS ===== */
.feedback-tag {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  background: var(--gray-100);
  color: var(--gray-600);
  cursor: pointer;
}
.feedback-tag.active { background: var(--pmax-blue); color: white; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border-radius: 8px;
  font-weight: 600; font-size: 14px;
  cursor: pointer; border: none;
  transition: all 0.15s; font-family: inherit;
}

.btn-primary { background: var(--pmax-blue); color: white; }
.btn-primary:hover { background: var(--pmax-blue-hover); box-shadow: var(--shadow-md), 0 0 16px rgba(59,130,246,0.25); }

.btn-outline { background: transparent; color: var(--gray-700); border: 1px solid var(--gray-300); }
.btn-outline:hover { background: var(--surface-raised); border-color: var(--gray-400); }

.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== DEAL FORM ===== */
.deal-form-card {
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid var(--border-subtle); padding: 32px;
}

.form-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 24px;
}

.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field.full-width { grid-column: 1 / -1; }

.form-field label {
  font-size: 13px; font-weight: 600; color: var(--gray-600);
}

.form-field .required { color: var(--pmax-red); }

.form-field input,
.form-field select,
.form-field textarea {
  padding: 10px 12px; border: 1px solid var(--gray-300); border-radius: 8px;
  font-size: 14px; font-family: inherit; color: var(--gray-800);
  background: var(--surface-raised); transition: border-color 0.15s;
}

.form-field select option {
  background: var(--surface-raised); color: var(--gray-800);
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none; border-color: var(--pmax-blue); box-shadow: 0 0 0 3px var(--pmax-blue-light);
}

.channel-checkboxes {
  display: flex; flex-wrap: wrap; gap: 12px; margin-top: 4px;
}

.checkbox-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--gray-700); cursor: pointer;
}

.checkbox-label input[type="checkbox"] { accent-color: var(--pmax-blue); }

.form-nav {
  display: flex; justify-content: space-between;
  padding-top: 20px; margin-top: 24px; border-top: 1px solid var(--gray-100);
}

.review-summary {
  margin-top: 16px; font-size: 14px; color: var(--gray-700); line-height: 1.8;
}

.review-summary .review-row {
  display: flex; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--gray-50);
}

.review-summary .review-label {
  font-weight: 600; color: var(--gray-500); min-width: 140px; font-size: 13px;
}

.sse-log {
  background: #010409; border-radius: 8px; padding: 20px 16px 16px;
  font-family: 'JetBrains Mono', 'Courier New', monospace; font-size: 12px;
  max-height: 400px; overflow-y: auto; line-height: 1.8; color: var(--gray-600);
  position: relative; border: 1px solid var(--border-subtle);
}

.sse-log::before {
  content: '● ● ●';
  position: absolute; top: 8px; left: 14px;
  font-size: 8px; letter-spacing: 4px;
  color: rgba(255,255,255,0.15);
}

.sse-log .log-line { padding: 2px 0; }
.sse-log .log-line::before { content: '> '; color: var(--pmax-blue); opacity: 0.5; }
.sse-log .log-complete { color: var(--pmax-green); font-weight: 600; }
.sse-log .log-error { color: var(--pmax-red); font-weight: 600; }

/* ===== PLACEHOLDER CONTENT ===== */
.placeholder-content {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border-subtle);
  padding: 80px 40px;
  text-align: center;
  color: var(--gray-400);
}

.placeholder-icon { font-size: 48px; margin-bottom: 16px; }
.placeholder-title { font-size: 16px; font-weight: 600; color: var(--gray-700); margin-bottom: 8px; }
.placeholder-desc { font-size: 14px; max-width: 400px; margin: 0 auto; }

/* ===== SLIDE-OVER PANEL (Level 4) ===== */
.panel-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 200;
}
.panel-overlay.open { display: block; }

.slide-panel {
  position: fixed;
  top: 0; right: -75vw;
  width: 75vw; max-width: 1200px; min-width: 580px;
  height: 100vh;
  background: var(--surface-solid); z-index: 201;
  box-shadow: var(--shadow-lg);
  transition: right 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex; flex-direction: column;
}
.slide-panel.open { right: 0; }

.panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--gray-100);
}

.panel-header h2 {
  font-size: 18px; font-weight: 700;
  color: var(--gray-900);
  font-family: 'Lexend Deca', sans-serif;
}

.panel-close {
  width: 32px; height: 32px;
  border-radius: 8px;
  border: 1px solid var(--gray-300);
  background: var(--surface-raised);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 16px; color: var(--gray-500);
}
.panel-close:hover { background: var(--gray-50); }

.panel-body { flex: 1; overflow-y: auto; padding: 24px; }

.panel-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.panel-detail-item .detail-label {
  font-size: 11px; font-weight: 600;
  color: var(--gray-400); text-transform: uppercase;
  letter-spacing: 0.3px; margin-bottom: 4px;
}

.panel-detail-item .detail-value { font-size: 14px; color: var(--gray-800); font-weight: 500; }

/* ===== AGENT PULSE ===== */
@keyframes agent-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
  50% { box-shadow: 0 0 0 4px rgba(34, 197, 94, 0); }
}

.nav-item.agent-active .module-icon::after {
  content: '';
  position: absolute;
  bottom: -1px; right: -1px;
  width: 7px; height: 7px;
  background: var(--pmax-green);
  border-radius: 50%;
  border: 1.5px solid var(--surface-solid);
  animation: agent-pulse 2s ease-in-out infinite;
}

.nav-item .module-icon { position: relative; }

/* ===== GLOBAL TRANSITIONS ===== */
a, button, .btn, .nav-item, .module-tab, .metric-card, .module-card, .stat-card, .deal-form-card {
  transition: all 0.2s ease;
}

/* ===== DARK SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.10); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.18); }

::selection { background: rgba(59, 130, 246, 0.3); color: var(--gray-900); }

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
  .pulse-metrics { grid-template-columns: repeat(2, 1fr); }
  .modules-grid { grid-template-columns: repeat(2, 1fr); }
  .module-card.bento-wide { grid-column: span 2; }
  .module-card.bento-tall { grid-row: span 1; }
}

@media (max-width: 768px) {
  .pulse-metrics { grid-template-columns: 1fr; }
  .modules-grid { grid-template-columns: 1fr; }
  .module-card.bento-wide { grid-column: span 1; }
  .activity-section { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .slide-panel { width: 100vw; min-width: 0; right: -100vw; }
  .panel-detail-grid { grid-template-columns: 1fr 1fr; }
}
