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

/* ═══ Font Reset ═══ */
button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button { cursor: pointer; }

:root {
  --primary: #0369a1;
  --primary-dark: #0c4a6e;
  --primary-light: #e0f2fe;
  --accent: #0ea5e9;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-500: #64748b;
  --gray-700: #334155;
  --gray-900: #0f172a;
  --radius: 14px;
  --shadow-sm: 0 1px 3px rgba(15,23,42,.06);
  --shadow-md: 0 4px 16px rgba(15,23,42,.08);
  --shadow-lg: 0 12px 32px rgba(15,23,42,.12);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Vazirmatn', Tahoma, sans-serif;
  background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
  color: var(--gray-900);
  direction: rtl;
  min-height: 100vh;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* ═══ Topbar ═══ */
.topbar {
  background: linear-gradient(135deg, #0c4a6e 0%, #075985 50%, #0369a1 100%);
  color: #fff;
  padding: 14px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.topbar::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 20% 50%, rgba(14,165,233,.25) 0%, transparent 40%),
                    radial-gradient(circle at 80% 80%, rgba(56,189,248,.15) 0%, transparent 40%);
  pointer-events: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  z-index: 1;
}

.org-logo {
  width: 52px;
  height: 52px;
  object-fit: contain;
  background: #fff;
  border-radius: 12px;
  padding: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}

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

.brand-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.brand-sub {
  font-size: 12px;
  opacity: 0.75;
  font-weight: 400;
}

.org-name {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  opacity: 0.9;
  position: relative;
  z-index: 1;
}

.org-name i { font-size: 18px; }

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--warning);
  box-shadow: 0 0 0 4px rgba(245,158,11,.25);
  transition: all .3s;
}
.status-dot.ok {
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(16,185,129,.25);
}
.status-dot.error {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(239,68,68,.25);
}

/* ═══ Container ═══ */
.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 40px 32px 80px;
}

.hero { margin-bottom: 32px; }

.hero h1 {
  font-size: 30px;
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}

.hero-sub {
  font-size: 14px;
  color: var(--gray-500);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ═══ Stats Row ═══ */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  transition: transform .2s, box-shadow .2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 22px;
}

.stat-icon.icon-blue  { background: #e0f2fe; color: #0369a1; }
.stat-icon.icon-amber { background: #fef3c7; color: #b45309; }
.stat-icon.icon-green { background: #d1fae5; color: #047857; }

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1.2;
}

.stat-label {
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 2px;
}

/* ═══ Loading ═══ */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 60px 20px;
  color: var(--gray-500);
  font-size: 14px;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.error {
  padding: 16px 20px;
  background: #fef2f2;
  color: #991b1b;
  border-radius: var(--radius);
  border: 1px solid #fecaca;
  margin-bottom: 20px;
  font-size: 14px;
}

/* ═══ Patients Grid ═══ */
.patients-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 18px;
}

.patient-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  position: relative;
  transition: transform .2s, box-shadow .2s, border-color .2s;
  cursor: pointer;
  overflow: hidden;
}

.patient-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--primary), var(--accent));
  transition: width .2s;
}

.patient-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
}

.patient-card:hover::before { width: 6px; }

.patient-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.patient-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-light), #bae6fd);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  color: var(--primary-dark);
  flex-shrink: 0;
}

.patient-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 4px;
}

.patient-meta {
  font-size: 12.5px;
  color: var(--gray-500);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.patient-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.patient-meta i { font-size: 13px; }

.patient-info {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--gray-100);
}

.badge {
  font-size: 12px;
  padding: 5px 11px;
  border-radius: 8px;
  background: var(--gray-100);
  color: var(--gray-700);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.badge i { font-size: 14px; }

.badge.diagnosis {
  background: #fef3c7;
  color: #92400e;
}

.badge.ward {
  background: var(--primary-light);
  color: var(--primary-dark);
}


/* ═══ Modal ═══ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.55);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn .2s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal {
  background: #fff;
  border-radius: 18px;
  width: 100%;
  max-width: 900px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 60px rgba(15,23,42,.3);
  animation: slideUp .25s cubic-bezier(.2,.8,.2,1);
  overflow: hidden;
}

.modal-header {
  padding: 22px 26px;
  background: linear-gradient(135deg, #0c4a6e 0%, #0369a1 100%);
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
}

.patient-avatar.large {
  width: 56px;
  height: 56px;
  font-size: 20px;
  background: rgba(255,255,255,.15);
  color: #fff;
  border: 2px solid rgba(255,255,255,.25);
}

.modal-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 3px;
}

.modal-sub {
  font-size: 13px;
  opacity: 0.85;
}

.modal-close {
  background: rgba(255,255,255,.12);
  border: 0;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}

.modal-close:hover { background: rgba(255,255,255,.25); }

.modal-body {
  padding: 24px 26px 30px;
  overflow-y: auto;
  flex: 1;
}

.modal-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-section-title i {
  color: var(--primary);
  font-size: 18px;
}

.modal-info-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 22px;
}

.info-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  background: var(--gray-100);
  border-radius: 9px;
  font-size: 13px;
  color: var(--gray-700);
}

.info-chip i { color: var(--primary); font-size: 15px; }

/* ═══ Test Groups ═══ */
.test-group {
  margin-bottom: 20px;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  overflow: hidden;
}

.test-group-header {
  padding: 12px 16px;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.test-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--gray-900);
  display: flex;
  align-items: center;
  gap: 8px;
}

