/* ============================================
   COVERAGEIQ — INSURANCE DEFENSE AI PLATFORM
   Design System: Rosewood Library
   Palette: Deep burgundy, slate, gold, parchment
   Fonts: Cormorant Garamond + Manrope + JetBrains Mono
   ============================================ */

:root {
  /* Core Palette */
  --bg-base:        #0E0A0F;
  --bg-surface:     #150F18;
  --bg-elevated:    #1C1420;
  --bg-card:        #211828;
  --bg-hover:       #2A1F32;

  /* Sidebar */
  --sidebar-bg:     #0A0709;
  --sidebar-border: #2A1A2E;

  /* Accent Gold */
  --gold:           #C9A87C;
  --gold-light:     #E2C99A;
  --gold-dim:       #8A6E4A;

  /* Burgundy */
  --burgundy:       #7D3C50;
  --burgundy-light: #A85070;
  --burgundy-dim:   #4A1C2B;

  /* Text */
  --text-primary:   #F2EDE4;
  --text-secondary: #9A8A7A;
  --text-muted:     #5A4A3A;
  --text-gold:      #C9A87C;

  /* Status Colors */
  --green:          #4CAF7D;
  --green-dim:      #1A3D2B;
  --red:            #C0504A;
  --red-dim:        #3D1A18;
  --amber:          #D4A017;
  --amber-dim:      #3D2E08;
  --blue:           #5B8DB8;
  --blue-dim:       #1A2D3D;
  --purple:         #8B6BB1;
  --purple-dim:     #2A1A3D;

  /* Borders */
  --border:         #2A1F32;
  --border-light:   #3A2A42;

  /* Typography */
  --font-display:   'Cormorant Garamond', Georgia, serif;
  --font-body:      'Manrope', system-ui, sans-serif;
  --font-mono:      'JetBrains Mono', 'Courier New', monospace;

  /* Spacing */
  --sidebar-w:      240px;
  --header-h:       56px;
  --radius:         8px;
  --radius-sm:      5px;
  --radius-lg:      12px;
}

/* ============ RESET & BASE ============ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 14px; }

body {
  font-family: var(--font-body);
  background: var(--bg-base);
  color: var(--text-primary);
  display: flex;
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: var(--font-body); }
input, select, textarea { font-family: var(--font-body); }
::selection { background: var(--burgundy); color: var(--text-primary); }

/* Scrollbar */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 2px; }

/* ============ SIDEBAR ============ */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  position: relative;
  z-index: 10;
}

.sidebar::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 200px;
  background: radial-gradient(ellipse at 50% 0%, rgba(201,168,124,0.06) 0%, transparent 70%);
  pointer-events: none;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--sidebar-border);
}

.brand-mark {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.02em;
  line-height: 1;
}

.brand-sub {
  font-size: 9px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Nav */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 8px;
}

.nav-section-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 12px 8px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.15s ease;
  cursor: pointer;
  position: relative;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(201,168,124,0.12), rgba(125,60,80,0.08));
  color: var(--gold);
  border: 1px solid rgba(201,168,124,0.15);
}

.nav-item.active svg { color: var(--gold); }

.nav-badge {
  margin-left: auto;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.06em;
  background: linear-gradient(135deg, var(--burgundy), var(--gold-dim));
  color: var(--text-primary);
  padding: 2px 5px;
  border-radius: 3px;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--sidebar-border);
}

.user-card {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  margin-bottom: 8px;
}

.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--burgundy), var(--gold-dim));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-primary);
  flex-shrink: 0;
}

.user-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
  min-width: 0;
}

.user-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 10px;
  color: var(--text-muted);
}

.user-status {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
}

.firm-badge {
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
  font-style: italic;
  font-family: var(--font-display);
}

/* ============ MAIN CONTENT ============ */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-base);
}

/* ============ HEADER ============ */
.top-header {
  height: var(--header-h);
  min-height: var(--header-h);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  gap: 16px;
}

