:root {
  --navy: #13294b;
  --teal: #2bb7a8;
  --mist: #eaf4f4;
  --cloud: #c8d3e0;
  --amber: #f2b544;
  --rose: #c95a74;
  --ink: #1b2c44;
  --text: #24364d;
  --muted: #66768d;
  --surface: #ffffff;
  --surface-alt: #f7fafc;
  --border: #d7e0ea;
  --shadow: 0 14px 36px rgba(19, 41, 75, 0.1);
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  min-height: 100%;
  margin: 0;
}

body {
  min-width: 1280px;
  background: linear-gradient(180deg, #f4f8fb 0%, #eef4f8 100%);
  color: var(--text);
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.app-shell {
  min-height: 100vh;
}

.top-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 1.2fr auto auto;
  align-items: center;
  gap: 1.5rem;
  padding: 1rem 1.75rem;
  background: rgba(19, 41, 75, 0.96);
  color: #fff;
  box-shadow: 0 8px 24px rgba(10, 21, 39, 0.28);
  backdrop-filter: blur(10px);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.brand-lockup h1 {
  font-size: 1.25rem;
  font-weight: 700;
}

.brand-logo {
  width: 3rem;
  height: 3rem;
  flex-shrink: 0;
}

.eyebrow {
  margin-bottom: 0.2rem;
  color: var(--teal);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav-tabs {
  display: inline-flex;
  gap: 0.5rem;
  justify-self: center;
  padding: 0.35rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.nav-tab,
.simulation-toggle,
.primary-button,
.secondary-button,
.danger-button,
.detail-tab,
.pending-list button {
  border: 0;
  border-radius: 999px;
  transition: all 160ms ease;
}

.nav-tab {
  padding: 0.7rem 1.2rem;
  background: transparent;
  color: rgba(255, 255, 255, 0.86);
  font-weight: 600;
}

.nav-tab:hover:not(:disabled),
.nav-tab.is-active {
  background: #fff;
  color: var(--navy);
}

.nav-tab:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.simulation-toggle {
  justify-self: end;
  padding: 0.8rem 1rem;
  background: rgba(43, 183, 168, 0.16);
  color: #fff;
  font-weight: 700;
  border: 1px solid rgba(43, 183, 168, 0.45);
}

.simulation-toggle.is-active {
  background: var(--teal);
  color: var(--navy);
}

.app-content {
  padding: 1.5rem;
}

.surface,
.detail-card,
.document-card,
.finding-card,
.metric-card,
.specialist-card,
.orchestration-supervisor-card,
.synthesis-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.dashboard-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.25rem;
  align-items: start;
}

.queue-filters {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.9rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--cloud);
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.filter-group span {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.filter-group select {
  font-size: 0.8rem;
  font-family: inherit;
  color: var(--navy);
  background: var(--mist);
  border: 1px solid var(--cloud);
  border-radius: 5px;
  padding: 0.3rem 0.6rem;
  cursor: pointer;
  min-width: 140px;
}

.filter-group select:focus {
  outline: 2px solid var(--teal);
  outline-offset: 1px;
}

.filter-clear {
  font-size: 0.75rem;
  font-family: inherit;
  color: var(--teal);
  background: none;
  border: 1px solid var(--teal);
  border-radius: 5px;
  padding: 0.3rem 0.7rem;
  cursor: pointer;
  align-self: flex-end;
}

.filter-clear:hover {
  background: var(--teal);
  color: #fff;
}

.reserve-cell {
  font-variant-numeric: tabular-nums;
  color: var(--navy);
  font-weight: 500;
}

.open-cell {
  padding: 0.35rem 0.5rem;
}

.open-claim-button {
  font-size: 0.72rem;
  font-family: inherit;
  font-weight: 600;
  color: var(--teal);
  background: none;
  border: 1px solid var(--teal);
  border-radius: 4px;
  padding: 0.25rem 0.65rem;
  cursor: pointer;
  white-space: nowrap;
}

.open-claim-button:hover {
  background: var(--teal);
  color: #fff;
}

.empty-row {
  text-align: center;
  color: var(--muted);
  padding: 1.5rem 0;
  font-size: 0.85rem;
}

.dashboard-center-column,
.dashboard-right-column,
.detail-layout,
.orchestration-layout,
.orchestration-bottom-grid {
  display: grid;
  gap: 1.25rem;
}

.claims-queue-panel,
.claim-highlight-card,
.agent-preview-panel,
.kpi-panel,
.alerts-panel,
.pending-panel,
.claim-detail-header,
.detail-body,
.orchestration-header,
.orchestration-diagram-panel,
.message-timeline-panel,
.synthesis-panel {
  padding: 1.2rem 1.25rem;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.section-heading.compact {
  margin-bottom: 0.9rem;
}

.section-heading h2,
.claim-detail-header h2,
.orchestration-header h2 {
  font-size: 1.18rem;
  color: var(--ink);
}

.queue-count,
.detail-subtitle,
.claim-description,
.summary-label,
.document-card p,
.document-card small,
.finding-summary,
.specialist-snippet,
.empty-copy,
.human-action-bar p,
.timeline-event p,
.alert-item p,
.metric-card span,
.pending-list small {
  color: var(--muted);
}

.table-scroll {
  overflow: auto;
}

.claims-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.claims-table th {
  padding: 0.8rem 0.7rem;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  text-align: left;
  text-transform: uppercase;
}

.claims-table td {
  padding: 0.85rem 0.7rem;
  border-bottom: 1px solid #edf2f6;
  vertical-align: middle;
}

.claims-table tbody tr {
  transition: background 140ms ease, transform 140ms ease;
}

.claims-table tbody tr:hover {
  background: #f7fbfd;
}

.claims-table tbody tr.is-selected {
  background: rgba(43, 183, 168, 0.1);
  box-shadow: inset 3px 0 0 var(--teal);
}

.claim-cell-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.fraud-icon {
  font-size: 0.92rem;
}

.badge,
.header-chip,
.agent-preview-chip,
.inline-list span,
.coverage-item,
.synthesis-factor-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.38rem 0.7rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.badge-severity,
.badge-status,
.badge-agent-status,
.badge-review,
.badge-role,
.badge-doc,
.header-chip,
.agent-preview-chip,
.inline-list span,
.coverage-item,
.synthesis-factor-item {
  border: 1px solid rgba(19, 41, 75, 0.08);
}

.badge-low {
  background: var(--mist);
  color: #41606d;
}

.badge-medium {
  background: rgba(43, 183, 168, 0.15);
  color: #1b7268;
}

.badge-high {
  background: rgba(242, 181, 68, 0.18);
  color: #9c6700;
}

.badge-critical {
  background: rgba(201, 90, 116, 0.16);
  color: #96324d;
}

.badge-status-new,
.badge-review-unreviewed,
.badge-agent-idle,
.badge-doc-pending {
  background: #f0f4f8;
  color: #5d7188;
}

.badge-status-in-review,
.badge-status-pending-approval,
.badge-review-ready,
.badge-agent-running,
.badge-doc-received {
  background: rgba(43, 183, 168, 0.13);
  color: #146a61;
}

.badge-status-approved,
.badge-status-closed,
.badge-review-approved,
.badge-agent-complete,
.badge-doc-reviewed {
  background: rgba(43, 183, 168, 0.18);
  color: #0c6a60;
}

.badge-status-escalated,
.badge-review-escalated,
.badge-review-needs-info,
.badge-agent-blocked {
  background: rgba(201, 90, 116, 0.15);
  color: #93344f;
}

.badge-role,
.header-chip,
.inline-list span,
.coverage-item,
.synthesis-factor-item,
.agent-preview-chip {
  background: var(--surface-alt);
  color: var(--ink);
}

.claim-highlight-card,
.agent-preview-panel,
.kpi-panel,
.alerts-panel,
.pending-panel {
  min-height: 0;
}

.claim-summary-grid,
.recommendation-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
  margin-bottom: 1rem;
}

.summary-label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.summary-value {
  color: var(--ink);
  font-weight: 700;
}

.claim-description {
  margin-bottom: 1rem;
  line-height: 1.6;
}

.highlight-meta-row,
.finding-meta-row,
.inline-list,
.header-chip-group,
.action-button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.recommendation-preview {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(19, 41, 75, 0.05), rgba(43, 183, 168, 0.08));
}

.agent-preview-grid,
.kpi-grid,
.document-grid,
.finding-grid,
.coverage-list,
.synthesis-factor-list {
  display: grid;
  gap: 0.85rem;
}

.agent-preview-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.kpi-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.metric-card {
  padding: 0.95rem;
}

.metric-card strong {
  display: block;
  margin-top: 0.4rem;
  color: var(--ink);
  font-size: 1.3rem;
}

.alert-list,
.pending-list,
.timeline-list {
  display: grid;
  gap: 0.75rem;
}

.alert-item {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.95rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
}

.alert-item.escalated {
  background: rgba(242, 181, 68, 0.12);
  border-color: rgba(242, 181, 68, 0.28);
}

.alert-item.fraud {
  background: rgba(201, 90, 116, 0.12);
  border-color: rgba(201, 90, 116, 0.24);
}

.alert-item span {
  color: var(--ink);
  font-weight: 700;
}

.pending-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.pending-list li {
  margin: 0;
}

.pending-list button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 0.95rem;
  background: var(--surface-alt);
  text-align: left;
}

.pending-list button:hover,
.secondary-button:hover,
.detail-tab:hover,
.primary-button:hover,
.danger-button:hover {
  transform: translateY(-1px);
}

.secondary-button,
.primary-button,
.danger-button {
  padding: 0.8rem 1rem;
  font-weight: 700;
}

.secondary-button {
  background: var(--mist);
  color: var(--navy);
  border: 1px solid rgba(19, 41, 75, 0.1);
}

.primary-button {
  background: var(--teal);
  color: var(--navy);
}

.danger-button {
  background: rgba(201, 90, 116, 0.16);
  color: #8e2f4b;
}

.detail-layout {
  gap: 1rem;
}

.claim-detail-header,
.orchestration-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.detail-tabs {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.detail-tab {
  padding: 0.78rem 1rem;
  background: rgba(19, 41, 75, 0.06);
  color: var(--navy);
  font-weight: 700;
}

.detail-tab.is-active {
  background: var(--navy);
  color: #fff;
}

.detail-body {
  overflow: hidden;
}

.overview-grid,
.audit-grid,
.orchestration-bottom-grid,
.recommendation-columns {
  display: grid;
  gap: 1rem;
}

.overview-grid,
.recommendation-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.detail-card {
  padding: 1.1rem;
}

.detail-card h3,
.document-card h3,
.finding-card h3,
.specialist-card h3,
.orchestration-supervisor-card h3,
.synthesis-card h3 {
  margin-bottom: 0.75rem;
  color: var(--ink);
  font-size: 1rem;
}

.detail-list {
  display: grid;
  gap: 1rem;
}

.detail-list.compact {
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.detail-list dt {
  margin-bottom: 0.28rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.detail-list dd {
  margin: 0;
  color: var(--ink);
  line-height: 1.55;
}

.coverage-list {
  grid-template-columns: 1fr;
}

.document-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.document-card {
  padding: 1rem;
}

.document-card-header,
.finding-card-header,
.specialist-card-header,
.recommendation-header {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: flex-start;
}

.document-icon {
  display: inline-flex;
  width: 2.25rem;
  height: 2.25rem;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(43, 183, 168, 0.12);
  font-size: 1.15rem;
}

.finding-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.finding-card {
  padding: 1rem;
}

.finding-card-header strong,
.specialist-confidence,
.recommendation-header strong {
  color: var(--navy);
  font-size: 0.95rem;
}

.finding-summary {
  margin: 0.85rem 0;
  color: var(--ink);
  font-weight: 600;
}

.finding-list {
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.5rem;
  line-height: 1.55;
}

.finding-footer {
  display: grid;
  gap: 0.9rem;
  margin-top: 1rem;
}

.confidence-meter {
  height: 0.5rem;
  overflow: hidden;
  margin-top: 0.75rem;
  border-radius: 999px;
  background: rgba(19, 41, 75, 0.09);
}

.confidence-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), #6ad1c6);
}

.recommendation-card {
  padding: 1.2rem;
  border-width: 1px;
}

.recommendation-approve,
.recommendation-approve-with-conditions {
  background: linear-gradient(180deg, rgba(43, 183, 168, 0.08), #fff);
}

.recommendation-request-info {
  background: linear-gradient(180deg, rgba(242, 181, 68, 0.11), #fff);
}

.recommendation-escalate,
.recommendation-deny {
  background: linear-gradient(180deg, rgba(201, 90, 116, 0.1), #fff);
}

.recommendation-rationale {
  margin: 1rem 0;
  line-height: 1.65;
}

.recommendation-tab {
  display: grid;
  gap: 1rem;
}

.human-action-bar {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
}

.toast-message {
  padding: 0.9rem 1rem;
  border-radius: var(--radius-md);
  background: var(--navy);
  color: #fff;
  animation: fadeIn 200ms ease;
}

.audit-grid {
  grid-template-columns: 1.3fr 1fr;
}

.audit-summary-card,
.audit-timeline-card {
  grid-column: span 2;
}

.audit-callout {
  margin: 1rem 0;
  padding: 0.95rem 1rem;
  border-radius: var(--radius-md);
  background: rgba(43, 183, 168, 0.08);
}

.orchestration-diagram-panel {
  position: relative;
  display: grid;
  gap: 1.4rem;
  justify-items: center;
  overflow: hidden;
}

.orchestration-supervisor-card {
  width: min(100%, 420px);
  padding: 1.25rem;
  border: 2px solid rgba(19, 41, 75, 0.18);
  text-align: center;
}

.diagram-connector-vertical {
  width: 2px;
  height: 50px;
  background: linear-gradient(180deg, rgba(19, 41, 75, 0.25), rgba(43, 183, 168, 0.45));
}

.diagram-connector-horizontal {
  width: calc(100% - 8rem);
  height: 2px;
  background: linear-gradient(90deg, rgba(19, 41, 75, 0.12), rgba(43, 183, 168, 0.5), rgba(19, 41, 75, 0.12));
}

.specialist-row {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.8rem;
}

.specialist-card {
  position: relative;
  min-height: 172px;
  padding: 0.95rem;
  border-radius: var(--radius-md);
  animation: fadeIn 280ms ease;
}

.specialist-card::before {
  content: '';
  position: absolute;
  top: -16px;
  left: 50%;
  width: 2px;
  height: 16px;
  transform: translateX(-50%);
  background: rgba(19, 41, 75, 0.16);
}

.specialist-card.is-running {
  border-color: rgba(43, 183, 168, 0.45);
  box-shadow: 0 0 0 3px rgba(43, 183, 168, 0.12), var(--shadow);
  animation: pulse 1.2s infinite;
}

.specialist-card.is-complete {
  background: linear-gradient(180deg, rgba(43, 183, 168, 0.08), #fff);
}

.specialist-analysing {
  font-size: 0.8rem;
  color: var(--teal);
  font-style: italic;
  margin: 0.4rem 0 0;
  animation: pulse-opacity 1.4s ease-in-out infinite;
}

.specialist-analysing.specialist-analysing-done {
  color: var(--navy);
  font-style: normal;
  animation: none;
  font-weight: 600;
}

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

.orchestration-bottom-grid {
  grid-template-columns: 1.55fr 1fr;
}

.timeline-event {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.8rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid #edf2f6;
}

.timeline-list.compact .timeline-event:last-child,
.timeline-list .timeline-event:last-child {
  border-bottom: 0;
}

.timeline-time {
  color: var(--navy);
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.synthesis-card {
  padding: 1rem;
  margin-bottom: 1rem;
}

.synthesis-factor-list {
  grid-template-columns: 1fr;
  margin-bottom: 1rem;
}

.empty-state-card {
  min-height: 180px;
  display: grid;
  place-items: center;
  padding: 1rem;
  border-radius: var(--radius-md);
  background: var(--surface-alt);
  color: var(--muted);
  text-align: center;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(43, 183, 168, 0.18), var(--shadow);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(43, 183, 168, 0), var(--shadow);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(43, 183, 168, 0), var(--shadow);
  }
}

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

@media (max-width: 1480px) {
  .dashboard-layout,
  .orchestration-bottom-grid,
  .overview-grid,
  .recommendation-columns,
  .audit-grid {
    grid-template-columns: 1fr;
  }

  .audit-summary-card,
  .audit-timeline-card {
    grid-column: span 1;
  }

  .specialist-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .document-grid,
  .finding-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

