:root {
  color-scheme: light;
  font-family: Inter, "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
  color: #152b36;
  background: #f4f7f8;
  --surface: #fff;
  --canvas: #f4f7f8;
  --ink: #152b36;
  --muted: #546a74;
  --line: #e0e8eb;
  --teal: #0c6e60;
  --teal-dark: #075b50;
  --mint: #e0f4ee;
  --nav: #132934;
  --shadow: 0 14px 38px #142b3513;
  font-synthesis: none;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; }
button, input, select, textarea { font: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
a { color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .65; cursor: wait; }
:focus-visible { outline: 3px solid #20a691; outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
svg { display: inline-block; flex-shrink: 0; vertical-align: middle; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: fixed; z-index: 10; top: 12px; left: 12px; padding: 10px 16px; border-radius: 6px; color: #fff; background: var(--teal-dark); transform: translateY(-160%); }
.skip-link:focus { transform: none; }
.initial-state { display: grid; min-height: 100vh; place-items: center; color: var(--muted); }

.shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 3; display: flex; flex-direction: column; width: 224px; padding: 29px 15px 15px; color: #e6f2f3; background: var(--nav); }
.brand { display: flex; align-items: center; gap: 11px; color: #f0faf9; }
.sidebar .brand { padding-inline: 8px; margin-bottom: 43px; }
.brand-mark { display: grid; place-items: center; width: 39px; height: 39px; border: 1px solid #478d80; border-radius: 11px; color: #b7f6e6; background: #1e524b; }
.brand-mark svg { width: 23px; height: 23px; }
.brand strong { display: block; font-size: 16px; letter-spacing: .025em; }
.brand small { display: block; margin-top: 3px; color: #9bb9bb; font-size: 9px; letter-spacing: .19em; }
.sidebar nav { overflow: auto; }
.nav-group { margin-bottom: 26px; }
.nav-group > p { padding: 0 12px 10px; color: #a0b7bd; font-size: 11px; letter-spacing: .12em; }
.nav-group a { display: flex; align-items: center; gap: 12px; min-height: 44px; margin-bottom: 3px; padding: 0 12px; border-radius: 8px; color: #c5d8da; font-size: 14px; text-decoration: none; white-space: nowrap; transition: background .15s ease; }
.nav-group a:hover { color: #f4ffff; background: #22414c; }
.nav-group a[aria-current="page"] { color: #e8fff8; background: #205148; font-weight: 700; }
.nav-group a[aria-current="page"] svg { color: #a2e7d8; }
.sidebar-user { display: flex; align-items: center; gap: 10px; margin-top: auto; padding: 15px 5px 2px; border-top: 1px solid #354d56; }
.avatar { display: grid; place-items: center; flex: 0 0 33px; height: 33px; border-radius: 50%; color: #d2fff2; background: #2e5c55; font-size: 13px; font-weight: 700; }
.sidebar-user div { flex: 1; min-width: 0; }
.sidebar-user strong, .sidebar-user small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user strong { font-size: 13px; }
.sidebar-user small { margin-top: 3px; color: #a3bec1; font-size: 11px; }
.sidebar-user button { color: #c5d8da; }
.sidebar-user button:hover { color: #fff; background: #22414c; }

.main-frame { margin-left: 224px; min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 12px; height: 63px; padding: 0 31px; border-bottom: 1px solid var(--line); background: var(--surface); }
.topbar-route, .topbar-tools { display: flex; align-items: center; gap: 11px; font-size: 13px; }
.topbar-label, .crumb-divider { color: var(--muted); }
.env-marker { padding: 5px 9px; border: 1px solid #dce9e7; border-radius: 6px; color: #375d5a; background: #f1f8f6; white-space: nowrap; font-size: 11px; }
.menu-button, .nav-dismiss { display: none !important; }
.page-content { max-width: 1680px; margin-inline: auto; padding: 29px 31px 46px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 23px; }
.page-head h1, .overview-hero h1 { font-size: clamp(23px, 2.1vw, 30px); line-height: 1.25; letter-spacing: -.015em; }
.page-head p, .overview-subtitle { margin-top: 8px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.section-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.overview-hero { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 116px; margin-bottom: 20px; padding: 22px 25px; overflow: hidden; border: 1px solid #cde5df; border-radius: 13px; background: linear-gradient(107deg, #edf8f4, #e0f1ee 65%, #d7eee7); }
.overview-hero .section-actions { position: relative; z-index: 1; }
.overview-hero h1 { line-height: 1.3; }
.overview-hero::before { position: absolute; right: -42px; bottom: -95px; width: 270px; height: 270px; border: 1px solid #78afa859; border-radius: 50%; box-shadow: 0 0 0 24px #78afa829, 0 0 0 47px #78afa818, 0 0 0 72px #78afa811; content: ""; pointer-events: none; }
.overview-hero > * { position: relative; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; margin-bottom: 18px; }
.metric { min-width: 0; display: flex; flex-direction: column; gap: 8px; padding: 16px 17px; border: 1px solid var(--line); border-radius: 11px; text-decoration: none; color: var(--muted); background: var(--surface); }
a.metric:hover { border-color: #83b8ac; }
.metric strong, .metric-number { display: block; color: var(--ink); font-size: clamp(25px, 2.1vw, 34px); font-weight: 750; font-variant-numeric: tabular-nums; line-height: 1.15; }
.metric p, .metric-hint { color: var(--muted); font-size: 12px; line-height: 1.4; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(265px, 1fr); gap: 17px; align-items: start; }
.dashboard-stack { display: grid; gap: 17px; min-width: 0; }
.dashboard-grid + .panel { margin-top: 17px; }
.panel { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.panel-head h2 { font-size: 16px; line-height: 1.4; }
.panel-head p { margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.signal-bars { display: grid; gap: 15px; }
.signal-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 13px; }
.signal-row progress { display: block; flex: 1; min-width: 40px; height: 8px; appearance: none; border: 0; border-radius: 8px; overflow: hidden; color: #258875; background: #e9f1f1; }
.signal-row progress::-webkit-progress-bar { border-radius: 8px; background: #e9f1f1; }
.signal-row progress::-webkit-progress-value { border-radius: 8px; background: #258875; }
.signal-row progress::-moz-progress-bar { border-radius: 8px; background: #258875; }
.feed-list { margin: 0; padding: 0; list-style: none; }
.feed-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid #e9eff1; font-size: 13px; }
.feed-item:last-child { border: 0; padding-bottom: 2px; }
.feed-item p, .feed-item small { margin-top: 4px; color: var(--muted); font-size: 12px; }
.feed-link { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; min-height: 41px; padding: 6px 5px; border: 0; border-radius: 6px; color: inherit; background: none; text-align: left; }
.feed-link:hover { background: #eff8f5; }
.feed-copy { display: grid; gap: 2px; }
.feed-copy small { margin: 0; }
.metric-label { color: #405b66; font-size: 13px; font-weight: 650; }
.table-search { min-width: 0; }
.record-actions { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.facility-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.facility-rosters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.facility-roster { min-height: 100px; }
.facility-names { margin-top: 10px; line-height: 1.6; overflow-wrap: anywhere; white-space: pre-wrap; }
.facility-fields { min-width: 0; margin: 0 0 13px; padding: 12px; border: 1px solid var(--line); border-radius: 9px; }
.facility-fields legend { padding-inline: 6px; color: var(--ink); font-size: 13px; font-weight: 700; }
.report-filter { margin-bottom: 17px; }
.report-filter .filter-bar { margin-bottom: 0; }
.report-filter .inline-error { margin-top: 12px; }
.report-filter input { min-width: min(150px, 100%); }
.data-table th[scope="row"] { background: transparent; text-align: left; }

.button, .icon-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 39px; padding: 8px 13px; border: 1px solid transparent; border-radius: 7px; color: var(--ink); background: transparent; text-decoration: none; font-size: 13px; font-weight: 650; white-space: nowrap; }
.button.primary { color: #fff; background: var(--teal); }
.button.primary:hover { background: var(--teal-dark); }
.button.secondary { border-color: #d6e2e5; color: #254452; background: var(--surface); }
.button.secondary:hover, .icon-button:hover { border-color: #d2e0e3; background: #eff6f6; }
.button.quiet { color: var(--teal-dark); }
.button.quiet:hover { background: var(--mint); }
.icon-button { min-width: 39px; padding: 5px; color: #3c5762; }
.record-actions .button, .panel-head .button { min-height: 32px; padding: 5px 8px; }
.filter-bar { display: flex; align-items: end; flex-wrap: wrap; gap: 11px; margin-bottom: 15px; }
.filter-bar label { display: grid; gap: 5px; color: #3e5964; font-size: 12px; }
.filter-bar input { min-width: min(260px, 100%); }
.filter-bar select { min-width: 126px; }
.field input, .field select, .field textarea, .filter-bar input, .filter-bar select { display: block; min-height: 41px; padding: 9px 11px; border: 1px solid #d0dee2; border-radius: 7px; color: var(--ink); background: #fff; font-size: 14px; }
.field input, .field select, .field textarea { width: 100%; }
.field textarea { min-height: 86px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder, .filter-bar input::placeholder { color: #657d86; }
.field :is(input, select, textarea):focus, .filter-bar :is(input, select):focus { outline: 2px solid #4ab8a3; outline-offset: 1px; }
.field :is(input, select, textarea):read-only:not(select) { background: #f7f9fa; }
.table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; text-align: left; color: #293f49; font-size: 13px; }
.data-table th { padding: 10px 11px; color: #44606a; background: #f2f6f7; white-space: nowrap; font-size: 12px; font-weight: 650; }
.data-table th:first-child { border-radius: 5px 0 0 5px; }
.data-table th:last-child { border-radius: 0 5px 5px 0; }
.data-table td { padding: 11px; border-bottom: 1px solid #e9eff1; white-space: nowrap; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #f8fbfa; }
.data-table tbody td:first-child { font-weight: 620; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 999px; color: #4b5e65; background: #edf2f4; white-space: nowrap; font-size: 11px; font-weight: 650; line-height: 1.3; }
.pill::before { width: 6px; height: 6px; border-radius: 50%; background: currentColor; content: ""; }
.pill.danger { color: #a42e3b; background: #ffedf0; }
.pill.warning { color: #805007; background: #fff2d8; }
.pill.success { color: #11654d; background: #e2f4eb; }
.pill.info { color: #285b82; background: #e8f2fb; }
.empty-state { display: grid; justify-items: center; gap: 9px; min-height: 105px; padding: 25px 10px; text-align: center; color: var(--muted); font-size: 13px; }
.empty-state :is(h2, h3, strong) { color: var(--ink); }

dialog { width: min(590px, calc(100% - 24px)); max-height: calc(100dvh - 24px); padding: 0; overflow: auto; border: 1px solid #d6e5e6; border-radius: 13px; color: var(--ink); background: var(--surface); box-shadow: 0 24px 80px #152b3680; }
dialog::backdrop { background: #0d222a80; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { font-size: 20px; }
.dialog-body { padding: 19px 20px; }
.dialog-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.span-all { grid-column: 1 / -1; }
.field { display: grid; align-content: start; gap: 6px; color: #38515c; font-size: 13px; font-weight: 650; }
.field small, .field .muted { font-weight: 400; font-size: 12px; line-height: 1.6; }
.detail-list { display: grid; gap: 0; margin: 0; }
.detail-row { display: grid; grid-template-columns: minmax(65px, 1fr) 3fr; gap: 12px; padding: 11px 0; border-bottom: 1px solid #e9eff1; font-size: 14px; }
.detail-row:last-child { border-bottom: 0; }
.detail-row dt { color: var(--muted); }
.detail-row dd { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.inline-error { margin: 1px 0; padding: 9px 11px; border-radius: 7px; color: #a12539; background: #fff1f2; font-size: 13px; line-height: 1.5; }
.dialog-body .inline-error { margin-top: 12px; }
.toast { position: fixed; z-index: 5; bottom: 24px; right: 24px; max-width: calc(100% - 48px); padding: 12px 18px; border-radius: 8px; color: #fff; background: #164d45; box-shadow: var(--shadow); font-size: 14px; }

.login { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); min-height: 100dvh; background: var(--surface); }
.login-brand { position: relative; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; padding: clamp(25px, 6vw, 94px); isolation: isolate; overflow: hidden; color: #f3fcfa; background: radial-gradient(ellipse at 60% 90%, #22494d, #132934 68%); }
.login-brand .brand { position: absolute; top: 35px; left: clamp(25px, 6vw, 94px); }
.login-mission h1 { font-size: clamp(36px, 5vw, 63px); line-height: 1.12; }
.login-mission p { max-width: 460px; margin-top: 21px; color: #c1dad8; font-size: clamp(15px, 2vw, 19px); line-height: 1.75; }
.login-lines { position: absolute; z-index: -1; left: -90px; bottom: -320px; width: 620px; height: 620px; border-radius: 50%; border: 1px solid #79adab49; box-shadow: 0 0 0 38px #79adab1d, 0 0 0 76px #79adab10, 0 0 0 114px #79adab0c; }
.login-body { display: grid; place-items: center; padding: 26px; }
.login-card { width: min(100%, 374px); }
.login-card h2 { margin-bottom: 25px; font-size: 26px; }
.login-form { display: grid; gap: 17px; }
.login-form .button { min-height: 44px; }
.demo-picker { display: grid; gap: 10px; margin-top: 27px; padding-top: 17px; border-top: 1px solid var(--line); }
.demo-picker p { color: var(--muted); font-size: 12px; }
.demo-picker > div { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

@media (max-width: 1090px) {
  .dashboard-grid { grid-template-columns: minmax(0, 1fr); }
  .topbar { padding-inline: 22px; }
  .page-content { padding-inline: 22px; }
}
@media (max-width: 760px) {
  .sidebar { width: min(260px, 82vw); transform: translateX(-100%); visibility: hidden; transition: transform .18s ease; }
  .menu-open .sidebar { transform: none; visibility: visible; }
  .main-frame { margin-left: 0; }
  .menu-button { display: inline-grid !important; }
  .menu-open .nav-dismiss { position: fixed; z-index: 2; inset: 0; display: block !important; width: 100%; border: 0; background: #142d3780; }
  .topbar { height: 57px; padding-inline: 12px; }
  .page-content { padding: 22px 13px 30px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .facility-rosters { grid-template-columns: 1fr; }
  .overview-hero { min-height: 104px; padding: 17px 15px; }
  .panel { padding: 13px; }
  .login { grid-template-columns: 1fr; align-content: start; }
  .login-brand { min-height: 210px; padding-block: 76px 25px; }
  .login-brand .brand { top: 18px; }
  .login-mission h1 { font-size: 34px; }
  .login-mission p { margin-top: 12px; }
  .login-body { padding-block: 29px; }
}
@media (max-width: 460px) {
  .topbar-label, .crumb-divider { display: none; }
  .page-head { align-items: flex-start; flex-direction: column; gap: 10px; }
  .overview-hero { flex-wrap: wrap; }
  .field:has(input[type="datetime-local"]) { grid-column: 1 / -1; }
  .filter-bar input { min-width: 0; width: 100%; }
  .filter-bar label:first-child { flex: 1 1 140px; }
  .form-grid { grid-template-columns: 1fr; }
  .data-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .data-table, .data-table tbody { display: block; }
  .data-table tbody { display: grid; gap: 10px; }
  .data-table tr { display: grid; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }
  .data-table td { display: flex; justify-content: space-between; align-items: center; gap: 13px; min-width: 0; padding: 7px 0; white-space: normal; text-align: right; overflow-wrap: anywhere; }
  .data-table td::before { flex: 0 0 auto; content: attr(data-label); color: var(--muted); font-size: 12px; font-weight: 450; }
  .data-table tbody tr td:last-child { border-bottom: 0; }
  .record-actions { flex-wrap: wrap; justify-content: flex-end; white-space: normal; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: .01ms !important; } }
