/* ============================================================
   Enterprise DataViz Demo — Premium Dark Tech Theme
   Author: Senior Developer (高级开发工程师)
   ============================================================ */

:root {
  --bg-0: #04070f;
  --bg-1: #0a1226;
  --bg-2: #0e1834;
  --panel: rgba(255, 255, 255, 0.045);
  --panel-2: rgba(255, 255, 255, 0.07);
  --border: rgba(120, 170, 255, 0.16);
  --border-strong: rgba(120, 170, 255, 0.34);
  --txt: #e8eefb;
  --muted: #8a9bc0;
  --cyan: #2ee6e6;
  --blue: #3b82f6;
  --purple: #a855f7;
  --green: #34d399;
  --amber: #fbbf24;
  --red: #fb7185;
  --glow-cyan: rgba(46, 230, 230, 0.45);
  --glow-purple: rgba(168, 85, 247, 0.4);
  --grid-line: rgba(120, 170, 255, 0.08);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --radius: 16px;
  --header-h: 64px;
  --transition: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

html[data-theme="light"] {
  --bg-0: #eef2fb;
  --bg-1: #f6f9ff;
  --bg-2: #ffffff;
  --panel: rgba(255, 255, 255, 0.78);
  --panel-2: rgba(255, 255, 255, 0.92);
  --border: rgba(40, 90, 180, 0.18);
  --border-strong: rgba(40, 90, 180, 0.36);
  --txt: #10203f;
  --muted: #5a6b8c;
  --cyan: #0ea5b7;
  --blue: #2563eb;
  --purple: #8b34e6;
  --green: #0f9d6b;
  --amber: #d97706;
  --red: #e11d6b;
  --glow-cyan: rgba(14, 165, 183, 0.35);
  --glow-purple: rgba(139, 52, 230, 0.3);
  --grid-line: rgba(40, 90, 180, 0.12);
  --shadow: 0 18px 50px rgba(40, 70, 140, 0.18);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", "Hiragino Sans GB", Roboto, Helvetica, Arial, sans-serif;
  color: var(--txt);
  background:
    radial-gradient(1200px 700px at 50% -10%, rgba(46, 230, 230, 0.06), transparent 60%),
    radial-gradient(1100px 680px at 100% 0%, rgba(59, 130, 246, 0.07), transparent 55%),
    linear-gradient(180deg, var(--bg-1), var(--bg-0) 70%);
  background-attachment: fixed;
  overflow-x: hidden;
  transition: background var(--transition), color var(--transition);
  -webkit-font-smoothing: antialiased;
}

/* animated faint grid overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at 50% 30%, #000 0%, transparent 80%);
  -webkit-mask-image: radial-gradient(circle at 50% 30%, #000 0%, transparent 80%);
  pointer-events: none;
  z-index: 0;
  opacity: 0.7;
}

/* ---------------- Header ---------------- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 22px;
  background: linear-gradient(180deg, rgba(10, 18, 38, 0.86), rgba(10, 18, 38, 0.5));
  backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--border);
}
html[data-theme="light"] .app-header {
  background: linear-gradient(180deg, rgba(246, 249, 255, 0.9), rgba(246, 249, 255, 0.55));
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.brand .logo {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1.5px solid var(--border-strong);
  color: var(--cyan);
  background: rgba(46, 230, 230, 0.06);
  display: grid;
  place-items: center;
  font-size: 17px;
  font-weight: 800;
}
.brand .name { font-size: 17px; }
.brand .name b { color: var(--txt); font-weight: 800; }
.brand .sub {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 1px;
}

/* nav */
.nav {
  display: flex;
  gap: 6px;
  margin: 0 auto;
  padding: 5px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
}
.nav-tab {
  position: relative;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  padding: 9px 20px;
  border-radius: 10px;
  cursor: pointer;
  transition: color var(--transition), background var(--transition);
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}
.nav-tab:hover { color: var(--txt); }
.nav-tab.active {
  color: #04121f;
  background: linear-gradient(135deg, var(--cyan), #5eead4);
  box-shadow: 0 6px 18px var(--glow-cyan);
}
html[data-theme="light"] .nav-tab.active { color: #fff; }
.nav-tab .ic { font-size: 15px; }

/* scenario switch */
.scenario-switch {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.scenario-switch button {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 9px;
  cursor: pointer;
  transition: color var(--transition), background var(--transition);
  white-space: nowrap;
}
.scenario-switch button:hover { color: var(--txt); }
.scenario-switch button.active {
  color: #04121f;
  background: linear-gradient(135deg, var(--blue), #60a5fa);
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
}
html[data-theme="light"] .scenario-switch button.active { color: #fff; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.clock {
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}
.clock b { color: var(--txt); font-weight: 700; }

.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--txt);
  cursor: pointer;
  font-size: 17px;
  display: grid;
  place-items: center;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.theme-toggle:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: 0 0 16px var(--glow-cyan);
}

/* ---------------- Layout ---------------- */
.app-main {
  position: relative;
  z-index: 1;
  padding: 18px 22px 28px;
  min-height: calc(100vh - var(--header-h));
}
.module { display: none; animation: fadeUp 0.5s ease both; }
.module.active { display: block; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------------- Panels ---------------- */
.panel {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(14px) saturate(140%);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}
/* 工业风边角装饰（参考 DataV / GoView 大屏边框语言） */
.panel::before, .panel::after {
  content: "";
  position: absolute;
  width: 14px; height: 14px;
  border: 2px solid var(--cyan);
  opacity: 0.5;
  pointer-events: none;
}
.panel::before { top: -1px; left: -1px; border-right: none; border-bottom: none; border-top-left-radius: var(--radius); }
.panel::after { bottom: -1px; right: -1px; border-left: none; border-top: none; border-bottom-right-radius: var(--radius); }
.panel:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  box-shadow: 0 22px 56px rgba(0, 0, 0, 0.5), 0 0 22px var(--glow-cyan);
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 18px 6px;
}
.panel-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 9px;
}
.panel-title .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 10px var(--glow-cyan);
}
.panel-extra { font-size: 12px; color: var(--muted); }
.panel-body { padding: 6px 14px 14px; height: 100%; }
/* OEE 三因子拆解（仪表盘下方） */
.panel-body.oee-body { display: flex; flex-direction: column; padding: 6px 14px 12px; }
.panel-body.oee-body .chart { flex: 1; min-height: 120px; }
.oee-breakdown { flex: 0 0 auto; display: flex; flex-direction: column; gap: 7px; padding-top: 8px; margin-top: 6px; border-top: 1px dashed var(--border); }
.oee-breakdown .oee-row { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.oee-breakdown .oee-row .lbl { width: 64px; color: var(--muted); flex: 0 0 auto; }
.oee-breakdown .oee-row .bar { flex: 1; height: 7px; border-radius: 4px; background: rgba(120,170,255,0.12); overflow: hidden; }
.oee-breakdown .oee-row .bar > i { display: block; height: 100%; border-radius: 4px; }
.oee-breakdown .oee-row .val { width: 50px; text-align: right; color: var(--txt); font-variant-numeric: tabular-nums; font-weight: 700; flex: 0 0 auto; }

/* ---------------- KPI flip cards ---------------- */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 18px;
}
.kpi-card {
  position: relative;
  padding: 18px 18px 16px;
  border-radius: var(--radius);
  background: linear-gradient(160deg, var(--panel-2), var(--panel));
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.kpi-card:hover { border-color: var(--border-strong); box-shadow: 0 0 18px var(--glow-cyan); }
.kpi-card:hover { transform: translateY(-3px); border-color: var(--border-strong); }
.kpi-card .accent {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 4px; border-radius: 4px 0 0 4px;
}
.kpi-label { font-size: 13px; color: var(--muted); font-weight: 600; }
.kpi-value {
  font-size: 34px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  margin-top: 6px;
  letter-spacing: 0.5px;
}
.kpi-value .suffix { font-size: 16px; font-weight: 700; color: var(--muted); margin-left: 3px; }
.kpi-trend { font-size: 12px; margin-top: 6px; font-weight: 600; display: flex; align-items: center; gap: 5px; }
.kpi-trend.up { color: var(--green); }
.kpi-trend.down { color: var(--red); }

/* ---------------- Dashboard grid ---------------- */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1.55fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 16px;
  height: calc(100vh - var(--header-h) - 150px);
  min-height: 540px;
}
.col-left { display: flex; flex-direction: column; gap: 16px; }
.col-right { display: flex; flex-direction: column; gap: 16px; }
.cell-map { grid-row: 1 / span 2; display: flex; flex-direction: column; }
.chart { width: 100%; height: 100%; min-height: 200px; }
.cell-map .panel-body { flex: 1; }
.map-chart { width: 100%; height: 100%; min-height: 420px; }

/* ---------------- Realtime ---------------- */
.rt-grid {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 16px;
  height: calc(100vh - var(--header-h) - 90px);
  min-height: 560px;
}
.rt-right { display: flex; flex-direction: column; gap: 16px; min-height: 0; }
.rt-line { flex: 1.4; min-height: 240px; }
.rt-line .chart { min-height: 240px; }
.status-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 4px 2px;
}
.status-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px;
  border-radius: 12px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}
