/* ═══════════════════════════════════════════════════════
   NEXUS OS — SYNMED CARE CLINICAL DASHBOARD
   Complete CSS — Design System + Components
═══════════════════════════════════════════════════════ */

/* ——— Google Font Import (fallback if offline) ——— */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;700&display=swap');

/* ═══════════════════════════ DESIGN TOKENS ═══════════════════════════ */
:root {
  /* Light Mode */
  --bg-base: #F8FAFC;
  --text-base: #0F172A;
  --text-base-rgb: 15, 23, 42;
  --bg-base-rgb: 248, 250, 252;
  --color-brand-900: #E2E8F0;
  --color-brand-800: #FFFFFF;
  --color-brand-700: #F1F5F9;
  --color-accent: #2563EB;
  --glass-bg: rgba(255,255,255,0.95);
  --glass-gradient-1: rgba(255,255,255,1);
  --glass-gradient-2: rgba(248,250,252,0.98);
  --glass-border: rgba(15,23,42,0.06);
  --shadow-inner: inset 0 1px 1px 0 rgba(255,255,255,1), inset 0 0 0 1px rgba(15,23,42,0.04);
  --shadow-luxury: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
  --shadow-hover: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.04);
  --scrollbar-track: rgba(226,232,240,0.4);
  --color-success: #10B981;
  --color-warning: #F59E0B;
  --color-danger: #EF4444;
  --color-blue: #3B82F6;
  --ease-luxury: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-silky: cubic-bezier(0.25, 1, 0.5, 1);
}

.dark {
  --bg-base: #0B1120;
  --text-base: #F8FAFC;
  --text-base-rgb: 248, 250, 252;
  --bg-base-rgb: 11, 17, 32;
  --color-brand-900: #0B1120;
  --color-brand-800: #1E293B;
  --color-brand-700: #334155;
  --color-accent: #3B82F6;
  --glass-bg: rgba(30,41,59,0.85);
  --glass-gradient-1: rgba(30,41,59,0.9);
  --glass-gradient-2: rgba(15,23,42,0.95);
  --glass-border: rgba(255,255,255,0.08);
  --shadow-inner: inset 0 1px 1px 0 rgba(255,255,255,0.1), inset 0 0 0 1px rgba(255,255,255,0.05);
  --shadow-luxury: 0 10px 20px -5px rgba(0,0,0,0.4), 0 4px 6px -2px rgba(0,0,0,0.2);
  --shadow-hover: 0 20px 25px -5px rgba(0,0,0,0.5), 0 10px 10px -5px rgba(59,130,246,0.1);
  --scrollbar-track: rgba(15,23,42,0.5);
}

/* ═══════════════════════════ RESET & BASE ═══════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { height: 100%; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-base);
  color: var(--text-base);
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background 0.3s ease, color 0.3s ease;
  user-select: none;
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, textarea { font-family: inherit; }

/* ═══════════════════════════ SCROLLBAR ═══════════════════════════ */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--scrollbar-track); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(to bottom, rgba(11,188,34,0.1), rgba(11,203,21,0.8), rgba(23,187,11,0.1));
  border-radius: 20px;
}
::-webkit-scrollbar-thumb:hover { background: var(--color-accent); }

/* ═══════════════════════════ GLASS UTILITIES ═══════════════════════════ */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-inner);
}

.glass-card {
  background: linear-gradient(135deg, var(--glass-gradient-1) 0%, var(--glass-gradient-2) 100%);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-inner), 0 10px 30px -10px rgba(0,0,0,0.5);
}

.hover-luxury {
  transition: all 0.6s var(--ease-luxury);
  transform-origin: center;
  will-change: transform, box-shadow, border-color;
}
.hover-luxury:hover {
  transform: translateY(-4px) scale(1.02);
  border-color: rgba(3,209,20,0.747);
  box-shadow: var(--shadow-inner), var(--shadow-hover);
  background: linear-gradient(135deg, var(--glass-gradient-1) 0%, var(--glass-gradient-2) 100%);
  z-index: 10;
}
.hover-luxury:active { transform: translateY(0) scale(0.98); transition: all 0.2s var(--ease-silky); }

/* ═══════════════════════════ SCREEN SYSTEM ═══════════════════════════ */
.screen {
  position: fixed; inset: 0;
  display: none;
  opacity: 0;
  transition: opacity 0.5s ease;
}
.screen.active {
  display: flex;
  opacity: 1;
}
/* App screen uses flex row */
#screen-app { flex-direction: row; }

/* ═══════════════════════════ ACCENT / COLORS ═══════════════════════════ */
.accent { color: var(--color-accent); }
.accent-text { color: var(--color-accent); }
.warning-text { color: var(--color-warning); }

/* ═══════════════════════════ LOGIN SCREEN ═══════════════════════════ */
#screen-login {
  align-items: center;
  justify-content: center;
  background: var(--bg-base);
  overflow: hidden;
}

.login-ambient-orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(100px);
  opacity: 0.08;
}
.orb-1 {
  width: 60vw; height: 60vw;
  background: var(--color-accent);
  top: -20%; left: -20%;
  animation: float1 12s ease-in-out infinite alternate;
}
.orb-2 {
  width: 50vw; height: 50vw;
  background: #10B981;
  bottom: -20%; right: -15%;
  animation: float2 15s ease-in-out infinite alternate;
}
@keyframes float1 { from {transform:translate(0,0)} to {transform:translate(5%,8%)} }
@keyframes float2 { from {transform:translate(0,0)} to {transform:translate(-8%,-5%)} }

.login-container {
  position: relative; z-index: 10;
  display: flex; flex-direction: column; align-items: center; gap: 2.5rem;
  width: 100%; max-width: 440px; padding: 1.5rem;
}

.login-brand { text-align: center; }
.login-logo {
  width: 64px; height: 64px;
  background: linear-gradient(135deg, var(--color-accent), #1d4ed8);
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 1.25rem; color: white;
  margin: 0 auto 1rem;
  box-shadow: 0 10px 30px rgba(37,99,235,0.3);
  animation: pulse-logo 3s ease-in-out infinite;
}
@keyframes pulse-logo {
  0%,100% { box-shadow: 0 10px 30px rgba(37,99,235,0.3); }
  50% { box-shadow: 0 10px 40px rgba(37,99,235,0.5), 0 0 0 8px rgba(37,99,235,0.1); }
}
.login-title { font-size: 2.5rem; font-weight: 300; letter-spacing: -0.05em; }
.login-title .accent { font-weight: 900; }
.login-subtitle { font-size: 0.6rem; font-weight: 700; letter-spacing: 0.25em; text-transform: uppercase; opacity: 0.4; margin-top: 0.5rem; }

.login-card { border-radius: 32px; padding: 2.5rem; width: 100%; }
.login-badge {
  font-size: 0.55rem; font-weight: 900; letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--color-accent); background: rgba(37,99,235,0.08); border: 1px solid rgba(37,99,235,0.15);
  display: inline-block; padding: 0.35rem 0.9rem; border-radius: 50px; margin-bottom: 1.5rem;
}
.login-card-title { font-size: 1.75rem; font-weight: 300; letter-spacing: -0.04em; margin-bottom: 0.5rem; }
.login-card-sub { font-size: 0.8rem; opacity: 0.5; margin-bottom: 2rem; }

.login-form { display: flex; flex-direction: column; gap: 1.25rem; }
.login-error {
  background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.2);
  color: #ef4444; font-size: 0.75rem; font-weight: 600; padding: 0.75rem 1rem; border-radius: 12px;
}
.hidden { display: none !important; }

.login-footer {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.7rem; opacity: 0.4; margin-top: 1.25rem; text-align: center; justify-content: center;
}

