/* ═══════════════════════════════════════════════════════════════
   RNI CLINICAL PORTAL — rni-clinical.css
   Surface: Clinical Portal | Accent: #43DBA3 (Clinical Green)
   Requires: rni-tokens.css (load first)
   Best-of-both merge: Clinical + Executive Master
   March 2026 — data that heals™
═══════════════════════════════════════════════════════════════ */

/* ── SECTION 1: SURFACE IDENTITY OVERRIDE ── */
/* Clinical green overrides on top of shared tokens */
.rni {
  --surface-accent:      var(--emerald);
  --surface-accent-dark: var(--emerald-dark);
  --surface-accent-light:var(--emerald-light);
  --nav-hover-bg:        rgba(67,219,163,0.05);
  --nav-active-bg:       rgba(67,219,163,0.08);
  --header-grad-start:   #2EBD8A;
  --header-grad-end:     #1FA577;
  --header-glow:         rgba(46,189,138,0.15);
}

 & WORDPRESS HIDE (NUCLEAR)
═══════════════════════════════════════════════════════════════════════════════ */

html, body {
  overflow-x: hidden;
  max-width: 100vw;
  margin: 0;
  padding: 0;
}

/* NUCLEAR: Hide ALL WordPress/Kallium/Admin elements everywhere */
.site-header, #site-header,
.kallium-header, .kallium-footer,
.footer-wrapper, #colophon, .site-info,
body > footer, #footer, .site-footer,
/* WordPress Admin Bar */
#wpadminbar, .wp-admin-bar, #adminbar,
/* WordPress Login/Auth elements */
.wp-login, #loginform, .login-form, .wp-login-form,
#wp-auth-check-wrap, #wp-auth-check, .wp-auth-check-close,
#wp-auth-check-form, .wp-auth-fallback-expired,
/* Generic login modals that plugins inject */
.login-modal, .signin-modal, .admin-login, .auth-modal,
[class*="login-popup"], [class*="signin-popup"],
[id*="login-modal"], [id*="signin-modal"],
/* Kallium specific */
.kallium-login, .theme-login, .theme-auth,
/* Any fixed/absolute positioned login overlays */
div[style*="position: fixed"][class*="login"],
div[style*="position: fixed"][class*="auth"],
div[style*="position: absolute"][class*="login"] {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  width: 0 !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  z-index: -9999 !important;
}

/* Ensure our Evidence Drawer is ABOVE any WordPress garbage */
.evidence-drawer {
  z-index: 9999 !important;
}

/* Ensure overlay doesn't let WordPress bleed through */
#overlay {
  z-index: 9998 !important;
}

.rni * { box-sizing: border-box; margin: 0; padding: 0; }
.rni {
  font-family: "Heebo", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  line-height: 1.6;
  background: var(--page-bg);
  overflow-x: hidden;
  max-width: 100vw;
}

/* ═══════════════════════════════════════════════════════════════════════════
   


═══════════════════════════════════════════════════════════════════════════════ */

