/* Citizens Bank Brand Design System */
:root {
  /* Primary Citizens Bank Green */
  --citizens-green: #00754A;
  --citizens-green-dark: #005C3A;
  --citizens-green-darker: #00432A;
  --citizens-green-light: #009A44;
  --citizens-green-lighter: #E6F2EC;
  --citizens-green-pale: #F4FAF6;

  /* Neutrals */
  --gray-50: #F8FAFC;
  --gray-100: #F1F5F9;
  --gray-200: #E2E8F0;
  --gray-300: #CBD5E1;
  --gray-400: #94A3B8;
  --gray-500: #64748B;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1E293B;
  --gray-900: #0F172A;

  /* Status colors */
  --success: #10B981;
  --warning: #F59E0B;
  --error: #EF4444;
  --info: #3B82F6;
  --purple: #8B5CF6;

  /* Surfaces */
  --bg: #F4F6F8;
  --surface: #FFFFFF;
  --border: #E5E7EB;

  /* Typography */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --font-heading: 'Inter', -apple-system, sans-serif;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.06), 0 1px 2px 0 rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.03);

  /* Radius */
  --r-sm: 6px;
  --r: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
}

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

html, body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--gray-800);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--citizens-green); text-decoration: none; }
a:hover { text-decoration: underline; }

a.btn, a.btn-logout, a.btn-new-verification, a.btn-on-dark,
a.btn:hover, a.btn-logout:hover, a.btn-new-verification:hover, a.btn-on-dark:hover {
  text-decoration: none;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* ===== App Shell ===== */
.app {
  display: grid;
  grid-template-columns: 248px 1fr;
  min-height: 100vh;
}

/* ===== Sidebar ===== */
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-logo {
  padding: 4px 8px 20px;
  border-bottom: 1px solid var(--gray-100);
}
.sidebar-logo img { height: 28px; width: auto; display: block; }

.btn-new-verification {
  margin: 16px 0;
  background: var(--citizens-green);
  color: #fff;
  padding: 10px 14px;
  border-radius: var(--r);
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.15s;
  width: 100%;
}
.btn-new-verification:hover { background: var(--citizens-green-dark); }

.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gray-400);
  padding: 16px 12px 8px;
  font-weight: 600;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  color: var(--gray-600);
  font-weight: 500;
  font-size: 13.5px;
  transition: all 0.15s;
  text-decoration: none;
}
.nav-item:hover { background: var(--gray-50); color: var(--gray-800); text-decoration: none; }
.nav-item.active {
  background: var(--citizens-green);
  color: #fff;
}
.nav-item .nav-icon { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.9; }
.nav-item .nav-badge {
  margin-left: auto;
  background: rgba(255,255,255,0.2);
  color: #fff;
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 10px;
  font-weight: 600;
}
.nav-item:not(.active) .nav-badge {
  background: var(--citizens-green-lighter);
  color: var(--citizens-green-dark);
}

.sidebar-user {
  border-top: 1px solid var(--gray-100);
  padding-top: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--citizens-green-lighter);
  color: var(--citizens-green-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
}
.user-info { flex: 1; min-width: 0; }
.user-name { font-weight: 600; font-size: 13px; color: var(--gray-800); }
.user-role { font-size: 12px; color: var(--gray-500); }
.btn-logout {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  color: var(--gray-500);
  font-size: 13px;
  margin-top: 6px;
  border-radius: var(--r-sm);
}
.btn-logout:hover { background: var(--gray-50); color: var(--gray-800); }

