/* ============================================================
   TAVEN PARTNER PORTAL — Enterprise Dashboard
   Stripe/Plaid-inspired sidebar layout
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Instrument+Sans:wght@600;700&family=Inter:wght@400;500;600&display=swap');

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

:root {
  /* Brand */
  --depth: #08112A;
  --signal: #00DFC8;
  --signal-dim: #00B5A3;
  --signal-text: #00DFC8;
  --clarity: #16C784;
  --clarity-text: #16C784;
  --cloud: #0A1628;
  --ink: #CBD5E1;
  --muted: #64748B;

  /* Semantic (dark-friendly) */
  --success: #16C784; --success-bg: rgba(22,199,132,0.12); --success-text: #34D399;
  --warning: #F59E0B; --warning-bg: rgba(245,158,11,0.12); --warning-text: #FBBF24;
  --error: #EF4444; --error-bg: rgba(239,68,68,0.12); --error-text: #FCA5A5;
  --info: #3B82F6; --info-bg: rgba(59,130,246,0.12); --info-text: #93C5FD;

  /* Portal surfaces — dark theme */
  --bg-page: #060E22;
  --bg-surface: #0E1938;
  --bg-alt: #0A1628;
  --bg-sidebar: #08112A;
  --bg-sidebar-hover: rgba(255,255,255,0.06);
  --bg-sidebar-active: rgba(0,223,200,0.12);
  --text-primary: #E8ECF4;
  --text-secondary: #CBD5E1;
  --text-tertiary: #64748B;
  --text-sidebar: rgba(255,255,255,0.7);
  --text-sidebar-active: #00DFC8;
  --border: #1E2D50;
  --border-light: #162040;

  /* Fonts */
  --font-display: 'Instrument Sans', 'Neue Haas Grotesk', Arial, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-data: 'DM Mono', 'JetBrains Mono', monospace;

  /* Space */
  --space-1:4px; --space-2:8px; --space-3:12px; --space-4:16px;
  --space-5:20px; --space-6:24px; --space-8:32px; --space-10:40px;
  --space-12:48px; --space-16:64px;

  /* Radius */
  --radius-sm:6px; --radius-md:8px; --radius-lg:12px; --radius-xl:16px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.5);
  --shadow-card: 0 1px 3px rgba(0,0,0,0.3), 0 4px 16px rgba(0,0,0,0.2);

  /* Layout */
  --sidebar-width: 260px;
  --topbar-height: 0px;
}

html { font-size: 16px; scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body { font-family: var(--font-body); color: var(--text-secondary); background: var(--bg-page); line-height: 1.56; }
a { color: var(--signal-text); text-decoration: none; }
h1,h2,h3,h4,h5 { font-family: var(--font-display); color: var(--text-primary); line-height: 1.2; }
.mono { font-family: var(--font-data); font-variant-numeric: tabular-nums; }

/* ── LAYOUT ── */
.portal-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── SIDEBAR ── */
.portal-sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 50;
  overflow-y: auto;
  transition: transform 0.3s ease;
}

.sidebar-brand {
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-brand a {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.sidebar-brand img {
  height: 32px;
}
.sidebar-brand .portal-badge {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--signal);
  background: rgba(0,223,200,0.12);
  padding: 2px 8px;
  border-radius: 4px;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
}
.sidebar-section {
  margin-bottom: 24px;
}
.sidebar-section-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  padding: 0 8px;
  margin-bottom: 8px;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  color: var(--text-sidebar);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s ease;
  text-decoration: none;
  margin-bottom: 2px;
}
.sidebar-link svg {
  width: 18px;
  height: 18px;
  opacity: 0.6;
  flex-shrink: 0;
}
.sidebar-link:hover {
  background: var(--bg-sidebar-hover);
  color: #fff;
}
.sidebar-link:hover svg { opacity: 0.9; }
.sidebar-link.active {
  background: var(--bg-sidebar-active);
  color: var(--text-sidebar-active);
}
.sidebar-link.active svg {
  opacity: 1;
  color: var(--signal);
}

