*, *::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: 22px; height: 22px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; 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; }

/* Favorites star button */
.fav-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  color: var(--gray-300);
  padding: 0 2px;
  line-height: 1;
  flex-shrink: 0;
  transition: color 0.15s;
}
.nav-item:hover .fav-btn { display: inline-flex; }
.fav-btn.starred { display: inline-flex; color: var(--pmax-orange); }
.fav-btn:hover { color: var(--pmax-orange); }
.sidebar.collapsed .fav-btn { display: none !important; }

/* Favorites section */
.nav-group-favorites { margin-top: 0; }
.nav-group-favorites .nav-group-header {
  padding: 6px 12px 2px;
}
.nav-group-favorites .nav-group-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--pmax-orange);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.nav-group-favorites + .nav-group {
  border-top: 1px solid var(--gray-100);
  padding-top: 4px;
}

/* Sidebar overflow threshold */
.nav-overflow { display: none; }
.nav-group-items.expanded .nav-overflow { display: flex; }
.nav-show-more {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-400);
  padding: 6px 12px;
  text-align: left;
  transition: color 0.15s;
}
.nav-show-more:hover { color: var(--pmax-blue); }
.sidebar.collapsed .nav-show-more { 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;
}

/* Cmd+K Modal */
.cmdk-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0, 0, 0, 0.5);
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 20vh;
  backdrop-filter: blur(4px);
}
.cmdk-modal {
  background: var(--surface); border: 1px solid var(--border-subtle);
  border-radius: 14px; width: 520px; max-height: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  overflow: hidden; display: flex; flex-direction: column;
}
.cmdk-input-row {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px; border-bottom: 1px solid var(--border-subtle);
}
.cmdk-search-icon { font-size: 16px; color: var(--gray-400); }
.cmdk-input {
  flex: 1; background: none; border: none; outline: none;
  font-size: 15px; font-family: inherit; color: var(--text-primary);
}
.cmdk-input::placeholder { color: var(--gray-400); }
.cmdk-esc {
  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: 2px 6px;
}
.cmdk-results {
  overflow-y: auto; padding: 8px;
  flex: 1;
}
.cmdk-result {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 8px; cursor: pointer;
  transition: background 0.1s;
}
.cmdk-result:hover, .cmdk-result.active { background: var(--gray-100); }
.cmdk-result-icon {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.cmdk-result-text { flex: 1; min-width: 0; }
.cmdk-result-name { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.cmdk-result-desc { font-size: 12px; color: var(--gray-400); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmdk-result-badge {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  color: var(--gray-400); background: var(--gray-100);
  padding: 2px 8px; border-radius: 4px; flex-shrink: 0;
}
.cmdk-result-key {
  font-size: 11px; color: var(--gray-300); flex-shrink: 0;
}
.cmdk-empty {
  text-align: center; padding: 32px 16px; color: var(--gray-400); font-size: 13px;
}
.cmdk-section-label {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--gray-400); padding: 8px 12px 4px;
}

.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="ec-agent"] { box-shadow: inset 2px 0 0 var(--pmax-orange); }
.module-card[data-agent="media-planning"] { box-shadow: inset 2px 0 0 var(--pmax-teal); }

.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); }
.module-card[data-agent="ec-agent"]:hover { box-shadow: inset 2px 0 0 var(--pmax-orange), 0 0 20px rgba(245,158,11,0.06); }
.module-card[data-agent="media-planning"]:hover { box-shadow: inset 2px 0 0 var(--pmax-teal), 0 0 20px rgba(20,184,166,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); }

/* Usage Dashboard */
.usage-dashboard {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border-subtle);
  padding: 20px 24px;
  margin-bottom: 36px;
}

.usage-totals {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.usage-stat {
  text-align: center;
  padding: 12px 0;
}

.usage-stat-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--gray-800);
  font-variant-numeric: tabular-nums;
}

.usage-stat-label {
  font-size: 11px;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-top: 4px;
}

.usage-breakdown {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 20px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 16px;
}

