/* ============================================================
   RAIOps Design System — futuristic healthcare operations
   ============================================================ */

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

button {
    font-family: inherit; -webkit-appearance: none; appearance: none;
    background: none; border: none; outline: none; padding: 0; margin: 0;
    color: inherit; cursor: pointer;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
[x-cloak] { display: none !important; }

@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.45; }
}
@keyframes glow {
    0%, 100% { box-shadow: 0 0 6px rgba(124, 58, 237, 0.45); }
    50%      { box-shadow: 0 0 14px rgba(124, 58, 237, 0.85); }
}
.spinner {
    display: inline-block; width: 20px; height: 20px;
    border: 2px solid var(--border); border-top-color: var(--primary);
    border-radius: 50%; animation: spin 0.65s linear infinite; will-change: transform; flex-shrink: 0;
}

/* Token aliases */
:root {
    --primary:        var(--gn-primary);
    --primary-dark:   var(--gn-primary-hover);
    --primary-light:  var(--gn-primary-light);
    --primary-xlight: #F5F3FF;
    --header-bg:     var(--gn-brand-deep);
    --header-height: 66px;
    --sidebar-width: 232px;

    --success:        var(--gn-success);
    --success-text:   var(--gn-success-text);
    --success-bg:     var(--gn-success-light);
    --success-bg-light: #ECFDF5;
    --success-border: #A7F3D0;
    --danger:        var(--gn-danger);
    --danger-text:   var(--gn-danger-text);
    --danger-bg:     var(--gn-danger-light);
    --danger-bg-light: #FEF2F2;
    --danger-border: #FECACA;
    --warning:        var(--gn-warning);
    --warning-text:   var(--gn-warning-text);
    --warning-bg:     var(--gn-warning-light);
    --warning-bg-light: #FFFBEB;
    --warning-border: #FDE68A;
    --info:        var(--gn-info);
    --info-text:   var(--gn-info-text);
    --info-bg:     var(--gn-info-light);
    --info-bg-light: #EFF6FF;
    --info-border: #BFDBFE;

    --text:           var(--gn-text-primary);
    --text-secondary: var(--gn-text-secondary);
    --text-muted:     var(--gn-text-muted);

    --bg-page:  #F4F6F9;
    --bg-card:  var(--gn-surface);
    --bg-hover: var(--gn-surface-alt);

    --border:      var(--gn-border);
    --border-dark: var(--gn-border-strong);

    --shadow-sm: var(--gn-shadow-sm);
    --shadow-md: var(--gn-shadow-md);

    --radius-sm:   var(--gn-radius);
    --radius:      var(--gn-radius-lg);
    --radius-lg:   var(--gn-radius-xl);
    --radius-pill: 20px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.5; -webkit-font-smoothing: antialiased;
    background: var(--bg-page); color: var(--text);
}