/* ===== Main Content ===== */
.main { display: flex; flex-direction: column; min-width: 0; }

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 18px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-title h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -0.01em;
}
.breadcrumb {
  font-size: 13px;
  color: var(--gray-500);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.breadcrumb a { color: var(--citizens-green); }
.breadcrumb .sep { color: var(--gray-300); }
.breadcrumb .current { color: var(--gray-700); font-weight: 500; }

.topbar-actions { display: flex; align-items: center; gap: 12px; }
.search-box {
  background: var(--gray-50);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 8px 12px 8px 36px;
  font-size: 13px;
  width: 280px;
  position: relative;
  display: flex;
  align-items: center;
}
.search-box svg { position: absolute; left: 12px; color: var(--gray-400); }
.search-box input {
  border: none; background: none; outline: none;
  width: 100%; font-family: inherit; font-size: 13px;
  color: var(--gray-800);
}
.icon-btn {
  width: 38px; height: 38px;
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--gray-500);
  background: var(--gray-50);
  position: relative;
}
.icon-btn:hover { background: var(--gray-100); color: var(--gray-700); }
.icon-btn .dot {
  position: absolute;
  top: 8px; right: 8px;
  width: 8px; height: 8px;
  background: var(--error);
  border-radius: 50%;
  border: 2px solid var(--surface);
}

.content { padding: 28px 32px; }

/* ===== Cards ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-800);
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-title svg { color: var(--citizens-green); }

/* ===== Stat cards row ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
}
.stat-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}
.stat-label {
  font-size: 12.5px;
  color: var(--gray-500);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.stat-icon {
  color: var(--gray-400);
  width: 18px;
  height: 18px;
}
.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.stat-value .unit { font-size: 14px; color: var(--gray-500); font-weight: 500; margin-left: 4px; }
.stat-meta { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 12.5px; color: var(--gray-500); }
.stat-trend.up { color: var(--success); font-weight: 600; }
.stat-trend.down { color: var(--error); font-weight: 600; }
.stat-link { color: var(--citizens-green); font-weight: 500; }

/* ===== Grid layouts ===== */
.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; margin-bottom: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 20px; }
.grid-1-2 { display: grid; grid-template-columns: 1fr 2fr; gap: 20px; margin-bottom: 20px; }

/* ===== Donut chart ===== */
.donut-wrap { display: flex; align-items: center; gap: 24px; padding: 16px 0; }
.donut {
  width: 180px;
  height: 180px;
  position: relative;
  flex-shrink: 0;
}
.donut svg { transform: rotate(-90deg); }
.donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.donut-value { font-size: 28px; font-weight: 700; color: var(--gray-900); }
.donut-label { font-size: 12px; color: var(--gray-500); margin-top: 2px; }
.legend { display: flex; flex-direction: column; gap: 10px; }
.legend-item { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--gray-700); }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; }
.legend-count { margin-left: auto; font-weight: 600; color: var(--gray-900); }

/* ===== Bar chart ===== */
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  height: 200px;
  padding: 0 8px;
  border-bottom: 1px solid var(--gray-100);
  position: relative;
}
.bar-group { display: flex; flex-direction: column; align-items: center; flex: 1; gap: 4px; height: 100%; justify-content: flex-end; }
.bar-stack { display: flex; gap: 3px; align-items: flex-end; height: 100%; width: 100%; justify-content: center; }
.bar { width: 14px; background: var(--citizens-green); border-radius: 3px 3px 0 0; transition: opacity 0.2s; }
.bar.success { background: var(--citizens-green-light); }
.bar.error { background: var(--error); }
.bar.warning { background: var(--warning); }
.bar:hover { opacity: 0.8; }
.bar-label { font-size: 11px; color: var(--gray-500); margin-top: 6px; }
.chart-legend { display: flex; gap: 20px; justify-content: center; padding-top: 14px; }
.chart-legend .legend-item { font-size: 12px; }

/* ===== Activity heatmap ===== */
.heatmap {
  display: grid;
  grid-template-columns: repeat(24, 1fr);
  gap: 3px;
}
.heatmap-cell {
  aspect-ratio: 1;
  background: var(--gray-100);
  border-radius: 2px;
}
.heatmap-cell.l1 { background: #C8E6D2; }
.heatmap-cell.l2 { background: #8DD0A2; }
.heatmap-cell.l3 { background: #4FB371; }
.heatmap-cell.l4 { background: var(--citizens-green); }

/* ===== Table ===== */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.table-header {
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--gray-100);
}
.table-filters { display: flex; gap: 8px; }
.filter-chip {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12.5px;
  background: var(--gray-50);
  color: var(--gray-600);
  border: 1px solid var(--border);
  font-weight: 500;
  cursor: pointer;
}
.filter-chip.active {
  background: var(--citizens-green);
  color: #fff;
  border-color: var(--citizens-green);
}
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-500);
  padding: 10px 20px;
  font-weight: 600;
  background: var(--gray-50);
  border-bottom: 1px solid var(--border);
}
td {
  padding: 14px 20px;
  font-size: 13.5px;
  color: var(--gray-700);
  border-bottom: 1px solid var(--gray-100);
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--gray-50); }
.cell-primary { color: var(--gray-900); font-weight: 600; }
.cell-mono { font-family: 'JetBrains Mono', 'Menlo', monospace; font-size: 12.5px; color: var(--gray-700); }