.usage-agents {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.usage-agent-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.usage-agent-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.usage-agent-name {
  flex: 1;
  color: var(--gray-600);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.usage-agent-tokens {
  font-weight: 600;
  color: var(--gray-800);
  font-variant-numeric: tabular-nums;
}

.usage-chart-wrap {
  position: relative;
  min-height: 120px;
}

/* 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;
}
.list-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.list-header .stats-row { margin-bottom: 0; flex: 1; }
.refresh-btn {
  background: var(--glass-bg); border: 1px solid var(--glass-border); color: var(--gray-400);
  border-radius: 8px; padding: 6px 12px; cursor: pointer; font-size: 13px; display: flex; align-items: center; gap: 6px;
  transition: all 0.2s; margin-left: 12px; white-space: nowrap;
}
.refresh-btn:hover { color: var(--pmax-blue); border-color: var(--pmax-blue); background: rgba(59,130,246,0.08); }
.refresh-btn.spinning svg { animation: spin 0.8s linear infinite; }

/* Iframe dashboard fallback banner */
.iframe-fallback {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; margin-bottom: 12px;
  background: rgba(59, 130, 246, 0.08); border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 8px; font-size: 13px; color: var(--gray-700);
}
.iframe-fallback-icon { flex-shrink: 0; color: var(--pmax-blue); }
.iframe-fallback-text { flex: 1; color: var(--gray-700); }
.iframe-fallback-text strong { color: var(--gray-900); font-weight: 600; }
.iframe-fallback-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 12px; background: var(--pmax-blue); color: white;
  border-radius: 6px; text-decoration: none; font-weight: 500; font-size: 12px;
  white-space: nowrap; transition: all 0.2s;
}
.iframe-fallback-btn:hover { background: #2563EB; color: white; }
.iframe-fallback-dismiss {
  background: transparent; border: none; color: var(--gray-500); cursor: pointer;
  padding: 4px 8px; border-radius: 4px; font-size: 18px; line-height: 1;
}
.iframe-fallback-dismiss:hover { background: rgba(255,255,255,0.05); color: var(--gray-800); }

/* Email-agent composer card */
.email-agent-card {
  max-width: 760px;
  margin: 24px auto;
  padding: 32px 36px;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
}
.email-agent-header {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 20px;
}
.email-agent-icon {
  font-size: 40px; line-height: 1;
  filter: drop-shadow(0 2px 8px rgba(59,130,246,0.25));
}
.email-agent-title {
  font-size: 22px; font-weight: 700; color: var(--gray-900);
  margin: 0;
}
.email-agent-subtitle {
  font-size: 13.5px; color: var(--gray-600);
  margin-top: 4px; line-height: 1.5;
}
.email-agent-meta {
  display: flex; flex-wrap: wrap; gap: 18px 28px;
  padding: 12px 16px; margin-bottom: 20px;
  background: rgba(59, 130, 246, 0.06);
  border: 1px solid rgba(59, 130, 246, 0.18);
  border-radius: 10px;
  font-size: 12.5px;
}
.email-agent-meta-label {
  color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.04em;
  font-size: 11px; font-weight: 600; margin-right: 8px;
}
.email-agent-meta-value {
  color: var(--gray-800); font-weight: 500;
}
.email-agent-guidelines {
  padding: 14px 18px; margin-bottom: 16px;
  background: rgba(20, 184, 166, 0.08);
  border-left: 3px solid var(--pmax-teal, #14B8A6);
  border-radius: 8px;
}
.email-agent-guidelines-title {
  font-size: 13px; font-weight: 600; color: var(--gray-800);
  margin-bottom: 6px;
}
.email-agent-guidelines ul {
  margin: 0; padding-left: 22px;
  font-size: 13px; color: var(--gray-700); line-height: 1.65;
}
.email-agent-deliverables {
  padding: 10px 14px; margin-bottom: 20px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed var(--border-subtle);
  border-radius: 8px;
  font-size: 12.5px; color: var(--gray-600); line-height: 1.5;
}
.email-agent-deliverables strong { color: var(--gray-800); font-weight: 600; }
.email-agent-form { display: flex; flex-direction: column; gap: 16px; }
.email-agent-form label { display: block; }
.email-agent-label {
  display: block; font-size: 12.5px; font-weight: 600;
  color: var(--gray-700); margin-bottom: 6px;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.email-agent-subject-row {
  display: flex; align-items: stretch;
  border: 1px solid var(--border-subtle); border-radius: 8px;
  background: var(--surface-alt, rgba(255,255,255,0.02));
  overflow: hidden;
  transition: border-color 0.2s;
}
.email-agent-subject-row:focus-within { border-color: var(--pmax-blue); }
.email-agent-subject-prefix {
  padding: 11px 14px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--gray-600);
  font-size: 13.5px;
  white-space: nowrap;
  border-right: 1px solid var(--border-subtle);
}
.email-agent-subject {
  flex: 1; border: none; outline: none; background: transparent;
  padding: 11px 14px; font-size: 13.5px; color: var(--gray-900);
}
.email-agent-body {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-alt, rgba(255,255,255,0.02));
  font-size: 13.5px; font-family: inherit; color: var(--gray-900);
  line-height: 1.55; resize: vertical;
  transition: border-color 0.2s;
}
.email-agent-body:focus { outline: none; border-color: var(--pmax-blue); }
.email-agent-actions {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.email-agent-send-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px;
  background: var(--pmax-blue); color: white;
  border: none; border-radius: 10px; cursor: pointer;
  font-weight: 600; font-size: 14px;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(59,130,246,0.35);
}
.email-agent-send-btn:hover {
  background: #2563EB;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59,130,246,0.45);
}
.email-agent-secondary-btn {
  padding: 11px 16px;
  background: transparent; color: var(--gray-700);
  border: 1px solid var(--border-subtle); border-radius: 10px;
  font-size: 13px; font-weight: 500; cursor: pointer;
  transition: all 0.15s;
}
.email-agent-secondary-btn:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--gray-500); color: var(--gray-900);
}
.email-agent-hint {
  font-size: 12px; color: var(--gray-500);
  line-height: 1.5;
}
.email-agent-hint strong { color: var(--gray-700); font-weight: 600; }

