:root {
  color-scheme: light;
  --canvas: #f8f7fc;
  --surface: #ffffff;
  --surface-soft: #f4f0ff;
  --surface-violet: #eee9ff;
  --accent: #7c3aed;
  --accent-soft: #8b5cf6;
  --text: #171421;
  --muted: #6f687d;
  --line: #e7e1f0;
  --midnight-violet: var(--canvas);
  --ink-violet: var(--surface-soft);
  --electric-lime: var(--accent);
  --hot-pink: #ec4899;
  --accent-violet: var(--accent);
  --deep-violet: #6d28d9;
  --hairline-violet: #d8d0e6;
  --bg: var(--canvas);
  --bg-deep: #f1eef8;
  --panel: rgba(255, 255, 255, 0.94);
  --panel-strong: #ffffff;
  --line-bright: rgba(124, 58, 237, 0.46);
  --cyan: var(--accent);
  --blue: #6366f1;
  --green: #20b486;
  --yellow: #d99a16;
  --orange: #f9734d;
  --red: #e5486d;
  --faint: #9a93a8;
  --brand-gold-start: #f7bc2d;
  --brand-gold-end: #b88a34;
  --radius: 12px;
  --shadow: 0 14px 40px rgba(58, 38, 93, 0.08), 0 2px 8px rgba(58, 38, 93, 0.04);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg-deep); }
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 50% -14%, rgba(106, 95, 193, 0.28), transparent 34%),
    radial-gradient(circle at 6% 24%, rgba(250, 127, 170, 0.08), transparent 24%),
    radial-gradient(circle at 95% 38%, rgba(66, 32, 130, 0.16), transparent 27%),
    linear-gradient(180deg, #171025 0%, #100a1a 52%, #09060f 100%);
}

button, input, select { font: inherit; }
button, label[for] { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible, label[for]:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.ambient-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.56;
  background-image:
    radial-gradient(circle at 22% 18%, rgba(194, 239, 78, 0.2) 0 1px, transparent 1.7px),
    radial-gradient(circle at 78% 32%, rgba(250, 127, 170, 0.2) 0 1px, transparent 1.6px),
    linear-gradient(rgba(151, 130, 203, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(151, 130, 203, 0.035) 1px, transparent 1px);
  background-size: 240px 240px, 310px 310px, 48px 48px, 48px 48px;
  mask-image: linear-gradient(to bottom, black, transparent 90%);
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 1920px);
  margin: 0 auto;
  padding: 24px clamp(16px, 2.2vw, 42px) 36px;
}