/* ===== Badges ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: capitalize;
}
.badge-success { background: #DCFCE7; color: #15803D; }
.badge-warning { background: #FEF3C7; color: #B45309; }
.badge-error { background: #FEE2E2; color: #B91C1C; }
.badge-info { background: #DBEAFE; color: #1D4ED8; }
.badge-purple { background: #EDE9FE; color: #6D28D9; }
.badge-neutral { background: var(--gray-100); color: var(--gray-700); }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--r-sm);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid transparent;
}
.btn-primary { background: var(--citizens-green); color: #fff; }
.btn-primary:hover { background: var(--citizens-green-dark); }
.btn-secondary { background: var(--surface); color: var(--gray-700); border-color: var(--border); }
.btn-secondary:hover { background: var(--gray-50); border-color: var(--gray-300); }
.btn-ghost { background: transparent; color: var(--citizens-green); }
.btn-ghost:hover { background: var(--citizens-green-lighter); }

/* ===== AI Agent Panel ===== */
.agent-panel {
  background: linear-gradient(135deg, var(--citizens-green-pale) 0%, #FFFFFF 100%);
  border: 1px solid var(--citizens-green-lighter);
  border-radius: var(--r-lg);
  padding: 20px;
}
.agent-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.agent-orb {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--citizens-green) 0%, var(--citizens-green-light) 100%);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  position: relative;
}
.agent-orb::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--citizens-green-light);
  opacity: 0.4;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.4; }
  50% { transform: scale(1.1); opacity: 0.1; }
}
.agent-name { font-size: 14px; font-weight: 600; color: var(--gray-800); }
.agent-status { font-size: 12px; color: var(--gray-500); display: flex; align-items: center; gap: 5px; }
.agent-status .live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success); animation: blink 1.4s ease-in-out infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

.agent-feed { display: flex; flex-direction: column; gap: 12px; }
.feed-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--gray-100);
  border-radius: var(--r);
}
.feed-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.feed-icon.success { background: #DCFCE7; color: #15803D; }
.feed-icon.processing { background: #DBEAFE; color: #1D4ED8; }
.feed-icon.warning { background: #FEF3C7; color: #B45309; }
.feed-icon.purple { background: #EDE9FE; color: #6D28D9; }
.feed-content { flex: 1; min-width: 0; }
.feed-title { font-size: 13px; font-weight: 600; color: var(--gray-800); }
.feed-desc { font-size: 12.5px; color: var(--gray-500); margin-top: 2px; line-height: 1.45; }
.feed-time { font-size: 11.5px; color: var(--gray-400); margin-top: 4px; }

/* ===== Progress bars ===== */
.progress {
  height: 6px;
  background: var(--gray-100);
  border-radius: 3px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: var(--citizens-green);
  border-radius: 3px;
  transition: width 0.3s;
}
.progress-bar.warning { background: var(--warning); }
.progress-bar.error { background: var(--error); }

/* ===== Page header ===== */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.page-header-title h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -0.01em;
}
.page-header-title p {
  font-size: 13.5px;
  color: var(--gray-500);
  margin-top: 4px;
}

/* ===== Login ===== */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--citizens-green-pale) 0%, #fff 50%, #F4F6F8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-card {
  background: var(--surface);
  border-radius: var(--r-xl);
  padding: 44px 40px;
  width: 100%;
  max-width: 460px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--gray-100);
}
.login-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 28px;
}
.login-logo img { height: 38px; }
.login-title {
  font-size: 26px;
  font-weight: 700;
  text-align: center;
  color: var(--gray-900);
  letter-spacing: -0.01em;
}
.login-subtitle {
  font-size: 14px;
  color: var(--gray-500);
  text-align: center;
  margin-top: 6px;
  margin-bottom: 32px;
}
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 6px;
}
.form-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  font-size: 14px;
  font-family: inherit;
  background: #F8FBF9;
  transition: all 0.15s;
}
.form-input:focus {
  outline: none;
  border-color: var(--citizens-green);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(0, 117, 74, 0.1);
}
.btn-login {
  width: 100%;
  padding: 13px;
  background: var(--citizens-green);
  color: #fff;
  border-radius: var(--r);
  font-size: 14.5px;
  font-weight: 600;
  margin-top: 8px;
  transition: background 0.15s;
}
.btn-login:hover { background: var(--citizens-green-dark); }
.login-footer {
  text-align: center;
  margin-top: 22px;
  font-size: 13px;
  color: var(--gray-500);
}
.login-footer a { color: var(--citizens-green); font-weight: 500; }