.breadcrumb {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
  font-style: italic;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  color: var(--text-muted);
  transition: border-color 0.15s;
}

.header-search:focus-within {
  border-color: var(--gold-dim);
}

.header-search input {
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 12px;
  width: 220px;
}

.header-search input::placeholder { color: var(--text-muted); }

.header-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  position: relative;
}

.header-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-light);
}

.notif-dot {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red);
  border: 1px solid var(--bg-surface);
}

/* ============ VIEW CONTAINER ============ */
.view-container {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.view {
  display: none;
  animation: fadeIn 0.2s ease;
}

.view.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============ VIEW HEADER ============ */
.view-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}

.view-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.view-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ============ BUTTONS ============ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  background: linear-gradient(135deg, var(--burgundy), #5A2035);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 600;
  border: 1px solid rgba(201,168,124,0.2);
  transition: all 0.15s;
  white-space: nowrap;
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--burgundy-light), var(--burgundy));
  border-color: rgba(201,168,124,0.35);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(125,60,80,0.3);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 500;
  border: 1px solid var(--border);
  transition: all 0.15s;
  white-space: nowrap;
}

.btn-secondary:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-light);
}

.link-btn {
  font-size: 11.5px;
  color: var(--gold);
  font-weight: 500;
  transition: color 0.15s;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.link-btn:hover { color: var(--gold-light); }

/* ============ KPI STRIP ============ */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: border-color 0.15s;
}

.kpi-card:hover { border-color: var(--border-light); }

.kpi-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kpi-blue   { background: var(--blue-dim);   color: var(--blue); }
.kpi-gold   { background: var(--amber-dim);  color: var(--amber); }
.kpi-green  { background: var(--green-dim);  color: var(--green); }
.kpi-red    { background: var(--red-dim);    color: var(--red); }
.kpi-purple { background: var(--purple-dim); color: var(--purple); }

.kpi-data {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.kpi-value {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1;
}

.kpi-label {
  font-size: 10.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kpi-trend {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 3px;
  white-space: nowrap;
  align-self: flex-start;
}

.kpi-trend.up      { background: var(--green-dim);  color: var(--green); }
.kpi-trend.warn    { background: var(--red-dim);    color: var(--red); }
.kpi-trend.neutral { background: var(--bg-elevated); color: var(--text-muted); }

/* ============ DASHBOARD GRID ============ */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 16px;
}

.dash-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  overflow: hidden;
}

.span-2 { grid-column: span 2; }

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

.card-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  font-style: italic;
}

.card-action {
  font-size: 11px;
  color: var(--gold);
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s;
}

.card-action:hover { color: var(--gold-light); }

.live-dot {
  font-size: 10px;
  color: var(--green);
  font-weight: 600;
  letter-spacing: 0.05em;
  animation: pulse-text 2s infinite;
}

