/* ==========================================================================
   D04 스마트라인 MES — 원형: 다크 좌측 사이드바(접기) + 고밀도 12열 패널 그리드
   타이포: Pretendard(본문) + Barlow Condensed(계기 수치) + JetBrains Mono(코드·시각)
   컬러: 다크 그레이 바탕 + 세이프티 오렌지 단일 강조, 상태색은 아이콘+라벨과 함께
   ========================================================================== */
:root {
  --ailo-bg: #121417;
  --ailo-fg: #e8eaed;
  --ailo-muted: #98a0aa;
  --ailo-line: rgba(255, 255, 255, .08);
  --ailo-accent: #ff7a1a;
  --ailo-accent-ink: #111;

  --d04-side: #0b0d0f;
  --d04-panel: #1a1d21;
  --d04-panel-2: #22262b;
  --d04-raise: #2a2f35;
  --d04-grid: #2a2e33;
  --d04-axis: #3b4047;
  --d04-track: #3a2a1f;
  --d04-plan: #c9cdd2;
  /* 차트 시리즈 (다크 표면 검증: 밴드·채도·CVD all-pairs 통과) */
  --d04-s1: #e5691f;
  --d04-s2: #3987e5;
  --d04-s3: #199e70;
  /* 상태 */
  --d04-good: #2bbf4a;
  --d04-warn: #fab219;
  --d04-crit: #ff5a5a;
  --d04-idle: #8a929c;
  --d04-cond: "Barlow Condensed", var(--ailo-font);
  --d04-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --d04-side-w: 248px;
  --d04-r: 10px;
  --d04-gap: clamp(10px, 1.1vw, 16px);
  color-scheme: dark;
}

body { background: var(--ailo-bg); font-size: 14px; line-height: 1.5; }
h1, h2, h3 { font-weight: 700; letter-spacing: -.01em; }

/* ===== App shell ===== */
.app { display: grid; grid-template-columns: var(--d04-side-w) minmax(0, 1fr); min-height: 100vh; transition: grid-template-columns .25s var(--ailo-ease); }
html.sb-mini .app { grid-template-columns: 76px minmax(0, 1fr); }
.shell { min-width: 0; display: flex; flex-direction: column; }