.hero {
  --reactor-rx: 0deg;
  --reactor-ry: 0deg;
  position: relative;
  display: grid;
  grid-template-columns: minmax(320px, 0.88fr) minmax(430px, 1.24fr) minmax(300px, 0.82fr);
  grid-template-areas:
    "brand reactor status"
    "actions reactor status";
  align-items: center;
  gap: 18px 28px;
  min-height: 330px;
  padding: 24px 28px;
  border: 1px solid rgba(151, 130, 203, 0.32);
  background:
    radial-gradient(circle at 50% 45%, rgba(106, 95, 193, 0.15), transparent 36%),
    linear-gradient(112deg, rgba(250, 127, 170, 0.055), transparent 35%, rgba(194, 239, 78, 0.035)),
    rgba(19, 13, 32, 0.9);
  box-shadow: 0 28px 80px rgba(4, 2, 10, 0.52), inset 0 1px rgba(255, 255, 255, 0.035), inset 0 -1px rgba(194, 239, 78, 0.09);
  clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 22px 100%, 0 calc(100% - 22px));
  overflow: hidden;
  isolation: isolate;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, transparent 49.8%, rgba(194, 239, 78, 0.08) 50%, transparent 50.2%),
    linear-gradient(0deg, transparent 49.8%, rgba(106, 95, 193, 0.12) 50%, transparent 50.2%);
  background-size: 180px 180px;
  mask-image: radial-gradient(circle at 50% 50%, black, transparent 72%);
}
.hero::after {
  content: "";
  position: absolute;
  top: -35%;
  left: 42%;
  z-index: -1;
  width: 20%;
  height: 170%;
  background: linear-gradient(90deg, transparent, rgba(194, 239, 78, 0.045), transparent);
  transform: skewX(-18deg);
  animation: light-sweep 9s ease-in-out infinite;
}
.hero__brand { grid-area: brand; display: flex; align-items: center; gap: 16px; min-width: 0; }
.brand-mark {
  position: relative;
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  border: 1px solid rgba(194, 239, 78, 0.54);
  transform: rotate(45deg);
  box-shadow: 0 0 26px rgba(194, 239, 78, 0.12), inset 0 0 22px rgba(106, 95, 193, 0.24);
}
.brand-mark span { position: absolute; inset: 9px; border: 1px solid rgba(159, 140, 255, 0.48); }
.brand-mark span:nth-child(2) { inset: 17px; background: rgba(106, 95, 193, 0.22); }
.brand-mark span:nth-child(3) { inset: 25px; border: 0; background: var(--electric-lime); box-shadow: 0 0 16px rgba(194, 239, 78, 0.72); }
.eyebrow { margin: 0 0 7px; color: var(--electric-lime); font-size: 10px; letter-spacing: 0.24em; }
h1 { margin: 0; color: #fbf9ff; font-size: clamp(30px, 2.4vw, 46px); line-height: 1.08; letter-spacing: 0.075em; text-shadow: 0 0 32px rgba(159, 140, 255, 0.24); }
.hero__subtitle { margin: 9px 0 0; color: var(--muted); font-size: 12px; letter-spacing: 0.13em; }
.hero__status { grid-area: status; display: grid; gap: 10px; align-content: center; }
.hero__status div { min-width: 0; padding: 13px 15px; text-align: left; border: 1px solid rgba(151, 130, 203, 0.16); border-left: 2px solid rgba(159, 140, 255, 0.56); border-radius: 7px; background: linear-gradient(90deg, rgba(106, 95, 193, 0.12), rgba(21, 15, 35, 0.18)); }
.hero__status div:last-child { border-right: 1px solid rgba(151, 130, 203, 0.16); }
.hero__status span, .hero__status strong { display: block; }
.hero__status span { color: var(--faint); font-size: 10px; letter-spacing: 0.1em; }
.hero__status strong { margin-top: 6px; color: #e8e0f8; font-size: 12px; font-weight: 500; white-space: nowrap; }
.hero__actions { grid-area: actions; display: flex; justify-content: flex-start; align-self: start; flex-wrap: wrap; gap: 8px; min-width: 0; }
.action-button, .text-button, .icon-button {
  cursor: pointer;
  color: #c9bedb;
  border: 1px solid rgba(151, 130, 203, 0.32);
  background: rgba(43, 30, 70, 0.46);
  transition: color 180ms ease, border-color 180ms ease, transform 180ms ease, background 180ms ease;
}
.action-button { display: inline-flex; align-items: center; justify-content: center; min-height: 34px; padding: 7px 11px; border-radius: 4px; font-size: 12px; }
.action-button:hover, .text-button:hover, .icon-button:hover { color: #fff; border-color: #a796e8; background: rgba(86, 66, 142, 0.42); transform: translateY(-1px); }
.action-button--primary { color: #f8f5ff; border-color: rgba(194, 239, 78, 0.56); background: linear-gradient(135deg, #4f438d, #32235f); box-shadow: inset 0 1px rgba(255,255,255,.08), 0 0 18px rgba(194, 239, 78, 0.07); font-weight: 700; }
.action-button--icon { width: 36px; padding: 0; font-size: 19px; }

.reactor-stage {
  --reactor-load: 0;
  grid-area: reactor;
  position: relative;
  align-self: stretch;
  min-width: 0;
  min-height: 276px;
  perspective: 900px;
  border-inline: 1px solid rgba(151, 130, 203, 0.12);
  background: radial-gradient(ellipse at center, rgba(106, 95, 193, 0.09), transparent 62%);
}
.reactor-stage::before {
  content: "";
  position: absolute;
  inset: 10% 14% 17%;
  border: 1px solid rgba(194, 239, 78, calc(0.04 + var(--reactor-load) * 0.12));
  border-radius: 50%;
  box-shadow: 0 0 55px rgba(106, 95, 193, calc(0.12 + var(--reactor-load) * 0.18));
  transform: perspective(500px) rotateX(70deg);
}
.reactor-stage__label { position: absolute; top: 6px; left: 50%; z-index: 3; color: rgba(194, 239, 78, 0.72); font: 600 9px/1.2 Consolas, monospace; letter-spacing: 0.2em; transform: translateX(-50%); white-space: nowrap; }
.reactor-stage__label::before { content: ""; display: inline-block; width: 4px; height: 4px; margin: 0 7px 1px 0; border-radius: 50%; background: var(--electric-lime); box-shadow: 0 0 10px var(--electric-lime); }
.reactor-scene { position: absolute; inset: -4px 0 22px; width: 100%; height: calc(100% - 18px); overflow: visible; transform: rotateX(var(--reactor-rx)) rotateY(var(--reactor-ry)); transform-origin: 50% 50%; transition: transform 320ms cubic-bezier(.2,.8,.2,1); }
.reactor-grid path { fill: none; stroke: rgba(151, 130, 203, 0.13); stroke-width: 0.8; vector-effect: non-scaling-stroke; }
.reactor-grid path:first-child { fill: rgba(66, 32, 130, 0.07); stroke: rgba(159, 140, 255, 0.17); }
.reactor-aura { fill: rgba(106, 95, 193, calc(0.08 + var(--reactor-load) * 0.1)); filter: url(#soft-glow); animation: reactor-pulse 4.8s ease-in-out infinite; }
.reactor-orbit { transform-box: fill-box; transform-origin: center; }
.reactor-orbit--outer { animation: reactor-orbit 24s linear infinite; }
.reactor-orbit--inner { animation: reactor-orbit-reverse 17s linear infinite; }
.reactor-orbit ellipse { fill: none; stroke: url(#orbit-gradient); stroke-width: 1.35; stroke-dasharray: 4 8 42 10; vector-effect: non-scaling-stroke; }
.reactor-orbit--inner ellipse { stroke-width: 1; stroke-dasharray: 2 7 28 8; opacity: 0.72; }
.reactor-node { fill: #9f8cff; stroke: rgba(255,255,255,.7); stroke-width: 1; filter: url(#reactor-glow); animation: node-drift 3.8s ease-in-out infinite; }
.reactor-node--lime { fill: var(--electric-lime); }
.reactor-node--pink { fill: var(--hot-pink); animation-delay: -1.4s; }
.reactor-links path { fill: none; stroke: rgba(159, 140, 255, 0.24); stroke-width: 0.8; stroke-dasharray: 2 7; vector-effect: non-scaling-stroke; }
.reactor-satellites path { fill: rgba(31, 22, 51, 0.92); stroke: rgba(194, 239, 78, 0.48); stroke-width: 1; }
.reactor-satellites circle { fill: var(--electric-lime); }
.reactor-core { transform-box: fill-box; transform-origin: center; animation: reactor-pulse 4.8s ease-in-out infinite; }
.reactor-core__halo { fill: rgba(106, 95, 193, calc(0.12 + var(--reactor-load) * 0.15)); }
.reactor-core__shell { fill: rgba(31, 22, 51, 0.72); stroke: url(#core-shell); stroke-width: 1.4; }
.reactor-core__shell--back { fill: rgba(66, 32, 130, 0.09); stroke-dasharray: 3 5; opacity: 0.62; }
.reactor-core__energy { fill: url(#core-gradient); opacity: calc(0.76 + var(--reactor-load) * 0.2); }
.reactor-core__iris { fill: #fdfcff; stroke: var(--electric-lime); stroke-width: 2; }
.reactor-core__axis { fill: none; stroke: rgba(194, 239, 78, 0.34); stroke-width: 0.8; stroke-dasharray: 2 5; }
.reactor-particles circle { fill: #b9a8ff; opacity: 0.54; animation: node-drift 4.2s ease-in-out infinite; }
.reactor-particles circle:nth-child(2n) { fill: var(--hot-pink); animation-delay: -2s; }
.reactor-metrics { position: absolute; right: 7%; bottom: 2px; left: 7%; z-index: 4; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.reactor-metric { padding: 7px 9px; border-top: 1px solid rgba(151, 130, 203, 0.28); background: linear-gradient(180deg, rgba(31, 22, 51, 0.18), rgba(31, 22, 51, 0.68)); backdrop-filter: blur(8px); }
.reactor-metric span, .reactor-metric strong { display: block; text-align: center; }
.reactor-metric span { color: var(--faint); font-size: 8px; letter-spacing: 0.08em; }
.reactor-metric strong { margin-top: 4px; color: #eee9fa; font: 600 13px/1 Consolas, monospace; font-variant-numeric: tabular-nums; }
.reactor-metric:first-child strong { color: var(--electric-lime); }

.phase-notice {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 12px 0;
  padding: 9px 14px;
  color: #9e93b5;
  border-left: 2px solid var(--hot-pink);
  background: linear-gradient(90deg, rgba(250, 127, 170, 0.08), transparent);
  font-size: 12px;
}
.phase-notice strong { color: #e5dcf4; }
.phase-notice__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); }

.panel {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 100% 0, rgba(106, 95, 193, 0.09), transparent 30%),
    linear-gradient(145deg, rgba(31, 22, 51, 0.88), rgba(16, 10, 28, 0.92));
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}
.panel::before, .panel::after { content: ""; position: absolute; z-index: 2; pointer-events: none; width: 18px; height: 18px; }
.panel::before { top: -1px; left: -1px; border-top: 2px solid var(--electric-lime); border-left: 2px solid var(--electric-lime); opacity: 0.66; }
.panel::after { right: -1px; bottom: -1px; border-right: 2px solid rgba(250, 127, 170, 0.48); border-bottom: 2px solid rgba(250, 127, 170, 0.48); }
.panel-heading { position: relative; z-index: 2; display: flex; justify-content: space-between; align-items: center; min-height: 52px; padding: 13px 18px 10px; border-bottom: 1px solid rgba(151, 130, 203, 0.13); }
.panel-heading::after { content: ""; position: absolute; left: 18px; bottom: -1px; width: 86px; height: 1px; background: linear-gradient(90deg, var(--electric-lime), transparent); }
.panel-heading > div:first-child { display: flex; align-items: center; gap: 10px; min-width: 0; }
.panel-heading h2 { margin: 0; color: #eee9f8; font-size: 16px; font-weight: 600; letter-spacing: 0.06em; }
.panel-index { color: var(--electric-lime); font: 700 10px/1 Arial, sans-serif; letter-spacing: 0.12em; text-shadow: 0 0 10px rgba(194, 239, 78, 0.25); }
.panel-unit { color: var(--faint); font-size: 11px; }
.panel-heading--inline { min-height: 58px; }

.filter-panel { margin-bottom: 14px; }
.filters { display: grid; grid-template-columns: repeat(8, minmax(120px, 1fr)); gap: 10px; padding: 14px 18px 10px; }
.filters label { display: grid; gap: 6px; color: var(--muted); font-size: 11px; }
.filters input, .filters select {
  width: 100%;
  height: 35px;
  padding: 0 10px;
  color: #eee9f7;
  border: 1px solid rgba(151, 130, 203, 0.24);
  border-radius: 4px;
  background: rgba(13, 8, 23, 0.72);
}
.filters input:hover, .filters select:hover { border-color: rgba(194, 239, 78, 0.34); }
.filters select option { color: #eee9f7; background: #1f1633; }
.filter-actions { margin-left: auto; }
.text-button { padding: 6px 12px; border-radius: 4px; font-size: 12px; }
.import-report { margin: 0 18px 12px; padding: 8px 12px; color: #aa9fc0; border: 1px solid rgba(151, 130, 203, 0.12); background: rgba(11, 7, 19, 0.46); font: 12px/1.5 Consolas, monospace; }

.kpi-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin: 14px 0; }
.kpi-card {
  --accent: var(--cyan);
  --accent-rgb: 53, 220, 255;
  position: relative;
  display: grid;
  grid-template-columns: 50px 1fr;
  align-items: center;
  min-height: 124px;
  padding: 18px 14px;
  border: 1px solid rgba(151, 130, 203, 0.2);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(33, 23, 55, 0.94), rgba(14, 9, 24, 0.96));
  box-shadow: inset 0 0 28px rgba(var(--accent-rgb), 0.045), 0 14px 38px rgba(5, 2, 11, 0.34);
  overflow: hidden;
  transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}
.kpi-card::before { content: ""; position: absolute; top: 0; left: 0; width: 2px; height: 100%; background: linear-gradient(transparent, var(--accent), transparent); box-shadow: 0 0 12px var(--accent); }
.kpi-card[data-accent="yellow"] { --accent: var(--yellow); --accent-rgb: 247, 213, 93; }
.kpi-card[data-accent="orange"] { --accent: var(--orange); --accent-rgb: 255, 140, 85; }
.kpi-card[data-accent="green"] { --accent: var(--green); --accent-rgb: 55, 229, 161; }
.kpi-card[data-accent="blue"] { --accent: #67a4ff; --accent-rgb: 103, 164, 255; }
.kpi-card[data-accent="amber"] { --accent: #ffc365; --accent-rgb: 255, 195, 101; }
.kpi-card__icon { display: grid; place-items: center; width: 40px; height: 40px; color: var(--accent); border: 1px solid rgba(var(--accent-rgb), 0.62); border-radius: 10px; background: rgba(var(--accent-rgb), 0.10); box-shadow: 0 0 20px rgba(var(--accent-rgb), 0.17); font: 700 19px Arial; }
.kpi-card__body { min-width: 0; }
.kpi-card__body span { display: block; color: #aaa0bd; font-size: 13px; white-space: nowrap; }
.kpi-card__body strong { display: block; margin: 6px 0 3px; color: #faf8ff; font: 700 clamp(25px, 2vw, 34px)/1 "Arial Narrow", Arial, sans-serif; letter-spacing: 0.01em; font-variant-numeric: tabular-nums; text-shadow: 0 0 16px rgba(var(--accent-rgb), 0.2); }
.kpi-card__body small { display: block; overflow: hidden; color: var(--faint); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.kpi-card__spark { position: absolute; right: -18px; bottom: -26px; width: 90px; height: 55px; border: 1px solid rgba(var(--accent-rgb), 0.18); border-radius: 50%; transform: rotate(-14deg); box-shadow: 0 0 24px rgba(var(--accent-rgb), .06); }

@media (hover: hover) {
  .panel:hover, .kpi-card:hover { transform: translateY(-2px); border-color: rgba(159, 140, 255, 0.4); box-shadow: 0 30px 84px rgba(6, 3, 13, 0.54), inset 0 1px rgba(255,255,255,.035); }
}

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(350px, 2fr); gap: 14px; }
.chart-panel { min-height: 355px; }
.chart { width: 100%; height: 300px; }
.efficiency-panel { margin-top: 14px; }
.table-summary { display: flex; gap: 24px; color: var(--muted); font-size: 12px; }
.table-summary strong { margin-left: 5px; color: var(--cyan); font: 700 16px Arial; }
.table-wrap { max-height: 530px; overflow: auto; scrollbar-color: rgba(52, 181, 241, 0.5) rgba(3, 18, 34, 0.8); }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
thead { position: sticky; top: 0; z-index: 3; background: #281b42; }
th { height: 42px; padding: 9px 14px; color: #b7a9d0; font-weight: 500; text-align: left; white-space: nowrap; }
td { min-height: 42px; padding: 10px 14px; color: #c9bfd8; border-top: 1px solid rgba(151, 130, 203, 0.11); }
tbody tr { background: rgba(24, 16, 40, 0.4); transition: background 150ms ease; }
tbody tr:nth-child(even) { background: rgba(42, 29, 68, 0.26); }
tbody tr:hover { background: rgba(74, 54, 118, 0.3); }
tfoot { position: sticky; bottom: 0; background: #25183d; box-shadow: 0 -7px 20px rgba(5, 2, 11, 0.32); }
tfoot td { color: #eee8f8; font-weight: 600; }
.empty-row td { height: 120px; color: var(--faint); text-align: center; }
.metric-bar { position: relative; display: block; width: 100%; min-width: 120px; padding: 5px 8px; overflow: hidden; color: #eee9f8; border-radius: 3px; background: rgba(106, 95, 193, 0.12); }
.metric-bar::before { content: ""; position: absolute; inset: 0 auto 0 0; z-index: 0; width: var(--bar, 0%); background: linear-gradient(90deg, rgba(66, 32, 130, 0.34), rgba(159, 140, 255, 0.52)); }
.metric-bar span { position: relative; z-index: 1; }
.row-action { cursor: pointer; padding: 5px 9px; color: #b9a8ff; border: 1px solid rgba(159, 140, 255, 0.28); border-radius: 3px; background: transparent; font-size: 11px; }
.row-action:hover { color: #fff; border-color: #a796e8; background: rgba(106, 95, 193, 0.12); }

.drawer-overlay { position: fixed; inset: 0; z-index: 19; background: rgba(7, 3, 14, 0.72); backdrop-filter: blur(5px); }
.detail-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 20;
  width: min(620px, 94vw);
  height: 100vh;
  padding: 22px;
  overflow-y: auto;
  border-left: 1px solid rgba(159, 140, 255, 0.42);
  background: linear-gradient(155deg, rgba(34, 24, 57, 0.99), rgba(11, 7, 19, 0.99));
  box-shadow: -28px 0 70px rgba(5, 2, 11, 0.62);
  transform: translateX(103%);
  transition: transform 260ms ease;
}
.detail-drawer.is-open { transform: translateX(0); }
.drawer-header { display: flex; align-items: center; justify-content: space-between; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.drawer-header h2 { margin: 6px 0 0; font-size: 21px; }
.icon-button { width: 38px; height: 38px; border-radius: 50%; font-size: 26px; }
.drawer-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px 0; }
.drawer-summary article { padding: 13px; border: 1px solid var(--line); border-radius: 5px; background: rgba(33, 23, 55, 0.72); }
.drawer-summary span, .drawer-summary strong { display: block; }
.drawer-summary span { color: var(--faint); font-size: 10px; }
.drawer-summary strong { margin-top: 6px; color: #f1ecfa; font: 600 16px Arial; }
.drawer-order { margin-bottom: 10px; padding: 14px; border: 1px solid rgba(151, 130, 203, 0.18); border-radius: 5px; background: rgba(31, 22, 51, 0.66); }
.drawer-order__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.drawer-order__top strong { color: #e6f9ff; font: 600 13px Consolas, monospace; }
.status-pill { padding: 3px 7px; color: #ffcf7a; border: 1px solid rgba(255, 186, 80, 0.32); border-radius: 99px; background: rgba(255, 164, 47, 0.08); font-size: 10px; }
.drawer-order dl { display: grid; grid-template-columns: 88px 1fr; gap: 7px 10px; margin: 12px 0 0; font-size: 12px; }
.drawer-order dt { color: var(--faint); }
.drawer-order dd { margin: 0; color: #a9cbdd; overflow-wrap: anywhere; }
.toast { position: fixed; left: 50%; bottom: 26px; z-index: 30; min-width: 260px; max-width: min(520px, 90vw); padding: 11px 16px; color: #f5f1ff; border: 1px solid rgba(159, 140, 255, 0.45); border-radius: 7px; background: rgba(31, 22, 51, 0.97); box-shadow: 0 16px 48px rgba(5, 2, 11, 0.55); text-align: center; transform: translate(-50%, 130px); opacity: 0; transition: transform 220ms ease, opacity 220ms ease; }
.toast.is-visible { transform: translate(-50%, 0); opacity: 1; }

footer { display: flex; justify-content: space-between; gap: 20px; padding: 22px 4px 0; color: #365a74; font-size: 10px; letter-spacing: 0.08em; }
.reveal { animation: cinematic-reveal 620ms cubic-bezier(.2,.72,.2,1) both; }
.kpi-card:nth-child(2), .dashboard-grid .panel:nth-child(2) { animation-delay: 40ms; }
.kpi-card:nth-child(3), .dashboard-grid .panel:nth-child(3) { animation-delay: 80ms; }
.kpi-card:nth-child(4), .dashboard-grid .panel:nth-child(4) { animation-delay: 120ms; }
.kpi-card:nth-child(5), .dashboard-grid .panel:nth-child(5) { animation-delay: 160ms; }
.kpi-card:nth-child(6), .dashboard-grid .panel:nth-child(6) { animation-delay: 200ms; }
@keyframes cinematic-reveal { from { opacity: 0; transform: translateY(11px) scale(.995); filter: blur(2px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes reactor-orbit { to { transform: rotate(360deg); } }
@keyframes reactor-orbit-reverse { to { transform: rotate(-360deg); } }
@keyframes reactor-pulse { 0%, 100% { transform: scale(.98); opacity: .78; } 50% { transform: scale(1.035); opacity: 1; } }
@keyframes node-drift { 0%, 100% { opacity: .52; } 50% { opacity: 1; filter: drop-shadow(0 0 6px currentColor); } }
@keyframes light-sweep { 0%, 35% { transform: translateX(-250%) skewX(-18deg); opacity: 0; } 48% { opacity: 1; } 64%, 100% { transform: translateX(360%) skewX(-18deg); opacity: 0; } }
@keyframes scan { to { transform: translateX(410%); } }

@media (max-width: 1580px) {
  .hero {
    grid-template-columns: minmax(330px, 0.9fr) minmax(420px, 1.1fr);
    grid-template-areas:
      "brand reactor"
      "status reactor"
      "actions actions";
  }
  .hero__status { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero__actions { grid-column: 1 / -1; justify-content: flex-start; }
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .filters { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 1100px) {
  .app-shell { padding-inline: 12px; }
  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(260px, .75fr);
    grid-template-areas:
      "brand status"
      "reactor reactor"
      "actions actions";
  }
  .reactor-stage { width: min(100%, 760px); min-height: 268px; justify-self: center; }
  .hero__status { grid-template-columns: 1fr; justify-content: stretch; overflow-x: visible; }
  .hero__status div:first-child { border-left: 0; padding-left: 0; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .chart-panel { min-height: 330px; }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .app-shell { padding: 10px; }
  .hero {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "brand" "reactor" "status" "actions";
    gap: 12px;
    padding: 18px 14px;
    clip-path: polygon(0 0, calc(100% - 15px) 0, 100% 15px, 100% 100%, 15px 100%, 0 calc(100% - 15px));
  }
  .brand-mark { width: 44px; height: 44px; flex-basis: 44px; }
  h1 { font-size: clamp(25px, 8vw, 33px); }
  .hero__subtitle { font-size: 10px; letter-spacing: .08em; }
  .reactor-stage { min-height: 226px; border-inline: 0; }
  .reactor-scene { inset: -15px -10% 30px; width: 120%; height: calc(100% - 8px); }
  .reactor-orbit--outer, .reactor-links, .reactor-particles, .reactor-satellites g:nth-child(n+3) { display: none; }
  .reactor-metrics { right: 1%; left: 1%; }
  .reactor-metric { padding-inline: 4px; }
  .hero__status { display: grid; grid-template-columns: 1fr 1fr; }
  .hero__status div, .hero__status div:last-child { min-width: 0; padding: 8px; border: 0; text-align: left; }
  .hero__actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: auto; max-width: 100%; }
  .hero__actions .action-button { width: 100%; min-width: 0; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .kpi-card { grid-template-columns: 40px 1fr; min-height: 112px; padding: 14px 10px; }
  .kpi-card__icon { width: 32px; height: 32px; }
  .filters { grid-template-columns: minmax(0, 1fr); }
  .filters label, .filters input, .filters select { min-width: 0; max-width: 100%; }
  .filter-panel .panel-heading { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
  .filter-actions { min-width: 0; margin-left: 0; }
  .phase-notice > span:last-child { min-width: 0; overflow-wrap: anywhere; }
  .chart { height: 270px; }
  .table-summary { display: none; }
  footer { flex-direction: column; }
}

@media (max-width: 420px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .phase-notice { align-items: flex-start; }
}

/* Lavender-light SaaS visual layer: keeps the existing dashboard structure intact. */
html { background: var(--canvas); }
body {
  color: var(--text);
  background:
    radial-gradient(circle at 10% -4%, rgba(167, 139, 250, 0.15), transparent 28%),
    radial-gradient(circle at 96% 8%, rgba(236, 72, 153, 0.055), transparent 22%),
    linear-gradient(180deg, #fcfbff 0, var(--canvas) 34%, #f6f3fb 100%);
}
.ambient-grid {
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(124, 58, 237, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124, 58, 237, 0.035) 1px, transparent 1px);
  mask-image: linear-gradient(to bottom, black 0, transparent 76%);
}
.hero,
.panel,
.kpi-card {
  color: var(--text);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  clip-path: none;
}
.hero::before,
.hero::after,
.panel::before,
.panel::after { display: none; }
.hero { background: linear-gradient(135deg, rgba(255,255,255,.98), rgba(249,247,255,.96)); }
.brand-mark {
  color: var(--accent);
  border-color: rgba(124, 58, 237, 0.22);
  background: var(--surface-soft);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.86), 0 8px 22px rgba(124,58,237,.10);
}
.brand-mark span { background: var(--accent); box-shadow: none; }
.eyebrow,
.panel-index { color: var(--accent); text-shadow: none; }
.hero__brand h1 { color: var(--text); text-shadow: none; }
.hero__subtitle,
.hero__status span,
.panel-unit,
.kpi-card__body span,
.kpi-card__body small,
.drawer-summary span,
.drawer-order dt { color: var(--muted); }
.hero__status {
  border-color: var(--line);
  background: var(--surface-soft);
  box-shadow: none;
}
.hero__status div { border-color: var(--line); }
.hero__status strong { color: var(--text); }
.action-button,
.text-button,
.icon-button {
  color: #4c4658;
  border-color: var(--line);
  background: var(--surface);
  box-shadow: 0 2px 7px rgba(58,38,93,.04);
}
.action-button:hover,
.text-button:hover,
.icon-button:hover {
  color: var(--accent);
  border-color: rgba(124, 58, 237, 0.34);
  background: var(--surface-soft);
  box-shadow: 0 8px 20px rgba(124,58,237,.09);
}
.action-button--primary {
  color: #fff;
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--accent), var(--accent-soft));
  box-shadow: 0 10px 24px rgba(124,58,237,.20);
}
.action-button--primary:hover { color: #fff; background: linear-gradient(135deg, #6d28d9, #7c3aed); }
.action-button:focus-visible,
.text-button:focus-visible,
.icon-button:focus-visible,
.row-action:focus-visible,
.filters input:focus,
.filters select:focus {
  outline: 3px solid rgba(124,58,237,.14);
  outline-offset: 2px;
  border-color: var(--accent);
}
.reactor-stage {
  border-color: rgba(184,138,52,.18);
  background:
    radial-gradient(circle at 50% 43%, rgba(247,188,45,.10), transparent 32%),
    linear-gradient(145deg, rgba(244,240,255,.86), rgba(255,255,255,.92));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.72), 0 12px 36px rgba(184,138,52,.08);
}
.reactor-stage::before,
.reactor-stage::after { border-color: rgba(184,138,52,.26); opacity: .34; }
.reactor-stage__label { color: #837a90; }
.reactor-stage__label::before { background: var(--brand-gold-start); box-shadow: 0 0 10px rgba(247,188,45,.52); }
.reactor-grid path { stroke: rgba(124,58,237,.12); }
.reactor-aura { fill: rgba(247,188,45,.10); }
.reactor-orbit ellipse { stroke: url(#orbit-gradient); filter: none; }
.reactor-links path { stroke: rgba(184,138,52,.32); }
.reactor-satellites path { fill: #fff; stroke: rgba(184,138,52,.68); filter: none; }
.reactor-satellites circle { fill: var(--brand-gold-start); }
.reactor-core__halo { fill: rgba(247,188,45,.12); }
.reactor-core__shell { fill: url(#core-shell); stroke: rgba(184,138,52,.72); }
.reactor-core__shell--back { opacity: .34; }
.reactor-core__energy { fill: url(#core-gradient); }
.reactor-core__iris { fill: #fffdf6; stroke: var(--brand-gold-start); }
.reactor-core__axis { stroke: rgba(184,138,52,.56); }
.reactor-node { fill: var(--brand-gold-start); stroke: #fff; filter: drop-shadow(0 2px 5px rgba(184,138,52,.24)); }
.reactor-node--lime { fill: var(--green); }
.reactor-node--pink { fill: var(--hot-pink); }
.reactor-particles circle { fill: var(--brand-gold-start); }
.reactor-metrics { border-color: var(--line); background: rgba(255,255,255,.82); box-shadow: 0 8px 24px rgba(58,38,93,.06); }
.reactor-metric { border-color: var(--line); background: linear-gradient(180deg, rgba(255,255,255,.28), rgba(244,240,255,.72)); }
.reactor-metric span { color: var(--muted); }
.reactor-metric strong,
.reactor-metric:first-child strong { color: var(--brand-gold-end); text-shadow: none; }
.phase-notice {
  color: var(--muted);
  border-color: rgba(124,58,237,.16);
  background: linear-gradient(90deg, rgba(124,58,237,.075), rgba(255,255,255,.66));
}
.phase-notice strong { color: #4c356f; }
.phase-notice__dot { background: var(--accent); box-shadow: 0 0 0 5px rgba(124,58,237,.10); }
.panel-heading { border-color: var(--line); }
.panel-heading::after { background: linear-gradient(90deg, var(--accent), transparent); }
.panel-heading h2 { color: var(--text); }
.filters label { color: var(--muted); }
.filters input,
.filters select {
  color: var(--text);
  border-color: var(--line);
  background: var(--surface);
  box-shadow: inset 0 1px 2px rgba(58,38,93,.025);
}
.filters input:hover,
.filters select:hover { border-color: rgba(124,58,237,.32); }
.filters input::placeholder { color: #aaa3b7; }
.filters select option { color: var(--text); background: var(--surface); }
.import-report {
  color: var(--muted);
  border-color: var(--line);
  background: var(--surface-soft);
}
.kpi-card {
  background: linear-gradient(145deg, #fff, #fbfaff);
  box-shadow: var(--shadow), inset 0 0 24px rgba(var(--accent-rgb), .025);
}
.kpi-card::before { width: 3px; box-shadow: none; }
.kpi-card__icon {
  border-color: rgba(var(--accent-rgb), .26);
  background: rgba(var(--accent-rgb), .09);
  box-shadow: none;
}
.kpi-card__body strong { color: var(--text); text-shadow: none; }
.kpi-card__spark { border-color: rgba(var(--accent-rgb), .12); box-shadow: none; }
@media (hover: hover) {
  .panel:hover,
  .kpi-card:hover {
    transform: translateY(-2px);
    border-color: rgba(124,58,237,.24);
    box-shadow: 0 18px 42px rgba(58,38,93,.11);
  }
}
.table-wrap { scrollbar-color: rgba(124,58,237,.34) var(--surface-soft); }
thead { background: var(--surface-violet); }
th { color: #625a70; }
td { color: #443e50; border-color: var(--line); }
tbody tr { background: rgba(255,255,255,.82); }
tbody tr:nth-child(even) { background: rgba(248,247,252,.88); }
tbody tr:hover { background: var(--surface-soft); }
tfoot { background: var(--surface-violet); box-shadow: 0 -6px 18px rgba(58,38,93,.05); }
tfoot td { color: var(--text); }
.metric-bar { color: #493d5c; background: #f0ecf8; }
.metric-bar::before { background: linear-gradient(90deg, rgba(124,58,237,.10), rgba(139,92,246,.30)); }
.row-action {
  color: var(--accent);
  border-color: rgba(124,58,237,.24);
  background: #fff;
}
.row-action:hover { color: #fff; border-color: var(--accent); background: var(--accent); }
.drawer-overlay { background: rgba(42,29,68,.18); backdrop-filter: blur(4px); }
.detail-drawer {
  color: var(--text);
  border-color: var(--line);
  background: rgba(255,255,255,.98);
  box-shadow: -24px 0 64px rgba(58,38,93,.16);
}
.drawer-header { border-color: var(--line); background: rgba(255,255,255,.92); }
.drawer-header h2 { color: var(--text); }
.drawer-summary article,
.drawer-order { border-color: var(--line); background: var(--surface-soft); }
.drawer-summary strong,
.drawer-order__top strong { color: var(--text); }
.drawer-order dd { color: #574e66; }
.status-pill { color: #a85a0c; border-color: rgba(217,154,22,.28); background: rgba(217,154,22,.09); }
.toast {
  color: var(--text);
  border-color: rgba(124,58,237,.26);
  background: rgba(255,255,255,.97);
  box-shadow: 0 18px 48px rgba(58,38,93,.18);
}
.toast[data-tone="success"] { border-color: rgba(32,180,134,.34); }
.toast[data-tone="error"] { border-color: rgba(229,72,109,.34); }
footer { color: #81798e; }

/* Compact WINIT brand layer: preserve the lavender dashboard and scope gold to brand identity. */
.hero {
  grid-template-columns: minmax(340px, .72fr) minmax(620px, 1.28fr);
  grid-template-areas:
    "brand reactor"
    "actions reactor";
  min-height: 350px;
  color: var(--text);
  border-color: var(--line);
  background: linear-gradient(135deg, rgba(255,255,255,.98), rgba(249,247,255,.96));
  box-shadow: var(--shadow);
  clip-path: none;
}
.hero::before,
.hero::after { display: none; }
.hero__brand { align-items: flex-start; }
.hero__brand-copy { min-width: 0; }
.winit-brand-logo {
  display: block;
  width: min(205px, 62vw);
  aspect-ratio: 205 / 44;
  margin: 0 0 18px;
  background: linear-gradient(90deg, var(--brand-gold-start), var(--brand-gold-end));
  -webkit-mask: url("./winit-brand-white.png") center / contain no-repeat;
  mask: url("./winit-brand-white.png") center / contain no-repeat;
  filter: drop-shadow(0 3px 9px rgba(184,138,52,.16));
}
.hero .eyebrow { color: var(--accent); }
.hero__brand h1 {
  color: var(--brand-gold-end);
  background: linear-gradient(90deg, var(--brand-gold-start), var(--brand-gold-end));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
}
.hero__subtitle { color: var(--muted); }
.hero__actions { grid-column: auto; }
.hero .reactor-stage {
  height: 290px;
  min-height: 290px;
  align-self: center;
  border: 1px solid rgba(184,138,52,.18);
  border-radius: 12px;
  background:
    radial-gradient(circle at 50% 38%, rgba(247,188,45,.10), transparent 32%),
    linear-gradient(145deg, rgba(244,240,255,.78), rgba(255,255,255,.94));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.72), 0 12px 36px rgba(184,138,52,.08);
  overflow: hidden;
}
.hero .reactor-stage::before { inset: 7% 14% 31%; }
.hero .reactor-scene {
  top: 104px;
  right: auto;
  bottom: auto;
  left: 50%;
  width: min(92%, 780px);
  height: auto;
  transform: translate(-50%, -50%) scale(.82) rotateX(var(--reactor-rx)) rotateY(var(--reactor-ry));
}
.reactor-context {
  position: absolute;
  right: 4%;
  bottom: 8px;
  left: 4%;
  z-index: 4;
  display: grid;
  gap: 6px;
}
.hero .reactor-metrics {
  position: static;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid var(--line);
  border-radius: 8px 8px 4px 4px;
  background: rgba(255,255,255,.84);
  box-shadow: 0 8px 24px rgba(58,38,93,.06);
  overflow: hidden;
}
.hero .reactor-metric { padding: 6px 8px; border-top: 0; }
.hero__status {
  grid-area: auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 4px 4px 8px 8px;
  background: var(--line);
  box-shadow: 0 8px 24px rgba(58,38,93,.05);
  overflow: hidden;
}
.hero__status div,
.hero__status div:first-child,
.hero__status div:last-child {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 7px 10px;
  text-align: left;
  border: 0;
  border-radius: 0;
  background: rgba(250,248,255,.97);
  box-shadow: none;
}
.hero__status span { color: var(--muted); font-size: 9px; white-space: nowrap; }
.hero__status strong {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1100px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "brand" "reactor" "actions";
  }
  .hero .reactor-stage { width: min(100%, 820px); min-height: 290px; }
}

@media (max-width: 680px) {
  .hero {
    grid-template-areas: "brand" "reactor" "actions";
    min-height: 0;
  }
  .hero__brand { display: block; }
  .winit-brand-logo { width: min(188px, 58vw); margin-bottom: 14px; }
  .hero .reactor-stage { height: 320px; min-height: 320px; }
  .hero .reactor-stage::before { bottom: 38%; }
  .hero .reactor-scene {
    top: 112px;
    bottom: auto;
    width: 116%;
    transform: translate(-50%, -50%) scale(.86) rotateX(var(--reactor-rx)) rotateY(var(--reactor-ry));
  }
  .hero__status { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero__status div:first-child { grid-column: 1 / -1; }
  .hero__status div,
  .hero__status div:first-child,
  .hero__status div:last-child { padding: 7px 8px; }
}

@media print {
  :root { color-scheme: light; }
  body { color: #10253a; background: #fff; }
  .ambient-grid, .reactor-scene, .reactor-stage__label, .reactor-metrics, .hero__actions, .phase-notice, .filter-panel, footer, .drawer-overlay, .detail-drawer, .toast, .row-action { display: none !important; }
  .app-shell { width: 100%; max-width: none; padding: 0; }
  .hero, .panel, .kpi-card { color: #10253a; border: 1px solid #b8c8d6; background: #fff; box-shadow: none; clip-path: none; break-inside: avoid; }
  .hero { grid-template-columns: 1fr auto; grid-template-areas: "brand reactor"; min-height: 0; }
  .reactor-stage { display: block; width: 310px; min-height: 0; border: 0; background: none; box-shadow: none; overflow: visible; }
  .reactor-stage::before { display: none; }
  .reactor-context { position: static; }
  .hero__brand *, .hero__status strong, .panel-heading h2, .kpi-card__body strong, td { color: #10253a !important; text-shadow: none; }
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .dashboard-grid { grid-template-columns: 3fr 2fr; }
  .chart-panel { min-height: 300px; }
  .chart { height: 250px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .hero .reactor-scene { transform: translate(-50%, -50%) scale(.82) !important; }
  .reactor-core, .reactor-orbit, .reactor-aura { transform: none !important; }
}
