/* ==========================================================================
   ROLOGY CLINICAL APPROVAL & REVIEW COCKPIT (UNIFIED WORKSTATION)
   Benchmark: Rology (Single-Screen Teleradiology / Clinical Verification)
   ========================================================================== */

.rology-cockpit-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  animation: fadeInCockpit 0.25s ease-out;
}

@keyframes fadeInCockpit {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 1. Cockpit Patient Header */
.cockpit-patient-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

body.dark .cockpit-patient-header {
  background: rgba(23, 37, 56, 0.85);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.cockpit-patient-header .header-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.patient-avatar-box {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.15), rgba(16, 185, 129, 0.15));
  border: 1px solid rgba(14, 165, 233, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
}

.patient-main-meta .title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.patient-main-meta .patient-name {
  margin: 0;
  font-size: 19px;
  font-weight: 900;
  color: var(--ink);
  letter-spacing: -0.3px;
}

.sub-meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 5px;
  font-size: 13px;
  color: var(--muted);
  flex-wrap: wrap;
}

.meta-separator {
  color: var(--line);
}

.doctor-linkage-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 2px 8px;
  border-radius: 6px;
  color: var(--ink);
}

.doctor-name-tag {
  color: #10b981;
  font-weight: 700;
}

/* 2. Cockpit Action Buttons */
.header-actions,
.bar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-cockpit {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 800;
  border: none;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: inherit;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.btn-cockpit:hover {
  transform: translateY(-1.5px);
  filter: brightness(1.08);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-cockpit:active {
  transform: translateY(0);
}

.btn-cockpit.approve {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
}

.btn-cockpit.modify-approve {
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  color: #ffffff;
}

.btn-cockpit.reject {
  background: #f1f5f9;
  color: #dc2626;
  border: 1.5px solid rgba(220, 38, 38, 0.3);
}

body.dark .btn-cockpit.reject {
  background: rgba(220, 38, 38, 0.12);
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.3);
}

.btn-cockpit.request-followup {
  background: #fff7ed;
  color: #ea580c;
  border: 1.5px solid rgba(234, 88, 12, 0.35);
}

body.dark .btn-cockpit.request-followup {
  background: rgba(234, 88, 12, 0.12);
  color: #fb923c;
  border-color: rgba(251, 146, 60, 0.35);
}

/* Emergency banner */
.cockpit-emergency-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(220, 38, 38, 0.08));
  border: 2px solid #ef4444;
  border-radius: 14px;
  color: #dc2626;
  animation: pulseEmergency 2s infinite ease-in-out;
}

body.dark .cockpit-emergency-banner {
  color: #fca5a5;
}

@keyframes pulseEmergency {
  0%, 100% { border-color: #ef4444; box-shadow: 0 0 0 rgba(239, 68, 68, 0); }
  50% { border-color: #b91c1c; box-shadow: 0 0 16px rgba(239, 68, 68, 0.3); }
}

.cockpit-emergency-banner .banner-icon {
  font-size: 28px;
}

.cockpit-emergency-banner p {
  margin: 3px 0 0;
  font-size: 13px;
  color: var(--ink);
  line-height: 1.45;
}

/* 3. Unified 2-Column Ergonomic Grid */
.cockpit-unified-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.15fr);
  gap: 18px;
  align-items: start;
}

@media (max-width: 1100px) {
  .cockpit-unified-grid {
    grid-template-columns: 1fr;
  }
}

.cockpit-col-inputs,
.cockpit-col-decision {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* 4. Cockpit Cards */
.cockpit-card {
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

body.dark .cockpit-card {
  background: rgba(23, 37, 56, 0.7);
  border-color: rgba(255, 255, 255, 0.08);
}

.cockpit-card .card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.card-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title-group h4 {
  margin: 0;
  font-size: 15.5px;
  font-weight: 800;
  color: var(--ink);
}

/* History Content */
.history-content-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.history-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}

.block-label {
  font-weight: 700;
  color: var(--muted);
  font-size: 12px;
}

.block-value {
  color: var(--ink);
  font-weight: 600;
}

.tags-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 3px;
}

.chip-condition {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
}

.chip-condition.active.danger {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.3);
  color: #dc2626;
}

body.dark .chip-condition.active.danger {
  color: #f87171;
}

.allergy-val.alert {
  color: #dc2626;
  font-weight: 800;
}

.allergy-val.safe {
  color: #10b981;
}

/* Vitals Matrix */
.vitals-matrix {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(105px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.vital-tile {
  background: var(--surface-2);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 3px;
}

.vital-tile.critical {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

.vital-tile.warning {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
}

.vital-name {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
}

.vital-num {
  font-size: 18px;
  font-weight: 900;
  color: var(--ink);
  font-family: var(--font-mono, monospace);
}

.vital-tile.critical .vital-num {
  color: #dc2626;
}

.vital-sub {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--muted);
}

/* Complaint Box */
.complaint-box {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
}

.complaint-row {
  margin-bottom: 8px;
  font-size: 13.5px;
  line-height: 1.5;
}

.complaint-label {
  color: var(--teal);
}

.complaint-text {
  color: var(--ink);
  font-weight: 600;
}

.complaint-meta {
  display: flex;
  gap: 14px;
  font-size: 12px;
  color: var(--muted);
  flex-wrap: wrap;
  padding-top: 6px;
  border-top: 1px dashed var(--line);
}

/* Attached Diagnostics Gallery */
.cockpit-attachments-preview {
  margin-top: 10px;
}

.att-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.att-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.att-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  cursor: pointer;
  transition: all 0.18s ease;
}

.att-card:hover {
  background: var(--surface);
  border-color: var(--teal);
  transform: translateY(-1px);
}

.att-thumb {
  font-size: 26px;
}

.att-info {
  display: flex;
  flex-direction: column;
}

.att-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
}