.sidebar-user {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.15);
}
.sidebar-user-info {
  flex: 1;
  min-width: 0;
}
.sidebar-user-name {
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-email {
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-signout {
  background: none;
  border: none;
  color: rgba(255,255,255,0.4);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: color 0.15s;
}
.sidebar-signout:hover { color: var(--error); }

/* ── MAIN CONTENT ── */
.portal-main {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
}
.portal-content {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 32px 24px 80px;
  box-sizing: border-box;
}

/* ── BREADCRUMBS ── */
.portal-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-tertiary);
  margin-bottom: 8px;
}
.portal-breadcrumb a { color: var(--text-tertiary); }
.portal-breadcrumb a:hover { color: var(--signal-text); }
.portal-breadcrumb svg { width: 12px; height: 12px; }

/* ── PAGE HEADER ── */
.portal-page-header {
  margin-bottom: 32px;
}
.portal-page-header h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.portal-page-header p {
  font-size: 15px;
  color: var(--text-tertiary);
  max-width: 640px;
}

/* ── CARDS ── */
.portal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.portal-card h2 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 12px;
}
.portal-card h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
}
.portal-card p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 12px;
}
.portal-card p:last-child { margin-bottom: 0; }

/* ── QUICK ACTIONS ── */
.quick-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.quick-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--signal);
  color: var(--depth, #08112A);
  border-radius: var(--radius-md, 8px);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-display);
  text-decoration: none;
  transition: background 0.15s, transform 0.1s;
  white-space: nowrap;
}
.quick-action-btn:hover { background: var(--signal-dim, #00B5A3); text-decoration: none; transform: translateY(-1px); }
.quick-action-btn.secondary {
  background: var(--bg-alt, #0A1628);
  color: var(--text-primary, #E8ECF4);
  border: 1px solid var(--border, #1E2D50);
}
.quick-action-btn.secondary:hover { border-color: var(--signal); color: var(--signal); }
.quick-action-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ── STAT GRID ── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
}
.stat-card .stat-value {
  font-family: var(--font-data);
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}
.stat-card .stat-value.signal { color: var(--signal-text); }
.stat-card .stat-value.clarity { color: var(--clarity-text); }
.stat-card .stat-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 6px;
}
.stat-card .stat-sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}

/* ── STATUS BADGE ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.badge-live { background: var(--success-bg); color: var(--success-text); }
.badge-beta { background: var(--info-bg); color: var(--info-text); }
.badge-warn { background: var(--warning-bg); color: var(--warning-text); }

/* ── TABLES ── */
.portal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.portal-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  padding: 10px 12px;
  border-bottom: 2px solid var(--border);
  background: var(--bg-page);
}
.portal-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-secondary);
  vertical-align: top;
}
.portal-table tr:hover td {
  background: rgba(0,223,200,0.03);
}
.portal-table code {
  font-family: var(--font-data);
  font-size: 12px;
  background: var(--bg-alt, var(--bg-page));
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--signal);
}