@keyframes pulse-text {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ============ DATA TABLE ============ */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.data-table thead tr {
  border-bottom: 1px solid var(--border);
}

.data-table th {
  text-align: left;
  padding: 6px 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.data-table td {
  padding: 10px 10px;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(42,31,50,0.5);
  vertical-align: middle;
}

.data-table tbody tr:last-child td { border-bottom: none; }

.data-table tbody tr:hover td {
  background: rgba(42,31,50,0.4);
  color: var(--text-primary);
}

.table-row-clickable { cursor: pointer; }

.matter-id {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
}

.matter-name {
  font-size: 12px;
  color: var(--text-primary);
  font-weight: 500;
}

.deadline-warn {
  color: var(--red);
  font-weight: 600;
}

/* ============ STATUS BADGES ============ */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.status-active   { background: var(--blue-dim);    color: var(--blue); }
.status-ror      { background: var(--amber-dim);   color: var(--amber); }
.status-billing  { background: var(--purple-dim);  color: var(--purple); }
.status-closed   { background: var(--bg-elevated); color: var(--text-muted); }
.status-flagged  { background: var(--red-dim);     color: var(--red); }
.status-submitted{ background: var(--green-dim);   color: var(--green); }
.status-complete { background: var(--green-dim);   color: var(--green); }
.status-processing{ background: var(--amber-dim);  color: var(--amber); }

/* ============ ACTIVITY FEED ============ */
.activity-feed {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.activity-item {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(42,31,50,0.5);
}

.activity-item:last-child { border-bottom: none; }

.activity-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

.ai-icon   { background: var(--blue-dim);   color: var(--blue); }
.bill-icon { background: var(--green-dim);  color: var(--green); }
.ror-icon  { background: var(--amber-dim);  color: var(--amber); }
.warn-icon { background: var(--red-dim);    color: var(--red); }

.activity-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.activity-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.activity-meta {
  font-size: 10.5px;
  color: var(--text-muted);
}

.activity-detail {
  font-size: 10.5px;
  color: var(--text-secondary);
}

/* ============ BAR CHART ============ */
.chart-container { padding: 8px 0; }

.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 100px;
  padding: 0 4px;
  margin-bottom: 10px;
}

.bar-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
  justify-content: flex-end;
  position: relative;
}

.bar-fill {
  width: 100%;
  background: var(--bg-elevated);
  border-radius: 3px 3px 0 0;
  transition: height 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  cursor: pointer;
}

.bar-fill:hover::after {
  content: attr(data-val);
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-hover);
  color: var(--text-primary);
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 3px;
  white-space: nowrap;
  border: 1px solid var(--border);
}

.bar-current {
  background: linear-gradient(180deg, var(--gold) 0%, var(--gold-dim) 100%);
}

.bar-group.active .bar-fill:not(.bar-current) {
  background: var(--bg-hover);
}

.bar-label {
  font-size: 10px;
  color: var(--text-muted);
}

.chart-legend {
  display: flex;
  gap: 14px;
  justify-content: center;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  color: var(--text-muted);
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.legend-dot.gold  { background: var(--gold); }
.legend-dot.green { background: var(--green); }

/* ============ QUICK ACTIONS ============ */
.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.qa-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 500;
  transition: all 0.15s;
  text-align: center;
}

.qa-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--gold-dim);
  transform: translateY(-1px);
}

.qa-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--burgundy-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
}

/* ============ COVERAGE OPINION ENGINE ============ */
.coverage-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
  height: calc(100vh - 180px);
}

.pipeline-panel,
.opinions-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  overflow-y: auto;
}

.panel-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-style: italic;
  margin-bottom: 16px;
}

/* Pipeline Stages */
.pipeline-stages {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  margin-bottom: 20px;
}

.pipeline-stages::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: var(--border);
}

.stage {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  position: relative;
}

.stage-dot {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg-base);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  transition: all 0.3s;
}

.stage.completed .stage-dot {
  background: var(--green);
  border-color: var(--green);
}

.stage.completed .stage-dot::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  color: white;
}

.stage.active .stage-dot {
  border-color: var(--gold);
  background: var(--amber-dim);
}

.stage-dot.pulse {
  animation: pulse-ring 1.5s infinite;
}

@keyframes pulse-ring {
  0%   { box-shadow: 0 0 0 0 rgba(201,168,124,0.4); }
  70%  { box-shadow: 0 0 0 6px rgba(201,168,124,0); }
  100% { box-shadow: 0 0 0 0 rgba(201,168,124,0); }
}

.stage-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex: 1;
}

.stage-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.stage.completed .stage-name { color: var(--text-primary); }
.stage.active .stage-name    { color: var(--gold); font-weight: 600; }

.stage-time {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
}

.stage-time.running {
  color: var(--gold);
  animation: pulse-text 1.5s infinite;
}

.pipeline-progress {
  margin-top: 4px;
}