.test-name i { color: var(--primary); font-size: 16px; }

.test-count {
  font-size: 12px;
  padding: 3px 9px;
  background: var(--primary-light);
  color: var(--primary-dark);
  border-radius: 6px;
  font-weight: 600;
}

.test-results {
  display: flex;
  flex-direction: column;
}

.result-row {
  display: grid;
  grid-template-columns: 1.4fr 1.5fr 1.2fr 1fr;
  gap: 12px;
  padding: 12px 16px;
  font-size: 13px;
  border-bottom: 1px solid var(--gray-100);
  align-items: center;
}

.result-row:last-child { border-bottom: 0; }

.result-row.latest {
  background: linear-gradient(90deg, #eff6ff 0%, transparent 70%);
  position: relative;
}

.result-row.latest::before {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--primary);
}

.result-value {
  font-weight: 700;
  color: var(--gray-900);
}

.result-unit {
  font-size: 11px;
  color: var(--gray-500);
  font-weight: 400;
  margin-right: 4px;
}

.result-date {
  color: var(--gray-500);
  font-size: 12px;
}

.result-source {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--gray-700);
  font-weight: 500;
}

.source-tag {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}

.source-tag.kowsar { background: #dbeafe; color: #1e40af; }
.source-tag.pasteur { background: #fce7f3; color: #9d174d; }
.source-tag.towhid  { background: #d1fae5; color: #065f46; }

.result-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  margin-right: 6px;
}

.result-badge.normal { background: #d1fae5; color: #065f46; }
.result-badge.high   { background: #fee2e2; color: #991b1b; }
.result-badge.low    { background: #fef3c7; color: #92400e; }

/* ═══ Alert Box ═══ */
.alert-box {
  padding: 14px 16px;
  border-radius: 12px;
  margin-bottom: 20px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 13.5px;
  line-height: 1.6;
}

.alert-box.warn {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #78350f;
}

.alert-box.info {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
}

.alert-box.danger {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.alert-box i {
  font-size: 20px;
  flex-shrink: 0;
  margin-top: 1px;
}

.alert-box strong { font-weight: 700; }


/* ═══ Modal Footer ═══ */
.modal-footer {
  padding: 16px 26px;
  border-top: 1px solid var(--gray-200);
  background: var(--gray-50);
  display: flex;
  justify-content: flex-end;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: linear-gradient(135deg, #0369a1, #075985);
  color: #fff;
  border: 0;
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(3,105,161,.3);
  transition: transform .15s, box-shadow .15s;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(3,105,161,.4);
}

.btn-primary i { font-size: 18px; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  background: #fff;
  color: var(--gray-700);
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}

.btn-secondary:hover { background: var(--gray-50); }

.btn-warning {
  background: linear-gradient(135deg, #d97706, #b45309);
  box-shadow: 0 2px 8px rgba(217,119,6,.3);
}

.btn-warning:hover { box-shadow: 0 4px 14px rgba(217,119,6,.4); }

.btn-danger {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  box-shadow: 0 2px 8px rgba(220,38,38,.3);
}

.btn-danger:hover { box-shadow: 0 4px 14px rgba(220,38,38,.4); }

/* ═══ Order Dialog ═══ */
.modal.modal-small { max-width: 560px; }

.test-picker {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-bottom: 20px;
}

.test-option {
  padding: 14px 16px;
  background: #fff;
  border: 1.5px solid var(--gray-200);
  border-radius: 11px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all .15s;
  font-family: inherit;
  text-align: right;
}

.test-option:hover {
  border-color: var(--primary);
  background: #f0f9ff;
}

.test-option.selected {
  border-color: var(--primary);
  background: #e0f2fe;
  box-shadow: 0 0 0 3px rgba(3,105,161,.1);
}

.test-option-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--gray-900);
  display: flex;
  align-items: center;
  gap: 10px;
}

.test-option-name i { color: var(--primary); font-size: 18px; }

.test-option-code {
  font-size: 11px;
  color: var(--gray-500);
  background: var(--gray-100);
  padding: 2px 8px;
  border-radius: 5px;
  margin-right: 6px;
}

/* ═══ CDS Alert ═══ */
.cds-alert {
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 18px;
  animation: slideUp .25s ease;
}

.cds-alert.warning {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 1.5px solid #fbbf24;
}

.cds-alert.info {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border: 1.5px solid #93c5fd;
}

.cds-alert.danger {
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
  border: 1.5px solid #fca5a5;
}

.cds-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.cds-header i {
  font-size: 24px;
  flex-shrink: 0;
  margin-top: 2px;
}

.cds-alert.warning .cds-header i { color: #d97706; }
.cds-alert.info .cds-header i { color: #0369a1; }
.cds-alert.danger .cds-header i { color: #dc2626; }

.cds-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--gray-900);
}

.cds-sub {
  font-size: 13px;
  color: var(--gray-700);
  line-height: 1.6;
}

/* ═══ Why Panel ═══ */
.why-toggle {
  background: rgba(255,255,255,.6);
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 9px;
  padding: 9px 14px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--gray-700);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}

.why-toggle:hover { background: #fff; }

.why-panel {
  margin-top: 12px;
  padding: 14px;
  background: rgba(255,255,255,.7);
  border-radius: 10px;
  display: none;
}

.why-panel.open { display: block; }

.why-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  font-size: 12.5px;
  color: var(--gray-700);
  border-bottom: 1px dashed rgba(0,0,0,.06);
}

.why-item:last-child { border-bottom: 0; }

.why-item-num {
  width: 22px;
  height: 22px;
  background: var(--primary-light);
  color: var(--primary-dark);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.why-weight {
  margin-right: auto;
  height: 5px;
  width: 70px;
  background: var(--gray-200);
  border-radius: 3px;
  position: relative;
  overflow: hidden;
}

.why-weight::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  border-radius: 3px;
  background: var(--primary);
}

.why-weight.w-high::after   { width: 85%; background: #0369a1; }
.why-weight.w-mid::after    { width: 55%; background: #0891b2; }
.why-weight.w-low::after    { width: 30%; background: #64748b; }

/* ═══ Actions ═══ */
.cds-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

/* ═══ Reason Form ═══ */
.reason-form {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed rgba(0,0,0,.1);
  display: none;
}

.reason-form.open { display: block; }

.reason-form label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 8px;
}

.reason-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.reason-radio {
  padding: 10px 12px;
  background: #fff;
  border: 1.5px solid var(--gray-200);
  border-radius: 9px;
  cursor: pointer;
  font-size: 12.5px;
  font-family: inherit;
  text-align: right;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all .15s;
}

.reason-radio:hover { border-color: var(--primary); }

.reason-radio.selected {
  border-color: var(--primary);
  background: #e0f2fe;
  color: var(--primary-dark);
  font-weight: 600;
}

.reason-radio i { color: var(--primary); font-size: 16px; }

/* ═══ Success / Saved Screen ═══ */
.result-screen {
  text-align: center;
  padding: 30px 20px;
}

.result-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  animation: popIn .35s cubic-bezier(.2,.8,.2,1);
}

@keyframes popIn {
  0%   { transform: scale(0); opacity: 0; }
  60%  { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}

.result-icon.success { background: #d1fae5; color: #059669; }
.result-icon.warning { background: #fef3c7; color: #d97706; }

.result-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 6px;
}

.result-text {
  font-size: 13.5px;
  color: var(--gray-500);
  margin-bottom: 20px;
}

/* ═══ Toast ═══ */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #0f172a;
  color: #fff;
  padding: 14px 22px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: 0 12px 32px rgba(0,0,0,.3);
  z-index: 2000;
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  transition: all .3s cubic-bezier(.2,.8,.2,1);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast i { font-size: 20px; }
.toast.success i { color: #10b981; }
.toast.warn i { color: #f59e0b; }

/* ═══ Live counter animation ═══ */
.stat-value.bump {
  animation: bump .5s cubic-bezier(.2,.8,.2,1);
}

@keyframes bump {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.15); color: #10b981; }
  100% { transform: scale(1); }
}


/* ═══ Button System v2 ═══ */
.btn-primary,
.btn-secondary,
.btn-warning,
.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: 0;
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s, background .15s;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary,
.btn-warning,
.btn-danger {
  color: #fff;
}

.btn-primary {
  background: linear-gradient(135deg, #0369a1, #075985);
  box-shadow: 0 2px 8px rgba(3,105,161,.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(3,105,161,.4);
}

.btn-warning {
  background: linear-gradient(135deg, #d97706, #b45309);
  box-shadow: 0 2px 8px rgba(217,119,6,.3);
}

.btn-warning:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(217,119,6,.4);
}

.btn-danger {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  box-shadow: 0 2px 8px rgba(220,38,38,.3);
}

.btn-danger:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(220,38,38,.4);
}

.btn-secondary {
  background: #fff;
  color: var(--gray-700);
  border: 1px solid var(--gray-200);
}

.btn-secondary:hover {
  background: var(--gray-50);
  border-color: var(--gray-500);
}

.btn-primary i,
.btn-secondary i,
.btn-warning i,
.btn-danger i {
  font-size: 18px;
  line-height: 1;
}

/* ═══ Fix v2: Toast / Modal text ═══ */
.toast {
  font-family: inherit;
}

.toast i {
  font-family: 'Phosphor' !important;
  font-style: normal;
  line-height: 1;
}

/* ═══ Fix v2: Reason Radio ═══ */
.reason-radio {
  font-family: inherit;
  line-height: 1.4;
}

.reason-radio i {
  font-family: 'Phosphor' !important;
  font-style: normal;
  font-size: 16px;
  line-height: 1;
}

/* ═══ Fix v2: test-option ═══ */
.test-option {
  font-family: inherit;
}

.test-option i {
  font-family: 'Phosphor' !important;
  font-style: normal;
}

/* ═══ Fix v2: why-toggle ═══ */
.why-toggle {
  font-family: inherit;
  line-height: 1.4;
}

.why-toggle i {
  font-family: 'Phosphor' !important;
  font-style: normal;
  font-size: 15px;
}

/* ═══ Fix v2: modal-close ═══ */
.modal-close i {
  font-family: 'Phosphor' !important;
  font-style: normal;
  font-size: 20px;
  line-height: 1;
}


/* ═══ Vertical Patients List ═══ */
.patients-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.patient-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 18px 22px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  position: relative;
  transition: transform .2s, box-shadow .2s, border-color .2s;
  cursor: pointer;
  overflow: hidden;
}

.patient-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--primary), var(--accent));
  transition: width .2s;
}

.patient-card:hover {
  transform: translateX(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
}

.patient-card:hover::before { width: 6px; }

.patient-card .patient-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 10px;
}

.patient-card .patient-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-900);
  flex: 1;
}

.patient-card .patient-avatar {
  width: 42px;
  height: 42px;
  font-size: 15px;
}

.patient-card .patient-meta {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--gray-500);
  margin-bottom: 10px;
}

.patient-card .patient-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.patient-card .patient-info {
  display: flex;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--gray-100);
}

/* ═══ Highlight Stat (Savings) ═══ */
.stat-highlight {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border: 2px solid #86efac;
  box-shadow: 0 4px 20px rgba(16,185,129,.15);
  position: relative;
  overflow: hidden;
}

.stat-highlight::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 50%, rgba(16,185,129,.08) 0%, transparent 60%);
  pointer-events: none;
}

.stat-highlight .stat-value.saving-value {
  font-size: 28px;
  color: #059669;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.stat-highlight .stat-label {
  color: #047857;
  font-weight: 600;
}

.stat-highlight .stat-icon.icon-green {
  background: #d1fae5;
  color: #059669;
}

.saving-value.bump {
  animation: bumpSaving .6s cubic-bezier(.2,.8,.2,1);
}

@keyframes bumpSaving {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.2); color: #047857; }
  100% { transform: scale(1); }
}

