/* ==========================================================================
   AILO Dashboard D27 — 딜리버리 관제 (물류 실시간 배송 관제)
   원형: 관제실 다크 — 아이콘 레일 + 고밀도 HUD 패널 그리드, 중앙 SVG 차량 지도
   타이포: JetBrains Mono(수치·라벨) + Pretendard(한글) / 컬러: 블랙 + 시안, 상태색은 아이콘·모양 병기
   ========================================================================== */

:root {
  color-scheme: dark;
  --ailo-bg: #04070a;
  --ailo-fg: #e3eef2;
  --ailo-muted: #8aa0ab;
  --ailo-line: #16242e;
  --ailo-accent: #22d3ee;
  --ailo-accent-ink: #001a20;

  --d27-panel: #091016;
  --d27-panel-2: #0c161d;
  --d27-cyan: #22d3ee;
  --d27-cyan-dim: rgba(34, 211, 238, .14);
  --d27-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* 차트: 시안(다크 밴드 PASS) + 비교 회색(강조형) */
  --d27-s1: #0aa2ba;
  --d27-s0: #5a6873;
  --d27-grid: #13202a;
  --d27-base: #23333f;
  --d27-axis: #7d939f;

  /* 상태 (모양·아이콘·라벨 병기) */
  --d27-run: #22d3ee;
  --d27-warn: #fab219;
  --d27-crit: #e0474a;
  --d27-crit-txt: #ff8b8d;
  --d27-stop: #6b7a86;
  --d27-good: #3ccf6e;

  --d27-rail: 64px;
  --d27-rail-wide: 216px;
  --d27-gap: 10px;
}

body {
  background:
    radial-gradient(1200px 600px at 60% -10%, rgba(34, 211, 238, .06), transparent 60%),
    var(--ailo-bg);
  font-size: 13px;
}
.mono { font-family: var(--d27-mono); }
.muted { color: var(--ailo-muted); }
.kpi__v, .tbl td.num, .clock, .pager, .term time, .fleet dd, .zones-list b { font-family: var(--d27-mono); font-variant-numeric: tabular-nums; }