/* ═══════════════════════════ FORM ELEMENTS ═══════════════════════════ */
.form-group { display: flex; flex-direction: column; gap: 0.4rem; }
.form-label {
  font-size: 0.6rem; font-weight: 700; letter-spacing: 0.18em;
  text-transform: uppercase; opacity: 0.5; margin-left: 2px;
}
.nexus-input {
  background: rgba(var(--text-base-rgb, 15,23,42), 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 14px; padding: 0.875rem 1.25rem;
  font-size: 0.875rem; color: var(--text-base);
  transition: all 0.3s ease; outline: none; width: 100%;
}
.dark .nexus-input { background: rgba(255,255,255,0.03); }
.nexus-input:focus { border-color: var(--color-accent); box-shadow: 0 0 0 4px rgba(37,99,235,0.08); }
.nexus-input::placeholder { opacity: 0.3; }

.search-input { padding-left: 2.75rem; }

/* ═══════════════════════════ BUTTONS ═══════════════════════════ */
.btn-primary {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: var(--color-accent); color: white;
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.05em;
  text-transform: uppercase; border-radius: 14px; padding: 0.75rem 1.5rem;
  transition: all 0.4s var(--ease-luxury); box-shadow: 0 8px 20px rgba(37,99,235,0.25);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(37,99,235,0.35); }
.btn-primary:active { transform: translateY(0) scale(0.97); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-full { width: 100%; justify-content: center; }
.btn-lg { padding: 1rem 2.5rem; font-size: 0.7rem; letter-spacing: 0.12em; }

.btn-indigo {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: linear-gradient(135deg, #6366f1, #3b82f6); color: white;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; border-radius: 14px; padding: 0.875rem 2rem;
  transition: all 0.4s ease; box-shadow: 0 10px 30px rgba(99,102,241,0.3);
}
.btn-indigo:hover { transform: translateY(-2px); box-shadow: 0 15px 35px rgba(99,102,241,0.4); }

.btn-icon { width: 16px; height: 16px; }
.link-btn { font-size: 0.75rem; color: var(--color-accent); font-weight: 600; }
.link-btn:hover { text-decoration: underline; }

/* ═══════════════════════════ STATUS DOTS ═══════════════════════════ */
.status-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
}
.status-dot.online { background: #10B981; box-shadow: 0 0 8px rgba(16,185,129,0.6); }

.live-dots { display: flex; gap: 4px; align-items: center; }
.dot-pulse {
  width: 6px; height: 6px; border-radius: 50%; background: #10B981;
  animation: pulse-dot 1.2s ease-in-out infinite;
}
@keyframes pulse-dot { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:0.4;transform:scale(0.7)} }

/* ═══════════════════════════ SIDEBAR ═══════════════════════════ */
.sidebar {
  position: relative; width: 104px; height: 100vh;
  display: flex; flex-direction: column; align-items: center;
  background: var(--color-brand-900);
  border-right: 1px solid var(--glass-border);
  padding: 1.5rem 0 1.1rem;
  z-index: 50; flex-shrink: 0;
  transition: background 0.3s ease;
}

.sidebar-brand { margin-bottom: 1.25rem; position: relative; cursor: pointer; flex-shrink: 0; }
.brand-logo {
  width: 56px; height: 56px; border-radius: 18px;
  background: linear-gradient(135deg, var(--color-accent), #1d4ed8);
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 1.1rem; color: white;
  box-shadow: 0 8px 20px rgba(37,99,235,0.2);
  transition: all 0.5s var(--ease-luxury);
}
.sidebar-brand:hover .brand-logo { transform: scale(1.1) rotate(3deg); }

.sidebar-nav {
  flex: 1 1 auto; min-height: 0;            /* allow the nav to shrink + scroll */
  display: flex; flex-direction: column; gap: 0.5rem;
  align-items: center;
  width: 100%;
  overflow-y: auto; overflow-x: hidden;     /* scroll when the icons exceed the height */
  padding: 6px 0;
  /* slim, subtle scrollbar */
  scrollbar-width: thin;
  scrollbar-color: rgba(var(--text-base-rgb), 0.25) transparent;
  overscroll-behavior: contain;
}
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(var(--text-base-rgb), 0.22); border-radius: 4px;
}
.sidebar-nav::-webkit-scrollbar-thumb:hover { background: rgba(var(--text-base-rgb), 0.4); }

.nav-link {
  position: relative; width: 50px; height: 50px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 15px; color: var(--text-base);
  opacity: 0.5; transition: all 0.35s var(--ease-luxury);
  text-decoration: none;
}
.nav-link:hover { opacity: 1; background: rgba(var(--text-base-rgb, 248,250,252), 0.06); }
.nav-link.active {
  background: var(--color-accent);
  opacity: 1; color: white;
  box-shadow: 0 8px 20px rgba(37,99,235,0.28);
}
.nav-link.active .nav-active-bar { opacity: 1; }
.nav-link svg { z-index: 10; transition: transform 0.4s ease; }
.nav-count-badge {
  position: absolute; top: 4px; right: 4px; z-index: 12;
  min-width: 18px; height: 18px; padding: 0 4px; box-sizing: border-box;
  display: flex; align-items: center; justify-content: center;
  background: #ef4444; color: #fff;
  font-size: 10px; font-weight: 800; line-height: 1;
  border-radius: 9px; border: 2px solid var(--color-bg, #0b1220);
  box-shadow: 0 0 0 0 rgba(239,68,68,0.5);
  animation: navBadgePulse 1.8s ease-in-out infinite;
}
.nav-count-badge.hidden { display: none; }
@keyframes navBadgePulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.45); }
  50% { box-shadow: 0 0 0 4px rgba(239,68,68,0); }
}
.nav-link:hover svg { transform: scale(1.1); }
.nav-link:active svg { transform: scale(0.9); }

.nav-active-bar {
  position: absolute; left: -24px; height: 32px; width: 4px;
  border-radius: 0 4px 4px 0; background: var(--color-accent);
  box-shadow: 4px 0 15px var(--color-accent);
  opacity: 0; transition: opacity 0.3s ease;
}

.nav-tooltip {
  position: absolute; left: calc(100% + 20px);
  white-space: nowrap;
  background: var(--glass-bg); backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  padding: 0.5rem 1rem; border-radius: 12px;
  font-size: 0.6rem; font-weight: 800; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--text-base); pointer-events: none; z-index: 100;
  opacity: 0; transform: translateX(-8px) scale(0.95);
  transition: all 0.4s var(--ease-luxury);
}
.nav-tooltip-red { color: #ef4444; border-color: rgba(239,68,68,0.2); }
.nav-link:hover .nav-tooltip,
.sidebar-icon-btn:hover .nav-tooltip,
.user-avatar:hover .nav-tooltip,
.settings-btn:hover .nav-tooltip {
  opacity: 1; transform: translateX(0) scale(1);
}

.sidebar-footer {
  display: flex; flex-direction: column; align-items: center; gap: 0.65rem;
  margin-top: 0.75rem; flex-shrink: 0; width: 100%;
  padding-top: 1.1rem;
  border-top: 1px solid var(--glass-border);   /* divider between nav + footer */
}

.sidebar-icon-btn {
  position: relative; width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 14px; color: var(--text-base); opacity: 0.5;
  transition: all 0.4s ease;
}
.sidebar-icon-btn:hover { opacity: 1; background: rgba(var(--text-base-rgb),0.05); }
.sidebar-icon-btn.logout-btn:hover { background: rgba(239,68,68,0.1); color: #ef4444; opacity: 1; }

.user-avatar {
  position: relative; width: 38px; height: 38px; border-radius: 50%;
  background: rgba(var(--text-base-rgb),0.05);
  border: 1px solid var(--glass-border);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.625rem; font-weight: 900; letter-spacing: -0.05em;
  color: var(--text-base); opacity: 0.7; cursor: default; text-transform: uppercase;
  transition: opacity 0.3s ease;
}
.user-avatar:hover { opacity: 1; }

.settings-btn {
  position: relative; width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 14px; background: rgba(var(--text-base-rgb),0.05);
  border: 1px solid var(--glass-border); color: var(--text-base); opacity: 0.5;
  transition: all 0.5s var(--ease-luxury);
}
.settings-btn:hover { opacity: 1; transform: rotate(90deg) scale(1.1); border-color: rgba(37,99,235,0.4); color: var(--color-accent); }
.settings-btn.active { background: var(--color-accent); border-color: var(--color-accent); color: white; opacity: 1; box-shadow: 0 0 20px rgba(37,99,235,0.4); }

/* ═══════════════════════════ MAIN CONTENT ═══════════════════════════ */
#main-content {
  flex: 1; display: flex; flex-direction: column;
  overflow: hidden; position: relative;
}

.page {
  display: none; flex: 1;
  flex-direction: column; height: 100%;
  overflow-y: auto; overflow-x: hidden;
  opacity: 0; transform: translateY(16px);
  transition: all 0.7s var(--ease-luxury);
}
.page.active {
  display: flex; opacity: 1; transform: translateY(0);
}
.page-body {
  padding: 2.5rem; max-width: 1400px; width: 100%;
  margin: 0 auto; display: flex; flex-direction: column; gap: 2rem;
}

/* ═══════════════════════════ PAGE HEADER ═══════════════════════════ */
.page-header {
  padding: 2rem 2.5rem;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--glass-border);
  flex-shrink: 0;
}
.sticky-header { position: sticky; top: 0; z-index: 30; }
.page-title {
  font-size: 1.5rem; font-weight: 600; letter-spacing: -0.03em;
  color: var(--text-base); transition: color 0.3s;
}
.page-subtitle {
  font-size: 0.8rem; opacity: 0.5; margin-top: 0.25rem;
  display: flex; align-items: center; gap: 0.5rem;
}
.header-date {
  font-size: 0.8rem; font-weight: 500; opacity: 0.5;
  background: var(--color-brand-800); padding: 0.625rem 1.25rem;
  border-radius: 12px; border: 1px solid var(--glass-border);
}