/* ═══ Clickable Stat ═══ */
.stat-clickable {
  cursor: pointer;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}

.stat-clickable:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
}

.stat-clickable.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(3,105,161,.15);
}

/* ═══ Alerts Panel ═══ */
.alerts-panel {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid #fde68a;
  box-shadow: var(--shadow-md);
  margin-bottom: 24px;
  overflow: hidden;
  animation: slideUp .25s ease;
}

.alerts-header {
  padding: 16px 20px;
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  border-bottom: 1px solid #fde68a;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.alerts-header h3 {
  font-size: 15px;
  font-weight: 700;
  color: #92400e;
  display: flex;
  align-items: center;
  gap: 8px;
}

.alerts-header h3 i { font-size: 20px; }

.alerts-list {
  padding: 12px;
}

.alert-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  cursor: pointer;
  transition: background .15s;
  border-bottom: 1px solid var(--gray-100);
}

.alert-item:last-child { border-bottom: 0; }

.alert-item:hover { background: #fef9c3; }

.alert-item-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #92400e;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

.alert-item-info { flex: 1; }

.alert-item-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-900);
}

.alert-item-reason {
  font-size: 12px;
  color: #92400e;
  margin-top: 2px;
}

.alert-item-badge {
  font-size: 11px;
  padding: 3px 8px;
  background: #fde68a;
  color: #78350f;
  border-radius: 6px;
  font-weight: 600;
}