.rni .page { display: flex; overflow-x: hidden; }
.rni .main { flex: 1; padding: 0; margin-left: 220px; max-width: calc(100vw - 220px); }
.rni .wrap { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

/* ═══════════════════════════════════════════════════════════════════════════
   

/* ── SECTION 2: CLINICAL BODY & SCROLLBAR ── */
 : AUDIT CLOSURE — Cross-Surface Template, 
   Clinician Override, Patient Self-Reports, Evidence Enforcement, Heartbeat
   Nav: Dashboard | My Caseload | Sessions | Communications | Performance
   Green discipline: heart, active nav, system dots, primary CTAs only
   Everything else: charcoal, slate, gold (achievement), white
   Template: Parameterized via RNI_SURFACE_CONFIG for all 7 client surfaces
═══════════════════════════════════════════════════════════════════════════ */

/* Sovereign Silence — no animation except heart + EKG */
.rni *:not(.heart):not(.ekg-line svg):not(.live-dot):not(.ehr-dot):not(.action-btn.critical) {
  animation-duration: 0s !important;
  animation-delay: 0s !important;
}
.rni .heart { animation: rniBeat 3s ease-in-out infinite !important; }
.rni .ekg-line svg { animation: ekg-scroll 3s linear infinite !important; }
.rni .live-dot { animation: livePulse 2s ease-in-out infinite !important; }
.rni .ehr-dot { animation: ehrPulse 2s ease-in-out infinite !important; }

.rni .detail-drawer,
.rni .toast-container .toast {
  transition: all 0.3s ease !important;
}

/* ═══ RESET & VARIABLES ═══ */
/* WordPress isolation — contain layout, prevent WP spillover */
.rni { position: relative; isolation: isolate; }
.rni .sidebar { overflow: hidden; }

html {
  height: auto !important; min-height: 100vh !important;
  overflow-y: scroll !important; overflow-x: hidden !important;
  margin: 0; padding: 0; scrollbar-width: none; -ms-overflow-style: none;
}
html::-webkit-scrollbar { display: none; }
*::-webkit-scrollbar { display: none; }
* { scrollbar-width: none; -ms-overflow-style: none; box-sizing: border-box; }

body {
  margin: 0; padding: 0; font-family: 'Heebo', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #F6F8FA; color: #1A1A2E; overflow-x: hidden;
}

/* :root variables → see rni-tokens.css */

/* ═══ DARK MODE ═══ */
.rni.dark {
  --charcoal: #E6EDF3;
  --ink: #E6EDF3;
  --slate: #B1BAC4;
  --muted: #8B949E;
  --light: #6E7681;
  --border: #30363D;
  --border-light: #21262D;
  --bg: #0D1117;
  --white: #161B22;
  --emerald-light: rgba(67,219,163,0.10);
  --gold-light: rgba(212,175,55,0.12);
  --red-light: #3D1F1F;
  --amber-light: #3D2E10;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.5);
}
/* Sidebar */
.rni.dark .sidebar { background: #0D1117; border-right-color: #30363D; }
.rni.dark .heart { filter: brightness(0) saturate(100%) invert(70%) sepia(52%) saturate(600%) hue-rotate(106deg) brightness(110%) contrast(90%); }
.rni.dark .nav a:hover { background: rgba(67,219,163,0.08); }
.rni.dark .nav a:hover span { color: #7EE2B8; }
.rni.dark .nav a.active span { color: #E6EDF3; }
.rni.dark .nav a i { color: #6E7681; }
.rni.dark .nav a span { color: #8B949E; }
.rni.dark .divider { background: #30363D; }
.rni.dark .nav a.logout-link:hover { background: #3D1F1F; }
/* Table hover */
.rni.dark .s-table tr:hover td { background: #1C2128; }
.rni.dark .s-table tr[data-risk="high"]:hover td { background: #2A1215; }
.rni.dark .s-table tr[data-risk="med"]:hover td { background: #2A2210; }
.rni.dark .s-table tr[data-risk="low"]:hover td { background: #0F2A1C; }
/* Patient avatar */
.rni.dark .pt-avatar { background: #21262D; color: #8B949E; }
/* Risk badges */
.rni.dark .risk.high { background: #3D1F1F; color: #F97583; }
.rni.dark .risk.med { background: #3D2E10; color: #E3B341; }
.rni.dark .risk.low { background: #0F2A1C; color: #56D364; }
.rni.dark .task-tag.urgent { background: #3D1F1F; color: #F97583; }
.rni.dark .task-tag.soon { background: #3D2E10; color: #E3B341; }
.rni.dark .task-tag.ok { background: #0F2A1C; color: #56D364; }
/* Cards, tiles */
.rni.dark .tile:hover { border-color: #484F58; }
.rni.dark .tile::after { background: #30363D; }
/* Schedule hover */
.rni.dark .schedule-item:hover { background: #1C2128; }
/* Notifications */
.rni.dark .notif-item:hover { background: #1C2128; }
/* Message threads */
.rni.dark .msg-thread:hover { border-color: #484F58; }
.rni.dark .msg-avatar { background: #21262D; color: #8B949E; }
.rni.dark .msg-action-btn:hover { background: #21262D; }
/* Bubbles */
.rni.dark .msg-bubble.incoming { background: #21262D; }
.rni.dark .msg-bubble.outgoing { background: rgba(67,219,163,0.10); }
/* Evidence card */
.rni.dark .evidence-card { background: #161B22; }
/* Flag/Override/Perf modal bodies */
.rni.dark .flag-modal { background: #161B22; }
.rni.dark .override-modal { background: #161B22; }
.rni.dark .override-original { background: #21262D; }
.rni.dark .override-confirm-row { background: #3D1F1F; color: #F97583; }
.rni.dark .flag-modal-footer { background: #0D1117; border-top-color: #30363D; }
.rni.dark .override-modal-footer { background: #0D1117; border-top-color: #30363D; }
/* Consent */
.rni.dark .consent-doc-box { background: #21262D; }
.rni.dark .consent-sig-area { background: #21262D; border-color: #30363D; }
.rni.dark .consent-sig-area.signed { background: #0F2A1C; border-color: var(--emerald); }
.rni.dark .consent-step-bar { background: #0D1117; }
.rni.dark .consent-step-indicator.active { background: #161B22; }
.rni.dark .consent-nav-row { background: #0D1117; border-top-color: #30363D; }
.rni.dark .consent-filed-banner { background: #0F2A1C; border-color: rgba(67,219,163,0.2); }
/* Handoff */
.rni.dark .handoff-text[contenteditable="true"] { background: #3D2E10; border-color: #B8952E; }
.rni.dark .handoff-action-btn:hover { background: #21262D; }
.rni.dark .handoff-comment-input { background: #0D1117; color: #E6EDF3; }
/* Scribe panels */
.rni.dark .scribe-panel { background: #161B22; }
/* Inputs/selects */
.rni.dark select, .rni.dark input, .rni.dark textarea { background: #0D1117; color: #E6EDF3; border-color: #30363D; }
.rni.dark select:focus, .rni.dark input:focus, .rni.dark textarea:focus { border-color: var(--emerald); }
/* Degraded strip */
.rni.dark .strip-degraded { background: #3D2E10; color: #E3B341; }
.rni.dark .strip-degraded i { color: #E3B341; }
/* Zone strips */
.rni.dark .zone-strip.live { background: rgba(67,219,163,0.06); border-color: rgba(67,219,163,0.15); }
/* Stale overlay */
.rni.dark .rni-module.stale::after { background: rgba(13,17,23,0.5); color: #8B949E; }
/* Self-report */
.rni.dark .selfr-journal { background: #1C1028; }
.rni.dark .selfr-tile { background: #21262D; }
/* Doctor chat */
.rni.dark .rni-chat-dialog { background: #161B22; }
.rni.dark .rni-chat-messages { background: #0D1117; }
.rni.dark .rni-chat-msg.doctor .rni-chat-bubble { background: #21262D; color: #B1BAC4; border-color: #30363D; }
.rni.dark .rni-typing-dots { background: #21262D; border-color: #30363D; }
.rni.dark .rni-chat-input-area { background: #161B22; border-top-color: #30363D; }
.rni.dark .rni-chat-input { border-color: #30363D; background: #0D1117; color: #E6EDF3; }
/* Action modal */
.rni.dark .rni-action-panel { background: #161B22; }
.rni.dark .rni-action-section { border-bottom-color: #21262D; }
.rni.dark .rni-section-label { color: #E6EDF3; }
.rni.dark .rni-section-tag.what { background: #172B4D; color: #79C0FF; }
.rni.dark .rni-section-tag.why { background: #3D2E10; color: #E3B341; }
.rni.dark .rni-section-tag.how { background: #0F2A1C; color: #56D364; }
/* Btn secondary */
.rni.dark .btn-secondary { background: #21262D; border-color: #30363D; }
.rni.dark .btn-secondary:hover { border-color: #484F58; }
.rni.dark .btn-danger { background: #3D1F1F; border-color: #6E3630; }
.rni.dark .action-btn.secondary { background: #21262D; border-color: #30363D; }
/* Filter buttons */
.rni.dark .filter-btn { background: #0D1117; border-color: #30363D; color: #8B949E; }
.rni.dark .filter-btn:hover { border-color: #484F58; }
.rni.dark .filter-btn.active { background: rgba(67,219,163,0.06); }
/* Quick flag */
.rni.dark .quick-flag { background: #E6EDF3; color: #0D1117; }
.rni.dark .quick-flag:hover { background: #fff; }
/* Announcement */
.rni.dark .announce-item { background: #161B22; }
/* Performance page inline cards — override hardcoded white bg */
.rni.dark [onclick*="openPerfModal"] { background: #161B22 !important; border-color: #30363D !important; }
/* Morning brief green banner */
.rni.dark .zone-strip.live { background: rgba(67,219,163,0.05); }

/* System preference mode — only activates when class is 'auto' */
@media (prefers-color-scheme: dark) {
  .rni.auto {
    --charcoal: #E6EDF3; --ink: #E6EDF3; --slate: #B1BAC4; --muted: #8B949E;
    --light: #6E7681; --border: #30363D; --border-light: #21262D;
    --bg: #0D1117; --white: #161B22;
    --emerald-light: rgba(67,219,163,0.10); --gold-light: rgba(212,175,55,0.12);
    --red-light: #3D1F1F; --amber-light: #3D2E10;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3); --shadow-md: 0 2px 8px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.5);
  }
  .rni.auto .sidebar { background: #0D1117; border-right-color: #30363D; }
  .rni.auto .heart { filter: brightness(0) saturate(100%) invert(70%) sepia(52%) saturate(600%) hue-rotate(106deg) brightness(110%) contrast(90%); }
  .rni.auto .nav a:hover { background: rgba(67,219,163,0.08); }
  .rni.auto .nav a:hover span { color: #7EE2B8; }
  .rni.auto .nav a.active span { color: #E6EDF3; }
  .rni.auto .nav a i { color: #6E7681; }
  .rni.auto .nav a span { color: #8B949E; }
  .rni.auto .divider { background: #30363D; }
  .rni.auto .s-table tr:hover td { background: #1C2128; }
  .rni.auto .pt-avatar { background: #21262D; color: #8B949E; }
  .rni.auto .risk.high { background: #3D1F1F; color: #F97583; }
  .rni.auto .risk.med { background: #3D2E10; color: #E3B341; }
  .rni.auto .risk.low { background: #0F2A1C; color: #56D364; }
  .rni.auto select, .rni.auto input, .rni.auto textarea { background: #0D1117; color: #E6EDF3; border-color: #30363D; }
  .rni.auto .rni-chat-dialog { background: #161B22; }
  .rni.auto .rni-chat-messages { background: #0D1117; }
  .rni.auto .rni-chat-msg.doctor .rni-chat-bubble { background: #21262D; color: #B1BAC4; border-color: #30363D; }
  .rni.auto .rni-chat-input-area { background: #161B22; border-top-color: #30363D; }
  .rni.auto .rni-chat-input { border-color: #30363D; background: #0D1117; color: #E6EDF3; }
  .rni.auto .rni-action-panel { background: #161B22; }
  .rni.auto .flag-modal { background: #161B22; }
  .rni.auto .override-modal { background: #161B22; }
  .rni.auto .consent-doc-box { background: #21262D; }
  .rni.auto .quick-flag { background: #E6EDF3; color: #0D1117; }
  .rni.auto [onclick*="openPerfModal"] { background: #161B22 !important; border-color: #30363D !important; }
}

/* ═══ LAYOUT ═══ */
.rni .page { display: flex; }
.rni .main {
  flex: 1; margin-left: 240px; max-width: calc(100vw - 240px);
  min-height: 100vh; background: var(--bg);
}
.rni .wrap { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

/* ═══ SIDEBAR — Brand Anchor (240px, exact copy) ═══ */
.rni .sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: 240px;
  background: #fff;
  display: flex; flex-direction: column;
  padding-top: 24px;
  border-right: 1px solid var(--border-light); z-index: 100;
}
.rni .heart {
  width: 80px; margin: 0 auto 8px;
  filter: brightness(0) saturate(100%) invert(70%) sepia(52%) saturate(600%) hue-rotate(106deg) brightness(95%) contrast(90%);
  animation: rniBeat 3s ease-in-out infinite;
}
@keyframes rniBeat { 0%,100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(220,38,38,0.4); } 50% { box-shadow: 0 0 0 6px rgba(220,38,38,0); } }
.rni .tagline {
  color: var(--muted); font-weight: 500; font-size: 12px; text-align: center;
  letter-spacing: 0.3px; margin: 0 0 20px;
}

/* Nav — Brand Anchor Scale, Green Active */
.rni .nav { width: 100%; padding: 0 12px; }
.rni .nav a {
  display: flex; gap: 10px; align-items: center; padding: 10px 12px;
  text-decoration: none; transition: all .15s; border-radius: 6px; margin-bottom: 2px;
}
.rni .nav a i { width: 18px; text-align: center; color: #9ca3af; font-size: 14px; transition: all .15s; }
.rni .nav a span { color: #6b7280; font-size: 13px; font-weight: 500; transition: all .15s; }
.rni .nav a:hover { background: rgba(67,219,163,0.06); }
.rni .nav a:hover i { color: #3db88a; }
.rni .nav a:hover span { color: #2a7d5e; }
.rni .nav a.active { background: rgba(67,219,163,0.08); }
.rni .nav a.active i { color: var(--emerald) !important; }
.rni .nav a.active span { color: var(--charcoal); font-weight: 600; }
.rni .nav a.logout-link:hover { background: #FEF2F2; }
.rni .nav a.logout-link:hover i { color: #DC2626; }
.rni .nav a.logout-link:hover span { color: #DC2626; }
.rni .divider { height: 1px; background: #e5e7eb; width: 100%; margin: 16px 0; }

/* ═══ HEADER — Clinical Green (Restrained) ═══ */
.rni .header-frame {
  max-width: 1100px; margin: 0 auto 0; padding: 24px 24px 0;
}
.rni .rni-header {
  background: linear-gradient(135deg, #2EBD8A 0%, #1FA577 100%);
  color: #fff; border-radius: 10px; padding: 20px 24px;
  display: flex; justify-content: space-between; align-items: center;
  box-shadow: 0 4px 6px rgba(0,0,0,0.06), 0 8px 16px rgba(46,189,138,0.15);
}
.rni .h-left h1 { margin: 0; font-size: 20px; font-weight: 600; color: #fff; line-height: 1.2; text-decoration: none; border-bottom: none; }
.rni .h-left .sub { margin-top: 3px; color: rgba(255,255,255,0.8); font-size: 13px; font-weight: 400; font-style: italic; }
.rni .h-right { display: flex; align-items: center; gap: 14px; }
.rni .h-right .user-name { font-size: 14px; font-weight: 600; color: #fff; }
.rni .h-right .user-unit { font-size: 12px; color: rgba(255,255,255,0.75); }
.rni .h-right .notif-btn {
  width: 32px; height: 32px; border-radius: 8px; background: rgba(255,255,255,0.18);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff; cursor: pointer;
}
.rni .h-right .notif-btn:hover { background: rgba(255,255,255,0.28); }

/* ═══ SYSTEM STRIP (Feature #3: Trust Strip) ═══ */
.rni .system-strip {
  display: flex; align-items: center; justify-content: center; gap: 20px;
  padding: 12px 0; margin-bottom: 4px;
}
.rni .strip-item {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: 0.3px;
}
.rni .strip-dot {
  width: 6px; height: 6px; border-radius: 50%;
}
.rni .strip-dot.green { background: var(--emerald); }
.rni .strip-dot.gold { background: var(--gold); }
.rni .strip-divider { width: 1px; height: 14px; background: var(--border); }

/* ═══ COUNCIL DOTS (matches Admin pattern) ═══ */
.rni .agent-group {
  display: flex; align-items: center; gap: 6px;
}
.rni .agent-dot {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff;
  cursor: pointer; transition: all 0.2s ease; position: relative;
}
.rni .agent-dot:hover {
  transform: scale(1.15);
  box-shadow: 0 0 0 4px rgba(0,0,0,0.1);
}
.rni .agent-dot.williams { background: #D4AF37; }
.rni .agent-dot.olivia { background: #43DBA3; }
.rni .agent-dot.rivera { background: #3B82F6; }
.rni .agent-dot.chen { background: #DC2626; }
.rni .agent-dot.peterson { background: #00B8D4; }
.rni .agent-dot.taylor { background: #9B59B6; }

/* Agent Fixed Tooltips — escapes overflow clipping */
.a-tip-fixed {
  position: fixed;
  transform: translateX(-50%) scale(0.95);
  background: rgba(30, 32, 38, 0.98); backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 10px;
  padding: 16px 20px; min-width: 280px; max-width: 320px;
  opacity: 0; pointer-events: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4); z-index: 99999; text-align: left;
}
.a-tip-fixed.visible { opacity: 1; transform: translateX(-50%) scale(1); pointer-events: auto; }
.a-tip-fixed::after {
  content: ''; position: absolute; bottom: 100%; left: 50%;
  transform: translateX(-50%); border: 8px solid transparent;
  border-bottom-color: rgba(30, 32, 38, 0.98);
}
.a-tip-name { font-size: 15px; font-weight: 700; color: #fff; margin-bottom: 8px; }
.a-tip-stat { font-size: 13px; color: #d1d5db; line-height: 1.6; white-space: normal; word-wrap: break-word; }
.a-tip-status { margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, 0.1); font-size: 13px; display: flex; align-items: center; gap: 8px; }
.a-tip-status .dot { width: 8px; height: 8px; border-radius: 50%; background: #10b981; animation: statusBlink 2s ease-in-out infinite; }
@keyframes statusBlink { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
.a-tip-status span { color: #10b981; font-weight: 600; }
.a-tip-consult { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px;
  padding: 9px 16px; border-radius: 6px; font-size: 12px; font-weight: 700;
  color: #fff; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15);
  cursor: pointer; transition: all 0.2s; text-decoration: none; letter-spacing: 0.3px; }
.a-tip-consult:hover { background: rgba(255,255,255,0.15); border-color: rgba(255,255,255,0.25); }

/* ═══ PAGE SWITCHING ═══ */
.page-content { display: none; }
.page-content.active { display: block; }

/* ═══ SHARED: CARDS, TILES, TABLES ═══ */
.rni .card {
  background: var(--white); border: 1px solid var(--border); border-radius: 12px;
  padding: 24px; margin-bottom: 16px;
}
.rni .card-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px;
}
.rni .card-title {
  font-size: 14px; font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: 8px;
}
.rni .card-title i { color: var(--slate); font-size: 14px; }
.rni .card-meta { font-size: 11px; color: var(--muted); font-weight: 500; }

/* Tile grid */
.rni .tile-row { display: grid; gap: 14px; margin-bottom: 20px; }
.rni .tile-row.cols-2 { grid-template-columns: 1fr 1fr; }
.rni .tile-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.rni .tile-row.cols-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }

.rni .tile {
  background: var(--white); border: 1px solid var(--border); border-radius: 8px;
  padding: 18px 20px; position: relative;
}
.rni .tile::after {
  content: ''; position: absolute; bottom: 0; left: 12.5%; width: 75%;
  height: 2px; background: var(--border-light); border-radius: 1px;
}
.rni .tile.accent-gold::after { background: var(--gold); opacity: 0.4; }
.rni .tile.accent-emerald::after { background: var(--emerald); opacity: 0.4; }
.rni .tile:hover { border-color: #D1D5DB; box-shadow: var(--shadow-md); }
.rni .tile-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--muted); margin-bottom: 6px;
}
.rni .tile-value {
  font-size: 20px; font-weight: 700; color: var(--ink); line-height: 1.2; margin-bottom: 3px;
}
.rni .tile-value .unit { font-size: 14px; font-weight: 500; color: var(--muted); }
.rni .tile-sub { font-size: 11px; color: var(--light); }
.rni .tile.accent-gold { border-left: 3px solid var(--gold); }
.rni .tile.accent-emerald { border-left: 3px solid var(--emerald); }
.rni .tile.accent-charcoal { border-left: 3px solid var(--charcoal); }
.rni .tile.accent-teal { border-left: 3px solid #00B8D4; }
.rni .tile.accent-charcoal::after { background: var(--charcoal); opacity: 0.3; }
.rni .tile.accent-teal::after { background: #00B8D4; opacity: 0.4; }

/* Tooltip */
.rni [data-tooltip] { cursor: default; }
.rni [data-tooltip]:hover::after {
  content: attr(data-tooltip); position: absolute; bottom: calc(100% + 8px);
  left: 50%; transform: translateX(-50%); background: var(--charcoal); color: #fff;
  padding: 10px 14px; border-radius: 8px; font-size: 11px; line-height: 1.5;
  width: 260px; text-align: left; z-index: 500; box-shadow: var(--shadow-lg);
  pointer-events: none; font-weight: 400;
}

/* Tables */
.rni .s-table { width: 100%; border-collapse: collapse; }
.rni .s-table th {
  text-align: left; font-size: 11px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.5px; padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.rni .s-table td {
  padding: 14px; font-size: 13px; color: var(--slate);
  background-image: linear-gradient(to right, transparent 12.5%, var(--border-light) 12.5%, var(--border-light) 87.5%, transparent 87.5%); background-repeat: no-repeat; background-size: 100% 1px; background-position: bottom center;
  position: relative;
}
.rni .s-table tr { cursor: pointer; }
.rni .s-table tr:hover td { background: #F8FAFD; }
.rni .s-table tr:last-child td { background-image: none; }

/* Patient cell — CHARCOAL avatars, not green */
.rni .pt-cell { display: flex; align-items: center; gap: 10px; }
.rni .pt-avatar {
  width: 32px; height: 32px; border-radius: 8px;
  background: #E8EAF0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: var(--slate);
}
.rni .pt-name { font-weight: 600; color: var(--ink); font-size: 13px; }
.rni .pt-mrn { font-size: 11px; color: var(--muted); }

/* Risk badges */
.rni .risk { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 12px; font-size: 11px; font-weight: 600; }
.rni .risk.high { background: #FEF2F2; color: #DC2626; }
.rni .risk.med { background: #FFFBEB; color: #D97706; }
.rni .risk.low { background: #ECFDF5; color: #059669; }

/* Bio pulse — green is OK here, it means "alive" */
.rni .bio-pulse {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--emerald); font-weight: 600;
}
.rni .bio-pulse .bp-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--emerald);
}
@keyframes ehrPulse { 0%,100% { opacity: 1; box-shadow: 0 0 0 0 rgba(67,219,163,0.4); } 50% { opacity: 0.7; box-shadow: 0 0 0 3px rgba(67,219,163,0); } }

/* Task badges */
.rni .task-tag { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 6px; font-size: 11px; font-weight: 600; }
.rni .task-tag.urgent { background: #FEF2F2; color: #DC2626; }
.rni .task-tag.soon { background: #FFFBEB; color: #D97706; }
.rni .task-tag.ok { background: #ECFDF5; color: #059669; }

/* Buttons — green primary CTA */
.rni .btn {
  padding: 8px 18px; border-radius: 8px; font-size: 12px; font-weight: 600;
  cursor: pointer; border: none; font-family: 'Heebo', sans-serif;
}
.rni .btn-primary { background: var(--emerald); color: #fff; }
.rni .btn-primary:hover { background: var(--emerald-dark); }
.rni .btn-secondary { background: var(--white); color: var(--ink); border: 1px solid var(--border); }
.rni .btn-secondary:hover { border-color: #9CA3AF; color: var(--ink); }
.rni .btn-danger { background: #FEF2F2; color: #DC2626; border: 1px solid #FECACA; }
.rni .btn-danger:hover { background: #FEE2E2; }
.rni .btn-lg { padding: 12px 28px; font-size: 14px; font-weight: 700; border-radius: 10px; }

/* Section labels */
.rni .section-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--muted); margin-bottom: 12px;
}

/* ═══ DETAIL DRAWER ═══ */
.rni .drawer-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.3); z-index: 900;
  opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.rni .drawer-overlay.open { opacity: 1; pointer-events: auto; }
.rni .detail-drawer {
  position: fixed; top: 0; right: -480px; bottom: 0; width: 480px;
  background: var(--white); z-index: 910; box-shadow: -8px 0 30px rgba(0,0,0,0.12);
  overflow-y: auto; transition: right 0.3s ease;
}
.rni .detail-drawer.open { right: 0; }
.rni .drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px; border-bottom: none; position: sticky; top: 0;
  background: #1C1F25; z-index: 2; border-radius: 0;
}
.rni .drawer-close {
  width: 32px; height: 32px; border-radius: 8px; border: none;
  background: transparent; display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: #9CA3AF; font-size: 18px; transition: color 0.3s;
}
.rni .drawer-close:hover { border-color: transparent; color: #fff; }
.rni .drawer-body { padding: 24px; }
.rni .drawer-section { margin-bottom: 24px; }
.rni .drawer-section-title {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--muted); margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border-light);
}
.rni .drawer-stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rni .drawer-stat { background: var(--bg); border-radius: 8px; padding: 12px 14px; }
.rni .drawer-stat-label { font-size: 10px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.3px; margin-bottom: 4px; }
.rni .drawer-stat-value { font-size: 16px; font-weight: 700; color: var(--ink); }

/* ═══ DASHBOARD — AI Morning Brief (Exec Overview Pattern) ═══ */
.rni .morning-brief {
  background: transparent; padding: 0; margin: 0 0 24px;
}
.rni .brief-header-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0; margin-bottom: 0;
}
.rni .brief-header-row h3 {
  margin: 0; font-size: 16px; font-weight: 700; color: var(--ink);
  display: flex; align-items: center; gap: 10px;
}
.rni .brief-header-row h3 i { color: var(--emerald); font-size: 18px; }
.rni .brief-header-row .brief-meta {
  font-size: 11px; color: var(--light);
}
.rni .brief-text {
  font-size: 14px; color: var(--slate); line-height: 1.7; font-weight: 400;
  padding: 12px 0 0;
}
.rni .brief-text strong { font-weight: 700; color: var(--ink); }

/* Priority Stack — 75% left-line, no card borders */
.rni .priority-item {
  background: transparent; border: none; border-radius: 0;
  padding: 14px 0 14px 18px; margin-bottom: 0;
  display: flex; align-items: flex-start; gap: 14px;
  position: relative;
  background-image: linear-gradient(to right, transparent 12.5%, var(--border-light) 12.5%, var(--border-light) 87.5%, transparent 87.5%);
  background-repeat: no-repeat;
  background-size: 100% 1px;
  background-position: bottom center;
}
.rni .priority-item:last-child { background-image: none; }
.rni .priority-item::before {
  content: ''; position: absolute; left: 0; top: 12.5%; height: 75%;
  width: 2px; border-radius: 1px;
}
.rni .priority-item.critical::before { background: var(--red); }
.rni .priority-item.warning::before { background: var(--amber); }
.rni .priority-item.stable::before { background: #D1D5DB; }
.rni .priority-icon {
  width: 36px; height: 36px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 14px;
}
.rni .priority-item.critical .priority-icon { background: #FEF2F2; color: var(--red); }
.rni .priority-item.warning .priority-icon { background: #FFFBEB; color: var(--amber); }
.rni .priority-item.stable .priority-icon { background: #F0F1F3; color: var(--slate); }
.rni .priority-body { flex: 1; }
.rni .priority-who { font-size: 14px; font-weight: 700; color: var(--ink); margin-bottom: 2px; }
.rni .priority-why { font-size: 13px; color: var(--slate); line-height: 1.5; margin-bottom: 6px; }
.rni .priority-action {
  font-size: 12px; font-weight: 600; color: var(--charcoal); cursor: pointer;
}
.rni .priority-action:hover { color: var(--emerald-dark); text-decoration-color: var(--emerald); }
.rni .priority-council { display: flex; gap: 4px; margin-top: 8px; }
.rni .council-dot {
  width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: 9px; font-weight: 700; color: #fff;
  cursor: default; position: relative;
}

/* Schedule Glance (Feature #4) */
.rni .schedule-item {
  display: flex; align-items: center; gap: 14px; padding: 12px 0 12px 10px;
  position: relative;
  background-image: linear-gradient(to right, transparent 12.5%, var(--border-light) 12.5%, var(--border-light) 87.5%, transparent 87.5%);
  background-repeat: no-repeat; background-size: 100% 1px; background-position: bottom center;
}
.rni .schedule-item::before {
  content: ''; position: absolute; left: 0; top: 12.5%; height: 75%;
  width: 2px; border-radius: 1px; background: #3B82F6;
}
.rni .schedule-item:last-child { background-image: none; }
.rni .schedule-item:hover { background: #F8FAFD; border-radius: 6px; }
.rni .schedule-time {
  font-size: 13px; font-weight: 700; color: var(--ink); width: 60px; flex-shrink: 0;
}
.rni .schedule-detail { flex: 1; }
.rni .schedule-name { font-size: 13px; font-weight: 600; color: var(--ink); }
.rni .schedule-type { font-size: 11px; color: var(--muted); }
.rni .schedule-flag {
  font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 4px;
}

/* Dashboard collapsible sections — chevron toggle */
.rni .dash-section {
  padding: 0; margin: 0;
}
.rni .dash-section-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 0; cursor: pointer; user-select: none;
  position: relative;
  background-image: linear-gradient(to right, transparent 12.5%, var(--border-light) 12.5%, var(--border-light) 87.5%, transparent 87.5%);
  background-repeat: no-repeat; background-size: 100% 1px; background-position: bottom center;
}
.rni .dash-section-header:hover .dash-chevron { color: var(--ink); }
.rni .dash-section-title {
  font-size: 14px; font-weight: 600; color: var(--ink);
  display: flex; align-items: center; gap: 10px;
}
.rni .dash-section-title i { width: 18px; text-align: center; font-size: 14px; }
.rni .dash-section-title .dash-count {
  font-size: 11px; font-weight: 500; color: var(--light);
}
.rni .dash-chevron {
  color: var(--light); font-size: 11px;
  transition: transform 0.2s;
}
.rni .dash-section.collapsed .dash-chevron { transform: rotate(-90deg); }
.rni .dash-section-body {
  padding: 0 0 16px; overflow: hidden;
  transition: max-height 0.25s ease;
}
.rni .dash-section.collapsed .dash-section-body { display: none; }

/* ═══ SESSIONS — Audio Scribe ═══ */
/* (Old toggle removed — replaced by e-consent workflow) */

.rni .scribe-workspace {
  display: none; grid-template-columns: 1fr 1fr; gap: 16px;
}
.rni .scribe-workspace.active { display: grid; }
.rni .scribe-panel {
  background: var(--white); border: 1px solid var(--border); border-radius: 12px;
  display: flex; flex-direction: column; min-height: 420px;
}
.rni .scribe-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; background: #1C1F25; border-bottom: none;
  border-radius: 12px 12px 0 0;
}
.rni .scribe-panel-title {
  font-size: 13px; font-weight: 700; color: #fff;
  display: flex; align-items: center; gap: 8px;
}
.rni .scribe-panel-title i { color: #9CA3AF; }
.rni .scribe-panel-body { flex: 1; padding: 18px; overflow-y: auto; max-height: 300px; }
.rni .scribe-mic {
  padding: 16px; border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px; justify-content: center;
}
.rni .mic-btn {
  width: 48px; height: 48px; border-radius: 50%; background: var(--charcoal);
  color: #fff; border: none; font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.rni .mic-btn:hover { background: #2d2d4a; }
.rni .mic-btn.recording { background: var(--red); }
.rni .mic-status { font-size: 12px; font-weight: 600; color: var(--muted); }

/* DAP sections */
.rni .dap-section { margin-bottom: 16px; }
.rni .dap-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--charcoal); margin-bottom: 6px;
}

/* ═══ COMMUNICATIONS ═══ */
.rni .msg-thread {
  background: var(--white); border: 1px solid var(--border); border-radius: 10px;
  padding: 16px 20px; margin-bottom: 10px; cursor: pointer;
  display: flex; align-items: center; gap: 14px;
}
.rni .msg-thread:hover { border-color: #D1D5DB; box-shadow: var(--shadow-sm); }
.rni .msg-avatar {
  width: 36px; height: 36px; border-radius: 50%; background: #E8EAF0;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: var(--slate); flex-shrink: 0;
}
.rni .msg-body { flex: 1; }
.rni .msg-from { font-size: 13px; font-weight: 600; color: var(--ink); }
.rni .msg-preview { font-size: 12px; color: var(--muted); margin-top: 1px; }
.rni .msg-time { font-size: 11px; color: var(--light); flex-shrink: 0; }
.rni .msg-unread { width: 8px; height: 8px; border-radius: 50%; background: var(--emerald); flex-shrink: 0; }

/* Quick Flag (Feature #22) */
.rni .quick-flag {
  position: fixed; bottom: 24px; right: 24px; z-index: 800;
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--charcoal); color: #fff; border: none;
  font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(26,26,46,0.25);
  transition: all 0.2s;
}
.rni .quick-flag:hover { transform: scale(1.08); background: #2d2d4a; }

/* Announcement item (Feature #21) */
.rni .announce-item {
  background: var(--white); border: 1px solid var(--border); border-radius: 10px;
  padding: 16px 20px; margin-bottom: 10px;
}
.rni .announce-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px;
}
.rni .announce-from { font-size: 12px; font-weight: 700; color: var(--ink); }
.rni .announce-time { font-size: 11px; color: var(--light); }
.rni .announce-text { font-size: 13px; color: var(--slate); line-height: 1.5; }

/* perf-tile removed — replaced by standard .tile with left accents */

/* Evidence cards (Caseload risk detail) */
.rni .evidence-card {
  background: var(--white); border: 1px solid var(--border); border-radius: 12px;
  margin-bottom: 16px; overflow: hidden;
}
.rni .evidence-header {
  display: flex; align-items: center; justify-content: space-between; padding: 18px 22px;
}
.rni .evidence-patient { display: flex; align-items: center; gap: 12px; }
.rni .evidence-name { font-size: 14px; font-weight: 700; color: var(--ink); }
.rni .evidence-meta { font-size: 12px; color: var(--muted); }
.rni .evidence-plot { padding: 0 22px; height: 160px; }
.rni .evidence-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 22px; border-top: 1px solid var(--border-light);
}

/* Toast */
.rni .toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; }
.rni .toast-container .toast {
  background: var(--charcoal); color: #fff; padding: 12px 18px; border-radius: 8px;
  font-size: 12px; font-weight: 500; margin-bottom: 8px;
  display: flex; align-items: center; gap: 8px;
  box-shadow: var(--shadow-lg); opacity: 0; transform: translateX(20px);
  transition: all 0.3s ease;
}
.rni .toast-container .toast.show { opacity: 1; transform: translateX(0); }

/* Compliance footer */
.rni .compliance {
  text-align: center; padding: 20px 0; margin-top: 20px;
}
.rni .compliance p { font-size: 11px; color: var(--light); margin: 3px 0; }
.rni .compliance a { color: var(--muted); text-decoration: none; }

/* Heartbeat footer (standardized across portals — matches patient portal) */
.rni .heartbeat {
  text-align: center; padding: 20px 0 10px;
}
.rni .ekg-line { height: 40px; width: 240px; margin: 0 auto 10px; position: relative; overflow: hidden; opacity: 0.4; }
.rni .ekg-line svg { position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 480px; height: 40px; }
@keyframes ekg-scroll { from { left: 0; } to { left: -240px; } }
.rni .footer-tagline { font-size: 11px; color: var(--light); font-weight: 500; letter-spacing: 0.3px; }
.rni .footer-meta { font-size: 10px; color: var(--light); margin-top: 3px; opacity: 0.6; }

/* ═══: ZONE LABELS ═══ */
.rni .zone-strip {
  padding: 10px 16px; border-radius: 8px; display: flex;
  align-items: center; justify-content: space-between; margin-bottom: 16px;
}
.rni .zone-strip.live {
  background: linear-gradient(135deg, rgba(67,219,163,0.08) 0%, rgba(67,219,163,0.03) 100%);
  border: 1px solid rgba(67,219,163,0.18);
}
.rni .zone-strip-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
}
.rni .zone-strip-badge {
  font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 4px;
}
.rni .zone-divider {
  display: flex; align-items: center; gap: 12px; margin: 24px 0 8px;
  padding: 0 4px;
}
.rni .zone-divider-line { flex: 1; height: 1px; background: var(--border); }
.rni .zone-divider-label {
  font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--light); white-space: nowrap;
}

/* ═══: CASELOAD SEARCH + SORT ═══ */
.rni .caseload-toolbar {
  display: flex; align-items: center; gap: 12px; margin-bottom: 14px;
}
.rni .caseload-search {
  flex: 1; position: relative;
}
.rni .caseload-search input {
  width: 100%; padding: 9px 14px 9px 36px; border: 1px solid var(--border);
  border-radius: 8px; font-family: 'Heebo', sans-serif; font-size: 13px;
  color: var(--ink); background: var(--white); outline: none;
  transition: border-color 0.15s;
}
.rni .caseload-search input:focus { border-color: var(--emerald); }
.rni .caseload-search input::placeholder { color: var(--light); }
.rni .caseload-search i {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  font-size: 12px; color: var(--light);
}
.rni .filter-btn {
  padding: 8px 14px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--white); font-family: 'Heebo', sans-serif; font-size: 12px;
  font-weight: 600; color: var(--slate); cursor: pointer; display: flex;
  align-items: center; gap: 6px; transition: all 0.15s; white-space: nowrap;
}
.rni .filter-btn:hover { border-color: #9CA3AF; }
.rni .filter-btn.active { border-color: var(--emerald); color: var(--emerald); background: rgba(67,219,163,0.04); }
.rni .s-table th.sortable { cursor: pointer; user-select: none; }
.rni .s-table th.sortable:hover { color: var(--ink); }
.rni .s-table th .sort-icon { font-size: 9px; margin-left: 3px; opacity: 0.4; }
.rni .s-table th.sorted .sort-icon { opacity: 1; color: var(--emerald); }

/* ═══: CASELOAD ROW RISK HOVER ═══ */
.rni .s-table tr[data-risk] td:first-child { position: relative; }
.rni .s-table tr[data-risk] td:first-child::before {
  content: ''; position: absolute; left: 0; top: 12.5%; height: 75%;
  width: 2px; border-radius: 1px;
}
.rni .s-table tr[data-risk="high"] td:first-child::before { background: #DC2626; }
.rni .s-table tr[data-risk="med"]  td:first-child::before { background: #D97706; }
.rni .s-table tr[data-risk="low"]  td:first-child::before { background: #059669; }
.rni .s-table tr[data-risk="high"]:hover td { background: #FEF8F8; }
.rni .s-table tr[data-risk="med"]:hover td  { background: #FFFDF7; }
.rni .s-table tr[data-risk="low"]:hover td  { background: #F8FDFA; }

/* ═══: ACTION BUTTON HIERARCHY ═══ */
.rni .action-btn {
  padding: 8px 14px; border-radius: 8px; font-size: 12px; font-weight: 600;
  cursor: pointer; border: none; font-family: 'Heebo', sans-serif;
  display: inline-flex; align-items: center; gap: 6px; transition: all 0.15s;
}
.rni .action-btn.critical {
  background: #DC2626; color: #fff; box-shadow: 0 2px 8px rgba(220,38,38,0.25);
  animation: actionPulse 2s ease-in-out infinite;
}
.rni .action-btn.critical:hover { background: #B91C1C; }
.rni .action-btn.primary { background: var(--emerald); color: #fff; }
.rni .action-btn.primary:hover { background: var(--emerald-dark); }
.rni .action-btn.secondary { background: var(--white); color: var(--ink); border: 1px solid var(--border); }
.rni .action-btn.secondary:hover { border-color: #9CA3AF; }
@keyframes actionPulse {
  0%, 100% { box-shadow: 0 2px 8px rgba(220,38,38,0.25); }
  50% { box-shadow: 0 2px 12px rgba(220,38,38,0.45); }
}

/* ═══: NOTIFICATION DROPDOWN ═══ */
.rni .notif-wrapper { position: relative; }
.rni .notif-dropdown {
  position: absolute; top: calc(100% + 10px); right: 0; width: 320px;
  background: var(--white); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.12); z-index: 200;
  opacity: 0; pointer-events: none; transform: translateY(-6px);
  transition: all 0.2s ease;
}
.rni .notif-dropdown.open { opacity: 1; pointer-events: auto; transform: translateY(0); }
.rni .notif-dropdown-header {
  padding: 14px 16px; border-bottom: 1px solid var(--border-light);
  display: flex; align-items: center; justify-content: space-between;
}
.rni .notif-dropdown-title { font-size: 13px; font-weight: 700; color: var(--ink); }
.rni .notif-dropdown-clear { font-size: 11px; font-weight: 600; color: var(--emerald); cursor: pointer; }
.rni .notif-dropdown-clear:hover { color: var(--emerald-dark); }
.rni .notif-item {
  padding: 12px 16px;
  position: relative;
  background-image: linear-gradient(to right, transparent 12.5%, var(--border-light) 12.5%, var(--border-light) 87.5%, transparent 87.5%);
  background-repeat: no-repeat; background-size: 100% 1px; background-position: bottom center;
  cursor: pointer; transition: background 0.1s; display: flex; gap: 10px;
}
.rni .notif-item::before {
  content: ''; position: absolute; left: 0; top: 12.5%; height: 75%;
  width: 2px; border-radius: 1px; background: var(--border);
}
.rni .notif-item.critical::before { background: var(--red); }
.rni .notif-item.warning::before  { background: var(--amber); }
.rni .notif-item.info::before     { background: #3B82F6; }
.rni .notif-item:last-child { background-image: none; }
.rni .notif-item:hover { background: #F8FAFD; }
.rni .notif-icon {
  width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 12px;
}
.rni .notif-text { font-size: 12px; color: var(--slate); line-height: 1.5; }
.rni .notif-text strong { color: var(--ink); }
.rni .notif-time { font-size: 10px; color: var(--light); margin-top: 2px; }

/* ═══.1: E-CONSENT WORKFLOW ═══ */
.rni .consent-workflow {
  background: var(--white); border: 1px solid var(--border); border-radius: 12px;
  max-width: 600px; margin: 0 auto; overflow: hidden;
}
.rni .consent-step-bar {
  display: flex; background: var(--bg); border-bottom: 1px solid var(--border);
}
.rni .consent-step-indicator {
  flex: 1; padding: 12px 10px; text-align: center; font-size: 11px; font-weight: 600;
  color: var(--light); position: relative; transition: all 0.2s;
}
.rni .consent-step-indicator.active { color: var(--ink); background: var(--white); }
.rni .consent-step-indicator.complete { color: var(--emerald); }
.rni .consent-step-indicator .step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%; font-size: 10px; font-weight: 700;
  margin-right: 4px; border: 1.5px solid var(--light); color: var(--light);
}
.rni .consent-step-indicator.active .step-num { border-color: var(--ink); color: var(--ink); }
.rni .consent-step-indicator.complete .step-num { border-color: var(--emerald); background: var(--emerald); color: #fff; }
.rni .consent-step-body { padding: 24px 28px; }
.rni .consent-step-panel { display: none; }
.rni .consent-step-panel.active { display: block; }
.rni .consent-patient-select {
  width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px;
  font-family: 'Heebo', sans-serif; font-size: 13px; color: var(--ink);
  background: var(--white); cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%234F566B' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.rni .consent-patient-select:focus { border-color: var(--emerald); outline: none; }
.rni .consent-doc-box {
  background: #FAFBFC; border: 1px solid var(--border); border-radius: 8px;
  padding: 18px 20px; max-height: 200px; overflow-y: auto; margin: 14px 0;
  font-size: 12px; color: var(--slate); line-height: 1.7;
}
.rni .consent-checkbox-row {
  display: flex; align-items: flex-start; gap: 10px; padding: 8px 0;
  background-image: linear-gradient(to right, transparent 12.5%, var(--border-light) 12.5%, var(--border-light) 87.5%, transparent 87.5%); background-repeat: no-repeat; background-size: 100% 1px; background-position: bottom center;
}
.rni .consent-checkbox-row:last-child { background-image: none; }
.rni .consent-checkbox-row input[type="checkbox"] {
  margin-top: 2px; accent-color: var(--emerald); width: 16px; height: 16px; flex-shrink: 0;
}
.rni .consent-checkbox-row label {
  font-size: 12px; color: var(--slate); line-height: 1.5; cursor: pointer;
}
.rni .consent-sig-area {
  border: 2px dashed var(--border); border-radius: 10px; background: #FAFBFC;
  padding: 16px; text-align: center; margin: 12px 0; position: relative;
}
.rni .consent-sig-area.signed { border-color: var(--emerald); border-style: solid; background: #F0FDF9; }
.rni .consent-sig-input {
  width: 100%; border: none; background: transparent; text-align: center;
  font-family: 'Brush Script MT', 'Segoe Script', 'Dancing Script', cursive;
  font-size: 32px; color: var(--ink); outline: none; padding: 12px 0;
}
.rni .consent-sig-input::placeholder { color: var(--light); font-size: 18px; font-family: 'Heebo', sans-serif; }
.rni .consent-sig-meta {
  font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px;
  margin-top: 6px;
}
.rni .consent-nav-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 28px; border-top: 1px solid var(--border); background: var(--bg);
}
.rni .consent-filed-banner {
  display: none; background: #ECFDF5; border: 1px solid rgba(67,219,163,0.2);
  border-radius: 12px; padding: 20px 24px; text-align: center;
  max-width: 600px; margin: 0 auto;
}
.rni .consent-filed-banner.visible { display: block; }

/* ═══: QUICK FLAG MODAL ═══ */
.rni .flag-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.35); z-index: 950;
  display: none; align-items: center; justify-content: center;
}
.rni .flag-modal-overlay.open { display: flex; }
.rni .flag-modal {
  background: var(--white); border-radius: 14px; width: 380px; max-width: 90vw;
  box-shadow: 0 20px 60px rgba(0,0,0,0.18); overflow: hidden;
}
.rni .flag-modal-header {
  padding: 18px 22px; background: #1C1F25; border-bottom: none; border-radius: 14px 14px 0 0;
  display: flex; align-items: center; justify-content: space-between;
}
.rni .flag-modal-title { font-size: 15px; font-weight: 700; color: #fff; display: flex; align-items: center; gap: 8px; }
.rni .flag-modal-body { padding: 18px 22px; }
.rni .flag-option {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: 8px; margin-bottom: 8px;
  cursor: pointer; transition: all 0.15s;
}
.rni .flag-option:hover { border-color: var(--emerald); background: rgba(67,219,163,0.03); }
.rni .flag-option.selected { border-color: var(--emerald); background: rgba(67,219,163,0.06); }
.rni .flag-option-icon {
  width: 32px; height: 32px; border-radius: 8px; display: flex;
  align-items: center; justify-content: center; font-size: 13px; flex-shrink: 0;
}
.rni .flag-option-text { font-size: 13px; font-weight: 600; color: var(--ink); }
.rni .flag-option-sub { font-size: 11px; color: var(--muted); margin-top: 1px; }
.rni .flag-detail-input {
  width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px;
  font-family: 'Heebo', sans-serif; font-size: 13px; color: var(--ink);
  resize: vertical; min-height: 60px; margin-top: 10px; display: none;
}
.rni .flag-detail-input:focus { border-color: var(--emerald); outline: none; }
.rni .flag-modal-footer {
  padding: 14px 22px; border-top: 1px solid var(--border); display: flex;
  justify-content: flex-end; gap: 10px; background: var(--bg);
}

/* ═══: SHIFT HANDOFF ═══ */
.rni .handoff-checklist-item {
  display: flex; align-items: flex-start; gap: 10px; padding: 12px 0 12px 10px;
  position: relative;
  background-image: linear-gradient(to right, transparent 12.5%, var(--border-light) 12.5%, var(--border-light) 87.5%, transparent 87.5%);
  background-repeat: no-repeat; background-size: 100% 1px; background-position: bottom center;
}
.rni .handoff-checklist-item::before {
  content: ''; position: absolute; left: 0; top: 12.5%; height: 75%;
  width: 2px; border-radius: 1px; background: #7C3AED;
}
.rni .handoff-checklist-item.done::before { background: var(--emerald); }
.rni .handoff-checklist-item:last-child { background-image: none; }
.rni .handoff-check {
  width: 18px; height: 18px; border-radius: 4px; border: 1.5px solid var(--border);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  cursor: pointer; margin-top: 1px; transition: all 0.15s;
}
.rni .handoff-check.checked { background: var(--emerald); border-color: var(--emerald); color: #fff; }
.rni .handoff-body { flex: 1; min-width: 0; }
.rni .handoff-text { font-size: 13px; color: var(--slate); line-height: 1.5; }
.rni .handoff-text strong { color: var(--ink); }
.rni .handoff-text[contenteditable="true"] { outline: none; background: #FFFBEB; border-radius: 4px; padding: 4px 6px; margin: -4px -6px; border: 1px solid #F4C84B; }
.rni .handoff-check.checked + .handoff-body .handoff-text { color: var(--light); text-decoration: line-through; }
.rni .handoff-actions { display: flex; gap: 6px; margin-top: 6px; }
.rni .handoff-action-btn {
  font-size: 11px; color: var(--muted); cursor: pointer; padding: 2px 8px;
  border-radius: 4px; border: none; background: none; font-family: 'Heebo', sans-serif;
  transition: all 0.15s; display: inline-flex; align-items: center; gap: 4px;
}
.rni .handoff-action-btn:hover { background: #f3f4f6; color: var(--ink); }
.rni .handoff-action-btn.editing { background: #FFFBEB; color: #92400E; }
.rni .handoff-comment-area {
  margin-top: 8px; display: none;
}
.rni .handoff-comment-area.open { display: block; }
.rni .handoff-comment-input {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 12px; font-family: 'Heebo', sans-serif; color: var(--ink); resize: none;
  line-height: 1.5; background: #fff; min-height: 36px;
}
.rni .handoff-comment-input:focus { outline: none; border-color: var(--emerald); box-shadow: 0 0 0 2px rgba(67,219,163,0.12); }
.rni .handoff-comment-input::placeholder { color: var(--light); }
.rni .handoff-comment-saved {
  font-size: 11px; color: var(--emerald); margin-top: 4px; padding: 4px 8px;
  background: rgba(67,219,163,0.06); border-radius: 4px; display: none;
}
.rni .handoff-comment-saved.has-comment { display: flex; align-items: flex-start; gap: 6px; }
.rni .handoff-comment-saved i { flex-shrink: 0; margin-top: 2px; }

/* ═══: MESSAGE THREAD VIEW ═══ */
.rni .msg-thread { cursor: pointer; }
.rni .msg-thread.read .msg-from { font-weight: 500; }
.rni .msg-actions {
  display: flex; gap: 4px; flex-shrink: 0; opacity: 0; transition: opacity 0.15s;
}
.rni .msg-thread:hover .msg-actions { opacity: 1; }
.rni .msg-action-btn {
  width: 28px; height: 28px; border-radius: 6px; border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 11px; background: transparent; color: var(--light);
  transition: all 0.15s;
}
.rni .msg-action-btn:hover { background: var(--bg); color: var(--ink); }
.rni .msg-action-btn.danger:hover { background: #FEF2F2; color: #DC2626; }
.rni .msg-thread-view {
  display: none; background: var(--white); border: 1px solid var(--border);
  border-radius: 12px; margin-top: 12px; overflow: hidden;
}
.rni .msg-thread-view.open { display: block; }
.rni .msg-thread-header {
  padding: 14px 18px; border-bottom: none;
  display: flex; align-items: center; justify-content: space-between; background: #1C1F25;
  border-radius: 12px 12px 0 0;
}
.rni .msg-thread-subject { font-size: 14px; font-weight: 700; color: #fff; }
.rni .msg-thread-close {
  width: 28px; height: 28px; border-radius: 6px; border: none; background: transparent;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: #9CA3AF; font-size: 14px;
}
.rni .msg-thread-close:hover { background: transparent; color: #fff; }
.rni .msg-bubble-list { padding: 16px 18px; max-height: 300px; overflow-y: auto; }
.rni .msg-bubble {
  margin-bottom: 14px; padding: 12px 14px; border-radius: 10px;
  font-size: 13px; line-height: 1.6; color: var(--slate); position: relative;
}
.rni .msg-bubble.incoming { background: var(--bg); border-bottom-left-radius: 4px; }
.rni .msg-bubble.outgoing { background: rgba(67,219,163,0.08); border-bottom-right-radius: 4px; }
.rni .msg-bubble-meta {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 10px; color: var(--light); margin-bottom: 6px;
}
.rni .msg-bubble-sender { font-weight: 600; color: var(--muted); }
.rni .msg-compose {
  padding: 14px 18px; border-top: 1px solid var(--border); display: flex; gap: 10px; align-items: flex-end;
}
.rni .msg-compose-input {
  flex: 1; padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px;
  font-family: 'Heebo', sans-serif; font-size: 13px; color: var(--ink);
  resize: none; min-height: 40px; max-height: 100px; outline: none;
}
.rni .msg-compose-input:focus { border-color: var(--emerald); }
.rni .msg-send-btn {
  width: 40px; height: 40px; border-radius: 8px; border: none;
  background: var(--emerald); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  font-size: 14px; transition: opacity 0.15s;
}
.rni .msg-send-btn:hover { opacity: 0.9; }
.rni .msg-new-btn {
  display: flex; align-items: center; gap: 6px; padding: 10px 16px;
  background: var(--emerald); color: #fff; border: none; border-radius: 8px;
  font-family: 'Heebo', sans-serif; font-size: 12px; font-weight: 600;
  cursor: pointer; transition: opacity 0.15s;
}
.rni .msg-new-btn:hover { opacity: 0.9; }
.rni .msg-delete-confirm {
  background: #FEF2F2; border: 1px solid #FECACA; border-radius: 8px;
  padding: 12px 16px; margin-top: 8px; display: none;
  font-size: 12px; color: #DC2626;
}
.rni .msg-delete-confirm.visible { display: flex; align-items: center; justify-content: space-between; }

/* ═══: STALE STATE ENFORCEMENT ═══ */
.rni .rni-module { position: relative; }
.rni .rni-module.stale { opacity: 0.5; pointer-events: none; }
.rni .rni-module.stale::after {
  content: 'STALE — DATA REFRESH REQUIRED';
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(26,31,54,0.08); border-radius: inherit;
  font-size: 11px; font-weight: 700; letter-spacing: 1px; color: var(--charcoal);
  z-index: 10; pointer-events: none;
}
.rni .freshness-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px; font-weight: 500; color: var(--light); margin-left: 8px;
}
.rni .freshness-badge .fb-dot {
  width: 5px; height: 5px; border-radius: 50%; background: var(--emerald);
}
.rni .freshness-badge.warn .fb-dot { background: #D97706; }
.rni .freshness-badge.stale .fb-dot { background: #DC2626; }

/* ═══: DEGRADED COUNCIL STRIP ═══ */
.rni .strip-degraded {
  background: #FFFBEB; color: #92400E; font-weight: 600;
  padding: 6px 16px; border-radius: 6px; font-size: 11px;
  display: none; align-items: center; gap: 6px; margin-top: 6px;
}
.rni .strip-degraded.visible { display: flex; }
.rni .strip-degraded i { color: #D97706; }

/* ═══: CLINICIAN OVERRIDE MODAL ═══ */
.rni .override-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 960;
  display: none; align-items: center; justify-content: center;
}
.rni .override-modal-overlay.open { display: flex; }
.rni .override-modal {
  background: var(--white); border-radius: 14px; width: 460px; max-width: 92vw;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2); overflow: hidden;
}
.rni .override-modal-header {
  padding: 18px 22px; background: #1C1F25; border-bottom: none; border-radius: 14px 14px 0 0;
  display: flex; align-items: center; gap: 10px;
}
.rni .override-modal-header i { color: #D97706; font-size: 16px; }
.rni .override-modal-title { font-size: 15px; font-weight: 700; color: #fff; }
.rni .override-modal-body { padding: 18px 22px; }
.rni .override-original {
  background: var(--bg); border-radius: 8px; padding: 12px 14px;
  font-size: 12px; color: var(--slate); margin-bottom: 14px;
  border-left: 3px solid var(--emerald);
}
.rni .override-original-label { font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.3px; margin-bottom: 4px; }
.rni .override-reason-input {
  width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: 8px;
  font-family: 'Heebo', sans-serif; font-size: 13px; color: var(--ink);
  resize: vertical; min-height: 80px; box-sizing: border-box;
}
.rni .override-reason-input:focus { border-color: var(--emerald); outline: none; }
.rni .override-charcount { font-size: 10px; color: var(--light); text-align: right; margin-top: 4px; }
.rni .override-charcount.short { color: #DC2626; }
.rni .override-confirm-row {
  display: flex; align-items: center; gap: 8px; margin-top: 12px;
  padding: 10px 12px; background: #FEF2F2; border-radius: 8px; font-size: 12px; color: #991B1B;
}
.rni .override-modal-footer {
  padding: 14px 22px; border-top: 1px solid var(--border); display: flex;
  justify-content: flex-end; gap: 10px; background: var(--bg);
}

/* ═══: PATIENT SELF-REPORT ZONE ═══ */
.rni .zone-patient {
  margin-top: 14px; border-top: 2px solid #7C3AED; padding-top: 12px;
}
.rni .zone-patient-label {
  display: flex; align-items: center; gap: 8px; margin-bottom: 12px;
}
.rni .zone-patient-badge {
  background: linear-gradient(135deg, #7C3AED, #6D28D9); color: #fff;
  font-size: 9px; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase;
  padding: 3px 10px; border-radius: 4px;
}
.rni .zone-patient-sub { font-size: 10px; color: var(--light); }
.rni .selfr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.rni .selfr-tile {
  background: var(--bg); border-radius: 8px; padding: 10px 12px;
  border-left: 3px solid #7C3AED;
}
.rni .selfr-tile-label { font-size: 10px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.3px; }
.rni .selfr-tile-value { font-size: 18px; font-weight: 700; color: var(--ink); margin-top: 2px; }
.rni .selfr-tile-sub { font-size: 10px; color: var(--light); margin-top: 1px; }
.rni .selfr-journal {
  background: #F5F3FF; border-radius: 8px; padding: 10px 14px;
  font-size: 12px; color: var(--slate); line-height: 1.6;
  border-left: 3px solid #7C3AED; font-style: italic;
}
.rni .selfr-journal-meta { font-size: 10px; color: #7C3AED; font-weight: 600; font-style: normal; margin-bottom: 4px; }

/* ═══: CROSS-SURFACE TEMPLATE ═══ */
.rni .surface-context-bar {
  display: flex; align-items: center; gap: 6px; padding: 4px 12px;
  background: rgba(67,219,163,0.06); border-radius: 6px;
  font-size: 10px; color: var(--muted); margin-right: 8px;
}
.rni .surface-context-dot {
  width: 6px; height: 6px; border-radius: 50%;
}
.rni .tenant-footer {
  padding: 8px 24px; text-align: center; font-size: 10px; color: var(--light);
  border-top: 1px solid var(--border-light); margin-top: 12px;
}
.rni .tenant-footer strong { color: var(--muted); }

/* ═══ RESPONSIVE ═══ */
@media (max-width: 768px) {
  .rni .sidebar { position: static; width: 100%; min-height: auto; flex-direction: row; padding: 8px; border-right: none; border-bottom: 1px solid var(--border); }
  .rni .main { margin-left: 0; max-width: 100%; }
  .rni .nav a span { display: none; }
  .rni .scribe-workspace.active { grid-template-columns: 1fr; }
  .rni .tile-row.cols-3, .rni .tile-row.cols-4 { grid-template-columns: 1fr 1fr; }
  .rni .s-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; }
}

/* ═══ MOBILE — Modal & Chat Responsive ═══ */
@media (max-width:600px){
  .rni-doctor-chat{padding:8px}
  .rni-chat-dialog{max-width:100%;max-height:90vh;border-radius:12px}
  .rni-chat-header{padding:14px 16px}
  #rniChatLogoWrap{width:42px !important;height:42px !important}
  #rniChatLogoWrap svg{width:20px !important;height:20px !important}
  .rni-chat-doc-name{font-size:14px}
  .rni-chat-doc-spec{font-size:11px}
  .rni-chat-messages{padding:16px;min-height:180px;max-height:50vh}
  .rni-chat-bubble{max-width:85%;font-size:13px;padding:10px 14px}
  .rni-chat-input-area{padding:12px 16px}
  .rni-chat-input{padding:10px 14px;font-size:16px}
  .rni-chat-send{padding:10px 18px;font-size:13px;min-height:44px}
  .rni-action-overlay{padding:8px}
  .rni-action-panel{max-width:100%;border-radius:12px}
  .rni-action-header{padding:18px 20px 14px}
  .rni-action-icon{width:40px !important;height:40px !important}
  .rni-action-footer{padding:12px 20px 18px;gap:8px}
  .rni-action-footer button{font-size:11px !important;padding:10px 10px !important;min-height:44px}
  .rni .tile-row.cols-3,.rni .tile-row.cols-4{grid-template-columns:1fr}
  /* Detail Drawer — full width on mobile */
  .rni .detail-drawer{width:100%;right:-100%}
  .rni .detail-drawer.open{right:0}
  .rni .drawer-header{padding:14px 16px}
  .rni .drawer-header svg{width:18px !important;height:18px !important}
  .rni .drawer-body{padding:16px}
  .rni .drawer-stat-grid{grid-template-columns:1fr}
  /* Flag + Override modals — full-width on mobile */
  .rni .flag-modal{width:100%;max-width:100%;border-radius:12px}
  .rni .override-modal{width:100%;max-width:100%;border-radius:12px}
  /* Agent dots — smaller on mobile strip */
  .rni .agent-dot{width:24px;height:24px;font-size:10px}
  .rni .agent-group{gap:4px}
  .rni .system-strip{gap:12px;flex-wrap:wrap;padding:10px 0}
  /* Fixed tooltip — narrower on mobile */
  .a-tip-fixed{min-width:220px;max-width:260px;padding:12px 16px}
  /* Scribe panels */
  .rni .scribe-panel{min-height:300px}
  .rni .scribe-panel-header{padding:12px 14px}
}
@media (max-width:400px){
  .rni-chat-bubble{max-width:90%}
  .rni .agent-dot{width:22px;height:22px;font-size:9px}
  .rni .system-strip{gap:8px}
}

/* ═══ DOCTOR CHAT MODAL STYLES ═══ */
.rni-doctor-chat{display:none;position:fixed;inset:0;background:rgba(0,0,0,0.7);z-index:2000;align-items:center;justify-content:center;padding:20px}
.rni-doctor-chat.active{display:flex}
.rni-chat-dialog{background:#fff;border-radius:8px;width:100%;max-width:700px;max-height:80vh;display:flex;flex-direction:column;box-shadow:0 25px 50px -12px rgba(0,0,0,0.25);font-family:'Heebo',sans-serif}
.rni-chat-header{background:#1C1F25;padding:18px 24px;display:flex;align-items:center;justify-content:space-between;border-radius:8px 8px 0 0}
.rni-chat-header-left{display:flex;align-items:center;gap:14px}
.rni-chat-doc-name{font-size:16px;font-weight:700;color:#fff}
.rni-chat-doc-spec{font-size:13px;color:#9CA3AF}
.rni-chat-close{background:none;border:none;font-size:24px;color:#9CA3AF;cursor:pointer;padding:0;line-height:1;transition:color .3s}
.rni-chat-close:hover{color:#fff}
.rni-chat-messages{flex:1;overflow-y:auto;padding:24px;background:#FAFBFD;min-height:200px;max-height:400px}
.rni-chat-msg{display:flex;gap:12px;margin-bottom:16px;animation:rniMsgSlide .3s ease-out}
.rni-chat-msg.user{flex-direction:row-reverse}
.rni-chat-msg.user .rni-chat-bubble{background:#1F2937;color:#fff}
.rni-chat-msg.doctor .rni-chat-bubble{background:#fff;color:#374151;border:1px solid #E5E7EB}
.rni-chat-bubble{max-width:70%;padding:12px 16px;border-radius:12px;font-size:14px;line-height:1.6}
@keyframes rniMsgSlide{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}
.rni-chat-typing{display:none;padding:8px 24px;gap:12px;align-items:center}
.rni-chat-typing.active{display:flex}
.rni-typing-dots{display:flex;gap:4px;padding:12px 16px;background:#fff;border-radius:12px;border:1px solid #E5E7EB}
.rni-typing-dots span{width:6px;height:6px;background:#9CA3AF;border-radius:50%;animation:rniTyping 1.4s infinite}
.rni-typing-dots span:nth-child(2){animation-delay:.2s}
.rni-typing-dots span:nth-child(3){animation-delay:.4s}
@keyframes rniTyping{0%,60%,100%{opacity:.3;transform:translateY(0)}30%{opacity:1;transform:translateY(-4px)}}
.rni-chat-input-area{padding:16px 24px;border-top:1px solid #E5E7EB;background:#fff;border-radius:0 0 8px 8px}
.rni-chat-input-wrap{display:flex;gap:12px}
.rni-chat-input{flex:1;padding:12px 16px;border:1px solid #E5E7EB;border-radius:8px;font-size:15px;font-family:'Heebo',sans-serif;outline:none}
.rni-chat-input:focus{border-color:var(--focus-color, #43DBA3);box-shadow:0 0 0 3px rgba(67,219,163,0.1)}
.rni-chat-send{padding:12px 24px;background:#1C1F25;color:#fff;border:none;border-radius:8px;font-size:15px;font-weight:600;cursor:pointer;font-family:'Heebo',sans-serif}
.rni-chat-send:hover{background:#2D3748}

/* ═══ ACTION MODAL STYLES ═══ */
.rni-action-overlay{display:none;position:fixed;inset:0;background:rgba(0,0,0,0.6);z-index:2500;align-items:center;justify-content:center;padding:20px}
.rni-action-overlay.active{display:flex}
.rni-action-panel{background:#fff;border-radius:14px;width:100%;max-width:580px;max-height:85vh;overflow-y:auto;box-shadow:0 25px 50px -12px rgba(0,0,0,0.25);font-family:'Heebo',sans-serif;position:relative}
.rni-action-header{padding:18px 24px;background:#1C1F25;border-bottom:none;border-radius:14px 14px 0 0;display:flex;align-items:center;gap:16px}
.rni-action-icon{width:48px;height:48px;border-radius:50%;display:flex;align-items:center;justify-content:center;flex-shrink:0;border:3px solid currentColor;background:transparent}
.rni-action-icon.critical{color:#DC2626}.rni-action-icon.warning{color:#D97706}.rni-action-icon.success{color:#059669}.rni-action-icon.info{color:#3B82F6}
.rni-action-body{padding:0 28px 16px}
.rni-action-section{padding:14px 0;border-bottom:1px solid #f3f4f6}
.rni-action-section:last-child{border-bottom:none}
.rni-section-label{display:flex;align-items:center;gap:8px;margin-bottom:10px;font-weight:600;font-size:14px;color:#111827}
.rni-section-tag{font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:1px;padding:3px 8px;border-radius:4px;display:inline-block}
.rni-section-tag.what{background:#DBEAFE;color:#1D4ED8}.rni-section-tag.why{background:#FEF3C7;color:#92400E}.rni-section-tag.how{background:#D1FAE5;color:#065F46}
.rni-action-footer{padding:16px 28px 24px;display:flex;gap:10px;flex-wrap:wrap}

/* ── SECTION 3: SIDEBAR (Executive master + green substitution) ── */

═══════════════════════════════════════════════════════════════════════════════ */

.rni .sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 220px;
  background: #FFFFFF;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 40px;
  box-shadow: none;
  border-right: 1px solid #E8ECF1;
  z-index: 100;
  overflow: visible;
}

.rni .sidebar .heart {
  width: 80px;
  margin: 0 auto 8px;
  filter: brightness(0) saturate(100%) invert(70%) sepia(52%) saturate(600%) hue-rotate(106deg) brightness(95%) contrast(90%);
  animation: rniBeat 3s ease-in-out infinite !important;
}

@keyframes rniBeat {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

.rni .sidebar .tagline {
  color: var(--gold);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.3px;
  margin: 8px 0 24px;
}

.rni .nav { width: 100%; padding: 0 16px; overflow-y: auto; flex: 1; }
.rni .nav a {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 11px 12px;
  text-decoration: none;
  transition: all 0.15s;
  cursor: pointer;
  border-radius: 6px;
}
.rni .nav a i { width: 18px; text-align: center; color: #6B7280; font-size: 15px; transition: 0.15s; }
/* SVG (Lucide) nav icon rules — stroke stays #6B7280 always per DNA spec */
.rni .nav a { color: #374151; } /* prevent browser default blue on currentColor SVGs */
.rni .nav a svg { stroke: #6B7280; width: 14px; height: 14px; flex-shrink: 0; transition: none; }
.rni .nav a:hover svg { stroke: #6B7280; } /* icon NEVER changes color per DNA spec */
.rni .nav a.active svg { stroke: #6B7280; } /* icon stays dark grey even when active */
.rni .nav a.logout-link:hover svg { stroke: #DC2626; } /* logout exception: red */
.rni .nav a span { color: #374151; font-size: 14px; font-weight: 500; letter-spacing: 0.2px; transition: 0.15s; }
.rni .nav a:hover { background: rgba(67,219,163,0.05); border-radius: 6px; }
.rni .nav a:hover i, .rni .nav a:hover span { color: var(--emerald); }
.rni .nav a.active { background: rgba(67,219,163,0.08); border-radius: 6px; }
.rni .nav a.active i, .rni .nav a.active span { color: var(--emerald); font-weight: 600; }
.rni .nav .divider { height: 2px; background: #E8ECF1; width: 75%; margin: 10px auto; }

/* Nav Dropdown */
.rni .nav-dropdown {
  position: relative;
}

.rni .nav {
  overflow: visible;
}

.rni .sidebar {
  overflow: visible;
}

.rni .nav-dropdown-trigger {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px 0;
  text-decoration: none;
  transition: 0.25s;
  cursor: pointer;
}

.rni .nav-dropdown-trigger i { width: 18px; text-align: center; color: #6B7280; font-size: 15px; transition: 0.15s; }
.rni .nav-dropdown-trigger span { color: #374151; font-size: 14px; font-weight: 500; letter-spacing: 0.2px; transition: 0.15s; }
.rni .nav-dropdown-trigger:hover i, .rni .nav-dropdown-trigger:hover span { color: var(--emerald); }

.rni .dropdown-arrow {
  font-size: 10px !important;
  margin-left: auto;
  transition: transform 0.25s;
}

.rni .nav-dropdown.open .dropdown-arrow {
  transform: rotate(180deg);
}

.rni .nav-dropdown-menu {
  display: none;
  background: #fff;
  border-radius: 6px;
  padding: 8px;
  border: 1px solid #E8ECF1;
  z-index: 200;
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  margin-bottom: 4px;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.08);
}

.rni .nav-dropdown.open .nav-dropdown-menu {
  display: block;
}

.rni .nav-dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  color: #374151;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  border-radius: 6px;
  transition: all 0.2s;
}

.rni .nav-dropdown-menu a:hover {
  background: rgba(67,219,163,0.05);
  color: var(--emerald);
}

.rni .nav-dropdown-menu a i {
  width: 16px;
  text-align: center;
  font-size: 12px;
  color: var(--grey-light);
}

.rni .nav-dropdown-menu a:hover i {
  color: var(--emerald);
}

/* ═══════════════════════════════════════════════════════════════════════════
   

/* ── SECTION 4: PHOENIX STATUS BAR ── */
 (Hover Popup)
═══════════════════════════════════════════════════════════════════════════════ */

.rni .phoenix-bar {
  max-width: 1100px;
  margin: 12px auto;
  padding: 0 24px;
}

.rni .phoenix-bar-inner {
  text-align: center;
  padding: 10px 0;
  position: relative;
}

.rni .phoenix-bar-text {
  color: var(--gold);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.3px;
  animation: breatheGold 3s ease-in-out infinite;
  cursor: default;
}

@keyframes breatheGold {
  0%, 100% { 
    opacity: 0.5; 
    text-shadow: 0 0 0 transparent;
  }
  50% { 
    opacity: 1; 
    text-shadow: 0 0 12px rgba(212, 175, 55, 0.6);
  }
}

.rni .phoenix-bar-text i {
  margin-right: 8px;
  font-size: 16px;
  display: inline-block;
  animation: heartBeat 1.2s ease-in-out infinite;
}

@keyframes heartBeat {
  0%, 100% { transform: scale(1); }
  14% { transform: scale(1.3); }
  28% { transform: scale(1); }
  42% { transform: scale(1.3); }
  56% { transform: scale(1); }
}

/* Phoenix Hover Popup */
.rni .phoenix-popup {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  padding: 20px;
  width: 320px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
  z-index: 500;
  margin-top: 8px;
}

.rni .phoenix-popup::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 8px solid #fff;
}

.rni .phoenix-bar-inner:hover .phoenix-popup {
  opacity: 1;
  visibility: visible;
}

.rni .phoenix-popup-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  position: relative;
}
.rni .phoenix-popup-header::after {
  content: ""; position: absolute; bottom: 0; left: 12.5%; width: 75%; height: 2px;
  background: #E8ECF1; border-radius: 1px;
}

.rni .phoenix-popup-header i {
  color: var(--gold);
  font-size: 18px;
}

.rni .phoenix-popup-header span {
  font-size: 15px;
  font-weight: 700;
  color: var(--charcoal);
}

.rni .phoenix-status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}

.rni .phoenix-status-row .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.5);
  flex-shrink: 0;
}

.rni .phoenix-status-row .label {
  flex: 1;
  font-size: 13px;
  color: var(--charcoal);
}

.rni .phoenix-status-row .value {
  font-size: 12px;
  color: var(--grey);
  font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════════════════════
   

/* ── SECTION 5: KPI TILES ── */
 
═══════════════════════════════════════════════════════════════════════════════ */

.rni .kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin: 0 0 32px;
}

.rni .kpi {
  background: #fff;
  border-radius: 6px;
  padding: 24px 28px;
  text-align: left;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
  position: relative;
  --kpi-accent: transparent;
}
.rni .kpi.s-green { --kpi-accent: #10B981; }
.rni .kpi.s-amber { --kpi-accent: #F59E0B; }
.rni .kpi.s-red { --kpi-accent: #EF4444; }
.rni .kpi.s-blue { --kpi-accent: var(--emerald); }
.rni .kpi::before {
  content: ""; position: absolute; left: 0; top: 12.5%; height: 75%; width: 2px;
  background: var(--kpi-accent); border-radius: 1px;
}

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

/* 75% bottom accent */
.rni .kpi::after {
  content: ""; position: absolute; bottom: 0; left: 12.5%; width: 75%; height: 2px;
  background: #E8ECF1; border-radius: 1px;
}

.rni .kpi .value {
  font-size: 34px;
  font-weight: 800;
  color: var(--charcoal);
  line-height: 1;
  margin-bottom: 8px;
}

.rni .kpi .label {
  font-size: 13px;
  font-weight: 500;
  color: #6B7280;
  margin-bottom: 10px;
  letter-spacing: 0;
  text-transform: none;
}

.rni .kpi .trend {
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-bottom: 6px;
}

.rni .kpi .trend.up { color: #10b981; }
.rni .kpi .trend.down { color: #ef4444; }
.rni .kpi .trend.flat { color: #6b7280; }

/* Trend as subtle status */
.rni .kpi .trend { font-size: 13px; font-weight: 600; }
.rni .kpi .trend i { font-size: 11px; margin-right: 2px; }
.rni .kpi .trend i { font-size: 12px; }
.rni .kpi .agent { font-size: 10px; color: var(--grey-light); display: none; }

/* ═══════════════════════════════════════════════════════════════════════════
   

/* ── SECTION 6: DOCTOR CARDS ── */
 - DOCTOR CARDS
═══════════════════════════════════════════════════════════════════════════════ */

.rni .council-intro {
  text-align: center;
  max-width: 900px;
  margin: 32px auto 24px;
  color: var(--grey);
  font-size: 15px;
  line-height: 1.7;
}

.rni .doctor-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 0 0 20px;
}

.rni .doctor-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 24px;
  transition: all 0.25s;
  cursor: pointer;
  position: relative;
}

.rni .doctor-card:hover {
  transform: translateY(-2px);
}

/* Doctor Card Left Accent — 75% height, 2px */
.rni .doctor-card.card-williams { --doc-accent: var(--dr-williams); }
.rni .doctor-card.card-olivia { --doc-accent: var(--dr-olivia); }
.rni .doctor-card.card-rivera { --doc-accent: var(--dr-rivera); }
.rni .doctor-card.card-chen { --doc-accent: var(--dr-chen); }
.rni .doctor-card.card-peterson { --doc-accent: var(--dr-peterson); }
.rni .doctor-card.card-taylor { --doc-accent: var(--dr-taylor); }
.rni .doctor-card::before {
  content: ""; position: absolute; left: 0; top: 12.5%; height: 75%; width: 2px;
  background: var(--doc-accent); border-radius: 1px;
}

/* Doctor-specific hover shadows */
.rni .doctor-card.card-williams:hover { box-shadow: 0 8px 24px rgba(212, 175, 55, 0.2); }
.rni .doctor-card.card-olivia:hover { box-shadow: 0 8px 24px rgba(67, 219, 163, 0.2); }
.rni .doctor-card.card-rivera:hover { box-shadow: 0 8px 24px rgba(59, 130, 246, 0.2); }
.rni .doctor-card.card-chen:hover { box-shadow: 0 8px 24px rgba(220, 38, 38, 0.2); }
.rni .doctor-card.card-peterson:hover { box-shadow: 0 8px 24px rgba(0, 184, 212, 0.2); }
.rni .doctor-card.card-taylor:hover { box-shadow: 0 8px 24px rgba(155, 89, 182, 0.2); }

.rni .doctor-card h4 {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 700;
  color: var(--charcoal);
}

.rni .doctor-card .specialty {
  font-size: 11px;
  font-weight: 700;
  color: var(--grey);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.rni .doctor-card p {
  font-size: 14px;
  color: var(--grey);
  line-height: 1.6;
  margin: 0 0 16px;
}

.rni .consult-btn {
  background: none;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--charcoal);
  cursor: pointer;
  transition: all 0.25s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Doctor-specific consult button hover colors */
.rni .doctor-card.card-williams .consult-btn:hover {
  border-color: var(--dr-williams);
  color: var(--dr-williams);
}
.rni .doctor-card.card-olivia .consult-btn:hover {
  border-color: var(--dr-olivia);
  color: var(--dr-olivia);
}
.rni .doctor-card.card-rivera .consult-btn:hover {
  border-color: var(--dr-rivera);
  color: var(--dr-rivera);
}
.rni .doctor-card.card-chen .consult-btn:hover {
  border-color: var(--dr-chen);
  color: var(--dr-chen);
}
.rni .doctor-card.card-peterson .consult-btn:hover {
  border-color: var(--dr-peterson);
  color: var(--dr-peterson);
}
.rni .doctor-card.card-taylor .consult-btn:hover {
  border-color: var(--dr-taylor);
  color: var(--dr-taylor);
}

.rni .consult-btn i {
  font-size: 12px;
  transition: transform 0.25s;
}

.rni .consult-btn:hover i {
  transform: translateX(3px);
}

.rni .council-tagline {
  text-align: center;
  color: var(--grey);
  font-size: 14px;
  margin: 24px 0 32px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   PAGE-CONTENT VIEW SYSTEM (switchView paradigm)
═══════════════════════════════════════════════════════════════════════════════ */

.page-content { display: none; }
.page-content.active { display: block; animation: fadeInView 0.3s ease; }
@keyframes fadeInView { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ═══════════════════════════════════════════════════════════════════════════
   SUCCESS FACTORS TRACKER
═══════════════════════════════════════════════════════════════════════════════ */

.success-factors { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 0 0 32px; }
.sf-card { background: var(--cream); border: 1px solid var(--outline); border-radius: 14px; padding: 18px 20px; transition: 0.25s; }
.sf-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.06); }
.sf-header { display: flex; justify-content: space-between; align-items: center; margin: 0 0 10px; }
.sf-label { font-weight: 700; font-size: 14px; color: var(--charcoal); }
.sf-target { font-size: 12px; color: var(--grey); font-weight: 500; }
.sf-bar-track { height: 8px; background: var(--outline); border-radius: 100px; overflow: hidden; margin: 0 0 8px; }
.sf-bar-fill { height: 100%; background: linear-gradient(90deg, #3B82F6, #60A5FA); border-radius: 100px; transition: width 1s ease; }
.sf-values { display: flex; justify-content: space-between; font-size: 12px; }
.sf-baseline { color: var(--grey); }
.sf-current { color: #059669; font-weight: 600; }

.rni.dark .sf-card { background: #161B22; border-color: #30363D; }
.rni.dark .sf-label { color: #E6EDF3; }
.rni.dark .sf-bar-track { background: #30363D; }

/* ═══════════════════════════════════════════════════════════════════════════
   

/* ── SECTION 7: CHARTS ── */

═══════════════════════════════════════════════════════════════════════════════ */

.rni .charts { margin: 32px 0; }
.rni .charts .row { display: grid; gap: 18px; margin: 0 0 24px; }
.rni .charts .row.trio { grid-template-columns: repeat(3, 1fr); }
.rni .charts .row.duo { grid-template-columns: repeat(2, 1fr); }

.rni .chart {
  background: #fff;
  border-radius: 6px;
  box-shadow: var(--shadow-sm);
  padding: 24px;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  border-left: none;
}

.rni .chart-header { margin-bottom: 14px; padding-bottom: 12px; position: relative; }
.rni .chart-header::after { content: ""; position: absolute; bottom: 0; left: 12.5%; width: 75%; height: 2px; background: #E8ECF1; border-radius: 1px; }
.rni .chart-header h4 { margin: 0 0 2px; font-size: 16px; font-weight: 700; color: var(--charcoal); }
.rni .chart-header .doctor-name { font-size: 12px; font-weight: 600; margin: 0 0 4px; letter-spacing: 0.3px; }
.rni .chart-header .sub { font-size: 12px; color: var(--grey-light); line-height: 1.4; }
.rni .chart-body {
  flex: 1;
  display: block;
  background: #FAFBFD;
  border-radius: 6px;
  padding: 16px;
  position: relative;
  min-height: 200px;
}
.rni .chart-body canvas { display: block !important; width: 100% !important; height: 100% !important; }

/* ═══ EXECUTIVE BRIEF — 3 Insight Rows with Arrows ═══ */
.rni .exec-brief { margin: 0 0 20px; }
.rni .exec-insight {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 0; cursor: pointer; position: relative;
  transition: background 0.15s;
}
.rni .exec-insight:hover { background: rgba(59,130,246,0.02); }
.rni .exec-insight::after {
  content: ""; position: absolute; bottom: 0; left: 12.5%; width: 75%; height: 2px;
  background: #E8ECF1; border-radius: 1px;
}
.rni .exec-insight:last-child::after { display: none; }
.rni .exec-insight-badge {
  flex-shrink: 0; width: 52px; height: 26px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
}
.rni .exec-insight-badge.high { background: rgba(220,38,38,0.1); color: #DC2626; border: 1px solid #DC2626; }
.rni .exec-insight-badge.opp { background: rgba(212,175,55,0.1); color: var(--gold); border: 1px solid var(--gold); }
.rni .exec-insight-badge.win { background: rgba(67,219,163,0.1); color: var(--emerald); border: 1px solid var(--emerald); }
.rni .exec-insight-text { flex: 1; font-size: 14px; color: #374151; line-height: 1.5; }
.rni .exec-insight-text strong { color: var(--charcoal); }
.rni .exec-insight-arrow { color: #9CA3AF; font-size: 13px; transition: transform 0.15s, color 0.15s; }
.rni .exec-insight:hover .exec-insight-arrow { color: var(--emerald); transform: translateX(3px); }

/* ═══ WHISPER RAIL (Audit: "whispers from the machine") ═══ */
.whisper-rail {
  background: #F9FAFB; border: 1px solid #F0F0F0; border-radius: 6px;
  padding: 16px; overflow-y: auto; max-height: 560px;
}
.whisper-hdr {
  font-size: 10px; font-weight: 700; color: #9CA3AF;
  text-transform: uppercase; letter-spacing: 0.6px;
  margin-bottom: 14px; display: flex; align-items: center; gap: 6px;
}
.whisper-hdr i { font-size: 10px; }
.whisper-msg {
  padding: 10px 0; position: relative;
  font-size: 12px; line-height: 1.55; color: #6B7280;
}
.whisper-msg::after {
  content: ""; position: absolute; bottom: 0; left: 12.5%; width: 75%; height: 2px;
  background: #E8ECF1; border-radius: 1px;
}
.whisper-msg:last-child::after { display: none; }
.whisper-doc { font-size: 10px; font-weight: 600; letter-spacing: 0.3px; display: block; margin-bottom: 3px; }
.whisper-ts { font-size: 10px; color: #D1D5DB; display: block; margin-top: 4px; }

/* ═══ EXEC ACTION MODAL (WHY/WHAT/HOW) — Heebo, charcoal header, white text ═══ */
/* ═══ RNI ACTION MODAL — From Clinical Canon ═══ */
.rni-action-overlay{display:none;position:fixed;inset:0;background:rgba(0,0,0,0.6);z-index:2500;align-items:center;justify-content:center;padding:20px}
.rni-action-overlay.active{display:flex}
.rni-action-panel{background:#fff;border-radius:6px;width:100%;max-width:580px;max-height:85vh;overflow-y:auto;box-shadow:0 25px 50px -12px rgba(0,0,0,0.25);font-family:'Heebo',sans-serif;position:relative}
.rni-action-header{padding:18px 24px;background:#1C1F25;border-radius:6px 6px 0 0;display:flex;align-items:center;gap:16px}
.rni-action-icon{width:48px;height:48px;border-radius:50%;display:flex;align-items:center;justify-content:center;flex-shrink:0;border:3px solid currentColor;background:transparent}
.rni-action-icon.critical{color:#DC2626}.rni-action-icon.warning{color:#D97706}.rni-action-icon.success{color:#059669}.rni-action-icon.info{color:#3B82F6}
.rni-action-body{padding:0 28px 16px}
.rni-action-section{padding:14px 0;position:relative}
.rni-action-section::after{content:"";position:absolute;bottom:0;left:12.5%;width:75%;height:2px;background:#E8ECF1;border-radius:1px}
.rni-action-section:last-child::after{display:none}
.rni-section-label{display:flex;align-items:center;gap:8px;margin-bottom:10px;font-weight:600;font-size:14px;color:#111827}
.rni-section-tag{font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:1px;padding:3px 8px;border-radius:4px;display:inline-block}
.rni-section-tag.what{background:#DBEAFE;color:#1FA577}.rni-section-tag.why{background:#FEF3C7;color:#92400E}.rni-section-tag.how{background:#D1FAE5;color:#065F46}
.rni-action-footer{padding:16px 28px 24px;display:flex;gap:10px;flex-wrap:wrap}

/* Legacy exec modal aliases — keep KPI onclick working */
.exec-overlay { display: none; }

/* Dark mode */
.rni.dark .rni-action-panel { background: #161B22; }
.rni.dark .rni-action-section::after { background: #30363D; }
.rni.dark .rni-section-label { color: #E6EDF3; }
.rni.dark .rni-section-tag.what { background: #172B4D; color: #79C0FF; }
.rni.dark .rni-section-tag.why { background: #3D2E10; color: #E3B341; }
.rni.dark .rni-section-tag.how { background: #0F2A1C; color: #56D364; }

@media (max-width: 1200px) {
  .chart-rail { grid-template-columns: 1fr !important; }
  .whisper-rail { max-height: 250px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   

/* ═══════════════════════════════════════════════════════════════
   PERFORMANCE CHARTS — Clinical surface
═══════════════════════════════════════════════════════════════ */
.rni .perf-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin: 0 0 24px;
}
.rni .perf-chart-card {
  background: #fff;
  border-radius: 6px;
  box-shadow: var(--shadow-sm);
  padding: 24px;
  min-height: 240px;
  display: flex;
  flex-direction: column;
}
.rni .perf-chart-card h4 {
  margin: 0 0 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.rni .perf-stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
  color: var(--slate);
  position: relative;
}
.rni .perf-stat-row:last-child { border-bottom: none; }
.rni .perf-stat-row::before {
  content: '';
  position: absolute;
  left: 0; top: 20%; height: 60%;
  width: 3px; border-radius: 2px;
}
.rni .perf-stat-row.gold::before    { background: var(--gold); }
.rni .perf-stat-row.green::before   { background: var(--emerald); }
.rni .perf-stat-row.charcoal::before{ background: var(--charcoal); }
.rni .perf-stat-row.teal::before    { background: #0891B2; }
.rni .perf-stat-value {
  font-weight: 700;
  color: var(--ink);
  font-size: 15px;
}
.rni .perf-action-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
  color: var(--slate);
}


/* ── SECTION 8: DAY 90 READINESS ── */

/* ═══════════════════════════════════════════════════════════════
   DAY 90 READINESS — Clinical surface
═══════════════════════════════════════════════════════════════ */
.rni .readiness-panel {
  background: #fff;
  border-radius: 6px;
  box-shadow: var(--shadow-sm);
  padding: 24px;
  margin: 0 0 24px;
  border-top: 3px solid var(--emerald);
}
.rni .readiness-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 20px;
}
.rni .readiness-header h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.rni .readiness-score {
  font-size: 36px;
  font-weight: 800;
  color: var(--emerald);
  line-height: 1;
}
.rni .readiness-score span {
  font-size: 16px;
  font-weight: 500;
  color: var(--muted);
}
.rni .readiness-bar-wrap {
  background: var(--border-light);
  border-radius: 4px;
  height: 8px;
  margin: 12px 0;
  overflow: hidden;
}
.rni .readiness-bar {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--emerald-dark), var(--emerald));
  transition: width 0.6s ease;
}
.rni .readiness-factors {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 16px;
}
.rni .readiness-factor {
  text-align: center;
  padding: 12px;
  background: var(--bg);
  border-radius: 6px;
}
.rni .readiness-factor .rf-score {
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
}
.rni .readiness-factor .rf-label {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.rni.dark .readiness-panel { background: #161B22; border-top-color: var(--emerald); }
.rni.dark .readiness-bar-wrap { background: #30363D; }
.rni.dark .readiness-factor { background: #0D1117; }
.rni.dark .readiness-factor .rf-score { color: var(--emerald); }


/* ── SECTION 9: EHR DEMO BADGE ── */

/* ═══════════════════════════════════════════════════════════════
   EHR DEMO MODE BADGE
═══════════════════════════════════════════════════════════════ */
.rni .ehr-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(244,200,75,0.12);
  border: 1px solid rgba(244,200,75,0.4);
  color: #92400E;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.rni .ehr-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #F59E0B;
  display: inline-block;
}


/* ── SECTION 10: PHOENIX STATUS MODAL ── */

/* ═══════════════════════════════════════════════════════════════
   PHOENIX STATUS MODAL
═══════════════════════════════════════════════════════════════ */
.phoenix-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 3000;
  align-items: center;
  justify-content: center;
}
.phoenix-modal.active { display: flex; }
.phoenix-modal-dialog {
  background: #fff;
  border-radius: 10px;
  width: 100%;
  max-width: 560px;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}
.phoenix-modal-header {
  background: linear-gradient(135deg, #2EBD8A 0%, #1FA577 100%);
  color: #fff;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.phoenix-modal-header h3 { margin: 0; font-size: 16px; font-weight: 700; }
.phoenix-modal-body { padding: 24px; }
.phoenix-modal-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
}
.phoenix-modal-row:last-child { border-bottom: none; }
.phoenix-modal-row .label { color: var(--slate); }
.phoenix-modal-row .value { font-weight: 600; color: var(--ink); }
.phoenix-modal-row .value.active { color: var(--emerald); }
.phoenix-modal-row .value.warning { color: var(--amber); }
.rni.dark .phoenix-modal-dialog { background: #161B22; }
.rni.dark .phoenix-modal-body { border-color: #30363D; }
.rni.dark .phoenix-modal-row { border-color: #21262D; }
.rni.dark .phoenix-modal-row .value { color: #E6EDF3; }


/* ── SECTION 11: EVIDENCE DRAWER (Executive master + green) ── */

═══════════════════════════════════════════════════════════════════════════════ */

.evidence-drawer {
  position: fixed;
  top: 0;
  right: -420px;
  width: 420px;
  height: 100vh;
  background: #f5f5f7;
  box-shadow: -1px 0 0 rgba(0,0,0,0.1), -8px 0 32px rgba(0,0,0,0.12);
  z-index: 1500;
  transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.evidence-drawer.active { right: 0; }

/* Signals View: Evidence drawer as inline full-page content */
.evidence-drawer.inline-view {
  position: static !important;
  width: 100% !important;
  height: auto !important;
  min-height: calc(100vh - 120px);
  box-shadow: none !important;
  border-radius: 0 !important;
  display: block !important;
  z-index: auto !important;
}
.evidence-drawer.inline-view .evidence-drawer-close { display: none; }
.evidence-drawer.inline-view .evidence-drawer-body { max-height: none; overflow: visible; }


.evidence-drawer-header {
  background: #fff;
  color: #1d1d1f;
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}
.evidence-drawer-header::after {
  content: ""; position: absolute; bottom: 0; left: 12.5%; width: 75%; height: 2px;
  background: #E8ECF1; border-radius: 1px;
}

.evidence-drawer-header h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.02em;
}

.evidence-drawer-header h3 i { color: var(--gold); }

.evidence-drawer-close {
  background: none;
  border: none;
  color: #86868b;
  font-size: 20px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.evidence-drawer-close:hover {
  background: #f0f0f0;
  color: #1d1d1f;
}

.evidence-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.evidence-section {
  margin-bottom: 20px;
  background: #fff;
  border-radius: 12px;
  padding: 16px;
}

.evidence-section h4 {
  font-size: 13px;
  font-weight: 600;
  color: #86868b;
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.vote-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.vote-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #fff;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #1d1d1f;
}

.vote-item .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #86868b;
}

.vote-item.approve .dot { background: #86868b; }
.vote-item.abstain .dot { background: #c7c7cc; }
.vote-item.veto .dot { background: #ef4444; animation: vetoPulse 1s ease-in-out infinite; }

.vote-item.veto {
  background: #fef2f2;
  color: #b91c1c;
}

@keyframes vetoPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}

/* Veto Alert Banner */
.veto-alert-banner {
  background: linear-gradient(135deg, #FEE2E2 0%, #FECACA 100%);
  border: 2px solid var(--dr-chen);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: vetoSlideIn 0.3s ease;
}

@keyframes vetoSlideIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.veto-alert-icon {
  width: 40px;
  height: 40px;
  background: var(--dr-chen);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.veto-alert-icon i {
  color: #fff;
  font-size: 18px;
}

.veto-alert-content {
  flex: 1;
}

.veto-alert-content strong {
  display: block;
  color: var(--dr-chen);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.veto-alert-content span {
  color: #991B1B;
  font-size: 13px;
}

.veto-alert-time {
  font-size: 11px;
  color: #991B1B;
  font-family: monospace;
}

/* ═══════════════════════════════════════════════════════════════════════════
   EVIDENCE DRAWER - LIVE SIGNAL FEED 
═══════════════════════════════════════════════════════════════════════════════ */

/* Header with LIVE indicator */
.evidence-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.evidence-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.live-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #10b981;
  letter-spacing: 0.5px;
}

.live-dot {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  animation: livePulse 2s ease-in-out infinite;
}

@keyframes livePulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  50% { opacity: 0.6; box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
}

/* Tabs - Apple Segmented Control Style */
.evidence-tabs {
  display: flex;
  padding: 4px;
  margin: 12px 16px;
  background: #e5e5e5;
  border-radius: 8px;
}

.evidence-tab {
  flex: 1;
  padding: 8px 12px;
  border: none;
  background: none;
  font-size: 13px;
  font-weight: 500;
  color: #1d1d1f;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
  border-radius: 6px;
}

.evidence-tab:hover {
  color: #1d1d1f;
}

.evidence-tab.active {
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  color: #1d1d1f;
}

.evidence-tab i {
  font-size: 12px;
  opacity: 0.7;
}

/* Tab Content */
.evidence-tab-content {
  display: none;
}

.evidence-tab-content.active {
  display: block;
}

/* Feed Header - Apple Style */
.feed-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding: 0 4px;
}

.feed-count {
  font-size: 13px;
  color: #86868b;
}

.feed-count span {
  font-weight: 600;
  color: #1d1d1f;
}

.feed-filters {
  display: flex;
  gap: 6px;
}

.feed-filter {
  padding: 6px 12px;
  border: none;
  background: #fff;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 500;
  color: #86868b;
  cursor: pointer;
  transition: all 0.15s;
}

.feed-filter:hover {
  background: #f5f5f7;
  color: #1d1d1f;
}

.feed-filter.active {
  background: #1d1d1f;
  color: #fff;
}

/* Signal Feed List - Apple Card Style */
.signal-feed {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  max-height: calc(100vh - 280px);
  overflow-y: auto;
}

.signal-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: #fff;
  position: relative;
  cursor: pointer;
  transition: background 0.15s ease;
}

.signal-item:first-child {
  border-radius: 6px 6px 0 0;
}

.signal-item:last-child {
  border-bottom: none;
  border-radius: 0 0 6px 6px;
}

.signal-item:only-child {
  border-radius: 6px;
}

.signal-item::after {
  content: ""; position: absolute; bottom: 0; left: 12.5%; width: 75%; height: 2px;
  background: #E8ECF1; border-radius: 1px;
}
.signal-item:last-child::after { display: none; }

.signal-item:hover {
  background: #fafafa;
}

.signal-item:active {
  background: #f5f5f5;
}

.signal-item-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.signal-severity {
  width: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.signal-severity.critical {
  color: #dc2626;
}

.signal-severity.elevated {
  color: #b45309;
}

.signal-severity.normal {
  color: #16a34a;
}

.signal-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.signal-item-title {
  font-size: 15px;
  font-weight: 500;
  color: #1d1d1f;
  letter-spacing: -0.01em;
}

.signal-item-source {
  font-size: 13px;
  color: #86868b;
  letter-spacing: -0.01em;
}

.signal-item-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.signal-item-time {
  font-size: 13px;
  color: #86868b;
}

.signal-item-status {
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.signal-item-status.veto {
  color: #dc2626;
}

.signal-item-status.escalate {
  color: #2563eb;
}

.signal-item-status.monitoring {
  color: #b45309;
}

.signal-item-status.approved {
  color: #16a34a;
}

/* Load More Button */
.load-more-signals {
  width: 100%;
  padding: 12px;
  margin-top: 12px;
  border: 1px dashed #e5e7eb;
  background: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--grey);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.load-more-signals:hover {
  border-color: var(--gold);
  color: var(--gold);
}

/* Back to Feed Button */
.back-to-feed {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  margin-bottom: 16px;
  border: none;
  background: #f1f5f9;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--grey);
  cursor: pointer;
  transition: all 0.2s;
}

.back-to-feed:hover {
  background: #e2e8f0;
  color: var(--charcoal);
}

/* Vote Summary Boxes - Apple Style */
.vote-summary {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.vote-box {
  flex: 1;
  padding: 16px 12px;
  border-radius: 12px;
  text-align: center;
  background: #fff;
  border: 1px solid #e5e5e5;
}

.vote-box.approve {
  border-color: rgba(52, 199, 89, 0.3);
}

.vote-box.approve .vote-count {
  color: #34c759;
}

.vote-box.veto {
  border-color: rgba(255, 59, 48, 0.3);
}

.vote-box.veto .vote-count {
  color: #ff3b30;
}

.vote-box.abstain {
  border-color: rgba(255, 149, 0, 0.3);
}

.vote-box.abstain .vote-count {
  color: #ff9500;
}

.vote-count {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 4px;
}

.vote-label {
  font-size: 12px;
  color: #86868b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 500;
}

.vote-count {
  display: block;
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 4px;
}

.vote-box.approve .vote-count { color: #059669; }
.vote-box.veto .vote-count { color: #DC2626; }
.vote-box.abstain .vote-count { color: #D97706; }

.vote-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--grey);
}

.canon-quote {
  background: #FDF6E7;
  border-left: 2px solid var(--gold);
  padding: 16px;
  border-radius: 0 4px 4px 0;
  font-size: 14px;
  color: var(--charcoal);
  line-height: 1.6;
  font-style: italic;
}

.audit-info {
  background: #f9fafb;
  padding: 16px;
  border-radius: 6px;
}

.audit-info .row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 13px;
}

.audit-info .row .label { color: var(--grey); }
.audit-info .row .value { color: var(--charcoal); font-weight: 600; font-family: monospace; }

/* Evidence Section Icons */
.evidence-section h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--grey-dark);
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.evidence-section h4 i {
  color: var(--gold);
  font-size: 12px;
}

/* Signal Origin Card */
.signal-origin-card {
  background: #f9fafb;
  border-radius: 6px;
  padding: 16px;
  border-left: 2px solid var(--gold);
}

.signal-source, .signal-timestamp {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 13px;
}

.signal-label {
  color: var(--grey);
  font-weight: 500;
}

.signal-value {
  color: var(--charcoal);
  font-weight: 600;
}

.signal-content {
  margin-top: 12px;
  padding-top: 12px;
  position: relative;
}
.signal-content::before {
  content: ""; position: absolute; top: 0; left: 12.5%; width: 75%; height: 2px;
  background: #E8ECF1; border-radius: 1px;
}

.signal-content .signal-label {
  display: block;
  margin-bottom: 8px;
}

.signal-quote {
  background: #fff;
  padding: 12px;
  border-radius: 6px;
  font-size: 14px;
  color: var(--charcoal);
  font-style: italic;
  line-height: 1.6;
  border: 1px solid #e5e7eb;
}

/* Council Analysis */
.council-analysis {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.analysis-item {
  background: #f9fafb;
  border-radius: 6px;
  padding: 14px;
  border-left: 2px solid var(--grey-light);
}

.analysis-item[data-doctor="olivia"] { border-left-color: var(--dr-olivia); }
.analysis-item[data-doctor="taylor"] { border-left-color: var(--dr-taylor); }
.analysis-item[data-doctor="chen"] { border-left-color: var(--dr-chen); }
.analysis-item[data-doctor="williams"] { border-left-color: var(--dr-williams); }
.analysis-item[data-doctor="rivera"] { border-left-color: var(--dr-rivera); }
.analysis-item[data-doctor="peterson"] { border-left-color: var(--dr-peterson); }

.analysis-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

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

.analysis-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--charcoal);
}

.analysis-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.analysis-badge.risk-high {
  background: rgba(220, 38, 38, 0.12);
  color: #DC2626;
}

.analysis-badge.risk-elevated {
  background: rgba(245, 158, 11, 0.12);
  color: #D97706;
}

.analysis-badge.governance {
  background: rgba(220, 38, 38, 0.12);
  color: #DC2626;
  border: 1px solid #DC2626;
}

.analysis-insight {
  font-size: 13px;
  color: var(--grey-dark);
  line-height: 1.5;
  font-style: italic;
}

/* Vote Outcome */
.vote-outcome {
  margin-top: 12px;
  padding: 12px;
  background: #FEF3C7;
  border-radius: 6px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: #92400E;
}

.vote-outcome i {
  color: #D97706;
  margin-top: 2px;
}

/* Recommended Action Card */
.action-card {
  background: #fff;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px;
}

.action-priority {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.action-priority.urgent {
  background: #DC2626;
  color: #fff;
}

.action-priority.standard {
  background: var(--gold);
  color: #fff;
}

.action-text {
  font-size: 14px;
  color: var(--charcoal);
  line-height: 1.6;
  margin-bottom: 16px;
}

.action-buttons {
  display: flex;
  gap: 10px;
}

.action-btn {
  flex: 1;
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
}

.action-btn.primary {
  background: var(--charcoal);
  color: #fff;
  border: none;
}

.action-btn.primary:hover {
  background: var(--gold);
}

.action-btn.secondary {
  background: #fff;
  color: var(--charcoal);
  border: 1px solid #e5e7eb;
}

.action-btn.secondary:hover {
  border-color: var(--gold);
  color: var(--gold);
}

/* ═══════════════════════════════════════════════════════════════════════════
   

/* ── SECTION 12: CHAT MODAL (Executive master + green) ── */
 (Clinical Style)
═══════════════════════════════════════════════════════════════════════════════ */

.chat-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.chat-modal.active { display: flex; }

.chat-dialog {
  background: #fff;
  border-radius: 8px;
  width: 100%;
  max-width: 700px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
}

.chat-header {
  padding: 20px 24px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.chat-header::after {
  content: ""; position: absolute; bottom: 0; left: 12.5%; width: 75%; height: 2px;
  background: #E8ECF1; border-radius: 1px;
}

.chat-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-logo-wrap {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid currentColor;
  background: var(--charcoal);
  padding: 8px;
}

.chat-logo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 4px rgba(255,255,255,0.3));
}

.chat-doctor-info .name {
  font-size: 16px;
  font-weight: 800;
  color: var(--charcoal);
}

.chat-doctor-info .specialty {
  font-size: 12px;
  color: var(--grey);
}

.chat-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--grey);
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.3s;
}

.chat-close:hover { color: var(--charcoal); }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background: #FAFBFD;
  min-height: 300px;
}

.chat-message {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  animation: messageSlide 0.3s ease-out;
}

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

.chat-message.user { flex-direction: row-reverse; }

.chat-message .msg-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.chat-message .msg-initial {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.chat-message .msg-bubble {
  max-width: 70%;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
}

.chat-message.doctor .msg-bubble {
  background: #fff;
  color: var(--charcoal);
  border: 1px solid #E5E7EB;
}

.chat-message.user .msg-bubble {
  background: var(--gold);
  color: #fff;
}

.chat-message .msg-meta {
  font-size: 10px;
  color: var(--grey-light);
  margin-top: 4px;
  display: flex;
  gap: 8px;
}

.typing-indicator {
  display: none;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.typing-indicator.active { display: flex; }

.typing-dots {
  background: #fff;
  border: 1px solid #E5E7EB;
  padding: 12px 16px;
  border-radius: 12px;
  display: flex;
  gap: 4px;
}

.typing-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--grey-light);
  animation: typingBounce 1.4s infinite;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-8px); }
}

.chat-input-area {
  padding: 16px 24px;
  background: #fff;
  position: relative;
}
.chat-input-area::before {
  content: ""; position: absolute; top: 0; left: 12.5%; width: 75%; height: 2px;
  background: #E8ECF1; border-radius: 1px;
}

.chat-input-wrapper {
  display: flex;
  gap: 12px;
}

.chat-input {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid #E5E7EB;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.3s;
}

.chat-input:focus {
  outline: none;
  border-color: var(--gold);
}

.chat-send {
  padding: 12px 24px;
  background: var(--gold);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
}

.chat-send:hover { opacity: 0.9; transform: scale(1.02); }
.chat-send:disabled { opacity: 0.5; cursor: not-allowed; transform: scale(1); }

/* ═══════════════════════════════════════════════════════════════════════════
   

/* ── SECTION 13: MODAL FONT ENFORCEMENT ── */
Force Heebo on ALL modals, drawers, overlays */
.phoenix-modal, .phoenix-modal *,
.chat-modal, .chat-modal *,
.settings-modal, .settings-modal *,
.evidence-drawer, .evidence-drawer *,
.exec-action-modal, .exec-action-modal *,
.kpi-detail-modal, .kpi-detail-modal * {
  font-family: 'Heebo', system-ui, -apple-system, sans-serif !important;
}

/* ── SECTION 14: EKG FOOTER ── */

═══════════════════════════════════════════════════════════════════════════════ */

.rni .heartbeat {
  background: #fff;
  padding: 28px 0 20px;
  text-align: center;
}

.rni .ekg-line {
  height: 40px;
  width: 200px;
  margin: 0 auto 8px;
  position: relative;
  overflow: hidden;
}

.rni .ekg-line svg {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 400px;
  height: 40px;
  animation: ekg-scroll 3s linear infinite;
}

@keyframes ekg-scroll {
  from { left: 0; }
  to { left: -200px; }
}

.rni .tagline-bottom {
  color: var(--gold);
  font-weight: 500;
  font-size: 14px;
  margin: 6px 0 2px;
}

.rni .meta {
  color: var(--grey);
  font-size: 12px;
  font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════════════════════
   

/* ── SECTION 15: COMPLIANCE FOOTER ── */

═══════════════════════════════════════════════════════════════════════════════ */

.rni .compliance-wrap {
  max-width: 1100px;
  margin: 32px auto 0;
  padding: 0 24px;
}

.rni .compliance {
  background: var(--charcoal);
  color: #fff;
  border-radius: 8px;
  box-shadow: var(--shadow-xl);
  padding: 20px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.rni .compliance .line1 {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  margin: 0;
  letter-spacing: 0.3px;
}

.rni .compliance .line2 {
  font-size: 12px;
  font-weight: 500;
  color: #d1d5db;
  margin: 0;
}

.rni .compliance .line3 {
  font-size: 11px;
  font-weight: 500;
  color: #d1d5db;
  margin: 0;
}

.rni .compliance .line3 a {
  color: var(--gold);
  text-decoration: none;
  transition: color 0.2s;
  margin: 0 4px;
}

.rni .compliance .line3 a.privacy:hover { color: var(--dr-olivia); }
.rni .compliance .line3 a.terms:hover { color: var(--dr-rivera); }
.rni .compliance .line3 a.hipaa:hover { color: var(--dr-chen); }
.rni .compliance .line3 a.ai-support:hover { color: var(--dr-peterson); }

/* ═══════════════════════════════════════════════════════════════════════════
   

/* ── SECTION 16: RESPONSIVE ── */
SECTION 18: RESPONSIVE
═══════════════════════════════════════════════════════════════════════════════ */

@media (max-width: 1200px) {
  .rni .uptime-row { grid-template-columns: repeat(3, 1fr); }
  .rni .doctor-grid { grid-template-columns: repeat(2, 1fr); }
  .success-factors { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 1000px) {
  .rni .main { margin-left: 0; padding-top: 20px; max-width: 100vw; }
  .rni .sidebar {
    position: static;
    width: 100%;
    min-height: auto;
    flex-direction: row;
    justify-content: space-around;
    padding: 16px 10px;
  }
  .rni .nav a span { display: none; }
  .rni .kpis { grid-template-columns: repeat(2, 1fr); }
  .rni .uptime-row { grid-template-columns: repeat(2, 1fr); }
  .rni .doctor-grid { grid-template-columns: repeat(2, 1fr); }
  .rni .charts .row.trio { grid-template-columns: 1fr; }
  .rni .strategy-grid { grid-template-columns: 1fr; }
  .success-factors { grid-template-columns: repeat(2, 1fr); }
  .evidence-drawer { width: 100%; right: -100%; }
}

@media (max-width: 600px) {
  .rni .kpis { grid-template-columns: 1fr; }
  .rni .uptime-row { grid-template-columns: 1fr; }
  .rni .doctor-grid { grid-template-columns: 1fr; }
  .success-factors { grid-template-columns: 1fr; }
}


/* ── ONBOARDING NOTE ──
   Onboarding is handled by RNI.onboarding() in rni-session.js
   CSS styling is injected dynamically by the onboarding module
   No static CSS needed here.
*/


/* ═══════════════════════════════════════════════════════
   RNI CLINICAL — BRANDING PATCH v3
   Fixes: blue SVG nav icons → clinical green
   Fixes: patient row full-height border → 75% accent
   Fixes: nav hover 75% left border per RNI spec
   March 2026 — data that heals™
═══════════════════════════════════════════════════════ */

/* ── RNI-ROW-BAR: 75% LEFT ACCENT (universal) ── */
.rni .rni-row-bar { position: relative; }
.rni .rni-row-bar::before {
  content: ''; position: absolute; left: 0; top: 12.5%; height: 75%;
  width: 2px; border-radius: 1px; background: var(--border);
}
.rni .rni-row-bar.gold::before     { background: var(--gold); }
.rni .rni-row-bar.emerald::before  { background: var(--emerald); }
.rni .rni-row-bar.red::before      { background: #DC2626; }
.rni .rni-row-bar.amber::before    { background: #D97706; }
.rni .rni-row-bar.charcoal::before { background: var(--charcoal); }

/* ── SVG NAV ICONS: #6B7280 ALWAYS — icons never change color (DNA spec) ── */
html body .rni .nav a svg,
html body .rni .nav a svg path,
html body .rni .nav a svg circle,
html body .rni .nav a svg line,
html body .rni .nav a svg polyline,
html body .rni .nav a svg rect {
  color: #6B7280 !important;
  stroke: #6B7280 !important;
}
html body .rni .nav a:hover svg,
html body .rni .nav a:hover svg path,
html body .rni .nav a:hover svg circle,
html body .rni .nav a:hover svg line,
html body .rni .nav a:hover svg polyline,
html body .rni .nav a:hover svg rect {
  color: #6B7280 !important;
  stroke: #6B7280 !important;
}
html body .rni .nav a.active svg,
html body .rni .nav a.active svg path,
html body .rni .nav a.active svg circle,
html body .rni .nav a.active svg line,
html body .rni .nav a.active svg polyline,
html body .rni .nav a.active svg rect {
  color: #6B7280 !important;
  stroke: #6B7280 !important;
}
html body .rni .nav a.logout-link:hover svg,
html body .rni .nav a.logout-link:hover svg path,
html body .rni .nav a.logout-link:hover svg line {
  color: #DC2626 !important;
  stroke: #DC2626 !important;
}

/* ── NAV HOVER — clinical green background + left border ── */
html body .rni .nav a {
  position: relative;
  border-left: 2px solid transparent !important;
  transition: all .15s !important;
}
html body .rni .nav a:hover {
  background: rgba(67,219,163,0.06) !important;
  border-left: 2px solid rgba(67,219,163,0.5) !important;
}
html body .rni .nav a.active {
  background: rgba(67,219,163,0.08) !important;
  border-left: 2px solid #43DBA3 !important;
}
html body .rni .nav a.active span { color: #1A1A2E !important; font-weight: 600 !important; }
html body .rni .nav a:hover span  { color: #2a7d5e !important; }
html body .rni .nav a.logout-link:hover {
  background: #FEF2F2 !important;
  border-left: 2px solid #DC2626 !important;
}
html body .rni .nav a.logout-link:hover span { color: #DC2626 !important; }

/* ── STRIP FRESHNESS ── */
#strip-freshness { font-size: 9px; color: var(--muted); }
