/* ==========================================================================
   AILO Dashboard D25 — 메디보드 (병원 외래 · 병상 운영)
   원형: 클린 메디컬 라이트, 그룹형 화이트 사이드바(접기) + 고밀도 12단 그리드, 대기 현황판은 전광판형
   타이포: Pretendard + IBM Plex Mono(번호·시각) / 컬러: 화이트 + 메디컬 블루, 다크 모드 토글(각 단계 별도 검증)
   ========================================================================== */
:root {
  --ailo-bg: #f3f6fa;
  --ailo-fg: #0f1b2d;
  --ailo-muted: #56667b;
  --ailo-line: #e1e8f0;
  --ailo-accent: #2167d6;
  --ailo-header-h: 64px;
  color-scheme: light;

  --d25-surface: #ffffff;
  --d25-surface-2: #f6f9fc;
  --d25-hover: #eef3fa;
  --d25-accent-soft: #e6effc;
  --d25-accent-ink: #ffffff;
  --d25-accent-text: #1a5bc4;
  --d25-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --d25-side-w: 248px;
  --d25-shadow: 0 1px 2px rgba(15, 27, 45, .04), 0 4px 14px -6px rgba(15, 27, 45, .08);

  /* 차트 범주색 (light/#ffffff 검증 통과) */
  --d25-s1: #2167d6;
  --d25-s2: #e0702a;
  --d25-s3: #0e9e86;
  --d25-cmp: #b3bfcd;
  --d25-grid: #edf1f6;

  /* 상태 (아이콘 + 라벨과 함께만 사용) */
  --d25-good: #1c7c3a;
  --d25-good-bg: #e3f4e8;
  --d25-warn: #8a5600;
  --d25-warn-bg: #fbefd6;
  --d25-serious: #b4461b;
  --d25-serious-bg: #fde6dc;
  --d25-crit: #c22f2f;
  --d25-crit-bg: #fbe1e1;
  --d25-info: #1a5bc4;
  --d25-info-bg: #e6effc;
  --d25-off: #6b7787;
  --d25-off-bg: #eef1f5;
  --d25-meter-ok: #2167d6;
  --d25-meter-warn: #e3a21a;
  --d25-meter-crit: #d03b3b;
  --d25-track: #e6effc;

  /* 대기 현황판(전광판)은 두 모드 모두 어두운 패널 */
  --d25-board: #0c1a2c;
  --d25-board-2: #13253c;
  --d25-board-line: #1f3550;
  --d25-board-fg: #e8f0fa;
  --d25-board-muted: #8ea3bd;
  --d25-board-num: #7fd1ff;
}