/* ═══ Guideline Link ═══ */
.guideline-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #0369a1;
  text-decoration: none;
  padding: 2px 8px;
  border-radius: 5px;
  background: #e0f2fe;
  transition: background .15s;
  margin-right: 6px;
  font-weight: 600;
}

.guideline-link:hover { background: #bae6fd; text-decoration: underline; }

.guideline-link i { font-size: 12px; }


/* ═══ Alerts Modal ═══ */
.modal.modal-medium { max-width: 720px; }

.modal-header-amber {
  background: linear-gradient(135deg, #b45309 0%, #d97706 100%) !important;
}

.avatar-amber {
  background: rgba(255,255,255,.15) !important;
  color: #fff !important;
  border: 2px solid rgba(255,255,255,.25) !important;
}

.alert-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: 12px;
  cursor: pointer;
  transition: all .15s;
  border-bottom: 1px solid var(--gray-100);
  margin-bottom: 4px;
}

.alert-item:last-child { border-bottom: 0; margin-bottom: 0; }

.alert-item:hover {
  background: #fffbeb;
  transform: translateX(-3px);
}

.alert-item-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #92400e;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.alert-item-info { flex: 1; min-width: 0; }

.alert-item-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 3px;
}

.alert-item-reason {
  font-size: 12.5px;
  color: #92400e;
  line-height: 1.5;
}

.alert-item-reason .reason-tag {
  display: inline-block;
  background: #fef3c7;
  padding: 2px 8px;
  border-radius: 5px;
  font-size: 11px;
  margin-left: 4px;
  font-weight: 600;
}

.alert-item-badge {
  font-size: 11.5px;
  padding: 4px 10px;
  background: #fde68a;
  color: #78350f;
  border-radius: 7px;
  font-weight: 700;
  white-space: nowrap;
}

/* ═══ PT/INR Info box ═══ */
.no-threshold-note {
  padding: 8px 12px;
  background: rgba(255,255,255,.6);
  border-radius: 8px;
  font-size: 11.5px;
  color: var(--gray-600, #475569);
  margin-top: 8px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.6;
}

.no-threshold-note i {
  color: var(--primary);
  font-size: 15px;
  margin-top: 1px;
  flex-shrink: 0;
}

/* ═══ Test evidence badge ═══ */
.evidence-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  padding: 3px 9px;
  border-radius: 6px;
  font-weight: 600;
  margin-top: 6px;
}

.evidence-badge.guideline {
  background: #dcfce7;
  color: #166534;
}

.evidence-badge.demo {
  background: #e0e7ff;
  color: #3730a3;
}

.evidence-badge.indication {
  background: #fef3c7;
  color: #92400e;
}