/* Inline link pill — used in agent list/panel views to surface deliverable links */
.link-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px;
  background: rgba(59, 130, 246, 0.10);
  color: var(--pmax-blue);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 999px;
  font-size: 11.5px; font-weight: 500;
  text-decoration: none;
  transition: all 0.15s;
}
.link-pill:hover {
  background: rgba(59, 130, 246, 0.18);
  border-color: rgba(59, 130, 246, 0.5);
}

/* When a launch card is rendered, hide any pre-existing module content
   (tabs, page-header, iframe, etc.) so the card is the sole focus. */
.embed-launch-hidden { display: none !important; }

/* Embed launch card — shown when iframe is blocked or fails to load */
.embed-launch-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  margin: 40px auto;
  padding: 48px 40px;
  max-width: 520px;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.18);
}
.embed-launch-icon {
  font-size: 56px;
  line-height: 1;
  margin-bottom: 16px;
  filter: drop-shadow(0 2px 8px rgba(59,130,246,0.25));
}
.embed-launch-title {
  font-size: 22px; font-weight: 700; color: var(--gray-900);
  margin: 0 0 8px;
}
.embed-launch-desc {
  font-size: 14px; color: var(--gray-600);
  margin: 0 0 20px; line-height: 1.5;
}
.embed-launch-reason {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 10px 14px; margin-bottom: 24px;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.20);
  border-radius: 8px;
  font-size: 12.5px; line-height: 1.5; color: var(--gray-700);
  text-align: left;
}
.embed-launch-reason svg { color: var(--pmax-blue); }
.embed-launch-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px;
  background: var(--pmax-blue); color: white;
  border-radius: 10px; text-decoration: none;
  font-weight: 600; font-size: 14px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(59,130,246,0.35);
}
.embed-launch-btn:hover {
  background: #2563EB; color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59,130,246,0.45);
}
.embed-launch-hint {
  margin-top: 14px;
  font-size: 11.5px; color: var(--gray-500);
}

/* Loading overlay shown while iframe is fetching (up to 15s) */
.embed-loading-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px;
  background: var(--gray-100);
  border-radius: 12px;
  pointer-events: auto;
  z-index: 5;
}
.embed-loading-spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border-subtle);
  border-top-color: var(--pmax-blue);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
.embed-loading-text {
  font-size: 15px; font-weight: 600; color: var(--gray-800);
}
.embed-loading-sub {
  font-size: 12.5px; color: var(--gray-600);
  text-align: center; max-width: 360px;
}
.embed-loading-link {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 8px 16px; margin-top: 4px;
  background: transparent; color: var(--pmax-blue);
  border: 1px solid rgba(59,130,246,0.4); border-radius: 8px;
  text-decoration: none; font-size: 12.5px; font-weight: 500;
  transition: all 0.2s;
}
.embed-loading-link:hover {
  background: rgba(59,130,246,0.08);
  border-color: var(--pmax-blue);
}

@keyframes spin { to { transform: rotate(360deg); } }

.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; }