/* ── CODE BLOCKS ── */
.code-block {
  background: #0D1117;
  border-radius: var(--radius-lg);
  padding: 20px;
  overflow-x: auto;
  margin: 16px 0;
  position: relative;
}
.code-block pre {
  font-family: var(--font-data);
  font-size: 13px;
  line-height: 1.6;
  color: #E6EDF3;
  white-space: pre;
  margin: 0;
}
.code-block .code-lang {
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(230,237,243,0.35);
}
.code-block .comment { color: #8B949E; }
.code-block .string { color: #A5D6FF; }
.code-block .keyword { color: #FF7B72; }
.code-block .number { color: #79C0FF; }
.code-block .key { color: #7EE787; }

/* ── ENDPOINT BLOCK ── */
.endpoint {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  font-family: var(--font-data);
  font-size: 14px;
}
.endpoint .method {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.04em;
}
.method-get { background: rgba(59,130,246,0.15); color: #93C5FD; }
.method-post { background: rgba(16,185,129,0.15); color: #6EE7B7; }
.method-put { background: rgba(245,158,11,0.15); color: #FCD34D; }
.method-delete { background: rgba(239,68,68,0.15); color: #FCA5A5; }

/* ── TABS ── */
.portal-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 24px;
}
.portal-tab {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-tertiary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.15s;
  background: none;
  border-left: none;
  border-right: none;
  border-top: none;
}
.portal-tab:hover { color: var(--text-primary); }
.portal-tab.active {
  color: var(--signal-text);
  border-bottom-color: var(--signal);
}

/* ── CONTENT SECTIONS ── */
.portal-section {
  margin-bottom: 40px;
}
.portal-section h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
}
.portal-section h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  margin-top: 24px;
}
.portal-section p {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 12px;
}
.portal-section ul, .portal-section ol {
  margin: 0 0 16px 0;
  padding-left: 24px;
}
.portal-section li {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 4px;
}

/* ── CALLOUT ── */
.callout {
  padding: 16px 20px;
  border-radius: var(--radius-md);
  margin: 16px 0;
  font-size: 13px;
  line-height: 1.6;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.callout svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.callout-info { background: var(--info-bg); border-left: 3px solid var(--info); color: var(--info-text); }
.callout-warn { background: var(--warning-bg); border-left: 3px solid var(--warning); color: var(--warning-text); }
.callout-success { background: var(--success-bg); border-left: 3px solid var(--success); color: var(--success-text); }

/* ── PIPELINE DIAGRAM ── */
.pipeline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 24px 0;
}
.pipeline-step {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  text-align: center;
  min-width: 120px;
}
.pipeline-step .step-num {
  font-family: var(--font-data);
  font-size: 11px;
  color: var(--signal-text);
  font-weight: 700;
}
.pipeline-step .step-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 2px;
}
.pipeline-arrow {
  color: var(--muted);
  font-size: 18px;
  flex-shrink: 0;
}

/* ── QUALITY TIER ── */
.tier-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin: 16px 0;
}
.tier-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  background: var(--bg-surface);
}
.tier-card .tier-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
}
.tier-a .tier-badge { color: var(--success-text); }
.tier-b .tier-badge { color: var(--info-text); }
.tier-c .tier-badge { color: var(--warning-text); }
.tier-card p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

/* ── LOADING SKELETON ── */
.skeleton {
  background: linear-gradient(90deg, #1E2D50 25%, #243656 50%, #1E2D50 75%);
  background-size: 200% 100%;
  animation: skeleton-pulse 1.5s infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeleton-pulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── LOGIN PAGE ── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--depth);
  position: relative;
  overflow: hidden;
}
.login-page::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(0,223,200,0.08) 0%, transparent 70%);
  top: -200px; right: -100px;
}
.login-page::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(22,199,132,0.06) 0%, transparent 70%);
  bottom: -100px; left: -50px;
}
.login-card {
  background: #0E1938;
  border: 1px solid #1E2D50;
  border-radius: var(--radius-xl);
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.4);
  position: relative;
  z-index: 1;
  text-align: center;
}
.login-card img.login-logo {
  height: 36px;
  margin: 0 auto 8px;
}
.login-card .login-badge {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--signal);
  margin-bottom: 32px;
}
.login-card h1 {
  font-size: 24px;
  margin-bottom: 8px;
}
.login-card .login-subtitle {
  font-size: 14px;
  color: var(--text-tertiary);
  margin-bottom: 32px;
  line-height: 1.5;
}

.login-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-alt, #0A1628);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  margin-bottom: 12px;
}
.login-btn:hover {
  background: var(--bg-surface);
  border-color: var(--signal);
  box-shadow: 0 0 0 3px rgba(0,223,200,0.1);
}
.login-btn svg { width: 20px; height: 20px; }