.progress-bar {
  height: 3px;
  background: var(--bg-elevated);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 6px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--burgundy), var(--gold));
  border-radius: 2px;
  transition: width 0.5s ease;
}

.progress-label {
  font-size: 10.5px;
  color: var(--text-muted);
}

/* Opinion Cards */
.opinions-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.opinion-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
  transition: all 0.15s;
}

.opinion-card:hover {
  border-color: var(--border-light);
  background: var(--bg-hover);
}

.completed-card:hover { border-color: var(--gold-dim); }

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

.opinion-id {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
}

.opinion-matter {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  font-family: var(--font-display);
  font-style: italic;
}

.opinion-meta {
  display: flex;
  gap: 12px;
  font-size: 10.5px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.opinion-result {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.result-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--bg-card);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  flex: 1;
  min-width: 80px;
}

.result-label {
  font-size: 9px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.result-val {
  font-size: 11px;
  font-weight: 700;
}

.result-val.confirmed { color: var(--green); }
.result-val.denied    { color: var(--red); }
.result-val.uncertain { color: var(--amber); }
.result-val.medium    { color: var(--amber); }
.result-val.low       { color: var(--green); }
.result-val.neutral   { color: var(--text-secondary); }

.opinion-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--text-muted);
}

/* Processing Card */
.processing-indicator {
  margin-top: 8px;
}

.proc-bar {
  height: 3px;
  background: var(--bg-card);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 6px;
}

.proc-fill {
  height: 100%;
  width: 60%;
  background: linear-gradient(90deg, var(--burgundy), var(--gold));
  border-radius: 2px;
  animation: proc-anim 2s ease-in-out infinite;
}

@keyframes proc-anim {
  0%   { width: 40%; }
  50%  { width: 75%; }
  100% { width: 40%; }
}

.processing-indicator span {
  font-size: 10.5px;
  color: var(--text-muted);
}

/* ============ ROR LETTER AUTOMATION ============ */
.ror-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 16px;
  height: calc(100vh - 180px);
}

.ror-queue {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.queue-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 14px;
  background: var(--bg-elevated);
  padding: 3px;
  border-radius: var(--radius-sm);
}

.qtab {
  flex: 1;
  padding: 5px 8px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: 4px;
  transition: all 0.15s;
  text-align: center;
}

.qtab.active {
  background: var(--bg-card);
  color: var(--text-primary);
}

.queue-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.queue-item {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  cursor: pointer;
  transition: all 0.15s;
}

.queue-item:hover { border-color: var(--border-light); }
.high-risk:hover  { border-color: rgba(192,80,74,0.4); }
.medium-risk:hover{ border-color: rgba(212,160,23,0.4); }
.low-risk:hover   { border-color: rgba(76,175,125,0.4); }

.queue-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
}

.queue-id {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
}

.risk-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  letter-spacing: 0.04em;
}

.risk-high   { background: var(--red-dim);   color: var(--red); }
.risk-medium { background: var(--amber-dim); color: var(--amber); }
.risk-low    { background: var(--green-dim); color: var(--green); }

.queue-matter {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 3px;
  font-family: var(--font-display);
  font-style: italic;
}

.queue-meta {
  font-size: 10.5px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.queue-actions {
  display: flex;
  gap: 6px;
}

.btn-approve {
  flex: 1;
  padding: 5px 10px;
  background: var(--green-dim);
  color: var(--green);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  transition: all 0.15s;
}

.btn-approve:hover { background: rgba(76,175,125,0.2); }

.btn-revise {
  flex: 1;
  padding: 5px 10px;
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  transition: all 0.15s;
}

.btn-revise:hover { background: var(--bg-hover); color: var(--text-primary); }

/* ROR Preview */
.ror-preview {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.preview-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
}

.preview-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.preview-label {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  font-style: italic;
}

.preview-actions {
  display: flex;
  gap: 6px;
}

.preview-btn {
  padding: 5px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 11px;
  color: var(--text-secondary);
  transition: all 0.15s;
}

.preview-btn:hover { background: var(--bg-hover); color: var(--text-primary); }

.jurisdiction-tags {
  display: flex;
  gap: 6px;
}

.jtag {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  background: var(--burgundy-dim);
  color: var(--gold);
  border-radius: 3px;
  border: 1px solid rgba(201,168,124,0.15);
}

.letter-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.letter-content {
  max-width: 600px;
  font-family: Georgia, serif;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text-secondary);
}

