/* Base */
:root {
  --teal: #0D6E6E;
  --teal-light: #0D6E6E1A;
  --teal-dark: #054E4E;
  --amber: #F59E0B;
  --amber-light: #F59E0B1A;
  --bg: #FAFAF8;
  --bg-alt: #F2F0ED;
  --dark: #1C1C1E;
  --text: #2D2D2D;
  --text-muted: #6B7280;
  --border: #E5E4E0;
}

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

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  line-height: 1.15;
}

/* Nav */
.nav {
  padding: 20px 40px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1100px;
  margin: 0 auto;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}
.nav-wordmark {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: 18px;
  color: var(--dark);
}
.nav-tagline {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* Hero */
.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  padding: 80px 40px 80px;
  max-width: 1100px;
  margin: 0 auto;
  align-items: center;
}
.hero-eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 16px;
}
.hero-headline {
  font-size: clamp(38px, 5vw, 56px);
  color: var(--dark);
  margin-bottom: 24px;
  font-weight: 800;
}
.hero-lede {
  font-size: 18px;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 480px;
}

/* Hero Visual - Route Card */
.hero-visual {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.route-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
}
.route-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.route-date {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
}
.route-badge {
  background: var(--teal);
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 0.04em;
}
.route-map {
  position: relative;
  height: 200px;
  background: #F8F7F4;
  padding: 20px;
}
.map-lines {
  position: absolute;
  inset: 0;
}
.map-pin {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.pin-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid;
}
.pin-start { background: var(--amber); border-color: var(--amber); }
.pin-stop { background: var(--teal); border-color: var(--teal); }
.pin-end { background: var(--teal-dark); border-color: var(--teal-dark); }
.pin-label {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 10px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}
.pin-time {
  font-size: 9px;
  color: var(--text-muted);
  white-space: nowrap;
}
.pin-1 { left: 20px; top: 130px; }
.pin-2 { left: 75px; top: 80px; }
.pin-3 { left: 140px; top: 50px; }
.pin-4 { left: 200px; top: 75px; }
.pin-5 { left: 265px; top: 30px; }

/* Route Stats */
.route-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--border);
}
.stat {
  padding: 14px 16px;
  text-align: center;
  border-right: 1px solid var(--border);
}
.stat:last-child { border-right: none; }
.stat-value {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: 20px;
  color: var(--dark);
}
.stat-unit {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}
.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.mode-text { color: var(--teal); font-size: 14px; font-weight: 700; }
.mode-badge { background: var(--teal-light); }

/* Optimize Banner */
.optimize-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--amber-light);
  border: 1px solid #F59E0B33;
  border-radius: 8px;
  font-size: 12px;
  color: #92400E;
  font-weight: 500;
}
.optimize-icon { flex-shrink: 0; }

/* Features */
.features {
  padding: 80px 40px;
  max-width: 1100px;
  margin: 0 auto;
}
.section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 12px;
}
.section-headline {
  font-size: clamp(28px, 4vw, 40px);
  color: var(--dark);
  margin-bottom: 48px;
  max-width: 560px;
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.feature-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px;
  transition: box-shadow 0.2s ease;
}
.feature-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.07);
}
.feature-primary {
  grid-column: span 1;
  border-left: 3px solid var(--teal);
}
.feature-icon { margin-bottom: 16px; }
.feature-card h3 {
  font-size: 17px;
  color: var(--dark);
  margin-bottom: 10px;
}
.feature-card p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.65;
}

/* Optimization Modes - Dark Section */
.modes {
  background: var(--dark);
  padding: 80px 40px;
}
.modes-inner {
  max-width: 1100px;
  margin: 0 auto;
}
.modes .section-label { color: var(--amber); }
.modes-headline {
  font-size: clamp(28px, 4vw, 40px);
  color: white;
  margin-bottom: 16px;
  max-width: 560px;
}
.modes-sub {
  color: #9CA3AF;
  font-size: 17px;
  margin-bottom: 48px;
}
.mode-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.mode-card {
  background: #2A2A2E;
  border: 1px solid #3A3A3E;
  border-radius: 14px;
  padding: 32px;
  position: relative;
}
.mode-card-featured {
  background: #1A2A2A;
  border-color: var(--amber);
}
.mode-icon { margin-bottom: 20px; }
.mode-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.mode-card h3 {
  font-size: 20px;
  color: white;
  margin-bottom: 12px;
}
.mode-card p {
  font-size: 14px;
  color: #9CA3AF;
  line-height: 1.65;
}
.mode-tag {
  position: absolute;
  top: 20px;
  right: 20px;
  background: var(--amber);
  color: var(--dark);
  font-size: 10px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 0.04em;
}