.login-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
  font-size: 12px;
  color: var(--text-tertiary);
}
.login-divider::before, .login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.login-footer {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 24px;
  line-height: 1.5;
}
.login-footer a {
  color: var(--signal-text);
}

/* ── QUICK LINKS GRID ── */
.quick-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin: 16px 0;
}
.quick-link {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  transition: all 0.2s ease;
}
.quick-link:hover {
  border-color: var(--signal);
  box-shadow: 0 4px 12px rgba(0,223,200,0.08);
  transform: translateY(-1px);
}
.quick-link .ql-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.quick-link .ql-icon svg { width: 18px; height: 18px; }
.ql-icon-blue { background: var(--info-bg); color: var(--info-text); }
.ql-icon-green { background: var(--success-bg); color: var(--success-text); }
.ql-icon-amber { background: var(--warning-bg); color: var(--warning-text); }
.ql-icon-purple { background: rgba(124,58,237,0.12); color: #A78BFA; }
.quick-link .ql-text h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}
.quick-link .ql-text p {
  font-size: 12px;
  color: var(--text-tertiary);
  margin: 0;
  line-height: 1.4;
}

/* ── MOBILE ── */
.mobile-header {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  background: var(--depth);
  z-index: 49;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}
.mobile-header img { height: 28px; }
.mobile-header button {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 8px;
}
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 49;
}

@media (max-width: 768px) {
  .mobile-header { display: flex; }
  .portal-sidebar {
    transform: translateX(-100%);
    z-index: 50;
  }
  .portal-sidebar.open { transform: translateX(0); }
  .sidebar-overlay.open { display: block; }
  .portal-main {
    margin-left: 0;
    padding-top: 56px;
  }
  .portal-content {
    padding: 16px 12px 60px;
  }
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .stat-card { padding: 14px 10px; }
  .stat-card .stat-value { font-size: 18px; }
  .stat-card .stat-label { font-size: 10px; }
  .stat-card .stat-sub { font-size: 9px; }
  /* Hide AI command bar on mobile */
  .ai-bar-inline { display: none !important; }
  .portal-topbar .ai-bar-inline { display: none !important; }
  .welcome-banner h1 { font-size: 20px !important; }
  .welcome-banner p { font-size: 13px; }
  .quick-actions { flex-direction: column; }
  .quick-links { grid-template-columns: 1fr !important; }
  .pipeline {
    flex-direction: column;
    align-items: stretch;
  }
  .pipeline-arrow {
    transform: rotate(90deg);
    text-align: center;
  }
}
@media (max-width: 400px) {
  .stat-grid { grid-template-columns: 1fr; }
  .stat-card .stat-value { font-size: 24px; }
}

/* ── PROGRESS BAR ── */
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin: 8px 0;
}
.progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease;
}
.progress-fill.green { background: var(--clarity); }
.progress-fill.signal { background: var(--signal); }
.progress-fill.blue { background: #3B82F6; }

/* ── COPY BUTTON ── */
.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255,255,255,0.1);
  border: none;
  border-radius: 4px;
  padding: 4px 8px;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  font-size: 11px;
  font-family: var(--font-body);
  transition: all 0.15s;
}
.copy-btn:hover { background: rgba(255,255,255,0.2); color: #fff; }
.copy-btn.copied { color: var(--signal); }

/* ── LIST ITEMS WITH ICONS ── */
.icon-list {
  list-style: none;
  padding: 0;
  margin: 12px 0;
}
.icon-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 6px 0;
  font-size: 14px;
}
.icon-list li svg {
  width: 16px;
  height: 16px;
  color: var(--signal-text);
  flex-shrink: 0;
  margin-top: 3px;
}

/* ── ANCHOR LINKS ── */
.anchor-link {
  color: var(--text-tertiary);
  text-decoration: none;
  margin-left: 6px;
  opacity: 0;
  transition: opacity 0.15s;
}
h2:hover .anchor-link,
h3:hover .anchor-link { opacity: 1; }