/* App chrome — slot content for <gn-app-shell> */
.brand {
    display: flex; align-items: center; gap: 12px;
    font-size: 14px; font-weight: 700; color: #fff;
}
.brand-mark {
    width: 32px; height: 32px; border-radius: 8px;
    background: linear-gradient(135deg, var(--az-primary-light, #731ee3) 0%, var(--az-secondary, #ae7def) 100%);
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; color: #fff; font-size: 14px; letter-spacing: 0.5px;
}
.brand-name { font-size: 14px; font-weight: 700; letter-spacing: 0.4px; }
.brand-divider {
    width: 1px; height: 22px; background: rgba(255,255,255,0.18);
}
.brand-tag {
    font-size: 11px; opacity: 0.62; font-weight: 500; letter-spacing: 0.4px;
}

.header-actions {
    display: flex; align-items: center; gap: 14px;
    font-size: 12px; color: rgba(255,255,255,0.6);
}
.header-user {
    font-size: 12px; color: rgba(255,255,255,0.88); font-weight: 500;
}
.header-logout {
    color: rgba(255,255,255,0.55); font-size: 12px; text-decoration: none;
    padding: 5px 12px; border: 1px solid rgba(255,255,255,0.18);
    border-radius: var(--radius-sm); transition: all 0.15s;
}
.header-logout:hover {
    color: #fff; border-color: rgba(255,255,255,0.4); text-decoration: none;
}
.system-pulse {
    display: inline-flex; align-items: center; gap: 6px;
    color: var(--az-secondary, #c4b5fd); font-size: 11px; letter-spacing: 0.5px;
    text-transform: uppercase; font-weight: 600;
}
.system-pulse .dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--az-success, #10b981); animation: pulse 1.6s ease-in-out infinite;
}
.powered-by {
    opacity: 0.45; font-size: 10px; letter-spacing: 0.5px;
}

/* Sidebar slot items — gn-app-shell only styles direct slotted children
   via ::slotted, so we wrap items in a <nav> and apply our own brand-band
   styling here in the light DOM. */
[slot="sidebar"] {
    display: flex; flex-direction: column; gap: 1px; padding: 0.75rem 0;
    background: transparent;
}
[slot="sidebar"] [data-group-label] {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 14px 20px 6px;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 10px; font-weight: 600;
    letter-spacing: 0.12em; text-transform: uppercase;
    color: rgba(255, 255, 255, 0.46);
}
[slot="sidebar"] [data-nav-item] {
    display: flex; align-items: center; gap: 10px;
    width: 100%; box-sizing: border-box;
    padding: 7px 20px 7px 20px;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 13px; font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    background: transparent;
    border: none; border-left: 2px solid transparent;
    text-decoration: none; cursor: pointer;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    transition: background var(--az-duration-fast, 100ms) var(--az-ease),
                color var(--az-duration-fast, 100ms) var(--az-ease);
}
[slot="sidebar"] [data-nav-item]:hover {
    background: rgba(174, 125, 239, 0.10);
    color: #fff;
    text-decoration: none;
}
[slot="sidebar"] [data-nav-item][aria-current="page"] {
    background: rgba(174, 125, 239, 0.14);
    border-left-color: var(--az-secondary, #ae7def);
    color: #fff; font-weight: 500;
}
[slot="sidebar"] [data-nav-item] svg,
[slot="sidebar"] [data-nav-item] i {
    width: 16px; height: 16px; flex-shrink: 0; opacity: 0.85;
}

/* Page header */
.page-header { margin-bottom: 18px; display: flex; justify-content: space-between; align-items: flex-end; }
.page-title { font-size: 22px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.page-subtitle { font-size: 13px; color: var(--text-secondary); }

/* Stat cards */
.stat-card-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 22px; }
.stat-card-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 22px; }
.stat-card-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.stat-card-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-bottom: 22px; }

.stat-card {
    background: white; border-radius: var(--radius-lg); padding: 18px;
    border: 1px solid var(--border); box-shadow: var(--shadow-sm);
    transition: box-shadow 0.15s, transform 0.15s;
}
.stat-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,0.07); transform: translateY(-1px); }
.stat-icon {
    width: 36px; height: 36px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 12px;
}
.stat-icon-purple { background: var(--primary-light); color: var(--primary); }
.stat-icon-yellow { background: var(--warning-bg); color: #D97706; }
.stat-icon-green  { background: var(--success-bg-light); color: var(--success); }
.stat-icon-red    { background: var(--danger-bg); color: var(--danger); }
.stat-icon-blue   { background: var(--info-bg); color: var(--info); }
.stat-value { font-size: 26px; font-weight: 700; line-height: 1; margin-bottom: 4px; color: var(--text); }
.stat-label { font-size: 11px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.stat-sublabel { font-size: 11px; color: var(--text-muted); margin-top: 6px; }

/* Sections */
.section-block { margin-bottom: 22px; }
.section-title {
    font-size: 14px; font-weight: 600; color: var(--text);
    margin-bottom: 12px; display: flex; align-items: center; gap: 8px;
}
.section-label {
    display: flex; align-items: center; gap: 8px;
    font-size: 12px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.5px; margin-bottom: 12px;
}
.card {
    background: white; border-radius: var(--radius-lg); padding: 20px;
    border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.card-bordered-purple { border-left: 3px solid var(--primary); }
.card-bordered-green  { border-left: 3px solid var(--success); }
.card-bordered-red    { border-left: 3px solid var(--danger); }
.card-bordered-blue   { border-left: 3px solid var(--info); }
.card-bordered-yellow { border-left: 3px solid var(--warning); }

/* Tables */
.table-wrapper {
    overflow-x: auto; border-radius: var(--radius-lg);
    border: 1px solid var(--border); box-shadow: var(--shadow-sm); background: white;
}
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.data-table thead { background: var(--bg-page); }
.data-table th {
    padding: 10px 14px; text-align: left; font-size: 10px; font-weight: 600;
    color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border); white-space: nowrap;
}
.data-table td {
    padding: 11px 14px; border-bottom: 1px solid var(--border);
    color: var(--text); vertical-align: middle;
}
.data-table tbody tr:hover { background: var(--bg-hover); }
.data-table tbody tr.clickable-row { cursor: pointer; }

/* Badges */
.badge {
    display: inline-block; padding: 2px 8px; border-radius: var(--radius-pill);
    font-size: 10px; font-weight: 600; text-transform: uppercase;
    white-space: nowrap; letter-spacing: 0.3px;
}
.badge-lg { padding: 3px 12px; font-size: 11px; font-weight: 700; }
.badge-approved, .badge-completed { background: var(--success-bg); color: var(--success-text); }
.badge-denied, .badge-rejected, .badge-failed { background: var(--danger-bg); color: var(--danger-text); }
.badge-pending, .badge-queued, .badge-awaiting_hitl { background: var(--warning-bg); color: var(--warning-text); }
.badge-in-progress, .badge-in_progress, .badge-running, .badge-coded, .badge-in_review { background: var(--primary-light); color: var(--primary); }
.badge-qa { background: var(--info-bg); color: var(--info-text); }
.badge-escalated { background: #fde68a; color: #92400e; }
.badge-needs_more_evidence { background: var(--warning-bg); color: var(--warning-text); }
.badge-urgent { background: var(--danger-bg); color: var(--danger-text); }
.badge-high { background: var(--warning-bg); color: var(--warning-text); }
.badge-standard, .badge-low { background: #F3F4F6; color: #374151; }
.badge-active { background: var(--success-bg); color: var(--success-text); }
.badge-MA { background: #ede9fe; color: #5b21b6; }
.badge-ACA { background: #dbeafe; color: #1e40af; }
.badge-Medicaid { background: #d1fae5; color: #065f46; }
.badge-low-seg { background: #f3f4f6; color: #374151; }
.badge-moderate-seg { background: #fef3c7; color: #92400e; }
.badge-high-seg { background: #fde68a; color: #b45309; }
.badge-complex-seg { background: #fee2e2; color: #991b1b; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 6px 14px; font-size: 11px; font-weight: 600;
    border-radius: var(--radius-sm); border: none; cursor: pointer;
    transition: all 0.15s; font-family: inherit; text-decoration: none;
    white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: white; box-shadow: 0 2px 6px rgba(109,40,217,0.3); }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }
.btn-secondary { background: white; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-secondary:hover:not(:disabled) { background: var(--primary-xlight); }
.btn-danger { background: var(--danger-bg); color: var(--danger-text); border: 1px solid var(--danger-border); }
.btn-danger:hover:not(:disabled) { background: #FDD; }
.btn-ghost { background: none; border: 1px solid var(--border-dark); color: var(--text-secondary); }
.btn-ghost:hover:not(:disabled) { background: var(--bg-hover); color: var(--text); }
.btn-sm { padding: 4px 10px; font-size: 11px; }
.btn-lg { padding: 10px 20px; font-size: 13px; border-radius: var(--radius); }

/* Tabs */
.tab-nav {
    display: flex; gap: 4px; margin-bottom: 24px;
    border-bottom: 2px solid var(--border); padding-bottom: 0;
}
.tab-btn {
    padding: 10px 18px; font-size: 13px; font-weight: 500;
    background: none; border: none; border-bottom: 2px solid transparent;
    margin-bottom: -2px; color: var(--text-secondary); cursor: pointer;
    transition: all 0.15s; font-family: inherit;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* Forms */
.form-group { margin-bottom: 12px; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.form-input, .form-select, .form-textarea {
    width: 100%; padding: 8px 12px; font-size: 13px;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: white; color: var(--text); outline: none;
    font-family: inherit; transition: border-color 0.15s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-light);
}
.form-range { width: 100%; accent-color: var(--primary); }
.form-actions { margin-top: 12px; display: flex; gap: 8px; }

/* Flash */
.flash-error {
    background: var(--danger-bg); color: var(--danger-text);
    padding: 10px 20px; text-align: center; font-size: 13px;
}

/* Modal */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.5);
    display: flex; align-items: center; justify-content: center;
    z-index: 200; padding: 16px;
}
.modal-content {
    background: white; border-radius: var(--radius-lg); box-shadow: var(--shadow-md);
    padding: 24px; max-width: 600px; width: 100%; max-height: 86vh; overflow-y: auto;
}
.modal-title { font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.modal-subtitle { font-size: 13px; color: var(--text-secondary); margin-bottom: 16px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

/* Login */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #1A0536 0%, #2F095B 50%, #4c1d95 100%); }
.login-card {
    background: white; border: 1px solid var(--border); border-radius: var(--radius-lg);
    box-shadow: 0 16px 56px rgba(0,0,0,0.3); padding: 36px; width: 100%; max-width: 420px;
}
.login-header { text-align: center; margin-bottom: 22px; }
.login-title { font-size: 22px; font-weight: 700; color: var(--text); }
.login-subtitle { color: var(--text-secondary); font-size: 13px; margin-top: 4px; }
.login-tagline { color: var(--text-muted); font-size: 11px; margin-top: 8px; letter-spacing: 0.5px; text-transform: uppercase; }
.login-error {
    background: var(--danger-bg); color: var(--danger-text);
    padding: 8px 12px; border-radius: var(--radius-sm); font-size: 12px;
    margin-bottom: 16px; text-align: center;
}
.login-form { display: flex; flex-direction: column; gap: 12px; }
.login-field { display: flex; flex-direction: column; gap: 4px; }
.login-label { font-size: 12px; font-weight: 600; color: var(--text); }
.login-input {
    padding: 10px 12px; font-size: 14px; border: 1px solid var(--border);
    border-radius: var(--radius-sm); background: white; color: var(--text);
    outline: none; font-family: inherit;
}
.login-input:focus { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-light); }
.login-submit-btn {
    padding: 10px; font-size: 14px; font-weight: 600;
    background: var(--primary); color: white; border: none;
    border-radius: var(--radius-sm); cursor: pointer;
    transition: background 0.15s; font-family: inherit;
}
.login-submit-btn:hover { background: var(--primary-dark); }
.login-divider { text-align: center; margin: 16px 0; position: relative; }
.login-divider::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--border); }
.login-divider-text { position: relative; background: white; padding: 0 12px; font-size: 11px; color: var(--text-muted); }
.login-azure-btn {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    width: 100%; padding: 10px; border: 1px solid var(--border);
    border-radius: var(--radius-sm); background: white; color: var(--text);
    font-size: 14px; font-weight: 600; text-decoration: none;
    transition: background 0.15s; cursor: pointer;
}
.login-azure-btn:hover { background: var(--bg-hover); text-decoration: none; }

/* RBAC */
.permission-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.checkbox-group { display: flex; flex-direction: column; gap: 8px; }
.checkbox-label {
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; color: var(--text); cursor: pointer;
}
.checkbox-label input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); }

/* AI Markdown */
.chat-md { font-family: 'Inter', sans-serif; font-size: 12px; line-height: 1.6; color: #374151; }
.chat-md h1, .chat-md h2, .chat-md h3 { font-size: 13px; font-weight: 700; margin: 12px 0 4px; color: #111827; }
.chat-md p { margin: 6px 0; }
.chat-md ul, .chat-md ol { margin: 6px 0; padding-left: 18px; }
.chat-md li { margin: 3px 0; }
.chat-md strong { font-weight: 700; color: #111827; }
.chat-md code { background: #f3f4f6; padding: 1px 4px; border-radius: 3px; font-family: 'SF Mono', monospace; font-size: 11px; }
.chat-md pre { background: #f3f4f6; padding: 10px; border-radius: 4px; overflow-x: auto; margin: 8px 0; }
.chat-md pre code { background: none; padding: 0; }
.chat-md blockquote { border-left: 3px solid var(--primary); padding-left: 10px; color: #6b7280; margin: 8px 0; }

/* Scrollbar */
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

/* ===== RAIOps-specific components ===== */

/* Hero metric panel */
.hero-panel {
    background: linear-gradient(135deg, #1A0536 0%, #3a0a73 100%);
    color: white; padding: 24px 28px; border-radius: var(--radius-lg);
    margin-bottom: 22px; position: relative; overflow: hidden;
}
.hero-panel::after {
    content: ''; position: absolute; top: -50%; right: -10%;
    width: 400px; height: 400px; border-radius: 50%;
    background: radial-gradient(circle, rgba(124,58,237,0.35) 0%, transparent 70%);
    pointer-events: none;
}
.hero-title { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.hero-sub { font-size: 12px; opacity: 0.7; }
.hero-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; margin-top: 18px; position: relative; z-index: 1; }
.hero-stat-value { font-size: 26px; font-weight: 700; }
.hero-stat-label { font-size: 11px; opacity: 0.7; text-transform: uppercase; letter-spacing: 0.5px; margin-top: 4px; }

/* Agent card */
.agent-card {
    background: white; border: 1px solid var(--border); border-radius: var(--radius-lg);
    padding: 18px; transition: all 0.2s; position: relative;
    display: flex; flex-direction: column; gap: 10px;
}
.agent-card:hover { box-shadow: 0 8px 24px rgba(124,58,237,0.18); transform: translateY(-2px); border-color: var(--primary-light); }
.agent-card-header { display: flex; align-items: flex-start; gap: 12px; }
.agent-icon {
    width: 42px; height: 42px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    color: white; flex-shrink: 0;
}
.agent-icon-purple { background: linear-gradient(135deg, #7c3aed 0%, #c084fc 100%); }
.agent-icon-blue   { background: linear-gradient(135deg, #2563eb 0%, #60a5fa 100%); }
.agent-icon-green  { background: linear-gradient(135deg, #059669 0%, #6ee7b7 100%); }
.agent-icon-red    { background: linear-gradient(135deg, #dc2626 0%, #fca5a5 100%); }
.agent-icon-yellow { background: linear-gradient(135deg, #d97706 0%, #fcd34d 100%); }
.agent-name { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.agent-tagline { font-size: 11px; color: var(--text-secondary); line-height: 1.4; }
.agent-status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); animation: pulse 1.4s ease-in-out infinite; }
.agent-meta-row { display: flex; gap: 14px; font-size: 11px; color: var(--text-muted); }
.agent-meta-row strong { color: var(--text); }

/* Orchestration graph */
.orch-graph {
    background: linear-gradient(180deg, #fdfcff 0%, #f5f3ff 100%);
    border: 1px solid var(--border); border-radius: var(--radius-lg);
    padding: 20px; height: 520px; position: relative; overflow: hidden;
}
.orch-graph-canvas { width: 100%; height: 100%; }

/* HITL queue */
.hitl-item {
    background: white; border: 1px solid var(--warning-border);
    border-left: 3px solid var(--warning); border-radius: var(--radius);
    padding: 12px 14px; margin-bottom: 10px;
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
}
.hitl-item-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* Knowledge section */
.kc-section {
    background: white; border: 1px solid var(--border); border-radius: var(--radius-lg);
    margin-bottom: 14px; overflow: hidden;
}
.kc-section-head {
    padding: 16px 20px; display: flex; align-items: center; justify-content: space-between;
    cursor: pointer; background: linear-gradient(90deg, #faf5ff 0%, white 30%);
    border-bottom: 1px solid transparent; transition: all 0.15s;
}
.kc-section-head:hover { background: linear-gradient(90deg, #f3e8ff 0%, #faf5ff 60%); }
.kc-section-head .kc-section-title { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 15px; color: var(--text); }
.kc-section-number {
    background: var(--primary); color: white; width: 28px; height: 28px;
    border-radius: 8px; display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 13px;
}
.kc-section-body { padding: 20px 24px; border-top: 1px solid var(--border); display: none; }
.kc-section.open .kc-section-body { display: block; }
.kc-subsection { margin: 20px 0; }
.kc-subsection h4 {
    font-size: 13px; font-weight: 700; color: var(--text);
    margin: 18px 0 8px; padding-bottom: 4px;
    border-bottom: 2px solid var(--primary-light);
}
.kc-subsection p { font-size: 13px; line-height: 1.7; color: var(--text); margin-bottom: 8px; }
.kc-subsection ul, .kc-subsection ol { padding-left: 22px; font-size: 13px; line-height: 1.7; }
.kc-callout {
    background: linear-gradient(90deg, #f5f3ff 0%, white 50%);
    border-left: 3px solid var(--primary); padding: 14px 18px;
    border-radius: var(--radius); margin: 14px 0; font-size: 13px;
}
.kc-callout-warning { background: linear-gradient(90deg, #fffbeb 0%, white 50%); border-left-color: var(--warning); }
.kc-callout-danger  { background: linear-gradient(90deg, #fef2f2 0%, white 50%); border-left-color: var(--danger); }
.kc-callout-info    { background: linear-gradient(90deg, #eff6ff 0%, white 50%); border-left-color: var(--info); }

/* Code chips for ICD/HCC */
.code-chip {
    display: inline-block; padding: 1px 6px; border-radius: 4px;
    font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 600;
    margin: 1px 2px; white-space: nowrap;
}
.code-chip-icd { background: #dbeafe; color: #1e40af; }
.code-chip-hcc { background: #ede9fe; color: #5b21b6; }
.code-chip-cpt { background: #d1fae5; color: #065f46; }

/* MEAT indicators */
.meat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.meat-cell {
    background: var(--bg-page); border-radius: var(--radius-sm); padding: 8px 10px;
    display: flex; flex-direction: column; gap: 2px;
    text-align: center;
}
.meat-cell-yes { background: var(--success-bg-light); color: var(--success-text); }
.meat-cell-no  { background: var(--danger-bg-light); color: var(--danger-text); opacity: 0.8; }
.meat-letter { font-size: 16px; font-weight: 700; }
.meat-label  { font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; }

/* Bars */
.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 12px; }
.bar-label { width: 180px; color: var(--text-secondary); flex-shrink: 0; }
.bar-track { flex: 1; height: 14px; background: var(--bg-page); border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, #7c3aed 0%, #c084fc 100%); border-radius: 4px; transition: width 0.35s; }
.bar-value { width: 56px; text-align: right; font-weight: 600; color: var(--text); }

/* Mini-bar (RAF distribution etc.) */
.minibar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 11px; }
.minibar-label { width: 60px; color: var(--text-muted); font-family: 'JetBrains Mono', monospace; flex-shrink: 0; }
.minibar-track { flex: 1; height: 10px; background: var(--bg-page); border-radius: 3px; overflow: hidden; }
.minibar-fill { height: 100%; background: var(--primary); }

/* Waterfall */
.waterfall-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--border); }
.waterfall-row:last-child { border-bottom: none; }
.waterfall-label { width: 220px; font-weight: 500; font-size: 13px; }
.waterfall-bar { flex: 1; height: 24px; background: var(--bg-page); border-radius: 4px; overflow: hidden; position: relative; }
.waterfall-fill { height: 100%; transition: width 0.5s; }
.waterfall-fill.pos { background: linear-gradient(90deg, #059669 0%, #10b981 100%); }
.waterfall-fill.neg { background: linear-gradient(90deg, #dc2626 0%, #f87171 100%); }
.waterfall-fill.neutral { background: linear-gradient(90deg, #6b7280 0%, #9ca3af 100%); }
.waterfall-value { width: 130px; text-align: right; font-weight: 600; font-size: 13px; }

/* Sankey-like stripes */
.flow-stripe {
    display: flex; align-items: center; gap: 0; height: 36px;
    border-radius: var(--radius-sm); overflow: hidden; margin-bottom: 12px;
    border: 1px solid var(--border);
}
.flow-segment {
    height: 100%; display: flex; align-items: center; justify-content: center;
    color: white; font-size: 11px; font-weight: 600; text-align: center;
    overflow: hidden; white-space: nowrap;
}

/* Timeline */
.timeline { position: relative; padding-left: 30px; margin-top: 10px; }
.timeline::before {
    content: ''; position: absolute; left: 10px; top: 0; bottom: 0;
    width: 2px; background: linear-gradient(180deg, var(--primary-light) 0%, var(--primary) 100%);
}
.timeline-event {
    position: relative; padding: 10px 0 14px 14px; margin-left: -8px;
}
.timeline-event::before {
    content: ''; position: absolute; left: -6px; top: 14px;
    width: 12px; height: 12px; border-radius: 50%;
    background: var(--primary); border: 3px solid white;
    box-shadow: 0 0 0 1px var(--primary);
}
.timeline-date { font-size: 11px; color: var(--text-muted); font-weight: 600; }
.timeline-title { font-size: 13px; font-weight: 600; color: var(--text); margin-top: 2px; }
.timeline-detail { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

/* Chart split-pane */
.split-pane { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; }

/* Heatmap cells */
.heat-cell {
    display: inline-block; width: 18px; height: 18px; border-radius: 2px; margin: 1px;
}

/* Footer attribution */
.attrib-row {
    margin-top: 14px; padding: 12px 18px;
    background: linear-gradient(90deg, #f5f3ff 0%, white 70%);
    border-radius: var(--radius); font-size: 11px; color: var(--text-muted);
    display: flex; gap: 16px; align-items: center;
}

/* Responsive */
@media (max-width: 1200px) {
    .stat-card-grid { grid-template-columns: repeat(3, 1fr); }
    .split-pane { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
    .stat-card-grid { grid-template-columns: repeat(2, 1fr); }
    .hero-stats { grid-template-columns: repeat(2, 1fr); }
}
