:root {
  /* Elation Health Brand Colors */
  --bg: #F5FAFF;
  --card: #ffffff;
  --header: #00214D;
  --accent: #1C94BC;
  --accent2: #FF754C;
  --green: #92C57D;
  --green-dark: #4a8a35;
  --yellow: #FFD966;
  --yellow-dark: #7F6000;
  --red: #EB5757;
  --red-dark: #b91c1c;
  --coral: #FF754C;
  --navy: #00214D;
  --gray: #6b7280;
  --border: #C8DDEF;
  --text: #00214D;
  --text2: #5a7392;
  --radius: 10px;
  --shadow: 0 1px 4px rgba(0,33,77,0.09);
}
* { margin:0; padding:0; box-sizing:border-box; }
body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background:var(--bg); color:var(--text); font-size:14px; }

/* LAYOUT */
.app { display:flex; flex-direction:column; min-height:100vh; }
.topbar { background:var(--header); color:#fff; padding:14px 24px; display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.topbar-left { display:flex; align-items:center; gap:12px; }
.topbar h1 { font-size:18px; font-weight:600; letter-spacing:.2px; font-family:'Gelasio',Georgia,serif; }
.topbar .subtitle { font-size:12px; opacity:.65; margin-top:1px; }
.month-nav { display:flex; align-items:center; gap:8px; color:#fff; font-size:13px; }
.month-nav button { background:rgba(255,255,255,.15); border:none; color:#fff; padding:8px 14px; border-radius:4px; cursor:pointer; font-size:14px; min-height:36px; min-width:36px; }

.main { display:flex; flex:1; }
.sidebar { width:200px; min-width:200px; background:#fff; border-right:1px solid var(--border); padding:16px 0; display:flex; flex-direction:column; gap:2px; }
.nav-item { display:flex; align-items:center; gap:9px; padding:9px 18px; cursor:pointer; border-radius:0; color:var(--gray); font-size:13px; font-weight:500; border-left:3px solid transparent; transition:all .18s ease; }
.nav-item:hover { background:#f3f4f6; color:var(--text); }
.nav-item.active { background:#e6f5fb; color:var(--accent); border-left-color:var(--accent); font-weight:600; }
.nav-icon { font-size:16px; width:18px; text-align:center; }
.nav-badge { margin-left:auto; background:var(--red); color:#fff; font-size:10px; padding:1px 6px; border-radius:10px; font-weight:700; }

.content { flex:1; padding:20px; overflow:auto; }

/* VIEWS */
.view { display:none; }
.view.active { display:block; }

/* KPI ROW */
.kpi-row { display:grid; grid-template-columns:repeat(auto-fit, minmax(170px,1fr)); gap:14px; margin-bottom:18px; }
.kpi-card { background:linear-gradient(135deg, #ffffff 0%, #f0f9ff 100%); border-radius:var(--radius); padding:16px 20px; box-shadow:0 2px 8px rgba(0,33,77,0.08); border-left:4px solid var(--accent); transition:box-shadow .18s ease; }
.kpi-card:hover { box-shadow:0 4px 16px rgba(0,33,77,0.12); }
.kpi-card.green { border-left-color:var(--green); }
.kpi-card.yellow { border-left-color:var(--yellow); }
.kpi-card.red { border-left-color:var(--red); }
.kpi-label { font-size:11px; text-transform:uppercase; letter-spacing:.6px; color:var(--text2); margin-bottom:4px; }
.kpi-value { font-size:26px; font-weight:800; line-height:1; }
.kpi-sub { font-size:11px; color:var(--text2); margin-top:4px; }

/* SECTION HEADER */
.section-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:12px; }
.section-header h2 { font-size:16px; font-weight:600; font-family:'Gelasio',Georgia,serif; color:var(--navy); }
.section-header .actions { display:flex; gap:8px; }
.btn { padding:7px 14px; border-radius:6px; font-size:12px; font-weight:600; cursor:pointer; border:none; transition:all .18s ease; min-height:38px; }
.btn-primary { background:var(--accent); color:#fff; min-width:120px; }
.btn-primary:hover { background:#1478a0; }
.btn-secondary { background:#f3f4f6; color:var(--text); border:1px solid var(--border); }
.btn-secondary:hover { background:#e5e7eb; }
.btn-sm { padding:4px 10px; font-size:11px; }
.btn-green { background:#e3f5da; color:var(--green-dark); }
.btn-yellow { background:#fff8d6; color:var(--yellow-dark); }
.btn-red { background:#fde8e8; color:var(--red-dark); }

/* TABLE */
.table-wrap { background:var(--card); border-radius:var(--radius); box-shadow:var(--shadow); overflow:auto; margin-bottom:18px; }
table { width:100%; border-collapse:collapse; }
thead th { background:#f9fafb; padding:10px 14px; text-align:left; font-size:11px; text-transform:uppercase; letter-spacing:.5px; color:var(--text2); font-weight:700; border-bottom:1px solid var(--border); white-space:nowrap; cursor:pointer; user-select:none; }
thead th:hover { color:var(--text); }
tbody td { padding:10px 14px; border-bottom:1px solid #f3f4f6; font-size:13px; }
tbody tr:last-child td { border-bottom:none; }
tbody tr { transition:background .15s ease; }
tbody tr:hover { background:#f5f8fb; }

/* BADGES */
.badge { display:inline-block; padding:2px 9px; border-radius:12px; font-size:11px; font-weight:600; }
.badge-green { background:#e3f5da; color:var(--green-dark); }
.badge-yellow { background:#fff8d6; color:var(--yellow-dark); }
.badge-red { background:#fde8e8; color:var(--red-dark); }
.badge-blue { background:#d6eef6; color:#0d617e; }

/* PATIENT AVATAR */
.patient-avatar { display:inline-flex; align-items:center; justify-content:center; width:28px; height:28px; border-radius:50%; font-size:11px; font-weight:700; color:#fff; margin-right:8px; flex-shrink:0; vertical-align:middle; }
.badge-gray { background:#f3f4f6; color:var(--gray); }

/* PROGRESS BAR */
.progress-bar { background:#e5e7eb; border-radius:99px; height:8px; overflow:hidden; min-width:80px; }
.progress-fill { height:100%; border-radius:99px; transition:width .3s; }
.progress-fill.green { background:var(--green); }
.progress-fill.yellow { background:var(--yellow); }
.progress-fill.red { background:var(--red); }

/* CHART GRID */
.chart-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(340px,1fr)); gap:14px; margin-bottom:18px; }
.chart-card { background:var(--card); border-radius:var(--radius); padding:18px 20px; box-shadow:var(--shadow); }
.chart-card h3 { font-size:14px; font-weight:600; margin-bottom:14px; color:var(--navy); font-family:'Gelasio',Georgia,serif; }
.chart-card canvas { max-height:220px; }

/* FILTER BAR */
.filter-bar { display:flex; gap:10px; flex-wrap:wrap; margin-bottom:14px; align-items:center; }
.filter-bar select, .filter-bar input[type="text"] { padding:6px 10px; border:1px solid var(--border); border-radius:6px; font-size:12px; background:#fff; color:var(--text); }
.search-input { min-width:200px; }

/* MODAL */
.modal-overlay { display:none; position:fixed; inset:0; background:rgba(0,0,0,.45); z-index:1000; align-items:center; justify-content:center; opacity:0; transition:opacity .2s ease; }
.modal-overlay.open { display:flex; opacity:1; }
.modal { background:#fff; border-radius:12px; padding:28px; width:540px; max-width:95vw; max-height:90vh; overflow-y:auto; box-shadow:0 8px 32px rgba(0,0,0,.18); transform:translateY(8px); transition:transform .2s ease; display:flex; flex-direction:column; }
.modal > *:not(.modal-footer) { flex-shrink:0; }
.modal-overlay.open .modal { transform:translateY(0); }
.modal h2 { font-size:18px; font-weight:600; margin-bottom:18px; font-family:'Gelasio',Georgia,serif; color:var(--navy); }
.modal-header-colored { margin:-28px -28px 18px; padding:18px 28px; border-radius:12px 12px 0 0; }
.modal-header-colored h2 { color:#fff; margin-bottom:0; }
.modal-header-colored .modal-close { color:rgba(255,255,255,.7); }
.modal-header-colored .modal-close:hover { color:#fff; }
.modal-header-navy { background:var(--header); }
.modal-header-teal { background:#0d9488; }
.modal-header-blue { background:var(--accent); }

/* BILLED TOOLTIP */
.billed-chip { position:relative; cursor:default; }
.billed-chip[data-tip]::after { content:attr(data-tip); position:absolute; bottom:calc(100% + 4px); left:50%; transform:translateX(-50%); background:#1e3a5f; color:#fff; font-size:11px; padding:4px 8px; border-radius:5px; white-space:nowrap; opacity:0; pointer-events:none; transition:opacity .15s; z-index:10; }
.billed-chip[data-tip]:hover::after { opacity:1; }

/* EMPTY STATE */
.empty-state { text-align:center; padding:60px 24px; color:var(--text2); }
.empty-state .empty-icon { font-size:52px; margin-bottom:12px; display:block; }
.empty-state h3 { font-size:16px; font-weight:600; color:var(--text); margin-bottom:6px; }
.modal-close { float:right; background:none; border:none; font-size:20px; cursor:pointer; color:var(--gray); margin-top:-4px; }
.form-row { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-bottom:12px; }
.form-row.full { grid-template-columns:1fr; }
.form-group { display:flex; flex-direction:column; gap:4px; }
.form-group label { font-size:12px; font-weight:600; color:var(--text2); }
.form-group input, .form-group select, .form-group textarea { padding:8px 10px; border:1px solid var(--border); border-radius:6px; font-size:13px; font-family:inherit; }
.form-group textarea { resize:vertical; min-height:70px; }
.modal-footer { display:flex; gap:8px; justify-content:flex-end; margin-top:18px; position:sticky; bottom:-28px; background:#fff; padding:14px 0 0; border-top:1px solid var(--border); z-index:10; }


/* TASK BOARD */
.task-cols { display:grid; grid-template-columns:repeat(3,1fr); gap:14px; }
.task-col { background:#f9fafb; border-radius:var(--radius); padding:14px; }
.task-col-header { font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.5px; margin-bottom:12px; display:flex; justify-content:space-between; align-items:center; }
.task-card { background:#fff; border-radius:8px; padding:12px 14px; margin-bottom:8px; box-shadow:0 1px 3px rgba(0,0,0,.07); border-left:3px solid var(--accent); cursor:pointer; }
.task-card.urgent { border-left-color:var(--red); }
.task-card.normal { border-left-color:var(--accent); }
.task-card.done { border-left-color:var(--green); opacity:.75; }
.task-card-title { font-size:13px; font-weight:600; margin-bottom:4px; }
.task-card-meta { font-size:11px; color:var(--text2); display:flex; gap:8px; flex-wrap:wrap; }
.task-card-meta span { display:flex; align-items:center; gap:3px; }

/* ENROLLMENT CONSENT */
.consent-strip { display:flex; align-items:center; gap:6px; font-size:12px; }
.dot { width:8px; height:8px; border-radius:50%; display:inline-block; }
.dot-green { background:var(--green); }
.dot-yellow { background:var(--yellow); }
.dot-red { background:var(--red); }

/* TOAST */
.toast { position:fixed; right:24px; background:#00214D; color:#fff; padding:12px 20px; border-radius:10px; font-size:13px; font-weight:500; box-shadow:0 4px 16px rgba(0,33,77,.25); z-index:2000; transform:translateX(60px); opacity:0; transition:all .25s ease; cursor:pointer; max-width:340px; }
.toast.show { transform:translateX(0); opacity:1; }
@keyframes slideInRight { from{transform:translateX(60px);opacity:0} to{transform:translateX(0);opacity:1} }

/* AUDIT LOG */
#view-audit .table-wrap table td { vertical-align:top; }
#view-audit .table-wrap table tr:hover { background:#fafcff; }

/* BILLED CHECKLIST */
/* Consent badge pulse when count > 0 */
@keyframes badge-pulse { 0%,100%{ transform:scale(1); } 50%{ transform:scale(1.12); } }
.nav-badge.badge-pulse { animation: badge-pulse 2s ease-in-out infinite; }

.bill-row-billed td { opacity:.6; }
.bill-row-billed td:first-child strong { text-decoration:line-through; }
.bill-row-billed td:first-child, .bill-row-billed td:nth-child(6) { opacity:1; }
tr.bill-row-billed { background:linear-gradient(90deg,#f0faf0 0%,#fff 100%) !important; }
#bill-billed-progress-wrap .progress-bar { height:10px; }

/* AI TOOLS */
.ai-tabs { display:flex; gap:4px; flex-wrap:wrap; margin-bottom:18px; }
.ai-tab { padding:7px 16px; border-radius:20px; font-size:12px; font-weight:600; cursor:pointer; border:2px solid var(--border); background:#fff; color:var(--gray); transition:all .15s; }
.ai-tab.active { background:linear-gradient(135deg,#00214D,#1C94BC); color:#fff; border-color:transparent; }
.ai-panel { display:none; }
.ai-panel.active { display:block; }
.ai-card { background:var(--card); border-radius:var(--radius); padding:22px 24px; box-shadow:var(--shadow); margin-bottom:16px; }
.ai-card h3 { font-size:15px; font-weight:600; margin-bottom:6px; display:flex; align-items:center; gap:8px; font-family:'Gelasio',Georgia,serif; color:var(--navy); }
.ai-card p { font-size:13px; color:var(--text2); margin-bottom:16px; line-height:1.5; }
.ai-output { background:#f0f8fc; border:1px solid #b8dcea; border-radius:8px; padding:18px 20px; margin-top:14px; font-size:13px; line-height:1.7; min-height:80px; }
.ai-output h4 { font-size:13px; font-weight:700; color:var(--header); margin:12px 0 4px; font-family:'Gelasio',Georgia,serif; }
.ai-output h4:first-child { margin-top:0; }
.ai-output ul { margin:4px 0 10px 16px; }
.ai-output li { margin-bottom:3px; }
.ai-output .risk-high { color:var(--red-dark); font-weight:700; }

/* Prompt Customizer */
.pc-section { border:1px solid var(--border); border-radius:8px; margin-bottom:8px; overflow:hidden; }
.pc-section-header { display:flex; align-items:center; justify-content:space-between; padding:10px 14px; background:var(--bg); cursor:pointer; font-size:13px; font-weight:600; }
.pc-section-header:hover { background:#f0f4f8; }
.pc-section-body { display:none; padding:12px 14px; border-top:1px solid var(--border); }
.pc-section-body.open { display:block; }
.pc-textarea { width:100%; padding:10px 12px; border:1px solid var(--border); border-radius:6px; font-size:12px; line-height:1.6; font-family:'SF Mono',Consolas,monospace; resize:vertical; background:#fafbfc; }
.pc-textarea:focus { border-color:var(--accent); outline:none; box-shadow:0 0 0 2px rgba(37,99,235,.15); }
.pc-hint { font-size:11px; color:var(--text2); margin:0 0 8px; line-height:1.4; }
.pc-inline { display:flex; align-items:center; gap:8px; margin-bottom:8px; }
.pc-inline label { font-size:12px; font-weight:600; white-space:nowrap; }
.pc-title-input { padding:4px 8px; border:1px solid var(--border); border-radius:4px; font-size:12px; font-weight:600; width:260px; }
.pc-chevron { font-size:12px; color:var(--text2); transition:transform .2s; }
.pc-toggle { display:flex; align-items:center; gap:4px; font-size:11px; cursor:pointer; margin-right:8px; }
.pc-toggle input { cursor:pointer; }
.pc-toggle-label { color:var(--text2); font-weight:500; }
.pc-section.pc-disabled { opacity:0.45; }
.pc-section.pc-disabled .pc-section-body { pointer-events:none; }
.ai-output .risk-med { color:var(--yellow-dark); font-weight:700; }
.ai-output .risk-low { color:var(--green-dark); font-weight:700; }
.ai-output table { width:100%; border-collapse:collapse; margin-top:8px; font-size:12px; }
.ai-output table th { background:#e6f5fb; padding:7px 10px; text-align:left; font-weight:700; border-bottom:1px solid #b8dcea; }
.ai-output table td { padding:7px 10px; border-bottom:1px solid #f0f4f8; }
.ai-output table tr:last-child td { border-bottom:none; }
.ai-streaming { opacity:.8; }
.ai-streaming::after { content:'▌'; animation:blink .7s infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }
.ai-loading { display:flex; align-items:center; gap:10px; color:var(--text2); font-size:13px; padding:12px 0; }
.spinner { width:18px; height:18px; border:2px solid var(--border); border-top-color:var(--accent); border-radius:50%; animation:spin .7s linear infinite; }
@keyframes spin { to{transform:rotate(360deg)} }
/* CARE PLAN ARCHIVE */
#cp-archive-section { margin-top:24px; padding-top:20px; border-top:1px solid var(--border); }
.cp-preview-snippet { max-width:320px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--text2); font-size:12px; }
#careplan-view-text { white-space:pre-wrap; font-family:'Courier New',monospace; font-size:12px; line-height:1.6; padding:16px; background:var(--bg); border:1px solid var(--border); border-radius:8px; max-height:60vh; overflow-y:auto; margin:12px 0; }
.cp-archive-empty { text-align:center; padding:40px 20px; color:var(--text2); }
.cp-archive-empty-icon { font-size:36px; margin-bottom:8px; }

.api-key-notice { background:#fff8d6; border:1px solid #FFD966; border-radius:8px; padding:12px 16px; font-size:12px; color:var(--yellow-dark); margin-bottom:16px; display:flex; align-items:center; gap:8px; }
.risk-table { width:100%; border-collapse:collapse; }
.risk-table th { background:#f9fafb; padding:9px 12px; text-align:left; font-size:11px; text-transform:uppercase; letter-spacing:.5px; color:var(--text2); font-weight:700; border-bottom:1px solid var(--border); }
.risk-table td { padding:9px 12px; border-bottom:1px solid #f3f4f6; font-size:13px; }
.risk-table tr:last-child td { border-bottom:none; }
.risk-badge-high { background:#fde8e8; color:var(--red-dark); padding:2px 10px; border-radius:12px; font-size:11px; font-weight:700; }
.risk-badge-med { background:#fff8d6; color:var(--yellow-dark); padding:2px 10px; border-radius:12px; font-size:11px; font-weight:700; }
.risk-badge-low { background:#e3f5da; color:var(--green-dark); padding:2px 10px; border-radius:12px; font-size:11px; font-weight:700; }
.settings-gear { background:rgba(255,255,255,.15); border:none; color:#fff; font-size:16px; padding:5px 8px; border-radius:6px; cursor:pointer; }
.settings-gear:hover { background:rgba(255,255,255,.25); }

/* WIZARD */
.wizard-steps { display:flex; gap:0; margin-bottom:22px; border-bottom:2px solid var(--border); }
.wizard-step { padding:10px 20px; font-size:12px; font-weight:600; color:var(--text2); border-bottom:2px solid transparent; margin-bottom:-2px; cursor:default; }
.wizard-step.active { color:var(--accent); border-bottom-color:var(--accent); }
.wizard-step.done { color:var(--green-dark); }
.wizard-body { min-height:220px; max-height:58vh; overflow-y:auto; padding-right:4px; }
.condition-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:8px; margin-bottom:14px; }
.condition-chip { border:2px solid var(--border); border-radius:8px; padding:10px 12px; cursor:pointer; font-size:12px; font-weight:600; background:#fff; display:flex; align-items:center; gap:6px; transition:all .15s; }
.condition-chip:hover { border-color:var(--accent); }
.condition-chip.selected { border-color:var(--accent); background:#e6f5fb; color:var(--accent); }
.condition-chip input[type=checkbox] { display:none; }
.template-preview { background:#f0f8fc; border:1px solid #b8dcea; border-radius:8px; padding:14px 16px; font-size:12px; line-height:1.7; margin-bottom:10px; }
.template-preview h5 { font-size:11px; text-transform:uppercase; letter-spacing:.5px; color:var(--text2); margin:8px 0 4px; }
.template-preview h5:first-child { margin-top:0; }
.template-preview ul { margin-left:14px; }
.template-preview li { margin-bottom:2px; }
/* KICKOFF */

.hamburger-btn { display:none; background:rgba(255,255,255,.15); border:none; color:#fff; font-size:22px; padding:6px 10px; border-radius:6px; cursor:pointer; line-height:1; }
.hamburger-btn:hover { background:rgba(255,255,255,.25); }
.sidebar-backdrop { display:none; position:fixed; inset:0; background:rgba(0,0,0,.35); z-index:899; }
.sidebar-backdrop.active { display:block; }

/* ── BUTTON STATES ── */
button:disabled, button[disabled] { opacity:0.5; cursor:not-allowed; }
.btn-danger { background:var(--red); color:#fff; border-color:var(--red); }
.btn-danger:hover { background:var(--red-dark); border-color:var(--red-dark); }

@media(max-width:480px) {
  .modal { padding:16px 12px; width:95vw; }
  .modal-footer { bottom:-12px; }
  table { font-size:11px; }
  thead th, tbody td { padding:8px 8px; }
  .btn { padding:6px 10px; font-size:11px; min-height:34px; }
  .topbar { flex-wrap:wrap; gap:6px; }
  .kpi-row { grid-template-columns:1fr; }
}

@media(max-width:768px) {
  .hamburger-btn { display:inline-block; }
  .sidebar { display:none; position:fixed; left:0; top:0; bottom:0; z-index:900; box-shadow:4px 0 16px rgba(0,0,0,.15); }
  .sidebar.mobile-open { display:flex; }
  .kpi-row { grid-template-columns:repeat(2,1fr); }
  .task-cols { grid-template-columns:1fr; }
  .form-row { grid-template-columns:1fr; }
}

/* ── BILLING PROGRAM BADGES ── */
.badge-ccm  { background:#d6eef6; color:#0d617e; }
.badge-apcm { background:#e3f5da; color:#2d6a4a; }
.badge-psych{ background:#ece9f8; color:#4a3a8a; }
.badge-pain { background:#fde8e8; color:var(--red-dark); }
.badge-pcm  { background:#d1fae5; color:#065f46; }
.badge-rpm  { background:#e0e7ff; color:#3730a3; }
.badge-nav  { background:#fef3c7; color:#92400e; }

/* ADD-ON ELIGIBILITY */
.addon-eligibility-card { background:#fffbeb; border:1px solid #f59e0b; border-radius:8px; padding:12px 16px; margin-top:12px; }
.badge-hr   { background:#ffe8df; color:#c0401a; }

/* ── CONDITION FLAGS ── */
.cond-flag { display:inline-block; font-size:9px; font-weight:700; padding:1px 5px; border-radius:4px; margin-left:3px; }
.flag-hr   { background:#ffe8df; color:#c0401a; }
.flag-psy  { background:#ece9f8; color:#4a3a8a; }
.flag-pain { background:#fff8d6; color:var(--yellow-dark); }

/* ── CONDITION CATEGORY PICKER ── */
.cond-category    { margin-bottom:10px; }
.cond-cat-header  { font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.6px; color:var(--text2); padding:4px 0 6px; border-bottom:1px solid var(--border); margin-bottom:6px; }
.cond-grid        { display:grid; grid-template-columns:repeat(auto-fill,minmax(200px,1fr)); gap:5px; }
.cond-item        { display:flex; align-items:center; gap:6px; padding:5px 7px; border-radius:6px; background:#f9fafb; border:1px solid transparent; transition:border-color .12s; }
.cond-item:hover  { border-color:var(--border); }
.cond-label       { font-size:12px; cursor:pointer; flex:1; }
.cond-flags       { display:flex; gap:2px; flex-shrink:0; }

/* ── MODAL TABS (Patient Modal) ── */
.modal-tabs       { display:flex; gap:0; border-bottom:2px solid var(--border); margin-bottom:18px; overflow-x:auto; }
.modal-tab        { padding:9px 12px; font-size:13px; font-weight:600; color:var(--text2); border-bottom:2px solid transparent; margin-bottom:-2px; cursor:pointer; white-space:nowrap; }
.modal-tab.active { color:var(--accent); border-bottom-color:var(--accent); }
.tab-panel        { display:none; padding:4px 2px; }
.tab-panel.active { display:block; }

/* ── REVENUE PREVIEW ── */
.rev-preview { background:#edf9f2; border:1px solid #b5dfca; border-radius:8px; padding:12px 14px; margin-top:10px; }
.rev-preview h4 { font-size:12px; font-weight:700; color:#2d6a4a; margin-bottom:8px; font-family:'Gelasio',Georgia,serif; }
.rev-line    { display:flex; justify-content:space-between; font-size:12px; padding:3px 0; border-bottom:1px dashed #c4ddb2; }
.rev-line:last-child { border-bottom:none; font-weight:700; font-size:13px; color:#2d6a4a; }
.rev-code    { font-weight:700; color:#0d617e; margin-right:6px; font-size:11px; background:#d6eef6; padding:1px 5px; border-radius:4px; }

/* ── BILLING SECTION ── */
.billing-section   { background:var(--card); border-radius:var(--radius); padding:16px 18px; box-shadow:var(--shadow); margin-bottom:12px; }
.billing-section h4 { font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.6px; color:var(--text2); margin-bottom:10px; padding-bottom:6px; border-bottom:1px solid var(--border); }
.billing-radio-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(140px,1fr)); gap:6px; }
.billing-radio-opt  { display:flex; align-items:flex-start; gap:7px; padding:7px 9px; border-radius:7px; border:1px solid var(--border); cursor:pointer; transition:border-color .12s; font-size:12px; }
.billing-radio-opt:hover { border-color:var(--accent); }
.billing-radio-opt input[type=radio] { margin-top:1px; accent-color:var(--accent); flex-shrink:0; }
.billing-radio-opt .opt-code { font-weight:700; display:block; font-size:11px; }
.billing-radio-opt .opt-desc { color:var(--text2); font-size:10px; display:block; line-height:1.3; margin-top:1px; }
.billing-addon  { margin-top:8px; display:flex; align-items:center; gap:8px; font-size:12px; padding:7px 10px; background:#f9fafb; border-radius:6px; }
.billing-addon input[type=number] { width:60px; padding:4px 6px; border:1px solid var(--border); border-radius:5px; font-size:12px; }

/* ── RATES TABLE ── */
.rates-table input[type=number] { width:80px; padding:5px 7px; border:1px solid var(--border); border-radius:5px; font-size:12px; text-align:right; }
.prog-group-hdr td { background:#f1f5f9; font-weight:700; font-size:11px; text-transform:uppercase; letter-spacing:.5px; color:var(--text2); padding:7px 14px; }

/* ── IMPORT DROP ZONE ── */
.import-drop { border:2px dashed var(--border); border-radius:10px; padding:32px 20px; text-align:center; cursor:pointer; transition:border-color .2s; background:#fafafa; }
.import-drop.drag-over { border-color:var(--accent); background:#e6f5fb; }
.import-drop p { font-size:13px; color:var(--text2); margin:6px 0; }
.import-drop strong { font-size:15px; color:var(--text); }
.mapping-grid { display:flex; flex-direction:column; gap:6px; margin-bottom:14px; }
.mapping-row  { display:flex; align-items:center; gap:10px; }
.csv-col      { font-size:12px; font-weight:600; color:#0d617e; background:#d6eef6; padding:2px 8px; border-radius:4px; min-width:130px; }
.import-preview { max-height:180px; overflow-y:auto; border:1px solid var(--border); border-radius:6px; }

/* ── HIPAA BANNER ── */
.hipaa-banner { background:#FFF9F2; border-bottom:1px solid #FFD966; padding:7px 20px; font-size:11px; color:#4a3000; display:flex; align-items:center; gap:8px; }
.hipaa-banner strong { color:#00214D; }

/* ── STAT CARDS (dashboard revenue) ── */
.stat-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(140px,1fr)); gap:12px; margin-bottom:18px; }
.stat-card { padding:14px 16px; border-radius:var(--radius); color:#fff; }
.stat-card .stat-label { font-size:10px; text-transform:uppercase; letter-spacing:.5px; opacity:.85; margin-bottom:4px; }
.stat-card .stat-value { font-size:22px; font-weight:800; line-height:1; }
.stat-card .stat-sub   { font-size:11px; opacity:.75; margin-top:4px; }
.stat-card.sc-navy  { background:#00214D; }
.stat-card.sc-teal  { background:#1C94BC; }
.stat-card.sc-green { background:#4a8a35; }
.stat-card.sc-blue  { background:#0d7fa3; }
.stat-card.sc-purple{ background:#6956a8; }
.stat-card.sc-orange{ background:#FF754C; }
.stat-card.sc-red   { background:#EB5757; }

/* ── CUSTOM CONDITIONS TAG ── */
.custom-tag { display:inline-flex; align-items:center; gap:4px; background:#e6f5fb; border:1px solid #9fd1e8; border-radius:12px; padding:2px 8px; font-size:12px; margin:2px 3px; }
.custom-tag button { background:none; border:none; cursor:pointer; color:var(--gray); font-size:14px; line-height:1; padding:0 2px; }

/* ── REPORT TABLE ── */
.report-section { background:var(--card); border-radius:var(--radius); padding:18px 20px; box-shadow:var(--shadow); margin-bottom:16px; }
.report-section h3 { font-size:15px; font-weight:600; margin-bottom:14px; padding-bottom:8px; border-bottom:1px solid var(--border); font-family:'Gelasio',Georgia,serif; color:var(--navy); }
.prog-bar-row { margin-bottom:10px; }
.prog-bar-row .label { display:flex; justify-content:space-between; font-size:12px; margin-bottom:3px; }

/* ── SETTINGS TABS ── */
.settings-tabs { display:flex; gap:6px; margin-bottom:20px; flex-wrap:wrap; }
.settings-tab { padding:6px 16px; font-size:12px; font-weight:500; color:var(--text2); background:transparent; border:1px solid transparent; border-radius:20px; cursor:pointer; display:flex; align-items:center; gap:7px; transition:all .15s; }
.settings-tab:hover:not(.active) { background:var(--bg); border-color:var(--border); }
.settings-tab.active { background:var(--accent); color:#fff; border-color:var(--accent); }
.settings-panel { display:none; }
.settings-panel.active { display:block; }

/* ── AI TOOLS NAV ── */
.nav-item-ai { color:#7c3aed; font-weight:600; }
.nav-badge-new { margin-left:auto; background:linear-gradient(135deg,#7c3aed,#2563eb); color:#fff; font-size:9px; padding:1px 6px; border-radius:8px; font-weight:700; }

/* ── SECONDARY KPI STRIP ── */
.kpi-secondary { display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:10px; margin-bottom:18px; padding:14px 16px; background:#FFF9F2; border:1px solid #FFD966; border-radius:var(--radius); }
.kpi-secondary-label { font-size:10px; text-transform:uppercase; letter-spacing:.6px; color:var(--text2); margin-bottom:2px; }
.kpi-secondary-value { font-size:20px; font-weight:800; line-height:1; }
.kpi-secondary-sub { font-size:11px; color:var(--text2); margin-top:3px; }

/* ── STATUS INDICATOR ── */
.kpi-status { font-size:11px; font-weight:700; margin-top:5px; display:flex; align-items:center; gap:3px; }
.kpi-status.status-good { color:var(--green-dark); }
.kpi-status.status-warn { color:var(--yellow-dark); }
.kpi-status.status-alert { color:var(--red-dark); }

/* ── IDLE LOCK OVERLAY ── */
/* Idle lock overlay removed — replaced by auto-logout (HIPAA) */

/* ── ATTENTION HERO ── */
.attention-hero { background:var(--card); border-radius:var(--radius); box-shadow:0 2px 10px rgba(0,33,77,.10); border:1.5px solid #9fd1e8; margin-bottom:18px; overflow:hidden; }
.attention-hero-header { display:flex; align-items:center; justify-content:space-between; padding:14px 18px; background:linear-gradient(90deg,#e6f5fb,#F5FAFF); border-bottom:1px solid #b8dcea; }
.attention-hero-header h2 { font-size:16px; font-weight:600; color:var(--navy); display:flex; align-items:center; gap:7px; font-family:'Gelasio',Georgia,serif; }
.attention-hero-header .attention-count { background:var(--accent); color:#fff; font-size:11px; font-weight:700; padding:2px 8px; border-radius:10px; }


@media print {
  body > *:not(#ai-cp-output) { display: none !important; }
  #ai-cp-output { display: block !important; }
}

/* ── LAB RESULTS ── */
.lab-report-card { background:var(--card); border-radius:var(--radius); box-shadow:var(--shadow); margin-bottom:14px; border-left:4px solid var(--accent); overflow:hidden; }
.lab-report-header { display:flex; align-items:center; justify-content:space-between; padding:12px 16px; cursor:pointer; gap:12px; background:#f9fafb; }
.lab-report-header:hover { background:#f0f4f8; }
.lab-report-title { font-size:13px; font-weight:700; color:var(--navy); display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.lab-report-meta { font-size:11px; color:var(--text2); display:flex; gap:12px; flex-wrap:wrap; }
.lab-report-body { display:none; padding:0 0 4px; }
.lab-report-body.open { display:block; }
.lab-result-table { width:100%; border-collapse:collapse; font-size:12px; }
.lab-result-table th { background:#f9fafb; padding:8px 14px; text-align:left; font-size:10px; text-transform:uppercase; letter-spacing:.5px; color:var(--text2); font-weight:700; border-bottom:1px solid var(--border); white-space:nowrap; }
.lab-result-table td { padding:8px 14px; border-bottom:1px solid #f3f4f6; }
.lab-result-table tr:last-child td { border-bottom:none; }
.lab-result-table tr:hover td { background:#fafafa; }
.lab-flag-H  { display:inline-block; padding:1px 7px; border-radius:10px; font-size:10px; font-weight:700; background:#fde8e8; color:var(--red-dark); }
.lab-flag-L  { display:inline-block; padding:1px 7px; border-radius:10px; font-size:10px; font-weight:700; background:#e3f5da; color:var(--green-dark); }
.lab-flag-HH { display:inline-block; padding:1px 7px; border-radius:10px; font-size:10px; font-weight:700; background:#7f1d1d; color:#fff; }
.lab-flag-LL { display:inline-block; padding:1px 7px; border-radius:10px; font-size:10px; font-weight:700; background:#1e3a5f; color:#fff; }
.lab-flag-none { display:inline-block; padding:1px 7px; border-radius:10px; font-size:10px; color:var(--gray); }
.lab-abnormal-count { background:#fde8e8; color:var(--red-dark); font-size:10px; font-weight:700; padding:2px 8px; border-radius:10px; }
.labs-empty { padding:32px 20px; text-align:center; color:var(--text2); font-size:13px; }
.labs-empty .labs-empty-icon { font-size:36px; margin-bottom:10px; }
.lab-patient-chip { font-size:11px; background:#d6eef6; color:#0d617e; padding:2px 8px; border-radius:8px; font-weight:600; cursor:pointer; }
.lab-patient-chip:hover { background:#b8dcea; }