.letter-content p { margin-bottom: 12px; }
.letter-content strong { color: var(--text-primary); }

.letter-date { color: var(--text-muted); }
.letter-addr { color: var(--text-secondary); }
.letter-re   { background: var(--bg-elevated); padding: 10px 14px; border-left: 2px solid var(--gold); border-radius: 0 4px 4px 0; margin-bottom: 14px; }
.letter-sig  { margin-top: 20px; color: var(--text-secondary); }

.ai-annotations {
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
}

.annotation-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.annotation-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 5px 0;
  font-size: 11.5px;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(42,31,50,0.4);
}

.annotation-item:last-child { border-bottom: none; }

.ann-icon {
  font-size: 12px;
  flex-shrink: 0;
  margin-top: 1px;
}

.ann-icon.warn { color: var(--amber); }
.ann-icon.info { color: var(--blue); }
.ann-icon.ok   { color: var(--green); }

/* ============ LEDES BILLING ENGINE ============ */
.billing-layout {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 16px;
}

.billing-main {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.billing-filters {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
  gap: 12px;
}

.filter-tabs {
  display: flex;
  gap: 2px;
}

.ftab {
  padding: 5px 12px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: 4px;
  transition: all 0.15s;
}

.ftab.active {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.ftab:hover:not(.active) { color: var(--text-secondary); }

.billing-search input {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font-size: 11.5px;
  color: var(--text-primary);
  outline: none;
  width: 180px;
}

.billing-table { padding: 0 4px; }

.mono {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.platform-tag {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  background: var(--blue-dim);
  color: var(--blue);
  border-radius: 3px;
}

.amount-cell {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.flag-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: var(--red-dim);
  color: var(--red);
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
}

/* Billing Sidebar */
.billing-sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.billing-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}

.warn-card { border-color: rgba(192,80,74,0.3); }

.bstat-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.bstat-value {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 3px;
}

.warn-val { color: var(--red); }

.bstat-sub {
  font-size: 10.5px;
  color: var(--text-muted);
}

.flag-breakdown,
.ledes-formats {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}

.fb-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.fb-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid rgba(42,31,50,0.4);
  font-size: 11.5px;
}

.fb-item:last-child { border-bottom: none; }
.fb-type { color: var(--text-secondary); }
.fb-count {
  font-weight: 700;
  color: var(--red);
  background: var(--red-dim);
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 10px;
}

.format-btn {
  display: block;
  width: 100%;
  padding: 7px 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 11px;
  color: var(--text-secondary);
  text-align: left;
  margin-bottom: 5px;
  transition: all 0.15s;
  font-family: var(--font-mono);
}

.format-btn:hover {
  background: var(--bg-hover);
  color: var(--gold);
  border-color: var(--gold-dim);
}

/* ============ MATTER MANAGEMENT ============ */
.matters-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
  height: calc(100vh - 180px);
}

.matter-list-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.matter-search-bar {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.matter-search-bar input,
.matter-filter {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  font-size: 11.5px;
  color: var(--text-primary);
  outline: none;
  width: 100%;
}

.matter-filter option { background: var(--bg-card); }

.matter-cards {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.matter-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  cursor: pointer;
  transition: all 0.15s;
}

.matter-card:hover { border-color: var(--border-light); background: var(--bg-hover); }

.selected-matter {
  border-color: var(--gold-dim) !important;
  background: rgba(201,168,124,0.05) !important;
}

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

.mc-id {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--text-muted);
}