/* Brand pill on login */
.product-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--citizens-green-lighter);
  color: var(--citizens-green-dark);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 auto 14px;
}

/* ===== Workflow visualizer ===== */
.workflow-canvas {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 32px;
  position: relative;
  min-height: 380px;
}
.workflow-stages {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  position: relative;
}
.workflow-stage {
  background: var(--gray-50);
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  padding: 16px;
  text-align: center;
  position: relative;
}
.workflow-stage.active {
  background: var(--citizens-green-pale);
  border-color: var(--citizens-green);
  box-shadow: 0 0 0 3px var(--citizens-green-lighter);
}
.workflow-stage.complete {
  background: #F0FDF4;
  border-color: var(--success);
}
.stage-icon {
  width: 40px; height: 40px;
  margin: 0 auto 10px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface);
  color: var(--gray-500);
  border: 1px solid var(--border);
}
.workflow-stage.active .stage-icon { background: var(--citizens-green); color: #fff; border-color: var(--citizens-green); }
.workflow-stage.complete .stage-icon { background: var(--success); color: #fff; border-color: var(--success); }
.stage-name { font-size: 12.5px; font-weight: 600; color: var(--gray-800); }
.stage-status { font-size: 11px; color: var(--gray-500); margin-top: 4px; }
.workflow-arrow {
  position: absolute;
  top: 50%;
  right: -12px;
  transform: translateY(-50%);
  color: var(--gray-300);
  z-index: 1;
}

/* ===== Document preview ===== */
.doc-preview {
  background: #F8FAFC;
  border: 1px dashed var(--border);
  border-radius: var(--r);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.doc-icon {
  width: 50px; height: 60px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--error);
  font-weight: 700;
  font-size: 11px;
}
.doc-meta { flex: 1; }
.doc-name { font-weight: 600; color: var(--gray-800); font-size: 14px; }
.doc-info { font-size: 12.5px; color: var(--gray-500); margin-top: 2px; }

/* ===== Field extraction preview ===== */
.field-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.field-item {
  background: var(--gray-50);
  padding: 10px 14px;
  border-radius: var(--r-sm);
  border-left: 3px solid var(--citizens-green);
}
.field-label { font-size: 11px; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
.field-value { font-size: 13.5px; font-weight: 600; color: var(--gray-900); margin-top: 2px; }
.field-confidence { font-size: 11px; color: var(--success); margin-top: 4px; display: flex; align-items: center; gap: 4px; }

/* ===== AI agents catalog ===== */
.agent-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 22px;
  position: relative;
  transition: all 0.2s;
}
.agent-card:hover { border-color: var(--citizens-green-light); box-shadow: var(--shadow-md); }
.agent-card-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}
.agent-avatar {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.agent-avatar.green { background: linear-gradient(135deg, var(--citizens-green) 0%, var(--citizens-green-light) 100%); color: #fff; }
.agent-avatar.blue { background: linear-gradient(135deg, #3B82F6 0%, #60A5FA 100%); color: #fff; }
.agent-avatar.purple { background: linear-gradient(135deg, #8B5CF6 0%, #A78BFA 100%); color: #fff; }
.agent-avatar.amber { background: linear-gradient(135deg, #F59E0B 0%, #FBBF24 100%); color: #fff; }
.agent-avatar.teal { background: linear-gradient(135deg, #14B8A6 0%, #2DD4BF 100%); color: #fff; }
.agent-avatar.pink { background: linear-gradient(135deg, #EC4899 0%, #F472B6 100%); color: #fff; }

.agent-card-title { font-size: 15px; font-weight: 700; color: var(--gray-900); }
.agent-card-role { font-size: 12px; color: var(--gray-500); margin-top: 1px; }
.agent-card-desc { font-size: 13px; color: var(--gray-600); line-height: 1.5; margin-bottom: 14px; }
.agent-stats { display: flex; gap: 16px; padding-top: 14px; border-top: 1px solid var(--gray-100); }
.agent-stat { font-size: 12px; }
.agent-stat-label { color: var(--gray-500); }
.agent-stat-value { color: var(--gray-900); font-weight: 700; font-size: 14px; }

/* Status pill */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  background: #DCFCE7;
  color: #15803D;
}
.status-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: blink 1.4s ease-in-out infinite; }

/* ===== Timeline ===== */
.timeline { position: relative; padding-left: 24px; }
.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--gray-200);
}
.timeline-item { position: relative; padding-bottom: 18px; }
.timeline-item::before {
  content: '';
  position: absolute;
  left: -22px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--citizens-green);
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 1px var(--citizens-green);
}
.timeline-item.pending::before { background: var(--gray-300); box-shadow: 0 0 0 1px var(--gray-300); }
.timeline-time { font-size: 11.5px; color: var(--gray-500); }
.timeline-title { font-size: 13.5px; font-weight: 600; color: var(--gray-800); margin-top: 1px; }
.timeline-desc { font-size: 12.5px; color: var(--gray-500); margin-top: 2px; }

/* ===== Tax basis chart ===== */
.basis-area {
  height: 240px;
  position: relative;
  margin-top: 16px;
}

/* Confidence ring */
.conf-ring {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--success);
  font-weight: 600;
}

/* ===== Insight card ===== */
.insight-card {
  background: linear-gradient(135deg, #00754A 0%, #009A44 100%);
  color: #fff;
  border-radius: var(--r-lg);
  padding: 22px;
  position: relative;
  overflow: hidden;
}
.insight-card::after {
  content: '';
  position: absolute;
  top: -50%; right: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 50%);
  pointer-events: none;
}
.insight-eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  opacity: 0.85;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.insight-title { font-size: 17px; font-weight: 700; line-height: 1.35; margin-bottom: 8px; }
.insight-body { font-size: 13px; opacity: 0.92; line-height: 1.5; }
.insight-actions { margin-top: 14px; display: flex; gap: 8px; }
.btn-on-dark {
  background: rgba(255,255,255,0.2);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.3);
  padding: 7px 14px;
  border-radius: var(--r-sm);
  font-size: 12.5px;
  font-weight: 600;
}
.btn-on-dark.solid { background: #fff; color: var(--citizens-green); border-color: #fff; }
.btn-on-dark:hover { background: rgba(255,255,255,0.3); }
.btn-on-dark.solid:hover { background: var(--gray-50); }

/* ===== Chat / agent-conversation ===== */
.chat-bubble {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}
.chat-bubble .agent-orb { width: 28px; height: 28px; }
.bubble-body {
  background: var(--gray-50);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--gray-700);
  max-width: 80%;
  line-height: 1.5;
}
.chat-bubble.user { flex-direction: row-reverse; }
.chat-bubble.user .bubble-body { background: var(--citizens-green); color: #fff; }
.chat-bubble.user .agent-orb { background: var(--gray-300); }
.chat-bubble.user .agent-orb::after { display: none; }

.chat-input {
  display: flex;
  gap: 8px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  margin-top: 12px;
}
.chat-input input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 13.5px;
  font-family: inherit;
}

/* ===== Ask AI page ===== */
.ask-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
  height: calc(100vh - 130px);
  min-height: 640px;
}
.thread-rail {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.thread-rail-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.thread-rail-head h3 { font-size: 13px; font-weight: 700; color: var(--gray-800); }
.btn-new-thread {
  width: 28px; height: 28px;
  border-radius: 6px;
  background: var(--citizens-green-pale);
  color: var(--citizens-green);
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--citizens-green-lighter);
}
.btn-new-thread:hover { background: var(--citizens-green-lighter); }
.thread-list { flex: 1; overflow-y: auto; padding: 6px; }
.thread-item {
  padding: 10px 12px;
  border-radius: var(--r-sm);
  cursor: pointer;
  display: block;
  text-decoration: none;
  margin-bottom: 2px;
}
.thread-item:hover { background: var(--gray-50); text-decoration: none; }
.thread-item.active { background: var(--citizens-green-pale); }
.thread-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-800);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.thread-meta { font-size: 11.5px; color: var(--gray-500); margin-top: 4px; display: flex; gap: 6px; align-items: center; }
.thread-day {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-400);
  font-weight: 600;
  padding: 12px 12px 4px;
}

.chat-shell {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.chat-shell-head {
  padding: 14px 20px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.chat-shell-head .head-meta {
  display: flex; align-items: center; gap: 10px;
}
.chat-shell-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
}
.chat-shell-foot {
  border-top: 1px solid var(--gray-100);
  padding: 14px 20px 18px;
  background: var(--gray-50);
}

.suggested-prompts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 10px;
}
.prompt-chip {
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.prompt-chip:hover {
  border-color: var(--citizens-green);
  background: var(--citizens-green-pale);
}
.prompt-chip-icon {
  width: 28px; height: 28px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  background: var(--citizens-green-lighter);
  color: var(--citizens-green-dark);
}
.prompt-chip-text { font-size: 12.5px; color: var(--gray-700); line-height: 1.45; }

/* Source card inside bubble */
.source-card {
  margin-top: 10px;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}
.source-card-head {
  padding: 8px 12px;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-100);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gray-500);
  font-weight: 600;
  display: flex; justify-content: space-between; align-items: center;
}
.source-card-body { padding: 12px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 14px; }
.source-row { display: flex; flex-direction: column; }
.source-row-label { font-size: 11px; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
.source-row-value { font-size: 13px; color: var(--gray-900); font-weight: 600; margin-top: 1px; }

.citation-pills {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 8px;
}
.citation-pill {
  font-size: 11px;
  background: var(--gray-100);
  color: var(--gray-700);
  padding: 3px 9px;
  border-radius: 12px;
  display: inline-flex; align-items: center; gap: 5px;
  font-weight: 500;
}
.citation-pill svg { color: var(--citizens-green); }

.composer {
  display: flex;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 10px 12px;
  align-items: flex-end;
}
.composer textarea {
  flex: 1;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 14px;
  resize: none;
  background: none;
  min-height: 22px;
  max-height: 120px;
  color: var(--gray-800);
}
.composer-actions { display: flex; gap: 6px; }
.composer-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--gray-500);
  background: var(--gray-50);
}
.composer-icon:hover { background: var(--gray-100); color: var(--gray-700); }
.composer-send {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--citizens-green);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.composer-send:hover { background: var(--citizens-green-dark); }

.composer-hint {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 8px;
  font-size: 11.5px; color: var(--gray-500);
}
.composer-hint kbd {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
}

@media (max-width: 1100px) {
  .ask-layout { grid-template-columns: 1fr; height: auto; }
  .thread-rail { max-height: 240px; }
  .suggested-prompts { grid-template-columns: 1fr; }
}

/* ===== Responsive ===== */
@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .grid-3, .grid-1-2 { grid-template-columns: 1fr; }
  .workflow-stages { grid-template-columns: repeat(2, 1fr); }
}

/* Utility */
.mt-0 { margin-top: 0; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 8px; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.justify-between { justify-content: space-between; }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-muted { color: var(--gray-500); }
.font-mono { font-family: 'JetBrains Mono', monospace; }
.font-bold { font-weight: 700; }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