/* 다크: OS 설정(라이트 고정 제외) + 토글 */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ailo-bg: #0b121b;
    --ailo-fg: #e6edf5;
    --ailo-muted: #97a7bb;
    --ailo-line: #233142;
    --ailo-accent: #3d8bf0;
    color-scheme: dark;
    --d25-surface: #131c27;
    --d25-surface-2: #172230;
    --d25-hover: #1b2838;
    --d25-accent-soft: #17304f;
    --d25-accent-ink: #06121f;
    --d25-accent-text: #79b0f7;
    --d25-shadow: 0 1px 2px rgba(0, 0, 0, .3);
    --d25-s1: #3d8bf0;
    --d25-s2: #d96c26;
    --d25-s3: #16a080;
    --d25-cmp: #4d5d71;
    --d25-grid: #1e2a39;
    --d25-good: #5fd17f;
    --d25-good-bg: #12301d;
    --d25-warn: #f2c25c;
    --d25-warn-bg: #362a10;
    --d25-serious: #f39a73;
    --d25-serious-bg: #3a1f14;
    --d25-crit: #ff8c8c;
    --d25-crit-bg: #3b1818;
    --d25-info: #79b0f7;
    --d25-info-bg: #17304f;
    --d25-off: #9aa6b5;
    --d25-off-bg: #1f2a37;
    --d25-meter-ok: #3d8bf0;
    --d25-meter-warn: #fab219;
    --d25-meter-crit: #e66767;
    --d25-track: #1e3048;
    --d25-board: #08111c;
    --d25-board-2: #0e1b2b;
    --d25-board-line: #1a2d44;
  }
}
:root[data-theme="dark"] {
  --ailo-bg: #0b121b;
  --ailo-fg: #e6edf5;
  --ailo-muted: #97a7bb;
  --ailo-line: #233142;
  --ailo-accent: #3d8bf0;
  color-scheme: dark;
  --d25-surface: #131c27;
  --d25-surface-2: #172230;
  --d25-hover: #1b2838;
  --d25-accent-soft: #17304f;
  --d25-accent-ink: #06121f;
  --d25-accent-text: #79b0f7;
  --d25-shadow: 0 1px 2px rgba(0, 0, 0, .3);
  --d25-s1: #3d8bf0;
  --d25-s2: #d96c26;
  --d25-s3: #16a080;
  --d25-cmp: #4d5d71;
  --d25-grid: #1e2a39;
  --d25-good: #5fd17f;
  --d25-good-bg: #12301d;
  --d25-warn: #f2c25c;
  --d25-warn-bg: #362a10;
  --d25-serious: #f39a73;
  --d25-serious-bg: #3a1f14;
  --d25-crit: #ff8c8c;
  --d25-crit-bg: #3b1818;
  --d25-info: #79b0f7;
  --d25-info-bg: #17304f;
  --d25-off: #9aa6b5;
  --d25-off-bg: #1f2a37;
  --d25-meter-ok: #3d8bf0;
  --d25-meter-warn: #fab219;
  --d25-meter-crit: #e66767;
  --d25-track: #1e3048;
  --d25-board: #08111c;
  --d25-board-2: #0e1b2b;
  --d25-board-line: #1a2d44;
}

body { background: var(--ailo-bg); font-size: 14px; transition: background-color .25s; }
.app { display: flex; min-height: 100vh; }
.app__main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ===== 사이드바 ===== */
.sb {
  width: var(--d25-side-w); flex: none; position: sticky; top: 0; height: 100vh; z-index: 60;
  background: var(--d25-surface); border-right: 1px solid var(--ailo-line);
  display: flex; flex-direction: column; transition: width .25s var(--ailo-ease);
}
.sb__brand { display: flex; align-items: center; gap: 10px; height: var(--ailo-header-h); padding: 0 18px; border-bottom: 1px solid var(--ailo-line); }
.sb__cross { width: 32px; height: 32px; flex: none; border-radius: 9px; background: var(--ailo-accent); position: relative; }
.sb__cross::before, .sb__cross::after { content: ""; position: absolute; background: #fff; border-radius: 2px; left: 50%; top: 50%; translate: -50% -50%; }
.sb__cross::before { width: 16px; height: 5px; }
.sb__cross::after { width: 5px; height: 16px; }
.sb__name { line-height: 1.2; white-space: nowrap; }
.sb__name b { font-size: 16px; font-weight: 800; letter-spacing: -.02em; display: block; }
.sb__name span { font-size: 11px; color: var(--ailo-muted); }
.sb .sb__close { display: none; margin-left: auto; }
.sb__nav { flex: 1; overflow-y: auto; padding: 8px 12px 12px; }
.sb__group { font-size: 11px; font-weight: 700; color: var(--ailo-muted); letter-spacing: .06em; padding: 14px 10px 6px; white-space: nowrap; }
.sb__link {
  display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 8px; font-weight: 500; font-size: 14px;
  color: var(--ailo-fg); white-space: nowrap; transition: background .15s, color .15s; position: relative;
}
.sb__link i { width: 18px; text-align: center; color: var(--ailo-muted); font-size: 14px; }
.sb__link:hover { background: var(--d25-hover); }
.sb__link.is-active { background: var(--d25-accent-soft); color: var(--d25-accent-text); font-weight: 700; }
.sb__link.is-active i { color: var(--d25-accent-text); }
.sb__link.is-active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--ailo-accent); }
.sb__n { margin-left: auto; font-size: 11px; font-weight: 700; color: var(--d25-crit); background: var(--d25-crit-bg); border-radius: 99px; padding: 1px 7px; font-style: normal; }
.sb__foot { border-top: 1px solid var(--ailo-line); padding: 10px 12px; }
.sb__mini { width: 100%; display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 8px; border: 0; background: transparent; color: var(--ailo-muted); font-size: 13px; white-space: nowrap; }
.sb__mini:hover { background: var(--d25-hover); color: var(--ailo-fg); }
.sb__mini i { width: 18px; }