.mc-status { font-size: 9px; }

.mc-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 5px;
  font-family: var(--font-display);
  font-style: italic;
  line-height: 1.3;
}

.mc-meta {
  display: flex;
  gap: 8px;
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.mc-footer {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
}

.mc-billed { color: var(--text-secondary); }
.mc-deadline { color: var(--text-muted); }
.warn-text { color: var(--red) !important; font-weight: 600; }

/* Matter Detail */
.matter-detail-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.md-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
  gap: 12px;
}

.md-id {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.md-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  font-style: italic;
}

.md-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.md-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  background: var(--bg-elevated);
}

.md-tab {
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
  margin-bottom: -1px;
}

.md-tab.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

.md-tab:hover:not(.active) { color: var(--text-secondary); }

.md-content {
  padding: 20px;
  flex: 1;
}

.md-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.md-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.md-label {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.md-value {
  font-size: 12.5px;
  color: var(--text-primary);
}

.md-section-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  font-style: italic;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

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

.cs-item {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.cs-label {
  font-size: 9px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.cs-val {
  font-size: 12px;
  font-weight: 700;
}

.cs-val.confirmed { color: var(--green); }
.cs-val.uncertain { color: var(--amber); }
.cs-val.medium    { color: var(--amber); }
.cs-val.neutral   { color: var(--text-secondary); }

/* Deadline List */
.deadline-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dl-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.dl-item.critical {
  border-color: rgba(192,80,74,0.4);
  background: rgba(61,26,24,0.3);
}

.dl-date {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 50px;
}

.dl-item.critical .dl-date { color: var(--red); }

.dl-desc {
  flex: 1;
  font-size: 12px;
  color: var(--text-secondary);
}

.dl-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  background: var(--red-dim);
  color: var(--red);
  border-radius: 3px;
}

.neutral-badge {
  background: var(--bg-card);
  color: var(--text-muted);
}

/* ============ ANALYTICS ============ */
.analytics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.analytics-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}

.span-full { grid-column: 1 / -1; }

.period-selector {
  display: flex;
  gap: 4px;
}

.period-btn {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: 4px;
  border: 1px solid transparent;
  transition: all 0.15s;
}

.period-btn.active {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border);
}

.period-btn:hover:not(.active) { color: var(--text-secondary); }

/* Rate Bar */
.rate-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rate-fill {
  height: 4px;
  background: var(--green);
  border-radius: 2px;
  flex: 1;
  max-width: 80px;
}

.warn-fill { background: var(--amber); }

.rate-bar span {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 30px;
}

.trend-up   { color: var(--green); font-weight: 600; font-size: 11px; }
.trend-down { color: var(--red);   font-weight: 600; font-size: 11px; }

/* Donut Chart */
.donut-chart-container {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 10px 0;
}

.donut-svg {
  width: 120px;
  height: 120px;
  flex-shrink: 0;
}

.donut-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dl-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--text-secondary);
}

.dl-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dl-row strong {
  margin-left: auto;
  color: var(--text-primary);
  font-size: 12px;
}

/* Efficiency Metrics */
.efficiency-metrics {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 4px 0;
}