/* Process / How It Works */
.process {
  padding: 80px 40px;
  max-width: 1100px;
  margin: 0 auto;
}
.process .section-headline { margin-bottom: 56px; }
.steps {
  display: flex;
  align-items: flex-start;
  gap: 0;
}
.step {
  flex: 1;
  padding: 0 32px 0 0;
}
.step:first-child { padding-left: 0; }
.step-num {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: 48px;
  color: var(--teal);
  opacity: 0.2;
  margin-bottom: 12px;
  line-height: 1;
}
.step h3 {
  font-size: 19px;
  color: var(--dark);
  margin-bottom: 10px;
}
.step p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.65;
}
.step-connector {
  width: 40px;
  height: 1px;
  background: var(--border);
  align-self: 80px;
  margin-top: 50px;
  flex-shrink: 0;
}
.process-outro {
  margin-top: 56px;
  padding: 32px;
  background: var(--teal-light);
  border: 1px solid #0D6E6E1A;
  border-radius: 12px;
}
.process-stat {
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.process-stat-value {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: 36px;
  color: var(--teal);
}
.process-stat-desc {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Closing */
.closing {
  background: var(--bg-alt);
  padding: 80px 40px;
}
.closing-inner {
  max-width: 1100px;
  margin: 0 auto;
}
.closing-headline {
  font-size: clamp(28px, 4vw, 42px);
  color: var(--dark);
  margin-bottom: 20px;
  max-width: 680px;
}
.closing-body {
  font-size: 18px;
  color: var(--text-muted);
  max-width: 600px;
  line-height: 1.7;
  margin-bottom: 32px;
}
.closing-pillars {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}
.pillar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 600;
  font-size: 14px;
  color: var(--dark);
}

/* Footer */
.footer {
  background: var(--dark);
  padding: 40px;
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.footer-name {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: 16px;
  color: white;
}
.footer-copy {
  font-size: 14px;
  color: #9CA3AF;
  margin-bottom: 8px;
}
.footer-meta {
  font-size: 12px;
  color: #6B7280;
}

/* Patient Management */
.patients-page {
  padding: 40px;
  max-width: 1100px;
  margin: 0 auto;
}
.patients-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 16px;
}
.patients-title {
  font-size: 28px;
  color: var(--dark);
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 10px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 600;
  font-size: 14px;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}
.btn-primary {
  background: var(--teal);
  color: white;
}
.btn-primary:hover { background: var(--teal-dark); }
.btn-outline {
  background: white;
  color: var(--teal);
  border: 1.5px solid var(--teal);
}
.btn-outline:hover { background: var(--teal-light); }

/* Recert Alert Banner */
.recert-alert {
  background: var(--amber-light);
  border: 1.5px solid #F59E0B44;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.recert-alert-icon { color: var(--amber); font-size: 20px; }
.recert-alert-text { flex: 1; }
.recert-alert-title { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 700; font-size: 14px; color: var(--dark); }
.recert-alert-sub { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.recert-count { font-weight: 700; color: var(--amber); }

/* Patient Table */
.patients-table-wrap {
  background: white;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.patients-table {
  width: 100%;
  border-collapse: collapse;
}
.patients-table th {
  background: var(--bg-alt);
  padding: 12px 16px;
  text-align: left;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.patients-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  vertical-align: middle;
}
.patients-table tr:last-child td { border-bottom: none; }
.patients-table tr:hover td { background: var(--bg); }
.patient-name-cell { font-weight: 600; color: var(--dark); }
.patient-mrn { font-family: monospace; font-size: 12px; color: var(--text-muted); }
.cert-date {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
}
.cert-urgent { color: #DC2626; font-weight: 600; }
.cert-soon { color: var(--amber); font-weight: 600; }
.cert-ok { color: var(--text-muted); }
.patient-actions { display: flex; gap: 8px; }
.action-btn {
  padding: 6px 12px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid var(--border);
  background: white;
  color: var(--text);
  text-decoration: none;
  display: inline-block;
  transition: all 0.12s ease;
}
.action-btn:hover { background: var(--teal-light); border-color: var(--teal); color: var(--teal); }

/* New Patient Page */
.new-patient-page {
  padding: 40px;
  max-width: 1100px;
  margin: 0 auto;
}
.new-patient-header { margin-bottom: 32px; }
.new-patient-title {
  font-size: 28px;
  color: var(--dark);
  margin-bottom: 4px;
}
.new-patient-sub { font-size: 15px; color: var(--text-muted); }

/* Upload Zone */
.upload-section { margin-bottom: 40px; }
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: 16px;
  padding: 56px 40px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--bg);
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--teal);
  background: var(--teal-light);
}
.upload-zone-icon { font-size: 48px; margin-bottom: 16px; }
.upload-zone-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: 18px;
  color: var(--dark);
  margin-bottom: 8px;
}
.upload-zone-sub { font-size: 14px; color: var(--text-muted); }
.upload-zone-hint { font-size: 12px; color: var(--text-muted); margin-top: 12px; }
.upload-input { display: none; }
.upload-loading {
  display: none;
  padding: 40px;
  text-align: center;
}
.upload-loading.active { display: block; }
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.upload-loading-text { font-size: 15px; color: var(--text-muted); }
.upload-success {
  display: none;
  padding: 20px;
  background: var(--teal-light);
  border: 1.5px solid var(--teal);
  border-radius: 12px;
  margin-bottom: 32px;
  font-size: 14px;
  color: var(--teal-dark);
  font-weight: 600;
}

/* Side-by-side Review */
.review-section { display: none; }
.review-section.active { display: block; }
.review-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.review-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--dark);
}
.review-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}
@media (max-width: 768px) {
  .review-grid { grid-template-columns: 1fr; }
}
.review-fields-panel {
  background: white;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.review-fields-header {
  padding: 16px 20px;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: 13px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.review-fields-body { padding: 20px; }

/* Field Groups */
.field-group {
  margin-bottom: 20px;
}
.field-group:last-child { margin-bottom: 0; }
.field-group-label {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.field-item {
  position: relative;
}
.field-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.confidence-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.conf-dot-high { background: #16A34A; }
.conf-dot-medium { background: var(--amber); }
.conf-dot-low { background: #DC2626; }
.field-input {
  width: 100%;
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: 'DM Sans', sans-serif;
  color: var(--text);
  background: white;
  transition: border-color 0.15s;
  box-sizing: border-box;
}
.field-input:focus {
  outline: none;
  border-color: var(--teal);
}
.field-input.low-confidence {
  border-color: var(--amber);
  background: var(--amber-light);
}
.field-input::placeholder { color: var(--text-muted); opacity: 0.7; }
.field-note { font-size: 11px; color: var(--text-muted); margin-top: 3px; font-style: italic; }

/* Cert Period Highlight */
.cert-period-card {
  background: var(--amber-light);
  border: 1.5px solid var(--amber);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 20px;
}
.cert-period-label {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--amber);
  margin-bottom: 4px;
}
.cert-period-date {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: 18px;
  color: var(--dark);
}
.cert-period-note { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* PDF Preview Panel */
.review-pdf-panel {
  background: white;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  position: sticky;
  top: 20px;
}
.review-pdf-header {
  padding: 16px 20px;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: 13px;
  color: var(--text);
}
.review-pdf-body {
  padding: 20px;
  max-height: 600px;
  overflow-y: auto;
}
.pdf-placeholder {
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}
.pdf-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--teal-light);
  color: var(--teal);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  margin-top: 12px;
}
.review-extraction-summary {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--text-muted);
}
.review-extraction-summary span { font-weight: 600; color: var(--text); }

/* Review Actions */
.review-actions {
  display: flex;
  gap: 12px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.review-actions .btn { padding: 12px 28px; font-size: 15px; }

/* ICD-10 Tags */
.ICD10-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.ICD10-tag {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 8px;
  font-family: monospace;
  font-size: 12px;
  color: var(--text);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 64px 40px;
  color: var(--text-muted);
}
.empty-state-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }
.empty-state-title { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 700; font-size: 18px; color: var(--dark); margin-bottom: 8px; }
.empty-state-sub { font-size: 14px; }

/* Responsive */
@media (max-width: 768px) {
  .nav { padding: 16px 24px; }
  .hero { grid-template-columns: 1fr; gap: 40px; padding: 48px 24px; }
  .hero-copy { order: 1; }
  .hero-visual { order: 2; }
  .features { padding: 48px 24px; }
  .features-grid { grid-template-columns: 1fr; }
  .modes { padding: 48px 24px; }
  .mode-cards { grid-template-columns: 1fr; }
  .process { padding: 48px 24px; }
  .steps { flex-direction: column; gap: 32px; }
  .step-connector { display: none; }
  .closing { padding: 48px 24px; }
  .closing-pillars { flex-direction: column; gap: 16px; }
  .route-stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2) { border-right: none; }
}