/* ── C9 Intelligence — App-Level Styles ──────────────────────────────────────── */

.filter-bar {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  padding: 16px 0;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.filter-input,
.filter-select {
  font-size: 13px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  min-width: 140px;
}
.filter-input:focus,
.filter-select:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px rgba(0, 179, 216, 0.15);
}

.filter-btn {
  font-size: 13px;
  font-weight: 600;
  padding: 8px 18px;
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: opacity 0.15s;
}
.filter-btn:hover { opacity: 0.85; }

.filter-count {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: 8px;
}

/* ── Table enhancements ── */

.data-table {
  font-size: 12px;
  width: 100%;
  table-layout: fixed;
}
.data-table th,
.data-table td {
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}
.data-table th {
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 5;
}
.data-table td {
  vertical-align: top;
  padding: 6px 10px;
}
.data-table td.cell-wrap {
  white-space: normal;
  overflow: visible;
}
.data-table .patient-name {
  white-space: normal;
  overflow: visible;
}
.data-table tr:hover {
  background: rgba(0, 179, 216, 0.04);
}

.cell-time {
  white-space: nowrap;
  font-weight: 500;
  color: var(--navy);
}
.cell-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  padding-right: 10px;
}
th.cell-num {
  text-align: right;
  padding-right: 10px;
}
.cell-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.patient-name {
  font-weight: 500;
}

/* ── Status badges ── */

.status-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 3px;
  letter-spacing: 0.02em;
}
.status-green  { background: var(--green-bg);  color: var(--green-txt); }
.status-red    { background: var(--red-bg);    color: var(--red-txt); }
.status-yellow { background: var(--yellow-bg); color: var(--yellow-txt); }
.status-blue   { background: #eff6ff; color: #1e40af; }
.status-gray   { background: #f3f4f6; color: #4b5563; }
.status-teal   { background: #ccfbf1; color: #0f766e; }
.status-orange { background: #fff7ed; color: #c2410c; }
.status-purple { background: #f3e8ff; color: #7c3aed; }

/* ── Layout badges (treatment cards) ── */

.layout-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 3px;
}
.layout-braces  { background: #dbeafe; color: #1e40af; }
.layout-aligner { background: #d1fae5; color: #065f46; }

/* ── KPI Cards ── */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
}
.kpi-card.kpi-red { border-left: 3px solid var(--red-txt); }
.kpi-card.kpi-orange { border-left: 3px solid #f59e0b; }
.kpi-card.kpi-green { border-left: 3px solid var(--green-txt); }
.kpi-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.kpi-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-top: 4px;
}

/* ── Dashboard panels ── */

.dashboard-panels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 16px;
}
.dashboard-panels .data-table th,
.dashboard-panels .data-table td {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  font-size: 11px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
}
.card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}

/* ── Executive Dashboard ── */

.exec-top-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 16px;
  align-items: start;
}
.health-score-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
}
.health-score-gauge {
  width: 100px;
  height: 100px;
  margin: 0 auto;
  position: relative;
}
.health-score-gauge svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.health-score-gauge .gauge-bg {
  fill: none;
  stroke: var(--border);
  stroke-width: 8;
}
.health-score-gauge .gauge-fill {
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.6s ease;
}
.health-score-gauge .gauge-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
}
.health-score-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-top: 8px;
}

.exec-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.exec-kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: center;
}
.exec-kpi-card.kpi-alert { border-left: 3px solid var(--red-txt); }
.exec-kpi-card.kpi-warn { border-left: 3px solid #f59e0b; }
.exec-kpi-card.kpi-ok { border-left: 3px solid var(--green-txt); }
.exec-kpi-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.exec-kpi-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-top: 2px;
}

/* ── Sparkline row ── */

.sparkline-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.sparkline-card {
  text-align: center;
}
.sparkline-card-title {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.sparkline-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 48px;
  justify-content: center;
}
.sparkline-bar {
  width: 8px;
  border-radius: 2px 2px 0 0;
  min-height: 2px;
  transition: height 0.3s;
}

/* ── Location Scorecards ── */

