:root {
  color-scheme: light;
  --navy: #112841;
  --ink: #14263b;
  --muted: #566a80;
  --quiet: #65778c;
  --line: #dce4ed;
  --paper: #fff;
  --page: #f1f5fa;
  --blue: #205dc7;
  --blue-dark: #16489f;
  --blue-soft: #eaf2ff;
  --green: #087353;
  --red: #a63940;
  --radius: 13px;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--page);
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 300px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; color: inherit; }
button:disabled { cursor: not-allowed; opacity: .55; }
a { color: var(--blue); }
:focus-visible { outline: 2px solid #407deb; outline-offset: 3px; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
svg { width: 20px; height: 20px; flex: 0 0 auto; display: block; }
.loading { display: grid; min-height: 100vh; place-items: center; padding: 24px; color: var(--muted); }
.btn {
  border: 1px solid transparent; border-radius: 8px; min-height: 40px; display: inline-flex;
  align-items: center; justify-content: center; gap: 8px; padding: 8px 14px; font-size: .875rem;
  font-weight: 600; line-height: 1.35; white-space: nowrap; background: none; text-decoration: none;
}
.btn.primary { background: var(--blue); color: white; box-shadow: 0 2px 4px #205dc71f; }
.btn.primary:hover { background: var(--blue-dark); }
.btn.outline { border-color: var(--line); background: white; }
.btn.outline:hover, .btn.icon:hover { background: var(--page); }
.btn.icon { min-width: 36px; min-height: 36px; padding: 7px; color: var(--muted); }
.btn.link { color: var(--blue); padding: 4px 5px; min-height: 30px; font-weight: 600; }
.btn.link:hover { background: var(--blue-soft); }
.btn.danger { background: var(--red); color: white; }
.btn.danger:hover { background: #8e272d; }
.btn svg { width: 17px; height: 17px; }
.brand { display: flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; min-width: 0; }
.brand-icon {
  display: grid; place-items: center; width: 39px; height: 39px; border-radius: 11px;
  background: #3b76e9; color: white; flex: 0 0 auto; box-shadow: 0 2px 15px #3072f54d;
}
.brand-icon svg { width: 24px; height: 24px; }
.brand-title { display: block; font-weight: 650; font-size: .9375rem; white-space: nowrap; }
.brand-subtitle { display: block; font-size: .75rem; color: #b5c8dc; margin-top: 1px; }

.layout {
  --header-height: 72px;
  --header-offset: calc(var(--header-height) + 8px);
  min-height: 100vh; display: grid; grid-template-columns: 228px minmax(0, 1fr);
  grid-template-rows: var(--header-offset) 1fr;
}
.sidebar {
  position: sticky; top: var(--header-offset); height: calc(100dvh - var(--header-offset));
  color: #fff; background: var(--page); align-self: start;
  padding: 10px 8px 10px 10px; display: flex; flex-direction: column; overflow: hidden;
}
.sidebar-navigation {
  flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column;
  background: var(--navy); border-radius: 12px; padding: 10px;
}
.menu {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior-y: contain;
  display: grid; align-content: start; gap: 20px;
  scrollbar-width: thin; scrollbar-color: #45617f transparent; padding-block: 2px;
}
.menu-group { display: grid; gap: 3px; }
.menu-group h2 { margin: 0 10px 6px; color: #a9bcd0; font-size: .75rem; font-weight: 500; }
.menu a {
  color: #d6e2f1; min-height: 42px; padding: 8px 11px; border-radius: 8px; display: flex;
  align-items: center; gap: 11px; text-decoration: none; font-size: .875rem; white-space: nowrap;
}
.menu a svg { width: 18px; height: 18px; }
.menu a:hover { background: #203c5b; }
.menu a[aria-current="page"] { background: #294460; color: #f5d093; font-weight: 650; }
.menu a:focus-visible { outline-offset: -2px; }
.sidebar-footer { flex: 0 0 auto; padding: 14px 9px 2px; display: flex; align-items: center; gap: 8px; font-size: .75rem; color: #c0d1e2; }
.sidebar-footer svg { width: 15px; height: 15px; }
.scrim { display: none; }
.workspace { min-width: 0; }
.topbar-shell {
  grid-column: 1 / -1; position: sticky; top: 0; z-index: 7;
  padding-top: 8px; background: #f8fafc;
}
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  height: var(--header-height); padding: 0 22px;
  color: #e3edf8; border-bottom: 1px solid #263f58; background: var(--navy);
}
.topbar-start { display: flex; align-items: center; gap: 18px; min-width: 0; }
.topbar .brand { flex: 0 0 auto; }
.topbar .brand-title { color: #f1c982; font-size: 1rem; }
.topbar .crumb { border-left: 1px solid #36516a; padding-left: 16px; color: #b5c8dc; }
.topbar .crumb strong { color: #f5f8fd; overflow: hidden; text-overflow: ellipsis; }
.topbar .tools { flex-shrink: 0; }
.topbar :is(.btn.icon,.user-name,.user summary svg) { color: #dbe7f4; }
.topbar .btn.icon:hover { background: #213b55; }
.topbar .user { border-color: #36516a; }
.topbar .avatar { color: #f4ce90; background: #3e3b38; }
.topbar .user-pop { color: var(--ink); }
.crumb, .tools, .user { display: flex; align-items: center; gap: 10px; }
.crumb { color: var(--quiet); font-size: .875rem; white-space: nowrap; min-width: 0; }
.crumb a { color: inherit; text-decoration: none; }
.crumb strong { color: var(--ink); font-weight: 600; }
.topbar .menu-toggle { display: none; }
.user { position: relative; padding-left: 10px; border-left: 1px solid var(--line); }
.user summary { display: flex; align-items: center; gap: 8px; padding: 3px; list-style: none; cursor: pointer; font-size: .875rem; }
.user summary::-webkit-details-marker { display: none; }
.user summary svg { width: 14px; height: 14px; color: var(--quiet); }
.avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: #e6efff; color: #1956b7; font-size: .875rem; font-weight: 650; flex: 0 0 auto; }
.user-pop { position: absolute; z-index: 4; top: 45px; right: 0; background: white; border: 1px solid var(--line);
  box-shadow: 0 6px 20px #192f4421; padding: 5px; border-radius: 9px; }

main.content { padding: 27px 29px 40px; max-width: 1650px; margin: auto; }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.page-head h1 { font-size: clamp(1.5rem, 2.4vw, 2rem); letter-spacing: -.035em; font-weight: 760; line-height: 1.25; }
.page-head p { color: var(--muted); margin-top: 6px; font-size: .875rem; }
.page-head .actions, .actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.metric, .panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 1px 2px #18304506; }
.metric {
  display: flex; align-items: flex-start; flex-direction: column; gap: 8px; padding: 15px 16px;
  text-align: left; width: 100%;
}
.metric:hover { border-color: #9fbff4; box-shadow: 0 2px 9px #153f7d12; }
.metric-head { display: flex; align-items: center; gap: 10px; font-size: .875rem; color: var(--muted); font-weight: 600; }
.metric-icon { display: grid; place-items: center; width: 33px; height: 33px; border-radius: 9px; color: #205dc7; background: #eaf2ff; }
.metric-icon svg { width: 18px; height: 18px; }
.metric-icon.teal { color: #06786e; background: #e4f7f2; }
.metric-icon.violet { color: #6552b8; background: #f0ecfe; }
.metric-icon.amber { color: #965114; background: #fff1dc; }
.metric-number strong { font-size: 1.875rem; font-weight: 725; line-height: 1.12; font-variant-numeric: tabular-nums; }
.metric-number span { font-size: .8125rem; color: var(--muted); margin-left: 6px; }
.metric-foot { color: var(--quiet); font-size: .75rem; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 15px; margin-bottom: 16px; }
.panel { min-width: 0; }
.panel-head { padding: 16px 18px 12px; display: flex; justify-content: space-between; align-items: center; gap: 9px; }
.panel-head h2 { font-size: 1rem; font-weight: 720; line-height: 1.4; }
.panel-head p { color: var(--muted); font-size: .8125rem; margin-top: 4px; }
.legend { display: flex; gap: 12px; margin: 0 18px 2px; list-style: none; padding: 0; font-size: .75rem; color: var(--muted); flex-wrap: wrap; }
.legend li { display: flex; align-items: center; gap: 6px; }
.legend i { display: block; width: 8px; height: 8px; background: #3775e7; border-radius: 3px; }
.legend i.teal { background: #34b7aa; }
.chart { display: block; width: calc(100% - 24px); height: 180px; margin: 0 12px 12px; }
.queue { padding: 0 18px 8px; }
.queue-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid #edf1f5; min-height: 50px; }
.queue-item time { color: var(--blue); background: #edf3ff; padding: 5px 7px; border-radius: 6px; font-size: .8125rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.queue-description { min-width: 0; flex: 1; }
.queue-description strong { display: block; font-size: .875rem; font-weight: 650; overflow-wrap: anywhere; }
.queue-description span { display: block; color: var(--muted); font-size: .75rem; overflow-wrap: anywhere; }
.pill { display: inline-flex; align-items: center; border-radius: 24px; padding: 3px 8px; font-size: .75rem; line-height: 1.4; font-weight: 630; white-space: nowrap; background: #edf1f5; color: #4e5d6e; }
.pill.booked, .pill.new { background: #eaf1ff; color: #2359a8; }
.pill.arrived, .pill.converted { background: #e5f6ed; color: #086747; }
.pill.contacted { background: #fff1dc; color: #874500; }

.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .875rem; text-align: left; }
th, td { padding: 11px 14px; white-space: nowrap; }
th:first-child, td:first-child { padding-left: 18px; }
th:last-child, td:last-child { padding-right: 18px; }
th { background: #f5f8fc; color: #50637a; font-size: .8125rem; font-weight: 640; }
td { border-top: 1px solid #ebeff5; }
tr:hover td { background: #fbfcfe; }
td .btn.link:first-child { margin-left: -5px; }
.table-foot { color: var(--muted); font-size: .8125rem; padding: 11px 18px; border-top: 1px solid #ebeff5; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.table-foot .btn { padding: 4px 9px; min-height: 30px; }
.empty { padding: 27px 12px; text-align: center; color: var(--muted); font-size: .875rem; }

.filters { --filter-height: 2.5rem; padding: 15px 18px; display: flex; flex-wrap: wrap; align-items: end; gap: 12px 10px; border-bottom: 1px solid #ebeff5; }
.field { display: grid; gap: 5px; min-width: 0; color: var(--ink); font-size: .875rem; font-weight: 600; }
.field input, .field select, .field textarea {
  width: 100%; min-width: 0; border: 1px solid #c7d3e1; padding: 8px 10px; border-radius: 8px;
  background: white; color: var(--ink); font-weight: 400; min-height: 40px;
}
.field textarea { min-height: 86px; resize: vertical; }
.field input::placeholder { color: var(--quiet); }
.filters .field { min-width: 110px; grid-template-rows: auto var(--filter-height); }
.filters .search { width: min(100%, 255px); min-width: 185px; }
.filters .field:has(> input[type="date"]) { min-width: 126px; }
.filters .field > :is(input, select) {
  height: var(--filter-height); min-height: 0; align-self: stretch;
  line-height: 1.25; padding-block: 0;
}
.filters .field:has(> select) { position: relative; }
.filters .field > select {
  appearance: none; padding-right: 28px; white-space: nowrap; text-overflow: ellipsis;
}
.filters .field:has(> select)::after {
  content: ""; position: absolute; right: 12px; bottom: calc(var(--filter-height) / 2 - 2px);
  width: 6px; height: 6px; border: solid currentColor; border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg); pointer-events: none;
}
.filter-actions { display: flex; align-items: center; gap: 10px; }
.filters .btn { height: var(--filter-height); min-height: 0; }
.filters .care-filter-check { min-height: var(--filter-height); white-space: nowrap; }
.split-panels { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 15px; }
.result-group + .result-group { margin-top: 16px; }
.records { padding: 0 18px 8px; }
.record { padding: 14px 0; border-top: 1px solid #edf1f5; }
.record h3 { font-size: .9375rem; }
.record time { color: var(--muted); font-size: .8125rem; }
.record p { margin-top: 5px; color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; font-size: .875rem; }
.info-list { display: grid; grid-template-columns: max-content 1fr; gap: 8px 17px; margin: 0; font-size: .875rem; }
.info-list dt { color: var(--muted); }
.info-list dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }

dialog {
  width: min(560px, calc(100% - 28px)); max-height: calc(100dvh - 28px);
  border: 1px solid var(--line); padding: 0; border-radius: 15px; color: var(--ink);
  box-shadow: 0 24px 80px #1128414c;
}
dialog::backdrop { background: #0d20316e; }
.dialog-head, .dialog-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 19px; }
.dialog-head { border-bottom: 1px solid var(--line); }
.dialog-head h2 { font-size: 1.12rem; }
.dialog-foot { justify-content: end; border-top: 1px solid var(--line); }
.dialog-body { padding: 17px 19px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.form-grid .wide { grid-column: 1 / -1; }
.form-error { margin: 0 19px 13px; color: var(--red); font-size: .875rem; }
.dialog-body .records { padding: 12px 0 0; }
#toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 5; max-width: calc(100vw - 48px);
  background: #163450; color: white; padding: 12px 16px; border-radius: 9px; font-size: .875rem; box-shadow: 0 6px 24px #0c223c30;
}
#toast.error { background: #8e272d; }

.auth { display: grid; grid-template-columns: minmax(0, 1.03fr) minmax(0, 1fr); min-height: 100vh; background: white; }
.auth-art {
  background: radial-gradient(ellipse at 70% 57%, #244e7b, transparent 68%), #112841;
  min-height: 100%; overflow: hidden; position: relative; color: white; padding: clamp(28px, 6vw, 86px);
  display: flex; flex-direction: column; justify-content: space-between;
}
.auth-art::before {
  content: ""; position: absolute; inset: 0; opacity: .16; pointer-events: none;
  background-image: linear-gradient(#9fbbd740 1px, transparent 1px), linear-gradient(90deg, #9fbbd740 1px, transparent 1px);
  background-size: 46px 46px;
}
.auth-art .brand, .auth-copy { position: relative; }
.auth-art .brand-title { font-size: 1rem; }
.auth-copy { margin-block: auto; padding: 40px 0; }
.auth-copy h2 { font-size: clamp(2rem, 5.2vw, 4.8rem); line-height: 1.16; letter-spacing: -.045em; font-weight: 730; }
.auth-copy p { color: #d2e4f9; max-width: 24em; margin-top: 17px; }
.auth-mark {
  width: 150px; height: 150px; margin-top: 42px; border: 1px solid #8eb7e66b; border-radius: 38px; display: grid;
  place-items: center; background: linear-gradient(140deg, #7eaeeb25, #81a0d507);
  box-shadow: 0 0 0 12px #90b9f009, 0 0 0 27px #90b9f007;
}
.auth-mark svg { width: 72px; height: 72px; color: #b5d4ff; }
.auth-login { display: grid; place-items: center; padding: 32px 25px; }
.auth-card { width: min(100%, 362px); }
.auth-card h1 { font-size: 1.85rem; letter-spacing: -.03em; }
.auth-card > p { color: var(--muted); margin: 7px 0 23px; font-size: .875rem; }
.auth-card form { display: grid; gap: 16px; }
.auth-card .field input { min-height: 45px; }
.auth-card .btn.primary { min-height: 45px; }
.auth-card .form-error { margin: 0; }
.demo-entry { margin-top: 19px; width: 100%; }

@media (max-width: 1100px) {
  .layout { grid-template-columns: 200px minmax(0, 1fr); }
  main.content, .topbar { padding-left: 19px; padding-right: 19px; }
  .sidebar { padding-inline: 8px; }
  .metric { padding: 13px; }
  .metric-head { gap: 7px; }
}
@media (max-width: 880px) {
  .layout { display: block; --header-height: 64px; }
  .sidebar { position: fixed; z-index: 6; width: 228px; inset: var(--header-offset) auto 0 0; height: auto; display: none; }
  .layout.nav-open .sidebar { display: flex; }
  .layout.nav-open .scrim { display: block; position: fixed; inset: var(--header-offset) 0 0; z-index: 4; border: 0; background: #122a476e; }
  .topbar .menu-toggle { display: inline-flex; margin-left: -6px; }
  .topbar .crumb .segment { display: none; }
  .topbar-start { gap: 10px; }
}
@media (max-width: 620px) {
  .layout { --header-height: 56px; }
  .topbar { gap: 5px; }
  main.content { padding-top: 17px; }
  .topbar, main.content { padding-left: 14px; padding-right: 14px; }
  .topbar .crumb, .topbar .brand-subtitle, .topbar .brand-platform, .topbar .user-name { display: none; }
  .topbar .brand { gap: 6px; }
  .topbar .brand-icon { width: 29px; height: 29px; border-radius: 8px; }
  .topbar .brand-icon svg { width: 19px; height: 19px; }
  .topbar .brand-title { font-size: .86rem; }
  .topbar-start { gap: 4px; }
  .tools { gap: 3px; }
  .page-head { align-items: start; flex-direction: column; gap: 10px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .dashboard-grid, .split-panels, .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-art { padding: 24px; min-height: 0; }
  .auth-copy { display: none; }
  .auth-login { align-items: start; }
  th, td { padding-left: 10px; padding-right: 10px; }
}
@media (max-width: 380px) {
  .form-grid { grid-template-columns: 1fr; }
}
.detail-actions, .detail-history { margin-top: 14px; }
.detail-history h3 { font-size: .9375rem; margin-bottom: 7px; }
.profile-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; margin-bottom: 14px; }
.profile-head h3 { font-size: 1.25rem; }
.profile-head > span { color: var(--muted); font-size: .8125rem; }
.profile-timeline { list-style: none; margin: 0 0 0 5px; padding: 0 0 0 16px; border-left: 2px solid var(--line); }
.profile-timeline li { position: relative; padding: 4px 0 12px; }
.profile-timeline li::before { content: ""; position: absolute; top: 9px; left: -21px; width: 8px; height: 8px; border-radius: 50%; background: var(--blue); }
.profile-timeline time { color: var(--muted); font-size: .8125rem; margin-right: 10px; }
.profile-timeline p { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--muted); font-size: .875rem; margin-top: 3px; }
.info-list + .form-grid { margin-top: 15px; }

.hospital-picker {
  display: flex; align-items: center; gap: 6px; background: #f5f8fc; padding: 4px 7px 4px 9px;
  border: 1px solid var(--line); border-radius: 8px; color: var(--blue);
}
.hospital-picker svg { width: 16px; height: 16px; }
.hospital-picker select {
  border: 0; min-height: 27px; max-width: min(18vw, 168px); background: transparent;
  font-size: .875rem; font-weight: 650; color: var(--ink); padding-right: 2px;
}
.user-role { display: block; padding: 4px 7px; color: var(--muted); font-size: .75rem; white-space: nowrap; }
.action-tabs { display: flex; gap: 8px; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.check-field { display: flex; align-items: center; gap: 8px; color: var(--ink); font-size: .875rem; line-height: 1.45; }
.check-field input { accent-color: var(--blue); width: 16px; height: 16px; flex: 0 0 auto; margin: 0; }
.form-section { margin: 16px 0 0; padding: 12px; border: 1px solid var(--line); border-radius: 8px; min-width: 0; }
.form-section legend { padding: 0 5px; font-size: .875rem; font-weight: 650; }
.check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.help-text { color: var(--muted); margin-bottom: 10px; font-size: .875rem; overflow-wrap: anywhere; }
.sync-poll .help-text { margin-top: 5px; }
.import-actions, .import-status { margin-top: 12px; }
.import-status { font-size: .875rem; color: var(--muted); }
.import-status ul { color: var(--red); margin: 6px 0; padding-left: 21px; }
.no-hospital { padding: 28px; }
.no-hospital h1 { font-size: 1.25rem; }
.no-hospital p { margin: 7px 0 14px; }
@media (max-width: 620px) {
  .hospital-picker { padding-left: 6px; gap: 3px; }
  .hospital-picker select { max-width: min(32vw, 125px); }
  .hospital-picker svg { display: none; }
}
@media (max-width: 380px) {
  .check-grid { grid-template-columns: 1fr; }
}

.care-batch { display:flex; justify-content:space-between; align-items:center; gap:10px; flex-wrap:wrap; padding:10px 18px; color:var(--muted); font-size:.875rem; }
.care-filter-check { min-height:40px; padding-inline:5px; }
.registration-search { margin-bottom: 16px; }
.registration-quick { border-bottom: 0; }
.registration-quick .search { flex: 1 1 245px; }
.registration-quick .filter-actions { margin-left: auto; }
.registration-filters .registration-advanced { border-top: 1px solid var(--line); border-bottom: 0; background: #f9fbfe; }
.registration-advanced[hidden] { display: none; }
.registration-advanced .field { flex: 1 1 126px; }
.registration-panel .panel-head { flex-wrap: wrap; }
.registration-stats {
  display: flex; flex-wrap: wrap; gap: 8px 12px; padding: 0 18px 12px;
  font-size: .875rem; font-variant-numeric: tabular-nums;
}
.registration-tally {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 5px 13px;
  padding: 7px 11px; border-radius: 8px; background: #f2f6fb; color: var(--muted);
}
.registration-tally > span:first-child { color: var(--ink); font-weight: 650; }
.registration-tally strong { color: var(--blue); }
.registration-batch { border-top: 1px solid #ebeff5; }
.registration-grid { max-height: min(58vh, 600px); overflow: auto; }
.registration-grid th { position: sticky; top: 0; z-index: 2; }
.registration-grid tbody td { background: white; }
.registration-grid tr.registration-arrived td { background: #f1faf5; }
.registration-grid tr.registration-below-target td { background: #fff7e9; }
.registration-grid tr.registration-archived td { background: #f7f9fc; }
.registration-grid tr:hover td { box-shadow: inset 0 0 0 100vmax #205dc706; }
.registration-grid td, .registration-grid th { padding: 9px 11px; }
.registration-grid td:first-child, .registration-grid th:first-child { padding-left: 18px; }
.registration-grid .registration-name .btn { max-width: 142px; display: inline-block; overflow: hidden; text-overflow: ellipsis; text-align: left; }
.registration-grid .registration-actions { position: sticky; right: 0; z-index: 1; box-shadow: -1px 0 var(--line); }
.registration-grid th.registration-actions { z-index: 3; }
.registration-actions .muted-action { color: var(--muted); }
.registration-summary { display: block; max-width: 184px; overflow: hidden; text-overflow: ellipsis; }
.registration-jump input { width: 68px; min-height: 30px; border: 1px solid var(--line); border-radius: 7px; padding: 3px 6px; }
@media (max-width: 620px) {
  .registration-quick .search { flex-basis: 100%; }
  .registration-quick .filter-actions { margin-left: 0; }
  .registration-grid .registration-actions { position: static; }
  .registration-grid th.registration-actions { position: sticky; }
}
.care-duplicate .care-duplicates-result { margin-top:5px; color:var(--muted); font-size:.8125rem; }
.care-duplicate ul { margin:4px 0; padding-left:20px; }
.care-card { border:2px solid #dce7f7; border-top:7px solid var(--blue); border-radius:10px; padding:20px; }
.care-card h3 { font-size:1.65rem; margin-bottom:14px; }
.care-card .info-list { padding-top:12px; border-top:1px solid var(--line); }
.care-card p { margin-bottom:5px; }
.care-card .care-card-note { border-top:1px solid var(--line); padding-top:10px; margin-top:14px; color:var(--muted); white-space:pre-wrap; }
.care-card-compact { border-top-color:#0f766e; background:#f1f9f7; }
.care-card-notice { border-top-color:#a23c3c; background:#fff8f5; }
.care-card-ticket { border-top-color:#8054b4; border-style:dashed; background:#fbf8ff; }
.circle-public { max-width:1120px !important; }
.circle-list { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,250px),1fr)); gap:16px; margin-top:16px; }
.circle-item { padding:18px; display:grid; justify-items:start; gap:8px; }
.circle-item h2 { font-size:1.1rem; }
.circle-item p,.circle-item small { color:var(--muted); }
.circle-article img { display:block; max-width:100%; max-height:240px; margin:0 auto 12px; object-fit:contain; }
.circle-copy { white-space:pre-wrap; overflow-wrap:anywhere; margin-bottom:16px; }
.holiday-banner { display:flex; justify-content:space-between; overflow:hidden; }
.holiday-banner-image { object-fit:cover; }
.holiday-red { background:#fff4ee; }
.holiday-green { background:#edf9f3; }
.holiday-blue { background:#eef5ff; }
@media print {
  body:has(.care-card) #app, body:has(.care-card) #toast, body:has(.care-card) .dialog-head,
  body:has(.care-card) .dialog-foot, body:has(.care-card) .dialog-body > :not(.care-card) { display:none !important; }
  body:has(.care-card) dialog { position:static; margin:0; width:100%; max-width:none; box-shadow:none; border:0; }
  body:has(.care-card) dialog::backdrop { background:transparent; }
}

.dashboard-legend { margin:12px 18px 5px; }
.legend i.amber { background:#ba7824; }
.dashboard-detail { border-top:1px solid var(--line); }
.dashboard-detail summary { cursor:pointer; padding:12px 18px; color:var(--blue); font-size:.875rem; }
.dashboard-breakdown,.dashboard-actions { margin-block:16px; }

.patient-search { display:flex; align-items:end; gap:8px; flex-wrap:wrap; }
.patient-search .field { flex:1 1 180px; }
.slot-availability { border:1px solid var(--line); border-radius:8px; padding:12px; color:var(--muted); font-size:.875rem; }
.slot-availability p { margin-top:6px; }
.activity-search { margin-bottom: 16px; }
.activity-filters { border-bottom: 0; }
.activity-filters > .field { flex: 1 0 136px; }
.activity-filters .filter-actions { margin-left: auto; }
.log-dates { border: 0; margin: 0; padding: 0; min-width: 0; max-width: 410px; flex: 1 1 285px; }
.log-dates legend { color: var(--ink); font-size: .875rem; font-weight: 600; padding: 0 0 5px; }
.log-dates div {
  display: flex; align-items: center; gap: 8px; padding: 0 8px;
  height: var(--filter-height); border: 1px solid #c7d3e1; border-radius: 8px; color: var(--muted);
}
.log-dates input { width: 100%; min-width: 0; height: 100%; border: 0; color: var(--ink); background: transparent; }
.sort-log { color: inherit; min-height: 0; padding: 0; font-size: inherit; font-weight: inherit; }
.sort-log span { color: var(--blue); }
.activity-table td { font-variant-numeric: tabular-nums; }
.activity-table-foot { flex-wrap: wrap; }
.activity-table-foot .field {
  display: flex; align-items: center; gap: 7px; border-left: 1px solid var(--line);
  margin-left: 3px; padding-left: 10px; color: inherit; font-size: inherit; font-weight: 400;
}
.activity-table-foot .field select { min-height: 30px; width: auto; padding: 3px 6px; font-size: inherit; }
.log-changes { border-top: 1px solid var(--line); padding-top: 12px; }

.executive { display: grid; gap: 16px; }
.overview-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.overview-heading h1 { font-size: clamp(1.55rem,2.7vw,2.2rem); line-height: 1.18; font-weight: 760; }
.overview-heading p { color: var(--muted); font-size: .9rem; margin-top: 6px; }
.overview-demo { background: #fbf1df; color: #754619; border: 1px solid #efd9b6; border-radius: 20px;
  padding: 4px 10px; font-size: .75rem; font-weight: 650; white-space: nowrap; }
.overview-filters { border-bottom: 0; }
.overview-filters .overview-hospital { min-width: min(100%,190px); }
.overview-periods { margin-left: auto; }
.overview-kpis { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; }
.overview-kpi { padding: 14px 15px; min-width: 0; }
.overview-kpi-label { display: flex; justify-content: space-between; align-items: center; gap: 5px;
  color: var(--muted); font-size: .85rem; font-weight: 650; }
.overview-kpi-icon { display: grid; place-items: center; color: #8a5b21; background: #fbf1df;
  border-radius: 9px; width: 35px; height: 35px; flex: 0 0 auto; }
.overview-kpi-icon svg { width: 17px; height: 17px; }
.overview-kpi > strong { color: var(--navy); font-size: clamp(1.65rem,3vw,2.35rem); font-weight: 740;
  letter-spacing: -.025em; line-height: 1.25; font-variant-numeric: tabular-nums; }
.overview-kpi p { color: var(--muted); font-size: .76rem; margin-top: 2px; }
.overview-panels { display: grid; grid-template-columns: minmax(270px,1fr) minmax(0,1.9fr); gap: 14px; align-items: start; }
.overview-trend, .overview-alerts, .overview-sites { min-width: 0; }
.overview-trend { grid-column: 2; grid-row: 1; }
.overview-alert-row, .overview-revenue { margin: 0 15px; display: flex; align-items: center; gap: 10px;
  min-height: 55px; padding: 8px 0; border-top: 1px solid #ebeff5; }
.overview-alert-icon { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 8px;
  background: #f4f6fa; color: #516a85; flex: 0 0 auto; }
.overview-alert-icon svg { width: 16px; height: 16px; }
.overview-alert-row > div { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex: 1; font-size: .875rem; }
.overview-alert-row strong { font-size: 1.06rem; font-variant-numeric: tabular-nums; }
.overview-revenue { justify-content: space-between; color: var(--muted); font-size: .8rem; }
.overview-revenue div { display: grid; }
.overview-revenue strong { color: var(--ink); font-size: .875rem; }
.overview-legend { margin: 0 18px 4px; }
.overview-chart { height: 184px; }
@media (max-width: 1080px) {
  .overview-periods { margin-left: 0; }
}
@media (max-width: 700px) {
  .overview-kpis { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .overview-panels { grid-template-columns: minmax(0,1fr); }
  .overview-trend { grid-column: auto; grid-row: auto; }
  .overview-filters .overview-hospital { flex: 1 1 100%; }
  .overview-filters .field:has(> input[type="date"]) { flex: 1 1 125px; }
}

.topbar-start { margin-right: auto; }
.header-clock {
  display: grid; flex-shrink: 0; gap: 1px; padding: 5px 9px; border-radius: 8px;
  background: #223d57; color: #dce8f7; font-size: .74rem; line-height: 1.22;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.header-clock > span:last-child { display: flex; gap: 6px; align-items: baseline; }
.header-clock strong { color: #fff; font-size: .86rem; letter-spacing: .01em; }
.overview-sites { scroll-margin-top: calc(var(--header-offset) + 10px); }

@media (max-width: 760px) {
  .layout { --header-height: 82px; }
  .topbar {
    display: grid; grid-template-columns: minmax(0,1fr) auto; grid-template-rows: 52px minmax(0,1fr);
    column-gap: 10px; row-gap: 0;
  }
  .topbar-start { margin-right: 0; }
  .topbar .tools { grid-column: 2; grid-row: 1; }
  .header-clock {
    grid-column: 1 / -1; grid-row: 2; align-self: stretch; justify-content: start;
    grid-auto-flow: column; align-items: center; gap: 7px; padding: 0;
    background: transparent; border-radius: 0; border-top: 1px solid #2a425a;
  }
}

.ai-banner {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  margin-bottom: 18px; padding: 23px 25px; border-radius: var(--radius);
  background: var(--navy); color: #f1c982;
}
.ai-banner h1 { font-size: clamp(1.5rem,3vw,2rem); line-height: 1.2; }
.ai-banner p { color: #cfdeed; margin-top: 8px; font-size: .875rem; }
.ai-mode { padding: 5px 9px; border: 1px solid #587086; border-radius: 8px; color: #f1c982; font-size: .75rem; white-space: nowrap; }
.ai-cards { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-bottom: 20px; }
.ai-card {
  display: grid; align-content: start; justify-items: start; gap: 4px; padding: 15px 17px; min-height: 124px;
  color: var(--ink); text-align: left;
}
.ai-card:hover, .ai-card[aria-pressed="true"] { border-color: #b28b51; background: #fffbf3; }
.ai-card strong { font-size: 1.03rem; }
.ai-card > span:last-child { color: var(--muted); font-size: .86rem; }
.ai-card-icon {
  display: grid; place-items: center; width: 31px; height: 31px; margin-bottom: 3px;
  background: #f9eedb; border-radius: 8px; color: #885a20;
}
.ai-card-icon svg { width: 17px; height: 17px; }
.ai-workspace { scroll-margin-top: calc(var(--header-offset) + 10px); }
.ai-form { padding: 0 18px 18px; }
.ai-form .actions { margin-top: 12px; }
.ai-output { border: 1px solid var(--line); padding: 14px; border-radius: 8px; margin-top: 14px; }
.ai-output .table-scroll { margin-top: 10px; }
.ai-draft { color: var(--ink); background: #f8fafd; }
.ai-results-list { margin-block: 8px; padding-left: 20px; }
.ai-case { padding: 10px; border-radius: 8px; background: #f2f6fb; color: var(--ink); }
.ai-prose { white-space: pre-wrap; overflow-wrap: anywhere; }
.ai-knowledge-toolbar { padding: 0 18px 12px; display: flex; align-items: end; flex-wrap: wrap; gap: 8px; }
.ai-knowledge-toolbar p { flex-basis: 100%; margin-bottom: 0; }
.ai-knowledge-count { align-self: center; color: var(--muted); font-size: .8125rem; }
@media (max-width: 620px) {
  .ai-banner { padding: 16px; flex-direction: column; gap: 10px; }
  .ai-card { padding: 12px; min-height: 118px; }
}

.department-picker select { max-width: min(16vw, 140px); }
.permission-hospital { margin-bottom: 12px; }
@media (max-width: 620px) {
  .layout { --header-height: 108px; }
  .topbar { display: grid; grid-template-columns: minmax(0,1fr) auto; grid-template-rows: 53px 54px; }
  .topbar .header-clock { grid-column: 2; grid-row: 1; grid-auto-flow: row; border: 0; padding: 0; gap: 1px; }
  .topbar .tools { grid-column: 1 / -1; grid-row: 2; justify-content: space-between; border-top: 1px solid #2a425a; padding-top: 5px; }
  .topbar .hospital-picker select { max-width: min(35vw,150px); }
  .topbar .department-picker select { max-width: min(25vw,110px); }
}