@media (min-width: 992px) {
  html.sb-mini .sb { width: 72px; }
  html.sb-mini .sb__name, html.sb-mini .sb__link span, html.sb-mini .sb__n, html.sb-mini .sb__mini span { display: none; }
  html.sb-mini .sb__group { font-size: 0; padding: 10px 0 4px; border-top: 1px solid var(--ailo-line); margin-top: 6px; }
  html.sb-mini .sb__link, html.sb-mini .sb__mini { justify-content: center; }
  html.sb-mini .sb__brand { padding: 0 20px; }
}

/* ===== 상단바 ===== */
.top {
  height: var(--ailo-header-h); position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 12px;
  padding: 0 clamp(16px, 2.4vw, 28px); background: var(--d25-surface); border-bottom: 1px solid var(--ailo-line);
}
.ib {
  width: 38px; height: 38px; flex: none; border-radius: 8px; border: 1px solid var(--ailo-line); background: var(--d25-surface);
  color: var(--ailo-fg); display: inline-grid; place-items: center; position: relative; transition: background .15s, border-color .15s;
}
.ib:hover { background: var(--d25-hover); border-color: var(--ailo-accent); }
.top__burger { display: none; }
.top__title { min-width: 0; }
.top__title ol { display: flex; gap: 6px; font-size: 11.5px; color: var(--ailo-muted); white-space: nowrap; }
.top__title li + li::before { content: "›"; margin-right: 6px; }
.top__title h1 { font-size: 18px; font-weight: 800; letter-spacing: -.02em; white-space: nowrap; }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ailo-muted); font-family: var(--d25-mono); padding: 4px 10px; border-radius: 99px; background: var(--d25-surface-2); border: 1px solid var(--ailo-line); white-space: nowrap; }
.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--d25-good); box-shadow: 0 0 0 3px var(--d25-good-bg); }
.top__search { margin-left: auto; position: relative; width: min(320px, 28vw); }
.top__search i { position: absolute; left: 12px; top: 50%; translate: 0 -50%; color: var(--ailo-muted); font-size: 13px; }
.top__search input { width: 100%; height: 38px; border-radius: 8px; border: 1px solid var(--ailo-line); background: var(--d25-surface-2); color: var(--ailo-fg); padding: 0 12px 0 36px; font-size: 13.5px; }
.top__search input::placeholder { color: var(--ailo-muted); }
.top__search input:focus { outline: 2px solid var(--ailo-accent); outline-offset: 0; border-color: transparent; }
.nb { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--d25-meter-crit); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--d25-surface); }
.dd { position: relative; }
.dd__panel { position: absolute; right: 0; top: calc(100% + 8px); width: 340px; max-width: calc(100vw - 32px); background: var(--d25-surface); border: 1px solid var(--ailo-line); border-radius: 10px; box-shadow: 0 16px 40px rgba(10, 20, 35, .18); display: none; z-index: 90; overflow: hidden; }
.dd__panel.is-open { display: block; }
.dd__head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--ailo-line); font-weight: 700; }
.dd__head a { font-size: 12px; color: var(--d25-accent-text); font-weight: 600; }
.dd__panel li a { display: flex; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--ailo-line); font-size: 13px; line-height: 1.45; }
.dd__panel li:last-child a { border-bottom: 0; }
.dd__panel li a:hover { background: var(--d25-hover); }
.dd__panel time { display: block; color: var(--ailo-muted); font-size: 11.5px; }
.dot-ic { width: 28px; height: 28px; flex: none; border-radius: 7px; display: grid; place-items: center; font-size: 12px; }
.me { display: flex; align-items: center; gap: 9px; }
.me__av { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 800; color: var(--d25-accent-text); background: var(--d25-accent-soft); }
.me__t { line-height: 1.2; white-space: nowrap; }
.me__t b { display: block; font-size: 13px; }
.me__t span { font-size: 11.5px; color: var(--ailo-muted); }

