/* 一秒互联公司 www.yimiaonet.com */
:root {
  --navy-950: #0a1d30;
  --navy-900: #102b46;
  --navy-800: #173b5e;
  --blue-600: #1769aa;
  --blue-500: #2e83bd;
  --blue-100: #eaf4fb;
  --ink-900: #173044;
  --ink-700: #526679;
  --ink-500: #7b8d9c;
  --line: #dfe8ee;
  --canvas: #f4f7f9;
  --surface: #ffffff;
  --green: #198b70;
  --green-soft: #eaf7f1;
  --amber: #b87918;
  --amber-soft: #fff6df;
  --red: #bd4b4b;
  --red-soft: #fff0f0;
  --shadow: 0 14px 34px rgba(15, 44, 69, .08);
  --radius: 14px;
  --font-display: "DIN Alternate", "Bahnschrift", "Microsoft YaHei", sans-serif;
  --font-body: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body { background: var(--canvas); color: var(--ink-900); font-family: var(--font-body); font-size: 14px; line-height: 1.5; }
button, select, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
a.button { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.app-shell { display: flex; min-height: 100vh; }
.sidebar { width: 246px; flex: 0 0 246px; background: var(--navy-950); color: #c8d8e5; display: flex; flex-direction: column; padding: 22px 14px 16px; }
.brand-block { display: flex; align-items: center; gap: 11px; padding: 0 10px 22px; }
.brand-mark { width: 38px; height: 38px; border: 1px solid rgba(188, 224, 242, .55); display: grid; place-items: center; color: #e6f7ff; background: linear-gradient(145deg, #1d567d, #0d253e); font-weight: 900; font-size: 20px; box-shadow: 0 6px 18px rgba(0,0,0,.24); }
.brand-name { color: #f4fbff; font-size: 17px; font-weight: 800; letter-spacing: .04em; }
.brand-subtitle { color: #7fa0b5; font-size: 11px; margin-top: 2px; }
.environment-chip { border: 1px solid rgba(123, 169, 193, .28); color: #a7c5d5; padding: 8px 10px; border-radius: 8px; margin: 0 6px 21px; font-size: 11px; display: flex; align-items: center; gap: 7px; }
.status-dot { width: 7px; height: 7px; background: #55caa6; border-radius: 50%; box-shadow: 0 0 0 4px rgba(85,202,166,.13); }
.nav-groups { display: flex; flex-direction: column; gap: 4px; }
.nav-label { color: #66849a; font-size: 10px; letter-spacing: .16em; padding: 12px 10px 5px; text-transform: uppercase; }
.nav-item { position: relative; display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: transparent; color: #9db4c5; padding: 10px 11px; border-radius: 9px; text-align: left; transition: .18s ease; }
.nav-item svg { width: 17px; height: 17px; color: #7595aa; }
.nav-item span { flex: 1; }
.nav-item kbd { color: #66849a; font-size: 10px; background: transparent; border: 0; }
.nav-item:hover { background: rgba(114, 170, 204, .12); color: #effaff; }
.nav-item.active { background: #194569; color: #fff; box-shadow: inset 3px 0 0 #63c3dd; }
.nav-item.active svg, .nav-item.active kbd { color: #bde9f3; }
.sidebar-foot { margin-top: auto; padding: 15px 9px 2px; border-top: 1px solid rgba(182, 218, 234, .14); }
.privacy-note { display: flex; flex-direction: column; gap: 2px; margin-bottom: 14px; }
.privacy-note span { color: #c9e8ec; font-size: 11px; }
.privacy-note small { color: #6e8ba0; font-size: 10px; }
.sidebar-foot a { color: #8bb9c9; font-size: 11px; text-decoration: none; }
.sidebar-foot a:hover { color: #fff; }
.main-area { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.topbar { min-height: 68px; background: rgba(255,255,255,.92); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 0 32px; position: sticky; top: 0; z-index: 10; backdrop-filter: blur(12px); }
.breadcrumb { display: flex; align-items: center; gap: 11px; color: var(--ink-500); font-size: 13px; }
.breadcrumb b { font-weight: 400; color: #b0bec8; }
.breadcrumb strong { color: var(--ink-900); font-weight: 700; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.role-switch { display: flex; align-items: center; gap: 8px; color: var(--ink-500); font-size: 12px; }
.role-switch select { border: 1px solid var(--line); background: var(--surface); color: var(--ink-900); border-radius: 8px; padding: 7px 30px 7px 10px; outline: none; }
.icon-button { position: relative; border: 1px solid var(--line); width: 36px; height: 36px; border-radius: 9px; background: #fff; color: var(--ink-700); display: grid; place-items: center; transition: .18s ease; }
.icon-button:hover { color: var(--blue-600); border-color: #9bc4d8; background: var(--blue-100); }
.icon-button i { position: absolute; top: -5px; right: -5px; width: 17px; height: 17px; background: #d45c5c; border-radius: 50%; color: #fff; font-style: normal; font-size: 10px; display: grid; place-items: center; border: 2px solid #fff; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: #d8edf2; color: #1f6172; display: grid; place-items: center; font-weight: 800; }
.content-area { flex: 1; padding: 30px 32px 20px; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 24px; }
.eyebrow { color: var(--blue-600); font-size: 10px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.page-heading h1 { margin: 5px 0 5px; font-family: var(--font-display); font-size: 28px; letter-spacing: -.01em; line-height: 1.15; }
.page-heading p { margin: 0; color: var(--ink-700); max-width: 670px; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.button { border: 1px solid var(--line); border-radius: 8px; padding: 9px 14px; background: #fff; color: var(--ink-700); transition: .18s ease; }
.button:hover { border-color: #9dc2d3; transform: translateY(-1px); }
.button.primary { background: var(--navy-900); color: #fff; border-color: var(--navy-900); box-shadow: 0 8px 17px rgba(16,43,70,.18); }
.button.primary:hover { background: var(--blue-600); border-color: var(--blue-600); }
.button.ghost { background: transparent; }
.button.small { padding: 6px 10px; font-size: 12px; }
.portal-switcher { display: grid; grid-template-columns: minmax(180px,.8fr) repeat(3,minmax(170px,1fr)); margin: -6px 0 18px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; box-shadow: 0 8px 22px rgba(15,44,69,.045); }
.portal-switcher-intro { display: flex; flex-direction: column; justify-content: center; min-width: 0; padding: 13px 16px; background: #f4f8fa; }
.portal-switcher-intro span { color: var(--blue-600); font-size: 9px; font-weight: 800; letter-spacing: .14em; }
.portal-switcher-intro strong { margin-top: 3px; color: var(--ink-900); font-size: 13px; }
.portal-switcher-intro small { margin-top: 2px; color: var(--ink-500); font-size: 10px; }
.portal-link { position: relative; display: grid; grid-template-columns: 36px minmax(0,1fr) auto; align-items: center; gap: 10px; min-width: 0; min-height: 72px; padding: 12px 14px; border-left: 1px solid var(--line); color: var(--ink-700); background: #fff; text-decoration: none; transition: background .2s ease, color .2s ease; }
.portal-link:hover { color: var(--blue-600); background: #f4fafc; }
.portal-icon { width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; color: var(--blue-600); background: var(--blue-100); }
.portal-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.portal-copy { min-width: 0; }
.portal-copy strong, .portal-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.portal-copy strong { color: inherit; font-size: 12px; }
.portal-copy small { margin-top: 3px; color: var(--ink-500); font-size: 10px; }
.portal-arrow { color: var(--blue-600); font: 700 17px/1 var(--font-display); transition: transform .2s ease; }
.portal-link:hover .portal-arrow { transform: translate(2px,-2px); }
.portal-link.current { color: #fff; background: var(--navy-900); }
.portal-link.current .portal-icon { color: #fff; background: rgba(255,255,255,.12); }
.portal-link.current .portal-copy small { color: #bcd0da; }
.portal-state { display: inline-flex; align-items: center; gap: 4px; color: #c7e8ef; font-size: 9px; white-space: nowrap; }
.portal-state i { width: 6px; height: 6px; border-radius: 50%; background: #75d3bd; box-shadow: 0 0 0 4px rgba(117,211,189,.12); animation: portal-status 2.2s ease-in-out infinite; }
.workflow-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 15px 18px; margin-bottom: 18px; box-shadow: var(--shadow); }
.workflow-step { position: relative; border: 0; background: transparent; padding: 4px 8px; color: var(--ink-500); text-align: left; min-width: 0; }
.workflow-step:not(:last-child)::after { content: ""; position: absolute; right: -1px; top: 13px; width: calc(100% - 44px); height: 1px; background: var(--line); transform: translateX(50%); }
.workflow-step .step-line { display: flex; align-items: center; gap: 7px; position: relative; z-index: 1; }
.workflow-step .step-index { width: 24px; height: 24px; border-radius: 50%; border: 1px solid #cddbe3; background: #fff; display: grid; place-items: center; font-family: var(--font-display); font-size: 11px; color: var(--ink-500); }
.workflow-step strong { display: block; margin-top: 7px; font-size: 12px; color: var(--ink-700); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.workflow-step small { display: block; margin-top: 2px; color: var(--ink-500); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.workflow-step.done .step-index, .workflow-step.current .step-index { color: #fff; border-color: var(--blue-600); background: var(--blue-600); }
.workflow-step.done strong, .workflow-step.current strong { color: var(--blue-600); }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.metric-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 17px; box-shadow: 0 8px 22px rgba(15, 44, 69, .045); }
.metric-head { display: flex; align-items: center; justify-content: space-between; color: var(--ink-500); font-size: 12px; }
.metric-icon { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; color: var(--blue-600); background: var(--blue-100); }
.metric-icon svg { width: 16px; height: 16px; }
.metric-value { margin: 14px 0 3px; font: 700 28px/1 var(--font-display); color: var(--ink-900); }
.metric-caption { color: var(--ink-500); font-size: 11px; }
.metric-trend { font-size: 11px; margin-left: 4px; color: var(--green); }
.workspace-grid { display: grid; grid-template-columns: minmax(280px, .9fr) minmax(360px, 1.4fr) minmax(240px, .75fr); gap: 14px; align-items: stretch; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 22px rgba(15, 44, 69, .045); min-width: 0; }
.panel-head { padding: 17px 18px 13px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; border-bottom: 1px solid #edf1f3; }
.panel-title { margin: 0; font-size: 15px; font-weight: 800; }
.panel-subtitle { color: var(--ink-500); font-size: 11px; margin-top: 2px; }
.panel-body { padding: 15px 18px; }
.quiet-link { border: 0; background: transparent; color: var(--blue-600); font-size: 12px; padding: 0; }
.queue-list { display: flex; flex-direction: column; gap: 7px; }
.queue-row { width: 100%; text-align: left; border: 1px solid transparent; background: #f8fafb; border-radius: 9px; padding: 10px; display: flex; align-items: center; gap: 10px; transition: .18s ease; }
.queue-row:hover, .queue-row.selected { border-color: #a9d3df; background: #f0f9fb; }
.queue-avatar { width: 31px; height: 31px; border-radius: 8px; display: grid; place-items: center; font-weight: 800; color: #356276; background: #dceef3; flex: 0 0 auto; }
.queue-content { min-width: 0; flex: 1; }
.queue-title { display: flex; gap: 7px; align-items: center; font-weight: 700; color: var(--ink-900); }
.queue-meta { display: flex; gap: 8px; color: var(--ink-500); font-size: 11px; margin-top: 2px; }
.queue-badge { font-size: 10px; padding: 3px 6px; border-radius: 4px; white-space: nowrap; }
.queue-badge.wait { color: var(--amber); background: var(--amber-soft); }
.queue-badge.urgent { color: var(--red); background: var(--red-soft); }
.queue-badge.done { color: var(--green); background: var(--green-soft); }
.patient-context { min-height: 100%; }
.patient-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.patient-identify { display: flex; gap: 12px; align-items: center; }
.patient-photo { width: 52px; height: 52px; border-radius: 12px; background: #d4e7ed; color: #2d6571; display: grid; place-items: center; font-size: 20px; font-weight: 900; }
.patient-name { font-size: 19px; font-weight: 900; }
.patient-id { color: var(--ink-500); font-size: 11px; margin-top: 3px; }
.risk-tags { display: flex; gap: 6px; margin-top: 7px; flex-wrap: wrap; }
.tag { border-radius: 4px; font-size: 10px; padding: 3px 6px; color: #356276; background: #edf6f7; }
.tag.red { color: #ad5151; background: #fff0f0; }
.tag.amber { color: #9c6a1c; background: #fff6e2; }
.patient-status { color: var(--green); background: var(--green-soft); border-radius: 5px; padding: 5px 8px; font-size: 11px; white-space: nowrap; }
.patient-data-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin: 20px 0 14px; padding: 13px 0; border-top: 1px solid #edf1f3; border-bottom: 1px solid #edf1f3; }
.data-item span { display: block; color: var(--ink-500); font-size: 11px; margin-bottom: 3px; }
.data-item strong { color: var(--ink-900); font-size: 12px; }
.patient-tabs { display: flex; gap: 15px; border-bottom: 1px solid var(--line); }
.patient-tab { position: relative; border: 0; background: transparent; color: var(--ink-500); padding: 0 0 9px; font-size: 12px; }
.patient-tab.active { color: var(--blue-600); font-weight: 800; }
.patient-tab.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--blue-600); }
.patient-tab-content { min-height: 190px; padding-top: 13px; }
.timeline { display: flex; flex-direction: column; gap: 12px; }
.timeline-item { display: grid; grid-template-columns: 52px 9px 1fr; gap: 8px; align-items: start; }
.timeline-time { color: var(--ink-500); font: 11px var(--font-display); padding-top: 1px; }
.timeline-dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 4px; background: #9cc7d7; box-shadow: 0 0 0 4px #eaf5f8; }
.timeline-item:first-child .timeline-dot { background: var(--blue-600); box-shadow: 0 0 0 4px #e5f0f8; }
.timeline-copy strong { display: block; color: var(--ink-900); font-size: 12px; }
.timeline-copy span { display: block; color: var(--ink-500); font-size: 11px; margin-top: 2px; }
.safety-list { display: flex; flex-direction: column; gap: 10px; }
.safety-item { display: flex; gap: 9px; align-items: flex-start; padding: 10px; border-radius: 8px; background: #f8fafb; }
.safety-item .safety-sign { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; font-weight: 900; font-size: 11px; color: #fff; background: var(--amber); flex: 0 0 auto; }
.safety-item.critical .safety-sign { background: var(--red); }
.safety-item strong { display: block; font-size: 12px; }
.safety-item span { color: var(--ink-500); font-size: 11px; display: block; margin-top: 2px; }
.lower-grid { display: grid; grid-template-columns: minmax(0,1.15fr) minmax(0,.85fr); gap: 14px; margin-top: 14px; }
.report-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.report-table th { text-align: left; color: var(--ink-500); font-weight: 500; padding: 0 0 9px; border-bottom: 1px solid var(--line); }
.report-table td { padding: 11px 0; border-bottom: 1px solid #edf1f3; color: var(--ink-700); }
.report-table tr:last-child td { border-bottom: 0; }
.status-label { padding: 3px 6px; border-radius: 4px; font-size: 10px; }
.status-label.ready { background: var(--green-soft); color: var(--green); }
.status-label.review { background: var(--amber-soft); color: var(--amber); }
.progress-row { display: flex; justify-content: space-between; color: var(--ink-500); font-size: 11px; margin: 13px 0 5px; }
.progress-track { height: 7px; border-radius: 99px; background: #e9eff2; overflow: hidden; }
.progress-value { height: 100%; background: linear-gradient(90deg, #2f89b8, #69c2bf); border-radius: inherit; }
.quick-actions { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
.quick-action { border: 1px solid var(--line); background: #fff; padding: 11px 10px; border-radius: 8px; text-align: left; color: var(--ink-700); }
.quick-action strong { display: block; color: var(--ink-900); font-size: 12px; }
.quick-action span { display: block; font-size: 10px; color: var(--ink-500); margin-top: 3px; }
.quick-action:hover { border-color: #9ecbda; background: #f4fbfc; }
.main-footer { color: var(--ink-500); font-size: 11px; text-align: center; padding: 4px 22px 18px; }
.main-footer a { color: var(--blue-600); text-decoration: none; }
.empty-panel { border: 1px dashed #c9d9e1; background: rgba(255,255,255,.7); border-radius: var(--radius); padding: 32px; text-align: center; color: var(--ink-500); }
.data-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.search-box { display: flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 7px 10px; min-width: 220px; }
.search-box svg { color: var(--ink-500); width: 15px; height: 15px; }
.search-box input { border: 0; outline: 0; min-width: 0; color: var(--ink-900); width: 100%; }
.filter-row { display: flex; gap: 7px; flex-wrap: wrap; }
.filter-chip { border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px; color: var(--ink-700); background: #fff; font-size: 11px; }
.filter-chip.active { border-color: #8fc2d0; background: #edf8fa; color: #216a79; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; min-width: 720px; border-collapse: collapse; font-size: 12px; }
.data-table th { text-align: left; color: var(--ink-500); font-weight: 500; padding: 12px 16px; background: #f8fafb; border-bottom: 1px solid var(--line); white-space: nowrap; }
.data-table td { padding: 13px 16px; color: var(--ink-700); border-bottom: 1px solid #edf1f3; white-space: nowrap; }
.data-table tr:hover td { background: #fbfdfe; }
.table-title { color: var(--ink-900); font-weight: 800; }
.view-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); gap: 14px; }
.summary-stack { display: flex; flex-direction: column; gap: 14px; }
.summary-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 17px; box-shadow: 0 8px 22px rgba(15,44,69,.045); }
.summary-card h3 { margin: 0 0 4px; font-size: 14px; }
.summary-card p { margin: 0; color: var(--ink-500); font-size: 12px; }
.stat-line { display: flex; align-items: flex-end; justify-content: space-between; margin-top: 15px; }
.stat-line strong { font: 700 30px/1 var(--font-display); }
.stat-line span { color: var(--green); font-size: 11px; }
.modal-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(8, 27, 45, .46); display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-backdrop.open { display: flex; animation: fade-in .16s ease; }
.modal { width: min(560px, 100%); background: #fff; border-radius: 16px; box-shadow: 0 26px 70px rgba(6,27,44,.28); overflow: hidden; animation: modal-in .2s ease; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; padding: 20px 22px 15px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 4px 0 0; font-size: 20px; }
.modal-body { padding: 20px 22px; color: var(--ink-700); }
.modal-body p { margin: 0 0 12px; }
.modal-body .detail-list { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; margin: 15px 0; }
.modal-body .detail-box { padding: 11px; background: #f6f9fa; border-radius: 8px; }
.detail-box span { display: block; color: var(--ink-500); font-size: 11px; }
.detail-box strong { display: block; margin-top: 3px; color: var(--ink-900); font-size: 13px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 0 22px 20px; }
.toast { position: fixed; left: 50%; bottom: 26px; z-index: 50; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: var(--navy-900); color: #fff; border-radius: 8px; padding: 10px 15px; font-size: 12px; box-shadow: 0 12px 28px rgba(6,27,44,.2); transition: .2s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes portal-status { 0%, 100% { opacity: .65; } 50% { opacity: 1; } }
@media (max-width: 1180px) {
  .sidebar { width: 215px; flex-basis: 215px; }
  .content-area { padding: 24px 22px 18px; }
  .workspace-grid { grid-template-columns: minmax(260px,.8fr) minmax(360px,1.2fr); }
  .workspace-grid > .panel:last-child { grid-column: 1 / -1; }
  .safety-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .portal-switcher { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .portal-switcher-intro { grid-column: 1 / -1; border-bottom: 1px solid var(--line); }
  .portal-link:first-of-type { border-left: 0; }
}
@media (max-width: 860px) {
  .app-shell { display: block; }
  .sidebar { width: 100%; padding: 12px 14px 10px; }
  .brand-block { padding: 0 4px 10px; }
  .environment-chip { margin: 0 4px 10px; }
  .nav-groups { display: flex; flex-direction: row; overflow-x: auto; gap: 6px; padding-bottom: 4px; }
  .nav-label { display: none; }
  .nav-item { width: auto; min-width: max-content; padding: 8px 10px; }
  .nav-item kbd { display: none; }
  .sidebar-foot { display: none; }
  .topbar { position: static; padding: 13px 18px; align-items: flex-start; }
  .role-switch span { display: none; }
  .breadcrumb { font-size: 12px; }
  .content-area { padding: 20px 16px 14px; }
  .page-heading { align-items: flex-start; flex-direction: column; margin-bottom: 18px; }
  .page-heading h1 { font-size: 24px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workflow-strip { overflow-x: auto; grid-template-columns: repeat(7, minmax(118px, 1fr)); }
  .workspace-grid, .lower-grid, .view-grid { grid-template-columns: 1fr; }
  .workspace-grid > .panel:last-child { grid-column: auto; }
  .safety-list { grid-template-columns: 1fr; }
  .portal-switcher { margin-top: 0; }
}
@media (max-width: 520px) {
  .topbar-actions { gap: 7px; }
  .role-switch select { max-width: 140px; font-size: 11px; }
  .avatar { width: 32px; height: 32px; }
  .icon-button { width: 32px; height: 32px; }
  .metric-grid { gap: 9px; }
  .metric-card { padding: 13px; }
  .metric-value { font-size: 24px; }
  .patient-data-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .page-actions { width: 100%; }
  .page-actions .button { flex: 1; }
  .search-box { min-width: 100%; }
  .modal-body .detail-list { grid-template-columns: 1fr; }
  .portal-switcher { grid-template-columns: 1fr; }
  .portal-switcher-intro { grid-column: auto; }
  .portal-link { min-height: 66px; border-left: 0; border-top: 1px solid var(--line); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