/* ===== Sidebar ===== */
.sb {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; overflow-x: hidden;
  background: var(--d04-side); border-right: 1px solid var(--ailo-line);
  display: flex; flex-direction: column; padding: 18px 14px; gap: 18px; z-index: 60;
}
.sb__brand { display: flex; align-items: center; gap: 10px; padding: 2px 6px; min-height: 36px; }
.sb__mark { width: 30px; height: 30px; flex: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; align-items: end; padding: 4px; border-radius: 7px; background: var(--ailo-accent); }
.sb__mark i { display: block; background: #111; border-radius: 1px; }
.sb__mark i:nth-child(1) { height: 40%; } .sb__mark i:nth-child(2) { height: 70%; } .sb__mark i:nth-child(3) { height: 100%; }
.sb__name { font-family: var(--d04-cond); font-weight: 700; font-size: 20px; letter-spacing: .06em; white-space: nowrap; }
.sb__name b { color: var(--ailo-accent); margin-left: 4px; }
.sb__close { display: none; margin-left: auto; width: 36px; height: 36px; border: 0; border-radius: 8px; background: var(--d04-panel-2); }

.sb__plant { position: relative; padding: 12px 12px 14px; border-radius: var(--d04-r); background: var(--d04-panel); border: 1px solid var(--ailo-line); display: grid; gap: 2px; }
.sb__plant-label { font-size: 11px; color: var(--ailo-muted); }
.sb__plant strong { font-size: 15px; }
.sb__shift { font-size: 12px; color: var(--ailo-muted); font-family: var(--d04-mono); }
.sb__shift-bar { height: 3px; margin-top: 8px; background: var(--d04-raise); border-radius: 3px; overflow: hidden; }
.sb__shift-bar span { display: block; height: 100%; background: var(--ailo-accent); }

.sb__nav { display: grid; gap: 2px; }
.sb__group { font-size: 11px; color: #6f7781; letter-spacing: .08em; margin: 10px 10px 4px; white-space: nowrap; }
.sb__nav a, .sb__foot a, .sb__collapse {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 8px;
  color: #b9bfc7; font-weight: 500; white-space: nowrap; border: 0; background: transparent; width: 100%; text-align: left;
  transition: background .15s, color .15s;
}
.sb__nav a i, .sb__foot a i, .sb__collapse i { width: 20px; text-align: center; font-size: 15px; flex: none; }
.sb__nav a:hover, .sb__foot a:hover, .sb__collapse:hover { background: var(--d04-panel-2); color: #fff; }
.sb__nav a.is-active { background: linear-gradient(90deg, rgba(255, 122, 26, .18), rgba(255, 122, 26, .04)); color: #fff; }
.sb__nav a.is-active::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--ailo-accent); }
.sb__nav a.is-active i { color: var(--ailo-accent); }
.sb__nav em { margin-left: auto; font-style: normal; font-size: 11px; font-family: var(--d04-mono); padding: 1px 7px; border-radius: 99px; background: var(--d04-raise); color: #cfd4da; }
.sb__nav em.is-hot { background: var(--ailo-accent); color: #111; font-weight: 600; }
.sb__foot { margin-top: auto; display: grid; gap: 2px; border-top: 1px solid var(--ailo-line); padding-top: 12px; }
.sb__collapse i { transition: rotate .25s var(--ailo-ease); }

html.sb-mini .sb { padding-inline: 12px; }
html.sb-mini .sb__name, html.sb-mini .sb__plant, html.sb-mini .sb__group, html.sb-mini .sb__nav span, html.sb-mini .sb__nav em, html.sb-mini .sb__foot span { display: none; }
html.sb-mini .sb__nav a, html.sb-mini .sb__foot a, html.sb-mini .sb__collapse { justify-content: center; padding: 11px 0; }
html.sb-mini .sb__nav a.is-active::before { left: -12px; }
html.sb-mini .sb__brand { justify-content: center; padding: 2px 0; }
html.sb-mini .sb__collapse i { rotate: 180deg; }
.sb-dim { display: none; }

/* ===== Topbar ===== */
.tb {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 14px;
  padding: 12px clamp(14px, 2vw, 28px); min-height: 68px;
  background: rgba(18, 20, 23, .9); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--ailo-line);
}
.tb__burger { display: none; width: 40px; height: 40px; border-radius: 8px; border: 1px solid var(--ailo-line); background: var(--d04-panel); flex: none; }
.tb__title { min-width: 0; margin-right: auto; }
.tb__crumb { display: flex; gap: 6px; font-size: 12px; color: var(--ailo-muted); white-space: nowrap; overflow: hidden; }
.tb__crumb li + li::before { content: "/"; margin-right: 6px; color: #5d646d; }
.tb__crumb a:hover { color: var(--ailo-accent); }
.tb h1 { font-size: clamp(17px, 1.4vw, 21px); line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb__search { position: relative; width: min(320px, 26vw); }
.tb__search i { position: absolute; left: 12px; top: 50%; translate: 0 -50%; color: var(--ailo-muted); font-size: 13px; }
.tb__search input { width: 100%; height: 38px; padding: 0 36px 0 34px; border-radius: 8px; border: 1px solid var(--ailo-line); background: var(--d04-panel); color: var(--ailo-fg); font-size: 13px; }
.tb__search input::placeholder { color: #6f7781; }
.tb__search input:focus { outline: none; border-color: var(--ailo-accent); box-shadow: 0 0 0 3px rgba(255, 122, 26, .2); }
.tb__search kbd { position: absolute; right: 8px; top: 50%; translate: 0 -50%; font-family: var(--d04-mono); font-size: 11px; padding: 1px 6px; border-radius: 4px; background: var(--d04-raise); color: var(--ailo-muted); box-shadow: none; }
.tb__live { display: flex; align-items: center; gap: 8px; font-family: var(--d04-mono); font-size: 12px; color: var(--ailo-muted); white-space: nowrap; }
.tb__live .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--d04-good); box-shadow: 0 0 0 0 rgba(43, 191, 74, .6); animation: d04-pulse 2s infinite; }
@keyframes d04-pulse { 70% { box-shadow: 0 0 0 7px rgba(43, 191, 74, 0); } 100% { box-shadow: 0 0 0 0 rgba(43, 191, 74, 0); } }
.tb__icon { position: relative; width: 40px; height: 40px; border-radius: 8px; border: 1px solid var(--ailo-line); background: var(--d04-panel); }
.tb__icon:hover, .tb__burger:hover { border-color: var(--d04-axis); background: var(--d04-panel-2); }
.badge-n { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--ailo-accent); color: #111; font-size: 11px; font-weight: 700; line-height: 18px; font-family: var(--d04-mono); }
.tb__noti { position: relative; }
.noti {
  position: absolute; right: 0; top: calc(100% + 10px); width: min(340px, calc(100vw - 24px)); z-index: 80;
  background: var(--d04-panel-2); border: 1px solid var(--d04-axis); border-radius: 12px; box-shadow: 0 18px 50px rgba(0, 0, 0, .5); overflow: hidden;
}
.noti__hd { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--ailo-line); }
.noti__all { border: 0; background: none; color: var(--ailo-accent); font-size: 12px; }
.noti ul { max-height: 320px; overflow-y: auto; }
.noti li { display: flex; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--ailo-line); }
.noti li > i { margin-top: 3px; color: var(--ailo-muted); width: 16px; text-align: center; }
.noti li.is-crit > i { color: var(--d04-crit); } .noti li.is-warn > i { color: var(--d04-warn); }
.noti li b { display: block; font-size: 13px; font-weight: 600; }
.noti li span { font-size: 12px; color: var(--ailo-muted); }
.noti li.is-read { opacity: .55; }
.noti__more { display: block; text-align: center; padding: 10px; font-size: 13px; color: var(--ailo-muted); }
.noti__more:hover { color: var(--ailo-fg); background: var(--d04-raise); }
.tb__user { display: flex; align-items: center; gap: 10px; padding: 4px 6px 4px 4px; border-radius: 10px; }
.tb__user:hover { background: var(--d04-panel); }
.avatar { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; background: linear-gradient(135deg, #ff9a4d, #c4520f); color: #111; font-weight: 800; flex: none; }
.tb__user-txt { display: grid; line-height: 1.25; white-space: nowrap; }
.tb__user-txt b { font-size: 13px; }
.tb__user-txt small { font-size: 11px; color: var(--ailo-muted); }

/* ===== Main ===== */
.main { padding: clamp(14px, 2vw, 28px); display: grid; gap: var(--d04-gap); align-content: start; flex: 1; }

.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.seg { display: inline-flex; padding: 3px; border-radius: 9px; background: var(--d04-panel); border: 1px solid var(--ailo-line); }
.seg button { border: 0; background: transparent; padding: 6px 16px; border-radius: 6px; font-size: 13px; font-weight: 600; color: var(--ailo-muted); }
.seg button:hover { color: var(--ailo-fg); }
.seg button.is-on { background: var(--ailo-accent); color: #111; }
.filters__info { font-size: 13px; color: var(--ailo-muted); font-family: var(--d04-mono); }
.filters__act { margin-left: auto; display: flex; gap: 8px; }
.btn-ghost, .btn-or { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 8px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.btn-ghost { border: 1px solid var(--ailo-line); background: var(--d04-panel); }
.btn-ghost:hover { background: var(--d04-panel-2); border-color: var(--d04-axis); }
.btn-or { border: 0; background: var(--ailo-accent); color: #111; }
.btn-or:hover { background: #ff9447; color: #111; }
.btn-sm { height: 34px; }

/* ===== KPI ===== */
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--d04-gap); }
.kpi {
  position: relative; padding: 14px 16px 12px; border-radius: var(--d04-r); background: var(--d04-panel); border: 1px solid var(--ailo-line);
  display: grid; grid-template-columns: 1fr auto; grid-template-areas: "label spark" "val val" "sub sub" "delta delta"; align-items: end; row-gap: 2px; overflow: hidden;
}
.kpi::after { content: ""; position: absolute; left: 0; top: 0; width: 26px; height: 2px; background: var(--d04-axis); }
.kpi--hero { background: linear-gradient(160deg, #2b1c11, var(--d04-panel) 60%); border-color: rgba(255, 122, 26, .35); }
.kpi--hero::after { background: var(--ailo-accent); width: 100%; }
.kpi__label { grid-area: label; font-size: 12px; color: var(--ailo-muted); font-weight: 500; }
.kpi__val { grid-area: val; font-family: var(--d04-cond); font-weight: 600; font-size: clamp(28px, 2.3vw, 36px); line-height: 1.1; letter-spacing: .01em; }
.kpi__val small { font-family: var(--ailo-font); font-size: 13px; font-weight: 500; color: var(--ailo-muted); margin-left: 4px; }
.kpi__sub { grid-area: sub; font-size: 12px; color: var(--ailo-muted); }
.kpi__delta { grid-area: delta; font-size: 12px; font-weight: 700; line-height: 1.35; padding-top: 8px; margin-top: 6px; border-top: 1px solid var(--ailo-line); }
.kpi__delta.is-good { color: var(--d04-good); }
.kpi__delta.is-bad { color: var(--d04-crit); }
.kpi__cmp { font-weight: 500; color: var(--ailo-muted); font-size: 11px; margin-left: 2px; white-space: nowrap; }
.spark { grid-area: spark; width: 64px; height: 22px; color: #69717b; align-self: start; }
.spark__dot { fill: var(--ailo-accent); stroke: var(--d04-panel); stroke-width: 2; }

/* ===== Panels grid ===== */
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--d04-gap); }
.grid > * { min-width: 0; }
.g-prod { grid-column: span 8; } .g-oee { grid-column: span 4; }
.g-board { grid-column: span 8; } .g-log { grid-column: span 4; }
.g-defect { grid-column: span 5; } .g-trend { grid-column: span 7; }
.g-table { grid-column: span 12; }

.panel { background: var(--d04-panel); border: 1px solid var(--ailo-line); border-radius: var(--d04-r); padding: 16px 18px 18px; display: flex; flex-direction: column; }
.panel__hd { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.panel__hd--wrap { flex-wrap: wrap; }
.panel h2 { font-size: 15px; display: flex; align-items: center; gap: 8px; }
.panel h2::before { content: ""; width: 6px; height: 6px; background: var(--ailo-accent); rotate: 45deg; flex: none; }
.panel__sub { font-size: 12px; color: var(--ailo-muted); margin-top: 2px; }
.chip { font-size: 11px; font-family: var(--d04-mono); padding: 3px 8px; border-radius: 5px; border: 1px solid var(--d04-axis); color: var(--ailo-muted); white-space: nowrap; }
.link-more { font-size: 12px; color: var(--ailo-muted); }
.link-more:hover { color: var(--ailo-accent); }

.legend { display: flex; gap: 14px; font-size: 12px; color: var(--ailo-muted); flex-wrap: wrap; justify-content: flex-end; }
.legend li { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.lg-bar { width: 10px; height: 10px; border-radius: 2px; background: var(--d04-s1); }
.lg-line { width: 14px; height: 2px; background: var(--d04-plan); }
.lg-l { width: 14px; height: 2px; border-radius: 2px; background: var(--c); }

.chart { position: relative; width: 100%; min-width: 0; }
.chart--prod { height: 280px; }
.chart--defect { height: 260px; }
.chart--trend { height: 260px; }

/* OEE gauge */
.gauge { position: relative; height: 170px; margin: 4px auto 18px; width: min(100%, 320px); }
.gauge canvas { position: absolute; inset: 0; }
.gauge__read { position: absolute; left: 0; right: 0; bottom: 6px; text-align: center; pointer-events: none; }
.gauge__read strong { display: block; font-family: var(--d04-cond); font-size: 52px; font-weight: 600; line-height: 1; }
.gauge__read strong small { font-size: 20px; color: var(--ailo-muted); margin-left: 2px; }
.gauge__read span { font-size: 12px; color: var(--ailo-muted); }
.gauge__min, .gauge__max { position: absolute; bottom: -18px; font-family: var(--d04-mono); font-size: 11px; color: #6f7781; }
.gauge__min { left: 7%; } .gauge__max { right: 4%; }
.apq { display: grid; gap: 10px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--ailo-line); }
.apq li { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; font-size: 13px; color: var(--ailo-muted); }
.apq b { font-family: var(--d04-mono); color: var(--ailo-fg); font-weight: 600; margin-left: 2px; }
.apq strong { font-family: var(--d04-cond); font-size: 17px; color: var(--ailo-fg); font-weight: 600; }
.apq .meter { grid-column: 1 / -1; }
.meter { display: block; height: 6px; border-radius: 6px; background: var(--d04-track); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 6px; background: var(--d04-s1); transition: width .5s var(--ailo-ease); }

/* Line status board */
.st-legend { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12px; color: var(--ailo-muted); justify-content: flex-end; }
.st-legend li { display: flex; align-items: center; gap: 6px; }
.st { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 5px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.st i { font-size: 9px; }
.st--run { background: rgba(43, 191, 74, .14); color: #5fd97a; }
.st--setup { background: rgba(250, 178, 25, .14); color: var(--d04-warn); }
.st--stop { background: rgba(255, 90, 90, .15); color: #ff7b7b; }
.st--idle { background: rgba(138, 146, 156, .16); color: #b7bec6; }

.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.ln { position: relative; padding: 12px 14px; border-radius: 9px; background: var(--d04-panel-2); border: 1px solid var(--ailo-line); overflow: hidden; display: grid; gap: 8px; }
.ln::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 3px; background: var(--d04-idle); }
.ln--run::before { background: var(--d04-good); }
.ln--setup::before { background: var(--d04-warn); }
.ln--stop::before { background: repeating-linear-gradient(135deg, var(--d04-crit) 0 8px, #2a1515 8px 16px); height: 4px; }
.ln--stop { border-color: rgba(255, 90, 90, .45); }
.ln--run::after { content: ""; position: absolute; top: 0; left: -40%; width: 40%; height: 3px; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .7), transparent); animation: d04-flow 2.4s linear infinite; }
@keyframes d04-flow { to { left: 100%; } }
.ln__top { display: flex; align-items: center; gap: 8px; }
.ln__id { font-family: var(--d04-cond); font-weight: 700; font-size: 20px; line-height: 1; letter-spacing: .03em; }
.ln__name { font-size: 12px; color: var(--ailo-muted); margin-right: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ln__item { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ln__prog { display: flex; align-items: center; gap: 8px; }
.ln__prog .meter { flex: 1; }
.ln__prog b { font-family: var(--d04-cond); font-size: 15px; width: 40px; text-align: right; }
.ln--stop .meter i { background: var(--d04-idle); }
.ln__m { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 6px; margin: 0; padding-top: 8px; border-top: 1px dashed var(--ailo-line); }
.ln__m dt { font-size: 10px; color: #7b838d; font-weight: 500; }
.ln__m dd { margin: 0; font-family: var(--d04-cond); font-size: 16px; font-weight: 600; }
.ln__m small { font-size: 11px; color: var(--ailo-muted); font-weight: 500; }
.ln__foot { font-size: 11px; color: var(--ailo-muted); display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.ln__note { margin-left: auto; font-family: var(--d04-mono); color: var(--ailo-fg); }
.ln--stop .ln__note { color: #ff8f8f; }

/* Log */
.log { position: relative; display: grid; gap: 0; max-height: 368px; overflow-y: auto; margin-right: -6px; padding-right: 6px; }
.log li { position: relative; display: grid; grid-template-columns: 44px 1fr; gap: 10px; padding: 9px 0 9px; border-bottom: 1px solid var(--ailo-line); }
.log li:last-child { border-bottom: 0; }
.log time { font-family: var(--d04-mono); font-size: 12px; color: var(--ailo-muted); padding-top: 1px; }
.log b { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; }
.log b::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--d04-idle); flex: none; }
.log .is-crit b::before { background: var(--d04-crit); box-shadow: 0 0 0 3px rgba(255, 90, 90, .2); }
.log .is-warn b::before { background: var(--d04-warn); }
.log .is-ok b::before { background: var(--d04-good); }
.log span { display: block; font-size: 12px; color: var(--ailo-muted); padding-left: 14px; }

/* Table */
.tbl-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.tbl-search { position: relative; }
.tbl-search i { position: absolute; left: 11px; top: 50%; translate: 0 -50%; color: var(--ailo-muted); font-size: 12px; }
.tbl-search input { height: 34px; width: 230px; max-width: 100%; padding: 0 12px 0 32px; border-radius: 8px; border: 1px solid var(--ailo-line); background: var(--d04-panel-2); color: var(--ailo-fg); font-size: 13px; }
.tbl-search input:focus { outline: none; border-color: var(--ailo-accent); }
.tbl-wrap { overflow-x: auto; margin-inline: -18px; padding-inline: 18px; }
.tbl-wrap:focus-visible { outline-offset: -2px; }
.tbl { width: 100%; min-width: 860px; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-weight: 600; font-size: 12px; color: var(--ailo-muted); border-bottom: 1px solid var(--d04-axis); padding: 0; white-space: nowrap; }
.tbl th button { width: 100%; text-align: inherit; border: 0; background: none; padding: 9px 10px; color: inherit; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.tbl th.num button { justify-content: flex-end; }
.tbl th button::after { content: "\f0dc"; font: var(--fa-font-solid); font-size: 10px; opacity: .45; }
.tbl th[aria-sort="ascending"] button::after { content: "\f0de"; opacity: 1; color: var(--ailo-accent); }
.tbl th[aria-sort="descending"] button::after { content: "\f0dd"; opacity: 1; color: var(--ailo-accent); }
.tbl th button:hover { color: var(--ailo-fg); }
.tbl td { padding: 10px; border-bottom: 1px solid var(--ailo-line); white-space: nowrap; }
.tbl tbody tr:hover td { background: rgba(255, 255, 255, .025); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .mono { font-family: var(--d04-mono); font-size: 12px; }
.tbl .empty { text-align: center; color: var(--ailo-muted); padding: 30px; }
.line-tag { font-family: var(--d04-cond); font-weight: 700; font-size: 14px; padding: 1px 7px; border-radius: 4px; background: var(--d04-raise); }
.cell-prog { display: flex; align-items: center; gap: 8px; min-width: 130px; }
.cell-prog .meter { flex: 1; height: 5px; }
.cell-prog b { font-family: var(--d04-cond); font-size: 14px; width: 38px; text-align: right; font-variant-numeric: tabular-nums; }
.ws { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 99px; border: 1px solid currentColor; }
.ws i { font-size: 10px; }
.ws--run { color: #6fb6ff; }
.ws--late { color: #ff7b7b; }
.ws--hold { color: var(--d04-warn); }
.ws--wait { color: #aab1b9; }
.ws--done { color: #5fd97a; }
.pager { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-top: 14px; }
.pager p { font-size: 12px; color: var(--ailo-muted); }
.pager ul { display: flex; gap: 4px; }
.pager button { min-width: 32px; height: 32px; border-radius: 7px; border: 1px solid var(--ailo-line); background: var(--d04-panel-2); font-size: 13px; font-family: var(--d04-mono); }
.pager button:hover:not(:disabled) { border-color: var(--d04-axis); }
.pager button.is-on { background: var(--ailo-accent); color: #111; border-color: var(--ailo-accent); font-weight: 700; }
.pager button:disabled { opacity: .35; cursor: not-allowed; }

/* Footer */
.ft { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; padding: 14px clamp(14px, 2vw, 28px) 20px; font-size: 12px; color: #6f7781; border-top: 1px solid var(--ailo-line); }
.ft__meta { font-family: var(--d04-mono); }

/* ===== Responsive ===== */
@media (max-width: 1439.98px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tb__live { display: none; }
}
@media (max-width: 1199.98px) {
  .g-prod, .g-board, .g-table { grid-column: span 12; }
  .g-oee, .g-log, .g-defect, .g-trend { grid-column: span 6; }
}
@media (max-width: 991.98px) {
  .app, html.sb-mini .app { grid-template-columns: minmax(0, 1fr); }
  .sb {
    position: fixed; left: 0; top: 0; bottom: 0; height: auto; width: min(290px, 86vw); z-index: 130;
    translate: -100% 0; transition: translate .3s var(--ailo-ease); visibility: hidden;
  }
  html.sb-open .sb { translate: 0 0; visibility: visible; box-shadow: 20px 0 60px rgba(0, 0, 0, .55); }
  html.sb-mini .sb__name, html.sb-mini .sb__plant, html.sb-mini .sb__group, html.sb-mini .sb__nav span, html.sb-mini .sb__nav em, html.sb-mini .sb__foot span { display: revert; }
  html.sb-mini .sb__nav a, html.sb-mini .sb__foot a { justify-content: flex-start; padding: 9px 10px; }
  .sb__close { display: grid; place-items: center; }
  .sb__collapse { display: none; }
  .sb-dim { display: block; position: fixed; inset: 0; z-index: 120; background: rgba(0, 0, 0, .6); opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s; }
  html.sb-open .sb-dim { opacity: 1; visibility: visible; }
  html.sb-open body { overflow: hidden; }
  .tb__burger { display: grid; place-items: center; }
  .tb__search { display: none; }
  .tb__user-txt { display: none; }
  .board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767.98px) {
  .g-oee, .g-log, .g-defect, .g-trend { grid-column: span 12; }
  .filters__act { margin-left: 0; }
}
@media (max-width: 575.98px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi { padding: 12px; grid-template-areas: "label label" "val val" "sub sub" "delta delta" "spark spark"; }
  .spark { width: 100%; height: 24px; margin-top: 6px; }
  .kpi__cmp { display: block; margin-left: 0; }
  .kpi__val { font-size: 28px; }
  .board { grid-template-columns: minmax(0, 1fr); }
  .tb { gap: 8px; padding-inline: 12px; }
  .tb__crumb { display: none; }
  .panel { padding: 14px; }
  .tbl-wrap { margin-inline: -14px; padding-inline: 14px; }
  .tbl-search input { width: 100%; }
  .tbl-tools, .tbl-search { width: 100%; }
  .panel__hd { flex-wrap: wrap; }
  .legend, .st-legend { justify-content: flex-start; }
  .chart--prod { height: 240px; }
  .filters__info { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .ln--run::after, .tb__live .dot { animation: none; }
}
