:root {
  color-scheme: light;
  --bg: #f3f7fb;
  --bg-soft: #f8fafc;
  --sidebar: #ffffff;
  --surface: #ffffff;
  --surface-2: #f7fafc;
  --surface-3: #edf3f7;
  --line: rgba(24, 53, 79, 0.09);
  --line-strong: rgba(24, 53, 79, 0.16);
  --text: #142638;
  --muted: #5f7184;
  --muted-2: #8997a6;
  --navy: #07518b;
  --primary: #00aa96;
  --primary-2: #008f80;
  --primary-soft: rgba(0, 170, 150, 0.10);
  --blue: #267fc9;
  --blue-soft: rgba(38, 127, 201, 0.10);
  --orange: #c77a16;
  --orange-soft: rgba(214, 132, 28, 0.11);
  --danger: #d9485f;
  --danger-soft: rgba(217, 72, 95, 0.10);
  --success: #16875f;
  --shadow: 0 18px 45px rgba(38, 61, 83, 0.12);
  --radius: 16px;
  --radius-sm: 10px;
  --sidebar-width: 248px;
  --topbar-height: 72px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
::selection { color: #001c18; background: var(--primary-2); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #24354b; border: 3px solid transparent; border-radius: 20px; background-clip: padding-box; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.back-icon { transform: rotate(180deg); }
.icon-fill { fill: currentColor; stroke: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }
.text-primary { color: var(--primary-2); }
.text-danger { color: var(--danger); }
.text-orange { color: var(--orange); }
.nowrap { white-space: nowrap; }

/* Login */
.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(440px, .9fr) minmax(520px, 1.1fr);
  background: #06101c;
}
.login-panel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px clamp(36px, 6vw, 92px);
  background: #081321;
  z-index: 1;
}
.login-panel::after { content: ""; position: absolute; inset: 28px 0 28px auto; width: 1px; background: var(--line); }
.login-card { width: 100%; max-width: 440px; }
.login-logo { width: 250px; margin-bottom: 64px; }
.login-card h1 { margin: 0 0 10px; font-size: clamp(28px, 3vw, 38px); letter-spacing: -.045em; line-height: 1.12; }
.login-card > p { margin: 0 0 34px; color: var(--muted); line-height: 1.65; font-size: 15px; }
.login-form { display: grid; gap: 19px; }
.field { display: grid; gap: 8px; min-width: 0; }
.field label, .field-label { font-size: 12px; color: #b8c7d8; font-weight: 650; letter-spacing: .02em; }
.field-note { color: var(--muted-2); font-size: 11px; line-height: 1.45; }
.input-wrap { position: relative; }
.input-icon { position: absolute; left: 14px; top: 50%; translate: 0 -50%; width: 18px; height: 18px; color: var(--muted-2); pointer-events: none; }
.input, .select, .textarea {
  width: 100%; border: 1px solid var(--line-strong); background: #0b1828; color: var(--text); outline: 0;
  border-radius: 11px; transition: border-color .2s, box-shadow .2s, background .2s;
}
.input { height: 48px; padding: 0 14px; }
.input.has-icon { padding-left: 44px; }
.input.has-action { padding-right: 45px; }
.select { height: 44px; padding: 0 36px 0 13px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%238fa1b8' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.7'%3E%3Cpath d='m3 5 4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.textarea { min-height: 105px; padding: 12px 14px; resize: vertical; line-height: 1.55; }
.input:focus, .select:focus, .textarea:focus { border-color: rgba(0, 206, 182, .65); box-shadow: 0 0 0 3px rgba(0, 189, 169, .1); background: #0d1b2c; }
.input::placeholder, .textarea::placeholder { color: #516278; }
.input-action { position: absolute; right: 8px; top: 50%; translate: 0 -50%; width: 34px; height: 34px; border: 0; background: none; color: var(--muted); display: grid; place-items: center; cursor: pointer; border-radius: 8px; }
.input-action:hover { color: var(--text); background: rgba(255,255,255,.04); }
.form-line { display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 12px; }
.checkbox { display: inline-flex; align-items: center; gap: 9px; color: var(--muted); cursor: pointer; }
.checkbox input { appearance: none; width: 17px; height: 17px; margin: 0; border: 1px solid var(--line-strong); border-radius: 5px; background: #0b1828; }
.checkbox input:checked { border-color: var(--primary); background: var(--primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23021a18' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m2 6 2.5 2.5L10 3'/%3E%3C/svg%3E") center/12px no-repeat; }
.link-button { border: 0; padding: 0; background: none; color: var(--primary-2); cursor: pointer; font-weight: 600; }
.login-security { display: flex; align-items: center; gap: 9px; margin-top: 30px; color: var(--muted-2); font-size: 11px; }
.login-security .icon { width: 15px; }
.login-visual { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; padding: 58px; background: radial-gradient(circle at 58% 42%, rgba(0, 182, 161, .14), transparent 30%), radial-gradient(circle at 85% 15%, rgba(31, 111, 183, .16), transparent 24%), #050c15; }
.login-visual::before, .login-visual::after { content: ""; position: absolute; border: 1px solid rgba(0, 189, 169, .08); border-radius: 50%; }
.login-visual::before { width: 560px; height: 560px; right: -160px; top: -260px; }
.login-visual::after { width: 360px; height: 360px; left: -180px; bottom: -160px; }
.visual-content { position: relative; width: min(570px, 90%); }
.visual-mark { width: 112px; height: 88px; object-fit: contain; margin-bottom: 34px; filter: drop-shadow(0 12px 30px rgba(0,189,169,.16)); }
.visual-content h2 { max-width: 540px; margin: 0; font-size: clamp(34px, 4.4vw, 62px); line-height: 1.06; letter-spacing: -.055em; font-weight: 720; }
.visual-content h2 span { color: var(--primary-2); }
.visual-content > p { max-width: 530px; margin: 22px 0 45px; color: #92a9bd; line-height: 1.65; font-size: 16px; }
.visual-flow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; }
.visual-step { min-height: 116px; padding: 18px; border: 1px solid var(--line); background: rgba(11, 25, 41, .72); border-radius: 14px; backdrop-filter: blur(10px); }
.visual-step .step-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; margin-bottom: 15px; color: var(--primary-2); background: var(--primary-soft); }
.visual-step .step-icon .icon { width: 17px; }
.visual-step strong { display: block; font-size: 12px; margin-bottom: 5px; }
.visual-step span { color: var(--muted-2); font-size: 10px; line-height: 1.4; display: block; }

/* Generic buttons */
.btn { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 0 17px; border: 1px solid transparent; border-radius: 10px; font-size: 13px; font-weight: 680; cursor: pointer; transition: transform .15s, background .2s, border-color .2s, color .2s, opacity .2s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #021b18; box-shadow: 0 10px 25px rgba(0,189,169,.14); }
.btn-primary:hover { background: var(--primary-2); }
.btn-secondary { background: var(--surface-3); border-color: var(--line); color: #dfeaf5; }
.btn-secondary:hover { border-color: var(--line-strong); background: #182a40; }
.btn-ghost { background: transparent; border-color: var(--line-strong); color: #c0cddd; }
.btn-ghost:hover { border-color: rgba(0,189,169,.4); color: var(--text); background: var(--primary-soft); }
.btn-danger { background: var(--danger-soft); border-color: rgba(242,109,125,.22); color: #ff9ba7; }
.btn-block { width: 100%; }
.btn-lg { min-height: 49px; font-size: 14px; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 11px; border-radius: 8px; }
.icon-btn { width: 38px; height: 38px; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; border-radius: 10px; color: var(--muted); cursor: pointer; transition: .2s; }
.icon-btn:hover { color: var(--text); border-color: var(--line-strong); background: var(--surface-2); }
.icon-btn.active { background: var(--primary-soft); color: var(--primary-2); border-color: rgba(0,189,169,.25); }

/* App shell */
.app-shell { min-height: 100vh; }
.sidebar { position: fixed; z-index: 30; inset: 0 auto 0 0; width: var(--sidebar-width); display: flex; flex-direction: column; border-right: 1px solid var(--line); background: var(--sidebar); transition: translate .25s ease; }
.side-brand { height: var(--topbar-height); display: flex; align-items: center; padding: 0 24px; border-bottom: 1px solid var(--line); }
.side-brand img { width: 168px; }
.side-context { margin: 19px 15px 8px; padding: 12px; border: 1px solid var(--line); background: rgba(15,30,48,.55); border-radius: 11px; }
.context-label { color: var(--muted-2); font-size: 9px; text-transform: uppercase; letter-spacing: .12em; margin-bottom: 5px; }
.context-value { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 650; }
.context-value .status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px rgba(54,211,154,.08); }
.nav-group { padding: 13px 12px; }
.nav-label { margin: 6px 11px 10px; color: #4f6279; font-size: 9px; text-transform: uppercase; letter-spacing: .13em; font-weight: 700; }
.nav-list { display: grid; gap: 3px; }
.nav-item { position: relative; min-height: 43px; display: flex; align-items: center; gap: 12px; padding: 0 12px; border-radius: 10px; color: #8496ac; font-size: 12px; font-weight: 570; cursor: pointer; transition: .2s; }
.nav-item:hover { background: rgba(255,255,255,.025); color: #c8d4e2; }
.nav-item.active { background: var(--primary-soft); color: #d9fffa; }
.nav-item.active::before { content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 4px 4px 0; background: var(--primary-2); }
.nav-item.active .icon { color: var(--primary-2); }
.nav-item .icon { width: 18px; }
.nav-badge { margin-left: auto; min-width: 21px; height: 19px; display: grid; place-items: center; padding: 0 5px; border-radius: 6px; background: rgba(241,168,75,.12); color: var(--orange); font-size: 9px; font-weight: 700; }
.sidebar-spacer { flex: 1; }
.side-user { width: calc(100% - 24px); margin: 0 12px 14px; padding: 12px 9px; display: flex; align-items: center; gap: 10px; border: 0; border-top: 1px solid var(--line); background: transparent; color: inherit; text-align: left; cursor: pointer; }
.avatar { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; flex: none; background: linear-gradient(145deg, #0b7c7a, #0e527d); color: white; font-weight: 750; font-size: 11px; }
.avatar.round { border-radius: 50%; }
.avatar.sm { width: 29px; height: 29px; border-radius: 8px; font-size: 9px; }
.avatar.lg { width: 52px; height: 52px; border-radius: 14px; font-size: 15px; }
.side-user-info { min-width: 0; flex: 1; }
.side-user-info strong { display: block; font-size: 11px; margin-bottom: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user-info span { display: block; color: var(--muted-2); font-size: 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user > .icon { width: 15px; color: var(--muted-2); }
.topbar { position: fixed; z-index: 20; top: 0; left: var(--sidebar-width); right: 0; height: var(--topbar-height); display: flex; align-items: center; padding: 0 30px; border-bottom: 1px solid var(--line); background: rgba(5,11,20,.88); backdrop-filter: blur(18px); }
.mobile-menu { display: none; margin-right: 13px; }
.breadcrumb { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--muted-2); font-size: 11px; }
.breadcrumb strong { color: #ccd8e4; font-weight: 620; }
.breadcrumb .icon { width: 13px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.global-search { width: clamp(190px, 21vw, 290px); position: relative; }
.global-search .input { height: 38px; background: rgba(13,27,44,.8); font-size: 11px; border-color: var(--line); }
.global-search .input-icon { width: 16px; }
.notification-btn { position: relative; }
.notification-btn::after { content: ""; position: absolute; width: 6px; height: 6px; top: 7px; right: 8px; border-radius: 50%; background: var(--primary-2); box-shadow: 0 0 0 2px var(--surface); }
.main { min-height: 100vh; margin-left: var(--sidebar-width); padding-top: var(--topbar-height); }
.content { padding: 28px 30px 48px; max-width: 1620px; margin: 0 auto; }
.page-enter { animation: pageEnter .28s ease both; }
@keyframes pageEnter { from { opacity: 0; translate: 0 6px; } to { opacity: 1; translate: 0 0; } }
.mobile-overlay { display: none; }

/* Layout and cards */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 25px; }
.eyebrow { margin-bottom: 7px; color: var(--primary-2); font-size: 9px; font-weight: 750; letter-spacing: .14em; text-transform: uppercase; }
.page-head h1 { margin: 0; font-size: 26px; line-height: 1.2; letter-spacing: -.035em; font-weight: 720; }
.page-head p { margin: 8px 0 0; max-width: 670px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.head-actions { display: flex; align-items: center; gap: 10px; }
.card { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(0,0,0,.08); }
.card-head { min-height: 61px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 20px; border-bottom: 1px solid var(--line); }
.card-title { min-width: 0; }
.card-title h2, .card-title h3 { margin: 0; font-size: 13px; letter-spacing: -.01em; }
.card-title p { margin: 4px 0 0; color: var(--muted-2); font-size: 10px; }
.card-body { padding: 20px; }
.section-title { margin: 0; font-size: 14px; letter-spacing: -.015em; }
.section-subtitle { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.span-2 { grid-column: span 2; }

/* Dashboard */
.welcome-strip { position: relative; min-height: 146px; display: flex; align-items: center; justify-content: space-between; gap: 30px; padding: 25px 30px; margin-bottom: 18px; overflow: hidden; border: 1px solid rgba(0,189,169,.17); background: linear-gradient(105deg, #0c2130, #0b192a 62%, #0a1625); border-radius: var(--radius); }
.welcome-strip::before { content: ""; position: absolute; width: 330px; height: 330px; right: -140px; top: -200px; border: 1px solid rgba(0,189,169,.15); border-radius: 50%; }
.welcome-strip::after { content: ""; position: absolute; width: 140px; height: 140px; right: 65px; bottom: -110px; border: 25px solid rgba(0,189,169,.035); border-radius: 50%; }
.welcome-copy { position: relative; max-width: 740px; z-index: 1; }
.welcome-copy h2 { margin: 0 0 9px; font-size: 22px; letter-spacing: -.035em; }
.welcome-copy p { margin: 0; color: #95a9bd; max-width: 680px; font-size: 12px; line-height: 1.6; }
.welcome-action { position: relative; z-index: 1; display: flex; align-items: center; gap: 18px; }
.ai-orbit { width: 73px; height: 73px; display: grid; place-items: center; border: 1px solid rgba(0,189,169,.22); background: rgba(0,189,169,.07); border-radius: 50%; }
.ai-orbit img { width: 48px; filter: drop-shadow(0 6px 16px rgba(0,189,169,.2)); }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card { position: relative; padding: 18px; min-height: 119px; overflow: hidden; }
.stat-card::after { content: ""; position: absolute; right: -30px; bottom: -38px; width: 95px; height: 95px; border-radius: 50%; background: var(--accent-soft, var(--primary-soft)); }
.stat-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.stat-label { color: var(--muted); font-size: 10px; font-weight: 600; }
.stat-icon { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 9px; color: var(--accent, var(--primary-2)); background: var(--accent-soft, var(--primary-soft)); }
.stat-icon .icon { width: 16px; }
.stat-value { position: relative; z-index: 1; display: flex; align-items: baseline; gap: 8px; }
.stat-value strong { font-size: 25px; letter-spacing: -.04em; }
.stat-trend { color: var(--success); font-size: 9px; font-weight: 700; }
.stat-caption { position: relative; z-index: 1; margin-top: 4px; color: var(--muted-2); font-size: 9px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0,1.55fr) minmax(290px,.75fr); gap: 18px; }
.chart-area { padding: 18px 20px 12px; }
.chart-legend { display: flex; align-items: center; gap: 16px; color: var(--muted); font-size: 9px; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); }
.legend-dot.blue { background: var(--blue); }
.line-chart { width: 100%; height: 176px; overflow: visible; }
.chart-grid-line { stroke: rgba(154,174,201,.1); stroke-width: 1; }
.chart-label { fill: #586b82; font-size: 9px; }
.chart-line { fill: none; stroke: var(--primary-2); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.chart-area-fill { fill: url(#areaFill); }
.chart-point { fill: #07111f; stroke: var(--primary-2); stroke-width: 2; }
.demand-list { display: grid; gap: 16px; }
.demand-item-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 7px; font-size: 10px; }
.demand-item-head span { color: #c5d3e1; }
.demand-item-head strong { font-size: 10px; }
.progress { height: 5px; overflow: hidden; border-radius: 8px; background: #152438; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: var(--primary); }
.review-list { display: grid; }
.review-row { display: grid; grid-template-columns: minmax(0, 1.5fr) 110px 105px 30px; align-items: center; gap: 16px; min-height: 67px; padding: 10px 20px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background .2s; }
.review-row:last-child { border-bottom: 0; }
.review-row:hover { background: rgba(255,255,255,.018); }
.patient-cell { display: flex; align-items: center; gap: 11px; min-width: 0; }
.patient-cell-info { min-width: 0; }
.patient-cell-info strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; margin-bottom: 4px; }
.patient-cell-info span { display: block; color: var(--muted-2); font-size: 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table-meta { color: var(--muted); font-size: 9px; }
.risk-tag, .status-tag, .tag { display: inline-flex; align-items: center; justify-content: center; gap: 5px; width: fit-content; min-height: 24px; padding: 0 9px; border-radius: 7px; font-size: 9px; font-weight: 700; white-space: nowrap; }
.risk-tag.attention, .status-tag.pending { color: var(--orange); background: var(--orange-soft); }
.risk-tag.stable, .status-tag.done { color: var(--success); background: rgba(54,211,154,.1); }
.risk-tag.info, .status-tag.progress { color: #71b9ff; background: var(--blue-soft); }
.risk-tag.alert { color: #ff94a2; background: var(--danger-soft); }
.tag { color: #a9bbcd; background: #142337; font-weight: 550; }
.see-all { display: inline-flex; align-items: center; gap: 4px; color: var(--primary-2); font-size: 10px; font-weight: 650; cursor: pointer; }
.see-all .icon { width: 13px; }

/* Toolbar and table */
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.toolbar-search { position: relative; flex: 1; max-width: 380px; }
.toolbar-search .input { height: 42px; font-size: 11px; }
.filter-select { width: 180px; }
.segmented { display: inline-flex; padding: 4px; gap: 3px; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; }
.segment { height: 31px; padding: 0 12px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 10px; font-weight: 650; cursor: pointer; }
.segment.active { background: var(--surface-3); color: var(--text); }
.table-card { overflow: hidden; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { height: 43px; padding: 0 18px; text-align: left; color: var(--muted-2); background: rgba(11,25,41,.6); border-bottom: 1px solid var(--line); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.data-table td { height: 66px; padding: 9px 18px; border-bottom: 1px solid var(--line); font-size: 10px; color: #bfccdb; }
.data-table tbody tr { cursor: pointer; transition: background .18s; }
.data-table tbody tr:hover { background: rgba(255,255,255,.018); }
.data-table tbody tr:last-child td { border-bottom: 0; }
.table-id { color: var(--muted-2); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; }
.empty-state { min-height: 300px; display: grid; place-items: center; padding: 40px; text-align: center; }
.empty-icon { width: 55px; height: 55px; margin: 0 auto 15px; display: grid; place-items: center; color: var(--primary-2); background: var(--primary-soft); border-radius: 16px; }
.empty-state h3 { margin: 0 0 7px; font-size: 14px; }
.empty-state p { max-width: 380px; margin: 0 auto 18px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.pagination { min-height: 54px; padding: 0 18px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); color: var(--muted-2); font-size: 9px; }

/* Patient page */
.patient-profile { display: flex; align-items: center; gap: 17px; }
.patient-profile .avatar { width: 60px; height: 60px; border-radius: 16px; font-size: 16px; }
.patient-profile h1 { margin: 0 0 6px; font-size: 22px; }
.patient-id-line { display: flex; align-items: center; flex-wrap: wrap; gap: 7px 13px; color: var(--muted); font-size: 10px; }
.detail-grid { display: grid; grid-template-columns: minmax(250px,.62fr) minmax(0,1.38fr); gap: 18px; }
.info-list { display: grid; }
.info-row { min-height: 54px; display: grid; grid-template-columns: 135px 1fr; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.info-row:last-child { border-bottom: 0; }
.info-label { color: var(--muted-2); font-size: 9px; }
.info-value { color: #ced9e5; font-size: 10px; font-weight: 560; }
.tag-list { display: flex; flex-wrap: wrap; gap: 7px; }
.timeline { position: relative; display: grid; gap: 0; }
.timeline::before { content: ""; position: absolute; left: 12px; top: 13px; bottom: 15px; width: 1px; background: var(--line-strong); }
.timeline-item { position: relative; display: grid; grid-template-columns: 26px 1fr; gap: 13px; padding-bottom: 20px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot { position: relative; z-index: 1; width: 25px; height: 25px; display: grid; place-items: center; border: 1px solid rgba(0,189,169,.22); background: #0d2030; color: var(--primary-2); border-radius: 8px; }
.timeline-dot .icon { width: 12px; }
.timeline-content { padding-top: 2px; }
.timeline-content strong { display: block; font-size: 10px; margin-bottom: 5px; }
.timeline-content p { margin: 0 0 5px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.timeline-content time { color: var(--muted-2); font-size: 8px; }

/* Encounter detail and chat */
.encounter-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 17px 20px; margin-bottom: 16px; }
.encounter-person { display: flex; align-items: center; gap: 13px; }
.encounter-person h1 { margin: 0 0 4px; font-size: 15px; letter-spacing: -.02em; }
.encounter-person p { margin: 0; color: var(--muted); font-size: 9px; }
.encounter-actions { display: flex; align-items: center; gap: 9px; }
.flow-steps { display: flex; align-items: center; padding: 0 8px; }
.flow-step { display: flex; align-items: center; gap: 8px; color: var(--muted-2); font-size: 9px; font-weight: 620; }
.flow-step:not(:last-child)::after { content: ""; display: block; width: 36px; height: 1px; margin: 0 8px; background: var(--line-strong); }
.flow-step-number { width: 21px; height: 21px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; font-size: 8px; }
.flow-step.active { color: #dce8f4; }
.flow-step.active .flow-step-number { color: #031a17; border-color: var(--primary); background: var(--primary); }
.flow-step.done { color: var(--primary-2); }
.flow-step.done .flow-step-number { color: var(--primary-2); border-color: rgba(0,189,169,.3); background: var(--primary-soft); }
.recording-setup { max-width: 900px; min-height: 510px; margin: 0 auto; padding: 48px 54px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.recording-setup-icon { width: 60px; height: 60px; display: grid; place-items: center; margin-bottom: 22px; border: 1px solid rgba(0,143,128,.16); border-radius: 18px; color: var(--primary); background: linear-gradient(145deg,#e5f8f5,#f3fbfa); box-shadow: 0 12px 30px rgba(0,143,128,.10); }
.recording-setup-icon .icon { width: 27px; height: 27px; }
.recording-setup h1 { max-width: 650px; margin: 0; color: #183247; font-size: 27px; line-height: 1.2; letter-spacing: -.035em; }
.recording-setup-lead { max-width: 710px; margin: 14px 0 28px; color: #617487; font-size: 13px; line-height: 1.65; }
.recording-choice-grid { width: 100%; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.recording-choice { min-height: 132px; display: flex; align-items: center; gap: 15px; padding: 20px; text-align: left; font: inherit; border: 1px solid var(--line-strong); border-radius: 14px; color: #2d4558; background: #ffffff; cursor: pointer; transition: transform .18s,border-color .18s,box-shadow .18s,background .18s; }
.recording-choice:hover { transform: translateY(-2px); border-color: rgba(0,143,128,.34); box-shadow: 0 12px 28px rgba(31,58,81,.08); }
.recording-choice.featured { border-color: rgba(0,143,128,.23); background: linear-gradient(145deg,#effaf8,#ffffff 75%); }
.recording-choice-icon { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 12px; color: #087a70; background: #e4f6f3; }
.recording-choice-icon .icon { width: 20px; height: 20px; }
.recording-choice-copy { min-width: 0; display: block; }
.recording-choice-copy strong { display: block; margin-bottom: 7px; color: #20394d; font-size: 14px; }
.recording-choice-copy span { display: block; color: #718293; font-size: 11px; line-height: 1.5; }
.recording-choice-arrow { flex: none; margin-left: auto; color: #8a99a7; }
.recording-choice-arrow .icon { width: 18px; }
.recording-setup-note { max-width: 710px; display: flex; align-items: flex-start; gap: 9px; margin-top: 22px; color: #758696; font-size: 11px; line-height: 1.5; text-align: left; }
.recording-setup-note .icon { width: 16px; flex: none; margin-top: 1px; color: #16877d; }
.live-consultation-layout { display: grid; grid-template-columns: minmax(205px,.48fr) minmax(500px,1.22fr) minmax(270px,.62fr); gap: 18px; align-items: stretch; }
.live-consultation-layout > .card { min-height: calc(100vh - 195px); }
.live-transcript-card { display: flex; min-width: 0; flex-direction: column; overflow: hidden; }
.live-consultation-head { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 20px; border-bottom: 1px solid var(--line); }
.live-status { display: flex; align-items: center; gap: 6px; margin-top: 4px; color: #7b8c9b; font-size: 10px; }
.live-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #aab5bf; }
.live-status.active { color: #087a70; }
.live-status.active::before { background: var(--primary); box-shadow: 0 0 0 4px rgba(0,143,128,.10); animation: blink 1.4s infinite; }
.live-transcript-toolbar { min-height: 82px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 17px 22px; background: #fbfcfd; border-bottom: 1px solid var(--line); }
.live-transcript-toolbar .eyebrow { margin-bottom: 5px; }
.live-transcript-toolbar h2 { margin: 0; color: #1e374b; font-size: 16px; }
.live-processing { min-height: 28px; display: inline-flex; align-items: center; padding: 0 10px; border-radius: 999px; color: #517083; background: #edf4f7; font-size: 10px; white-space: nowrap; }
.live-transcript-content { flex: 1; min-height: 360px; max-height: calc(100vh - 365px); overflow-y: auto; padding: 22px; scroll-behavior: smooth; }
.live-transcript-segment { display: grid; grid-template-columns: 45px 1fr; gap: 12px; padding: 14px 0; border-bottom: 1px solid #edf1f4; }
.live-transcript-segment:first-child { padding-top: 0; }
.live-transcript-segment time { padding-top: 2px; color: #91a0ad; font-size: 9px; font-variant-numeric: tabular-nums; }
.live-transcript-segment p { margin: 0; color: #30495d; font-size: 13px; line-height: 1.65; }
.live-transcript-empty { min-height: 310px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: #8a99a6; }
.live-transcript-empty > .icon { width: 28px; height: 28px; margin-bottom: 14px; color: #75a9a3; }
.live-transcript-empty h3 { margin: 0 0 7px; color: #3a5265; font-size: 14px; }
.live-transcript-empty p { max-width: 360px; margin: 0; font-size: 11px; line-height: 1.55; }
.live-transcript-foot { min-height: 48px; display: flex; align-items: center; gap: 8px; padding: 0 20px; border-top: 1px solid var(--line); color: #7d8c99; background: #fbfcfd; font-size: 10px; }
.live-transcript-foot .icon { width: 14px; color: #47938b; }
.live-copilot-panel { overflow: hidden; }
.live-question-list { display: grid; gap: 9px; }
.live-question { display: grid; grid-template-columns: 24px 1fr; gap: 9px; padding: 11px; border: 1px solid #e1e9ee; border-radius: 10px; background: #f8fafb; }
.live-question > span { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 7px; color: #087a70; background: #e2f5f2; font-size: 9px; font-weight: 750; }
.live-question p { margin: 2px 0 0; color: #40586b; font-size: 11px; line-height: 1.45; }
.live-symptom-list { display: flex; flex-wrap: wrap; gap: 7px; }
.live-symptom { min-height: 28px; display: inline-flex; align-items: center; padding: 0 9px; border: 1px solid rgba(202,127,30,.16); border-radius: 8px; color: #79571e; background: #fff8e9; font-size: 10px; }
.live-empty-copy { margin: 0; color: #8795a2; font-size: 10px; line-height: 1.5; }
.live-privacy-note { display: flex; align-items: flex-start; gap: 8px; color: #718492; font-size: 10px; line-height: 1.5; }
.live-privacy-note .icon { width: 14px; flex: none; margin-top: 1px; color: #16877d; }
.interview-layout { display: grid; grid-template-columns: minmax(200px,.52fr) minmax(440px,1.2fr) minmax(240px,.63fr); gap: 14px; align-items: stretch; }
.interview-layout > .card { min-height: calc(100vh - 195px); }
.interview-side { padding: 18px; }
.side-section { padding: 15px 0; border-bottom: 1px solid var(--line); }
.side-section:first-child { padding-top: 0; }
.side-section:last-child { border-bottom: 0; }
.mini-title { display: flex; align-items: center; gap: 7px; margin-bottom: 12px; color: #cbd7e3; font-size: 10px; font-weight: 680; }
.mini-title .icon { width: 14px; color: var(--primary-2); }
.mini-info { display: grid; gap: 10px; }
.mini-info-row { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 9px; }
.mini-info-row strong { color: #cbd8e4; font-weight: 600; text-align: right; }
.completion-ring { display: flex; align-items: center; gap: 12px; }
.ring { --value: 68%; position: relative; width: 52px; height: 52px; flex: none; border-radius: 50%; background: conic-gradient(var(--primary) var(--value), #18283b 0); }
.ring::after { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--surface); }
.ring strong { position: absolute; z-index: 1; inset: 0; display: grid; place-items: center; font-size: 10px; }
.ring-copy strong { display: block; font-size: 10px; margin-bottom: 4px; }
.ring-copy span { color: var(--muted-2); font-size: 8px; line-height: 1.4; display: block; }
.chat-card { display: flex; flex-direction: column; overflow: hidden; }
.chat-head { height: 61px; flex: none; display: flex; align-items: center; justify-content: space-between; padding: 0 18px; border-bottom: 1px solid var(--line); }
.chat-head-actions { display: flex; align-items: center; gap: 8px; }
.finish-consultation-btn { min-height: 38px; }
.ai-identity { display: flex; align-items: center; gap: 10px; }
.ai-avatar { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid rgba(0,189,169,.2); background: var(--primary-soft); border-radius: 10px; }
.ai-avatar img { width: 25px; }
.ai-identity strong { display: block; font-size: 11px; margin-bottom: 3px; }
.online-label { display: flex; align-items: center; gap: 5px; color: var(--muted-2); font-size: 8px; }
.online-label::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--success); }
.chat-messages { flex: 1; min-height: 390px; max-height: calc(100vh - 345px); overflow-y: auto; padding: 22px; display: flex; flex-direction: column; gap: 18px; }
.message { display: flex; align-items: flex-end; gap: 9px; max-width: 86%; }
.message.user { align-self: flex-end; flex-direction: row-reverse; }
.message-avatar { width: 26px; height: 26px; display: grid; place-items: center; flex: none; border-radius: 8px; background: var(--surface-3); color: var(--muted); font-size: 8px; font-weight: 700; }
.message.ai .message-avatar { color: var(--primary-2); background: var(--primary-soft); }
.message-bubble { padding: 11px 13px; border: 1px solid var(--line); background: #111f31; border-radius: 12px 12px 12px 3px; color: #ccd7e4; font-size: 11px; line-height: 1.58; }
.message.user .message-bubble { color: #d9f8f4; border-color: rgba(0,189,169,.16); background: #0c3a3a; border-radius: 12px 12px 3px 12px; }
.message-time { display: block; margin-top: 6px; color: #62758a; font-size: 7px; }
.message.user .message-time { color: #70a6a2; text-align: right; }
.typing { display: inline-flex; gap: 4px; padding: 13px 15px; }
.typing i { width: 4px; height: 4px; border-radius: 50%; background: var(--muted); animation: typing 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; }.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes typing { 0%,60%,100% { opacity: .3; translate: 0 0; } 30% { opacity: 1; translate: 0 -3px; } }
.chat-suggestions { display: flex; gap: 7px; padding: 0 18px 10px; overflow-x: auto; }
.suggestion-label { flex: none; align-self: center; margin-right: 3px; color: var(--muted-2); font-size: 9px; font-weight: 650; }
.suggestion { flex: none; height: 30px; padding: 0 11px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--muted); font-size: 9px; cursor: pointer; }
.suggestion:hover { border-color: rgba(0,189,169,.28); color: var(--primary-2); background: var(--primary-soft); }
.composer { flex: none; display: flex; align-items: flex-end; gap: 9px; padding: 13px 16px 16px; border-top: 1px solid var(--line); background: rgba(7,16,28,.55); }
.composer-field { min-width: 0; min-height: 43px; max-height: 120px; flex: 1; padding: 12px 13px; resize: none; border: 1px solid var(--line-strong); border-radius: 11px; background: #0b1929; color: var(--text); outline: none; line-height: 1.45; font-size: 11px; }
.composer-field:focus { border-color: rgba(0,189,169,.45); }
.composer-btn { width: 43px; height: 43px; flex: none; }
.reply-record-btn { width: auto; min-width: 146px; padding-inline: 14px; }
.mic-label { display: inline; }
.session-record-btn.recording, .reply-record-btn.recording { color: #ffffff; border-color: var(--danger); background: var(--danger); }
.transcript-source { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; opacity: .8; }
.transcript-source .icon { width: 12px; height: 12px; }
.mic-btn.recording { color: white; border-color: var(--danger); background: var(--danger); animation: pulseRecord 1.5s infinite; }
@keyframes pulseRecord { 0%,100% { box-shadow: 0 0 0 0 rgba(242,109,125,.3); } 50% { box-shadow: 0 0 0 7px rgba(242,109,125,0); } }
.live-fields { display: grid; gap: 11px; }
.live-field { padding: 10px; border: 1px solid var(--line); background: rgba(15,30,48,.45); border-radius: 9px; }
.live-field label { display: block; margin-bottom: 5px; color: var(--muted-2); font-size: 8px; text-transform: uppercase; letter-spacing: .07em; }
.live-field p { margin: 0; color: #c8d5e2; font-size: 9px; line-height: 1.45; }
.live-field.pending p { color: var(--muted-2); font-style: italic; }
.signal-list { display: grid; gap: 8px; }
.signal { display: flex; align-items: flex-start; gap: 8px; padding: 9px; border-radius: 8px; color: #b9c8d6; background: var(--orange-soft); font-size: 8px; line-height: 1.4; }
.signal .icon { width: 13px; color: var(--orange); }
.recording-banner { display: flex; align-items: center; gap: 10px; min-height: 36px; margin: 0 16px 10px; padding: 0 12px; border-radius: 9px; background: var(--danger-soft); color: #ffc3ca; font-size: 9px; }
.recording-help { margin-left: auto; text-align: right; }
.recording-end-btn { min-height: 28px; display: inline-flex; align-items: center; gap: 6px; padding: 0 10px; border: 1px solid rgba(190,43,67,.24); border-radius: 7px; color: #a72c40; background: #ffffff; font-size: 9px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.recording-end-btn:hover { border-color: rgba(190,43,67,.42); background: #fff6f7; }
.recording-end-btn .icon { width: 11px; }
.recording-banner.processing { color: var(--muted); background: var(--surface-3); }
.recording-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--danger); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .35; } }
.consultation-end-card { display: flex; align-items: flex-start; gap: 15px; padding: 18px; border: 1px solid rgba(190,43,67,.15); border-radius: 12px; background: #fff7f8; }
.consultation-end-icon { width: 42px; height: 42px; flex: none; display: grid; place-items: center; border-radius: 11px; color: #b83249; background: #ffe5e9; }
.consultation-end-icon .icon { width: 19px; }
.consultation-end-card strong { display: block; margin: 2px 0 6px; color: #3b4650; font-size: 13px; }
.consultation-end-card p { margin: 0; color: #71808d; font-size: 11px; line-height: 1.55; }

/* Summary/review */
.summary-layout { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(270px,.6fr); gap: 18px; }
.summary-doc { padding: 24px; }
.summary-banner { display: flex; align-items: flex-start; gap: 11px; margin-bottom: 22px; padding: 12px 14px; border: 1px solid rgba(58,145,232,.18); border-radius: 10px; background: var(--blue-soft); color: #a7cbed; font-size: 9px; line-height: 1.5; }
.summary-banner .icon { width: 16px; color: var(--blue); }
.summary-section { padding: 19px 0; border-bottom: 1px solid var(--line); }
.summary-section:first-of-type { padding-top: 0; }
.summary-section:last-child { border-bottom: 0; }
.summary-section h3 { margin: 0 0 11px; display: flex; align-items: center; gap: 8px; color: #dbe6f0; font-size: 11px; }
.summary-section h3 .icon { width: 14px; color: var(--primary-2); }
.summary-section p { margin: 0; color: #b6c4d3; font-size: 11px; line-height: 1.7; }
.summary-columns { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; }
.structured-list { display: grid; gap: 8px; }
.structured-item { display: grid; grid-template-columns: 115px 1fr; gap: 14px; font-size: 10px; line-height: 1.45; }
.structured-item span { color: var(--muted-2); }
.structured-item strong { color: #c7d4e1; font-weight: 560; }
.review-panel { padding: 20px; }
.review-status { display: flex; gap: 10px; align-items: center; padding: 13px; margin-bottom: 18px; border-radius: 10px; background: var(--orange-soft); }
.review-status .icon { color: var(--orange); }
.review-status strong { display: block; font-size: 10px; margin-bottom: 3px; }
.review-status span { display: block; color: var(--muted); font-size: 8px; }
.review-checks { display: grid; gap: 12px; margin: 18px 0; }
.review-check { display: flex; align-items: flex-start; gap: 9px; color: #aebdcc; font-size: 9px; line-height: 1.45; }
.review-check input { margin-top: 1px; }
.cost-note { display: flex; gap: 8px; padding: 10px; margin-top: 12px; color: var(--muted); background: rgba(255,255,255,.025); border-radius: 8px; font-size: 8px; line-height: 1.45; }
.cost-note .icon { width: 13px; color: var(--primary-2); }

/* Analytics */
.analytics-grid { display: grid; grid-template-columns: repeat(12,minmax(0,1fr)); gap: 16px; }
.analytics-grid .wide { grid-column: span 8; }
.analytics-grid .narrow { grid-column: span 4; }
.analytics-grid .half { grid-column: span 6; }
.bar-chart { height: 225px; display: flex; align-items: flex-end; gap: clamp(8px,2vw,20px); padding-top: 20px; }
.bar-group { flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 9px; }
.bar-stack { width: min(32px,70%); height: calc(var(--height) * 1%); min-height: 4px; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, var(--primary-2), #087a81); position: relative; }
.bar-stack:hover::after { content: attr(data-value); position: absolute; left: 50%; bottom: calc(100% + 7px); translate: -50%; padding: 4px 7px; border-radius: 5px; background: #1c2d42; color: #dce8f2; font-size: 8px; }
.bar-label { color: var(--muted-2); font-size: 8px; }
.donut-wrap { min-height: 225px; display: flex; align-items: center; justify-content: center; gap: 25px; }
.donut { position: relative; width: 135px; height: 135px; border-radius: 50%; background: conic-gradient(var(--primary) 0 38%, var(--blue) 38% 63%, var(--orange) 63% 81%, #765de5 81% 93%, #33475e 93%); }
.donut::after { content: ""; position: absolute; inset: 24px; border-radius: 50%; background: var(--surface); }
.donut-center { position: absolute; z-index: 1; inset: 0; display: grid; place-content: center; text-align: center; }
.donut-center strong { font-size: 20px; }
.donut-center span { color: var(--muted-2); font-size: 8px; }
.donut-legend { display: grid; gap: 9px; }
.donut-legend .legend-item { font-size: 8px; }
.territory-list { display: grid; gap: 12px; }
.territory-row { display: grid; grid-template-columns: 115px 1fr 30px; align-items: center; gap: 10px; font-size: 9px; }
.territory-row span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.metric-highlight { display: grid; grid-template-columns: repeat(3,1fr); gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: var(--line); }
.metric-mini { padding: 15px; background: var(--surface); }
.metric-mini strong { display: block; margin-bottom: 4px; font-size: 18px; letter-spacing: -.03em; }
.metric-mini span { color: var(--muted-2); font-size: 8px; }

/* Config and audit */
.settings-layout { display: grid; grid-template-columns: 215px minmax(0,1fr); gap: 18px; }
.settings-menu { padding: 8px; height: fit-content; }
.settings-tab { width: 100%; min-height: 40px; display: flex; align-items: center; gap: 10px; padding: 0 11px; border: 0; background: none; color: var(--muted); border-radius: 8px; font-size: 10px; cursor: pointer; text-align: left; }
.settings-tab .icon { width: 15px; }
.settings-tab:hover { color: var(--text); background: rgba(255,255,255,.025); }
.settings-tab.active { color: var(--primary-2); background: var(--primary-soft); }
.settings-content { padding: 23px; }
.settings-section { padding-bottom: 25px; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.settings-section:last-child { padding-bottom: 0; margin-bottom: 0; border-bottom: 0; }
.setting-row { display: grid; grid-template-columns: minmax(200px,.8fr) minmax(280px,1.2fr); gap: 28px; padding: 14px 0; }
.setting-copy h3 { margin: 0 0 5px; font-size: 10px; }
.setting-copy p { margin: 0; color: var(--muted-2); font-size: 9px; line-height: 1.5; }
.integration-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 11px; }
.integration-grid-two { grid-template-columns: repeat(2,minmax(0,1fr)); }
.integration-card { padding: 14px; border: 1px solid var(--line); background: rgba(15,30,48,.45); border-radius: 11px; }
.integration-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.integration-icon { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 8px; color: var(--primary-2); background: var(--primary-soft); }
.integration-icon .icon { width: 14px; }
.connection { display: flex; align-items: center; gap: 5px; color: var(--success); font-size: 8px; }
.connection::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.integration-card strong { display: block; font-size: 10px; margin-bottom: 4px; }
.integration-card p { margin: 0; color: var(--muted-2); font-size: 8px; line-height: 1.45; }
.protocol-list { display: grid; gap: 10px; }
.protocol-card { display: grid; grid-template-columns: 1fr auto; gap: 15px; align-items: center; padding: 15px; border: 1px solid var(--line); background: rgba(15,30,48,.35); border-radius: 10px; }
.protocol-card h4 { margin: 0 0 5px; font-size: 10px; }
.protocol-card p { margin: 0; color: var(--muted-2); font-size: 8px; line-height: 1.45; }
.toggle { position: relative; width: 38px; height: 21px; display: inline-block; flex: none; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-ui { position: absolute; inset: 0; cursor: pointer; border-radius: 20px; background: #24354a; transition: .2s; }
.toggle-ui::before { content: ""; position: absolute; width: 15px; height: 15px; left: 3px; top: 3px; border-radius: 50%; background: #8798aa; transition: .2s; }
.toggle input:checked + .toggle-ui { background: var(--primary); }
.toggle input:checked + .toggle-ui::before { translate: 17px 0; background: #e7fffc; }
.audit-list { overflow: hidden; }
.audit-row { display: grid; grid-template-columns: 130px minmax(150px,.6fr) minmax(270px,1.3fr) 110px; gap: 20px; align-items: center; min-height: 63px; padding: 10px 20px; border-bottom: 1px solid var(--line); font-size: 9px; }
.audit-row.audit-head { min-height: 41px; color: var(--muted-2); background: rgba(11,25,41,.6); text-transform: uppercase; font-size: 8px; letter-spacing: .07em; font-weight: 700; }
.audit-row:last-child { border-bottom: 0; }
.audit-event { display: flex; align-items: center; gap: 9px; }
.audit-event .icon { width: 14px; color: var(--primary-2); }
.audit-date { color: var(--muted); }
.audit-detail { color: #b9c7d5; }

/* Modal, toasts and popover */
.modal-backdrop { position: fixed; z-index: 80; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(1,6,12,.74); backdrop-filter: blur(6px); animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(590px,100%); max-height: calc(100vh - 40px); overflow: auto; border: 1px solid var(--line-strong); background: #0a1625; border-radius: 17px; box-shadow: 0 30px 90px rgba(0,0,0,.5); animation: modalIn .25s ease; }
.modal.wide { width: min(760px,100%); }
@keyframes modalIn { from { opacity: 0; transform: scale(.98) translateY(8px); } }
.modal-head { min-height: 67px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 22px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 14px; }
.modal-head p { margin: 4px 0 0; color: var(--muted-2); font-size: 9px; }
.modal-body { padding: 22px; }
.modal-foot { min-height: 68px; display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 0 22px; border-top: 1px solid var(--line); }
.generation-loading { display:flex; align-items:center; justify-content:center; gap:16px; min-height:150px; text-align:left; }
.generation-loading > div { max-width:390px; }
.generation-loading strong { display:block; color:var(--ink); font-size:15px; }
.generation-loading p { margin:6px 0 0; color:var(--muted); font-size:12px; line-height:1.55; }
.generation-spinner { display:grid; place-items:center; width:42px; height:42px; border-radius:50%; background:var(--primary-soft); color:var(--primary); }
.generation-spinner .loader { width:20px; height:20px; border-width:2px; }
.live-question { width:100%; border:0; text-align:left; font:inherit; cursor:pointer; }
.live-question.used { opacity:.6; }
.account-reset { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-top:20px; padding:14px; border:1px solid rgba(190,43,67,.16); border-radius:10px; background:#fff7f8; }
.account-reset strong { display:block; color:#3b4650; font-size:12px; }
.account-reset span { display:block; margin-top:4px; color:#7b8b98; font-size:10px; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.option-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
.option-card { position: relative; min-height: 93px; padding: 14px; display: flex; flex-direction: column; align-items: flex-start; border: 1px solid var(--line); background: rgba(15,30,48,.4); border-radius: 10px; cursor: pointer; transition: .2s; }
.option-card input { position: absolute; opacity: 0; }
.option-card:has(input:checked) { border-color: rgba(0,189,169,.45); background: var(--primary-soft); }
.option-icon { width: 29px; height: 29px; display: grid; place-items: center; margin-bottom: 10px; color: var(--muted); background: var(--surface-3); border-radius: 8px; }
.option-card .option-icon { display: grid; place-items: center; line-height: 1; }
.option-card .option-icon .icon { display: block; margin: 0; }
.option-card:has(input:checked) .option-icon { color: var(--primary-2); background: rgba(0,189,169,.15); }
.option-icon .icon { width: 15px; }
.option-card strong { display: block; font-size: 9px; margin-bottom: 3px; }
.option-card span { color: var(--muted-2); font-size: 7px; line-height: 1.35; display: block; }
.transcript-review { min-height: 280px; line-height: 1.65; }
.toast-root { position: fixed; z-index: 120; right: 22px; bottom: 22px; width: min(360px,calc(100vw - 44px)); display: grid; gap: 10px; }
.toast { display: flex; align-items: flex-start; gap: 11px; padding: 13px 15px; border: 1px solid var(--line-strong); background: #112033; border-radius: 11px; box-shadow: var(--shadow); animation: toastIn .28s ease; }
@keyframes toastIn { from { opacity: 0; transform: translateX(18px); } }
.toast.out { opacity: 0; transform: translateX(15px); transition: .25s; }
.toast-icon { width: 27px; height: 27px; display: grid; place-items: center; flex: none; border-radius: 8px; color: var(--primary-2); background: var(--primary-soft); }
.toast.error .toast-icon { color: var(--danger); background: var(--danger-soft); }
.toast-icon .icon { width: 14px; }
.toast-copy strong { display: block; font-size: 10px; margin-bottom: 3px; }
.toast-copy span { color: var(--muted); font-size: 8px; line-height: 1.4; display: block; }
.popover { position: fixed; z-index: 60; width: 300px; padding: 8px; border: 1px solid var(--line-strong); background: #0d1b2b; border-radius: 12px; box-shadow: var(--shadow); }
.popover-head { padding: 9px 10px 12px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); font-size: 10px; font-weight: 700; }
.notification-item { display: flex; align-items: flex-start; gap: 9px; padding: 11px 9px; border-radius: 8px; cursor: pointer; }
.notification-item:hover { background: rgba(255,255,255,.025); }
.notification-item .status-dot { width: 6px; height: 6px; margin-top: 4px; border-radius: 50%; background: var(--primary); }
.notification-item strong { display: block; font-size: 9px; margin-bottom: 3px; }
.notification-item span { display: block; color: var(--muted-2); font-size: 8px; line-height: 1.4; }
.loader { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { rotate: 1turn; } }

/* Light visual system */
html, body { background: var(--bg); }
body { color: var(--text); font-size: 14px; }
::selection { color: #ffffff; background: var(--primary); }
::-webkit-scrollbar-thumb { background: #b8c5d1; border-color: transparent; }

.login-screen { background: #ffffff; }
.login-panel { background: #ffffff; }
.login-panel::after { background: rgba(24, 53, 79, .09); }
.login-card h1 { color: #11283b; }
.login-card > p { color: var(--muted); }
.login-visual {
  background:
    radial-gradient(circle at 62% 36%, rgba(0, 170, 150, .14), transparent 29%),
    radial-gradient(circle at 88% 14%, rgba(25, 98, 157, .12), transparent 25%),
    linear-gradient(145deg, #eff8f8, #f6f9fc 54%, #edf5fa);
}
.login-visual::before, .login-visual::after { border-color: rgba(0, 143, 128, .10); }
.visual-content h2 { color: #12304a; }
.visual-content h2 span { color: var(--primary-2); }
.visual-content > p { color: #5b7185; }
.visual-step { border-color: rgba(24, 53, 79, .10); background: rgba(255, 255, 255, .76); box-shadow: 0 12px 28px rgba(40, 74, 102, .07); }
.visual-step strong { color: #1f3447; font-size: 13px; }
.visual-step span { color: #728295; font-size: 11px; }

.field label, .field-label { color: #44586b; font-size: 13px; }
.field-note { color: var(--muted); font-size: 12px; }
.input, .select, .textarea { border-color: var(--line-strong); background-color: #ffffff; color: var(--text); }
.input:focus, .select:focus, .textarea:focus { border-color: rgba(0, 143, 128, .58); background: #ffffff; box-shadow: 0 0 0 3px rgba(0, 170, 150, .11); }
.input::placeholder, .textarea::placeholder { color: #9aa8b6; }
.input-action:hover { background: rgba(18, 48, 74, .05); }
.checkbox input { border-color: var(--line-strong); background: #ffffff; }
.checkbox input:checked { color: #ffffff; }
.login-security { color: #7d8d9c; font-size: 12px; }

.btn { min-height: 44px; padding-inline: 18px; font-size: 13px; border-radius: 10px; }
.btn-primary { color: #ffffff; background: var(--primary); box-shadow: 0 9px 22px rgba(0, 170, 150, .18); }
.btn-primary:hover { color: #ffffff; background: #008f80; }
.btn-secondary { color: #34495d; border-color: var(--line-strong); background: #f3f6f9; }
.btn-secondary:hover { color: #1c3448; border-color: rgba(24, 53, 79, .2); background: #e9eff4; }
.btn-ghost { color: #425a70; border-color: var(--line-strong); background: rgba(255, 255, 255, .48); }
.btn-ghost:hover { color: #0c685f; border-color: rgba(0, 143, 128, .32); background: var(--primary-soft); }
.btn-danger { color: #bd354d; }
.btn-lg { min-height: 50px; font-size: 14px; }
.btn-sm { min-height: 36px; padding-inline: 13px; font-size: 12px; }
.icon-btn { width: 40px; height: 40px; color: #65788a; border-color: var(--line); background: #ffffff; }
.icon-btn:hover { color: #20384c; border-color: var(--line-strong); background: #f3f7fa; }

.sidebar { border-color: var(--line); background: #ffffff; box-shadow: 8px 0 28px rgba(29, 55, 78, .035); }
.side-brand { border-color: var(--line); }
.side-context { margin: 20px 16px 10px; padding: 14px; border-color: var(--line); background: #f5f9fb; }
.context-label { color: #8998a6; font-size: 10px; }
.context-value { color: #23394c; font-size: 12px; }
.nav-group { padding: 15px 13px; }
.nav-label { margin: 7px 12px 11px; color: #97a4b1; font-size: 10px; }
.nav-item { min-height: 46px; padding-inline: 13px; color: #66798b; font-size: 13px; }
.nav-item:hover { color: #233a4e; background: #f5f8fa; }
.nav-item.active { color: #087a70; background: rgba(0, 170, 150, .09); }
.nav-item.active::before { background: var(--primary); }
.side-user { padding-block: 14px; color: var(--text); }
.side-user-info strong { color: #263c4e; font-size: 12px; }
.side-user-info span { color: #8796a5; font-size: 10px; }

.topbar { height: var(--topbar-height); padding-inline: 32px; border-color: var(--line); background: rgba(255, 255, 255, .91); box-shadow: 0 1px 12px rgba(31, 57, 79, .035); }
.breadcrumb { color: var(--muted); font-size: 12px; }
.breadcrumb strong { color: #2a4053; }
.global-search .input { height: 42px; color: var(--text); border-color: var(--line); background: #f5f8fb; font-size: 12px; }
.notification-btn::after { box-shadow: 0 0 0 2px #ffffff; }
.content { max-width: 1580px; padding: 32px 34px 56px; }

.page-head { margin-bottom: 28px; }
.eyebrow { margin-bottom: 8px; color: #008f80; font-size: 10px; }
.page-head h1 { color: #142a3e; font-size: 30px; }
.page-head p { margin-top: 9px; color: var(--muted); font-size: 14px; }
.card { border-color: var(--line); background: #ffffff; box-shadow: 0 7px 24px rgba(31, 58, 81, .055); }
.card-head { min-height: 68px; padding-inline: 22px; border-color: var(--line); }
.card-title h2, .card-title h3 { color: #1c3347; font-size: 15px; }
.card-title p { margin-top: 5px; color: #8493a2; font-size: 12px; }
.card-body { padding: 22px; }
.section-title { color: #1d3448; font-size: 17px; }
.section-subtitle { color: var(--muted); font-size: 13px; }
.grid-2, .grid-3 { gap: 20px; }

.welcome-strip { min-height: 154px; margin-bottom: 20px; padding: 28px 32px; border-color: rgba(0, 143, 128, .14); background: linear-gradient(110deg, #e8f8f5, #f3fafb 58%, #edf6fb); box-shadow: 0 9px 28px rgba(25, 88, 105, .055); }
.welcome-strip::before { border-color: rgba(0, 143, 128, .13); }
.welcome-strip::after { border-color: rgba(0, 143, 128, .045); }
.welcome-copy h2 { color: #173349; font-size: 24px; }
.welcome-copy p { color: #587084; font-size: 14px; }
.ai-orbit { border-color: rgba(0, 143, 128, .18); background: rgba(255, 255, 255, .65); }
.stats-grid { gap: 16px; margin-bottom: 20px; }
.stat-card { min-height: 132px; padding: 20px; }
.stat-label { color: #627487; font-size: 12px; }
.stat-icon { width: 36px; height: 36px; }
.stat-icon .icon { width: 18px; }
.stat-value strong { color: #152d41; font-size: 29px; }
.stat-trend { font-size: 10px; }
.stat-caption { margin-top: 5px; color: #8a99a8; font-size: 11px; }
.dashboard-grid { gap: 20px; }
.chart-area { padding: 22px 22px 15px; }
.chart-legend { color: #6f8091; font-size: 11px; }
.line-chart { display: block; width: 100%; height: auto; aspect-ratio: 700 / 190; overflow: visible; }
.chart-grid-line { stroke: rgba(38, 69, 94, .09); }
.chart-label { fill: #7b8c9c; font-size: 10px; }
.chart-point { fill: #ffffff; stroke: var(--primary); }
.demand-list { gap: 18px; }
.demand-item-head { margin-bottom: 8px; font-size: 12px; }
.demand-item-head span { color: #40576b; }
.demand-item-head strong { color: #263d51; font-size: 12px; }
.progress { height: 7px; background: #e9eff4; }
.review-row { min-height: 74px; padding: 12px 22px; }
.review-row:hover, .data-table tbody tr:hover { background: #f8fafc; }
.patient-cell-info strong { color: #233a4e; font-size: 13px; }
.patient-cell-info span { color: #7b8b9a; font-size: 11px; }
.table-meta { color: #748596; font-size: 11px; }
.risk-tag, .status-tag, .tag { min-height: 26px; padding-inline: 10px; font-size: 10px; }
.risk-tag.info, .status-tag.progress { color: #1d6ead; }
.risk-tag.alert { color: #c83b52; }
.tag { color: #4d6275; background: #edf3f7; }
.see-all { font-size: 12px; }

.toolbar { gap: 12px; margin-bottom: 20px; }
.toolbar-search .input { height: 44px; font-size: 12px; }
.segmented { padding: 5px; background: #ffffff; }
.segment { height: 34px; padding-inline: 14px; color: #6b7c8d; font-size: 11px; }
.segment.active { color: #155f58; background: #e8f5f3; }
.data-table th { height: 48px; padding-inline: 20px; color: #798a99; background: #f7f9fb; font-size: 10px; }
.data-table td { height: 72px; padding-inline: 20px; color: #40566a; font-size: 12px; }
.table-id { color: #768696; font-size: 10px; }
.empty-state h3 { color: #253c50; font-size: 16px; }
.empty-state p { font-size: 13px; }
.pagination { min-height: 58px; padding-inline: 20px; color: #7d8c9a; font-size: 11px; }

.patient-profile h1 { color: #172f43; font-size: 25px; }
.patient-id-line { color: #66798b; font-size: 12px; }
.info-row { min-height: 60px; grid-template-columns: 145px 1fr; }
.info-label { color: #81909e; font-size: 11px; }
.info-value { color: #30485c; font-size: 12px; }
.timeline-dot { border-color: rgba(0, 143, 128, .19); background: #eaf7f5; }
.timeline-content strong { color: #253d51; font-size: 12px; }
.timeline-content p { color: #627487; font-size: 12px; }
.timeline-content time { color: #8896a4; font-size: 10px; }

.encounter-header { padding: 19px 22px; margin-bottom: 20px; }
.encounter-person h1 { color: #1d3549; font-size: 17px; }
.encounter-person p { color: #718293; font-size: 11px; }
.flow-step { color: #8a98a6; font-size: 10px; }
.flow-step.active { color: #254054; }
.flow-step.active .flow-step-number { color: #ffffff; }
.interview-layout { gap: 18px; }
.interview-side { padding: 22px; }
.side-section { padding-block: 18px; }
.mini-title { margin-bottom: 14px; color: #2b4357; font-size: 12px; }
.mini-info { gap: 12px; }
.mini-info-row { color: #687a8b; font-size: 11px; }
.mini-info-row strong { color: #2e465a; }
.ring { width: 58px; height: 58px; background: conic-gradient(var(--primary) var(--value), #e7eef3 0); }
.ring strong { color: #1e394d; font-size: 11px; }
.ring-copy strong { color: #2b4357; font-size: 12px; }
.ring-copy span { color: #8795a3; font-size: 10px; }
.chat-head { height: 68px; padding-inline: 20px; }
.session-record-btn { min-height: 38px; }
.ai-identity strong { color: #263e52; font-size: 13px; }
.online-label { color: #81909f; font-size: 10px; }
.chat-messages { padding: 24px; gap: 20px; }
.message-avatar { width: 30px; height: 30px; font-size: 9px; }
.message-bubble { padding: 13px 15px; color: #344b5f; border-color: var(--line); background: #f4f7fa; font-size: 13px; line-height: 1.55; }
.message.user .message-bubble { color: #ffffff; border-color: rgba(0, 143, 128, .12); background: #0e8f82; }
.message-time { color: #8a99a7; font-size: 9px; }
.message.user .message-time { color: rgba(255, 255, 255, .72); }
.suggestion { height: 34px; padding-inline: 13px; color: #65788a; background: #ffffff; font-size: 10px; }
.composer { gap: 10px; padding: 15px 18px 18px; background: #fbfcfd; }
.composer-field { min-height: 46px; padding: 13px 14px; color: var(--text); border-color: var(--line-strong); background: #ffffff; font-size: 13px; }
.composer-btn { width: 46px; height: 46px; }
.reply-record-btn { width: auto; min-width: 156px; }
.live-fields { gap: 12px; }
.live-field { padding: 12px; background: #f7f9fb; }
.live-field label { color: #8695a4; font-size: 9px; }
.live-field p { color: #354d61; font-size: 11px; }
.signal { padding: 11px; color: #6c521f; font-size: 10px; }
.recording-banner { color: #ad3548; font-size: 11px; }

.summary-doc { padding: 28px; }
.summary-banner { padding: 14px 16px; color: #32668f; font-size: 11px; }
.summary-section { padding-block: 22px; }
.summary-section h3 { color: #263f53; font-size: 13px; }
.summary-section p { color: #42586b; font-size: 13px; }
.structured-item { grid-template-columns: 130px 1fr; font-size: 12px; }
.structured-item strong { color: #324b5f; }
.review-panel { padding: 24px; }
.review-status strong { color: #4f3b14; font-size: 12px; }
.review-status span { font-size: 10px; }
.review-check { color: #52677a; font-size: 11px; }
.cost-note { padding: 12px; color: #66798a; background: #f5f8fa; font-size: 10px; }

.bar-chart { height: 250px; padding: 26px 8px 0; background: repeating-linear-gradient(to top, rgba(40, 70, 94, .07) 0 1px, transparent 1px 25%); }
.bar-group { position: relative; z-index: 1; gap: 11px; }
.bar-stack { width: min(38px, 68%); background: linear-gradient(180deg, #18b6a4, #008f80); }
.bar-stack:hover::after { color: #ffffff; background: #244154; font-size: 10px; }
.bar-label { color: #718292; font-size: 10px; }
.donut-wrap { min-height: 250px; gap: 30px; }
.donut { width: 150px; height: 150px; }
.donut-center strong { color: #193247; font-size: 23px; }
.donut-center span { font-size: 10px; }
.donut-legend { gap: 11px; }
.donut-legend .legend-item { color: #5e7183; font-size: 10px; }
.territory-row { grid-template-columns: 130px 1fr 34px; font-size: 11px; }
.metric-mini { padding: 18px; }
.metric-mini strong { color: #1c3549; font-size: 21px; }
.metric-mini span { font-size: 10px; }

.settings-layout { gap: 20px; }
.settings-tab { min-height: 44px; padding-inline: 13px; font-size: 12px; }
.settings-tab:hover { background: #f5f8fa; }
.settings-content { padding: 28px; }
.setting-row { padding-block: 18px; }
.setting-copy h3 { color: #263e52; font-size: 12px; }
.setting-copy p { color: #758697; font-size: 11px; }
.integration-card { padding: 17px; background: #f8fafb; }
.connection { font-size: 10px; }
.integration-card strong { color: #2a4256; font-size: 12px; }
.integration-card p { font-size: 10px; }
.protocol-card { padding: 18px; background: #fafbfc; }
.protocol-card h4 { color: #294155; font-size: 12px; }
.protocol-card p { font-size: 10px; }
.toggle-ui { background: #ccd5dd; }
.toggle-ui::before { background: #ffffff; box-shadow: 0 1px 3px rgba(28, 54, 77, .16); }
.audit-row { min-height: 70px; padding-inline: 22px; color: #3f5669; font-size: 11px; }
.audit-row.audit-head { min-height: 46px; color: #7e8d9b; background: #f7f9fb; font-size: 9px; }
.audit-detail { color: #6e7f90; }

.modal-backdrop { background: rgba(20, 38, 54, .42); }
.modal { border-color: rgba(24, 53, 79, .13); background: #ffffff; box-shadow: 0 30px 80px rgba(24, 48, 68, .22); }
.modal-head { min-height: 72px; padding-inline: 24px; }
.modal-head h2 { color: #1f374b; font-size: 17px; }
.modal-head p { color: #7a8a99; font-size: 11px; }
.modal-body { padding: 24px; }
.modal-foot { min-height: 74px; padding-inline: 24px; }
.form-grid { gap: 18px; }
.option-card { min-height: 104px; padding: 16px; background: #f8fafb; }
.option-card strong { color: #2d4559; font-size: 11px; }
.option-card span { color: #7c8c9b; font-size: 9px; }
.toast { padding: 15px 17px; border-color: var(--line-strong); background: #ffffff; }
.toast-copy strong { color: #263e52; font-size: 12px; }
.toast-copy span { color: #6e8091; font-size: 10px; }
.popover { width: 320px; background: #ffffff; }
.popover-head { color: #263e52; font-size: 12px; }
.notification-item:hover { background: #f5f8fa; }
.notification-item strong { color: #30485c; font-size: 11px; }
.notification-item span { color: #7b8b9a; font-size: 10px; }

/* Responsive */
@media (max-width: 1180px) {
  :root { --sidebar-width: 218px; }
  .side-brand img { width: 155px; }
  .content { padding-inline: 22px; }
  .topbar { padding-inline: 22px; }
  .stats-grid { grid-template-columns: repeat(2,1fr); }
  .interview-layout { grid-template-columns: 220px minmax(420px,1fr); }
  .interview-layout > .card:last-child { grid-column: 1 / -1; min-height: auto; }
  .interview-layout > .card:last-child .interview-side { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; }
  .interview-layout > .card:last-child .side-section { border-bottom: 0; padding: 0; }
  .live-consultation-layout { grid-template-columns: 220px minmax(440px,1fr); }
  .live-consultation-layout > .card:last-child { grid-column: 1 / -1; min-height: auto; }
  .live-consultation-layout > .card:last-child .interview-side { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; }
  .live-consultation-layout > .card:last-child .side-section { border-bottom: 0; padding: 0; }
  .integration-grid { grid-template-columns: 1fr; }
}
@media (max-width: 920px) {
  .login-screen { grid-template-columns: 1fr; }
  .login-panel { min-height: 100vh; }
  .login-panel::after { display: none; }
  .login-visual { display: none; }
  .sidebar { translate: -100% 0; width: 248px; box-shadow: none; }
  .sidebar.open { translate: 0 0; box-shadow: 20px 0 60px rgba(37, 59, 78, .22); }
  .mobile-overlay { position: fixed; z-index: 25; inset: 0; display: block; background: rgba(0,0,0,.55); }
  .topbar { left: 0; padding-inline: 18px; }
  .mobile-menu { display: grid; }
  .main { margin-left: 0; }
  .content { padding: 22px 18px 42px; }
  .dashboard-grid, .detail-grid, .summary-layout { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .analytics-grid .wide, .analytics-grid .narrow, .analytics-grid .half { grid-column: span 12; }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-menu { display: flex; overflow-x: auto; }
  .settings-tab { width: auto; flex: none; padding-right: 17px; }
  .audit-row { grid-template-columns: 110px 150px minmax(220px,1fr); }
  .audit-row > :last-child { display: none; }
  .interview-layout { grid-template-columns: 1fr; }
  .interview-layout > .card { min-height: auto; }
  .live-consultation-layout { grid-template-columns: 1fr; }
  .live-consultation-layout > .card { min-height: auto; }
  .live-consultation-layout > .card:first-child { display: none; }
  .live-consultation-layout > .card:last-child { grid-column: auto; }
  .live-consultation-layout > .card:last-child .interview-side { display: block; }
  .live-consultation-layout > .card:last-child .side-section { padding-block: 18px; border-bottom: 1px solid var(--line); }
  .live-transcript-card { min-height: calc(100vh - 205px) !important; }
  .live-transcript-content { max-height: none; }
  .chat-card { min-height: calc(100vh - 205px) !important; }
  .chat-messages { max-height: none; }
  .interview-layout > .card:first-child { display: none; }
  .interview-layout > .card:last-child { grid-column: auto; }
}
@media (max-width: 680px) {
  .global-search { display: none; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .page-head .head-actions { width: 100%; }
  .page-head .head-actions .btn { flex: 1; }
  .welcome-strip { align-items: flex-start; padding: 22px; }
  .welcome-action .ai-orbit { display: none; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { min-height: 110px; padding: 14px; }
  .stat-value strong { font-size: 21px; }
  .review-row { grid-template-columns: 1fr 87px 28px; padding-inline: 15px; }
  .review-row > :nth-child(2) { display: none; }
  .toolbar { flex-wrap: wrap; }
  .toolbar-search { max-width: none; flex-basis: 100%; }
  .filter-select { flex: 1; }
  .table-card { overflow-x: auto; }
  .data-table { min-width: 720px; }
  .flow-steps { display: none; }
  .encounter-header { align-items: flex-start; }
  .encounter-actions .btn-secondary { display: none; }
  .session-record-btn { width: 38px; min-width: 38px; padding: 0; }
  .session-record-btn .record-label { display: none; }
  .finish-consultation-btn { width: 38px; min-width: 38px; padding: 0; }
  .finish-consultation-btn .finish-label { display: none; }
  .recording-help { display: none; }
  .modal-foot { flex-wrap: wrap; padding-block: 12px; }
  .recording-setup { min-height: auto; padding: 38px 28px; }
  .recording-choice-grid { grid-template-columns: 1fr; }
  .interview-layout > .card:last-child .interview-side { grid-template-columns: 1fr; }
  .summary-columns { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
  .option-grid { grid-template-columns: 1fr; }
  .setting-row { grid-template-columns: 1fr; gap: 12px; }
  .audit-list { overflow-x: auto; }
  .audit-row { min-width: 650px; }
  .metric-highlight { grid-template-columns: 1fr; }
  .visual-flow { grid-template-columns: 1fr; }
}
@media (max-width: 450px) {
  .login-panel { padding: 34px 22px; }
  .login-logo { width: 205px; margin-bottom: 48px; }
  .content { padding-inline: 13px; }
  .topbar { padding-inline: 13px; }
  .stats-grid { grid-template-columns: 1fr; }
  .welcome-action { display: none; }
  .card-head { padding-inline: 15px; }
  .recording-setup { padding: 32px 19px; }
  .recording-setup h1 { font-size: 23px; }
  .recording-choice { min-height: 118px; padding: 16px; }
  .chat-messages { padding: 16px; }
  .message { max-width: 95%; }
  .reply-record-btn { width: 46px; min-width: 46px; padding: 0; }
  .reply-record-btn .mic-label { display: none; }
  .patient-profile { align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