.status-item:hover { border-color: var(--border-strong); background: var(--panel); }
.status-light {
  width: 12px; height: 12px; border-radius: 50%;
  flex: 0 0 auto;
  position: relative;
}
.status-light::after {
  content: ""; position: absolute; inset: -5px; border-radius: 50%;
  border: 2px solid currentColor; opacity: 0.4;
  animation: ping 1.6s ease-out infinite;
}
@keyframes ping {
  0% { transform: scale(0.6); opacity: 0.6; }
  100% { transform: scale(1.5); opacity: 0; }
}
.status-light.ok { background: var(--green); color: var(--green); box-shadow: 0 0 10px var(--green); }
.status-light.warn { background: var(--amber); color: var(--amber); box-shadow: 0 0 10px var(--amber); }
.status-light.err { background: var(--red); color: var(--red); box-shadow: 0 0 10px var(--red); }
.status-meta { display: flex; flex-direction: column; line-height: 1.25; }
.status-name { font-size: 13px; font-weight: 600; }
.status-desc { font-size: 11px; color: var(--muted); }

.alarm-panel { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.alarm-list {
  flex: 1; overflow: hidden; position: relative;
  padding: 4px 6px;
  mask-image: linear-gradient(180deg, transparent, #000 6%, #000 94%, transparent);
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 6%, #000 94%, transparent);
}
.alarm-item {
  display: grid;
  grid-template-columns: 54px 8px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 8px;
  border-bottom: 1px dashed var(--border);
  cursor: pointer;
  animation: slideIn 0.4s ease both;
  transition: background var(--transition);
}
.alarm-item:hover { background: var(--panel); }
@keyframes slideIn {
  from { opacity: 0; transform: translateX(18px); }
  to { opacity: 1; transform: translateX(0); }
}
.alarm-sev {
  font-size: 11px; font-weight: 700; text-align: center;
  padding: 3px 0; border-radius: 6px;
}
.alarm-sev.critical { background: rgba(251, 113, 133, 0.16); color: var(--red); }
.alarm-sev.warning { background: rgba(251, 191, 36, 0.16); color: var(--amber); }
.alarm-sev.info { background: rgba(46, 230, 230, 0.14); color: var(--cyan); }
.alarm-dot { width: 9px; height: 9px; border-radius: 50%; }
.alarm-dot.critical { background: var(--red); box-shadow: 0 0 8px var(--red); }
.alarm-dot.warning { background: var(--amber); box-shadow: 0 0 8px var(--amber); }
.alarm-dot.info { background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.alarm-msg { font-size: 13px; }
.alarm-msg .node { color: var(--muted); font-size: 11px; }
.alarm-time { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

.rt-badge {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; color: var(--muted); font-weight: 600;
}
.rt-badge .live {
  width: 9px; height: 9px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 10px var(--green);
  animation: blink 1s steps(2, start) infinite;
}
@keyframes blink { 50% { opacity: 0.25; } }

/* ---------------- Report ---------------- */
.report-wrap { display: flex; flex-direction: column; gap: 16px; }
.report-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  padding: 14px 18px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.toolbar-group { display: flex; align-items: center; gap: 8px; }
.toolbar-group label { font-size: 12px; color: var(--muted); font-weight: 600; }
.seg {
  display: flex; padding: 3px; gap: 3px;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px;
}
.seg button {
  border: none; background: transparent; color: var(--muted);
  font-size: 13px; font-weight: 600; padding: 6px 13px; border-radius: 8px; cursor: pointer;
  transition: all var(--transition);
}
.seg button.active { color: #04121f; background: linear-gradient(135deg, var(--cyan), #5eead4); }
html[data-theme="light"] .seg button.active { color: #fff; }
input[type="date"] {
  background: var(--panel-2); border: 1px solid var(--border); color: var(--txt);
  border-radius: 9px; padding: 7px 10px; font-size: 13px; font-family: inherit;
  color-scheme: dark;
}
html[data-theme="light"] input[type="date"] { color-scheme: light; }
.spacer { flex: 1; }
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--border-strong);
  background: linear-gradient(135deg, rgba(46, 230, 230, 0.16), rgba(168, 85, 247, 0.16));
  color: var(--txt); font-size: 13px; font-weight: 700;
  padding: 8px 16px; border-radius: 10px; cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px var(--glow-cyan); }
.btn.primary { background: linear-gradient(135deg, var(--cyan), var(--blue)); color: #04121f; border-color: transparent; }

.report-body { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; align-items: start; }
.table-wrap { overflow: auto; max-height: 560px; border-radius: 12px; }
table.data {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
table.data thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--bg-2);
  color: var(--muted); font-weight: 700; text-align: right;
  padding: 12px 14px; border-bottom: 1px solid var(--border-strong);
  cursor: pointer; user-select: none; white-space: nowrap;
}
table.data thead th:first-child { text-align: left; }
table.data thead th .arrow { font-size: 10px; opacity: 0.5; margin-left: 4px; }
table.data thead th.sorted .arrow { opacity: 1; color: var(--cyan); }
table.data tbody td {
  padding: 11px 14px; border-bottom: 1px solid var(--border);
  text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap;
}
table.data tbody td:first-child { text-align: left; font-weight: 600; }
table.data tbody tr { transition: background var(--transition); cursor: pointer; }
table.data tbody tr:hover { background: var(--panel-2); }
table.data tbody tr.selected { background: rgba(46, 230, 230, 0.12); }
.pct-bar {
  display: inline-block; height: 7px; border-radius: 4px; vertical-align: middle;
  background: linear-gradient(90deg, var(--cyan), var(--purple)); margin-right: 7px;
}
.tag { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 20px; }
.tag.up { background: rgba(52, 211, 153, 0.16); color: var(--green); }
.tag.down { background: rgba(251, 113, 133, 0.16); color: var(--red); }

.chart-card .chart { min-height: 300px; height: 360px; }

/* ---------------- Toast ---------------- */
.toast {
  position: fixed; left: 50%; bottom: 36px; transform: translateX(-50%) translateY(20px);
  background: var(--bg-2); border: 1px solid var(--border-strong);
  color: var(--txt); padding: 12px 20px; border-radius: 12px;
  box-shadow: var(--shadow); font-size: 13px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: all 0.35s ease; z-index: 100;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------------- Detail Drawer（下钻详情抽屉） ---------------- */
/* 参考 GoView / DataV 成熟大屏的「详情抽屉」交互：点击图表元素滑出右侧详情面板 */
.drawer-backdrop {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(2, 6, 16, 0.55);
  backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none;
  transition: opacity var(--transition);
}
.drawer-backdrop.show { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; z-index: 100;
  width: 420px; max-width: 92vw; height: 100%;
  display: flex; flex-direction: column;
  background: var(--bg-2);
  border-left: 1px solid var(--border-strong);
  box-shadow: -24px 0 60px rgba(0, 0, 0, 0.5);
  transform: translateX(100%);
  transition: transform var(--transition);
}
.drawer.show { transform: translateX(0); }
.drawer-head {
  flex: 0 0 auto; display: flex; align-items: flex-start; gap: 12px;
  padding: 20px 22px 16px; border-bottom: 1px solid var(--border);
}
.drawer-head .dh-accent { width: 4px; align-self: stretch; border-radius: 4px; background: var(--cyan); }
.drawer-titles { flex: 1; min-width: 0; }
.drawer-title { font-size: 17px; font-weight: 800; color: var(--txt); letter-spacing: 0.5px; }
.drawer-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.drawer-badge {
  font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 20px; white-space: nowrap;
  background: rgba(46, 230, 230, 0.14); color: var(--cyan);
}
.drawer-badge.warn { background: rgba(251, 191, 36, 0.16); color: var(--amber); }
.drawer-badge.err { background: rgba(251, 113, 133, 0.16); color: var(--red); }
.drawer-close {
  width: 34px; height: 34px; flex: 0 0 auto; border-radius: 9px;
  border: 1px solid var(--border); background: var(--panel); color: var(--muted);
  cursor: pointer; font-size: 18px; line-height: 1; transition: all var(--transition);
}
.drawer-close:hover { color: var(--txt); border-color: var(--border-strong); transform: rotate(90deg); }
.drawer-body { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 22px 28px; }
.drawer-body::-webkit-scrollbar { width: 8px; }
.drawer-body::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }

.d-section { margin-bottom: 22px; }
.d-section-title {
  font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: 1px;
  text-transform: uppercase; margin-bottom: 12px; display: flex; align-items: center; gap: 8px;
}
.d-section-title::before { content: ""; width: 3px; height: 12px; border-radius: 2px; background: var(--cyan); }

.d-metric-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.d-metric {
  padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--panel);
}
.d-metric .dm-label { font-size: 12px; color: var(--muted); }
.d-metric .dm-value { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; margin-top: 4px; }
.d-metric .dm-value small { font-size: 13px; font-weight: 700; color: var(--muted); margin-left: 3px; }

.d-bar { margin: 10px 0; }
.d-bar .dl { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 5px; }
.d-bar .dl .name { color: var(--txt); font-weight: 600; }
.d-bar .dl .val { color: var(--muted); font-variant-numeric: tabular-nums; }
.d-bar .track { height: 8px; border-radius: 5px; background: rgba(120, 170, 255, 0.12); overflow: hidden; }
.d-bar .track > i { display: block; height: 100%; border-radius: 5px; transition: width 0.6s ease; }

.d-def { font-size: 13px; line-height: 1.7; color: var(--muted); }
.d-def b { color: var(--txt); }
.d-chart { width: 100%; height: 220px; }

.d-note {
  display: flex; gap: 10px; padding: 12px 14px; border-radius: 10px;
  background: rgba(46, 230, 230, 0.06); border: 1px solid var(--border);
  font-size: 13px; line-height: 1.6; color: var(--txt);
}
.d-note.warn { background: rgba(251, 191, 36, 0.07); }
.d-note.err { background: rgba(251, 113, 133, 0.07); }
.d-note .ni { font-size: 16px; flex: 0 0 auto; }

.d-list { list-style: none; margin: 0; padding: 0; }
.d-list li {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 9px 0; border-bottom: 1px dashed var(--border); font-size: 13px;
}
.d-list li:last-child { border-bottom: none; }
.d-list .k { color: var(--muted); }
.d-list .v { color: var(--txt); font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------------- Responsive ---------------- */
@media (max-width: 1180px) {
  .dash-grid { grid-template-columns: 1fr 1fr; grid-template-rows: auto auto auto; height: auto; }
  .cell-map { grid-row: auto; grid-column: 1 / span 2; min-height: 420px; }
  .report-body { grid-template-columns: 1fr; }
  .rt-grid { grid-template-columns: 1fr; height: auto; }
  .rt-right { min-height: 480px; }
}
@media (max-width: 720px) {
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .nav { order: 3; width: 100%; margin: 0; justify-content: center; }
  .app-header { flex-wrap: wrap; height: auto; padding: 12px 16px; gap: 12px; }
  .dash-grid { grid-template-columns: 1fr; }
  .cell-map { grid-column: auto; }
}