/* ── V2 WORKSPACE SHELL — TOPBAR ── */
.portal-topbar {
  height: var(--topbar-height);
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 40;
}
.topbar-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 8px;
}
.topbar-logo-mobile {
  display: none;
  height: 24px;
}
@media (max-width: 768px) {
  .topbar-menu-btn { display: flex; }
  .topbar-logo-mobile { display: block; }
}
.topbar-tenant-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--signal-text);
  background: rgba(0,223,200,0.1);
  padding: 4px 10px;
  border-radius: 12px;
}

/* ── AI COMMAND BAR ── */
.ai-bar-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 6px 12px;
  max-width: 420px;
  flex: 1;
}
.ai-bar-input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 13px;
  font-family: var(--font-body);
  outline: none;
}
.ai-bar-input::placeholder { color: var(--text-tertiary); }

/* ── AI MODAL ── */
.ai-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
}
.ai-modal-content {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 560px;
  padding: 24px;
  box-shadow: var(--shadow-lg);
}

/* ── AI RESULTS PANEL ── */
.ai-results-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 420px;
  background: var(--bg-surface);
  border-left: 1px solid var(--border);
  z-index: 90;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}
.ai-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

/* ── AI LOADING ── */
.ai-loading-dots {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.ai-loading-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--signal);
  animation: ai-dot-pulse 1.4s ease-in-out infinite;
}
.ai-loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.ai-loading-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes ai-dot-pulse {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1); }
}

/* ── AI FEEDBACK ── */
.ai-feedback-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-top: 1px solid var(--border-light);
  margin-top: 12px;
}
.ai-feedback-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  cursor: pointer;
  color: var(--text-tertiary);
  font-size: 13px;
  transition: all 0.15s;
}
.ai-feedback-btn:hover { border-color: var(--signal); color: var(--signal-text); }
.ai-feedback-btn.selected { background: rgba(0,223,200,0.12); border-color: var(--signal); color: var(--signal-text); }
.ai-feedback-thanks {
  font-size: 12px;
  color: var(--success-text);
}

/* ── WELCOME BANNER ── */
.welcome-banner {
  margin-bottom: 24px;
}
.welcome-banner h1 {
  font-size: 28px;
  font-weight: 700;
}
.welcome-banner p {
  color: var(--text-tertiary);
  font-size: 15px;
}

/* ── DATA FRESHNESS ── */
.freshness-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}
.freshness-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.freshness-dot.fresh { background: var(--success); }
.freshness-dot.stale { background: var(--warning); }
.freshness-dot.error { background: var(--error); }

/* ── BENCHMARK EXPLORER ── */
.benchmark-search-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.benchmark-filter {
  padding: 8px 14px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 13px;
  font-family: var(--font-body);
}
.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 120px;
  padding: 12px 0;
}
.chart-bars .bar {
  flex: 1;
  background: var(--signal);
  border-radius: 3px 3px 0 0;
  min-width: 12px;
  transition: height 0.3s ease;
}

/* ── PROVIDER SEARCH ── */
.provider-search-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  font-family: var(--font-body);
}
.provider-search-input:focus { border-color: var(--signal); outline: none; }
.provider-autocomplete {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  max-height: 240px;
  overflow-y: auto;
}
.provider-result-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: border-color 0.15s;
}
.provider-result-card:hover { border-color: var(--signal); }

/* ── PROVIDER PROFILE ── */
.provider-profile-header {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 24px;
}
.provider-profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

/* ── TRUST PANEL ── */
.trust-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.trust-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--border-light);
}
.trust-item:last-child { border-bottom: none; }

/* ── TRUST CENTER ── */
.trust-sources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
.trust-source-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.trust-source-card h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}

/* ── TIER BADGES ── */
.tier-badge-a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--success-bg);
  color: var(--success-text);
}
.tier-badge-b {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--info-bg);
  color: var(--info-text);
}
.tier-badge-c {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--warning-bg);
  color: var(--warning-text);
}

