:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --border: #e5e7eb;
  --text: #0f172a;
  --muted: #64748b;
  --primary: #2563eb;
  --primary-contrast: #ffffff;
  
  /* Score color variables */
  --score-red: linear-gradient(90deg, #fca5a5, #f87171);
  --score-orange: linear-gradient(90deg, #fcd34d, #fbbf24);
  --score-yellow: linear-gradient(90deg, #fef08a, #fde047);
  --score-green: linear-gradient(90deg, #86efac, #4ade80);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}

  #app {
    display: grid;
    grid-template-columns: 300px 1fr 420px;
    height: 100vh;
  }

.sidebar {
  background: var(--bg);
  padding: 16px;
  border-right: 1px solid var(--border);
  overflow: auto;
  height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 18px; }
.brand-logo { display: block; height: 32px; width: auto; }

.sidebar-cards { display: grid; gap: 14px; }
.card {
  text-align: left;
  padding: 14px;
  background: var(--panel);
  border: 2px solid #cfe3ff;
  border-radius: 10px;
  cursor: pointer;
}
.card-title { font-weight: 600; margin-bottom: 4px; }
.card-desc { color: var(--muted); font-size: 12px; line-height: 1.3; }

.content { padding: 16px 18px; display: flex; flex-direction: column; gap: 16px; overflow-y: auto; height: 100vh; }
.content-header { 
  display: flex; 
  align-items: center; 
  justify-content: space-between; 
}

.header-buttons {
  display: flex;
  align-items: center;
}

.btn-secondary {
  background-color: #6b7280;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
  margin-right: 10px;
}

.btn-secondary:hover {
  background-color: #4b5563;
}

.model-switcher {
  display: none !important;
}

.model-select {
  background-color: white;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.model-select:hover {
  border-color: #9ca3af;
}

.model-select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
.page-title { margin: 0; font-size: 20px; }

.btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--border); background: var(--panel); padding: 8px 12px; border-radius: 8px; cursor: pointer; }
.btn-primary { background: var(--primary); color: var(--primary-contrast); border-color: var(--primary); }
.btn-icon { font-size: 16px; }

/* Summary Section */
.summary-section {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.scores-container {
  display: flex;
  gap: 20px;
  align-items: flex-end;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.summary-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.summary-item label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

.summary-item span {
  font-size: 14px;
  font-weight: 600;
}

.total-amount {
  color: var(--primary);
  font-size: 16px !important;
}

.deal-score, .weighted-win-rate {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 180px;
  flex-shrink: 0;
  padding: 16px;
  background: #fafafa;
  border-radius: 12px;
  border: 1px solid #f0f0f0;
  transition: all 0.2s ease;
}

.deal-score:hover, .weighted-win-rate:hover {
  background: #f5f5f5;
  border-color: #e0e0e0;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.deal-score label, .weighted-win-rate label {
  font-size: 13px;
  color: var(--text);
  font-weight: 600;
  text-align: center;
  margin-bottom: 4px;
}

.score-bar {
  position: relative;
  height: 28px;
  background: #f3f4f6;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
}

.score-fill {
  height: 100%;
  background: var(--score-color, linear-gradient(90deg, #10b981, #059669));
  border-radius: 14px;
  transition: width 0.3s ease;
}

.score-value {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-weight: 700;
  font-size: 14px;
  color: black;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  z-index: 2;
  min-width: 20px;
  text-align: center;
}

/* Style for N/A values */
.score-value.no-score {
  color: black;
  font-weight: 600;
  text-shadow: none;
}

/* Enhanced Widget Content Styles */
.metrics-overview {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 16px 0;
}

.metric-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  text-align: center;
}

.metric-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}

.metric-label {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.transaction-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.pricing-breakdown {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.4;
}

.pricing-breakdown span {
  margin-right: 8px;
}

.pricing-insights {
  margin: 16px 0;
}

.insight-item {
  display: flex;
  align-items: flex-start;
  padding: 12px;
  margin: 8px 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.insight-icon {
  font-size: 16px;
  margin-right: 12px;
  margin-top: 2px;
}

.insight-content {
  font-size: 13px;
  line-height: 1.4;
  color: var(--text);
}

.recommendations {
  margin: 16px 0;
}

.recommendation-item {
  display: flex;
  align-items: flex-start;
  padding: 12px;
  margin: 8px 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.rec-badge {
  background: var(--primary);
  color: white;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 600;
  margin-right: 12px;
  min-width: 60px;
  text-align: center;
}

.rec-text {
  font-size: 13px;
  line-height: 1.4;
  color: var(--text);
  flex: 1;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 2px;
  background: var(--bg);
  padding: 4px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.tab {
  flex: 1;
  padding: 8px 16px;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
}

.tab.active {
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}



/* Table Sections */
.table-section {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.pricing-tiers-section {
  padding: 20px;
  border-top: 1px solid var(--border);
  background: #f8fafc;
}

.pricing-tiers-section h4 {
  margin: 0 0 16px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.pricing-tiers-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pricing-tier-row {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 6px;
  gap: 12px;
}

.pricing-tier-row.aggressive {
  border-left: 2px solid #d1d5db;
}

.pricing-tier-row.target {
  border-left: 2px solid #d1d5db;
}

.pricing-tier-row.stretch {
  border-left: 2px solid #d1d5db;
}

.pricing-tier-info {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
}

.pricing-tier-label {
  min-width: 80px;
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
}

.pricing-tier-price {
  min-width: 100px;
  font-weight: 600;
  font-size: 16px;
  color: var(--text);
}

.pricing-tier-metrics {
  display: flex;
  align-items: center;
  gap: 16px;
}

.pricing-tier-metric {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.pricing-tier-metric-label {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}

.pricing-tier-metric-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.pricing-tier-accept-btn {
  padding: 6px 12px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pricing-tier-accept-btn:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
}

.pricing-tier-accept-btn:active {
  transform: translateY(0);
}

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

.table-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

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

.table-container {
  overflow: auto;
}

.pricing-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

.pricing-table th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  padding: 8px 12px;
  text-align: left;
  font-weight: 600;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.pricing-table .sub-header th {
  background: #f1f5f9;
  font-size: 10px;
  padding: 4px 12px;
}

.pricing-table td {
  border-bottom: 1px solid var(--border);
  padding: 8px 12px;
  font-size: 13px;
  white-space: nowrap;
}

.pricing-table tbody tr:hover {
  background: #f0f9ff;
}

.pricing-table tbody tr.selected {
  background: #dbeafe;
}

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

.score-bar-small {
  flex: 1;
  height: 16px;
  background: #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

.score-fill-small {
  height: 100%;
  border-radius: 8px;
  transition: width 0.3s ease;
  background: var(--score-color, var(--score-green));
}

.score-fill-green {
  background: var(--score-color, linear-gradient(90deg, #10b981, #059669));
}

.score-fill-orange {
  background: var(--score-color, linear-gradient(90deg, #f59e0b, #d97706));
}

.score-value-small {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-weight: 700;
  font-size: 10px;
  color: black;
}

.win-rate-score {
  font-weight: 600;
  font-size: 12px;
  color: var(--score-color, var(--score-green));
}

.discount-input {
  width: 60px;
  padding: 2px 4px;
  border: 1px solid var(--border);
  border-radius: 3px;
  font-size: 11px;
  text-align: center;
}

.discount-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

.chat { border-left: 1px solid var(--border); background: var(--bg); display: grid; grid-template-rows: auto 1fr auto auto; height: 100vh; }
.chat-header { padding: 16px; font-weight: 600; }
.chat-body { padding: 14px 16px; overflow: auto; display: flex; flex-direction: column; gap: 8px; }

/* Chat message layout */
.message { display: flex; gap: 10px; align-items: flex-end; }
.message .bubble { max-width: 78%; padding: 10px 12px; border-radius: 14px; font-size: 13px; line-height: 1.45; background: #f3f4f6; color: #111827; }
.message.user-msg { justify-content: flex-end; }
.message.user-msg .bubble { background: #e5e7eb; border-bottom-right-radius: 6px; }
.message.bot-msg { justify-content: flex-start; }
.message.bot-msg .bubble { background: #eef2ff; border-bottom-left-radius: 6px; }
.message .avatar { width: 28px; height: 28px; border-radius: 50%; background: #e5e7eb; display: grid; place-items: center; font-size: 12px; color: #374151; flex: 0 0 28px; }
.message.user-msg .avatar { display: none; }

/* Streaming/thinking state */
.message.thinking .bubble { opacity: 0.95; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%{opacity:.8} 50%{opacity:1} 100%{opacity:.8} }

/* Markdown styling inside bubbles */
.message .bubble h1, .message .bubble h2, .message .bubble h3 { margin: 8px 0 6px; font-weight: 700; }
.message .bubble h1 { font-size: 20px; }
.message .bubble h2 { font-size: 18px; }
.message .bubble h3 { font-size: 16px; }

/* Make numeric points bold and bigger in headings */
.message .bubble h1,
.message .bubble h2,
.message .bubble h3 {
  font-variant-numeric: oldstyle-nums;
  display: block;
}

/* Styling for entire numbered sentences */
.message .bubble .numbered-sentence {
  font-weight: 900;
  font-size: 1.4em;
  color: inherit;
}

/* Bold number styling (no background) */
.message .bubble .bold-number {
  font-weight: 700;
  color: inherit; /* Use current text color */
  background: none; /* No background */
}

.message .bubble p { margin: 0 0 16px 0; font-size: 13px; }
.message .bubble p:last-child { margin-bottom: 0; }
.message .bubble ul, .message .bubble ol { margin: 6px 0 6px 18px; padding: 0; }
.message .bubble li { margin: 4px 0; font-size: 14px; }
.message .bubble code { background: #1118270d; border: 1px solid #e5e7eb; border-radius: 4px; padding: 1px 4px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.message .bubble pre { background: #0f172a; color: #e5e7eb; padding: 10px; border-radius: 10px; overflow: auto; font-size: 12px; }
.message .bubble pre code { background: transparent; border: 0; color: inherit; padding: 0; }
.message .bubble a { color: #2563eb; text-decoration: none; }
.message .bubble a:hover { text-decoration: underline; }

.chips { display: flex; gap: 10px; padding: 8px 16px; flex-wrap: wrap; }
.chip { background: #e5e7eb; border-radius: 16px; padding: 6px 10px; font-size: 12px; cursor: pointer; }
.chip:hover { background: #d1d5db; }
.chat-input { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--border); }
.chat-input input { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--panel); }
.send { background: var(--primary); color: #fff; border: none; padding: 0 14px; border-radius: 10px; cursor: pointer; }

.drawer { 
  position: fixed; 
  inset: 0; 
  background: rgba(15, 23, 42, 0.3); 
  display: none; 
  z-index: 1000;
}
.drawer.open { 
  display: block; 
}
.drawer-panel { 
  position: absolute; 
  left: 0; 
  top: 0; 
  bottom: 0; 
  width: 600px; 
  background: var(--panel); 
  border-right: 1px solid var(--border); 
  box-shadow: 0 10px 30px rgba(0,0,0,0.12); 
  transform: translateX(-100%); 
  transition: transform 220ms ease; 
  display: flex; 
  flex-direction: column; 
}
.drawer.open .drawer-panel { 
  transform: translateX(0); 
}
.drawer-header { display: flex; align-items: center; justify-content: space-between; padding: 16px; border-bottom: 1px solid var(--border); }
.drawer-title { 
  font-weight: 600; 
  font-size: 16px;
  color: var(--text);
}
.drawer-body { 
  padding: 16px; 
  color: var(--text); 
  line-height: 1.4; 
  overflow-y: auto;
  flex: 1;
  font-size: 13px;
}
.icon-btn { 
  border: 1px solid var(--border); 
  background: var(--panel); 
  border-radius: 8px; 
  padding: 6px 8px; 
  cursor: pointer; 
}

/* Widget content specific styles */
.widget-content h3 {
  margin: 0 0 16px 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.widget-content h4 {
  margin: 20px 0 12px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

/* New widget content styles */
.widget-header-image {
  margin-bottom: 20px;
  text-align: center;
}

.widget-header-image img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.product-context {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  border-left: 4px solid #3b82f6;
  font-size: 14px;
  color: #374151;
  text-align: center;
  font-weight: 500;
}

.insights-section,
.implications-section,
.sales-guidance {
  margin-bottom: 24px;
}

.insight-item,
.action-item,
.guidance-item {
  display: flex;
  align-items: flex-start;
  margin-bottom: 16px;
  padding: 12px;
  background: var(--bg);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.insight-icon {
  font-size: 16px;
  margin-right: 12px;
  flex-shrink: 0;
  margin-top: 2px;
}

.insight-content,
.action-text,
.guidance-text {
  flex: 1;
  line-height: 1.4;
  color: var(--text);
  font-size: 13px;
}

.action-badge,
.guidance-badge {
  background: var(--primary);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  margin-right: 12px;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.transaction-list {
  margin: 16px 0;
}

.transaction-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  margin: 8px 0;
}

.status {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
}

.status.approved {
  background: #dcfce7;
  color: #166534;
}

.status.pending {
  background: #fef3c7;
  color: #92400e;
}

/* Chart container and controls for discount simulator */
.chart-container {
  margin: 20px 0;
  text-align: center;
  width: 100%;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
  padding: 15px;
  overflow: visible;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.chart-container canvas {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin: 5px;
  display: block;
}

.chart-controls {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.chart-controls label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.chart-controls input[type="range"] {
  width: 200px;
  height: 6px;
  border-radius: 3px;
  background: #e5e7eb;
  outline: none;
  -webkit-appearance: none;
}

.chart-controls input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.chart-controls input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Approval Table Styles */
.approval-table {
  margin: 20px 0;
  overflow-x: auto;
}

.approval-table table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.approval-table th {
  background: #f8fafc;
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  border-bottom: 1px solid #e5e7eb;
}

.approval-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13px;
}

.approval-table tbody tr:hover {
  background: #f8fafc;
}

.margin-excellent {
  color: #059669;
  font-weight: 600;
}

.margin-safe {
  color: #d97706;
  font-weight: 600;
}

.margin-thin {
  color: #dc2626;
  font-weight: 600;
}

.margin-critical {
  color: #dc2626;
  font-weight: 600;
}

.highlighted {
  background: #dbeafe !important;
  color: #1e40af;
  font-weight: 600;
}

/* Comparison Table Styles */
.comparison-table {
  margin: 20px 0;
  overflow-x: auto;
}

.comparison-table table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  font-size: 12px;
}

.comparison-table th {
  background: #f8fafc;
  padding: 10px 8px;
  text-align: left;
  font-weight: 600;
  font-size: 11px;
  color: var(--text);
  border-bottom: 1px solid #e5e7eb;
  white-space: nowrap;
}

.comparison-table td {
  padding: 8px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 11px;
  line-height: 1.3;
  vertical-align: top;
}

.comparison-table tbody tr:hover {
  background: #f8fafc;
}

.feature-name {
  font-weight: 600;
  color: var(--text);
  background: #f8fafc;
}

.iridium {
  color: #000000;
  font-weight: 500;
}

.competitor {
  color: #000000;
  font-weight: 500;
}

.concern {
  color: #d97706;
  font-style: italic;
  font-size: 10px;
}

.argument {
  color: #1e40af;
  font-size: 10px;
  line-height: 1.4;
}

/* TCO Table Styles */
.tco-table {
  margin: 20px 0;
  overflow-x: auto;
}

.tco-table table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  font-size: 11px;
}

.tco-table th {
  background: #1f2937;
  color: white;
  padding: 10px 6px;
  text-align: center;
  font-weight: 600;
  font-size: 10px;
  border-bottom: 1px solid #374151;
  white-space: nowrap;
}

.tco-table td {
  padding: 8px 6px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 10px;
  line-height: 1.3;
  text-align: center;
  vertical-align: middle;
}

.tco-table tbody tr:nth-child(even) {
  background: #f8fafc;
}

.tco-table tbody tr:hover {
  background: #e5e7eb;
}

.vendor-name {
  font-weight: 600;
  color: var(--text);
  text-align: left !important;
}

.tco-highlight {
  background: #fef3c7 !important;
  color: #92400e;
  font-weight: 600;
  border-radius: 4px;
}

.tco-competitive {
  background: #dbeafe !important;
  color: #1e40af;
  font-weight: 600;
  border-radius: 4px;
}



/* Chart Legend Styles */
.chart-legend {
  margin-top: 20px;
  padding: 16px;
  background: #f9fafb;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.chart-legend h4 {
  margin: 0 0 12px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.legend-item {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--text);
}

.legend-color {
  width: 16px;
  height: 3px;
  margin-right: 8px;
  border-radius: 2px;
}

.legend-insight {
  margin-top: 12px;
  padding: 8px 12px;
  background: #fef3c7;
  border-radius: 6px;
  font-size: 11px;
  color: #92400e;
  border-left: 3px solid #f59e0b;
}

@media (max-width: 1200px) {
  #app { grid-template-columns: 260px 1fr 420px; }
}
@media (max-width: 980px) {
  #app { grid-template-columns: 1fr; grid-template-rows: auto auto auto; }
  .sidebar { grid-row: 2; }
  .chat { grid-row: 3; }
  .kpi-bar { grid-template-columns: repeat(3, 1fr); }
  .table-scroll { max-height: unset; }
}

/* Partner Margin Insights Chart Styling */
.margin-chart-container {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px;
  margin: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.deal-info h4 {
  margin: 0 0 8px 0;
  font-size: 18px;
  color: #1f2937;
  font-weight: 600;
}

.meta {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 16px;
  line-height: 1.4;
}

.control-badges {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.control-badge {
  display: flex;
  align-items: center;
  gap: 6px;
}

.control-badge label {
  font-size: 11px;
  color: #6b7280;
  font-weight: 500;
}

.badge {
  background: #e5e7eb;
  color: #374151;
  border-radius: 12px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 500;
  border: 1px solid #d1d5db;
}

.sequence-notes {
  font-size: 12px;
  color: #6b7280;
  margin-top: 12px;
  padding: 8px 12px;
  background: #f1f5f9;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  line-height: 1.4;
}

.chart-controls {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 8px;
}

.controls-row {
  display: flex;
  gap: 40px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.control-group label {
  font-size: 12px;
  color: #6b7280;
  font-weight: 500;
}

.control-group input[type="range"] {
  width: 120px;
  height: 4px;
  background: #e5e7eb;
  border-radius: 2px;
  outline: none;
  -webkit-appearance: none;
}

.control-group input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  background: #2563eb;
  border-radius: 50%;
  cursor: pointer;
}

.control-group input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: #2563eb;
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

.ticks {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #9ca3af;
  margin-top: 4px;
}

.control-group input[type="checkbox"] {
  margin-right: 6px;
  accent-color: #2563eb;
}

.key-figures {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.figure-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: #f1f5f9;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}

.figure-item .label {
  font-size: 12px;
  color: #6b7280;
  font-weight: 500;
}

.figure-item .value {
  font-size: 14px;
  color: #1f2937;
  font-weight: 600;
}

#marginChart {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
}

/* Hide scrollbars for all browsers */
* {
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* Internet Explorer 10+ */
}

*::-webkit-scrollbar {
  display: none; /* WebKit browsers (Chrome, Safari, Edge) */
}

/* Ensure scrolling still works for specific elements */
.sidebar,
.content,
.chat-body,
.table-container,
.message .bubble pre {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.sidebar::-webkit-scrollbar,
.content::-webkit-scrollbar,
.chat-body::-webkit-scrollbar,
.table-container::-webkit-scrollbar,
.message .bubble pre::-webkit-scrollbar {
  display: none;
}