.att-info small {
  font-size: 11px;
  color: var(--muted);
}

/* 5. AI Diagnostic Outputs Card */
.ai-prediction-box {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.1), rgba(16, 185, 129, 0.1));
  border: 1.5px solid rgba(14, 165, 233, 0.35);
  border-radius: 14px;
  padding: 14px 18px;
  margin-bottom: 14px;
}

.pred-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--teal);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.pred-title {
  font-size: 17px;
  font-weight: 900;
  color: var(--ink);
  line-height: 1.35;
}

/* Confidence Gauge */
.ai-confidence-container {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.gauge-wrapper {
  position: relative;
  width: 90px;
  height: 90px;
  flex-shrink: 0;
}

.confidence-circle {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.circle-bg {
  fill: none;
  stroke: var(--line);
  stroke-width: 8;
}

.circle-progress {
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 251.2;
  transition: stroke-dashoffset 0.8s ease-out;
}

.gauge-center-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.pct-num {
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  font-family: var(--font-mono, monospace);
}

.pct-sub {
  font-size: 10px;
  color: var(--muted);
  font-weight: 600;
  margin-top: 2px;
}

.confidence-details {
  flex: 1;
  min-width: 180px;
}

.conf-desc {
  margin: 6px 0 0;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.45;
}

/* AI Evidence List */
.ai-evidence-box {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
}

.evidence-title {
  font-size: 12.5px;
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
}

.evidence-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.evidence-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  padding: 4px 0;
  border-bottom: 1px dashed var(--line);
}

.evidence-list li:last-child {
  border-bottom: none;
}

.ai-regulatory-notice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(14, 165, 233, 0.06);
  border-radius: 8px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.45;
}

.ai-regulatory-notice p {
  margin: 0;
}

/* Protocol Text Preview */
.regimen-preview-box {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
}

.regimen-text {
  margin: 0;
  white-space: pre-wrap;
  font-family: inherit;
  font-size: 12.5px;
  color: var(--ink);
  line-height: 1.5;
  background: var(--surface);
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px dashed var(--line);
}

/* 6. Bottom Sticky Action Bar */
.cockpit-bottom-bar {
  position: sticky;
  bottom: 0;
  z-index: 20;
  background: var(--surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1.5px solid var(--line);
  border-radius: 16px;
  padding: 14px 20px;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

body.dark .cockpit-bottom-bar {
  background: rgba(19, 29, 45, 0.95);
  border-color: rgba(255, 255, 255, 0.1);
}

.bar-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.status-indicator-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #f59e0b;
  animation: pulseDot 1.6s infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.3); }
}

/* 7. Modal Dialogs */
.cockpit-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeInModal 0.2s ease-out;
}

@keyframes fadeInModal {
  from { opacity: 0; }
  to { opacity: 1; }
}

.cockpit-modal-dialog {
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 18px;
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
}

body.dark .cockpit-modal-dialog {
  background: #131d2d;
  border-color: rgba(255, 255, 255, 0.12);
}

.cockpit-modal-dialog.radiology-dialog {
  max-width: 720px;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1.5px solid var(--line);
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 18px;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  transition: all 0.15s ease;
}

.modal-close-btn:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.modal-body {
  padding: 20px;
  flex: 1;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1.5px solid var(--line);
  background: var(--surface-2);
  border-radius: 0 0 16px 16px;
}

/* 🛡️ Docus AI Benchmark (Req #61): Clinical Override & Rejection Audit */
.docus-override-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: rgba(14, 165, 233, 0.08);
  border: 1.5px solid rgba(14, 165, 233, 0.35);
  border-radius: 10px;
  margin-bottom: 12px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink);
}

body.dark .docus-override-notice {
  background: rgba(14, 165, 233, 0.12);
  border-color: rgba(56, 189, 248, 0.4);
}

.docus-override-notice.rejection {
  background: rgba(220, 38, 38, 0.08);
  border-color: rgba(220, 38, 38, 0.35);
}

body.dark .docus-override-notice.rejection {
  background: rgba(220, 38, 38, 0.12);
  border-color: rgba(248, 113, 113, 0.4);
}

.override-validation-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  margin-top: 4px;
  transition: all 0.2s ease;
}

.override-validation-badge.invalid {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid rgba(220, 38, 38, 0.25);
}

body.dark .override-validation-badge.invalid {
  background: rgba(220, 38, 38, 0.15);
  color: #fca5a5;
  border-color: rgba(248, 113, 113, 0.3);
}

.override-validation-badge.valid {
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid rgba(22, 163, 74, 0.25);
}

body.dark .override-validation-badge.valid {
  background: rgba(22, 163, 74, 0.15);
  color: #86efac;
  border-color: rgba(74, 222, 128, 0.3);
}

.mandatory-override-box {
  background: var(--surface-2);
  border: 1.5px dashed var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
  transition: border-color 0.2s ease;
}

.mandatory-override-box.highlight-required {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.05);
}

body.dark .mandatory-override-box.highlight-required {
  border-color: #fbbf24;
  background: rgba(245, 158, 11, 0.1);
}