/* ── PAGINATION ── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 20px;
}
.pagination button {
  min-width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}
.pagination button:hover { border-color: var(--signal); color: var(--signal-text); }
.pagination button.active { background: var(--signal); color: var(--depth); border-color: var(--signal); }

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-tertiary);
}
.empty-state svg { width: 48px; height: 48px; margin-bottom: 12px; opacity: 0.4; }
.empty-state h3 { font-size: 16px; margin-bottom: 6px; color: var(--text-secondary); }
.empty-state p { font-size: 13px; max-width: 360px; margin: 0 auto; }

/* ── EXPORT BUTTON ── */
.btn-export {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-export:hover { border-color: var(--signal); color: var(--signal-text); }
.btn-export svg { width: 14px; height: 14px; }

/* ── DISABLED SIDEBAR LINK ── */
.sidebar-link.disabled {
  opacity: 0.4;
  pointer-events: none;
  cursor: not-allowed;
}

/* ── SCREEN READER ONLY ── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ── ALERT CENTER ── */
.alert-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.alert-card-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  background: var(--info-bg);
  flex-shrink: 0;
}
.alert-card-icon.threshold { background: var(--warning-bg); }
.alert-card-icon.anomaly { background: var(--error-bg); }
.alert-card-icon.change { background: var(--info-bg); }
.alert-card-icon.market_movement { background: rgba(124,58,237,0.12); color: #A78BFA; }
.alert-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  color: var(--text-tertiary);
  cursor: pointer;
  font-size: 12px;
  transition: all 0.15s;
}
.alert-toggle:hover { border-color: var(--signal); color: var(--signal-text); }

.alert-form {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.alert-form-full {
  max-width: 640px;
}

.alert-history-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
}
.alert-history-item:last-child { border-bottom: none; }
.alert-history-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
}

.alert-bulk-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}
.alert-bulk-btn {
  padding: 6px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.alert-bulk-btn:hover { border-color: var(--signal); color: var(--signal-text); }
.alert-bulk-count {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-left: auto;
}

.alert-filter-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.alert-sparkline {
  display: inline-block;
  vertical-align: middle;
}
.alert-sparkline-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.alert-email-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 8px;
  background: var(--info-bg);
  color: var(--info-text);
}

.alert-section-heading {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 20px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-light);
}

.alert-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
}
.alert-checkbox-label input[type="checkbox"] {
  accent-color: var(--signal);
}

/* ── TREND INDICATORS ── */
.trend-up { color: var(--success-text); }
.trend-down { color: var(--error-text); }
.trend-stable { color: var(--text-tertiary); }

/* ── DETECTION DETAIL ── */
.detection-detail {
  font-size: 12px;
  color: var(--text-tertiary);
  font-family: var(--font-data);
  padding: 4px 8px;
  background: var(--bg-alt);
  border-radius: var(--radius-sm);
  display: inline-block;
}

/* ── REPORT STUDIO ── */
.report-editor {
  max-width: 800px;
  margin: 0 auto;
}
.report-block {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
  position: relative;
}
.report-block:hover { border-color: var(--border); box-shadow: var(--shadow-sm); }
.report-block-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  position: absolute;
  top: 8px;
  right: 8px;
  opacity: 0;
  transition: opacity 0.15s;
}
.report-block:hover .report-block-toolbar { opacity: 1; }

.report-block-type-picker {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.report-block-type-btn {
  padding: 8px 16px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}
.report-block-type-btn:hover { border-color: var(--signal); color: var(--signal-text); }
.report-block-type-btn.active { background: rgba(0,223,200,0.12); border-color: var(--signal); color: var(--signal-text); }

.report-add-block {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  color: var(--text-tertiary);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}
.report-add-block:hover { border-color: var(--signal); color: var(--signal-text); }

.report-list-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.report-list-card:hover { border-color: var(--signal); }
.report-status-badge {
  display: inline-flex;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.report-status-draft { background: var(--warning-bg); color: var(--warning-text); }
.report-status-published { background: var(--success-bg); color: var(--success-text); }