/* ===== 본문 ===== */
.content { padding: clamp(14px, 2vw, 24px) clamp(16px, 2.4vw, 28px); display: grid; gap: 16px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.seg { display: inline-flex; border: 1px solid var(--ailo-line); border-radius: 8px; overflow: hidden; background: var(--d25-surface); }
.seg button { border: 0; background: transparent; padding: 7px 16px; font-size: 13px; font-weight: 600; color: var(--ailo-muted); border-right: 1px solid var(--ailo-line); }
.seg button:last-child { border-right: 0; }
.seg button:hover { background: var(--d25-hover); color: var(--ailo-fg); }
.seg button[aria-pressed="true"] { background: var(--ailo-accent); color: var(--d25-accent-ink); }
.filters__info { font-size: 12.5px; color: var(--ailo-muted); }
.filters__info b { color: var(--ailo-fg); }
.btn-m { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--ailo-line); background: var(--d25-surface); font-size: 13px; font-weight: 600; color: var(--ailo-fg); }
.btn-m:hover { border-color: var(--ailo-accent); color: var(--d25-accent-text); }
.btn-m--p { margin-left: 0; background: var(--ailo-accent); border-color: var(--ailo-accent); color: var(--d25-accent-ink); }
.btn-m--p:hover { filter: brightness(1.08); color: var(--d25-accent-ink); }