/* ═══════════════════════════ OVERVIEW — METRICS ═══════════════════════════ */
.metrics-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem;
}
@media (max-width: 1100px) { .metrics-grid { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 600px) { .metrics-grid { grid-template-columns: 1fr; } }

.metric-card {
  border-radius: 22px; padding: 1.5rem;
  display: flex; flex-direction: column; justify-content: space-between;
  min-height: 160px;
}
.metric-card.metric-secure { border-color: rgba(16,185,129,0.2); background: rgba(16,185,129,0.04); }
.metric-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1rem; }
.metric-icon {
  padding: 0.75rem; background: rgba(37,99,235,0.08);
  border-radius: 12px; color: var(--color-accent);
  display: flex; align-items: center; justify-content: center;
}
.metric-icon-green { background: rgba(16,185,129,0.1) !important; color: #10B981 !important; }
.metric-trend {
  font-size: 0.7rem; font-weight: 700; padding: 0.25rem 0.625rem;
  background: rgba(16,185,129,0.1); color: #10B981; border-radius: 50px;
  display: flex; flex-direction: column; align-items: flex-end; gap: 2px;
}
.trend-sub { font-size: 0.55rem; opacity: 0.5; font-weight: 500; }
.metric-label { font-size: 0.75rem; opacity: 0.55; font-weight: 500; margin-bottom: 0.25rem; }
.metric-value { font-size: 2rem; font-weight: 700; letter-spacing: -0.04em; }
.metric-value-green { color: #10B981; font-size: 1.5rem; }

/* ═══════════════════════════ OVERVIEW — TWO COL ═══════════════════════════ */
.two-col-grid {
  display: grid; grid-template-columns: 2fr 1fr; gap: 2rem;
}
@media (max-width:900px) { .two-col-grid { grid-template-columns: 1fr; } }

.panel { border-radius: 28px; padding: 2rem; }
.panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; border-bottom: 1px solid var(--glass-border); padding-bottom: 1rem; }
.panel-title { font-size: 1.05rem; font-weight: 600; }

.activity-list { display: flex; flex-direction: column; gap: 1rem; }
.activity-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem; border-radius: 18px;
  background: rgba(var(--text-base-rgb),0.02);
  border: 1px solid var(--glass-border);
  transition: background 0.3s ease;
}
.activity-item:hover { background: rgba(var(--text-base-rgb),0.04); }
.activity-item-left { display: flex; align-items: center; gap: 1.25rem; }
.activity-icon {
  padding: 0.75rem; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
}
.activity-icon.chat { background: rgba(59,130,246,0.1); color: #3b82f6; }
.activity-icon.lab { background: rgba(139,92,246,0.1); color: #8b5cf6; }
.activity-title { font-size: 0.8rem; font-weight: 600; margin-bottom: 2px; }
.activity-desc { font-size: 0.75rem; opacity: 0.55; }
.activity-item-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.activity-time { font-size: 0.65rem; opacity: 0.4; font-weight: 500; }
.activity-badge {
  font-size: 0.55rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em;
  padding: 2px 8px; border-radius: 6px;
}
.badge-new { background: rgba(59,130,246,0.1); color: #3b82f6; }
.badge-scheduled { background: rgba(139,92,246,0.1); color: #8b5cf6; }
.badge-inprogress { background: rgba(245,158,11,0.1); color: var(--color-warning); }
.badge-paid { background: rgba(16,185,129,0.1); color: var(--color-success); border: 1px solid rgba(16,185,129,0.2); box-shadow: 0 0 15px rgba(16,185,129,0.1); }
.badge-pending { background: rgba(245,158,11,0.1); color: var(--color-warning); border: 1px solid rgba(245,158,11,0.2); box-shadow: 0 0 15px rgba(245,158,11,0.1); }
.badge-green { background: rgba(16,185,129,0.1); color: var(--color-success); padding: 4px 12px; border-radius: 50px; font-size: 0.65rem; font-weight: 700; border: 1px solid rgba(16,185,129,0.2); }
.badge-yellow { background: rgba(245,158,11,0.1); color: var(--color-warning); padding: 4px 12px; border-radius: 50px; font-size: 0.65rem; font-weight: 700; border: 1px solid rgba(245,158,11,0.2); }

.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 3rem; opacity: 0.3; gap: 0.75rem; font-size: 0.875rem;
}

/* Quick Actions */
.quick-actions { display: flex; flex-direction: column; gap: 1rem; }
.quick-action-primary {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem 1.5rem; background: var(--color-accent); color: white;
  border-radius: 18px; box-shadow: 0 8px 20px rgba(37,99,235,0.25);
  transition: all 0.4s var(--ease-luxury); font-weight: 600; font-size: 0.875rem;
}
.quick-action-primary:hover { transform: translateY(-3px); box-shadow: 0 15px 30px rgba(37,99,235,0.4); }
.quick-action-secondary {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem 1.5rem; background: var(--bg-base);
  border: 1px solid rgba(var(--text-base-rgb), 0.1);
  border-radius: 18px; font-weight: 500; font-size: 0.875rem;
  color: var(--text-base); transition: all 0.4s ease;
}
.quick-action-secondary:hover { border-color: rgba(37,99,235,0.4); }
.qa-left { display: flex; align-items: center; gap: 1rem; }
.qa-left svg { opacity: 0.5; transition: all 0.3s; }
.quick-action-secondary:hover .qa-left svg { opacity: 1; color: var(--color-accent); }

.hipaa-notice {
  margin-top: auto; margin-top: 1.5rem; padding: 1rem 1.25rem;
  background: rgba(245,158,11,0.08); border: 1px solid rgba(245,158,11,0.2);
  border-radius: 16px; display: flex; gap: 0.75rem; align-items: flex-start;
  color: #92400e;
}
.dark .hipaa-notice { color: #fbbf24; }
.hipaa-title { font-size: 0.75rem; font-weight: 700; margin-bottom: 0.375rem; }
.hipaa-text { font-size: 0.7rem; line-height: 1.6; opacity: 0.8; }

/* ═══════════════════════════ INBOX ═══════════════════════════ */
.inbox-layout {
  flex-direction: row !important;
  overflow: hidden !important;
}

.inbox-queue {
  width: 380px; flex-shrink: 0; display: flex; flex-direction: column;
  border-right: 1px solid var(--glass-border); background: rgba(var(--glass-gradient-1),0.3);
  position: relative; z-index: 10; overflow: hidden;
}

.inbox-queue-header { padding: 2rem; border-bottom: 1px solid var(--glass-border); }
.inbox-queue-title-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.inbox-title { font-size: 1.5rem; font-weight: 300; letter-spacing: -0.04em; }

.inbox-list { flex: 1; overflow-y: auto; padding: 1rem 1.5rem; display: flex; flex-direction: column; gap: 0.75rem; }

.inbox-item {
  cursor: pointer; border-radius: 18px; padding: 1.25rem;
  border: 1px solid var(--glass-border);
  background: rgba(var(--text-base-rgb),0.02);
  transition: all 0.4s var(--ease-luxury);
}
.inbox-item:hover { border-color: rgba(var(--text-base-rgb),0.15); }
.inbox-item.selected { background: rgba(37,99,235,0.08); border-color: rgba(37,99,235,0.25); transform: scale(1.01); }
.inbox-item-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.inbox-tag {
  font-size: 0.5rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.15em;
  padding: 2px 8px; border-radius: 6px;
  background: rgba(16,185,129,0.08); color: var(--color-accent); border: 1px solid rgba(16,185,129,0.2);
}
.inbox-tag.dead { background: rgba(var(--text-base-rgb),0.08); color: rgba(var(--text-base-rgb),0.4); border-color: var(--glass-border); }
.inbox-tag.urgent { background: rgba(239,68,68,0.08); color: #ef4444; border-color: rgba(239,68,68,0.2); }
.inbox-tag.booked { background: rgba(16,185,129,0.14); color: #10B981; border-color: rgba(16,185,129,0.32); }
.inbox-tag.lead { background: rgba(59,130,246,0.12); color: #3b82f6; border-color: rgba(59,130,246,0.28); }
.inbox-tag.escalation { background: rgba(239,68,68,0.14); color: #ef4444; border-color: rgba(239,68,68,0.34); animation: nexusPulse 1.6s ease-in-out infinite; }
@keyframes nexusPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); } 50% { box-shadow: 0 0 0 3px rgba(239,68,68,0.18); } }

/* Inbox: human-takeover / escalation banner + AI service-card chips */
.inbox-handoff {
  margin: 0 0 1rem; padding: 0.75rem 1rem; border-radius: 12px;
  font-size: 0.78rem; font-weight: 600; line-height: 1.4;
}
.inbox-handoff.human { background: rgba(59,130,246,0.1); color: #3b82f6; border: 1px solid rgba(59,130,246,0.25); }
.inbox-handoff.escalate { background: rgba(239,68,68,0.1); color: #ef4444; border: 1px solid rgba(239,68,68,0.28); }
.msg-cards { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.msg-card-chip {
  font-size: 0.65rem; font-weight: 700; padding: 4px 10px; border-radius: 8px;
  background: rgba(16,185,129,0.1); color: #10B981; border: 1px solid rgba(16,185,129,0.25);
}

/* Admin management inputs */
.admin-input {
  width: 100%; box-sizing: border-box;
  padding: 0.75rem 0.9rem; border-radius: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--text-base, #e5e7eb); font-size: 0.85rem; outline: none;
  transition: border-color 0.2s;
}
.admin-input:focus { border-color: #6366f1; }

/* Realtime notification toasts */
.toast-host {
  position: fixed; top: 22px; right: 22px; z-index: 99999;
  display: flex; flex-direction: column; gap: 10px; pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 12px;
  min-width: 230px; max-width: 340px; padding: 13px 16px;
  border-radius: 14px;
  background: var(--glass-bg, rgba(17,21,34,0.92));
  border: 1px solid var(--glass-border, rgba(255,255,255,0.1));
  box-shadow: 0 14px 34px rgba(0,0,0,0.38);
  backdrop-filter: blur(14px);
  color: var(--text-base, #e5e7eb);
  transform: translateX(120%); opacity: 0;
  transition: transform .35s cubic-bezier(.4,0,.2,1), opacity .35s ease;
  pointer-events: auto;
}
.toast.show { transform: translateX(0); opacity: 1; }
.toast-new { border-left: 4px solid #10B981; }
.toast-update { border-left: 4px solid #3b82f6; }
.toast-icon { font-size: 1.2rem; line-height: 1; }
.toast-title { font-size: 0.8rem; font-weight: 700; text-transform: capitalize; margin: 0; }
.inbox-id { font-family: 'JetBrains Mono', monospace; font-size: 0.6rem; opacity: 0.3; }
.inbox-time { font-size: 0.65rem; opacity: 0.4; }
.inbox-name { font-size: 0.9rem; font-weight: 700; margin-bottom: 4px; }
.inbox-preview { font-size: 0.75rem; opacity: 0.5; font-style: italic; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Theater */
.inbox-theater { flex: 1; position: relative; display: flex; flex-direction: column; overflow: hidden; background: radial-gradient(circle at top, var(--color-brand-800,rgba(30,41,59,0.5)), transparent); }
.inbox-theater::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(var(--color-accent) 1px, transparent 1px);
  background-size: 40px 40px; opacity: 0.03; z-index: 0;
}
.inbox-empty-state {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; opacity: 0.35; z-index: 10;
}
.empty-ping-ring { position: relative; width: 140px; height: 140px; display: flex; align-items: center; justify-content: center; margin-bottom: 2rem; }
.empty-ping-ring::before {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  background: rgba(37,99,235,0.08); animation: ping-ring 2s ease-out infinite;
}
@keyframes ping-ring { 0%{transform:scale(0.8);opacity:1} 100%{transform:scale(1.3);opacity:0} }
.empty-title { font-size: 2rem; font-weight: 300; letter-spacing: -0.04em; }
.empty-sub { font-size: 0.6rem; font-weight: 900; letter-spacing: 0.3em; text-transform: uppercase; margin-top: 1rem; opacity: 0.6; }

.inbox-chat-panel { display: flex; flex-direction: column; flex: 1; height: 100%; z-index: 10; position: relative; }
.inbox-chat-header {
  padding: 0 2.5rem; height: 100px; display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0; border-bottom: 1px solid var(--glass-border);
}
.chat-avatar {
  width: 56px; height: 56px; border-radius: 18px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--color-accent), #0891b2);
  padding: 2px; box-shadow: 0 8px 20px rgba(37,99,235,0.2);
}
.chat-avatar-inner {
  width: 100%; height: 100%; border-radius: 16px; background: var(--bg-base);
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 1.1rem; color: var(--color-accent); letter-spacing: -0.05em;
}
.chat-header-info { display: flex; align-items: center; gap: 1.25rem; }
.chat-name { font-size: 1.5rem; font-weight: 300; letter-spacing: -0.04em; margin-bottom: 4px; }
.chat-status-row { display: flex; align-items: center; gap: 0.5rem; }
.online-dot { width: 8px; height: 8px; border-radius: 50%; background: #10B981; }
.chat-status-text { font-size: 0.6rem; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; font-family: 'JetBrains Mono', monospace; opacity: 0.5; }
.chat-header-actions { display: flex; gap: 0.75rem; }
.btn-ghost {
  padding: 0.625rem 1.5rem; border-radius: 12px;
  border: 1px solid var(--glass-border); background: rgba(var(--text-base-rgb),0.02);
  font-size: 0.6rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.15em;
  color: var(--text-base); transition: all 0.3s ease;
}
.btn-ghost:hover { background: rgba(var(--text-base-rgb),0.05); }
.btn-danger-ghost {
  padding: 0.625rem 1.5rem; border-radius: 12px;
  border: 1px solid rgba(239,68,68,0.25); background: rgba(239,68,68,0.08);
  font-size: 0.6rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.15em;
  color: #ef4444; transition: all 0.3s ease;
}
.btn-danger-ghost:hover { background: rgba(239,68,68,0.15); }
.btn-success-ghost {
  padding: 0.625rem 1.5rem; border-radius: 12px;
  border: 1px solid rgba(16,185,129,0.25); background: rgba(16,185,129,0.08);
  font-size: 0.6rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.15em;
  color: #10B981; transition: all 0.3s ease;
}

.inbox-messages {
  flex: 1; overflow-y: auto; padding: 3rem; display: flex; flex-direction: column; gap: 2rem;
}
.msg-bubble-wrap {
  display: flex; flex-direction: column; gap: 0.5rem; max-width: 75%;
  animation: slideInMsg 0.4s var(--ease-luxury);
}
@keyframes slideInMsg { from{opacity:0;transform:translateY(10px)} to{opacity:1;transform:translateY(0)} }
.msg-bubble-wrap.admin { margin-left: auto; align-items: flex-end; }
.msg-bubble-wrap.patient { align-items: flex-start; }
.msg-bubble {
  padding: 1.25rem 1.5rem; font-size: 0.875rem; font-weight: 500;
  line-height: 1.6; border-radius: 24px;
}
.msg-bubble.admin { border-top-right-radius: 6px; background: linear-gradient(135deg, var(--color-accent), #0891b2); color: white; box-shadow: 0 8px 24px rgba(37,99,235,0.25); }
.msg-bubble.patient { border-top-left-radius: 6px; background: rgba(var(--text-base-rgb),0.04); border: 1px solid var(--glass-border); color: var(--text-base); }
.msg-time { font-size: 0.55rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.2em; opacity: 0.35; }
.msg-time-row { display: flex; align-items: center; gap: 0.5rem; }
.msg-delivered-dot { width: 4px; height: 4px; border-radius: 50%; background: #0891b2; }

.triage-card {
  background: rgba(var(--text-base-rgb),0.02); border: 1px solid var(--glass-border);
  border-radius: 24px; padding: 2rem; position: relative; overflow: hidden;
  max-width: 85%; margin-bottom: 1rem; box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
.triage-bar { position: absolute; left: 0; top: 0; width: 4px; height: 100%; background: #6366f1; }
.triage-badge { font-size: 0.55rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.3em; color: #6366f1; margin-bottom: 1rem; }
.triage-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin-bottom: 1rem; border-bottom: 1px solid var(--glass-border); padding-bottom: 1rem; }
.triage-field-label { font-size: 0.55rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.2em; opacity: 0.4; margin-bottom: 4px; }
.triage-field-val { font-weight: 700; font-size: 0.9rem; }
.triage-note-label { font-size: 0.55rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.2em; opacity: 0.4; margin-bottom: 8px; }
.triage-note-text { font-size: 0.8rem; font-style: italic; opacity: 0.8; border-left: 2px solid rgba(99,102,241,0.2); padding-left: 1rem; line-height: 1.6; }

/* Reply Area */
.inbox-reply-area { padding: 0 2.5rem 2.5rem; flex-shrink: 0; }
.reply-method-btns { display: flex; gap: 0.75rem; margin-bottom: 1rem; }
.reply-method-btn {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 1.25rem; border-radius: 50px;
  font-size: 0.6rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.1em;
  color: rgba(var(--text-base-rgb),0.4); background: rgba(var(--text-base-rgb),0.03);
  transition: all 0.4s ease;
}
.reply-method-btn.active-chat { background: var(--color-accent); color: white; box-shadow: 0 6px 20px rgba(37,99,235,0.25); }
.reply-method-btn.active-email { background: #3b82f6; color: white; box-shadow: 0 6px 20px rgba(59,130,246,0.25); }

.reply-form {
  display: flex; align-items: center; border-radius: 24px; padding: 0.75rem;
  border: 1px solid var(--glass-border); background: linear-gradient(135deg, var(--glass-gradient-1) 0%, var(--glass-gradient-2) 100%);
  box-shadow: 0 10px 40px rgba(0,0,0,0.2); transition: box-shadow 0.4s ease;
}
.reply-form:focus-within { box-shadow: 0 20px 50px rgba(0,0,0,0.3); border-color: rgba(37,99,235,0.4); }
.reply-textarea {
  flex: 1; background: transparent; border: none; resize: none;
  height: 64px; padding: 1rem 1.5rem; font-size: 0.875rem; color: var(--text-base);
  font-weight: 500; outline: none; font-family: inherit;
}
.reply-textarea::placeholder { opacity: 0.3; }
.reply-send-btn {
  width: 64px; height: 64px; border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  background: var(--color-accent); color: white;
  transition: all 0.3s ease; flex-shrink: 0;
}
.reply-send-btn:hover { transform: scale(1.05); }
.reply-send-btn:active { transform: scale(0.95); }
.reply-send-btn:disabled { opacity: 0.2; cursor: not-allowed; }

/* ═══════════════════════════ TABLE ═══════════════════════════ */
.table-card { border-radius: 28px; overflow: hidden; }
.table-header-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 2rem; border-bottom: 1px solid var(--glass-border);
  background: rgba(var(--text-base-rgb),0.01);
}
.table-title { font-size: 1.25rem; font-weight: 300; letter-spacing: -0.03em; }

.nexus-table { width: 100%; border-collapse: collapse; }
.nexus-table thead tr {
  font-size: 0.55rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.2em;
  color: rgba(var(--text-base-rgb),0.4); border-bottom: 1px solid var(--glass-border);
  background: rgba(var(--text-base-rgb),0.02);
}
.nexus-table th { padding: 1.5rem 2rem; text-align: left; }
.nexus-table tbody tr {
  border-bottom: 1px solid var(--glass-border);
  transition: background 0.2s ease;
  animation: fadeInRow 0.4s var(--ease-luxury) both;
}
@keyframes fadeInRow { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:none} }
.nexus-table tbody tr:hover { background: rgba(var(--text-base-rgb),0.02); }
.nexus-table td { padding: 1.5rem 2rem; font-size: 0.875rem; }
.nexus-table .empty-row td { padding: 4rem; text-align: center; font-size: 0.65rem; font-weight: 900; letter-spacing: 0.2em; text-transform: uppercase; opacity: 0.3; font-style: italic; }

.mono { font-family: 'JetBrains Mono', monospace; font-size: 0.65rem; opacity: 0.5; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; }
.identity-cell { display: flex; align-items: center; gap: 1rem; }
.id-avatar {
  width: 44px; height: 44px; border-radius: 14px;
  background: var(--bg-base); border: 1px solid var(--glass-border);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 900; color: var(--color-accent);
  flex-shrink: 0; transition: transform 0.4s ease;
}
.nexus-table tr:hover .id-avatar { transform: scale(1.1) rotate(4deg); }
.id-name { font-weight: 700; font-size: 0.9rem; margin-bottom: 2px; }
.id-sub { font-size: 0.6rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.4; }

/* ═══════════════════════════ BILLING ═══════════════════════════ */
.billing-metrics-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 1.5rem; }
@media (max-width:900px) { .billing-metrics-grid { grid-template-columns: 1fr; } }

.spotlight-card { border-radius: 24px; padding: 1.75rem; position: relative; overflow: hidden; }
.spotlight-label { font-size: 0.6rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.2em; opacity: 0.5; }
.spotlight-value { font-size: 2.5rem; font-weight: 300; letter-spacing: -0.05em; margin: 1rem 0; }
.spotlight-sub { font-size: 0.6rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.2em; }
.spotlight-blue { border-color: rgba(59,130,246,0.15) !important; background: rgba(59,130,246,0.04) !important; }
.spotlight-blue::after {
  content: ''; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px;
  background: rgba(59,130,246,0.08); border-radius: 50%; filter: blur(50px); pointer-events: none;
  transition: transform 1s ease;
}
.spotlight-blue:hover::after { transform: scale(1.5); }

.ping-dot { position: relative; display: inline-flex; }
.ping-anim { position: absolute; inset: -3px; border-radius: 50%; animation: ping-outer 1.2s ease-out infinite; }
@keyframes ping-outer { 0%{transform:scale(1);opacity:0.75} 100%{transform:scale(2);opacity:0} }
.ping-core { position: relative; display: inline-flex; width: 10px; height: 10px; border-radius: 50%; }

.billing-two-col { display: grid; grid-template-columns: 2fr 1fr; gap: 2rem; }
@media (max-width:1100px) { .billing-two-col { grid-template-columns: 1fr; } }

.billing-form-card { border-radius: 28px; padding: 2rem; }
.billing-sidebar { border-radius: 28px; padding: 2rem; height: fit-content; }

.section-header-label {
  font-size: 0.6rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.2em;
  opacity: 0.4; margin-bottom: 2rem; display: flex; align-items: center; gap: 0.5rem;
  border-bottom: 1px solid var(--glass-border); padding-bottom: 1.25rem;
}

.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin-bottom: 1.5rem; }
@media (max-width:700px) { .form-row-2 { grid-template-columns: 1fr; } }

.line-items-container {
  background: rgba(var(--text-base-rgb),0.02); border: 1px solid var(--glass-border);
  border-radius: 24px; padding: 2rem; position: relative; overflow: hidden;
}
.line-item-row { display: flex; gap: 1.25rem; align-items: center; margin-bottom: 1.25rem; animation: fadeInRow 0.3s both; }
.line-item-desc { flex: 1; }
.line-item-amount { position: relative; width: 160px; }
.line-item-amount .currency { position: absolute; left: 1.25rem; top: 50%; transform: translateY(-50%); opacity: 0.4; font-weight: 700; }
.line-item-amount .nexus-input { padding-left: 2rem; text-align: right; font-weight: 700; }
.remove-item-btn {
  width: 48px; height: 48px; border-radius: 14px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.2);
  color: #ef4444; transition: all 0.3s ease;
}
.remove-item-btn:hover { background: rgba(239,68,68,0.16); }
.remove-item-btn:disabled { opacity: 0.2; cursor: not-allowed; background: transparent; border-color: transparent; }

.line-items-footer {
  display: flex; justify-content: space-between; align-items: center;
  border-top: 1px solid var(--glass-border); margin-top: 1.5rem; padding-top: 2rem;
}
.add-item-btn {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.6rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.2em;
  color: var(--color-accent); background: rgba(37,99,235,0.08);
  border: 1px solid rgba(37,99,235,0.2); border-radius: 12px; padding: 0.75rem 1.25rem;
  transition: all 0.3s ease;
}
.add-item-btn:hover { background: rgba(37,99,235,0.16); }
.aggregate-total { display: flex; align-items: center; gap: 1.5rem; background: var(--bg-base); padding: 1rem 2rem; border-radius: 18px; border: 1px solid var(--glass-border); }
.agg-label { font-size: 0.6rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.2em; opacity: 0.4; }
.agg-value { font-size: 2rem; font-weight: 300; letter-spacing: -0.04em; }

/* Toggle */
.toggle { position: relative; width: 44px; height: 24px; border-radius: 50px; background: rgba(var(--text-base-rgb),0.2); transition: all 0.4s ease; }
.toggle.active { background: var(--color-accent); }
.toggle-knob { position: absolute; right: 4px; top: 4px; width: 16px; height: 16px; border-radius: 50%; background: white; box-shadow: 0 2px 4px rgba(0,0,0,0.2); }
.toggle-row { display: flex; justify-content: space-between; align-items: center; padding: 0.625rem 0; }
.toggle-label { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.15em; opacity: 0.6; }

/* Switch */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; inset: 0; background: rgba(var(--text-base-rgb),0.15); border-radius: 50px; transition: 0.4s; }
.slider:before { content: ''; position: absolute; height: 18px; width: 18px; left: 3px; bottom: 3px; background: white; border-radius: 50%; transition: 0.4s; box-shadow: 0 2px 4px rgba(0,0,0,0.2); }
input:checked + .slider { background: var(--color-success); }
input:checked + .slider.indigo { background: #6366f1; }
input:checked + .slider.red { background: #ef4444; }
input:checked + .slider:before { transform: translateX(20px); }
.info-block {
  padding: 1rem 1.25rem; border-radius: 14px;
  background: rgba(var(--text-base-rgb),0.03); border: 1px solid var(--glass-border);
  font-size: 0.6rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  opacity: 0.5; line-height: 1.7;
}

/* Ledger ops */
.ledger-ops { display: flex; justify-content: flex-end; align-items: center; gap: 1.5rem; }
.op-link {
  font-size: 0.6rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.15em;
  display: flex; align-items: center; gap: 0.4rem; transition: all 0.3s ease;
}
.op-link.blue { color: #3b82f6; }
.op-link.green { color: #10B981; }
.op-link.red { color: #ef4444; }
.op-link:hover { opacity: 0.6; }

/* ═══════════════════════════ AI BRAIN ═══════════════════════════ */
.section-label { font-size: 0.6rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.2em; opacity: 0.4; margin-bottom: 1.5rem; }
.persona-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 1.5rem; }
@media (max-width:900px) { .persona-grid { grid-template-columns: 1fr; } }

.persona-card { border-radius: 28px; padding: 1.75rem; cursor: pointer; transition: all 0.5s var(--ease-luxury); }
.persona-card.active-concierge { background: rgba(99,102,241,0.08) !important; border-color: rgba(99,102,241,0.35) !important; box-shadow: 0 20px 40px rgba(99,102,241,0.15) !important; }
.persona-card.active-closer { background: rgba(16,185,129,0.08) !important; border-color: rgba(16,185,129,0.35) !important; box-shadow: 0 20px 40px rgba(16,185,129,0.15) !important; }
.persona-card.active-executive { background: rgba(59,130,246,0.08) !important; border-color: rgba(59,130,246,0.35) !important; box-shadow: 0 20px 40px rgba(59,130,246,0.15) !important; }
.persona-card.inactive { opacity: 0.55; }
.persona-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1.5rem; }
.persona-icon {
  width: 48px; height: 48px; border-radius: 14px; display: flex; align-items: center; justify-content: center;
  background: rgba(var(--text-base-rgb),0.05); border: 1px solid var(--glass-border);
  color: rgba(var(--text-base-rgb),0.4); transition: all 0.5s ease;
}
.persona-icon.indigo { background: rgba(99,102,241,0.15); border-color: rgba(99,102,241,0.3); color: #6366f1; transform: scale(1.1) rotate(3deg); }
.persona-icon.green { background: rgba(16,185,129,0.15); border-color: rgba(16,185,129,0.3); color: #10B981; transform: scale(1.1) rotate(3deg); }
.persona-icon.blue { background: rgba(59,130,246,0.15); border-color: rgba(59,130,246,0.3); color: #3b82f6; transform: scale(1.1) rotate(3deg); }
.persona-active-dot { position: relative; display: flex; width: 12px; height: 12px; }
.persona-active-dot::before { content:''; position:absolute;inset:0;border-radius:50%;opacity:0.75;animation:ping-outer 1.2s ease-out infinite; }
.persona-name { font-size: 1.25rem; font-weight: 700; margin-bottom: 0.5rem; letter-spacing: -0.02em; }
.persona-desc { font-size: 0.75rem; opacity: 0.55; line-height: 1.7; font-weight: 500; }
.persona-active-dot[data-color="indigo"] { background: #6366f1; }
.persona-active-dot[data-color="indigo"]::before { background: rgba(99,102,241,0.5); }
.persona-active-dot[data-color="green"] { background: #10B981; }
.persona-active-dot[data-color="green"]::before { background: rgba(16,185,129,0.5); }
.persona-active-dot[data-color="blue"] { background: #3b82f6; }
.persona-active-dot[data-color="blue"]::before { background: rgba(59,130,246,0.5); }

.ai-two-col { display: grid; grid-template-columns: 2fr 1fr; gap: 2rem; margin-top: 2rem; }
@media (max-width:1000px) { .ai-two-col { grid-template-columns: 1fr; } }
.ai-col-2 { grid-column: span 1; }
.ai-knowledge-card { border-radius: 28px; padding: 2rem; display: flex; flex-direction: column; gap: 1.25rem; }
.faq-entry {
  background: rgba(var(--text-base-rgb),0.03); border: 1px solid var(--glass-border);
  border-radius: 20px; padding: 1.5rem; position: relative;
  transition: all 0.4s ease; animation: fadeInRow 0.3s both;
}
.faq-entry:hover { background: rgba(var(--text-base-rgb),0.06); border-color: rgba(var(--text-base-rgb),0.1); }
.faq-remove-btn {
  position: absolute; right: 1rem; top: 1rem; width: 30px; height: 30px;
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
  color: rgba(var(--text-base-rgb),0.3); opacity: 0; transition: all 0.3s ease;
}
.faq-entry:hover .faq-remove-btn { opacity: 1; }
.faq-remove-btn:hover { color: #ef4444; background: rgba(239,68,68,0.08); }
.faq-input-row { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; }
.faq-role-label { font-size: 0.6rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.15em; width: 40px; flex-shrink: 0; }
.faq-role-label.input { color: #6366f1; }
.faq-role-label.logic { color: #10B981; }
.faq-text-input {
  flex: 1; background: transparent; border: none; border-bottom: 1px solid var(--glass-border);
  padding: 0.25rem 0; font-size: 0.875rem; color: var(--text-base); font-weight: 700;
  outline: none; font-family: inherit; transition: border-color 0.3s;
}
.faq-text-input:focus { border-bottom-color: #6366f1; }
.faq-text-input::placeholder { opacity: 0.3; }
.faq-textarea {
  flex: 1; background: transparent; border: none; resize: none; min-height: 56px;
  padding: 0.25rem 0; font-size: 0.8rem; color: var(--text-base); opacity: 0.7;
  font-weight: 500; outline: none; font-family: inherit;
}
.add-node-btn {
  width: 100%; padding: 1.25rem; border-radius: 18px;
  border: 2px dashed rgba(var(--text-base-rgb),0.1); background: rgba(var(--text-base-rgb),0.01);
  font-size: 0.6rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.3em;
  color: rgba(var(--text-base-rgb),0.4); transition: all 0.4s ease;
}
.add-node-btn:hover { border-color: rgba(99,102,241,0.3); color: #6366f1; background: rgba(99,102,241,0.03); }

.guardrails-card { border-radius: 28px; padding: 2rem; display: flex; flex-direction: column; gap: 2rem; }
.guardrail-row { display: flex; justify-content: space-between; align-items: center; }
.guardrail-name { font-size: 0.875rem; font-weight: 700; letter-spacing: -0.01em; }
.guardrail-sub { font-size: 0.6rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.15em; opacity: 0.4; margin-top: 4px; }

/* ═══════════════════════════ CAMPAIGNS ═══════════════════════════ */
.campaigns-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 1.5rem; }
@media (max-width:900px) { .campaigns-grid { grid-template-columns: 1fr; } }

.campaign-card { border-radius: 24px; padding: 1.75rem; cursor: pointer; }
.campaign-card-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1.5rem; }
.campaign-icon { padding: 0.875rem; border-radius: 14px; display: flex; align-items: center; justify-content: center; }
.campaign-status { font-size: 0.55rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.15em; padding: 4px 12px; border-radius: 50px; }
.camp-active { background: rgba(16,185,129,0.1); color: #10B981; border: 1px solid rgba(16,185,129,0.2); }
.camp-draft { background: rgba(var(--text-base-rgb),0.08); color: rgba(var(--text-base-rgb),0.5); border: 1px solid var(--glass-border); }
.camp-paused { background: rgba(245,158,11,0.1); color: var(--color-warning); border: 1px solid rgba(245,158,11,0.2); }
.campaign-name { font-size: 1rem; font-weight: 700; margin-bottom: 0.375rem; }
.campaign-desc { font-size: 0.75rem; opacity: 0.5; line-height: 1.5; margin-bottom: 1.25rem; }
.campaign-meta { display: flex; gap: 1.5rem; border-top: 1px solid var(--glass-border); padding-top: 1.25rem; }
.campaign-stat { display: flex; flex-direction: column; gap: 2px; }
.campaign-stat-val { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.03em; }
.campaign-stat-label { font-size: 0.55rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.15em; opacity: 0.4; }

/* ═══════════════════════════ DOCUMENTS ═══════════════════════════ */
.docs-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 1.25rem; }
@media (max-width:1100px) { .docs-grid { grid-template-columns: repeat(2,1fr); } }

.doc-card { border-radius: 22px; padding: 1.5rem; cursor: pointer; display: flex; flex-direction: column; gap: 1rem; }
.doc-icon-wrap { width: 52px; height: 52px; border-radius: 14px; display: flex; align-items: center; justify-content: center; }
.doc-name { font-weight: 700; font-size: 0.875rem; margin-bottom: 2px; }
.doc-meta { font-size: 0.65rem; opacity: 0.4; }
.doc-badge { font-size: 0.55rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.1em; padding: 3px 10px; border-radius: 50px; align-self: flex-start; }
.doc-pdf { background: rgba(239,68,68,0.1); color: #ef4444; }
.doc-docx { background: rgba(59,130,246,0.1); color: #3b82f6; }
.doc-xlsx { background: rgba(16,185,129,0.1); color: #10B981; }
.doc-other { background: rgba(var(--text-base-rgb),0.08); color: rgba(var(--text-base-rgb),0.5); }

/* ═══════════════════════════ FORMS PAGE ═══════════════════════════ */
.forms-stats-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 1.25rem; }
@media (max-width:900px) { .forms-stats-grid { grid-template-columns: repeat(2,1fr); } }
.stat-mini { border-radius: 20px; padding: 1.5rem; }
.stat-mini-label { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.15em; opacity: 0.4; margin-bottom: 0.75rem; }
.stat-mini-value { font-size: 2.5rem; font-weight: 300; letter-spacing: -0.05em; }

/* ═══════════════════════════ VIDEO CALLS ═══════════════════════════ */
.video-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 1.5rem; }
@media (max-width:900px) { .video-grid { grid-template-columns: 1fr; } }
.video-card { border-radius: 24px; padding: 1.75rem; cursor: pointer; }
.video-thumb { width: 100%; aspect-ratio: 16/9; border-radius: 16px; background: linear-gradient(135deg, var(--color-brand-700), var(--color-brand-800)); display: flex; align-items: center; justify-content: center; margin-bottom: 1rem; position: relative; overflow: hidden; }
.video-thumb svg { opacity: 0.3; }
.video-live-badge { position: absolute; top: 0.75rem; left: 0.75rem; background: #ef4444; color: white; font-size: 0.5rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.15em; padding: 3px 10px; border-radius: 50px; display: flex; align-items: center; gap: 4px; }
.video-live-dot { width: 5px; height: 5px; border-radius: 50%; background: white; animation: pulse-dot 1s ease-in-out infinite; }
.video-title { font-weight: 700; font-size: 0.9rem; margin-bottom: 4px; }
.video-sub { font-size: 0.75rem; opacity: 0.5; }

/* ═══════════════════════════ SETTINGS ═══════════════════════════ */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
@media (max-width:900px) { .settings-grid { grid-template-columns: 1fr; } }
.settings-section { border-radius: 28px; padding: 2rem; }
.settings-section-title { font-size: 1rem; font-weight: 600; margin-bottom: 1.75rem; padding-bottom: 1rem; border-bottom: 1px solid var(--glass-border); }
.settings-form { display: flex; flex-direction: column; gap: 1rem; }
.settings-toggle-row { display: flex; justify-content: space-between; align-items: center; padding: 1rem 0; border-bottom: 1px solid var(--glass-border); }
.settings-toggle-row:last-child { border-bottom: none; }
.settings-toggle-label { font-size: 0.875rem; font-weight: 600; margin-bottom: 3px; }
.settings-toggle-sub { font-size: 0.7rem; opacity: 0.4; }
.integration-row { display: flex; justify-content: space-between; align-items: center; padding: 1rem 0; border-bottom: 1px solid var(--glass-border); }
.integration-row:last-child { border-bottom: none; }

/* ═══════════════════════════ TAB SWITCHER ═══════════════════════════ */
.tab-switcher {
  display: flex; background: rgba(var(--text-base-rgb),0.04);
  border-radius: 14px; padding: 4px; border: 1px solid var(--glass-border);
}
.tab-switcher.small { border-radius: 10px; }
.tab-btn {
  padding: 0.625rem 1.25rem; border-radius: 10px;
  font-size: 0.65rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.15em;
  color: rgba(var(--text-base-rgb),0.4); transition: all 0.3s ease;
}
.tab-btn.active { background: var(--color-accent); color: white; box-shadow: 0 4px 12px rgba(37,99,235,0.25); }
.tab-btn[data-billing-tab="trash"].active { background: rgba(239,68,68,0.15); color: #ef4444; box-shadow: none; }
.tab-btn[data-inbox-tab="trash"].active { background: rgba(239,68,68,0.08); color: #ef4444; border: 1px solid rgba(239,68,68,0.2); box-shadow: none; }

/* Search bar */
.search-wrap { position: relative; }
.search-icon { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); opacity: 0.35; pointer-events: none; }
.search-filter-bar { display: flex; gap: 1.25rem; align-items: center; flex-wrap: wrap; }
.filter-tabs { display: flex; gap: 0.5rem; }

/* ═══════════════════════════ AMBIENT GLOW ═══════════════════════════ */
.ambient-glow {
  position: absolute; top: 0; left: 25%; width: 50%; height: 400px;
  border-radius: 50%; filter: blur(120px); pointer-events: none; z-index: 0;
  opacity: 0.04;
}
.ambient-glow.teal { background: #14b8a6; }
.ambient-glow.indigo { background: #6366f1; }

/* ═══════════════════════════ OVERLAYS ═══════════════════════════ */
.overlay {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center; padding: 1.5rem;
  animation: fadeOverlay 0.4s ease;
}
@keyframes fadeOverlay { from{opacity:0} to{opacity:1} }
.overlay-bg {
  position: absolute; inset: 0;
  background: rgba(var(--bg-base-rgb,11,17,32),0.85);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}
.overlay-card {
  position: relative; z-index: 10; width: 100%; max-width: 440px;
  border-radius: 32px; padding: 2.5rem; box-shadow: 0 40px 80px rgba(0,0,0,0.5);
  animation: slideUpCard 0.5s var(--ease-luxury);
}
@keyframes slideUpCard { from{transform:translateY(30px) scale(0.96);opacity:0} to{transform:none;opacity:1} }
.overlay-icon {
  width: 80px; height: 80px; border-radius: 24px; margin: 0 auto 1.5rem;
  background: rgba(37,99,235,0.1); border: 1px solid rgba(37,99,235,0.2);
  display: flex; align-items: center; justify-content: center; color: var(--color-accent);
}
.overlay-badge {
  font-size: 0.6rem; font-weight: 900; letter-spacing: 0.25em; text-transform: uppercase;
  color: var(--color-accent); background: rgba(37,99,235,0.08); border: 1px solid rgba(37,99,235,0.15);
  padding: 0.35rem 1rem; border-radius: 50px; display: inline-block; margin-bottom: 1.25rem;
}
.overlay-title { font-size: 2rem; font-weight: 300; letter-spacing: -0.05em; margin-bottom: 0.75rem; }
.overlay-msg { font-size: 0.875rem; opacity: 0.55; line-height: 1.7; margin-bottom: 2rem; }

/* Modal */
.modal-card {
  position: relative; z-index: 10; width: 100%; max-width: 440px;
  border-radius: 32px; overflow: hidden;
  animation: slideUpCard 0.6s var(--ease-luxury);
}
.modal-glow {
  position: absolute; top: -30%; left: -30%; width: 160%; height: 160%;
  border-radius: 50%; opacity: 0.05; pointer-events: none; filter: blur(100px);
}
.modal-body { position: relative; z-index: 10; text-align: center; padding: 2.5rem; }
.modal-badge {
  font-size: 0.55rem; font-weight: 900; letter-spacing: 0.3em; text-transform: uppercase;
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.35rem 1rem; border-radius: 50px; border: 1px solid; margin-bottom: 2rem;
}
.modal-badge.info { color: #14b8a6; border-color: rgba(20,184,166,0.3); background: rgba(20,184,166,0.08); }
.modal-badge.danger { color: #ef4444; border-color: rgba(239,68,68,0.3); background: rgba(239,68,68,0.08); }
.modal-badge.success { color: #10B981; border-color: rgba(16,185,129,0.3); background: rgba(16,185,129,0.08); }
.modal-badge.security { color: #6366f1; border-color: rgba(99,102,241,0.3); background: rgba(99,102,241,0.08); }
.modal-title { font-size: 2rem; font-weight: 300; letter-spacing: -0.05em; margin-bottom: 1rem; }
.modal-msg { font-size: 0.875rem; opacity: 0.55; line-height: 1.7; margin-bottom: 3rem; }
.modal-actions { display: flex; flex-direction: column; gap: 0.75rem; }
.modal-confirm-btn {
  width: 100%; padding: 1.25rem; border-radius: 18px;
  font-size: 0.65rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.2em;
  color: white; transition: all 0.4s ease;
}
.modal-confirm-btn:hover { transform: translateY(-2px); }
.modal-confirm-btn.info { background: #14b8a6; box-shadow: 0 10px 25px rgba(20,184,166,0.3); }
.modal-confirm-btn.danger { background: #ef4444; box-shadow: 0 10px 25px rgba(239,68,68,0.3); }
.modal-confirm-btn.success { background: #10B981; box-shadow: 0 10px 25px rgba(16,185,129,0.3); }
.modal-confirm-btn.security { background: #6366f1; box-shadow: 0 10px 25px rgba(99,102,241,0.3); }
.modal-cancel {
  width: 100%; padding: 1rem;
  font-size: 0.65rem; font-weight: 700; opacity: 0.4;
  text-transform: uppercase; letter-spacing: 0.2em;
  transition: opacity 0.2s ease;
}
.modal-cancel:hover { opacity: 0.7; }

/* PHI Shield */
#phi-shield {
  pointer-events: none;
  transition: opacity 0.3s ease;
}
#phi-shield.visible { pointer-events: all; }
.shield-bg { position: absolute; inset: 0; background: var(--bg-base); opacity: 0.85; backdrop-filter: blur(32px); }
.shield-content { position: relative; z-index: 10; text-align: center; max-width: 480px; padding: 2rem; }
.shield-icon-wrap {
  width: 88px; height: 88px; border-radius: 50%; background: var(--color-brand-800);
  border: 1px solid var(--glass-border); margin: 0 auto 1.5rem;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 40px rgba(37,99,235,0.15);
}
.shield-title { font-size: 2rem; font-weight: 600; letter-spacing: -0.04em; margin-bottom: 1rem; }
.shield-msg { font-size: 0.875rem; opacity: 0.55; line-height: 1.7; }

/* ═══════════════════════════ MISC UTILITIES ═══════════════════════════ */
.hidden { display: none !important; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.italic { font-style: italic; }

/* Intake Queue filter highlight */
.queue-row-new td:first-child { border-left: 3px solid #3b82f6; }
.queue-row-scheduled td:first-child { border-left: 3px solid #8b5cf6; }
.queue-row-inprogress td:first-child { border-left: 3px solid var(--color-warning); }

/* ═══════════════════════════ CLINICAL LAB FACELIFT ═══════════════════════════ */
:root {
  --color-accent: #0f766e;
  --color-blue: #2563eb;
  --color-success: #059669;
  --color-warning: #b45309;
  --color-danger: #dc2626;
  --clinical-line: rgba(15, 23, 42, 0.08);
}

.dark {
  --bg-base: #08111f;
  --color-brand-900: #0b1727;
  --color-brand-800: #122238;
  --color-brand-700: #1b314c;
  --color-accent: #2dd4bf;
  --glass-bg: rgba(18, 34, 56, 0.9);
  --glass-gradient-1: rgba(18, 34, 56, 0.92);
  --glass-gradient-2: rgba(8, 17, 31, 0.96);
  --glass-border: rgba(226, 232, 240, 0.1);
  --clinical-line: rgba(226, 232, 240, 0.1);
}

body {
  user-select: text;
  background:
    linear-gradient(135deg, rgba(15,118,110,0.08), transparent 34%),
    linear-gradient(315deg, rgba(37,99,235,0.06), transparent 30%),
    var(--bg-base);
}

.glass-card,
.panel,
.table-card,
.billing-form-card,
.settings-section,
.persona-card,
.guardrails-card,
.ai-knowledge-card {
  border-radius: 16px;
}

.hover-luxury:hover {
  transform: translateY(-2px);
  border-color: rgba(15, 118, 110, 0.35);
  box-shadow: var(--shadow-inner), 0 18px 36px -24px rgba(15, 118, 110, 0.45);
}

.page-header {
  background:
    linear-gradient(90deg, rgba(15,118,110,0.1), transparent 45%),
    var(--glass-bg);
}

.header-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.clinical-toolbelt {
  position: fixed;
  z-index: 80;
  top: auto;
  bottom: 1rem;
  right: 1rem;
  display: flex;
  gap: 0.5rem;
  padding: 0.45rem;
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 18px 45px -30px rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(18px);
}

.dark .clinical-toolbelt {
  background: rgba(8, 17, 31, 0.82);
}

.toolbelt-btn {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0 0.75rem;
  border-radius: 12px;
  border: 1px solid transparent;
  color: var(--text-base);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: transparent;
  transition: 0.2s ease;
}

.toolbelt-btn:hover {
  border-color: rgba(15, 118, 110, 0.25);
  background: rgba(15, 118, 110, 0.09);
  color: var(--color-accent);
}

.page-title {
  letter-spacing: 0;
}

.page-subtitle {
  opacity: 0.68;
  letter-spacing: 0;
}

.metric-card {
  min-height: 142px;
  border-left: 3px solid rgba(15, 118, 110, 0.45);
}

.metric-icon,
.activity-icon.chat,
.activity-icon.lab {
  background: rgba(15, 118, 110, 0.1);
  color: var(--color-accent);
}

.quick-action-primary,
.btn-primary,
.nav-link.active {
  background: linear-gradient(135deg, #0f766e, #2563eb);
}

.dark .quick-action-primary,
.dark .btn-primary,
.dark .nav-link.active {
  background: linear-gradient(135deg, #0f766e, #1d4ed8);
}

.nexus-table th {
  padding: 1rem 1.25rem;
  letter-spacing: 0.12em;
}

.nexus-table td {
  padding: 1.125rem 1.25rem;
  vertical-align: middle;
}

.table-scroll {
  overflow-x: auto;
}

.table-subtitle {
  margin-top: 0.35rem;
  font-size: 0.76rem;
  opacity: 0.55;
}

.forms-toolbar {
  gap: 1.5rem;
  align-items: flex-start;
}

.forms-controls {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.forms-search {
  min-width: 300px;
}

.forms-select {
  width: auto;
  min-width: 170px;
  padding-right: 2.5rem;
}

.forms-table {
  min-width: 1080px;
}

.forms-row {
  cursor: pointer;
}

.section-heading-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1.25rem;
}

.provider-access-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.45fr);
  gap: 1.25rem;
  margin-bottom: 1.5rem;
  align-items: start;
}

.provider-access-card {
  border-radius: 18px;
  padding: 1.35rem;
}

.provider-access-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.provider-access-form .btn-primary {
  grid-column: 1 / -1;
  justify-content: center;
}

.provider-access-table {
  min-width: 840px;
}

.provider-code {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 0.7rem;
  border-radius: 10px;
  border: 1px dashed rgba(15, 118, 110, 0.35);
  background: rgba(15, 118, 110, 0.08);
  color: var(--color-accent);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.audit-table {
  min-width: 1120px;
}

.audit-time,
.audit-desc {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.audit-time strong,
.audit-desc strong {
  font-size: 0.78rem;
  font-weight: 800;
}

.audit-time span,
.audit-desc span {
  font-size: 0.68rem;
  line-height: 1.45;
  opacity: 0.55;
}

.form-record-cell,
.zoho-cell {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-record-cell span:last-child,
.zoho-cell span:last-child,
.forms-date {
  font-size: 0.72rem;
  line-height: 1.45;
  opacity: 0.58;
}

.form-type-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.35rem 0.65rem;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--clinical-line);
  background: rgba(var(--text-base-rgb), 0.04);
}

.type-appointment,
.type-requisition {
  color: #0f766e;
  background: rgba(15, 118, 110, 0.1);
  border-color: rgba(15, 118, 110, 0.2);
}

.type-contact,
.type-video-call {
  color: #2563eb;
  background: rgba(37, 99, 235, 0.1);
  border-color: rgba(37, 99, 235, 0.2);
}

.type-career,
.type-newsletter {
  color: #7c3aed;
  background: rgba(124, 58, 237, 0.1);
  border-color: rgba(124, 58, 237, 0.2);
}

.type-enrollment {
  color: #b45309;
  background: rgba(180, 83, 9, 0.1);
  border-color: rgba(180, 83, 9, 0.2);
}

.document-tools-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.document-tool-card {
  min-height: 156px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.85rem;
  text-align: left;
  border-radius: 14px;
  border: 1px solid var(--glass-border);
  background:
    linear-gradient(135deg, rgba(15,118,110,0.08), transparent 62%),
    rgba(var(--text-base-rgb), 0.025);
  color: var(--text-base);
  transition: 0.2s ease;
}

.document-tool-card:hover {
  transform: translateY(-2px);
  border-color: rgba(15, 118, 110, 0.35);
  background:
    linear-gradient(135deg, rgba(15,118,110,0.14), transparent 62%),
    rgba(var(--text-base-rgb), 0.04);
}

.document-tool-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--color-accent);
  background: rgba(15, 118, 110, 0.1);
}

.document-tool-icon svg {
  width: 22px;
  height: 22px;
}

.document-tool-card strong {
  font-size: 0.95rem;
  letter-spacing: 0;
}

.document-tool-card small {
  font-size: 0.76rem;
  line-height: 1.55;
  opacity: 0.62;
}

.form-detail-panel {
  position: fixed;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  width: min(980px, calc(100vw - 3rem));
  height: min(92vh, 980px);
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  overflow: hidden;
  animation: scaleInPanel 0.28s var(--ease-luxury);
  box-shadow: 0 35px 90px -45px rgba(0, 0, 0, 0.75);
}

@keyframes scaleInPanel {
  from { transform: translate(-50%, -47%) scale(0.97); opacity: 0; }
  to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

.form-detail-header {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 2rem;
  border-bottom: 1px solid var(--glass-border);
  background: linear-gradient(90deg, rgba(15,118,110,0.12), transparent);
}

.form-detail-kicker {
  color: var(--color-accent);
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 0.55rem;
}

.form-detail-title {
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: 0;
  margin-bottom: 0.35rem;
}

.form-detail-sub {
  font-size: 0.78rem;
  opacity: 0.58;
  font-family: 'JetBrains Mono', monospace;
}

.form-detail-close {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-base);
  border: 1px solid var(--glass-border);
  background: rgba(var(--text-base-rgb), 0.04);
  flex-shrink: 0;
}

.form-detail-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--glass-border);
  background: rgba(var(--text-base-rgb), 0.02);
}

.form-detail-actions .btn-primary,
.form-detail-actions .btn-ghost,
.header-actions .btn-ghost,
.header-actions .btn-primary {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  white-space: nowrap;
}

.form-detail-content {
  overflow-y: auto;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-detail-section {
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 1.25rem;
  background: rgba(var(--text-base-rgb), 0.02);
}

.form-detail-section h3 {
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent);
  padding-bottom: 0.85rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--glass-border);
}

.form-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.raw-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-detail-field {
  border: 1px solid var(--clinical-line);
  border-radius: 10px;
  padding: 0.9rem;
  background: rgba(var(--bg-base-rgb), 0.26);
  min-width: 0;
}

.form-detail-field.wide {
  grid-column: 1 / -1;
}

.form-detail-field span,
.nested-detail-row span {
  display: block;
  font-size: 0.61rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.5;
  margin-bottom: 0.35rem;
}

.form-detail-field strong,
.nested-detail-row strong {
  display: block;
  font-size: 0.9rem;
  line-height: 1.55;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.detail-muted {
  opacity: 0.42;
  font-style: italic;
}

.detail-list {
  display: grid;
  gap: 0.5rem;
}

.nested-detail-grid {
  display: grid;
  gap: 0.65rem;
}

.nested-detail-row {
  padding: 0.75rem;
  border-radius: 8px;
  background: rgba(var(--text-base-rgb), 0.03);
  border: 1px solid var(--clinical-line);
}

@media (max-width: 900px) {
  .clinical-toolbelt {
    top: auto;
    right: 0.75rem;
    left: 0.75rem;
    bottom: 0.75rem;
    justify-content: space-between;
  }

  .toolbelt-btn {
    flex: 1;
    justify-content: center;
    padding-inline: 0.5rem;
  }

  .toolbelt-btn span {
    display: none;
  }

  .document-tools-grid {
    grid-template-columns: 1fr;
  }

  .provider-access-grid {
    grid-template-columns: 1fr;
  }

  .header-actions {
    justify-content: stretch;
    width: 100%;
  }

  .header-actions > * {
    flex: 1;
    justify-content: center;
  }

  .forms-toolbar,
  .forms-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .forms-search,
  .forms-select {
    min-width: 0;
    width: 100%;
  }

  .provider-access-form {
    grid-template-columns: 1fr;
  }

  .form-detail-grid,
  .raw-grid {
    grid-template-columns: 1fr;
  }

  .form-detail-panel {
    width: calc(100vw - 1rem);
    height: calc(100vh - 1rem);
    border-radius: 16px;
  }

  .form-detail-header,
  .form-detail-content,
  .form-detail-actions {
    padding-inline: 1.25rem;
  }
}

/* ═══════════════════════════ WORKFORCE CONSOLE ═══════════════════════════ */
.wf-tabs {
  display: flex; gap: 0.5rem; margin: 1.25rem 0 1rem; flex-wrap: wrap;
}
.wf-tab {
  padding: 0.55rem 1.1rem; border-radius: 12px; border: 1px solid var(--glass-border);
  background: var(--color-brand-800); color: var(--text-base); opacity: 0.7;
  font-family: inherit; font-size: 0.82rem; font-weight: 700; cursor: pointer;
  transition: all 0.25s var(--ease-luxury);
}
.wf-tab:hover { opacity: 1; }
.wf-tab.active {
  background: var(--color-accent); color: #fff; opacity: 1; border-color: transparent;
  box-shadow: 0 8px 20px -8px var(--color-accent);
}
.wf-panel[hidden] { display: none; }

.wf-settings-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem; margin-top: 1.25rem;
}
.wf-field { display: flex; flex-direction: column; gap: 0.4rem; }
.wf-field span { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; opacity: 0.7; }
.wf-check {
  display: flex; align-items: center; gap: 0.6rem; margin-top: 1.25rem;
  font-size: 0.88rem; font-weight: 600; cursor: pointer;
}
.wf-check input { width: 17px; height: 17px; accent-color: var(--color-accent); }

.wf-code {
  font-family: monospace; font-weight: 800; letter-spacing: 0.12em;
  background: rgba(var(--text-base-rgb), 0.06); padding: 0.2rem 0.55rem; border-radius: 8px;
}
.wf-op-btn {
  background: none; border: 1px solid var(--glass-border); border-radius: 9px;
  padding: 0.35rem 0.7rem; font-family: inherit; font-size: 0.74rem; font-weight: 700;
  color: var(--text-base); cursor: pointer; opacity: 0.85; transition: all 0.2s;
}
.wf-op-btn:hover { opacity: 1; border-color: var(--color-accent); color: var(--color-accent); }
.wf-cred-box {
  background: rgba(var(--text-base-rgb), 0.05); border: 1px dashed var(--glass-border);
  border-radius: 12px; padding: 1rem 1.2rem; margin-top: 0.5rem; text-align: left;
}
.wf-cred-box .row { display: flex; justify-content: space-between; align-items: center; padding: 0.3rem 0; }
.wf-cred-box .row b { font-family: monospace; font-size: 1.05rem; letter-spacing: 0.1em; }

/* ── Two-factor (MFA) modal ── */
.mfa-code-input {
  text-align: center; letter-spacing: 0.5em; font-size: 1.5rem; font-weight: 700;
  margin-top: 0.5rem;
}
#mfa-qr { display: flex; justify-content: center; margin: 1rem 0; }
#mfa-qr img, #mfa-qr canvas { border-radius: 10px; background: #fff; padding: 8px; }
