/* ══════════════════════════════════════════════════════════════════
   admin_console.css — 관리자(1212) 화면 껍데기를 앱과 같은 콘솔로
   ------------------------------------------------------------------
   구급대원 앱 · 의료진 앱 · 의료진 PC 콘솔과 같은 시각 언어를 쓴다:
   어두운 남색 바탕, 왼쪽 256px 콘솔 메뉴(그룹 + 부제), 얇은 위 막대.

   원칙: 껍데기만 바꾸고 본문은 그대로 둔다.
         그래프·표·카드(.ns-tab-panel 안쪽, .chart-card, .kpi-card, DT,
         leaflet, echarts)는 지금의 밝은 카드를 유지한다 — 가독성 위험을
         만들지 않기 위해서다.
   imap_theme.css 뒤에 실려 껍데기 선택자만 덮어쓴다. (≥769px 전용)
   ══════════════════════════════════════════════════════════════════ */

@media (min-width: 769px) {

  /* ── 바탕 ─────────────────────────────────────────────── */
  body {
    background: #061224 !important;
  }

  /* ── 위 막대: 52px → 44px 로 줄이고 어둡게 ──────────────── */
  .ns-header {
    background: linear-gradient(90deg, #0a1930 0%, #0d2440 100%) !important;
    height: 44px !important;
    border-bottom: 1px solid rgba(255, 255, 255, .08) !important;
    box-shadow: none !important;
  }
  .ns-logo-area { margin-right: 14px !important; }
  .ns-title { color: #ffffff !important; }
  .ns-subtitle { color: rgba(224, 247, 250, .55) !important; }
  .ns-live { color: #34d399 !important; }
  .ns-date { color: rgba(224, 247, 250, .45) !important; }
  .ns-filter-btn {
    background: rgba(255, 255, 255, .08) !important;
    border: 1px solid rgba(255, 255, 255, .18) !important;
    color: #a5f3fc !important;
  }
  .ns-filter-btn:hover {
    background: rgba(34, 211, 238, .18) !important;
    color: #ffffff !important;
  }
  .ns-progress-bar { background: rgba(255, 255, 255, .07) !important; }
  .ns-progress-fill {
    background: linear-gradient(90deg, #22d3ee 0%, #0891b2 100%) !important;
  }
  /* 위 막대에 있던 탭 줄은 왼쪽 콘솔로 옮긴다(잘려 보이던 원인) */
  .ns-header .ns-tab-bar { display: none !important; }

  /* ── 왼쪽 콘솔 메뉴 ───────────────────────────────────── */
  #ns-console {
    position: fixed;
    top: 46px; left: 0; bottom: 0;
    width: 256px;
    box-sizing: border-box;
    z-index: 150;
    display: flex;
    flex-direction: column;
    padding: 16px 14px 14px;
    overflow-y: auto;
    background: linear-gradient(180deg, #0a1930 0%, #050d1c 100%);
    border-right: 1px solid rgba(255, 255, 255, .08);
    font-family: 'Outfit', 'Noto Sans KR', sans-serif;
  }
  #ns-console::-webkit-scrollbar { width: 6px; }
  #ns-console::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .12); border-radius: 3px;
  }
  #ns-console .ns-cgrp {
    font-size: 10px; font-weight: 700; letter-spacing: .1em;
    color: #64748b; margin: 0 6px 7px; flex-shrink: 0;
  }
  #ns-console .ns-cgrp:not(:first-child) { margin-top: 16px; }
  #ns-console .ns-cnav {
    display: flex; flex-direction: column; gap: 3px; flex-shrink: 0;
  }

  /* 탭 버튼 — 위 막대용 규칙(높이 52px·밑줄)을 지우고 콘솔 항목으로 */
  #ns-console .ns-tab {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    width: 100% !important;
    height: auto !important;
    padding: 9px 11px !important;
    border: 1px solid transparent !important;
    border-radius: 11px !important;
    background: transparent !important;
    color: #94a3b8 !important;
    font-family: 'Outfit', 'Noto Sans KR', sans-serif !important;
    font-size: 13.5px !important;
    font-weight: 600 !important;
    text-align: left !important;
    white-space: normal !important;
    flex-shrink: 0 !important;
    cursor: pointer;
    transition: background .15s, color .15s !important;
  }
  #ns-console .ns-tab:hover {
    background: rgba(255, 255, 255, .05) !important;
    color: #e2e8f0 !important;
  }
  #ns-console .ns-tab:focus-visible {
    outline: 2px solid rgba(34, 211, 238, .7) !important;
    outline-offset: 1px !important;
  }
  #ns-console .ns-tab.active {
    background: rgba(34, 211, 238, .13) !important;
    border-color: rgba(34, 211, 238, .4) !important;
    color: #a5f3fc !important;
    font-weight: 700 !important;
  }
  /* 위 막대에서 쓰던 밑줄 표시는 콘솔에서 쓰지 않는다 */
  #ns-console .ns-tab.active::after { display: none !important; }
  #ns-console .ns-tab svg { flex-shrink: 0; }
  #ns-console .ns-tab ._l { flex: 1; min-width: 0; }
  #ns-console .ns-tab ._l b {
    display: block; font-size: 13px; font-weight: 700; line-height: 1.35;
  }
  #ns-console .ns-tab ._l small {
    display: block; font-size: 10.5px; font-weight: 500;
    color: #64748b; margin-top: 2px; line-height: 1.35;
  }
  /* 실시간 관제 — 늘 눈에 띄게 */
  #ns-console .ns-tab.ns-tab-ctrl {
    color: #fca5a5 !important;
    border-color: rgba(248, 113, 113, .35) !important;
    background: rgba(239, 68, 68, .1) !important;
  }
  #ns-console .ns-tab.ns-tab-ctrl:hover {
    background: rgba(239, 68, 68, .18) !important;
    color: #fecaca !important;
  }
  #ns-console .ns-tab.ns-tab-ctrl.active {
    background: rgba(239, 68, 68, .22) !important;
    border-color: rgba(248, 113, 113, .65) !important;
    color: #fff !important;
  }
  #ns-console .ns-cfoot {
    margin-top: auto;
    padding: 12px 6px 0;
    border-top: 1px solid rgba(255, 255, 255, .07);
    flex-shrink: 0;
  }
  #ns-console .ns-cclock {
    font-family: 'JetBrains Mono', 'Outfit', monospace;
    font-size: 17px; font-weight: 700; color: #e2e8f0;
    font-variant-numeric: tabular-nums;
  }
  #ns-console .ns-cdate { font-size: 10.5px; color: #64748b; margin-top: 3px; }

  /* 창 높이가 낮으면 촘촘하게 — 메뉴 18개가 스크롤 없이 들어가도록 */
  @media (max-height: 1000px) {
    #ns-console { padding: 10px 12px 8px; }
    #ns-console .ns-cnav { gap: 2px; }
    #ns-console .ns-cgrp { margin: 0 6px 4px; }
    #ns-console .ns-cgrp:not(:first-child) { margin-top: 9px; }
    #ns-console .ns-tab { padding: 6px 10px !important; }
    #ns-console .ns-tab ._l small { display: none; }
    #ns-console .ns-cfoot { padding-top: 9px; }
    #ns-console .ns-cclock { font-size: 15px; }
  }
  @media (max-height: 820px) {
    #ns-console .ns-tab { padding: 6px 9px !important; font-size: 12.5px !important; }
    #ns-console .ns-tab ._l b { font-size: 12.5px; }
    #ns-console .ns-cfoot { padding-top: 9px; }
    #ns-console .ns-cclock { font-size: 14px; }
  }
  /* 노트북(720px 높이)에서도 18개가 스크롤 없이 들어가야 한다 —
     항목 여백을 더 줄이고, 자리만 차지하는 시계는 접는다(날짜는 위 막대에 있다) */
  @media (max-height: 768px) {
    #ns-console { padding: 8px 11px 6px; }
    #ns-console .ns-cnav { gap: 1px; }
    #ns-console .ns-cgrp { font-size: 9.5px; margin: 0 6px 3px; }
    #ns-console .ns-cgrp:not(:first-child) { margin-top: 7px; }
    #ns-console .ns-tab { padding: 4px 9px !important; border-radius: 9px !important; }
    #ns-console .ns-tab svg { width: 15px; height: 15px; }
    #ns-console .ns-cfoot { display: none; }
  }

  /* ── 본문: 콘솔 오른쪽으로 ─────────────────────────────── */
  .app-container {
    top: 46px !important;
    left: 256px !important;
    right: 0 !important;
    /* ui.R 머리말의 .app-container{width:100vw} 가 살아 있어 좌측 여백만큼
       오른쪽으로 넘쳐 잘린다 — 폭을 다시 자동으로 돌려놓는다 */
    width: auto !important;
    max-width: none !important;
    height: calc(100vh - 46px) !important;
  }

  /* ── 필터 서랍: 콘솔을 덮지 않고 그 옆에서 열린다 ───────── */
  /* 필터 서랍 — 껍데기를 어둡게 바꾸면서 서랍만 밝은 베이지(#F6F4F1)로 남아
     흰 글자가 흰 배경 위에 놓였다(명도비 1.1, 사실상 안 보임). 배경을 함께 어둡게 맞춘다. */
  .sidebar-container {
    left: 256px !important;
    background: #0A1930 !important;
    border-right: 1px solid rgba(34, 211, 238, .16) !important;
    color: #E2E8F0 !important;
  }
  #ns-sidebar-overlay.visible { left: 486px !important; }

  /* ── 실시간 관제 KPI 줄 ────────────────────────────────
     본문이 좌측 메뉴(256px)만큼 좁아지면(노트북 1280px → 본문 1024px)
     KPI 상자가 한 글자 폭까지 눌려 "이/송/중" 처럼 세로로 접혔다.
     (imap_theme.css 뒤쪽 블록이 .ns-ctrl-kpi-box 의 min-width 를 unset 으로 되돌린다)
     → 라벨·숫자는 한 줄로 유지하고, 상자는 눌리지 않게 하며,
        그래도 좁으면 줄 전체를 가로로 흘린다. */
  .ns-ctrl-kpi-strip {
    overflow-x: auto !important;
    scrollbar-width: thin;
  }
  .ns-ctrl-kpi-strip::-webkit-scrollbar { height: 5px; }
  .ns-ctrl-kpi-strip::-webkit-scrollbar-thumb {
    background: rgba(15, 35, 64, .18); border-radius: 3px;
  }
  .ns-ctrl-kpi-box {
    flex-shrink: 0 !important;
    min-width: 92px !important;
    padding: 0 11px !important;
  }
  .ns-ctrl-kpi-box:first-child { padding-left: 6px !important; }
  .ns-ctrl-kpi-strip { padding: 0 10px !important; }
  /* 줄이 넘치면 두 줄로 접는다 — 가로로 흘려 버리면 오른쪽 끝의
     [전화번호] [메시지] [LIVE] 가 화면 밖으로 숨는다.
     폭 경계를 정해 두지 않는다: flex-wrap 은 넘칠 때만 접히므로
     넓은 화면은 한 줄, 좁은 화면은 두 줄로 저절로 갈린다. */
  .ns-ctrl-kpi-strip {
    height: auto !important;
    min-height: 52px !important;
    flex-wrap: wrap !important;
    row-gap: 4px !important;
    padding: 5px 10px !important;
    overflow-x: visible !important;
  }
  .ns-ctrl-kpi-box { border-right: 1px solid #e4e7ec !important; }
  .ns-ctrl-date-wrap { flex-wrap: wrap !important; }
  .ns-ctrl-kpi-lbl,
  .ns-ctrl-kpi-val,
  #ctrl-drift-kpi-sub {
    white-space: nowrap !important;
  }
  /* 날짜·버튼 묶음도 눌려서 겹치지 않게 */
  .ns-ctrl-date-wrap { flex-shrink: 0 !important; }

  /* 필터 서랍의 구역 제목이 거의 안 보였다(명암비 1.98:1) — 읽히는 값으로 올린다.
     서랍 배경은 그대로 밝은 크림이다. */
  .sidebar-section-title { color: #5A544E !important; }

  /* ── 어두운 껍데기 위에서 묻히는 글자 ────────────────────────────
     본문 카드는 밝은 채로 두는 원칙은 그대로다. 문제는 카드 밖,
     즉 어두운 바탕 위에 바로 놓인 글자들이 밝은 테마용 진한 색을
     그대로 쓰고 있다는 점이다. ─────────────────────────────── */

  /* 탭 상단 작은 라벨 — color: var(--tab-accent, #0F2340) 이 그대로 남는다.
     실측 명도비: 시공간 패턴 rgb(22,92,53) 2.34 · 데이터베이스 rgb(15,35,64) 1.19.
     어두운 바탕용 밝은 변형으로 덮어쓴다(막대 ::before 도 함께). */
  .ns-tab-hlbl { color: #7DD3FC !important; }
  .ns-tab-hlbl::before { background: #7DD3FC !important; }
  .theme-ai .ns-tab-hlbl, .theme-inet .ns-tab-hlbl { color: #C4B5FD !important; }
  .theme-ai .ns-tab-hlbl::before, .theme-inet .ns-tab-hlbl::before { background: #C4B5FD !important; }
  .theme-comp .ns-tab-hlbl { color: #FCD34D !important; }
  .theme-comp .ns-tab-hlbl::before { background: #FCD34D !important; }
  .theme-flow .ns-tab-hlbl { color: #67E8F9 !important; }
  .theme-flow .ns-tab-hlbl::before { background: #67E8F9 !important; }
  .theme-stp .ns-tab-hlbl { color: #6EE7B7 !important; }
  .theme-stp .ns-tab-hlbl::before { background: #6EE7B7 !important; }
  .theme-db .ns-tab-hlbl { color: #93C5FD !important; }
  .theme-db .ns-tab-hlbl::before { background: #93C5FD !important; }
  .theme-res .ns-tab-hlbl { color: #FCA5A5 !important; }
  .theme-res .ns-tab-hlbl::before { background: #FCA5A5 !important; }

  /* 방법론 — 문서형 화면이라 제목·메타·안내가 모두 밝은 테마용 #0F2340 이다
     (어두운 바탕 위 명도비 1.19, 실측 9곳). 글자를 하나씩 밝히면 흰 카드 안
     같은 색 글자까지 건드리게 되므로, 판 전체에 밝은 바탕을 깔아 원래 대비를
     되살린다 — 사례 관리·지리적 시각화 탭이 이미 같은 형태다. */
  .ns-method-panel { background: #F6F4F1 !important; }
  .sidebar-section-title i { opacity: .75 !important; }

  /* ── 관리자 홈: 실시간 관제 요약 ────────────────────────────────
     첫 화면을 소개 커버 대신 "지금 무슨 일이 벌어지는지"로 바꿨다.
     콘솔(어두운 껍데기) 위에 놓이므로 이 화면은 어두운 톤으로 맞춘다. */
  .tab-pane[data-value="홈"] { background: #071527 !important; }
  .ah-top { padding: 18px 22px 4px; }
  .ah-title { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; }
  .ah-title b { font-size: 17px; font-weight: 800; color: #fff; letter-spacing: -.2px; }
  .ah-title span { font-size: 11.5px; color: #64748b; font-variant-numeric: tabular-nums; }
  .ah-kpis {
    display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px;
  }
  /* 흐르는 배경이 밝은 구간(보라)으로 바뀌면 카드 위 글자 대비가 떨어진다
     → 카드 바탕을 충분히 불투명하게 깔고 글자색을 올린다 */
  .ah-kpi {
    background: rgba(8, 20, 38, .72); border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 13px; padding: 12px 14px; min-width: 0;
    backdrop-filter: blur(2px);
  }
  .ah-kpi-v {
    font-size: 25px; font-weight: 800; line-height: 1;
    font-variant-numeric: tabular-nums; font-family: 'JetBrains Mono', 'Outfit', monospace;
  }
  .ah-kpi-l { font-size: 11.5px; color: #e2e8f0; margin-top: 7px; white-space: nowrap;
              overflow: hidden; text-overflow: ellipsis; }
  .ah-kpi-s { font-size: 10px; color: #94a3b8; margin-top: 2px; white-space: nowrap;
              overflow: hidden; text-overflow: ellipsis; }
  /* ── 메인: 이송 흐름 + AI 브리핑 (관리자 화면의 중심) ── */
  .ah-flow-wrap {
    display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr);
    gap: 12px; padding: 14px 22px 0; flex: 0 0 auto;
  }
  .ah-flow-row {
    display: flex; align-items: center; gap: 9px;
    padding: 8px 10px; border-radius: 10px;
    background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .07);
  }
  .ah-flow-from, .ah-flow-to {
    min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-size: 13px;
  }
  .ah-flow-from { flex: 1 1 0; color: #94a3b8; text-align: right; }
  .ah-flow-to { flex: 1 1 0; color: #fff; font-weight: 700; }
  .ah-flow-arrow { flex-shrink: 0; color: #2dd4f4; font-weight: 800; font-size: 14px; }
  .ah-flow-el {
    flex-shrink: 0; font-size: 11px; font-weight: 700; color: #cbd5e1;
    font-variant-numeric: tabular-nums;
  }
  .ah-brief-text {
    font-size: 12.5px; line-height: 1.7; color: #e2e8f0; white-space: pre-wrap;
    word-break: keep-all; max-height: 190px; overflow-y: auto;
  }
  .ah-brief-time { font-size: 10.5px; color: #64748b; margin-top: 7px; }
  @media (max-width: 1240px) { .ah-flow-wrap { grid-template-columns: minmax(0, 1fr); } }

  .ah-cols {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px; padding: 14px 22px 0;
  }
  .ah-cols:last-child { padding-bottom: 24px; }
  /* 화면 높이와 무관하게 첫 화면이 한 번에 들어오게 한다.
     바깥 틀을 화면에 고정하고, 카드 본문이 남은 높이를 나눠 갖고 스스로 스크롤한다.
     (여백을 몇 px 씩 깎는 방식은 해상도가 조금만 달라지면 다시 넘친다) */
  .tab-pane[data-value="홈"] > #admin_home_ops {
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }
  /* 첫 그리기 전에는 내용이 비어 있어 화면이 통째로 빈다 — 오류처럼 보인다는 신고가 있었다.
     자리표시자를 두어 "불러오는 중"임을 알린다(그려지면 :empty 가 풀려 저절로 사라진다). */
  .tab-pane[data-value="홈"] > #admin_home_ops:empty {
    display: flex !important; align-items: center; justify-content: center;
    min-height: 320px; color: #64748b; font-size: 13px;
  }
  .tab-pane[data-value="홈"] > #admin_home_ops:empty::before {
    content: "실시간 관제 요약을 불러오는 중입니다…";
  }
  .ah-top { flex: 0 0 auto; }
  .ah-cols { flex: 1 1 0; min-height: 0; }
  .ah-card { min-height: 0; }
  .ah-card-b { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
  .ah-card-b::-webkit-scrollbar { width: 5px; }
  .ah-card-b::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .14); border-radius: 3px; }
  .ah-card {
    background: rgba(8, 20, 38, .66); border: 1px solid rgba(255, 255, 255, .11);
    border-radius: 14px; display: flex; flex-direction: column; min-width: 0;
    backdrop-filter: blur(2px);
  }
  .ah-card-h {
    display: flex; align-items: center; gap: 8px;
    padding: 11px 14px 9px; border-bottom: 1px solid rgba(255, 255, 255, .07);
  }
  .ah-card-h b { flex: 1; min-width: 0; font-size: 12.5px; font-weight: 800; color: #a5f3fc;
                 letter-spacing: .02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ah-go {
    flex-shrink: 0; padding: 4px 10px; border-radius: 999px;
    border: 1px solid rgba(34, 211, 238, .4); background: rgba(34, 211, 238, .1);
    color: #a5f3fc; font-family: inherit; font-size: 11px; font-weight: 700; cursor: pointer;
  }
  .ah-go:hover { background: rgba(34, 211, 238, .22); color: #fff; }
  .ah-card-b { padding: 9px 12px 12px; display: flex; flex-direction: column; gap: 5px; }
  .ah-row {
    display: flex; align-items: center; gap: 9px;
    padding: 7px 9px; border-radius: 10px;
    background: rgba(255, 255, 255, .03); border: 1px solid rgba(255, 255, 255, .06);
  }
  .ah-tag {
    flex-shrink: 0; min-width: 30px; text-align: center;
    padding: 2px 7px; border-radius: 6px; font-size: 10.5px; font-weight: 800;
    background: rgba(34, 211, 238, .16); color: #a5f3fc;
  }
  .ah-tag.ah-red { background: rgba(239, 68, 68, .18); color: #fca5a5; }
  .ah-dot {
    flex-shrink: 0; width: 8px; height: 8px; border-radius: 50%;
    background: rgba(255, 255, 255, .18);
  }
  .ah-dot.on { background: #34d399; box-shadow: 0 0 8px rgba(52, 211, 153, .7); }
  .ah-row-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
  .ah-row-t b { font-size: 12.5px; font-weight: 700; color: #fff;
                overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ah-row-t small { font-size: 10.5px; color: #94a3b8;
                    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ah-row-r { flex-shrink: 0; font-size: 11px; font-weight: 700; color: #cbd5e1;
              font-variant-numeric: tabular-nums; }
  .ah-empty { font-size: 11.5px; color: #94a3b8; line-height: 1.6; padding: 4px 2px; word-break: keep-all; }
  .ah-big { display: flex; align-items: baseline; gap: 7px; padding: 2px 2px 6px; }
  .ah-big b { font-size: 27px; font-weight: 800; color: #fff; line-height: 1;
              font-variant-numeric: tabular-nums; font-family: 'JetBrains Mono', 'Outfit', monospace; }
  .ah-big span { font-size: 11.5px; color: #94a3b8; }
  .ah-links { display: flex; flex-wrap: wrap; gap: 6px; }
  .ah-links .ah-go { padding: 7px 12px; font-size: 11.5px; }
  @media (max-width: 1460px) {
    .ah-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .ah-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  }
  /* 화면이 낮으면 KPI 를 두 줄로 접지 않는다 — 두 줄이 되면 위쪽이 190px 을 먹어
     카드 3행이 화면 밖으로 밀린다. 대신 한 줄로 촘촘히 둔다. */
  @media (max-height: 820px) {
    .ah-kpis { grid-template-columns: repeat(7, minmax(0, 1fr)) !important; }
  }
  /* 노트북(720px 높이)에서도 첫 화면이 한눈에 들어와야 한다.
     내용을 숨기지 않고 카드 본문에 자체 스크롤을 준다 — 모니터링 화면이므로
     "무엇이 있는지"가 스크롤 아래로 사라지면 안 된다. */
  @media (max-height: 820px) {
    .ah-top { padding: 12px 18px 2px; }
    .ah-title { margin-bottom: 10px; }
    .ah-kpi { padding: 8px 10px; }
    .ah-kpi-v { font-size: 20px; }
    .ah-kpi-l { margin-top: 4px; font-size: 11px; }
    .ah-kpi-s { display: none; }
    .ah-cols { padding: 9px 18px 0; gap: 9px; }
    .ah-cols:last-child { padding-bottom: 14px; }
    .ah-card-h { padding: 8px 12px 7px; }
    .ah-card-b { padding: 6px 10px 8px; gap: 4px; }
    .ah-card-b::-webkit-scrollbar { width: 5px; }
    .ah-card-b::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .14); border-radius: 3px; }
    .ah-row { padding: 6px 8px; }
    .ah-big { padding: 0 2px 4px; }
    .ah-big b { font-size: 22px; }
  }

  /* 구급대원(0119) · 의료진(1339) 모드에서는 관리자 콘솔을 쓰지 않는다 */
  body.force-mobile-only #ns-console,
  body.hosp-desk-mode #ns-console { display: none !important; }

  /* 2026-09-22: 1440×900 같은 보통 모니터에서 카드가 제목만 남고 내용이 잘렸다 —
     "한 화면에 다 넣기" 위해 카드가 0까지 줄어들 수 있었기 때문(.ah-card/.ah-cols min-height:0).
     카드에 읽을 수 있는 최소 높이를 주고, 넘치면 홈 전체가 스크롤되게 한다.
     큰 모니터에서 자리가 남으면 예전처럼 화면을 채운다(flex-grow 유지). */
  .tab-pane[data-value="홈"] > #admin_home_ops { overflow-y: auto !important; }
  .ah-cols { flex: 1 0 auto; min-height: auto; }
  .ah-card { min-height: 124px; }
  .ah-card-b { max-height: 260px; }
}

/* ══════════════════════════════════════════════════════════════════
   휴대폰 폭 — 관리자(1212)만 콘솔을 내어 준다.
   ⚠️ ui.R 의 @media (max-width:768px) 가 .app-container 를 통째로 숨기고,
      1212 는 force-mobile-only 도 걷어낸다. 그래서 표식이 없으면 관리자는
      모바일에서 갈 곳이 없어 런처 홈만 남는다(접속해도 아무것도 못 하는 상태).
      body.admin-mode 일 때만 관리자 화면을 살리고, 왼쪽 메뉴는 위쪽 가로 줄로 접는다.
      구급대원·의료진 모바일은 이 표식이 없으므로 지금 그대로다.
   ══════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  #ns-console { display: none !important; }

  /* 관리자 모드에서는 모바일 앱·런처 홈이 관리자 화면을 덮지 않게 한다 */
  body.admin-mode #imap-mobile-app,
  body.admin-mode .m-bottom-nav,
  body.admin-mode #_lh-bg,
  body.admin-mode #_lh-shield { display: none !important; }

  body.admin-mode { background: #061224 !important; }

  /* 위 막대 + 가로 메뉴 줄 */
  body.admin-mode #ns-pc-nav {
    display: block !important;
    position: fixed !important; top: 0 !important; left: 0 !important; right: 0 !important;
    z-index: 120 !important;
  }
  body.admin-mode .ns-header {
    display: flex !important; height: 44px !important;
    background: #0A1930 !important; border-bottom: 1px solid rgba(34, 211, 238, .16) !important;
  }
  body.admin-mode #ns-console {
    display: flex !important;
    position: fixed !important; top: 44px !important; left: 0 !important; right: 0 !important;
    bottom: auto !important; width: auto !important; height: 50px !important;
    flex-direction: row !important; align-items: center !important;
    gap: 6px !important; padding: 5px 10px !important;
    overflow-x: auto !important; overflow-y: hidden !important;
    background: #0A1930 !important;
    border-right: none !important;
    border-bottom: 1px solid rgba(34, 211, 238, .16) !important;
    z-index: 119 !important;
  }
  body.admin-mode #ns-console::-webkit-scrollbar { display: none; }
  /* 좁은 줄에서는 그룹 이름·부제·시계를 접는다 — 탭 이름만 남긴다 */
  body.admin-mode #ns-console .ns-cgrp,
  body.admin-mode #ns-console .ns-cfoot,
  body.admin-mode #ns-console .ns-tab ._l small,
  body.admin-mode #ns-console .ns-tab svg { display: none !important; }
  body.admin-mode #ns-console .ns-cnav {
    display: flex !important; flex-direction: row !important; gap: 6px !important;
    flex: 0 0 auto !important;
  }
  body.admin-mode #ns-console .ns-tab {
    flex: 0 0 auto !important; white-space: nowrap !important;
    padding: 8px 13px !important; margin: 0 !important;
    font-size: 12.5px !important; border-radius: 9px !important;
  }
  body.admin-mode #ns-console .ns-tab ._l b { font-size: 12.5px !important; }

  /* 본문 — 위 막대(44) + 메뉴 줄(50) 아래를 남김없이 쓴다 */
  body.admin-mode .app-container {
    display: flex !important;
    position: fixed !important;
    top: 94px !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
    width: auto !important; height: auto !important;
    overflow: hidden !important;
    background: #061224 !important;
  }
  body.admin-mode .main-area { overflow-y: auto !important; }

  /* 홈 요약: 좁은 화면에서는 한 단으로 쌓고 화면 전체가 스크롤되게 둔다 */
  body.admin-mode .ah-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  body.admin-mode .ah-flow-wrap,
  body.admin-mode .ah-cols { grid-template-columns: minmax(0, 1fr) !important; }
  body.admin-mode .tab-pane[data-value="홈"] > #admin_home_ops {
    display: block !important; overflow-y: auto !important;
  }
  body.admin-mode .ah-cols { flex: none !important; }

  /* 필터 서랍도 화면 폭에 맞춘다 */
  body.admin-mode .sidebar-container {
    left: 0 !important; top: 94px !important;
    background: #0A1930 !important; color: #E2E8F0 !important;
  }
  body.admin-mode #ns-sidebar-overlay.visible { left: 0 !important; }
}