.location-scorecard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr) auto;
  gap: 12px;
  align-items: start;
}
.loc-scorecard {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
}
.loc-scorecard-header {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.loc-scorecard-header .loc-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.loc-scorecard-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.loc-stat {
  text-align: center;
}
.loc-stat-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.loc-stat-label {
  font-size: 9px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}
.loc-score-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 10px;
}
.loc-score-value {
  font-size: 28px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.loc-score-label {
  font-size: 11px;
  font-weight: 600;
}
.loc-scorecard-rubric {
  background: var(--card-bg);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 11px;
}
.rubric-title {
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.rubric-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  margin-bottom: 3px;
}
.rubric-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.rubric-detail {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 8px;
  border-top: 1px solid var(--border);
  padding-top: 6px;
}

/* ── Executive bottom grid ── */

.exec-bottom-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1.4fr;
  gap: 16px;
}
.exec-action-card { min-height: 160px; }

/* ── Action items ── */

.action-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.action-item:last-child { border-bottom: none; }
.action-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 6px;
  border-radius: 3px;
  min-width: 24px;
  text-align: center;
}
.action-badge-red { background: #fee2e2; color: #991b1b; }
.action-badge-yellow { background: #fef3c7; color: #92400e; }
.action-badge-blue { background: #dbeafe; color: #1e40af; }
.action-text {
  font-size: 12px;
  color: var(--text);
  flex: 1;
}
.action-count {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

/* ── AI Action Items (named patients) ── */

.ai-action-section {
  margin-bottom: 12px;
}
.ai-action-section:last-child { margin-bottom: 0; }
.ai-action-section-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 4px;
}
.ai-action-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid rgba(0,0,0,0.04);
  cursor: pointer;
  border-radius: 3px;
  transition: background 0.1s;
}
.ai-action-item:hover { background: rgba(0, 179, 216, 0.05); }
.ai-action-item:last-child { border-bottom: none; }
.ai-action-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}
.ai-action-detail {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Patient Flow ── */

.flow-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr) auto;
  gap: 12px;
  align-items: start;
}
.flow-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
}
.flow-card-header {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}
.flow-bar-container {
  display: flex;
  height: 24px;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 6px;
}
.flow-bar-segment {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
}
.flow-bar-chair { background: var(--cyan); }
.flow-bar-checkout { background: #94a3b8; }
.flow-stats {
  display: flex;
  gap: 10px;
  font-size: 10px;
  color: var(--text-muted);
}
.flow-stat strong { color: var(--text); }
.flow-stat strong.flow-warn { color: var(--red-txt); }
.flow-stat strong.flow-ok { color: var(--green-txt); }
.flow-legend {
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-content: center;
  font-size: 10px;
  color: var(--text-muted);
}
.flow-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
}
.flow-leg-box {
  width: 12px;
  height: 12px;
  border-radius: 2px;
}

/* ── Patient Comments ── */

.comment-list {
  max-height: 400px;
  overflow-y: auto;
}
.comment-item {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.comment-item:last-child { border-bottom: none; }
.comment-item.comment-alert {
  background: #fffbeb;
  margin: 0 -8px;
  padding: 8px;
  border-radius: 3px;
  border: 1px solid #fef3c7;
}
.comment-meta {
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 3px;
  display: flex;
  gap: 8px;
}
.comment-text {
  color: var(--text);
  line-height: 1.4;
  word-break: break-word;
}
.comment-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 2px;
  background: #fef3c7;
  color: #92400e;
}

/* ── Milestones ── */