.app { display: flex; min-height: 100vh; }
.shell { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ---------- Icon rail ---------- */
.rail {
  position: sticky; top: 0; height: 100vh; width: var(--d27-rail); flex-shrink: 0; z-index: 60;
  background: #020405; border-right: 1px solid var(--ailo-line); display: flex; flex-direction: column;
  transition: width .28s var(--ailo-ease);
}
.rail__brand { height: 60px; display: flex; align-items: center; justify-content: center; border-bottom: 1px solid var(--ailo-line); padding: 0 14px; gap: 8px; flex-shrink: 0; }
.rail__logo { display: flex; align-items: center; gap: 10px; color: var(--d27-cyan); white-space: nowrap; overflow: hidden; }
.rail__logo svg { flex-shrink: 0; filter: drop-shadow(0 0 6px rgba(34, 211, 238, .5)); }
.rail__name { display: none; font-family: var(--d27-mono); font-weight: 700; font-size: 13px; letter-spacing: .08em; color: var(--ailo-fg); }
.rail__name b { color: var(--d27-cyan); margin-left: 6px; font-family: var(--ailo-font); letter-spacing: 0; }
.rail__close { display: none; margin-left: auto; width: 32px; height: 32px; border: 1px solid var(--ailo-line); background: transparent; color: var(--ailo-fg); border-radius: 2px; }
.rail__nav { flex: 1; display: flex; flex-direction: column; gap: 4px; padding: 12px 10px; }
.rail__nav a {
  position: relative; display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 13px; border-radius: 3px;
  color: #7f95a1; white-space: nowrap; transition: background .2s, color .2s; border: 1px solid transparent;
}
.rail__nav a i { width: 18px; text-align: center; font-size: 15px; flex-shrink: 0; }
.rail__nav a span { display: none; font-weight: 600; }
.rail__nav a:hover { color: var(--ailo-fg); background: #0b151b; }
.rail__nav a.is-active { color: var(--d27-cyan); background: var(--d27-cyan-dim); border-color: rgba(34, 211, 238, .35); box-shadow: inset 0 0 12px rgba(34, 211, 238, .12); }
.rail__nav a.is-active::before { content: ""; position: absolute; left: -11px; top: 10px; bottom: 10px; width: 2px; background: var(--d27-cyan); box-shadow: 0 0 8px var(--d27-cyan); }
.rail__nav em { position: absolute; top: 4px; left: 30px; font-style: normal; font-family: var(--d27-mono); font-size: 9px; font-weight: 700; background: var(--d27-crit); color: #fff; padding: 0 4px; border-radius: 2px; line-height: 14px; }
/* tooltip for icon-only rail */
.rail__nav a[data-tip]::after {
  content: attr(data-tip); position: absolute; left: calc(100% + 12px); top: 50%; translate: 0 -50%;
  background: #02161c; color: var(--ailo-fg); border: 1px solid rgba(34, 211, 238, .4); padding: 4px 8px; font-size: 12px; border-radius: 2px;
  opacity: 0; pointer-events: none; transition: opacity .15s; z-index: 5;
}
.rail__nav a:hover::after, .rail__nav a:focus-visible::after { opacity: 1; }
.rail__toggle { display: flex; align-items: center; gap: 12px; height: 46px; margin: 10px; padding: 0 13px; border: 1px solid var(--ailo-line); background: transparent; color: #7f95a1; border-radius: 3px; white-space: nowrap; overflow: hidden; }
.rail__toggle:hover { color: var(--d27-cyan); border-color: rgba(34, 211, 238, .4); }
.rail__toggle i { width: 18px; flex-shrink: 0; transition: rotate .25s; }
.rail__toggle span { display: none; }

html.rail-wide .rail { width: var(--d27-rail-wide); }
html.rail-wide .rail__brand { justify-content: flex-start; }
html.rail-wide .rail__name, html.rail-wide .rail__nav a span, html.rail-wide .rail__toggle span { display: inline; }
html.rail-wide .rail__nav em { position: static; margin-left: auto; font-size: 10px; padding: 0 6px; }
html.rail-wide .rail__nav a[data-tip]::after { display: none; }
html.rail-wide .rail__toggle i { rotate: 180deg; }
.rail-overlay { display: none; }

/* ---------- Topbar ---------- */
.top { height: 60px; display: flex; align-items: center; gap: 16px; padding: 0 16px; border-bottom: 1px solid var(--ailo-line); background: rgba(4, 7, 10, .88); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 50; }
.top__burger { display: none; width: 38px; height: 38px; border: 1px solid var(--ailo-line); background: transparent; color: var(--ailo-fg); border-radius: 3px; flex-shrink: 0; }
.top__title { min-width: 0; }
.crumb { display: flex; gap: 6px; font-family: var(--d27-mono); font-size: 10px; color: var(--ailo-muted); text-transform: uppercase; letter-spacing: .04em; line-height: 1.3; }
.crumb li + li::before { content: "/"; margin-right: 6px; color: #3c505c; }
.crumb a:hover { color: var(--d27-cyan); }
.top h1 { font-size: 17px; font-weight: 800; letter-spacing: -.01em; white-space: nowrap; line-height: 1.35; }
.top__sys { display: flex; align-items: center; gap: 12px; margin-right: auto; padding-left: 16px; border-left: 1px solid var(--ailo-line); }
.sys { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--d27-good); font-weight: 600; white-space: nowrap; }
.sys__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--d27-good); box-shadow: 0 0 8px var(--d27-good); animation: d27-blink 2.4s infinite; }
.clock { font-size: 20px; font-weight: 700; color: var(--d27-cyan); letter-spacing: .02em; text-shadow: 0 0 12px rgba(34, 211, 238, .45); white-space: nowrap; }
.clock small { font-size: 10px; color: var(--ailo-muted); margin-left: 5px; text-shadow: none; letter-spacing: .1em; }
@keyframes d27-blink { 50% { opacity: .35; } }
.top__search { position: relative; width: clamp(180px, 20vw, 300px); }
.top__search i { position: absolute; left: 11px; top: 50%; translate: 0 -50%; color: var(--ailo-muted); font-size: 12px; }
.top__search input { width: 100%; height: 36px; background: #071015; border: 1px solid var(--ailo-line); border-radius: 3px; color: var(--ailo-fg); padding: 0 10px 0 32px; font-family: var(--d27-mono); font-size: 12px; }
.top__search input::placeholder { color: #5f7480; }
.top__search input:focus { outline: none; border-color: var(--d27-cyan); box-shadow: 0 0 0 3px var(--d27-cyan-dim); }
.top__actions { display: flex; align-items: center; gap: 8px; }
.icon-btn { position: relative; width: 36px; height: 36px; border: 1px solid var(--ailo-line); background: transparent; color: var(--ailo-fg); border-radius: 3px; display: grid; place-items: center; }
.icon-btn:hover { border-color: var(--d27-cyan); color: var(--d27-cyan); }
.badge-n { position: absolute; top: -6px; right: -6px; font-family: var(--d27-mono); font-size: 10px; font-weight: 700; background: var(--d27-crit); color: #fff; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 2px; display: grid; place-items: center; }
.profile { display: flex; align-items: center; gap: 9px; border: 1px solid var(--ailo-line); background: transparent; color: var(--ailo-fg); padding: 3px 12px 3px 3px; border-radius: 3px; text-align: left; }
.profile__ava { width: 28px; height: 28px; border-radius: 2px; background: var(--d27-cyan-dim); color: var(--d27-cyan); font-family: var(--d27-mono); font-size: 11px; font-weight: 700; display: grid; place-items: center; border: 1px solid rgba(34, 211, 238, .4); }
.profile__txt { display: flex; flex-direction: column; line-height: 1.2; }
.profile__txt b { font-size: 12px; }
.profile__txt small { font-size: 10px; color: var(--ailo-muted); }

.notif { position: relative; }
.notif__panel { position: absolute; right: 0; top: calc(100% + 8px); width: min(360px, calc(100vw - 24px)); background: #050c10; border: 1px solid rgba(34, 211, 238, .35); box-shadow: 0 20px 60px -10px rgba(0, 0, 0, .8), 0 0 24px -8px rgba(34, 211, 238, .3); z-index: 90; border-radius: 3px; }
.notif__head { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--ailo-line); font-family: var(--d27-mono); font-size: 12px; letter-spacing: .1em; color: var(--d27-cyan); }
.link-btn { border: 0; background: none; color: var(--ailo-muted); font-size: 12px; font-family: var(--ailo-font); letter-spacing: 0; }
.link-btn:hover { color: var(--d27-cyan); text-decoration: underline; }
.notif__panel li { display: flex; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--ailo-line); position: relative; }
.notif__panel li:last-child { border-bottom: 0; }
.notif__panel li > i { margin-top: 3px; color: var(--ailo-muted); }
.notif__panel li.sev-crit > i { color: var(--d27-crit-txt); }
.notif__panel li.sev-warn > i { color: var(--d27-warn); }
.notif__panel li.is-new::after { content: ""; position: absolute; right: 12px; top: 14px; width: 6px; height: 6px; background: var(--d27-cyan); box-shadow: 0 0 6px var(--d27-cyan); }
.notif__panel p { font-size: 12.5px; line-height: 1.45; padding-right: 14px; }
.notif__panel small { display: block; font-family: var(--d27-mono); font-size: 10px; color: var(--ailo-muted); }

/* ---------- Main ---------- */
.main { padding: 12px 16px 16px; flex: 1; transition: opacity .2s; }
.main.is-loading .kpis, .main.is-loading .pn--thr, .main.is-loading .pn--reason, .main.is-loading .pn--zone { opacity: .55; }
.filters { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; margin-bottom: var(--d27-gap); }
.seg { display: inline-flex; border: 1px solid var(--ailo-line); border-radius: 3px; overflow: hidden; }
.seg button { border: 0; background: transparent; color: var(--ailo-muted); font-family: var(--d27-mono); font-size: 12px; font-weight: 700; padding: 6px 16px; border-right: 1px solid var(--ailo-line); letter-spacing: .04em; }
.seg button:last-child { border-right: 0; }
.seg button:hover { color: var(--ailo-fg); background: #0b151b; }
.seg button[aria-pressed="true"] { background: var(--d27-cyan); color: var(--ailo-accent-ink); }
.filters__note { font-size: 12px; color: var(--ailo-muted); }
.filters__note .mono { font-size: 11px; color: #5f7480; }

/* KPI row */
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--d27-gap); margin-bottom: var(--d27-gap); transition: opacity .2s; }
.kpi { position: relative; background: var(--d27-panel); border: 1px solid var(--ailo-line); padding: 12px 14px 10px; border-radius: 2px; min-width: 0; overflow: hidden; }
.kpi::before { content: ""; position: absolute; left: 0; top: 0; width: 10px; height: 10px; border-left: 2px solid var(--d27-cyan); border-top: 2px solid var(--d27-cyan); opacity: .7; }
.kpi h2 { font-size: 11px; font-weight: 600; color: var(--ailo-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi h2 small { font-family: var(--d27-mono); font-size: 9px; color: #5f7480; }
.kpi__v { font-size: clamp(20px, 1.75vw, 28px); font-weight: 700; color: #fff; letter-spacing: -.02em; margin-top: 4px; white-space: nowrap; line-height: 1.2; }
.kpi__v small { font-size: 12px; color: var(--ailo-muted); margin-left: 2px; font-weight: 500; }
.kpi--hl .kpi__v { color: var(--d27-cyan); text-shadow: 0 0 14px rgba(34, 211, 238, .35); }
.kpi--warn .kpi__v { color: var(--d27-warn); }
.kpi--warn::before { border-color: var(--d27-warn); }
.delta { font-size: 10.5px; color: var(--ailo-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.up { color: var(--d27-good); font-weight: 700; font-family: var(--d27-mono); }
.down { color: var(--d27-crit-txt); font-weight: 700; font-family: var(--d27-mono); }
.neutral { color: var(--ailo-fg); font-weight: 700; font-family: var(--d27-mono); }
.kpi__spark { position: relative; height: 24px; margin-top: 8px; }
.kpi__spark svg { display: block; width: 100%; height: 100%; overflow: visible; }
.kpi__spark i { position: absolute; width: 6px; height: 6px; border-radius: 50%; translate: -50% -50%; box-shadow: 0 0 0 2px var(--d27-panel), 0 0 8px currentColor; }

/* panel grid */
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--d27-gap); }
.pn { position: relative; background: var(--d27-panel); border: 1px solid var(--ailo-line); border-radius: 2px; padding: 12px 14px; min-width: 0; }
.pn::after { content: ""; position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px; border-right: 2px solid rgba(34, 211, 238, .55); border-bottom: 2px solid rgba(34, 211, 238, .55); pointer-events: none; }
.pn__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.pn__head h2 { font-size: 13px; font-weight: 700; letter-spacing: .01em; display: flex; align-items: center; gap: 8px; }
.pn__idx { font-family: var(--d27-mono); font-size: 10px; color: var(--d27-cyan); border: 1px solid rgba(34, 211, 238, .4); padding: 0 5px; line-height: 16px; border-radius: 2px; }
.pn__note { font-size: 10.5px; color: var(--ailo-muted); margin-top: 3px; }
.pn__sub { font-size: 12px; font-weight: 700; margin: 14px 0 8px; }
.pn__sub .mono { font-size: 10px; color: #5f7480; font-weight: 400; }
.live-chip { display: inline-flex; align-items: center; gap: 6px; font-family: var(--d27-mono); font-size: 10px; font-weight: 700; letter-spacing: .12em; color: var(--d27-crit-txt); border: 1px solid rgba(224, 71, 74, .5); padding: 1px 7px; border-radius: 2px; }
.live-chip i { width: 6px; height: 6px; border-radius: 50%; background: var(--d27-crit); animation: d27-blink 1.2s infinite; }

.pn--map { grid-column: span 8; }
.pn--status { grid-column: span 4; }
.pn--thr { grid-column: span 6; }
.pn--reason { grid-column: span 3; }
.pn--zone { grid-column: span 3; }
.pn--table { grid-column: span 8; }
.pn--log { grid-column: span 4; }

/* map */
.map { position: relative; background: #03080b; border: 1px solid #0f1c24; border-radius: 2px; overflow: hidden; }
.map::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgba(34, 211, 238, .025) 0 1px, transparent 1px 3px); pointer-events: none; z-index: 1; }
.map__svg { display: block; width: 100%; height: auto; }
.zones polygon { fill: rgba(34, 211, 238, .025); stroke: #1b3542; stroke-width: 1; stroke-dasharray: 0; }
.zones polygon.is-hot { fill: rgba(224, 71, 74, .07); stroke: rgba(224, 71, 74, .35); }
.river { fill: none; stroke: #0a2633; stroke-width: 24; stroke-linecap: round; }
.roads path { fill: none; stroke: #1d3340; stroke-width: 2.5; }
.roads #r1 { stroke: #24414f; stroke-width: 3.5; }
.zlabels text { font-family: var(--d27-mono); font-size: 11px; fill: #6f8692; letter-spacing: .04em; }
.zlabels tspan { fill: var(--d27-cyan); font-weight: 700; }
.zlabels text.is-hot tspan { fill: var(--d27-warn); }
.hubs rect { fill: #03080b; stroke: var(--d27-cyan); stroke-width: 2; }
.hubs text { font-family: var(--ailo-font); font-size: 11px; font-weight: 700; fill: #cfe3ea; paint-order: stroke; stroke: #03080b; stroke-width: 3px; }
.veh circle, .veh rect { stroke: #03080b; stroke-width: 2; }
.veh--run circle { fill: var(--d27-run); }
.veh--warn rect { fill: var(--d27-warn); }
.veh--crit circle { fill: var(--d27-crit); }
.veh--stop circle { fill: var(--d27-stop); }
.veh__ring { fill: none !important; stroke: var(--d27-crit) !important; stroke-width: 1.5 !important; transform-box: fill-box; transform-origin: center; animation: d27-ring 1.8s ease-out infinite; }
@keyframes d27-ring { 0% { opacity: .9; scale: .5; } 100% { opacity: 0; scale: 1.4; } }
.map__legend { position: absolute; left: 10px; bottom: 10px; z-index: 2; display: flex; flex-wrap: wrap; gap: 4px 12px; background: rgba(3, 8, 11, .85); border: 1px solid var(--ailo-line); padding: 6px 10px; font-size: 11px; color: var(--ailo-muted); max-width: calc(100% - 20px); }
.map__legend li { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.map__legend b { font-family: var(--d27-mono); color: var(--ailo-fg); }
.map__scale { position: absolute; right: 12px; top: 10px; z-index: 2; font-size: 10px; color: var(--ailo-muted); display: flex; align-items: center; gap: 6px; }
.map__scale span { width: 48px; height: 6px; border: 1px solid var(--ailo-muted); border-top: 0; }
.lg { display: inline-block; flex-shrink: 0; }
.lg--run { width: 9px; height: 9px; border-radius: 50%; background: var(--d27-run); }
.lg--warn { width: 8px; height: 8px; background: var(--d27-warn); rotate: 45deg; }
.lg--crit { width: 9px; height: 9px; border-radius: 50%; background: var(--d27-crit); box-shadow: 0 0 0 2px #03080b, 0 0 0 3px var(--d27-crit); }
.lg--stop { width: 8px; height: 8px; border-radius: 50%; background: var(--d27-stop); }
.lg--hub { width: 9px; height: 9px; border: 2px solid var(--d27-cyan); }
.lg--off { width: 9px; height: 9px; background: repeating-linear-gradient(135deg, #3a4954 0 2px, transparent 2px 4px); border: 1px solid #3a4954; }

/* fleet status */
.fleetbar { display: flex; gap: 2px; height: 10px; margin-bottom: 12px; }
.fleetbar span { border-radius: 1px; }
.fb--run { background: var(--d27-run); }
.fb--warn { background: var(--d27-warn); }
.fb--crit { background: var(--d27-crit); }
.fb--stop { background: var(--d27-stop); }
.fb--off { background: repeating-linear-gradient(135deg, #3a4954 0 2px, #0e171d 2px 4px); }
.fleet { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin: 0; border: 1px solid var(--ailo-line); }
.fleet div { padding: 8px; border-right: 1px solid var(--ailo-line); min-width: 0; }
.fleet div:last-child { border-right: 0; }
.fleet dt { font-size: 10.5px; color: var(--ailo-muted); font-weight: 500; display: flex; align-items: center; gap: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fleet dd { margin: 2px 0 0; font-size: 18px; font-weight: 700; color: #fff; }
.alerts { display: flex; flex-direction: column; gap: 6px; }
.alerts li { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 10px; background: var(--d27-panel-2); border: 1px solid var(--ailo-line); border-left: 2px solid var(--d27-warn); }
.alerts li.sev-crit { border-left-color: var(--d27-crit); }
.alerts li > i { color: var(--d27-warn); }
.alerts li.sev-crit > i { color: var(--d27-crit-txt); }
.alerts p { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.alerts p b { font-family: var(--d27-mono); }
.alerts small { display: block; font-size: 11px; color: var(--ailo-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.alerts small b { color: var(--d27-crit-txt); font-family: var(--d27-mono); }
.mini-btn { border: 1px solid rgba(34, 211, 238, .45); background: transparent; color: var(--d27-cyan); font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 2px; white-space: nowrap; }
.mini-btn:hover { background: var(--d27-cyan); color: var(--ailo-accent-ink); }

/* docks */
.docks { display: flex; flex-direction: column; gap: 9px; }
.docks li { display: grid; grid-template-columns: 92px minmax(0, 1fr) 70px; gap: 10px; align-items: center; font-size: 12px; color: #c6d6dc; }
.dock { position: relative; height: 6px; background: #0f1b22; }
.dock span { display: block; height: 100%; background: var(--d27-s1); }
.dock i { position: absolute; top: -3px; width: 1px; height: 12px; background: var(--ailo-fg); opacity: .7; }
.docks b { text-align: right; font-family: var(--d27-mono); color: #fff; }
.docks b small { color: var(--ailo-muted); font-weight: 400; }
.docks li.is-over .dock span { background: var(--d27-warn); }
.docks li.is-over b { color: var(--d27-warn); }
.docks b i { font-size: 10px; }

/* charts */
.chart { position: relative; width: 100%; }
.chart--thr { height: 220px; }
.chart--reason { height: 220px; }
.legend { display: flex; gap: 12px; font-size: 11px; color: #b7c8cf; }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.lg-line { display: inline-block; width: 14px; height: 2px; background: var(--c); }

/* zones */
.zones-list { display: flex; flex-direction: column; gap: 13px; padding-top: 4px; }
.zones-list li { display: grid; grid-template-columns: 52px minmax(0, 1fr) 66px; align-items: center; gap: 10px; font-size: 12px; }
.zn { color: #c6d6dc; }
.zbar { position: relative; height: 8px; background: #0f1b22; border-radius: 1px; }
.zbar span { display: block; height: 100%; background: var(--d27-s1); border-radius: 1px; }
.zbar i { position: absolute; top: -3px; width: 1px; height: 14px; background: var(--ailo-fg); opacity: .7; }
.zones-list b { text-align: right; font-size: 12px; color: #fff; }
.zones-list li.is-low .zbar span { background: var(--d27-warn); }
.zones-list li.is-low b { color: var(--d27-warn); }
.zones-list li.is-low b i { font-size: 10px; }

/* table */
.pn--table { padding-bottom: 6px; }
.pn__head--table { align-items: center; flex-wrap: wrap; }
.tbl-search { position: relative; }
.tbl-search i { position: absolute; left: 10px; top: 50%; translate: 0 -50%; color: var(--ailo-muted); font-size: 11px; }
.tbl-search input { height: 30px; width: 200px; max-width: 100%; background: #071015; border: 1px solid var(--ailo-line); border-radius: 2px; color: var(--ailo-fg); padding: 0 10px 0 28px; font-size: 12px; font-family: var(--ailo-font); }
.tbl-search input:focus { outline: none; border-color: var(--d27-cyan); }
.tbl-wrap { overflow-x: auto; margin: 0 -14px; padding: 0 14px; }
.tbl { width: 100%; min-width: 760px; border-collapse: collapse; font-size: 12.5px; }
.tbl th { padding: 0; text-align: left; font-family: var(--d27-mono); font-size: 10.5px; font-weight: 500; text-transform: uppercase; letter-spacing: .06em; color: var(--ailo-muted); border-bottom: 1px solid var(--d27-base); white-space: nowrap; }
.tbl th button { border: 0; background: none; color: inherit; padding: 8px 8px; display: inline-flex; align-items: center; gap: 6px; font: inherit; letter-spacing: inherit; text-transform: inherit; }
.tbl th button:hover { color: var(--ailo-fg); }
.tbl th button i { font-size: 9px; opacity: .5; }
.tbl th[aria-sort="ascending"], .tbl th[aria-sort="descending"] { color: var(--d27-cyan); }
.tbl th[aria-sort="ascending"] i, .tbl th[aria-sort="descending"] i { opacity: 1; }
.tbl th.num, .tbl td.num { text-align: right; }
.tbl th.num button { flex-direction: row-reverse; }
.tbl td { padding: 8px 8px; border-bottom: 1px solid var(--ailo-line); white-space: nowrap; color: #cfdde2; }
.tbl tbody tr { transition: background .15s; }
.tbl tbody tr:hover { background: #0c171e; }
.tbl tr.row--crit td:first-child { box-shadow: inset 2px 0 0 var(--d27-crit); }
.tbl tr.row--warn td:first-child { box-shadow: inset 2px 0 0 var(--d27-warn); }
.tbl td.car { color: #fff; font-weight: 700; }
.prog { display: inline-flex; align-items: center; gap: 8px; }
.prog__bar { width: 60px; height: 4px; background: #13212a; }
.prog__bar i { display: block; height: 100%; background: var(--d27-s1); }
.delay.is-warn { color: var(--d27-warn); font-weight: 700; }
.delay.is-crit { color: var(--d27-crit-txt); font-weight: 700; }
.st { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 1px 7px; border: 1px solid; border-radius: 2px; }
.st i { font-size: 9px; }
.st--run { color: var(--d27-cyan); border-color: rgba(34, 211, 238, .4); }
.st--warn { color: var(--d27-warn); border-color: rgba(250, 178, 25, .45); }
.st--crit { color: var(--d27-crit-txt); border-color: rgba(224, 71, 74, .55); background: rgba(224, 71, 74, .08); }
.st--stop { color: #9aabb5; border-color: #2c3a44; }
.st--off { color: #9aabb5; border-color: #2c3a44; background: repeating-linear-gradient(135deg, rgba(58, 73, 84, .25) 0 2px, transparent 2px 5px); }
.empty { text-align: center !important; color: var(--ailo-muted) !important; padding: 24px !important; }
.pager { display: flex; justify-content: space-between; align-items: center; padding-top: 8px; font-size: 11px; color: var(--ailo-muted); }
.pager__list { display: flex; gap: 4px; }
.pager__list button { min-width: 28px; height: 26px; border: 1px solid var(--ailo-line); background: transparent; color: var(--ailo-fg); font-family: var(--d27-mono); font-size: 11px; border-radius: 2px; }
.pager__list button:hover:not(:disabled) { border-color: var(--d27-cyan); color: var(--d27-cyan); }
.pager__list button.is-current { background: var(--d27-cyan); color: var(--ailo-accent-ink); border-color: var(--d27-cyan); font-weight: 700; }
.pager__list button:disabled { opacity: .35; cursor: default; }

/* terminal log */
.term { font-family: var(--d27-mono); font-size: 11.5px; display: flex; flex-direction: column; max-height: 330px; overflow: hidden; }
.term li { display: grid; grid-template-columns: 62px 54px minmax(0, 1fr); gap: 8px; padding: 6px 0; border-bottom: 1px dashed #13212a; align-items: baseline; }
.term li.is-in { animation: d27-in .5s var(--ailo-ease); }
@keyframes d27-in { from { opacity: 0; background: var(--d27-cyan-dim); } to { opacity: 1; background: transparent; } }
.term time { color: #5f7480; font-size: 11px; }
.term .t { justify-self: start; min-width: 50px; padding: 0 5px; font-size: 10px; font-weight: 700; color: #9aabb5; border: 1px solid #2c3a44; text-align: center; border-radius: 2px; line-height: 16px; }
.term .t--ok { color: var(--d27-good); border-color: rgba(60, 207, 110, .45); }
.term .t--warn { color: var(--d27-warn); border-color: rgba(250, 178, 25, .45); }
.term .t--crit { color: var(--d27-crit-txt); border-color: rgba(224, 71, 74, .55); }
.term p { font-family: var(--ailo-font); color: #c6d6dc; font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }

/* footer */
.foot { padding: 0 16px 16px; font-size: 11px; color: #5f7480; font-family: var(--d27-mono); }
.foot p { font-family: var(--ailo-font); }
.foot a:hover { color: var(--d27-cyan); text-decoration: underline; }

/* ---------- Responsive ---------- */
@media (max-width: 1399.98px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pn--map { grid-column: span 12; }
  .pn--status { grid-column: span 12; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 20px; align-content: start; }
  .pn--status > .pn__head, .pn--status > .fleetbar, .pn--status > .fleet { grid-column: 1; }
  .pn--status > .pn__sub { grid-column: 2; grid-row: 1; margin-top: 0; }
  .pn--status > .alerts { grid-column: 2; grid-row: 2 / span 5; }
  .pn--status > .pn__sub--dock, .pn--status > .docks { grid-column: 1; }
  .pn--thr { grid-column: span 12; }
  .pn--reason, .pn--zone { grid-column: span 6; }
  .pn--table { grid-column: span 12; }
  .pn--log { grid-column: span 12; }
  .term { max-height: none; }
}
@media (max-width: 991.98px) {
  .rail { position: fixed; left: 0; top: 0; bottom: 0; height: 100%; width: min(280px, 84vw); translate: -105% 0; visibility: hidden; transition: translate .3s var(--ailo-ease), visibility .3s; z-index: 200; box-shadow: 0 0 60px rgba(0, 0, 0, .8); }
  html.sb-open .rail { translate: 0 0; visibility: visible; transition: translate .3s var(--ailo-ease), visibility 0s; } /* 열 때 visibility 즉시 → 곧바로 포커스 가능 */
  html.rail-wide .rail { width: min(280px, 84vw); }
  .rail__brand { justify-content: flex-start; }
  .rail__name, .rail__nav a span { display: inline; }
  .rail__nav em { position: static; margin-left: auto; font-size: 10px; padding: 0 6px; }
  .rail__nav a[data-tip]::after { display: none; }
  .rail__close { display: grid; place-items: center; }
  .rail__toggle { display: none; }
  .rail-overlay { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .65); z-index: 190; opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s; }
  html.sb-open .rail-overlay { opacity: 1; visibility: visible; }
  html.sb-open body { overflow: hidden; }
  .top__burger { display: grid; place-items: center; }
  .top__search, .profile__txt { display: none; }
  .profile { padding: 3px; }
  .pn--status { display: block; }
  .pn--status > .pn__sub { margin-top: 14px; }
}
@media (max-width: 767.98px) {
  .top__sys .sys { display: none; }
  .top__sys { padding-left: 12px; }
  .clock { font-size: 16px; }
  .pn--reason, .pn--zone { grid-column: span 12; }
  .map__legend { position: static; max-width: none; border: 0; border-top: 1px solid var(--ailo-line); }
}
@media (max-width: 575.98px) {
  .top { gap: 10px; padding: 0 12px; }
  .top h1 { font-size: 15px; }
  .crumb li:nth-child(2) { display: none; }
  .main { padding: 10px 12px 14px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .seg { width: 100%; }
  .seg button { flex: 1; }
  .fleet { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .fleet div:nth-child(3) { border-right: 0; }
  .fleet div:nth-child(-n+3) { border-bottom: 1px solid var(--ailo-line); }
  .alerts li { grid-template-columns: 16px minmax(0, 1fr); }
  .alerts .mini-btn { grid-column: 2; justify-self: start; }
  .tbl-search, .tbl-search input { width: 100%; }
  .pn__head--table > div { width: 100%; }
  .notif { position: static; }
  .notif__panel { position: fixed; left: 12px; right: 12px; top: 66px; width: auto; }
  .term li { grid-template-columns: 58px minmax(0, 1fr); }
  .term li p { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
  .sys__dot, .live-chip i, .veh__ring { animation: none; }
}