/* SSE Status Bar */
.sse-status-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; margin-bottom: 8px;
  background: var(--surface); border: 1px solid var(--border-subtle);
  border-radius: 8px; font-size: 12px; font-family: 'Inter', sans-serif;
}
.sse-status-left { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.sse-status-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.sse-status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--pmax-blue); animation: sse-pulse 1.5s ease-in-out infinite;
  flex-shrink: 0;
}
.sse-status-dot.done { background: var(--pmax-green); animation: none; }
.sse-status-dot.error { background: var(--pmax-red); animation: none; }
.sse-status-dot.stopped { background: var(--gray-400); animation: none; }
@keyframes sse-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
.sse-step-label {
  color: var(--gray-600); overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; max-width: 400px;
}
.sse-elapsed {
  color: var(--gray-500); font-family: 'JetBrains Mono', monospace;
  font-size: 11px; min-width: 36px; text-align: right;
}
.btn-stop {
  background: transparent; border: 1px solid var(--pmax-red);
  color: var(--pmax-red); padding: 3px 10px; border-radius: 4px;
  font-size: 11px; cursor: pointer; font-weight: 600;
  transition: background 0.15s, color 0.15s;
}
.btn-stop:hover { background: var(--pmax-red); color: #fff; }
.btn-stop:disabled { opacity: 0.4; cursor: default; background: transparent; color: var(--gray-400); border-color: var(--gray-300); }

/* File Upload Area */
.file-upload-area {
  border: 2px dashed var(--border-subtle); border-radius: 8px;
  padding: 20px; text-align: center; cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.file-upload-area:hover, .file-upload-area.dragover {
  border-color: var(--pmax-blue); background: rgba(0,123,255,0.04);
}

/* ===== SHARE TAGS INPUT ===== */
.share-tags-input {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  border: 1px solid var(--border-subtle); border-radius: 8px;
  padding: 6px 10px; min-height: 40px; background: var(--surface);
}
.share-tags-input input {
  border: none; outline: none; flex: 1; min-width: 180px;
  font-size: 13px; font-family: inherit; background: transparent;
  color: var(--text-primary); padding: 4px 0;
}
.share-tags-input input::placeholder { color: var(--text-muted); }
.share-tag-pill {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--pmax-blue-light, rgba(59,130,246,0.1)); color: var(--pmax-blue);
  font-size: 12px; font-weight: 500; padding: 3px 8px; border-radius: 12px;
}
.share-tag-pill button {
  background: none; border: none; color: inherit; cursor: pointer;
  font-size: 14px; line-height: 1; padding: 0 2px; opacity: 0.7;
}
.share-tag-pill button:hover { opacity: 1; }

/* Share list in panels */
.share-list-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; padding: 6px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.share-list-row span:first-child { flex: 1; color: var(--text-primary); }
.share-remove-btn {
  background: none; border: none; color: var(--gray-400); cursor: pointer;
  font-size: 14px; padding: 0 4px;
}
.share-remove-btn:hover { color: var(--pmax-red); }

/* ===== 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; }

/* ===== DO Panel Redesign ===== */
.do-panel-banner {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; border-radius: 10px; margin-bottom: 20px;
}
.do-panel-section {
  margin-bottom: 20px;
}
.do-panel-section.collapsed .do-section-body { display: none; }
.do-panel-section.collapsed .do-toggle-arrow { transform: rotate(-90deg); }
.do-section-title {
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--gray-500);
  margin-bottom: 10px; display: flex; align-items: center; gap: 6px;
}
.do-section-toggle { cursor: pointer; user-select: none; }
.do-section-toggle:hover { color: var(--gray-700); }
.do-toggle-arrow { font-size: 10px; margin-left: auto; transition: transform 0.2s; }
.do-panel-error {
  font-size: 13px; color: var(--pmax-red); background: var(--pmax-red-light);
  padding: 14px 16px; border-radius: 8px; border-left: 3px solid var(--pmax-red);
}
.do-stats-row {
  display: flex; gap: 2px; flex-wrap: wrap;
}
.do-stat {
  flex: 1; min-width: 100px; background: var(--gray-50); border-radius: 8px;
  padding: 10px 12px; text-align: center;
}
.do-stat-val { font-size: 13px; font-weight: 600; color: var(--gray-800); }
.do-stat-lbl { font-size: 10px; font-weight: 600; color: var(--gray-400); text-transform: uppercase; margin-top: 2px; }
.do-files-grid { display: flex; flex-direction: column; gap: 6px; }
.do-file-card {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 8px; background: var(--gray-50);
  text-decoration: none; transition: background 0.15s;
  border: 1px solid transparent;
}
.do-file-card:hover { background: var(--pmax-blue-light); border-color: var(--pmax-blue); }
.do-file-card.disabled { opacity: 0.5; pointer-events: none; }
.do-file-icon { font-size: 20px; }
.do-file-info { flex: 1; min-width: 0; }
.do-file-name { font-size: 13px; font-weight: 600; color: var(--gray-800); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.do-file-agent { font-size: 11px; color: var(--gray-400); }
.do-file-open { font-size: 14px; color: var(--pmax-blue); }
.do-agent-card {
  border-radius: 8px; background: var(--gray-50); padding: 12px;
}
.do-agent-header {
  display: flex; align-items: center; gap: 8px;
}
.do-agent-text {
  font-size: 12px; color: var(--gray-500); line-height: 1.5;
  white-space: pre-wrap; margin-top: 8px;
}
.do-expand-btn {
  background: none; border: none; cursor: pointer;
  font-size: 12px; font-weight: 500; color: var(--pmax-blue);
  padding: 4px 0; margin-top: 4px;
}
.do-expand-btn:hover { text-decoration: underline; }
.do-eval-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; padding: 8px 12px; border-radius: 6px; background: var(--gray-50);
}

/* ===== 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; }
}