.eff-item {
  padding: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.eff-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.eff-compare {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.eff-before, .eff-after {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.eff-val-old {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: line-through;
}

.eff-val-new {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--green);
}

.eff-tag-old {
  font-size: 9px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.eff-tag-new {
  font-size: 9px;
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}

.eff-arrow {
  font-size: 16px;
  color: var(--gold);
  flex-shrink: 0;
}

.eff-saving {
  font-size: 11px;
  font-weight: 700;
  color: var(--gold);
  text-align: right;
}

/* ============ MODALS ============ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10,7,9,0.85);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-overlay.open {
  display: flex;
  animation: fadeIn 0.15s ease;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
}

.modal-wide { max-width: 720px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
}

.modal-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  font-style: italic;
}

.modal-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.modal-close:hover {
  background: var(--red-dim);
  color: var(--red);
  border-color: var(--red-dim);
}

.modal-body {
  padding: 20px 22px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
}

/* Forms */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group.span-2 { grid-column: span 2; }

.form-group label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.form-input {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 12.5px;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
}

.form-input:focus { border-color: var(--gold-dim); }
.form-input option { background: var(--bg-card); }

textarea.form-input { resize: vertical; min-height: 70px; }

.file-drop-zone {
  border: 1px dashed var(--border-light);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}

.file-drop-zone:hover {
  border-color: var(--gold-dim);
  background: rgba(201,168,124,0.03);
  color: var(--text-secondary);
}

.file-drop-zone span { font-size: 12px; }
.file-hint { font-size: 10.5px !important; color: var(--text-muted); }

/* Conflict Check */
.conflict-check-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 10px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.conflict-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--blue-dim);
  color: var(--blue);
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 600;
  transition: all 0.15s;
}

.conflict-btn:hover { background: rgba(91,141,184,0.2); }

.conflict-status {
  font-size: 11.5px;
  color: var(--text-muted);
}

/* Invoice Flags */
.invoice-flags {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.flag-header {
  font-size: 12px;
  font-weight: 700;
  color: var(--red);
  padding: 8px 12px;
  background: var(--red-dim);
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
}

.flag-item {
  display: flex;
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.flag-error { background: rgba(61,26,24,0.3); border-color: rgba(192,80,74,0.3); }
.flag-warn  { background: rgba(61,46,8,0.3);  border-color: rgba(212,160,23,0.3); }
.flag-info  { background: rgba(26,45,61,0.3); border-color: rgba(91,141,184,0.3); }

.flag-icon {
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 1px;
}

.flag-error .flag-icon { color: var(--red); }
.flag-warn  .flag-icon { color: var(--amber); }
.flag-info  .flag-icon { color: var(--blue); }

.flag-body { flex: 1; }

.flag-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.flag-desc {
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-bottom: 10px;
  line-height: 1.5;
}

.flag-actions {
  display: flex;
  gap: 6px;
}

.flag-btn {
  padding: 4px 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 11px;
  color: var(--text-secondary);
  transition: all 0.15s;
}

.flag-btn:hover { background: var(--bg-hover); color: var(--text-primary); }

.accept-btn {
  background: var(--green-dim) !important;
  color: var(--green) !important;
  border-color: transparent !important;
}

/* Opinion Detail Modal */
.od-result-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.od-result-item {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.od-label {
  font-size: 9px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.od-val {
  font-size: 13px;
  font-weight: 700;
}

.od-val.confirmed { color: var(--green); }
.od-val.uncertain { color: var(--amber); }
.od-val.medium    { color: var(--amber); }

.od-section { margin-bottom: 16px; }

.od-section-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  font-style: italic;
  margin-bottom: 8px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--border);
}

.od-text {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.exclusion-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.excl-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.excl-item.applicable    { background: rgba(61,26,24,0.2); border-color: rgba(192,80,74,0.2); }
.excl-item.not-applicable{ background: rgba(26,61,43,0.2); border-color: rgba(76,175,125,0.2); }
.excl-item.review        { background: rgba(61,46,8,0.2);  border-color: rgba(212,160,23,0.2); }

.excl-status {
  font-size: 10px;
  font-weight: 700;
  min-width: 120px;
}

.applicable .excl-status    { color: var(--red); }
.not-applicable .excl-status{ color: var(--green); }
.review .excl-status        { color: var(--amber); }

.excl-name {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ============ TOAST ============ */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 12px 18px;
  font-size: 12.5px;
  color: var(--text-primary);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  transform: translateY(80px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 2000;
  max-width: 320px;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.success { border-left: 3px solid var(--green); }
.toast.error   { border-left: 3px solid var(--red); }
.toast.info    { border-left: 3px solid var(--gold); }