.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.box { background: var(--d25-surface); border: 1px solid var(--ailo-line); border-radius: 10px; padding: 16px 18px; min-width: 0; box-shadow: var(--d25-shadow); }
.box__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.box__head h2 { font-size: 15px; font-weight: 800; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
.box__head h2 i { color: var(--ailo-accent); font-size: 14px; }
.box__head p { font-size: 12px; color: var(--ailo-muted); margin-top: 1px; }
.box__link { font-size: 12.5px; color: var(--d25-accent-text); font-weight: 600; }
.box__link:hover { text-decoration: underline; }

/* KPI */
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.kpi { padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.kpi__label { font-size: 12.5px; color: var(--ailo-muted); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.kpi__label i { color: var(--ailo-accent); font-size: 12px; }
.kpi__row { display: flex; align-items: flex-end; justify-content: space-between; gap: 6px; }
.kpi__val { font-size: clamp(21px, 1.8vw, 26px); font-weight: 800; letter-spacing: -.03em; line-height: 1.25; }
.kpi__val small { font-size: 12.5px; font-weight: 600; color: var(--ailo-muted); margin-left: 2px; }
.spark { width: 70px; height: 26px; flex: none; margin-bottom: 4px; }
.delta { font-size: 11.5px; font-weight: 700; display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.delta.is-good { color: var(--d25-good); }
.delta.is-bad { color: var(--d25-crit); }
.delta.is-neutral { color: var(--ailo-fg); }
.delta em { font-style: normal; font-weight: 500; color: var(--ailo-muted); }

/* ===== 대기 현황판 ===== */
.g-board { grid-column: span 8; }
.g-beds { grid-column: span 4; }
.g-line { grid-column: span 7; }
.g-dept { grid-column: span 5; }
.g-table { grid-column: span 8; }
.g-log { grid-column: span 4; }
.board { background: var(--d25-board); color: var(--d25-board-fg); border-color: var(--d25-board-line); }
.board .box__head h2 i { color: var(--d25-board-num); }
.board .box__head p { color: var(--d25-board-muted); }
.board select {
  height: 34px; border-radius: 7px; border: 1px solid var(--d25-board-line); background: var(--d25-board-2); color: var(--d25-board-fg);
  font-size: 13px; padding: 0 30px 0 10px; appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--d25-board-muted) 50%), linear-gradient(135deg, var(--d25-board-muted) 50%, transparent 50%);
  background-position: calc(100% - 15px) 15px, calc(100% - 10px) 15px; background-size: 5px 5px; background-repeat: no-repeat;
}
.board select:focus { outline: 2px solid var(--d25-board-num); outline-offset: 1px; }
.board__tools { display: flex; align-items: center; gap: 10px; }
.board__clock { font-family: var(--d25-mono); font-size: 13px; color: var(--d25-board-muted); }
.board__clock b { color: var(--d25-board-fg); font-size: 16px; }
.bwrap { overflow-x: auto; }
.btbl { width: 100%; border-collapse: collapse; min-width: 700px; font-size: 13.5px; }
.btbl th { font-size: 11.5px; font-weight: 600; color: var(--d25-board-muted); text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--d25-board-line); white-space: nowrap; letter-spacing: .02em; }
.btbl td { padding: 10px; border-bottom: 1px solid var(--d25-board-line); white-space: nowrap; }
.btbl tbody tr:last-child td { border-bottom: 0; }
.btbl .dept { font-weight: 700; font-size: 14px; }
.btbl .room { font-size: 12px; color: var(--d25-board-muted); }
.btbl .num { font-family: var(--d25-mono); font-size: 22px; font-weight: 600; color: var(--d25-board-num); letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.btbl .num.is-off { color: var(--d25-board-muted); font-size: 16px; }
.btbl .wait { font-family: var(--d25-mono); font-variant-numeric: tabular-nums; font-size: 15px; }
.btbl .wait small { font-family: var(--ailo-font); font-size: 11.5px; color: var(--d25-board-muted); margin-left: 2px; }
.btbl tr.is-flash td { animation: d25flash 1.2s ease-out; }
@keyframes d25flash { from { background: rgba(127, 209, 255, .16); } to { background: transparent; } }
.bst { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 99px; }
.bst--good { background: rgba(12, 163, 12, .18); color: #7fe39a; }
.bst--warn { background: rgba(250, 178, 25, .18); color: #ffd46b; }
.bst--serious { background: rgba(236, 131, 90, .2); color: #ffab88; }
.bst--info { background: rgba(127, 209, 255, .14); color: #9edcff; }
.bst--off { background: rgba(142, 163, 189, .14); color: var(--d25-board-muted); }
.wbar { display: block; width: 90px; height: 4px; border-radius: 99px; background: var(--d25-board-line); margin-top: 5px; overflow: hidden; }
.wbar i { display: block; height: 100%; border-radius: 99px; }
.board__foot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--d25-board-muted); margin-top: 10px; }
.board__foot b { color: var(--d25-board-fg); }

/* 병상 */
.beds__total { display: flex; align-items: baseline; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--ailo-line); margin-bottom: 6px; }
.beds__total b { font-size: 34px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.beds__total span { font-size: 12.5px; color: var(--ailo-muted); }
.meter { display: grid; grid-template-columns: 92px 1fr 54px; gap: 10px; align-items: center; padding: 7px 0; font-size: 13px; }
.meter__name b { display: block; font-weight: 700; }
.meter__name span { font-size: 11.5px; color: var(--ailo-muted); }
.meter__bar { height: 8px; border-radius: 99px; background: var(--d25-track); overflow: hidden; }
.meter__bar i { display: block; height: 100%; border-radius: 99px; transition: width .5s var(--ailo-ease); }
.meter__val { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
.meter__val span { display: block; font-size: 11px; font-weight: 700; }
.lv-ok { color: var(--d25-info); }
.lv-warn { color: var(--d25-warn); }
.lv-crit { color: var(--d25-crit); }
.beds__legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11.5px; color: var(--ailo-muted); margin-top: 8px; }
.beds__legend span { display: inline-flex; align-items: center; gap: 5px; }

/* 차트 */
.chart-box { position: relative; height: 270px; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--ailo-fg); align-items: center; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; width: 16px; height: 2px; border-radius: 2px; }
.legend i.sq { width: 10px; height: 10px; border-radius: 2px; }
.mix { margin: 4px 0 12px; }
.mix__bar { display: flex; gap: 2px; height: 8px; }
.mix__bar span { border-radius: 99px; }
.mix .legend { margin-top: 6px; color: var(--ailo-muted); }
.mix .legend b { color: var(--ailo-fg); }
.tv { margin-top: 8px; font-size: 12.5px; }
.tv summary { cursor: pointer; color: var(--ailo-muted); font-weight: 600; width: max-content; }
.tv summary:hover { color: var(--d25-accent-text); }
.tv__wrap { overflow: auto; max-height: 220px; margin-top: 6px; }
.tv table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.tv th, .tv td { padding: 5px 8px; border-bottom: 1px solid var(--ailo-line); text-align: right; white-space: nowrap; }
.tv th:first-child, .tv td:first-child { text-align: left; }

/* 테이블 */
.tsearch { position: relative; }
.tsearch i { position: absolute; left: 11px; top: 50%; translate: 0 -50%; font-size: 12px; color: var(--ailo-muted); }
.tsearch input { height: 34px; width: 220px; max-width: 100%; border-radius: 8px; border: 1px solid var(--ailo-line); background: var(--d25-surface-2); color: var(--ailo-fg); padding: 0 10px 0 30px; font-size: 13px; }
.tsearch input::placeholder { color: var(--ailo-muted); }
.tsearch input:focus { outline: 2px solid var(--ailo-accent); outline-offset: 0; }
.twrap { overflow-x: auto; border: 1px solid var(--ailo-line); border-radius: 8px; }
.tbl { width: 100%; border-collapse: collapse; min-width: 760px; font-size: 13px; }
.tbl th { text-align: left; font-size: 11.5px; font-weight: 700; color: var(--ailo-muted); padding: 9px 12px; background: var(--d25-surface-2); border-bottom: 1px solid var(--ailo-line); white-space: nowrap; }
.tbl th button { border: 0; background: none; padding: 0; color: inherit; font-weight: 700; display: inline-flex; align-items: center; gap: 5px; }
.tbl th button i { font-size: 10px; opacity: .5; }
.tbl th button:hover { color: var(--ailo-fg); }
.tbl th[aria-sort="ascending"] button, .tbl th[aria-sort="descending"] button { color: var(--d25-accent-text); }
.tbl th[aria-sort="ascending"] button i, .tbl th[aria-sort="descending"] button i { opacity: 1; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--ailo-line); white-space: nowrap; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: var(--d25-hover); }
.tbl .mono { font-family: var(--d25-mono); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.tbl .sub { display: block; font-size: 11.5px; color: var(--ailo-muted); }
.tbl__empty { text-align: center; padding: 24px !important; color: var(--ailo-muted); }
.tag { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 5px; border: 1px solid var(--ailo-line); color: var(--ailo-muted); }
.tag--new { color: var(--d25-accent-text); border-color: currentColor; }
.st { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 99px; }
.st--good { background: var(--d25-good-bg); color: var(--d25-good); }
.st--warn { background: var(--d25-warn-bg); color: var(--d25-warn); }
.st--serious { background: var(--d25-serious-bg); color: var(--d25-serious); }
.st--info { background: var(--d25-info-bg); color: var(--d25-info); }
.st--off { background: var(--d25-off-bg); color: var(--d25-off); }
.st--crit { background: var(--d25-crit-bg); color: var(--d25-crit); }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; font-size: 12.5px; color: var(--ailo-muted); }
.pager__btns { display: flex; gap: 4px; }
.pager__btns button { min-width: 32px; height: 32px; border-radius: 7px; border: 1px solid var(--ailo-line); background: var(--d25-surface); font-size: 12.5px; font-weight: 600; color: var(--ailo-fg); }
.pager__btns button:hover:not(:disabled) { border-color: var(--ailo-accent); color: var(--d25-accent-text); }
.pager__btns button[aria-current="page"] { background: var(--ailo-accent); border-color: var(--ailo-accent); color: var(--d25-accent-ink); }
.pager__btns button:disabled { opacity: .4; cursor: default; }

/* 활동 */
.feed li { display: grid; grid-template-columns: auto 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--ailo-line); }
.feed li:last-child { border-bottom: 0; }
.feed p { font-size: 13px; line-height: 1.45; }
.feed time { font-size: 11.5px; color: var(--ailo-muted); font-family: var(--d25-mono); }
.c-good { background: var(--d25-good-bg); color: var(--d25-good); }
.c-warn { background: var(--d25-warn-bg); color: var(--d25-warn); }
.c-crit { background: var(--d25-crit-bg); color: var(--d25-crit); }
.c-info { background: var(--d25-info-bg); color: var(--d25-info); }

.foot { padding: 14px clamp(16px, 2.4vw, 28px) 24px; font-size: 12px; color: var(--ailo-muted); display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.foot a:hover { color: var(--d25-accent-text); }
.sb-overlay { display: none; }

/* ===== 반응형 ===== */
@media (max-width: 1399.98px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .me__t { display: none; }
}
@media (max-width: 1199.98px) {
  .g-board, .g-beds, .g-line, .g-dept, .g-table, .g-log { grid-column: span 12; }
  .g-beds .beds__list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; }
  .live { display: none; }
}
@media (max-width: 991.98px) {
  .sb {
    position: fixed; left: 0; top: 0; bottom: 0; height: auto; width: min(280px, 84vw);
    translate: -100% 0; visibility: hidden; z-index: 130; transition: translate .28s var(--ailo-ease), visibility .28s;
  }
  html.sb-open .sb { translate: 0 0; visibility: visible; box-shadow: 16px 0 40px rgba(0, 0, 0, .22); transition: translate .28s var(--ailo-ease), visibility 0s; } /* 열 때 visibility 즉시 → 곧바로 포커스 가능 */
  .sb .sb__close { display: inline-grid; }
  .sb__foot { display: none; }
  .sb-overlay { display: block; position: fixed; inset: 0; z-index: 120; background: rgba(8, 15, 25, .5); opacity: 0; visibility: hidden; transition: opacity .28s, visibility .28s; }
  html.sb-open .sb-overlay { opacity: 1; visibility: visible; }
  html.sb-open body { overflow: hidden; }
  .top__burger { display: inline-grid; }
}
@media (max-width: 767.98px) {
  .top { height: auto; flex-wrap: wrap; padding-block: 10px; }
  .top__search { order: 5; flex-basis: 100%; width: auto; margin-left: 0; }
  .top__tools { margin-left: auto; }
  .top__title ol { display: none; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-beds .beds__list { display: block; }
  .btn-m { margin-left: 0; }
}
@media (max-width: 575.98px) {
  .filters .seg { width: 100%; }
  .filters .seg button { flex: 1; }
  .filters .btn-m { flex: 1; justify-content: center; white-space: nowrap; }
  .filters__info { flex-basis: 100%; order: 3; }
  .spark { width: 52px; }
  .chart-box { height: 240px; }
  .tsearch, .tsearch input { width: 100%; }
  .board__tools { width: 100%; justify-content: space-between; }
  .meter { grid-template-columns: 84px 1fr 50px; }
}
@media (prefers-reduced-motion: reduce) {
  .btbl tr.is-flash td { animation: none; }
}