.milestone-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-top: 10px;
  margin-bottom: 4px;
}
.milestone-section-title:first-child { margin-top: 0; }
.milestone-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.milestone-row:hover { background: rgba(0, 179, 216, 0.04); }
.milestone-row:last-child { border-bottom: none; }
.milestone-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  min-width: 32px;
  text-align: center;
}
.milestone-badge-green { background: rgba(16, 185, 129, 0.15); color: #059669; }
.milestone-badge-blue { background: rgba(99, 102, 241, 0.15); color: #4f46e5; }
.milestone-badge-orange { background: rgba(245, 158, 11, 0.15); color: #d97706; }
.milestone-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.milestone-detail {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: auto;
  white-space: nowrap;
}

/* ── DOW Pattern heatmap ── */

.dow-heatmap {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.dow-cell {
  text-align: center;
  padding: 8px 4px;
  border-radius: 4px;
}
.dow-cell-day {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}
.dow-cell-value {
  font-size: 14px;
  font-weight: 700;
  margin-top: 2px;
}
.dow-cell-count {
  font-size: 9px;
  color: var(--text-muted);
  margin-top: 1px;
}
.dow-low { background: rgba(16, 185, 129, 0.12); }
.dow-low .dow-cell-value { color: #065f46; }
.dow-med { background: rgba(245, 158, 11, 0.12); }
.dow-med .dow-cell-value { color: #92400e; }
.dow-high { background: rgba(239, 68, 68, 0.12); }
.dow-high .dow-cell-value { color: #991b1b; }

/* ── Risk score bar ── */

.risk-bar-wrap {
  width: 60px;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  display: inline-block;
  vertical-align: middle;
  margin-right: 6px;
}
.risk-bar {
  height: 8px;
  border-radius: 4px;
  transition: width 0.3s;
}
.risk-bar.risk-red { background: #ef4444; }
.risk-bar.risk-orange { background: #f97316; }
.risk-bar.risk-yellow { background: #eab308; }
.risk-bar.risk-green { background: #22c55e; }

/* ── Enhanced Risk Score Cell ── */

.risk-score-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 160px;
}
.risk-score-bar-bg {
  flex: 1;
  height: 10px;
  background: #e5e7eb;
  border-radius: 5px;
  overflow: hidden;
  min-width: 60px;
}
.risk-score-bar-fill {
  height: 10px;
  border-radius: 5px;
  transition: width 0.3s;
}
.risk-score-bar-fill.risk-critical { background: linear-gradient(90deg, #ef4444, #dc2626); }
.risk-score-bar-fill.risk-high { background: linear-gradient(90deg, #f59e0b, #d97706); }
.risk-score-bar-fill.risk-moderate { background: linear-gradient(90deg, #eab308, #ca8a04); }
.risk-score-bar-fill.risk-low { background: linear-gradient(90deg, #22c55e, #16a34a); }

.risk-score-value {
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  min-width: 28px;
}
.risk-score-label {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 3px;
  white-space: nowrap;
}
.risk-score-value.risk-critical, .risk-score-label.risk-critical { color: #dc2626; }
.risk-score-label.risk-critical { background: #fef2f2; }
.risk-score-value.risk-high, .risk-score-label.risk-high { color: #d97706; }
.risk-score-label.risk-high { background: #fffbeb; }
.risk-score-value.risk-moderate, .risk-score-label.risk-moderate { color: #ca8a04; }
.risk-score-label.risk-moderate { background: #fefce8; }
.risk-score-value.risk-low, .risk-score-label.risk-low { color: #16a34a; }
.risk-score-label.risk-low { background: #f0fdf4; }

/* ── Rubric modal items (matching goto-calls pattern) ── */

.rubric-item {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-left: 3px solid #6366f1;
  border-radius: 6px;
  background: var(--surface);
}
.rubric-item-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.rubric-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #6366f1;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}
.rubric-name { font-size: 13px; font-weight: 700; color: var(--text); }
.rubric-def { font-size: 12px; color: var(--text); line-height: 1.55; margin: 0 0 5px; }
.rubric-look { font-size: 11px; color: var(--text-muted); line-height: 1.5; margin: 0 0 8px; }
.rubric-scale { display: flex; gap: 8px; flex-wrap: wrap; }
.rs-1 { font-size: 10px; color: #ef4444; background: #fef2f2; padding: 2px 8px; border-radius: 4px; border: 1px solid #fecaca; }
.rs-3 { font-size: 10px; color: #f59e0b; background: #fffbeb; padding: 2px 8px; border-radius: 4px; border: 1px solid #fed7aa; }
.rs-5 { font-size: 10px; color: #22c55e; background: #f0fdf4; padding: 2px 8px; border-radius: 4px; border: 1px solid #bbf7d0; }

.risk-score-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  text-align: center;
  min-width: 44px;
}
.risk-score-badge.risk-critical { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.risk-score-badge.risk-high { background: #fffbeb; color: #d97706; border: 1px solid #fed7aa; }
.risk-score-badge.risk-moderate { background: #fefce8; color: #ca8a04; border: 1px solid #fef08a; }
.risk-score-badge.risk-low { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }

/* ── Utilization heatmap ── */

.util-card {
  padding: 16px;
  overflow: auto;
}
.util-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.util-legend-title {
  font-weight: 700;
  font-size: 13px;
  color: var(--text);
  margin-right: 4px;
}
.util-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-muted);
}
.util-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
}
.util-dot.util-green { background: #10b981; }
.util-dot.util-yellow { background: #f59e0b; }
.util-dot.util-red { background: #ef4444; }
.util-dot.util-empty { background: var(--border); }

.util-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 3px;
}
.util-table th {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 6px 8px;
  text-align: center;
}
.util-table th:first-child {
  text-align: left;
}
.util-section-header td {
  font-weight: 700;
  font-size: 12px;
  color: var(--text);
  padding: 10px 8px 4px;
  border-bottom: 1px solid var(--border);
  letter-spacing: 0.02em;
}
.util-summary-row td {
  font-weight: 600;
  background: rgba(99, 102, 241, 0.05);
  border-radius: 3px;
}
.util-table td.util-cell {
  text-align: center;
  padding: 10px 8px;
  min-width: 90px;
  border-radius: 4px;
  position: relative;
  cursor: default;
  transition: transform 0.1s, box-shadow 0.1s;
}
.util-table td.util-cell:hover {
  transform: scale(1.03);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  z-index: 1;
}
.util-cell .util-pct {
  font-weight: 700;
  font-size: 15px;
  line-height: 1.2;
}
.util-cell .util-kept {
  font-weight: 500;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}
.util-cell .util-detail {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 1px;
  opacity: 0.8;
}
.util-cell-label {
  font-size: 11px;
  color: var(--text-muted);
  padding: 6px 8px;
  white-space: nowrap;
}
.util-green { background: rgba(16, 185, 129, 0.18); color: #065f46; }
.util-yellow { background: rgba(245, 158, 11, 0.18); color: #92400e; }
.util-red { background: rgba(239, 68, 68, 0.18); color: #991b1b; }
.util-empty { background: var(--bg); color: var(--text-muted); }

/* ── Util tooltip ── */
.util-tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 11px;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0,0,0,0.28);
  z-index: 100;
  pointer-events: none;
}
.util-cell:hover .util-tooltip {
  display: block;
}
.util-tooltip-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  line-height: 1.6;
}
.util-tooltip-label { color: var(--text); opacity: 0.7; }
.util-tooltip-value { font-weight: 700; color: var(--text); }

/* ── Pipeline funnel ── */

/* ── Pipeline KPIs ── */

.pipeline-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 16px;
}
.pipeline-kpi-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
}
.pipeline-kpi-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.pipeline-kpi-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-top: 4px;
}
.pipeline-kpi-trend {
  font-size: 11px;
  font-weight: 600;
  margin-top: 4px;
}
.pipeline-kpi-trend.trend-up { color: var(--green-txt); }
.pipeline-kpi-trend.trend-down { color: var(--red-txt); }
.pipeline-kpi-trend.trend-flat { color: var(--text-muted); }

/* ── Pipeline Stage Funnel ── */

.stage-funnel {
  padding: 12px 0;
}
.stage-funnel-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.stage-funnel-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  min-width: 140px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.stage-funnel-track {
  flex: 1;
  height: 36px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  max-width: 60%;
}
.stage-funnel-bar {
  height: 36px;
  border-radius: 4px;
  transition: width 0.4s ease;
  display: flex;
  align-items: center;
  padding-left: 10px;
}
.stage-funnel-bar-text {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.stage-funnel-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  min-width: 50px;
  text-align: right;
}
.stage-funnel-dropoff {
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
  padding: 2px 0;
  margin-left: 130px;
}

.stage-color-exam { background: var(--cyan); }
.stage-color-obs { background: #8b5cf6; }
.stage-color-scheduled { background: #f59e0b; }
.stage-color-started { background: var(--green-txt); }
.stage-color-undecided { background: #94a3b8; }
.stage-color-lost { background: var(--red-txt); }

/* ── Pipeline Split Layout ── */

.pipeline-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.pipeline-split-left, .pipeline-split-right {
  min-width: 0;
}

/* ── Pipeline Location Chart ── */

.loc-chart-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.loc-chart-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  min-width: 30px;
}
.loc-chart-track {
  flex: 1;
  height: 28px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}
.loc-chart-bar {
  height: 28px;
  border-radius: 4px;
  transition: width 0.4s;
  display: flex;
  align-items: center;
  padding-left: 8px;
}
.loc-chart-bar-text {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
}
.loc-chart-stats {
  font-size: 11px;
  color: var(--text-muted);
  min-width: 90px;
  text-align: right;
}

/* ── Pipeline Monthly Trend ── */

.trend-container {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 120px;
  padding: 8px 0;
}
.trend-bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
}
.trend-bar {
  width: 100%;
  max-width: 40px;
  border-radius: 3px 3px 0 0;
  transition: height 0.3s;
  min-height: 2px;
}
.trend-bar-label {
  font-size: 9px;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 4px;
  text-align: center;
}
.trend-bar-value {
  font-size: 10px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

/* ── Referral bar ── */

.referral-bar-cell {
  width: 80px;
}
.referral-bar-track {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.referral-bar-fill {
  height: 8px;
  background: var(--cyan);
  border-radius: 4px;
  transition: width 0.3s;
}

/* ── Aging badge ── */

.aging-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  font-variant-numeric: tabular-nums;
}
.aging-green { background: #d1fae5; color: #065f46; }
.aging-yellow { background: #fef3c7; color: #92400e; }
.aging-red { background: #fee2e2; color: #991b1b; }

/* ── Old funnel (kept for compatibility) ── */

.funnel-container {
  padding: 8px 0;
}
.funnel-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.funnel-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  min-width: 50px;
}
.funnel-track {
  flex: 1;
  height: 32px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.funnel-bar {
  height: 32px;
  border-radius: 4px;
  transition: width 0.3s;
}
.funnel-exams { background: var(--cyan); }
.funnel-starts { background: var(--green-txt); }
.funnel-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  min-width: 80px;
  text-align: right;
}

/* ── Loading / error states ── */

.state-loading {
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}
.state-error {
  padding: 12px 16px;
  background: var(--red-bg);
  color: var(--red-txt);
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 12px;
}

/* ── AI Summary Card ── */

.ai-summary-card {
  background: #f2fafb;
  border: 1px solid #d7eef2;
  border-left: 3px solid var(--cyan);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 16px;
}
.ai-summary-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.ai-summary-icon {
  color: var(--cyan);
  font-size: 12px;
}
.ai-summary-title {
  font-size: 12px;
  font-weight: 700;
  color: #0e7f8f;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex: 1;
}
.ai-expand-btn {
  font-size: 11px;
  color: var(--cyan);
  background: rgba(14, 159, 179, 0.08);
  border: 1px solid rgba(14, 159, 179, 0.2);
  border-radius: 4px;
  padding: 4px 10px;
  cursor: pointer;
  transition: background 0.15s;
}
.ai-expand-btn:hover { background: rgba(14, 159, 179, 0.15); }
.ai-expand-btn.expanded { background: rgba(14, 159, 179, 0.12); }

.ai-summary-text {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
}
.ai-summary-text.loading {
  color: var(--text-muted);
  font-style: italic;
}

.ai-detail {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(14, 159, 179, 0.15);
  font-size: 13px;
  line-height: 1.7;
  color: var(--text);
  white-space: pre-wrap;
}

/* ── Tooltips ── */

.tooltip-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.1);
  color: #6366f1;
  font-size: 10px;
  font-weight: 700;
  cursor: help;
  position: relative;
  vertical-align: middle;
  margin-left: 4px;
}
.tooltip-trigger:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #1e1b4b;
  color: #fff;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.4;
  padding: 8px 12px;
  border-radius: 6px;
  width: 260px;
  white-space: normal;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.tooltip-trigger:hover::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: #1e1b4b;
  z-index: 100;
}

/* ── AR Table ── */

.ar-row { cursor: pointer; }
.ar-row:hover { background: rgba(0, 179, 216, 0.08) !important; }
.ar-high { color: var(--red-txt); font-weight: 700; }
.ar-med { color: var(--yellow-txt); font-weight: 600; }

.ar-th-sort {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.ar-th-sort:hover { color: var(--cyan); }
.ar-sort-arrow {
  font-size: 10px;
  color: var(--text-muted);
  margin-left: 2px;
}

.wo-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
  letter-spacing: 0.02em;
  margin-top: 2px;
}

/* ── Patient Detail Modal ── */

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open {
  display: flex;
}
.modal-box {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.modal-close {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px 8px;
  border-radius: 4px;
}
.modal-close:hover { background: var(--bg); }

.patient-detail-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.pd-stat {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: center;
}
.pd-stat-highlight {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
}
.pd-stat-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.pd-stat-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 2px;
}

/* ── Category badges ── */

.cat-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 3px;
  letter-spacing: 0.04em;
}
.cat-chg { background: #fef3c7; color: #92400e; }
.cat-pmt { background: #d1fae5; color: #065f46; }
.cat-adj { background: #e0e7ff; color: #3730a3; }

/* ── Patient Analytics Grid ── */

.pat-analytics-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

/* ── Patient Demographics ── */

.pat-demo-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.pat-demo-stat {
  text-align: center;
}
.pat-demo-stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.pat-demo-stat-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 2px;
}
.pat-demo-split {
  margin-bottom: 14px;
}
.pat-demo-split-bar {
  display: flex;
  height: 16px;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 6px;
}
.pat-demo-split-seg { height: 100%; }
.pat-demo-ped { background: #06b6d4; }
.pat-demo-adult { background: #6366f1; }
.pat-demo-split-legend {
  display: flex;
  gap: 16px;
  font-size: 11px;
  color: var(--text);
}
.pat-demo-split-legend span {
  display: flex;
  align-items: center;
  gap: 4px;
}
.pat-demo-age-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.pat-demo-age-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 80px;
}
.pat-demo-age-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
}
.pat-demo-age-bar {
  width: 100%;
  background: linear-gradient(to top, #6366f1, #818cf8);
  border-radius: 3px 3px 0 0;
  min-height: 3px;
}
.pat-demo-age-label {
  font-size: 9px;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 4px;
}
.pat-demo-age-count {
  font-size: 9px;
  color: var(--text);
  font-weight: 700;
}

/* ── Evaluation Analytics ── */

.eval-analytics-row {
  min-height: 40px;
}
.eval-kpi-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 20px;
  align-items: start;
}
.eval-kpi {
  text-align: center;
  padding: 8px 0;
}
.eval-kpi-value {
  font-size: 32px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.eval-kpi-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 2px;
}
.eval-kpi-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.eval-rec-chart {
  padding: 4px 0;
}
.eval-rec-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.eval-rec-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 5px;
}
.eval-rec-label {
  font-size: 11px;
  color: var(--text);
  width: 160px;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.eval-rec-track {
  flex: 1;
  max-width: 200px;
  height: 14px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.eval-rec-bar {
  height: 14px;
  background: var(--cyan);
  border-radius: 3px;
  transition: width 0.3s;
}
.eval-rec-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  min-width: 30px;
  text-align: right;
}

/* ── Evaluation Modal ── */

.eval-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.eval-modal-quest {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.eval-modal-date {
  font-size: 12px;
  color: var(--text-muted);
}
.eval-detail-group {
  margin-bottom: 16px;
}
.eval-detail-cat {
  font-size: 11px;
  font-weight: 700;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.eval-answer-row {
  display: flex;
  gap: 12px;
  padding: 4px 0;
  font-size: 12px;
  border-bottom: 1px solid rgba(0,0,0,0.04);
}
.eval-answer-row:last-child { border-bottom: none; }
.eval-q {
  color: var(--text-muted);
  min-width: 200px;
  flex-shrink: 0;
}
.eval-a {
  color: var(--text);
  font-weight: 600;
}

/* ── Treatment Summary ── */

.tx-summary-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 16px;
  margin-top: 16px;
}
.tx-summary-kpis {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.tx-summary-visuals {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tx-visual-card {
  flex: 1;
}
.tx-val-warn {
  color: #f59e0b;
}
.tx-mix-bar {
  display: flex;
  height: 28px;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 10px;
}
.tx-mix-segment {
  height: 100%;
  transition: opacity 0.2s;
}
.tx-mix-segment:hover {
  opacity: 0.8;
}
.tx-mix-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}
.tx-mix-legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text);
}
.tx-mix-leg-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex-shrink: 0;
}

/* ── Treatment Card Modal ── */

.tc-header {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  color: #fff;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}
.tc-header-name {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
}
.tc-header-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px 16px;
  font-size: 11px;
}
.tc-header-grid span { opacity: 0.8; }
.tc-header-grid strong { opacity: 1; font-weight: 600; }

.tc-entry-table {
  width: 100%;
  font-size: 11px;
  border-collapse: collapse;
  table-layout: auto;
}
.tc-entry-table th {
  background: #1f2937;
  color: #e5e7eb;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 6px 5px;
  text-align: left;
  position: sticky;
  top: 0;
  z-index: 5;
  white-space: nowrap;
}
.tc-entry-table td {
  padding: 5px 5px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  white-space: nowrap;
}
.tc-row-V { background: rgba(173, 216, 230, 0.25); }
.tc-row-C { background: rgba(221, 160, 221, 0.18); }
.tc-row-E { background: rgba(255, 0, 0, 0.10); }
.tc-row-R { background: rgba(255, 255, 255, 0.5); }
.tc-row-VC { background: rgba(127, 255, 212, 0.15); }

.tc-type-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  width: 18px;
  height: 18px;
  line-height: 18px;
  text-align: center;
  border-radius: 3px;
  color: #fff;
}
.tc-note-row td {
  padding: 2px 5px 8px 30px;
  font-style: italic;
  color: var(--text-muted);
  font-size: 11px;
  white-space: normal;
  border-bottom: 1px solid var(--border);
}
.tc-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 12px;
}
.tc-tab-btn {
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 600;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}
.tc-tab-btn.active {
  color: var(--cyan);
  border-bottom-color: var(--cyan);
}

/* ── Chat Drawer ── */

.btn-chat {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}
.btn-chat:hover { opacity: 0.85; }

.chat-drawer {
  position: fixed;
  top: 0;
  right: -420px;
  width: 400px;
  height: 100vh;
  background: #fff;
  border-left: 1px solid var(--border);
  box-shadow: -4px 0 24px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: right 0.3s ease;
}
.chat-drawer.open { right: 0; }

.chat-drawer-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.chat-drawer-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.chat-drawer-sub {
  font-size: 11px;
  color: var(--text-muted);
}
.chat-drawer-close {
  margin-left: auto;
  background: none;
  border: none;
  font-size: 18px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}
.chat-drawer-close:hover { background: var(--border); }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-welcome {
  text-align: center;
  padding: 20px 12px;
  color: var(--text-muted);
  font-size: 12px;
}
.chat-welcome p { margin: 0 0 16px; }

.chat-examples {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.chat-example-btn {
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 11px;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s;
}
.chat-example-btn:hover { border-color: #6366f1; }

.chat-bubble {
  max-width: 90%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 12px;
  line-height: 1.6;
  word-break: break-word;
}
.chat-bubble-user {
  align-self: flex-end;
  background: #6366f1;
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-bubble-assistant {
  align-self: flex-start;
  background: var(--bg);
  color: var(--text);
  border-bottom-left-radius: 4px;
}
.chat-bubble-assistant h3,
.chat-bubble-assistant h4 {
  margin: 8px 0 4px;
  font-size: 12px;
}
.chat-bubble-assistant code {
  background: rgba(99,102,241,0.1);
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 11px;
}
.chat-bubble-assistant ul {
  margin: 4px 0;
  padding-left: 16px;
}
.chat-bubble-assistant li {
  margin-bottom: 2px;
}

.chat-thinking {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
}
.chat-thinking-dot {
  width: 6px;
  height: 6px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: chatDot 1.2s infinite;
}
.chat-thinking-dot:nth-child(2) { animation-delay: 0.2s; }
.chat-thinking-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes chatDot {
  0%, 60%, 100% { opacity: 0.3; transform: scale(0.8); }
  30% { opacity: 1; transform: scale(1); }
}

.chat-tool-pill {
  font-size: 11px;
  color: #6366f1;
  font-weight: 600;
  font-style: italic;
}

.chat-error {
  color: var(--red-txt);
  font-weight: 600;
}

.chat-input-area {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex-shrink: 0;
}
.chat-input {
  flex: 1;
  resize: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  font-family: inherit;
  line-height: 1.4;
  max-height: 120px;
  outline: none;
}
.chat-input:focus { border-color: #6366f1; }
.chat-send-btn {
  width: 32px;
  height: 32px;
  background: #6366f1;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.chat-send-btn:hover { background: #4f46e5; }
.chat-send-btn:disabled { opacity: 0.5; cursor: not-allowed; }
