/* RNI Clinical Portal — client-clinical.css — */

/* ── Fail-Closed Gate Styles ── */
/* LOCAL PREVIEW: html.rni-locked body { opacity: 0 !important; pointer-events: none !important; } */
html.rni-unlocked body { opacity: 1; pointer-events: auto; transition: opacity 120ms ease; }
#rni-lockscreen {
  position: fixed; inset: 0; display: none; align-items: center; justify-content: center;
  font-family: 'Heebo', system-ui, sans-serif; background: #FFFFFF; color: #1C1F25; z-index: 999999;
  flex-direction: column; gap: 0;
}
html.rni-locked #rni-lockscreen { display: flex; }
#rni-lockscreen .lock-logo { margin-bottom: 24px; }
#rni-lockscreen .lock-title { font-size: 26px; font-weight: 800; color: #1C1F25; margin-bottom: 6px; letter-spacing: 0.04em; }
#rni-lockscreen .lock-sub { font-size: 14px; color: #6B7280; margin-bottom: 20px; font-weight: 400; }
#rni-lockscreen .lock-verifying { font-size: 12px; color: #43DBA3; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; margin-bottom: 12px; }
#rni-lockscreen .lock-pulse { width: 48px; height: 2px; background: #43DBA3; margin-bottom: 0; border-radius: 1px; animation: rni-pulse 1.5s ease-in-out infinite; }
#rni-lockscreen .lock-tagline { position: absolute; bottom: 28px; font-size: 12px; color: #9CA3AF; letter-spacing: 0.05em; }
@keyframes rni-pulse { 0%,100% { opacity: 0.3; } 50% { opacity: 1; } }

  /* ── Inline SVG icon system ─────────────────────────── */
  .rni .nav a { color: #9ca3af; }
  .rni .nav a svg { flex-shrink: 0; transition: stroke 0.15s, color 0.15s; }
  .rni .nav a.active svg, .rni .nav a.active { color: var(--emerald); }
  .rni .nav a:hover svg, .rni .nav a:hover { color: #3db88a; }
  .rni .nav a.logout-link:hover svg, .rni .nav a.logout-link:hover { color: #DC2626; }
  .icon-spin { display:inline-block; line-height:0; animation: rni-spin 1s linear infinite; }
  @keyframes rni-spin { to { transform: rotate(360deg); } }
  
/* ── 75% left accent bar — all row types ── */
.rni .perf-stat-row,
.rni .perf-action-row,
.rni .wearable-row,
.rni .group-session-row,
.rni .msg-thread-row,
.rni .announce-row { position: relative; }

.rni .perf-stat-row::before,
.rni .perf-action-row::before,
.rni .wearable-row::before,
.rni .group-session-row::before,
.rni .msg-thread-row::before,
.rni .announce-row::before {
  content: ''; position: absolute; left: 0; top: 12.5%; height: 75%;
  width: 2px; border-radius: 1px; background: var(--border);
}
.rni .perf-stat-row.gold::before   { background: var(--gold); }
.rni .perf-stat-row.charcoal::before { background: var(--charcoal); }
.rni .perf-stat-row.teal::before    { background: #0891B2; }
.rni .perf-stat-row.emerald::before  { background: var(--emerald); }
.rni .perf-action-row.gold::before    { background: var(--gold); }
.rni .perf-action-row.charcoal::before { background: var(--charcoal); }

/* ── rni-row-bar: universal 75% left accent ── */
.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.blue::before     { background: #3B82F6; }
.rni .rni-row-bar.amber::before    { background: #D97706; }
.rni .rni-row-bar.red::before      { background: #DC2626; }

/* ── Main Surface Styles ── */
/* ═══════════════════════════════════════════════════════════════════════════
 : 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 {
  --charcoal: #1A1A2E;
  --ink: #1A1F36;
  --slate: #4F566B;
  --muted: #697386;
  --light: #A3ACB9;
  --border: #E3E8EE;
  --border-light: #F0F3F7;
  --bg: #F6F8FA;
  --white: #FFFFFF;
  /* Green — clinical identity (used sparingly) */
  --emerald: #43DBA3;
  --rni-green: #43DBA3;  /* canonical master */
  --rni-dark:  #0A0F1E;  /* canonical master */
  --emerald-dark: #2EBD8A;
  --emerald-light: rgba(67,219,163,0.06);
  /* Gold — achievement & confidence */
  --gold: #D4AF37;
  --gold-dark: #B8952E;
  --gold-light: rgba(212,175,55,0.08);
  /* Utility */
  --blue: #3B82F6;
  --red: #DC2626;
  --red-light: #FEF2F2;
  --amber: #F59E0B;
  --amber-light: #FFFBEB;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.08);
}

/* ═══ 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: #FFFFFF;
  color: #1C1F25; border-radius: 10px; padding: 20px 24px;
  display: flex; justify-content: space-between; align-items: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.06);
  border-bottom: 3px solid #43DBA3;
}
.rni .h-left h1 { margin: 0; font-size: 20px; font-weight: 500; color: #1C1F25; line-height: 1.2; text-decoration: none; border-bottom: none; }
.rni .h-left .sub { margin-top: 3px; color: #6B7280; 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: #1C1F25; }
.rni .h-right .user-unit { font-size: 12px; color: #6B7280; }
.rni .h-right .notif-btn {
  width: 32px; height: 32px; border-radius: 8px; background: #F3F4F6;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #1C1F25; cursor: pointer;
}
.rni .h-right .notif-btn:hover { background: #E5E7EB; }

/* ═══ 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}