/* ═══ Landing & Roles ═══ */
.landing {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background: linear-gradient(160deg, #0c4a6e 0%, #0369a1 50%, #0ea5e9 100%);
  position: relative;
  overflow: hidden;
}

.landing::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 15% 20%, rgba(255,255,255,.12) 0%, transparent 35%),
    radial-gradient(circle at 85% 80%, rgba(56,189,248,.2) 0%, transparent 40%);
  pointer-events: none;
}

.landing-header {
  text-align: center;
  color: #fff;
  margin-bottom: 48px;
  position: relative;
  z-index: 1;
}

.landing-logo {
  width: 88px;
  height: 88px;
  background: #fff;
  border-radius: 22px;
  padding: 10px;
  margin-bottom: 20px;
  box-shadow: 0 12px 40px rgba(0,0,0,.25);
}

.landing-header h1 {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.8px;
  margin-bottom: 8px;
  color: #fff;
}

.landing-sub { font-size: 15px; opacity: 0.85; margin-bottom: 6px; color: #fff; }
.landing-org { font-size: 13px; opacity: 0.7; color: #fff; }

.roles-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  max-width: 720px;
  width: 100%;
  position: relative;
  z-index: 1;
}

.role-card {
  background: #fff;
  border: 0;
  border-radius: 20px;
  padding: 32px 28px;
  cursor: pointer;
  text-align: right;
  font-family: inherit;
  transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s;
  box-shadow: 0 8px 32px rgba(0,0,0,.15);
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  overflow: hidden;
}

.role-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

.role-card:hover { transform: translateY(-6px); box-shadow: 0 20px 48px rgba(0,0,0,.25); }

.role-icon {
  width: 64px; height: 64px;
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  font-size: 32px;
}

.role-icon-physician { background: linear-gradient(135deg, #dbeafe, #bfdbfe); color: #1e40af; }
.role-icon-insurance { background: linear-gradient(135deg, #d1fae5, #a7f3d0); color: #047857; }

.role-title { font-size: 20px; font-weight: 800; color: var(--gray-900); letter-spacing: -0.3px; }
.role-desc { font-size: 13px; color: var(--gray-500); line-height: 1.7; flex: 1; }

.role-enter {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 700; color: var(--primary); margin-top: 4px;
}

.role-enter i { font-size: 16px; transition: transform .2s; }
.role-card:hover .role-enter i { transform: translateX(-4px); }

.landing-footer { margin-top: 40px; text-align: center; color: #fff; position: relative; z-index: 1; }

.demo-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 20px;
  font-size: 12px; font-weight: 600; margin-bottom: 8px;
  backdrop-filter: blur(10px);
}

.demo-badge i { font-size: 14px; }
.demo-note { display: block; font-size: 11.5px; opacity: 0.7; }

/* ═══ Role Indicator ═══ */
.role-indicator { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }

.role-badge {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 12px;
  backdrop-filter: blur(10px);
}

.role-badge > i { font-size: 22px; color: #fff; opacity: 0.9; }
.role-badge-text { display: flex; flex-direction: column; }
.role-badge-label { font-size: 10px; opacity: 0.7; color: #fff; text-transform: uppercase; letter-spacing: 0.5px; }
.role-badge-name { font-size: 13px; font-weight: 700; color: #fff; }

.switch-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  background: rgba(255,255,255,.95);
  color: #0369a1;
  border: 0; border-radius: 10px;
  font-family: inherit; font-size: 12.5px; font-weight: 700;
  cursor: pointer;
  transition: background .15s, transform .15s;
}

.switch-btn:hover { background: #fff; transform: translateY(-1px); }
.switch-btn i { font-size: 15px; }

/* ═══ Stats Rows ═══ */
.stats-row-2 { grid-template-columns: repeat(2, 1fr); max-width: 640px; }
.stats-row-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

.stat-amber {
  border-color: #fde68a;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}

.stat-amber:hover { border-color: #fbbf24; }
.stat-amber .stat-icon.icon-amber { background: #fef3c7; color: #b45309; }

/* ═══ Insurance Dashboard ═══ */
.ins-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }

.ins-card {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.ins-card-header {
  padding: 16px 20px;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
  display: flex; align-items: center; gap: 10px;
}

.ins-card-header i { color: var(--primary); font-size: 20px; }
.ins-card-header h3 { font-size: 14px; font-weight: 700; color: var(--gray-900); }

.ins-card-body { padding: 16px 20px; max-height: 360px; overflow-y: auto; }

.ins-table { width: 100%; border-collapse: collapse; font-size: 13px; }

.ins-table th {
  text-align: right;
  padding: 10px 8px;
  font-size: 11.5px; font-weight: 700;
  color: var(--gray-500);
  border-bottom: 2px solid var(--gray-200);
  text-transform: uppercase; letter-spacing: 0.3px;
}

.ins-table td {
  padding: 12px 8px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700);
}

.ins-table td:first-child { font-weight: 700; color: var(--gray-900); }
.ins-table tr:last-child td { border-bottom: 0; }
.ins-table .highlight-cell { color: #059669; font-weight: 700; }
.ins-table .zero-cell { color: var(--gray-400, #94a3b8); }

.audit-entry {
  padding: 12px 0;
  border-bottom: 1px dashed var(--gray-100);
  display: flex; gap: 12px; align-items: flex-start;
}

.audit-entry:last-child { border-bottom: 0; }

.audit-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 15px;
}

.audit-icon.cancel { background: #fee2e2; color: #b91c1c; }
.audit-icon.override { background: #fef3c7; color: #b45309; }
.audit-icon.submit { background: #d1fae5; color: #047857; }

.audit-content { flex: 1; min-width: 0; }

.audit-title { font-size: 13px; font-weight: 600; color: var(--gray-900); margin-bottom: 3px; }

.audit-meta {
  font-size: 11.5px;
  color: var(--gray-500);
  display: flex; flex-wrap: wrap; gap: 8px;
}

.audit-meta .audit-reason { color: #92400e; font-weight: 500; }

/* ═══ Quality Grid ═══ */
.quality-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }

.quality-item {
  padding: 16px;
  background: var(--gray-50);
  border-radius: 12px;
  text-align: center;
  border: 1px solid var(--gray-100);
}

.quality-value { font-size: 20px; font-weight: 800; margin-bottom: 6px; letter-spacing: -0.3px; }
.quality-value.ok { color: #059669; }
.quality-value.neutral { color: #0369a1; }
.quality-value.warn { color: #d97706; }
.quality-label { font-size: 11.5px; color: var(--gray-500); font-weight: 500; }

@media (max-width: 720px) {
  .roles-grid { grid-template-columns: 1fr; }
  .ins-grid { grid-template-columns: 1fr; }
  .stats-row-2 { grid-template-columns: 1fr; }
}


/* ═══ fix-11 Additions ═══ */

/* Icon purple */
.stat-icon.icon-purple { background: #ede9fe; color: #6d28d9; }

/* Today card (physician) */
.today-card {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.today-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.today-header i {
  color: var(--primary);
  font-size: 20px;
}

.today-header h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--gray-900);
}

.today-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.today-item {
  text-align: center;
  padding: 12px 8px;
  background: #fff;
  border-radius: 10px;
  border: 1px solid var(--gray-100);
}

.today-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: 4px;
  letter-spacing: -0.3px;
}

.today-value.ok { color: #059669; }
.today-value.cancel { color: #dc2626; }
.today-value.override { color: #d97706; }

.today-label {
  font-size: 11.5px;
  color: var(--gray-500);
  font-weight: 500;
}

/* Insurance hint */
.ins-hint {
  margin-right: auto;
  font-size: 11px;
  color: var(--gray-500);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
}

.ins-hint i { font-size: 13px; color: var(--primary); }

/* Audit badge + methodology button */
.audit-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: #dcfce7;
  color: #166534;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 600;
  margin-right: auto;
}

.audit-badge i { font-size: 13px; }

.methodology-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  background: #e0f2fe;
  color: #0369a1;
  border: 0;
  border-radius: 8px;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
}

.methodology-btn:hover { background: #bae6fd; }
.methodology-btn i { font-size: 14px; }

/* Quality value denominator */
.quality-denom {
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-500);
  margin-right: 4px;
}

.quality-source {
  font-size: 10.5px;
  color: var(--gray-400, #94a3b8);
  margin-top: 4px;
}

/* Override chart */
.override-chart {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 4px 0;
}

.override-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.override-label {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--gray-700);
}

.override-pct {
  color: var(--primary);
  font-weight: 800;
}

.override-bar {
  height: 10px;
  background: var(--gray-100);
  border-radius: 5px;
  overflow: hidden;
  position: relative;
}

.override-bar-fill {
  height: 100%;
  border-radius: 5px;
  background: linear-gradient(90deg, #0369a1, #0ea5e9);
  transition: width .5s cubic-bezier(.2,.8,.2,1);
}

.override-bar-fill.r1 { background: linear-gradient(90deg, #0369a1, #0ea5e9); }
.override-bar-fill.r2 { background: linear-gradient(90deg, #0891b2, #22d3ee); }
.override-bar-fill.r3 { background: linear-gradient(90deg, #7c3aed, #a78bfa); }
.override-bar-fill.r4 { background: linear-gradient(90deg, #64748b, #94a3b8); }

/* Audit trail eye button */
.audit-eye {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--gray-100);
  color: var(--gray-700);
  border: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s;
  flex-shrink: 0;
}

.audit-eye:hover { background: #e0f2fe; color: #0369a1; }
.audit-eye i { font-size: 15px; }

/* Audit trail modal content */
.audit-trail-header {
  background: linear-gradient(135deg, #0369a1, #0ea5e9);
  color: #fff;
  padding: 16px 20px;
  border-radius: 12px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.audit-trail-id {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.audit-trail-meta {
  font-size: 12px;
  opacity: 0.85;
}

.audit-timeline {
  position: relative;
  padding-right: 24px;
}

.audit-timeline::before {
  content: '';
  position: absolute;
  right: 8px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(180deg, #bfdbfe, #dbeafe);
}

.timeline-item {
  position: relative;
  padding: 10px 0 14px 0;
}

.timeline-item::before {
  content: '';
  position: absolute;
  right: -22px;
  top: 14px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid #0369a1;
  z-index: 1;
}

.timeline-item.success::before { border-color: #10b981; }
.timeline-item.warn::before { border-color: #f59e0b; }
.timeline-item.info::before { border-color: #0369a1; }

.timeline-time {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--gray-500);
  margin-bottom: 3px;
}

.timeline-text {
  font-size: 13px;
  color: var(--gray-900);
  line-height: 1.6;
}

.timeline-text strong { color: #0369a1; }

.audit-followup {
  background: var(--gray-50);
  border-radius: 10px;
  padding: 14px 16px;
  margin-top: 16px;
  border: 1px solid var(--gray-100);
}

.audit-followup-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--gray-700);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.followup-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: var(--gray-700);
  padding: 6px 0;
}

.followup-check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #d1fae5;
  color: #059669;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}

.audit-final-status {
  margin-top: 14px;
  padding: 12px 16px;
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  border: 1px solid #86efac;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  color: #065f46;
}

.audit-final-status i { font-size: 18px; }

/* Financial modal */
.avatar-fin {
  background: rgba(16,185,129,.15) !important;
  color: #059669 !important;
  border: 2px solid rgba(16,185,129,.25) !important;
}

.avatar-audit {
  background: rgba(3,105,161,.15) !important;
  color: #0369a1 !important;
  border: 2px solid rgba(3,105,161,.25) !important;
}

.fin-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fin-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px dashed var(--gray-100);
  font-size: 13px;
}

.fin-row:last-child { border-bottom: 0; }

.fin-row-label {
  color: var(--gray-700);
  display: flex;
  align-items: center;
  gap: 8px;
}

.fin-row-label i { color: var(--gray-500); font-size: 15px; }

.fin-row-value {
  font-weight: 700;
  color: var(--gray-900);
}

.fin-row-value.big {
  font-size: 18px;
  color: #059669;
  font-weight: 800;
}

.fin-total {
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  border: 1px solid #86efac;
  border-radius: 10px;
  padding: 16px;
  margin-top: 14px;
}

.fin-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.fin-total-label {
  font-size: 13px;
  font-weight: 700;
  color: #065f46;
}

.fin-total-value {
  font-size: 22px;
  font-weight: 800;
  color: #059669;
  letter-spacing: -0.5px;
}

/* Methodology content */
.methodology-content p {
  font-size: 13px;
  color: var(--gray-700);
  margin-bottom: 16px;
  line-height: 1.7;
}

.method-item {
  display: flex;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--gray-100);
}

.method-item:last-of-type { border-bottom: 0; }

.method-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e0f2fe;
  color: #0369a1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  flex-shrink: 0;
}

.method-item strong {
  display: block;
  font-size: 13.5px;
  color: var(--gray-900);
  margin-bottom: 3px;
}

.method-item p {
  font-size: 12.5px;
  color: var(--gray-500);
  margin: 0;
  line-height: 1.6;
}

.method-framework {
  margin-top: 16px;
  padding: 14px 16px;
  background: var(--gray-50);
  border-radius: 10px;
  border: 1px solid var(--gray-100);
}

.method-framework-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--gray-700);
  margin-bottom: 8px;
}

.method-framework ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.method-framework li {
  font-size: 12.5px;
  color: var(--gray-700);
  padding: 4px 0;
  padding-right: 18px;
  position: relative;
}

.method-framework li::before {
  content: '✓';
  position: absolute;
  right: 0;
  color: #059669;
  font-weight: 700;
}

.method-warning {
  margin-top: 16px;
  padding: 12px 14px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 10px;
  display: flex;
  gap: 10px;
  font-size: 12px;
  color: #78350f;
  line-height: 1.6;
}

.method-warning i {
  color: #d97706;
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

.method-warning strong { color: #92400e; }

/* Queue grid */
.queue-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.queue-item {
  padding: 18px;
  border-radius: 12px;
  text-align: center;
  border: 1px solid;
  transition: transform .15s;
}

.queue-item:hover { transform: translateY(-2px); }

.queue-item.high { background: #fef2f2; border-color: #fecaca; }
.queue-item.medium { background: #fffbeb; border-color: #fde68a; }
.queue-item.low { background: #f0fdf4; border-color: #bbf7d0; }

.queue-count {
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 4px;
  letter-spacing: -0.5px;
}

.queue-item.high .queue-count { color: #dc2626; }
.queue-item.medium .queue-count { color: #d97706; }
.queue-item.low .queue-count { color: #059669; }

.queue-label {
  font-size: 12px;
  font-weight: 600;
}

.queue-item.high .queue-label { color: #991b1b; }
.queue-item.medium .queue-label { color: #92400e; }
.queue-item.low .queue-label { color: #065f46; }

/* Clickable table row */
.ins-table tbody tr.clickable { cursor: pointer; transition: background .15s; }
.ins-table tbody tr.clickable:hover { background: #f0f9ff; }

@media (max-width: 720px) {
  .today-stats { grid-template-columns: repeat(2, 1fr); }
  .queue-grid { grid-template-columns: 1fr; }
}


/* ═══ fix-12 Additions ═══ */

/* Today card clickable */
.today-card {
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
}

.today-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.today-card-hint {
  margin-right: auto;
  font-size: 11px;
  color: var(--gray-500);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
}

.today-card-hint i {
  font-size: 13px;
  color: var(--primary);
}

/* Queue items clickable */
.queue-item {
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}

.queue-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,.08);
}

/* Queue modal header themes */
.modal-header-queue-high {
  background: linear-gradient(135deg, #b91c1c 0%, #dc2626 100%) !important;
}

.modal-header-queue-medium {
  background: linear-gradient(135deg, #b45309 0%, #d97706 100%) !important;
}

.modal-header-queue-low {
  background: linear-gradient(135deg, #047857 0%, #059669 100%) !important;
}

.avatar-queue {
  background: rgba(255,255,255,.15) !important;
  color: #fff !important;
  border: 2px solid rgba(255,255,255,.25) !important;
}

/* Queue case item */
.queue-case {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--gray-200);
  margin-bottom: 10px;
  cursor: pointer;
  transition: all .15s;
}

.queue-case:hover {
  border-color: var(--primary);
  background: #f0f9ff;
  transform: translateX(-3px);
}

.queue-case-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.queue-case-icon.high { background: #fee2e2; color: #b91c1c; }
.queue-case-icon.medium { background: #fef3c7; color: #b45309; }
.queue-case-icon.low { background: #d1fae5; color: #047857; }

.queue-case-content { flex: 1; min-width: 0; }

.queue-case-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.queue-case-code {
  font-size: 10.5px;
  padding: 2px 7px;
  background: var(--gray-100);
  color: var(--gray-500);
  border-radius: 5px;
  font-weight: 600;
}

.queue-case-meta {
  font-size: 11.5px;
  color: var(--gray-500);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.queue-case-arrow {
  color: var(--gray-400, #94a3b8);
  font-size: 18px;
  align-self: center;
  transition: transform .15s;
}

.queue-case:hover .queue-case-arrow {
  transform: translateX(-4px);
  color: var(--primary);
}

/* Today modal decisions */
.today-decision {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--gray-100);
}

.today-decision:last-child { border-bottom: 0; }

.today-decision-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.today-decision-icon.cancel { background: #fee2e2; color: #b91c1c; }
.today-decision-icon.override { background: #fef3c7; color: #b45309; }
.today-decision-icon.submit { background: #d1fae5; color: #047857; }

.today-decision-content { flex: 1; min-width: 0; }

.today-decision-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 4px;
}

.today-decision-meta {
  font-size: 11.5px;
  color: var(--gray-500);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.today-decision-reason {
  font-size: 11.5px;
  color: #92400e;
  font-weight: 500;
  margin-top: 4px;
  padding: 4px 8px;
  background: #fffbeb;
  border-radius: 5px;
  display: inline-block;
}

.today-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--gray-500);
}

.today-empty i {
  font-size: 40px;
  color: var(--gray-300, #cbd5e1);
  display: block;
  margin-bottom: 12px;
}


/* ═══ fix-13 Additions ═══ */

/* Insight list items (used in insurance detail modals) */
.insight-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.insight-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--gray-50);
  border: 1px solid var(--gray-100);
  border-radius: 10px;
  transition: background .15s, border-color .15s;
}

.insight-row:hover {
  background: #f0f9ff;
  border-color: var(--primary-light);
}

.insight-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.insight-icon.amber { background: #fef3c7; color: #b45309; }
.insight-icon.blue { background: #dbeafe; color: #1e40af; }
.insight-icon.green { background: #d1fae5; color: #047857; }
.insight-icon.purple { background: #ede9fe; color: #6d28d9; }

.insight-content { flex: 1; min-width: 0; }

.insight-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 3px;
}

.insight-meta {
  font-size: 11.5px;
  color: var(--gray-500);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.insight-value {
  font-size: 13px;
  font-weight: 700;
  color: #059669;
  white-space: nowrap;
}

.insight-value.neutral {
  color: var(--gray-900);
}

/* Big total in modal */
.insight-total {
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  border: 1px solid #86efac;
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 18px;
}

.insight-total-label {
  font-size: 12px;
  font-weight: 700;
  color: #065f46;
  margin-bottom: 6px;
}

.insight-total-value {
  font-size: 24px;
  font-weight: 800;
  color: #059669;
  letter-spacing: -0.5px;
}

.insight-total-value .unit {
  font-size: 13px;
  font-weight: 500;
  color: #047857;
}

/* Header themes */
.modal-header-amber {
  background: linear-gradient(135deg, #b45309 0%, #d97706 100%) !important;
}
.modal-header-blue {
  background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%) !important;
}
.modal-header-green {
  background: linear-gradient(135deg, #047857 0%, #059669 100%) !important;
}
.modal-header-purple {
  background: linear-gradient(135deg, #5b21b6 0%, #6d28d9 100%) !important;
}

.avatar-amber { background: rgba(255,255,255,.15) !important; color: #fff !important; border: 2px solid rgba(255,255,255,.25) !important; }
.avatar-blue { background: rgba(255,255,255,.15) !important; color: #fff !important; border: 2px solid rgba(255,255,255,.25) !important; }
.avatar-green { background: rgba(255,255,255,.15) !important; color: #fff !important; border: 2px solid rgba(255,255,255,.25) !important; }
.avatar-purple { background: rgba(255,255,255,.15) !important; color: #fff !important; border: 2px solid rgba(255,255,255,.25) !important; }

/* Queue counts dynamic */
.queue-count {
  transition: color .2s;
}

/* Empty state in modal */
.modal-empty {
  text-align: center;
  padding: 50px 20px;
  color: var(--gray-500);
}

.modal-empty i {
  font-size: 46px;
  color: var(--gray-300, #cbd5e1);
  display: block;
  margin-bottom: 12px;
}

.modal-empty-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--gray-700);
  margin-bottom: 6px;
}

.modal-empty-sub {
  font-size: 12.5px;
  color: var(--gray-500);
  line-height: 1.6;
}


/* ═══ fix-15 ═══ */
.today-hint {
  margin-right: auto;
  font-size: 11px;
  color: var(--gray-500);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
}

.today-hint i {
  font-size: 13px;
  color: var(--primary);
}

.today-card {
  cursor: default !important;
}

.today-item {
  cursor: pointer !important;
}
