:root {
  --ink:#17384a;
  --muted:#526b79;
  --line:#dce8ed;
  --blue:#12608b;
  --teal:#08796f;
  --green:#14664a;
  --red:#aa263c;
  --amber:#805500;
  --radius:20px
}
.location-panel {display:flex;flex-wrap:wrap;align-items:center;background:#fff;border-color:var(--line)}
.location-panel form {display:flex;flex-wrap:wrap;align-items:end;gap:12px}
.location-panel label {display:flex;flex-direction:column;font-size:16px}
.location-panel #location-result {flex-basis:100%;font-size:16px}
.care-filter-panel {display:flex;flex-wrap:wrap;gap:14px;align-items:end;background:white;border:1px solid var(--line);border-radius:16px;padding:20px;margin-bottom:24px}
.care-filter-panel label {display:flex;flex-direction:column;gap:6px;font-size:16px}
.care-filter-panel input {font:inherit;min-height:50px;border:1px solid #b9ccd6;border-radius:10px;padding:8px;max-width:100%}
.care-filter-panel input:focus-visible {outline:3px solid #126d9c;outline-offset:4px}
.care-filter-note {flex-basis:100%;font-size:15px;color:var(--muted)}
.care-scope {font-size:16px;margin:15px 0;color:var(--muted)}
.care-stats {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}
.care-stat {border:1px solid var(--line);border-top:5px solid var(--blue);border-radius:16px;padding:20px;background:#fff;display:flex;flex-direction:column;font-weight:600}
.care-stat.waiting {border-top-color:var(--amber)}
.care-stat.completed {border-top-color:var(--green)}
.care-stat strong {font-size:40px;font-variant-numeric:tabular-nums}
.care-section {background:#fff;border:1px solid var(--line);border-radius:18px;padding:22px;margin:24px 0;scroll-margin-top:16px}
.care-section>.muted {font-size:16px;margin-bottom:16px}
.care-section .table-wrap {margin-top:16px}
.care-pain {background:#fff0f2;border-left:5px solid var(--red)}
.care-pain .badge {display:block;margin-top:8px;white-space:normal}
.care-queue-table {min-width:560px}
.care-history-table {min-width:1450px}
.care-command-note {font-size:14px;color:var(--amber);margin-top:8px;min-width:180px}
.care-pagination {display:flex;gap:15px;align-items:center;justify-content:flex-end;margin-top:18px;flex-wrap:wrap}
.care-wards {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;margin-top:20px}
.care-room {border:1px solid var(--line);border-radius:14px;padding:14px;min-width:0}
.care-room h3 {margin-bottom:12px}
.care-room h3 button {width:100%;justify-content:flex-start}
.care-beds {display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px}
.care-bed {display:flex;flex-direction:column;gap:5px;min-width:0;padding:10px 5px;font-size:14px;white-space:normal;background:#f5f9fb;color:var(--ink);border:1px solid var(--line)}
.care-bed:hover {background:#e5f1f8}
.care-bed.represented {border:2px solid var(--teal);background:#edf9f5}
.care-pi-state {font-size:12px;font-weight:400;overflow-wrap:anywhere}
.legacy-dashboard {border-top:1px solid var(--line);margin:35px 0 20px;padding-top:20px}
.legacy-dashboard>summary {cursor:pointer;font-size:17px;padding:12px 0}
#care-view {overflow-anchor:none}
@media(max-width:1100px) {.care-wards {grid-template-columns:1fr}}
@media(max-width:760px) {.care-stats {grid-template-columns:1fr}.care-section {padding:14px}.care-filter-panel {padding:14px}.care-filter-panel label {width:100%}.care-filter-panel input,.care-filter-panel select {width:100%}.care-beds {gap:4px}.care-bed {font-size:12px;padding:8px 2px}.care-pi-state {font-size:11px}.care-room {padding:8px}.care-pagination {justify-content:space-between}}
* {
  box-sizing:border-box
}
body {
  margin:0;
  background:#f3f8fa;
  color:var(--ink);
  font:18px/1.55 "Segoe UI",Arial,sans-serif
}
button,select {
  font:inherit
}
button,select,a {
  -webkit-tap-highlight-color:transparent
}
button:focus-visible,select:focus-visible,a:focus-visible,[tabindex]:focus-visible {
  outline:3px solid #126d9c;
  outline-offset:4px
}
h1,h2,h3,p {
  margin:0
}
h2 {
  font-size:26px;
  line-height:1.3
}
h3 {
  font-size:23px;
  line-height:1.4
}
.icon {
  width:24px;
  height:24px;
  flex-shrink:0;
  vertical-align:middle
}
button {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  min-height:52px;
  padding:12px 20px;
  border:1px solid var(--blue);
  border-radius:12px;
  background:var(--blue);
  color:#fff;
  font-weight:600;
  cursor:pointer;
  white-space:nowrap
}
button:hover {
  background:#0c4d71
}
button:disabled {
  cursor:wait;
  opacity:.75
}
.secondary {
  background:#fff;
  color:var(--blue);
  border-color:#b8ceda
}
.secondary:hover {
  background:#edf6fa
}
.muted {
  color:var(--muted)
}
.eyebrow,.micro-label {
  font-size:13px;
  letter-spacing:1.4px;
  font-weight:700
}
.eyebrow {
  color:var(--teal)
}
.micro-label {
  display:block;
  color:var(--muted);
  font-size:12px;
  letter-spacing:1px
}
.code-label {
  display:block;
  color:var(--muted);
  font-size:14px;
  letter-spacing:.6px;
  font-weight:600
}
.text-normal {
  color:var(--green)
}
.text-error {
  color:var(--red)
}
.separator {
  padding:0 5px;
  color:#8499a5
}
.normal {
  color:var(--green);
  background:#e9f6ef
}
.warning {
  color:var(--amber);
  background:#fff5d9
}
.error,.emergency {
  color:var(--red);
  background:#fff0f2
}
.neutral {
  color:var(--muted);
  background:#edf3f6
}
.badge {
  display:inline-flex;
  align-items:center;
  gap:5px;
  padding:5px 10px;
  border-radius:7px;
  font-size:13px;
  font-weight:700;
  line-height:1.5;
  white-space:nowrap
}
.badge .icon {
  width:15px;
  height:15px
}
.page-header {
  border-top:5px solid var(--teal);
  background:linear-gradient(110deg,#fff 65%,#effaf8);
  border-bottom:1px solid var(--line)
}
.header-inner {
  max-width:1480px;
  margin:auto;
  display:flex;
  align-items:center;
  gap:22px;
  padding:27px 36px
}
.brand-icon {
  display:grid;
  place-items:center;
  flex-shrink:0;
  width:72px;
  height:82px;
  color:#fff;
  border-radius:22px;
  background:linear-gradient(145deg,#16859b,#087769);
  box-shadow:0 8px 20px #167f8b18
}
.brand-icon .icon {
  width:47px;
  height:47px
}
.brand-copy {
  flex:1;
  min-width:0
}
.brand-copy h1 {
  max-width:910px;
  font-size:clamp(18px,1.45vw,23px);
  line-height:1.55;
  font-weight:700;
  margin-top:7px
}
.brand-copy .eyebrow {
  font-size:12px
}
.brand-copy .eyebrow span {
  color:var(--muted)
}
.clock-panel {
  padding-left:28px;
  border-left:1px solid var(--line);
  min-width:174px;
  display:flex;
  flex-direction:column
}
.clock-panel .icon {
  height:16px;
  width:16px;
  margin-right:4px
}
.clock-panel time {
  font-size:20px;
  font-weight:700;
  letter-spacing:0;
  font-variant-numeric:tabular-nums;
  color:var(--blue)
}
#clock-date {
  font-size:14px;
  color:var(--muted)
}
.workspace {
  max-width:1480px;
  margin:auto;
  padding:30px 36px 0
}
.page-heading {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:20px;
  margin-bottom:24px
}
.page-heading h2 {
  font-size:32px;
  margin:6px 0
}
.page-heading p.muted {
  font-size:17px
}
.status-strip {
  display:grid;
  grid-template-columns:1.05fr .9fr 1.4fr 1fr;
  background:white;
  border:1px solid var(--line);
  border-radius:14px;
  margin-bottom:22px;
  box-shadow:0 3px 10px #17384a03
}
.status-item {
  display:flex;
  align-items:center;
  gap:12px;
  margin:17px 0;
  padding:0 20px;
  border-right:1px solid var(--line);
  min-width:0
}
.status-item:last-child {
  border:0
}
.status-item>.icon {
  color:var(--teal);
  width:23px
}
.status-item strong,.status-item time {
  font-size:16px;
  font-weight:600
}
.status-item time {
  font-variant-numeric:tabular-nums
}
.notice {
  display:flex;
  gap:10px;
  align-items:center;
  padding:16px 20px;
  border-radius:12px;
  border:1px solid currentColor;
  margin-bottom:20px
}
.overview-grid {
  display:grid;
  grid-template-columns:minmax(0,2.6fr) minmax(230px,1fr);
  gap:22px
}
.alert-panel {
  min-width:0
}
.alert-content {
  height:100%;
  padding:26px 30px;
  border-radius:var(--radius);
  border:1px solid #cae2d8;
  border-left:5px solid var(--green)
}
.alert-content.emergency,.alert-content.error {
  border-color:#edc7cf;
  border-left-color:var(--red)
}
.alert-content.warning {
  border-color:#e9d4a3;
  border-left-color:var(--amber)
}
.alert-content .eyebrow {
  color:inherit;
  display:flex;
  align-items:center;
  gap:8px
}
.section-top {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px
}
.alert-body {
  display:flex;
  align-items:center;
  gap:22px;
  margin:25px 0
}
.alert-body h2 {
  font-size:33px;
  margin-bottom:4px
}
.alert-body p {
  font-size:17px
}
.alert-icon {
  display:grid;
  place-items:center;
  width:65px;
  height:65px;
  flex-shrink:0;
  border:1px solid currentColor;
  border-radius:18px;
  background:#ffffff70
}
.alert-icon .icon {
  width:36px;
  height:36px
}
.alert-detail {
  display:flex;
  align-items:center;
  gap:18px;
  flex-wrap:wrap
}
.alert-detail .event-time {
  flex-direction:row;
  align-items:baseline;
  gap:8px
}
.alert-empty-note {
  font-size:16px
}
.summary-card {
  background:white;
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:26px
}
.summary-card>.section-top>.icon {
  color:var(--teal)
}
.summary-card p {
  font-size:16px;
  color:var(--muted)
}
.total-number {
  display:block;
  font-size:62px;
  line-height:1.3;
  letter-spacing:-2px;
  margin:12px 0 0;
  color:var(--blue);
  overflow-wrap:anywhere
}
.summary-bottom {
  border-top:1px solid var(--line);
  padding-top:15px;
  margin-top:19px;
  font-size:14px;
  color:var(--muted)
}
.status-dot {
  display:inline-block;
  width:8px;
  height:8px;
  border-radius:50%;
  background:var(--teal);
  margin-right:6px
}
.section-block {
  margin-top:30px
}
.section-heading {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:15px
}
.section-heading h2 {
  font-size:23px;
  display:flex;
  align-items:center;
  gap:10px
}
.section-heading h2 .icon {
  color:var(--teal)
}
.section-heading>span {
  font-size:14px
}
.three-grid {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:20px
}
.request-card {
  background:white;
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:22px 24px;
  border-top:3px solid var(--accent)
}
.request-card.nurse {
  --accent:#b83450;
  --tint:#fff0f3
}
.request-card.pain {
  --accent:#976000;
  --tint:#fff5e2
}
.request-card.water {
  --accent:#086e83;
  --tint:#e7f7fa
}
.tile-icon {
  display:grid;
  place-items:center;
  flex-shrink:0;
  border-radius:13px;
  width:49px;
  height:49px;
  background:var(--tint,#eaf6f6);
  color:var(--accent,var(--teal))
}
.tile-icon .icon {
  width:28px;
  height:28px
}
.priority {
  font-size:13px;
  font-weight:700;
  border-radius:6px;
  padding:5px 9px;
  color:var(--accent);
  background:var(--tint)
}
.request-card h3 {
  margin:15px 0 2px
}
.request-last {
  border-top:1px solid var(--line);
  margin-top:18px;
  padding-top:15px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  min-height:63px
}
.request-last p {
  font-size:16px
}
.event-time {
  display:flex;
  flex-direction:column;
  font-size:16px;
  font-variant-numeric:tabular-nums;
  white-space:normal
}
.event-time strong {
  font-weight:600
}
.event-time span {
  font-size:12px;
  color:var(--muted);
  font-weight:400
}
.device-card {
  display:flex;
  align-items:center;
  gap:17px;
  background:white;
  border:1px solid var(--line);
  border-radius:16px;
  padding:22px
}
.device-copy {
  min-width:0
}
.device-card h3 {
  font-size:21px;
  margin:2px 0 9px
}
.device-card .badge {
  white-space:normal
}
.device-fault {
  margin-top:8px;
}
.history-panel {
  background:white;
  border:1px solid var(--line);
  border-radius:var(--radius);
  margin-top:30px;
  overflow:hidden
}
.history-heading {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:14px;
  padding:25px 26px 20px
}
.history-heading h2 {
  margin-top:5px;
  font-size:25px
}
.filter-bar {
  display:flex;
  align-items:flex-end;
  gap:14px;
  flex-wrap:wrap;
  padding:0 26px 16px
}
.filter-bar label {
  display:flex;
  flex-direction:column;
  gap:6px;
  font-size:14px;
  font-weight:600;
  color:var(--muted)
}
select {
  color:var(--ink);
  border:1px solid #b9ccd6;
  border-radius:10px;
  background:white;
  min-height:50px;
  padding:9px 35px 9px 12px;
  max-width:100%;
  font-size:16px;
  cursor:pointer
}
.filter-bar button {
  font-size:16px;
  min-height:50px
}
.filter-bar #filter-count {
  font-size:14px;
  margin-left:auto;
  align-self:center;
  padding-top:24px
}
.table-note {
  font-size:14px;
  color:var(--muted);
  padding:0 26px 18px
}
.table-wrap {
  overflow-x:auto;
  overscroll-behavior-x:contain
}
table {
  border-collapse:collapse;
  width:100%;
  min-width:1050px;
  font-size:16px
}
th {
  text-align:left;
  background:#f1f7f9;
  color:#45616f;
  font-size:13px;
  font-weight:700;
  letter-spacing:.25px;
  white-space:nowrap
}
th,td {
  padding:16px 20px;
  border-bottom:1px solid #e6eef2
}
td {
  vertical-align:middle
}
tbody tr:hover {
  background:#f8fbfc
}
.event-label {
  display:flex;
  align-items:center;
  gap:11px
}
.event-label>.icon {
  color:var(--teal);
  width:22px
}
.event-label strong {
  font-size:16px;
  white-space:nowrap
}
.event-label .code-label {
  font-size:11px
}
.mode-label {
  display:block;
  color:var(--muted);
  font-size:11px;
  margin-top:6px;
  padding-left:33px
}
.unavailable {
  color:var(--muted);
  font-size:21px
}
.history-panel td>.event-time:not(:first-child) {
  margin-top:7px
}
.history-panel td>.event-time:not(:first-child) strong {
  font-size:13px
}
.history-footer {
  display:flex;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  padding:15px 26px;
  background:#fafcfd;
  color:var(--muted);
  font-size:13px
}
.empty-state {
  text-align:center;
  padding:34px 18px;
  color:var(--muted)
}
.empty-state .icon {
  margin-right:8px
}
footer {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:16px;
  flex-wrap:wrap;
  font-size:13px;
  color:var(--muted);
  padding:26px 0
}
footer>span:first-child {
  display:flex;
  align-items:center;
  gap:8px
}
footer .icon {
  width:19px;
  height:19px;
  color:var(--teal)
}
.footer-divider {
  margin:0 4px
}
.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
}
.skip-link {
  position:fixed;
  left:12px;
  top:-100px;
  background:white;
  z-index:10;
  padding:12px;
  color:var(--blue)
}
.skip-link:focus {
  top:10px
}
[hidden] {
  display:none!important
}
.new-event {
  animation:arrive .45s ease-out 1
}
@keyframes arrive {
  from {
    transform:translateY(5px)
  }
  to {
    transform:translateY(0)
  }
}
@media(min-width:1550px) {
  body {
    font-size:20px
  }
  .brand-copy h1 {
    font-size:23px
  }
}
@media(max-width:1100px) {
  .header-inner {
    padding:23px 24px;
    gap:16px
  }
  .workspace {
    padding:24px 24px 0
  }
  .clock-panel {
    min-width:148px;
    padding-left:18px
  }
  .clock-panel time {
    font-size:27px
  }
  .status-strip {
    grid-template-columns:repeat(2,minmax(0,1fr))
  }
  .status-item:nth-child(2) {
    border:0
  }
  .status-item {
    margin:13px 0
  }
  .three-grid {
    gap:14px
  }
  .device-card {
    padding:18px;
    gap:12px;
    align-items:flex-start
  }
  .device-card h3 {
    font-size:19px
  }
  .device-card .tile-icon {
    width:38px;
    height:42px
  }
  .request-card {
    padding:19px
  }
  .alert-content {
    padding:23px
  }
  .request-last {
    min-height:92px
  }
}
@media(max-width:760px) {
  .header-inner {
    flex-wrap:wrap;
    padding:20px;
    gap:14px
  }
  .brand-icon {
    width:50px;
    height:60px;
    border-radius:16px
  }
  .brand-icon .icon {
    width:35px;
    height:35px
  }
  .brand-copy .eyebrow span {
    display:none
  }
  .brand-copy h1 {
    font-size:16px;
    line-height:1.6
  }
  .brand-copy {
    flex-basis:calc(100% - 70px)
  }
  .clock-panel {
    flex-direction:row;
    align-items:center;
    gap:12px;
    padding:12px 0 0;
    border-left:0;
    border-top:1px solid var(--line);
    width:100%;
    flex-wrap:wrap
  }
  .clock-panel time {
    font-size:22px
  }
  .clock-panel .micro-label {
    font-size:11px
  }
  #clock-date {
    margin-left:auto
  }
  .workspace {
    padding:23px 16px 0
  }
  .page-heading {
    align-items:flex-start;
    flex-wrap:wrap;
    gap:15px
  }
  .page-heading h2 {
    font-size:29px
  }
  .page-heading p.muted {
    font-size:16px
  }
  .page-heading button {
    font-size:16px;
    width:100%
  }
  .status-strip {
    margin-bottom:18px
  }
  .status-item {
    padding:0 12px;
    gap:8px;
    align-items:flex-start
  }
  .status-item>.icon {
    width:18px;
    margin-top:3px
  }
  .status-item .micro-label {
    font-size:10px;
    letter-spacing:.3px
  }
  .status-item strong,.status-item time {
    font-size:16px
  }
  .overview-grid {
    grid-template-columns:1fr;
    gap:16px
  }
  .alert-content {
    padding:20px;
    border-radius:16px
  }
  .alert-content .eyebrow {
    font-size:11px;
    letter-spacing:.7px
  }
  .alert-content .eyebrow .icon {
    width:18px
  }
  .alert-content .section-top {
    gap:6px
  }
  .alert-content .section-top>.badge {
    font-size:10px;
    padding:5px 7px
  }
  .alert-body {
    gap:15px;
    margin:22px 0
  }
  .alert-body h2 {
    font-size:27px
  }
  .alert-body p {
    font-size:14px;
    overflow-wrap:anywhere
  }
  .alert-icon {
    width:52px;
    height:58px
  }
  .alert-detail {
    gap:12px
  }
  .alert-detail .event-time {
    flex-direction:column;
    gap:0
  }
  .summary-card {
    padding:20px;
    display:grid;
    grid-template-columns:1fr auto;
    gap:6px 20px;
    align-items:center
  }
  .summary-card .section-top {
    grid-column:1
  }
  .summary-card .section-top .icon {
    display:none
  }
  .summary-card .total-number {
    grid-column:2;
    grid-row:1/3;
    font-size:47px;
    margin:0
  }
  .summary-card p {
    font-size:14px
  }
  .summary-bottom {
    grid-column:1/-1;
    margin-top:8px;
    padding-top:12px
  }
  .three-grid {
    grid-template-columns:1fr;
    gap:12px
  }
  .section-heading {
    align-items:flex-start;
    flex-direction:column;
    gap:6px
  }
  .section-heading h2 {
    font-size:23px
  }
  .section-heading>span {
    font-size:13px
  }
  .request-card {
    padding:20px;
    position:relative
  }
  .request-card h3 {
    font-size:24px
  }
  .request-last {
    min-height:0;
    margin-top:14px;
    padding-top:14px
  }
  .device-card {
    padding:20px;
    align-items:center;
    gap:18px
  }
  .device-card .tile-icon {
    width:52px;
    height:57px
  }
  .device-card h3 {
    font-size:22px
  }
  .history-heading {
    padding:20px;
    align-items:flex-start;
    flex-direction:column;
    gap:12px
  }
  .history-heading h2 {
    font-size:24px
  }
  .filter-bar {
    padding:0 20px 15px;
    gap:12px
  }
  .filter-bar label {
    width:100%
  }
  .filter-bar select {
    width:100%;
    font-size:17px;
    min-height:52px
  }
  .filter-bar #filter-count {
    padding-top:0
  }
  .table-note {
    padding:0 20px 15px;
    font-size:13px
  }
  .history-footer {
    padding:15px 20px;
    font-size:12px
  }
  .notice {
    font-size:16px;
    padding:14px
  }
  .history-panel {
    border-radius:16px
  }
  footer {
    font-size:12px;
    gap:10px
  }
  footer>span:first-child {
    flex-wrap:wrap;
    gap:5px
  }
}
@media(prefers-reduced-motion:reduce) {
  *,*::before,*::after {
    animation:none!important;
    scroll-behavior:auto!important
  }
}
/* Dashboard demo: lịch sử là vùng chính, sơ đồ giường chỉ mở khi cần. */
.header-inner {padding-top:16px;padding-bottom:16px}
.brand-copy h1 {font-size:clamp(21px,3vw,30px);max-width:none;line-height:1.3}
.workspace {padding-top:18px}
.page-heading {margin:16px 0;gap:12px}
.page-heading h2,.care-section h2 {font-size:22px}
.page-heading p,.location-panel p {margin:5px 0}
.notice,.location-panel {padding:12px 16px;margin-bottom:14px}
.location-panel {gap:12px;justify-content:space-between}
.location-panel select,.care-filter-panel select,.care-filter-panel input {min-height:42px;font-size:16px}
.care-filter-panel {padding:14px;gap:10px;margin-bottom:14px;border-radius:12px}
.care-filter-note {margin:0;order:2}
.care-section {padding:16px;margin:14px 0;border-radius:12px}
.care-section .table-wrap {margin-top:10px}
.care-history-table {min-width:760px;width:100%}
.care-history-table td {padding:12px 10px;vertical-align:top}
.care-history-table td:first-child {white-space:nowrap}
.care-history-table p {margin:6px 0}
.care-history-table small {display:block;font-size:13px;margin-top:5px}
.care-history-table details {margin-top:8px;font-size:14px}
summary {cursor:pointer;font-weight:600;padding:6px 0}
.demo-devices {display:flex;flex-wrap:wrap;gap:10px;margin:12px 0}
.demo-devices article {flex:1;min-width:180px;background:#fff;border:1px solid var(--line);border-radius:10px;padding:12px;display:flex;flex-direction:column;gap:5px}
.demo-devices small {font-size:12px;color:var(--muted)}
.demo-devices>p {flex-basis:100%;font-size:13px;margin:0}
.room-map {width:100%;min-width:650px;table-layout:fixed}
.room-map td,.room-map th {padding:6px}
.room-map th:first-child {width:85px}
.room-map button {width:100%;font-size:13px;min-height:42px;padding:6px}
.room-map .represented {border:2px solid #167394;background:#edf8ff}
.room-map .care-pi-state {font-size:12px}
@media(max-width:760px) {.care-filter-panel label {width:auto;flex:1 1 140px}.clock-panel {display:none}.location-panel form {width:100%}.care-history-table {min-width:720px}.demo-devices article {min-width:140px}.care-section {padding:12px}}

/* Bố cục bệnh viện: hai hàng thẻ, SVG nội bộ và bộ lọc nằm trong lịch sử. */
body {background:#f4f9fc}
.header-inner {gap:16px;padding:14px 36px;align-items:center}
.brand-icon {width:48px;height:48px;min-width:48px;border-radius:14px;background:#e8f5f7;color:#126d7d}
.brand-icon .icon {width:30px;height:30px}
.brand-copy h1 {font-size:clamp(20px,2.5vw,27px);margin:3px 0}
.brand-copy .eyebrow {font-size:11px;letter-spacing:1px}
.header-runtime {display:flex;align-items:center;gap:8px;max-width:300px;font-size:13px;color:var(--muted)}
.header-runtime>.icon {width:24px;height:24px;flex-shrink:0;color:#1979a6}
.header-runtime p {margin:0}
.clock-panel {font-size:13px}
.demo-card-row {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin:16px 0}
.demo-card-row[hidden] {display:none}
.demo-card-row .demo-card {min-width:0;min-height:170px;background:#fff;border:1px solid #dce7ed;border-radius:14px;box-shadow:0 3px 12px #244d6810;padding:18px;display:flex;flex-direction:column;gap:8px}
.demo-card-heading {display:flex;align-items:center;gap:12px}
.demo-card-heading h2 {font-size:20px;line-height:1.3;margin:0;font-weight:650}
.demo-icon {display:inline-flex;align-items:center;justify-content:center;width:46px;height:46px;flex-shrink:0;border-radius:12px;color:#167397;background:#eaf6fb}
.demo-icon .icon {width:29px;height:29px}
.request-call_nurse .demo-icon {color:#a65308;background:#fff2df}
.request-pain .demo-icon {color:#ba2941;background:#fff0f2}
.request-water .demo-icon {color:#1769b1;background:#edf5ff}

.device-command {font-size:23px;margin:2px 0;font-weight:650}
.demo-card-row small {font-size:13px}
.demo-card-row p {margin:0;font-size:15px}
.request-position {font-weight:600;color:#334c60}
.demo-card details {font-size:13px;color:#536a7b;margin-top:auto}
.demo-card details summary {font-weight:500;font-size:13px}
.demo-card details p {font-size:13px}
.history-panel .care-filter-panel {border:0;border-radius:0;background:#f6fafc;padding:12px;margin:12px 0;gap:12px}
.care-filter-panel>label {flex:1 1 150px;min-width:0}
.care-filter-panel select {width:100%}
.care-filter-panel button {min-height:42px}
.advanced-filters {flex-basis:100%;border-top:1px solid #dce7ed;padding-top:5px}
.advanced-filters>summary {font-size:14px;width:fit-content}
.advanced-filter-fields {display:flex;flex-wrap:wrap;gap:12px;padding:10px 0 0}
.advanced-filter-fields label {flex:1 1 190px;min-width:0}
.history-note,.history-count {font-size:13px;margin:8px 0}
.history-panel {box-shadow:0 3px 12px #244d6809}
.history-panel .section-heading h2 {display:flex;align-items:center;gap:8px}
.room-browser>summary {font-size:17px}
summary:focus-visible {outline:3px solid #126d9c;outline-offset:3px;border-radius:4px}
@media(max-width:1100px) {.header-inner {flex-wrap:wrap}.header-runtime {max-width:none}.clock-panel {margin-left:auto}.demo-card-row {gap:12px}.demo-card-row .demo-card {padding:14px}.demo-card-heading {gap:8px}}
@media(max-width:760px) {.header-inner {padding:12px 20px;gap:10px}.header-runtime {flex-basis:100%;padding-left:58px}.demo-card-row {grid-template-columns:repeat(2,minmax(0,1fr))}.demo-card-row .demo-card {min-height:160px}.demo-card-heading h2 {font-size:18px}.device-command {font-size:21px}.care-filter-panel>label {flex:1 1 130px}}
@media(max-width:480px) {.demo-card-row {grid-template-columns:1fr;gap:10px;margin:12px 0}.demo-card-row .demo-card {min-height:0;padding:14px;gap:6px}.demo-card details {margin-top:0}.header-runtime {padding-left:0}.location-panel form {gap:8px}.location-panel label {flex:1 1 90px}.location-panel button {width:100%}.advanced-filter-fields label {flex-basis:100%}}

/* Chỉ nhấn đỏ khi có yêu cầu thực tại vị trí ACK; không dùng timer hay animation. */
.request-tile:not(.has-request) .demo-icon {color:#607587;background:#f0f4f7}
.demo-card-row .request-tile.has-request {background:#FEE2E2;border:1px solid #DC2626}
.request-tile.has-request .demo-icon {background:#FEE2E2;color:#B91C1C}
.request-tile.has-request h2,.request-tile.has-request .request-position {color:#B91C1C}
.request-presence {align-self:flex-start;border-radius:6px;padding:2px 8px;background:#FEE2E2;color:#B91C1C;font-size:13px;font-weight:650}
.request-tile.has-request .muted {color:#65505a}
/* Màu chỉ biểu thị lệnh gốc mới nhất, độc lập trạng thái thiết bị/yêu cầu. */
.demo-card-row .device-tile.latest-command {background:#e7f2ff;border-color:#7aa9da}
.latest-command-line {font-size:13px!important;line-height:1.6;font-weight:600;color:#334c60}
/* Màu lịch sử phân nhóm nội dung, không biểu thị trạng thái xử lý yêu cầu. */
.history-quick-filters {display:flex;flex-wrap:wrap;gap:8px;flex-basis:100%}
.history-quick-filters button[aria-pressed="true"] {background:#176e91;color:#fff;border-color:#176e91}
.history-category {display:inline-flex;align-items:center;gap:8px;padding:5px 9px;border-radius:7px;font-weight:600}
.history-category .icon {width:20px;height:20px;flex-shrink:0}
.history-request .history-category {background:#fee2e2;color:#9b2535}
.history-device .history-category {background:#e7f2ff;color:#1e568d}
.history-result {font-size:15px}
.history-legend {font-size:13px;margin:8px 0 14px}
.older-history {margin-top:16px;border-top:1px solid var(--line);padding-top:10px}
.older-history>summary {color:#245770;font-size:16px}
.care-history-table details small {overflow-wrap:anywhere}
/* Viền đỏ chỉ phạm vi xem; dấu chấm Pi vẫn giữ theo heartbeat. */
.room-map button.viewing-location {border:2px solid #dc2626;outline:1px solid #dc2626;outline-offset:-2px}
#care-history-title {scroll-margin-top:18px}
.history-scope {font-size:16px;font-weight:600;margin:10px 0}
[data-filter-pending="true"]>* {display:none}
[data-filter-pending="true"]::before {content:'Đang tải sự kiện…';display:block;padding:20px 0;color:var(--muted)}

/* Giám sát trực tiếp và bố cục trình chiếu. */
.header-inner {padding-block:10px}
.brand-icon {width:42px;height:42px;min-width:42px}
.brand-icon .icon {width:26px;height:26px}
.live-overview {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  align-items:start;
  gap:16px;
  margin:4px 0 18px
}
.live-main,.live-side,.live-side-pair {display:grid;gap:12px;min-width:0}
.live-side-pair {grid-template-columns:minmax(0,1fr)}
.live-card,.live-camera-card {min-width:0;padding:12px;border:1px solid var(--line);border-radius:14px;background:#fff}
.live-overview h2 {margin:0;font-size:1.0625rem;line-height:1.25}
.live-title {display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:6px;margin-bottom:8px}
.live-title-controls {display:inline-flex;align-items:center;gap:8px;flex-wrap:wrap}
.recognition-toggle-btn {
  display:inline-flex;align-items:center;justify-content:center;
  min-height:34px;padding:5px 13px;border-radius:999px;border:1px solid #0f766e;
  background:linear-gradient(135deg,#0f766e,#118f84);color:#fff;
  font-size:.8rem;font-weight:700;letter-spacing:.15px;white-space:nowrap;cursor:pointer;
  box-shadow:0 3px 10px #0f766e26;transition:background .15s ease,border-color .15s ease,opacity .15s ease
}
.recognition-toggle-btn:hover:not(:disabled) {background:linear-gradient(135deg,#0b5e58,#0d776e)}
.recognition-toggle-btn[data-state="running"] {
  background:linear-gradient(135deg,#b91c1c,#dc2626);border-color:#b91c1c;
  box-shadow:0 3px 10px #b91c1c29
}
.recognition-toggle-btn[data-state="running"]:hover:not(:disabled) {
  background:linear-gradient(135deg,#991b1b,#b91c1c)
}
.recognition-toggle-btn[data-state="busy"],
.recognition-toggle-btn:disabled {
  background:#e6eff3;border-color:#bfd2dc;color:#4a6675;box-shadow:none;cursor:wait
}
.recognition-state-badge {
  display:inline-flex;align-items:center;gap:6px;padding:4px 10px;border-radius:999px;
  font-size:.76rem;font-weight:700;background:#eef4f7;color:#486472;border:1px solid #d0e0e8;white-space:nowrap
}
.recognition-state-badge::before {
  content:'';width:7px;height:7px;border-radius:50%;background:#94a3b8
}
.recognition-state-badge[data-state="running"] {background:#e5f7ef;color:#0f6144;border-color:#a7dfc7}
.recognition-state-badge[data-state="running"]::before {background:#16a34a}
.recognition-state-badge[data-state="starting"],
.recognition-state-badge[data-state="stopping"] {background:#fff5d9;color:#8a4f00;border-color:#ebd09d}
.recognition-state-badge[data-state="starting"]::before,
.recognition-state-badge[data-state="stopping"]::before {background:#d97706}
.recognition-state-badge[data-state="error"] {background:#fee9ec;color:#a31c31;border-color:#eabbc3}
.recognition-state-badge[data-state="error"]::before {background:#dc2626}
.recognition-status-note {
  margin:0 0 8px;padding:7px 10px;border-radius:9px;font-size:.82rem;font-weight:600;
  background:#edf6fc;border:1px solid #b8d8ee;color:#124b70
}
.recognition-status-note[data-tone="error"] {
  background:#fff1f3;border-color:#f2b3be;color:#9b1c31
}
.live-title h2,.live-system h2,.gesture-card h2 {display:flex;align-items:center;gap:8px}
.live-title h2 .icon,.live-system h2 .icon,.gesture-card h2 .icon {color:var(--teal)}
.live-title p,.live-meta,.device-sync {color:var(--muted);font-size:.8125rem}
.live-viewport {aspect-ratio:4/3;width:100%;display:grid;grid-template: minmax(0,1fr) / minmax(0,1fr);place-items:center;overflow:hidden;background:#102f3e;color:#e2f2f7}
.live-viewport canvas,.live-viewport .live-stream-img {display:block;width:100%;height:100%;min-width:0;min-height:0;object-fit:contain;grid-area:1/1}
.live-viewport #live-placeholder {grid-area:1/1;text-align:center;padding:18px;display:grid;justify-items:center;gap:8px}
#live-placeholder[hidden],#live-camera[hidden],#live-stream[hidden] {display:none}
#live-placeholder .icon {width:28px;height:28px;color:#83dbd8}
#live-placeholder span {color:#b9d6df;font-size:.875rem}
.live-meta {display:flex;justify-content:space-between;flex-wrap:wrap;gap:2px 10px;margin-top:6px}
#live-frame-info {white-space:nowrap;font-variant-numeric:tabular-nums}
.gesture-card {border-left:4px solid var(--teal);background:#f8fcfc}
.gesture-reading {display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:4px}
.gesture-reading strong {font-size:1.2rem;overflow-wrap:anywhere}
.gesture-reading .badge {font-size:.875rem;font-variant-numeric:tabular-nums}
.gesture-feedback {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px 12px;margin-top:4px}
.gesture-feedback p {display:flex;align-items:baseline;flex-wrap:wrap;gap:0 8px;color:#365665;font-size:.875rem}
.gesture-feedback p span {color:var(--muted)}
.live-overview .live-room {display:grid;gap:5px;padding:8px 10px}
.live-location {display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:4px 10px}
.live-location strong {
  padding:3px 8px;border-radius:6px;background:#e4f2f5;color:#18516a;
  font-size:1rem;line-height:1.25;font-variant-numeric:tabular-nums;overflow-wrap:anywhere
}
.live-room form {display:flex;align-items:stretch;gap:8px}
.live-room form :is(select,button) {min-height:36px;padding:4px 10px;font-size:.9375rem}
.live-room form button {font-size:.875rem}
.live-room form label {flex:1;min-width:0}
.live-room select {width:100%;height:100%}
.live-room #location-result {font-size:.8125rem;line-height:1.35;color:var(--muted);overflow-wrap:anywhere}
.live-system dl {margin:6px 0 0}
.live-system dl>div {display:flex;justify-content:space-between;gap:12px;padding:3px 0;font-size:.9375rem}
.live-system dl>div + div {border-top:1px solid var(--line)}
.live-system dd {min-width:0;margin:0;text-align:right;font-weight:600;overflow-wrap:anywhere}
.device-line {display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:5px;min-height:35px;padding:5px 0;border-top:1px solid var(--line);line-height:1.25;font-size:.875rem}
.device-line:first-child {border-top:0}
.device-name {display:inline-flex;align-items:center;gap:4px;white-space:nowrap}
.device-name .icon {width:16px;height:16px;color:var(--blue)}
.device-line .device-command {margin:0;text-align:right;font-size:.8125rem;overflow-wrap:anywhere}
.device-note {display:block;color:var(--muted);font-size:.75rem;font-weight:400}
.recent-care {display:flex;flex-direction:column}
.recent-care-list {list-style:none;margin:4px 0;padding:0}
.recent-care-list li {padding:5px 0;line-height:1.3;border-top:1px solid var(--line)}
.recent-care-list li:first-child {border-top:0}
.recent-care-item,.recent-care-meta {display:flex;align-items:baseline;justify-content:space-between;flex-wrap:wrap;gap:2px 8px;overflow-wrap:anywhere}
.recent-care-item {font-size:.875rem}
.recent-care-meta,.recent-care-empty,.care-state {font-size:.8125rem;color:var(--muted)}
.care-state[data-state="WAITING"] {color:var(--amber)}
.care-state[data-state="ACCEPTED"],.care-state[data-state="COMPLETED"] {color:var(--teal)}
.recent-care-empty {margin:8px 0}
.care-all {margin-top:auto;color:var(--blue);font-size:.875rem;text-underline-offset:3px;width:fit-content;padding-block:6px}
#care-view>.history-panel {margin-top:0;min-width:0}
#care-view .history-panel .section-heading {flex-direction:row;align-items:center;flex-wrap:wrap}
.history-context {display:flex;align-items:baseline;flex-wrap:wrap;gap:2px 12px;margin-top:6px}
.history-context :is(.history-note,.history-scope) {margin:0;font-size:.875rem}
.history-room-filter {display:flex;align-items:end;gap:8px;flex:0 1 auto;flex-wrap:wrap}
.history-room-filter label {min-width:0}
.history-quick-filters {flex:1 1 auto;align-items:end}
.history-panel :is(.care-filter-panel button,#care-refresh) {min-height:44px;padding:6px 12px;font-size:.9375rem;white-space:normal}
#care-view .history-panel .table-wrap {margin-top:8px}
#care-view .care-history-table {min-width:0;table-layout:fixed}
#care-view .care-history-table th,#care-view .care-history-table td {padding:7px 10px;overflow-wrap:anywhere}
#care-view .care-history-table th:first-child {width:24%}
#care-view .care-history-table th:nth-child(2) {width:12%}
#care-view .care-history-table td:first-child {white-space:normal}
#care-view .care-history-table td details {display:inline-block;margin:0 0 0 6px}
#care-view .care-history-table td details[open] {display:block;margin:5px 0 0}
#care-view .history-count {margin:2px 0;font-size:.875rem}
.care-worklist:not([open]) {padding-block:12px}
.care-worklist>[data-care-region="queue"] {margin:10px 0 0;padding:0;border:0}
.care-worklist .table-wrap {max-height:400px;overflow:auto}
.care-queue-table {min-width:0}
.care-queue-table td {overflow-wrap:anywhere}
.room-map {min-width:0}
.care-cell-label {display:none}
#care-operation:empty {display:none}
.care-worklist #care-operation {margin:8px 0;font-size:.9375rem}
.care-worklist #care-operation[data-error="true"] {color:var(--red)}
.care-bulk-actions,.care-dialog-actions {display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}
.care-bulk-actions button,.care-dialog-actions button,.care-queue-table button,.care-pagination button {
  min-height:44px;padding:6px 12px;font-size:.9375rem;white-space:normal
}
.care-bulk-actions button:disabled {cursor:default}
.care-bulk-note {margin:6px 0;font-size:.875rem}
#care-bulk-dialog {
  width:min(480px,calc(100% - 24px));max-height:calc(100% - 24px);padding:20px;
  border:1px solid var(--line);border-radius:14px;color:var(--ink);overflow:auto
}
#care-bulk-dialog::backdrop {background:#122e40a6}
#care-bulk-dialog h2 {font-size:1.25rem}
#care-bulk-dialog p {margin-top:8px;font-size:1rem;overflow-wrap:anywhere}
#care-bulk-error:empty {display:none}
.care-dialog-actions {justify-content:flex-end;margin-top:16px}
#care-bulk-confirm[data-target="COMPLETED"] {background:#932a3c;border-color:#932a3c}
@media (min-width:1050px) {
  .live-side-pair {grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
}
@media (min-width:901px) and (max-height:800px) {
  .live-side {gap:9px}
  .live-side .live-card {padding:10px}
  .live-main {gap:8px}
  /* Giới hạn chiều rộng theo chiều cao màn hình để giữ nguyên tỷ lệ 4:3. */
  .live-viewport {width:min(100%,max(400px,calc((100dvh - 330px) * 4 / 3)));margin-inline:auto}
}
@media (max-width:900px) {
  .live-overview {grid-template-columns:minmax(0,1fr)}
  .live-room form :is(select,button) {min-height:44px}
  .live-room form select {font-size:1rem}
}
@media (max-width:640px) {
  /* Cùng một nội dung và khóa sự kiện cho bảng trên desktop lẫn thẻ trên điện thoại. */
  .responsive-care-table,.responsive-care-table tbody {display:block}
  .responsive-care-table thead {position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
  .responsive-care-table tr {
    display:grid;grid-template-columns:minmax(0,1fr);padding:8px;
    border:1px solid var(--line);border-radius:10px;margin-bottom:8px
  }
  #care-view .responsive-care-table td {display:block;padding:4px 5px;border:0;font-size:.9375rem;overflow-wrap:anywhere}
  #care-view .responsive-care-table td details {display:block;margin:4px 0}
  .care-cell-label {display:inline-block;margin-right:8px;color:var(--muted);font-weight:600;font-size:.875rem}
  .care-worklist .table-wrap {max-height:none;overflow:visible}
}
@media (max-width:520px) {
  .gesture-feedback {grid-template-columns:minmax(0,1fr)}
  .history-room-filter {width:100%}
  .history-room-filter label {flex:1 0 100%}
  .history-room-filter select {font-size:1rem}
  .care-bulk-actions button {flex:1 1 160px}
}

/* Nâng cấp trực quan hóa CommandGate, telemetry phần cứng, cảnh báo y tế và in bàn giao ca. */
.sound-pill {
  display:inline-flex;align-items:center;gap:7px;min-height:36px;padding:4px 6px 4px 10px;
  border-radius:999px;border:1px solid #b8ceda;background:#f7fbfd;color:var(--ink);
  font-size:.82rem;font-weight:600;transition:background .15s ease,border-color .15s ease,color .15s ease
}
.sound-pill:hover {background:#eaf5f9;border-color:#7fb2c9}
.sound-pill-icon {display:inline-flex;align-items:center;color:var(--muted)}
.sound-pill-icon .icon {width:16px;height:16px}
.sound-pill-state {
  padding:2px 8px;border-radius:999px;background:#e4eef3;color:var(--muted);
  font-size:.74rem;font-weight:700;letter-spacing:.2px
}
.sound-pill[aria-pressed="true"] {
  background:linear-gradient(135deg,#08796f,#0e8f83);border-color:#08796f;color:#fff;
  box-shadow:0 3px 10px #08796f2e
}
.sound-pill[aria-pressed="true"]:hover {background:linear-gradient(135deg,#06655d,#0a7c71)}
.sound-pill[aria-pressed="true"] .sound-pill-icon {color:#fde68a}
.sound-pill[aria-pressed="true"] .sound-pill-state {background:#f59e0b;color:#2b1800}

/* Khung Camera CSI chuẩn y tế: nền gradient tối dịu, khung ngắm 4 góc và badge độ phân giải. */
.live-viewport {
  position:relative;border-radius:10px;
  background:radial-gradient(circle at 50% 42%,#164458 0%,#0d2b3b 66%,#081e2b 100%)
}
.viewport-badge {
  position:absolute;top:8px;right:8px;z-index:2;pointer-events:none;
  padding:2px 8px;border-radius:999px;background:#081f2ccc;border:1px solid #49c4bd4d;
  color:#d9f5f3;font-size:.7rem;font-weight:600;letter-spacing:.35px;font-variant-numeric:tabular-nums
}
.viewfinder-corners {position:absolute;inset:10px;z-index:1;pointer-events:none}
.viewfinder-corners span {
  position:absolute;width:16px;height:16px;border-color:#4fd9cc88;border-style:solid;border-width:0
}
.viewfinder-corners span:nth-child(1) {top:0;left:0;border-top-width:2px;border-left-width:2px;border-top-left-radius:4px}
.viewfinder-corners span:nth-child(2) {top:0;right:0;border-top-width:2px;border-right-width:2px;border-top-right-radius:4px}
.viewfinder-corners span:nth-child(3) {bottom:0;left:0;border-bottom-width:2px;border-left-width:2px;border-bottom-left-radius:4px}
.viewfinder-corners span:nth-child(4) {bottom:0;right:0;border-bottom-width:2px;border-right-width:2px;border-bottom-right-radius:4px}

.gesture-action-banner {
  margin-top:6px;padding:6px 10px;border-radius:8px;border:1px solid #d5e4ec;
  background:#f4f9fb;color:var(--ink);font-size:.82rem;font-weight:600;line-height:1.3
}
.gesture-action-banner[data-state="detecting"] {background:#edf6fc;border-color:#93c5e6;color:#114b70}
.gesture-action-banner[data-state="neutral"] {background:#fff8e6;border-color:#eab308;color:#7a4f00}
.gesture-action-banner[data-state="executed"] {background:#e4f7ee;border-color:#16a34a;color:#0e593d}
.gesture-action-banner[data-state="emergency"] {background:#fee2e2;border-color:#dc2626;color:#991b1b}
.gesture-meters {display:grid;gap:6px;margin-top:7px;padding-top:6px;border-top:1px solid var(--line)}
.meter-row {display:grid;gap:3px}
.meter-head {display:flex;justify-content:space-between;align-items:baseline;gap:8px;font-size:.76rem;color:var(--muted);font-variant-numeric:tabular-nums}
.meter-track {height:6px;border-radius:999px;background:#e3eef2;overflow:hidden}
.meter-fill {height:100%;border-radius:999px;background:#7b9aab;transition:width .14s linear}
.meter-fill[data-tone="ready"] {background:var(--green)}
.meter-fill[data-tone="active"] {background:var(--blue)}
.meter-fill[data-tone="warn"] {background:#c78600}
.meter-fill[data-tone="cooldown"] {background:#8b6c2c}

.device-line .device-command {
  display:inline-flex;flex-direction:column;align-items:flex-end;justify-self:end;
  padding:3px 9px;border-radius:999px;background:#edf3f6;color:var(--ink);font-size:.8rem;line-height:1.25
}
.device-line .device-command::before {
  content:'';display:inline-block;width:7px;height:7px;border-radius:50%;
  background:#8aa0ad;margin-right:6px;vertical-align:middle
}
.device-line .device-command:not(:has(.device-note)) {flex-direction:row;align-items:center}
.device-line .device-command:has(.device-note)::before {display:none}
.device-line .device-command[data-visual-state="on"],
.device-line .device-command[data-visual-state="raised"] {background:#e4f7ee;color:#115e43}
.device-line .device-command[data-visual-state="on"]::before,
.device-line .device-command[data-visual-state="raised"]::before {background:#16a34a}
.device-line .device-command[data-visual-state="lowered"] {background:#e9f4fa;color:#14567a}
.device-line .device-command[data-visual-state="lowered"]::before {background:#0284c7}
.device-line .device-command[data-visual-state="moving"] {background:#fff4d6;color:#7a4f00}
.device-line .device-command[data-visual-state="moving"]::before {background:#d97706}
.device-line .device-command[data-visual-state="error"] {background:#fee2e2;color:#a51d2d}
.device-line .device-command[data-visual-state="error"]::before {background:#dc2626}
.device-line .device-command[data-visual-state="saved"] {background:#f4f8fa;color:var(--muted);border:1px dashed #b9ccd6}

/* Thanh chỉ báo trực quan góc nâng giường MG90S (0° Hạ ↔ 90° Nâng). */
.bed-angle-meter {
  display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:6px;
  padding:3px 0 1px;font-size:.7rem;color:var(--muted);font-variant-numeric:tabular-nums
}
.bed-angle-end {white-space:nowrap;font-weight:600}
.bed-angle-track {
  position:relative;display:block;height:6px;border-radius:999px;background:#e4eef2
}
.bed-angle-fill {
  position:absolute;left:0;top:0;bottom:0;border-radius:999px;background:#0284c7;transition:width .25s ease
}
.bed-angle-knob {
  position:absolute;top:50%;width:10px;height:10px;border-radius:50%;
  background:#fff;border:2px solid #0284c7;transform:translate(-50%,-50%);transition:left .25s ease
}
.bed-angle-meter[data-bed-visual="raised"] .bed-angle-fill {background:#16a34a}
.bed-angle-meter[data-bed-visual="raised"] .bed-angle-knob {border-color:#16a34a}
.bed-angle-meter[data-bed-visual="moving"] .bed-angle-fill {background:#d97706}
.bed-angle-meter[data-bed-visual="moving"] .bed-angle-knob {border-color:#d97706}
.bed-angle-meter[data-bed-visual="error"] .bed-angle-track {background:#fee2e2}

.live-system dd[data-health="ready"],#live-cpu-temp[data-temp-state="normal"] {color:var(--green)}
.live-system dd[data-health="warn"],#live-cpu-temp[data-temp-state="warn"] {color:var(--amber)}
.live-system dd[data-health="error"],#live-cpu-temp[data-temp-state="hot"] {color:var(--red)}
.live-system dd[data-health="off"] {color:var(--muted)}
.emergency-banner {
  display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap;
  padding:7px 9px;margin:5px 0 4px;border-radius:10px;border:1px solid #dc2626;
  background:#fee2e2;color:#991b1b
}
.emergency-banner[data-severity="call"] {border-color:#d97706;background:#ffedd5;color:#9a3412}
.emergency-banner-text {display:grid;gap:1px;min-width:0}
.emergency-banner-text strong {font-size:.8rem;line-height:1.25}
.emergency-banner-text span {font-size:.74rem;font-variant-numeric:tabular-nums}
.emergency-action {
  min-height:30px;padding:3px 9px;font-size:.76rem;border-radius:8px;
  background:#b91c1c;border-color:#b91c1c;color:#fff
}
.emergency-banner[data-severity="call"] .emergency-action {background:#c2410c;border-color:#c2410c}
.recent-care-title {display:inline-flex;align-items:center;gap:6px;flex-wrap:wrap}
.care-priority {
  display:inline-block;padding:1px 6px;border-radius:5px;font-size:.7rem;font-weight:700;
  background:#fee2e2;color:#b91c1c;border:1px solid #fca5a5
}
.care-priority.call {background:#ffedd5;color:#9a3412;border-color:#fdba74}
.care-wait {font-weight:600;color:var(--red);font-variant-numeric:tabular-nums}
.recent-care-list li[data-label="PAIN"][data-status="WAITING"] {
  border-left:3px solid #dc2626;padding-left:8px;background:#fff5f5;border-radius:6px
}
.recent-care-list li[data-label="CALL_NURSE"][data-status="WAITING"] {
  border-left:3px solid #d97706;padding-left:8px;background:#fffbeb;border-radius:6px
}
.recent-care-list li[data-label="WATER"][data-status="WAITING"] {
  border-left:3px solid #0284c7;padding-left:8px
}
.care-queue-table tr.care-priority-pain {background:#fff5f5}
.care-queue-table tr.care-priority-pain td:first-child {border-left:4px solid #dc2626}
.care-queue-table tr.care-priority-call {background:#fffbeb}
.care-queue-table tr.care-priority-call td:first-child {border-left:4px solid #d97706}
.history-actions {display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.history-time-filters {display:flex;flex-wrap:wrap;gap:6px;flex-basis:100%}
.history-time-filters button[aria-pressed="true"] {background:#176e91;color:#fff;border-color:#176e91}

/* Cân đối chiều cao live-overview cho màn hình 1080p: toàn bộ thẻ (gồm LCD/Nút nhấn/CPU) vừa 1 khung nhìn. */
@media (min-width:901px) {
  .header-inner {padding-block:8px}
  .workspace {padding-top:12px}
  .live-overview {gap:14px;margin:2px 0 14px}
  .live-main,.live-side {gap:10px}
  .live-card,.live-camera-card {padding:10px 12px}
  .live-viewport {width:min(100%,614px,max(380px,calc((100dvh - 340px) * 4 / 3)));margin-inline:auto}
  .device-line {min-height:31px;padding:4px 0}
  .live-system dl {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px 16px;margin-top:6px}
  .live-system dl>div {padding:3px 0;font-size:.84rem;border-top:1px solid var(--line)}
  .live-system dl>div:nth-child(1),.live-system dl>div:nth-child(2) {border-top:0}
}

/* Trang đăng nhập chuẩn bệnh viện hiện đại (Smart Healthcare). */
.login-body {
  min-height:100dvh;margin:0;
  background:linear-gradient(145deg,#f0f7f6 0%,#e3f1ef 55%,#d7ebe8 100%);
  display:flex;align-items:center;justify-content:center;padding:20px;color:var(--ink)
}
.login-shell {width:100%;max-width:440px}
.login-card {
  background:#fff;border:1px solid #cde2df;border-radius:20px;padding:32px 28px 24px;
  box-shadow:0 18px 40px #0f766e1a,0 2px 8px #102a380d
}
.login-brand {text-align:center;margin-bottom:22px}
.login-emblem {
  width:56px;height:56px;margin:0 auto 12px;border-radius:16px;
  background:linear-gradient(135deg,#0f766e,#149489);color:#fff;
  display:grid;place-items:center;box-shadow:0 8px 18px #0f766e33
}
.login-emblem svg {width:30px;height:30px}
.login-eyebrow {font-size:.74rem;font-weight:700;letter-spacing:1.3px;color:#0f766e;margin:0 0 6px}
.login-brand h1 {font-size:1.35rem;line-height:1.25;margin:0 0 6px;color:#0f2d3c;letter-spacing:.3px}
.login-subtitle {font-size:.9rem;color:var(--muted);margin:0}
.login-error {
  margin:0 0 16px;padding:10px 12px;border-radius:10px;border:1px solid #f4a4b0;
  background:#fff1f3;color:#9b1c31;font-size:.88rem;font-weight:600
}
.login-form {display:grid;gap:14px}
.login-field {display:grid;gap:6px}
.login-field label {font-size:.88rem;font-weight:600;color:#214557}
.login-field input {
  width:100%;min-height:46px;padding:10px 12px;border:1px solid #bdd4d9;border-radius:11px;
  font:inherit;font-size:.98rem;color:var(--ink);background:#fbfefe
}
.login-field input:focus {outline:2px solid #0f766e;outline-offset:1px;border-color:#0f766e;background:#fff}
.password-input-wrap {position:relative;display:flex;align-items:center}
.password-input-wrap input {padding-right:46px}
.password-toggle {
  position:absolute;right:4px;min-height:38px;width:38px;padding:0;border:0;border-radius:8px;
  background:transparent;color:var(--muted)
}
.password-toggle:hover {background:#eaf5f3;color:#0f766e}
.password-toggle svg {width:20px;height:20px}
.login-submit {
  width:100%;min-height:48px;margin-top:4px;border-radius:12px;border:0;
  background:linear-gradient(135deg,#0f766e,#0d8f84);color:#fff;font-size:1rem;font-weight:700;
  box-shadow:0 8px 18px #0f766e2e
}
.login-submit:hover {background:linear-gradient(135deg,#0c615b,#0b786e)}
.login-footer {
  margin-top:18px;padding-top:12px;border-top:1px solid #e6f0ee;text-align:center;
  font-size:.78rem;color:var(--muted)
}

/* Nút hồ sơ & menu tài khoản thả xuống gọn gàng trên Header. */
.page-header {position:relative;z-index:20}
.header-account {position:relative;display:inline-flex;align-items:center;min-width:0}
.user-pill.user-menu-trigger {
  display:inline-flex;align-items:center;gap:7px;min-height:38px;padding:4px 12px 4px 5px;
  border-radius:999px;background:#f2faf8;border:1px solid #b5dcd6;color:#103846;
  font-size:.83rem;font-weight:600;max-width:100%;cursor:pointer;
  transition:background .15s ease,border-color .15s ease,box-shadow .15s ease
}
.user-pill.user-menu-trigger:hover,
.user-pill.user-menu-trigger[aria-expanded="true"] {
  background:#e6f5f2;border-color:#0f766e;box-shadow:0 3px 10px #0f766e1f
}
.user-pill.user-menu-trigger:focus-visible {outline:2px solid #0f766e;outline-offset:2px}
.user-avatar {
  display:inline-flex;align-items:center;justify-content:center;
  width:28px;height:28px;flex-shrink:0;border-radius:50%;
  background:linear-gradient(135deg,#0f766e,#149489);color:#fff;
  font-size:.72rem;font-weight:700;letter-spacing:.3px
}
.user-pill[data-role="NURSE"] .user-avatar {background:linear-gradient(135deg,#0284c7,#0369a1)}
.user-role-tag {
  padding:2px 8px;border-radius:999px;background:#0f766e;color:#fff;
  font-size:.7rem;font-weight:700;white-space:nowrap
}
.user-pill[data-role="NURSE"] .user-role-tag {background:#e0f2fe;color:#0369a1;border:1px solid #bae6fd}
.user-full-name {font-weight:650;max-width:165px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.user-menu-chevron {
  font-size:.75rem;color:#4a6b78;margin-left:1px;transition:transform .15s ease
}
.user-pill.user-menu-trigger[aria-expanded="true"] .user-menu-chevron {transform:rotate(180deg)}

.account-dropdown {
  position:absolute;top:calc(100% + 8px);right:0;z-index:50;
  width:min(252px,calc(100vw - 24px));padding:6px;border-radius:14px;
  background:#fff;border:1px solid #cde0e5;
  box-shadow:0 16px 34px #0e2d3c24,0 2px 6px #0e2d3c0f;
  display:grid;gap:2px
}
.account-dropdown-head {
  display:grid;gap:2px;padding:8px 10px 9px;margin-bottom:2px;
  border-bottom:1px solid #e7f0f3
}
.account-dropdown-head strong {font-size:.88rem;color:#0f2d3c;line-height:1.25;overflow-wrap:anywhere}
.account-dropdown-head span {font-size:.75rem;color:var(--muted);overflow-wrap:anywhere}
.account-menu-item {
  display:flex;align-items:center;justify-content:flex-start;gap:10px;width:100%;min-height:38px;padding:8px 10px;
  border:0;border-radius:9px;background:transparent;color:#173d4e;
  font:inherit;font-size:.86rem;font-weight:600;text-align:left;text-decoration:none;cursor:pointer;
  transition:background .12s ease,color .12s ease
}
.account-menu-item:hover,.account-menu-item:focus-visible {background:#edf7f6;color:#0f766e;outline:none}
.menu-item-icon {display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;flex-shrink:0;color:#486978}
.menu-item-icon .icon {width:17px;height:17px}
.account-menu-item:hover .menu-item-icon {color:#0f766e}
.account-menu-divider {border:0;border-top:1px solid #e7f0f3;margin:4px 6px}
.account-menu-section-label {
  padding:4px 10px 2px;font-size:.69rem;font-weight:750;letter-spacing:.45px;
  text-transform:uppercase;color:#627d8c
}
.account-menu-reboot {color:#9a5400}
.account-menu-reboot .menu-item-icon {color:#b86800}
.account-menu-reboot:hover,.account-menu-reboot:focus-visible {background:#fff7e6;color:#7c4300}
.account-menu-reboot:hover .menu-item-icon {color:#7c4300}
.account-menu-power {color:#a31c31}
.account-menu-power .menu-item-icon {color:#b91c1c}
.account-menu-power:hover,.account-menu-power:focus-visible {background:#fff1f3;color:#881427}
.account-menu-power:hover .menu-item-icon {color:#881427}
.account-menu-logout {color:#a91d34}
.account-menu-logout .menu-item-icon {color:#be2941}
.account-menu-logout:hover,.account-menu-logout:focus-visible {background:#fff1f3;color:#991b2e}
.account-menu-logout:hover .menu-item-icon {color:#991b2e}

/* Hộp thoại xác nhận Khởi động lại / Tắt nguồn Raspberry Pi. */
.pi-power-dialog {width:min(540px,calc(100vw - 24px))}
.pi-power-head {display:flex;align-items:flex-start;gap:12px;margin-bottom:12px}
.pi-power-badge-icon {
  display:inline-flex;align-items:center;justify-content:center;
  width:42px;height:42px;flex-shrink:0;border-radius:12px;
  background:#fff1f3;color:#b91c1c;border:1px solid #f4c2ca
}
.pi-power-badge-icon .icon {width:22px;height:22px}
.pi-power-head h2 {margin:0 0 3px;font-size:1.12rem;line-height:1.25;color:#0f2d3c}
.pi-power-head p {margin:0;font-size:.86rem}
.pi-power-steps {
  margin:0 0 12px;padding:12px 14px 12px 30px;border-radius:12px;
  background:#f5fafb;border:1px solid #d7e6ec;font-size:.86rem;line-height:1.5;color:#1b4052;
  display:grid;gap:6px
}
.pi-power-steps code {font-size:.8rem;background:#e6f1f5;padding:1px 5px;border-radius:5px}
.pi-power-confirm[data-action="reboot"] {background:#b45309;border-color:#b45309}
.pi-power-confirm[data-action="reboot"]:hover:not(:disabled) {background:#92400e}
.pi-power-confirm[data-action="shutdown"] {background:#b91c1c;border-color:#b91c1c}
.pi-power-confirm[data-action="shutdown"]:hover:not(:disabled) {background:#991b1b}

.account-btn {
  display:inline-flex;align-items:center;justify-content:center;min-height:34px;padding:4px 10px;
  border-radius:9px;border:1px solid #b8ceda;background:#fff;color:var(--blue);
  font-size:.8rem;font-weight:600;text-decoration:none;white-space:nowrap
}
.account-btn:hover {background:#edf6fa}

/* Hộp thoại Đổi mật khẩu & Quản lý tài khoản nhân viên (Admin) chuẩn y tế, không tràn ngang. */
.account-dialog {
  width:min(500px,calc(100vw - 24px));max-width:calc(100vw - 24px);max-height:92dvh;padding:22px;
  border:1px solid #cde0e5;border-radius:18px;color:var(--ink);overflow:auto;
  box-shadow:0 24px 52px #0d2b3b36
}
.account-dialog::backdrop {background:#0f2a38a8;backdrop-filter:blur(2px)}
.dialog-form {display:grid;gap:11px;margin-top:12px}
.dialog-form label,.admin-create-form label {display:grid;gap:5px;font-size:.82rem;font-weight:650;color:#23485a;min-width:0}
.dialog-form input,.admin-create-form input,.admin-create-form select {
  box-sizing:border-box;min-height:40px;height:40px;padding:6px 10px;
  border:1px solid #bfd5dc;border-radius:9px;font:inherit;font-size:.88rem;width:100%;background:#fff;color:var(--ink)
}
.dialog-form input:focus,.admin-create-form input:focus,.admin-create-form select:focus {
  outline:2px solid #0f766e;outline-offset:1px;border-color:#0f766e
}

.admin-users-dialog {
  width:min(940px,95vw);max-width:95vw;padding:0;overflow:hidden
}
.admin-dialog-header {
  display:flex;align-items:center;justify-content:space-between;gap:14px;
  padding:16px 22px;border-bottom:1px solid #dce8ec;background:#f8fcfc
}
.admin-dialog-heading {display:flex;align-items:center;gap:12px;min-width:0}
.admin-dialog-icon {
  display:inline-flex;align-items:center;justify-content:center;
  width:40px;height:40px;flex-shrink:0;border-radius:12px;
  background:#e2f5f2;color:#0f766e
}
.admin-dialog-icon .icon {width:22px;height:22px}
.admin-dialog-heading h2 {margin:0;font-size:1.12rem;line-height:1.25;color:#0f2d3c}
.admin-dialog-subtitle {margin:2px 0 0;font-size:.82rem;color:var(--muted)}
.admin-close-btn {
  min-height:36px;padding:6px 14px;border-radius:9px;border:1px solid #c2d7df;
  background:#fff;color:#2a4d5f;font-size:.84rem;font-weight:650;white-space:nowrap
}
.admin-close-btn:hover {background:#eef6f9;border-color:#93bac8}
.admin-dialog-body {
  padding:18px 22px 22px;overflow-y:auto;overflow-x:hidden;
  max-height:calc(92dvh - 78px);display:grid;gap:14px
}

.admin-create-card {
  padding:15px 16px;border-radius:14px;background:#eef8f7;border:1px solid #c5e3df;
  display:grid;gap:12px
}
.admin-create-head {
  display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px
}
.admin-create-head h3 {margin:0;font-size:.94rem;font-weight:700;color:#0d5c56}
.admin-stats-pill {
  margin:0;padding:4px 10px;border-radius:999px;background:#fff;border:1px solid #c5e3df;
  font-size:.78rem;font-weight:650;color:#1d5460;font-variant-numeric:tabular-nums
}
.admin-create-form {
  display:grid;
  grid-template-columns:minmax(130px,1fr) minmax(175px,1.3fr) 114px minmax(145px,1fr) auto;
  gap:10px;align-items:end
}
.admin-create-submit {
  min-height:40px;height:40px;padding:0 16px;border-radius:9px;border:0;
  background:linear-gradient(135deg,#0f766e,#118f84);color:#fff;
  font-size:.86rem;font-weight:700;white-space:nowrap;
  box-shadow:0 4px 12px #0f766e29
}
.admin-create-submit:hover {background:linear-gradient(135deg,#0b6059,#0e786f)}

.dialog-status {margin:0;font-size:.86rem;font-weight:600;color:var(--green)}
.dialog-status[data-error="true"] {color:var(--red)}
.dialog-status:empty {display:none}

.admin-users-table-wrap {
  width:100%;border:1px solid #d7e5ea;border-radius:12px;background:#fff;overflow:hidden
}
.admin-users-table {width:100%;min-width:0;border-collapse:collapse;font-size:.86rem;table-layout:auto}
.admin-users-table thead th {
  padding:10px 12px;background:#f4f9fb;border-bottom:1px solid #d7e5ea;
  font-size:.76rem;font-weight:700;letter-spacing:.3px;text-transform:uppercase;
  color:#486675;text-align:left;white-space:nowrap
}
.admin-users-table thead th.admin-actions-col {text-align:right}
.admin-users-table tbody td {
  padding:10px 12px;border-bottom:1px solid #eaf1f4;vertical-align:middle;color:var(--ink)
}
.admin-users-table tbody tr:last-child td {border-bottom:0}
.admin-users-table tbody tr:hover {background:#f9fcfd}
.admin-users-table tbody tr.is-locked {background:#fcfcfd}
.admin-users-table tbody tr.is-locked .staff-fullname,
.admin-users-table tbody tr.is-locked .staff-username {color:#6b808c}

.staff-identity {display:flex;align-items:center;gap:10px;min-width:0}
.staff-avatar {
  display:inline-flex;align-items:center;justify-content:center;
  width:34px;height:34px;flex-shrink:0;border-radius:50%;
  background:#0f766e;color:#fff;font-size:.78rem;font-weight:700;letter-spacing:.4px
}
.staff-avatar[data-role="NURSE"] {background:#e0f2fe;color:#0369a1;border:1px solid #bae6fd}
.staff-username {font-size:.88rem;color:#113647;overflow-wrap:anywhere}
.staff-fullname {font-weight:600;color:#173d4e;overflow-wrap:anywhere}

.staff-role-badge {
  display:inline-flex;align-items:center;padding:3px 10px;border-radius:999px;
  font-size:.76rem;font-weight:700;white-space:nowrap
}
.staff-role-badge[data-role="ADMIN"] {background:#0f766e;color:#fff}
.staff-role-badge[data-role="NURSE"] {background:#e0f2fe;color:#0369a1;border:1px solid #bae6fd}

.staff-status-badge {
  display:inline-flex;align-items:center;gap:6px;padding:3px 10px;border-radius:999px;
  font-size:.76rem;font-weight:650;white-space:nowrap;
  background:#e6f7ef;color:#0f6144
}
.staff-status-badge::before {
  content:'';width:7px;height:7px;border-radius:50%;background:#16a34a
}
.staff-status-badge[data-active="false"] {background:#fee9ec;color:#a31c31}
.staff-status-badge[data-active="false"]::before {background:#dc2626}

.admin-actions-cell {text-align:right;white-space:nowrap}
.admin-row-actions {display:inline-flex;align-items:center;justify-content:flex-end;gap:6px;flex-wrap:nowrap}
.staff-action-btn {
  display:inline-flex;align-items:center;justify-content:center;
  min-height:32px;padding:4px 10px;border-radius:8px;border:1px solid #bfd4de;
  background:#fff;color:#1a4f66;font-size:.78rem;font-weight:650;white-space:nowrap;cursor:pointer;
  transition:background .12s ease,border-color .12s ease
}
.staff-action-btn:hover {background:#eef6fa;border-color:#8db6c8}
.staff-action-btn.is-warn {color:#8a4f00;border-color:#ebd09d;background:#fffbf2}
.staff-action-btn.is-warn:hover {background:#fff1d6;border-color:#d8a94c}
.staff-action-btn.is-unlock {color:#0f6144;border-color:#a7dfc7;background:#f0fbf6}
.staff-action-btn.is-unlock:hover {background:#dff6eb}
.staff-action-btn.is-danger {color:#a31c31;border-color:#eabbc3;background:#fff6f7}
.staff-action-btn.is-danger:hover {background:#fde3e7;border-color:#dc8d9b}

@media (max-width:860px) {
  .admin-create-form {grid-template-columns:repeat(2,minmax(0,1fr))}
  .admin-create-submit {grid-column:1 / -1;width:100%}
}
@media (max-width:720px) {
  .admin-dialog-header {padding:14px 16px}
  .admin-dialog-body {padding:14px 16px 18px}
  .admin-users-table-wrap {border:0;background:transparent}
  .admin-users-table,.admin-users-table tbody {display:block;width:100%}
  .admin-users-table thead {position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
  .admin-users-table tbody {display:grid;gap:10px}
  .admin-users-table tbody tr {
    display:grid;gap:8px;padding:12px;border:1px solid #d7e5ea;border-radius:12px;background:#fff
  }
  .admin-users-table tbody td {
    display:flex;align-items:center;justify-content:space-between;gap:10px;
    padding:0;border:0;text-align:right
  }
  .admin-users-table tbody td::before {
    content:attr(data-label);font-size:.76rem;font-weight:700;color:var(--muted);text-align:left;flex-shrink:0
  }
  .admin-users-table tbody td.admin-actions-cell {
    padding-top:8px;margin-top:2px;border-top:1px solid #eaf1f4;white-space:normal
  }
  .admin-users-table tbody td.admin-actions-cell::before {display:none}
  .admin-row-actions {width:100%;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
  .staff-action-btn {min-height:36px;width:100%}
}
@media (max-width:560px) {
  .admin-create-form {grid-template-columns:minmax(0,1fr)}
  .header-account {margin-left:auto}
  .user-full-name {max-width:115px}
}

/* Dải 3 chỉ số KPI tóm tắt ca trực cho y tá. */
.care-kpi-strip {
  display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:0 0 12px
}
.kpi-card {
  display:flex;align-items:center;justify-content:space-between;gap:10px;
  padding:12px 16px;border-radius:14px;border:1px solid var(--line);background:#fff;
  border-left:4px solid var(--blue)
}
.kpi-card.kpi-waiting {border-left-color:#94a3b8}
.kpi-card.kpi-waiting[data-alert="true"] {
  border-color:#fca5a5;border-left:5px solid #dc2626;background:#fff4f4
}
.kpi-card.kpi-waiting[data-alert="true"] .kpi-value {color:#b91c1c}
.kpi-card.kpi-accepted {border-left-color:#0284c7}
.kpi-card.kpi-completed {border-left-color:#0f766e}
.kpi-label {font-size:.88rem;font-weight:600;color:var(--muted)}
.kpi-value {font-size:1.6rem;line-height:1;font-variant-numeric:tabular-nums;color:var(--ink)}

/* Cột Kết quả tinh gọn tối đa 2 dòng: trạng thái/nguồn/Telegram + mốc giờ ngang. */
.result-line-primary {display:flex;align-items:center;flex-wrap:wrap;gap:5px;line-height:1.3}
.result-status-pill {
  display:inline-flex;align-items:center;padding:2px 8px;border-radius:999px;
  font-size:.8rem;font-weight:700;background:#edf3f6;color:var(--ink)
}
.result-status-pill[data-tone="waiting"] {background:#fff1d6;color:#8a4f00}
.result-status-pill[data-tone="active"] {background:#e0f2fe;color:#075985}
.result-status-pill[data-tone="done"] {background:#e3f7ee;color:#0f6144}
.result-status-pill[data-tone="error"] {background:#fee2e2;color:#a51d2d}
.source-pill {
  display:inline-flex;align-items:center;padding:2px 7px;border-radius:6px;
  font-size:.74rem;font-weight:600;background:#f1f6f9;color:#395869;border:1px solid #d5e4ec
}
.source-pill[data-source="BUTTON"] {background:#f4f0ff;color:#4c3399;border-color:#d8cdf7}
.telegram-pill {
  display:inline-flex;align-items:center;padding:2px 7px;border-radius:6px;
  font-size:.74rem;font-weight:600;background:#edf6f5;color:#0f766e;border:1px solid #bce0db
}
.telegram-pill[data-tg="FAILED"] {background:#fee2e2;color:#b91c1c;border-color:#fca5a5}
.telegram-pill[data-tg="PENDING"] {background:#fff5d9;color:#805500;border-color:#f4d482}
.telegram-pill[data-tg="DISABLED"] {background:#f1f5f7;color:var(--muted);border-color:#d6e2e8}
.result-line-timeline {
  display:flex;flex-wrap:wrap;gap:3px 6px;margin-top:3px;
  font-size:.78rem;color:var(--muted);font-variant-numeric:tabular-nums
}
.result-handler {font-weight:600;color:#124e63}

@media (max-width:640px) {
  .care-kpi-strip {grid-template-columns:minmax(0,1fr);gap:8px}
  .kpi-card {padding:10px 12px}
  .header-inner {flex-wrap:wrap;gap:8px;padding:10px 14px}
}

.print-header,.print-signoff {display:none}
@media print {
  @page {size:A4 portrait;margin:12mm}
  /* Ép toàn bộ khung ngoài về luồng block phẳng để trình duyệt không đẩy bảng xuống trang sau. */
  html,body,.app-shell,.workspace,main,#care-dashboard,#care-view,.care-section,.care-panel,
  .history-panel,#care-history,.care-worklist,.table-wrap,details {
    display:block!important;
    position:static!important;
    width:auto!important;
    max-width:none!important;
    height:auto!important;
    max-height:none!important;
    overflow:visible!important;
    break-inside:auto!important;
    page-break-inside:auto!important;
    box-shadow:none!important;
  }
  body {background:#fff!important;color:#000!important;font-size:10.5pt;line-height:1.4;margin:0;padding:0}
  .workspace {padding:0!important;margin:0!important}
  .skip-link,.page-header,.header-account,.account-dialog,.notice,.sound-pill,.live-overview,.care-filter-panel,.care-filters,
  .history-actions,.care-bulk-actions,.care-bulk-note,.care-pagination,.room-browser,footer,
  #care-bulk-dialog,.care-queue-table button,.care-history-table td details>summary {
    display:none!important
  }
  .care-kpi-strip {display:grid!important;grid-template-columns:repeat(3,1fr)!important;gap:8pt;margin:0 0 10pt}
  .kpi-card {border:1px solid #666!important;border-radius:4pt!important;padding:5pt 8pt!important;background:#fff!important}
  .kpi-value {font-size:12pt!important;color:#000!important}
  .print-header {
    display:block!important;
    margin:0 0 10pt;
    padding:0 0 8pt;
    border-bottom:2px solid #000;
    text-align:center;
  }
  .print-header h1 {font-size:15pt;margin:0 0 6pt;letter-spacing:.4px;color:#000}
  .print-meta {
    display:flex!important;
    justify-content:space-between;
    flex-wrap:wrap;
    gap:4pt 14pt;
    font-size:9.5pt;
    color:#222;
    text-align:left;
  }
  .care-section {
    border:0!important;
    border-radius:0!important;
    background:#fff!important;
    margin:0 0 12pt!important;
    padding:0!important;
  }
  .care-section .section-heading {display:block!important;margin:0 0 4pt}
  .care-section h2,.care-worklist>summary,.older-history>summary {
    font-size:12pt;
    font-weight:700;
    color:#000;
    margin:6pt 0 4pt;
    list-style:none;
    break-after:avoid;
    page-break-after:avoid;
  }
  .history-context,.history-count {margin:2pt 0 6pt;font-size:9.5pt;color:#222}
  .care-section .icon {display:none!important}
  /* Giữ dạng bảng chuẩn khi in, không bị media query mobile biến thành lưới dọc. */
  .responsive-care-table {
    display:table!important;
    width:100%!important;
    min-width:0!important;
    table-layout:auto!important;
    border-collapse:collapse!important;
    margin-top:4pt;
  }
  .responsive-care-table thead {
    display:table-header-group!important;
    position:static!important;
    width:auto!important;
    height:auto!important;
    overflow:visible!important;
    clip-path:none!important;
  }
  .responsive-care-table tbody {display:table-row-group!important}
  .responsive-care-table tr {
    display:table-row!important;
    break-inside:avoid!important;
    page-break-inside:avoid!important;
    border:0!important;
    margin:0!important;
    padding:0!important;
    background:#fff!important;
  }
  .responsive-care-table th,.responsive-care-table td {
    display:table-cell!important;
    border:1px solid #666!important;
    padding:4pt 6pt!important;
    font-size:9pt!important;
    vertical-align:top!important;
    color:#000!important;
    background:#fff!important;
  }
  .responsive-care-table th {background:#eef2f5!important;font-weight:700}
  .care-cell-label {display:none!important}
  .history-category {display:inline!important;padding:0!important;background:none!important;color:#000!important}
  .result-status-pill,.source-pill,.telegram-pill {border:1px solid #888!important;background:#fff!important;color:#000!important;padding:1pt 4pt!important;font-size:8pt!important}
  .result-line-timeline {font-size:8pt!important;color:#222!important}
  .print-signoff {
    display:block!important;
    margin-top:16pt;
    padding-top:10pt;
    border-top:1px solid #666;
    break-inside:avoid!important;
    page-break-inside:avoid!important;
  }
  .print-signatures {
    display:flex!important;
    justify-content:space-between;
    gap:16pt;
    margin-top:26pt;
    font-size:10pt;
  }
}

.sync-reconnecting-badge {
  display:inline-flex;align-items:center;gap:4px;
  padding:2px 8px;border-radius:999px;margin-left:6px;
  background:#fff7ed;border:1px solid #fdba74;color:#9a3412;
  font-size:.74rem;font-weight:650;white-space:nowrap;
}
.sync-reconnecting-badge[hidden] {display:none!important}
