:root {
  --bg: #03110f;
  --bg-soft: #071917;
  --panel: rgba(8, 24, 21, 0.92);
  --panel-strong: rgba(11, 32, 27, 0.98);
  --panel-muted: rgba(14, 40, 35, 0.72);
  --line: rgba(130, 214, 190, 0.12);
  --line-strong: rgba(130, 214, 190, 0.22);
  --text: #eff8f4;
  --muted: #8cab9f;
  --green: #97f6c8;
  --cyan: #6feef3;
  --blue: #7aa7ff;
  --purple: #7f8cff;
  --warn: #ffd36e;
  --danger: #ff8f9e;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(109, 180, 255, 0.18), transparent 30%),
    radial-gradient(circle at top right, rgba(151, 246, 200, 0.12), transparent 28%),
    linear-gradient(180deg, #cfe0ff 0%, #dff7ee 100%);
  color: var(--text);
}

button,
input,
textarea {
  font: inherit;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px 14px;
  color: var(--text);
  background: rgba(5, 20, 17, 0.9);
  outline: none;
}

input::placeholder,
textarea::placeholder {
  color: rgba(173, 208, 196, 0.48);
}

.ambient {
  position: fixed;
  inset: auto;
  pointer-events: none;
  filter: blur(80px);
  opacity: 0.6;
}

.ambient-left {
  width: 260px;
  height: 260px;
  left: 40px;
  top: 60px;
  background: rgba(122, 167, 255, 0.35);
}

.ambient-right {
  width: 300px;
  height: 300px;
  right: 60px;
  bottom: 80px;
  background: rgba(111, 238, 243, 0.25);
}

.dashboard-shell {
  padding: 0;
}

.dashboard {
  position: relative;
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
  background: rgba(3, 14, 12, 0.92);
  border: 0;
  border-radius: 0;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.sidebar {
  background: linear-gradient(180deg, rgba(4, 22, 19, 0.96), rgba(1, 12, 9, 0.98));
  border-right: 1px solid var(--line);
  padding: 26px 18px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.brand,
.sidebar-profile,
.nav-item,
.search-box,
.header-chip,
.mini-status,
.summary-item,
.drawer-head,
.modal-actions {
  display: flex;
  align-items: center;
}

.brand {
  gap: 12px;
}

.brand-mark,
.avatar {
  display: grid;
  place-items: center;
  border-radius: 14px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  background: linear-gradient(135deg, rgba(111, 238, 243, 0.18), rgba(151, 246, 200, 0.3));
  border: 1px solid var(--line-strong);
  color: var(--green);
  font-weight: 700;
}

.brand-title,
.brand-subtitle,
.eyebrow,
.panel-head p,
.sidebar-label,
.sidebar-profile p,
.summary-item span,
.setting-item p {
  margin: 0;
}

.brand-title {
  font-size: 18px;
  font-weight: 700;
}

.brand-subtitle {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-item {
  gap: 10px;
  width: 100%;
  border: 0;
  background: transparent;
  color: rgba(239, 248, 244, 0.8);
  padding: 12px 14px;
  border-radius: 14px;
  cursor: pointer;
  justify-content: flex-start;
}

.nav-item.active,
.nav-item:hover {
  background: linear-gradient(90deg, rgba(91, 219, 184, 0.18), rgba(91, 219, 184, 0.06));
  box-shadow: inset 0 0 0 1px rgba(111, 238, 243, 0.14);
}

.nav-icon {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--cyan), var(--green));
  box-shadow: 0 0 18px rgba(111, 238, 243, 0.35);
}

.sidebar-block,
.sidebar-profile {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(5, 20, 17, 0.72);
}

.sidebar-block {
  padding: 16px;
}

.sidebar-label {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 12px;
}

.mini-status {
  justify-content: space-between;
  padding: 9px 0;
  font-size: 13px;
}

.sidebar-profile {
  margin-top: auto;
  gap: 12px;
  padding: 14px;
}

.avatar {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, rgba(122, 167, 255, 0.2), rgba(151, 246, 200, 0.28));
  color: var(--green);
  font-weight: 700;
}

.sidebar-profile p {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.main-content {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  background:
    linear-gradient(180deg, rgba(2, 12, 10, 0.7), rgba(2, 12, 10, 0.9)),
    radial-gradient(circle at top center, rgba(91, 219, 184, 0.06), transparent 30%);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.eyebrow {
  color: var(--green);
  font-size: 13px;
  font-weight: 600;
}

h1,
h2 {
  margin: 0;
}

h1 {
  margin-top: 6px;
  font-size: 36px;
  letter-spacing: -0.03em;
}

h2 {
  font-size: 17px;
}

.topbar-tools {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-box {
  position: relative;
  gap: 10px;
  min-width: 280px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(8, 24, 21, 0.8);
}

.search-box input {
  border: 0;
  padding: 14px 0;
  background: transparent;
}

.search-results {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  z-index: 60;
  display: none;
  max-height: 360px;
  overflow-y: auto;
  padding: 10px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(6, 20, 17, 0.98);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.search-results.open {
  display: block;
}

.search-result-item {
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.search-result-item:hover {
  background: rgba(111, 238, 243, 0.08);
}

.search-result-item small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.search-empty {
  padding: 14px;
  color: var(--muted);
  font-size: 13px;
}

.search-icon {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(239, 248, 244, 0.8);
  border-radius: 50%;
  position: relative;
}

.search-icon::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 2px;
  background: rgba(239, 248, 244, 0.8);
  right: -6px;
  bottom: -2px;
  transform: rotate(45deg);
  border-radius: 999px;
}

.header-chip,
.summary-item {
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(8, 24, 21, 0.82);
}

.header-chip {
  flex-direction: column;
  align-items: flex-start;
  min-width: 140px;
}

.header-chip span,
.summary-item span {
  color: var(--muted);
  font-size: 12px;
}

.header-chip strong,
.summary-item strong {
  margin-top: 6px;
  color: var(--text);
}

.page-section {
  display: none;
}

.page-section.active {
  display: block;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 1.25fr;
  gap: 20px;
}

.stats-cluster {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.panel,
.metric-card,
.summary-item,
.drawer,
.modal-card {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.metric-card,
.panel,
.summary-item {
  border-radius: 22px;
}

.metric-card {
  min-height: 160px;
  padding: 22px;
  position: relative;
  overflow: hidden;
}

.metric-card.highlight {
  background:
    radial-gradient(circle at top right, rgba(151, 246, 200, 0.3), transparent 45%),
    linear-gradient(180deg, rgba(197, 255, 223, 0.98), rgba(147, 250, 208, 0.82));
  color: #032119;
}

.metric-card.highlight .metric-label,
.metric-card.highlight .metric-footnote {
  color: rgba(3, 33, 25, 0.75);
}

.metric-label {
  color: var(--muted);
  font-size: 14px;
}

.metric-value {
  margin-top: 18px;
  font-size: 40px;
  font-weight: 700;
}

.metric-footnote {
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
}

.metric-tag {
  display: inline-flex;
  margin-top: 14px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(151, 246, 200, 0.18);
  font-size: 12px;
}

.metric-card.highlight .metric-tag {
  background: rgba(3, 33, 25, 0.12);
}

.panel {
  padding: 20px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.panel-head p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 6px;
}

.legend,
.command-examples,
.filter-row,
.modal-actions,
.status-meta,
.drawer-tags,
.donut-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.legend span,
.donut-legend span {
  color: var(--muted);
  font-size: 12px;
}

.dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 8px;
}

.dot-cyan {
  background: var(--cyan);
  box-shadow: 0 0 20px rgba(111, 238, 243, 0.5);
}

.dot-green {
  background: var(--green);
  box-shadow: 0 0 20px rgba(151, 246, 200, 0.5);
}

.dot-blue {
  background: var(--blue);
}

.dot-purple {
  background: var(--purple);
}

.chart-panel {
  min-height: 336px;
}

.line-chart {
  position: relative;
  height: 250px;
  border-radius: 18px;
  border: 1px solid rgba(130, 214, 190, 0.08);
  background: linear-gradient(180deg, rgba(11, 30, 26, 0.7), rgba(7, 22, 19, 0.95));
  overflow: hidden;
  padding: 22px 20px 36px;
}

.grid-lines {
  position: absolute;
  inset: 0 0 30px;
  background-image: linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 100% 48px;
}

.chart-svg {
  position: relative;
  width: 100%;
  height: 180px;
  z-index: 1;
}

.line-primary,
.line-secondary {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
}

.line-primary {
  stroke: var(--cyan);
  filter: drop-shadow(0 0 10px rgba(111, 238, 243, 0.4));
}

.line-secondary {
  stroke: rgba(151, 246, 200, 0.82);
  filter: drop-shadow(0 0 10px rgba(151, 246, 200, 0.2));
}

.chart-point {
  fill: var(--cyan);
  filter: drop-shadow(0 0 12px rgba(111, 238, 243, 0.7));
}

.chart-callout {
  position: absolute;
  right: 110px;
  top: 78px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(111, 238, 243, 0.16);
  color: var(--cyan);
  border: 1px solid rgba(111, 238, 243, 0.2);
  z-index: 2;
  font-size: 12px;
}

.chart-axis {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 10px;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}

.overview-lower,
.table-layout,
.listing-grid,
.dual-grid {
  display: grid;
  gap: 20px;
}

.overview-lower {
  margin-top: 20px;
  grid-template-columns: 1.3fr 0.9fr;
}

.command-lower {
  margin-top: 20px;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 20px;
}

.table-layout {
  margin-top: 20px;
  grid-template-columns: 1.1fr 0.9fr;
}

.listing-grid,
.dual-grid,
.settings-bottom-grid {
  grid-template-columns: 1.1fr 0.9fr;
}

.command-form {
  display: grid;
  grid-template-columns: 1fr 150px;
  gap: 12px;
}

.glow-button,
.ghost-button,
.icon-button,
.example-chip,
.filter-chip,
.action-button {
  cursor: pointer;
  border: 0;
}

.glow-button {
  padding: 0 18px;
  border-radius: 14px;
  color: #032119;
  font-weight: 700;
  background: linear-gradient(135deg, var(--cyan), var(--green));
  box-shadow: 0 0 30px rgba(111, 238, 243, 0.24);
}

.example-chip,
.filter-chip,
.ghost-button,
.action-button {
  padding: 9px 12px;
  border-radius: 12px;
  color: var(--text);
  background: rgba(7, 22, 19, 0.92);
  border: 1px solid var(--line);
}

.filter-chip.active {
  background: rgba(111, 238, 243, 0.12);
  color: var(--cyan);
}

.command-feedback,
.alert-item,
.timeline-item,
.recommend-item,
.setting-item,
.inspection-item,
.inventory-health-item {
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(7, 22, 19, 0.92);
}

.command-feedback {
  padding: 14px 16px;
  color: var(--muted);
  line-height: 1.7;
}

.command-output {
  margin-top: 14px;
  display: grid;
  gap: 14px;
}

.execution-flow,
.result-summary,
.log-list,
.confirm-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.flow-card,
.result-card,
.log-item,
.confirm-card {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(7, 22, 19, 0.92);
}

.flow-card strong,
.result-card strong,
.log-item strong,
.confirm-card strong {
  display: block;
}

.flow-card p,
.result-card p,
.log-item p,
.confirm-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.flow-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.flow-tags {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.flow-tag {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(111, 238, 243, 0.08);
  color: var(--cyan);
  font-size: 12px;
}

.flow-step {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 12px;
  align-items: flex-start;
}

.step-index {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  color: #032119;
  background: linear-gradient(135deg, var(--cyan), var(--green));
}

.result-list {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.result-line {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  font-size: 13px;
  color: var(--text);
}

.result-line.muted {
  color: var(--muted);
}

.donut-wrap {
  display: grid;
  justify-items: center;
  gap: 18px;
  padding-top: 8px;
}

.donut-chart {
  position: relative;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background:
    conic-gradient(var(--green) 0 36%, var(--cyan) 36% 58%, var(--blue) 58% 82%, var(--purple) 82% 100%);
  box-shadow: inset 0 0 40px rgba(255, 255, 255, 0.04), 0 0 50px rgba(111, 238, 243, 0.08);
}

.donut-chart::after {
  content: "";
  position: absolute;
  inset: 34px;
  border-radius: 50%;
  background: rgba(5, 18, 15, 0.98);
  border: 1px solid var(--line);
}

.donut-center {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  text-align: center;
}

.donut-center strong {
  font-size: 42px;
}

.donut-center span {
  margin-top: -20px;
  color: var(--muted);
  font-size: 12px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 10px;
  text-align: left;
  border-bottom: 1px solid rgba(130, 214, 190, 0.08);
  font-size: 14px;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.status-pill.ok {
  color: var(--green);
  background: rgba(151, 246, 200, 0.12);
}

.status-pill.warn {
  color: var(--warn);
  background: rgba(255, 211, 110, 0.12);
}

.status-pill.danger {
  color: var(--danger);
  background: rgba(255, 143, 158, 0.12);
}

.listing-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.listing-summary {
  display: flex;
  gap: 14px;
}

.summary-item {
  min-width: 124px;
  flex-direction: column;
  align-items: flex-start;
}

.product-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.product-cell small {
  color: var(--muted);
}

.table-actions {
  display: flex;
  gap: 8px;
}

.slim-panel {
  min-width: 0;
}

.alert-list,
.timeline,
.recommend-list,
.settings-list,
.model-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.model-card {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(7, 22, 19, 0.92);
}

.model-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.alert-item,
.timeline-item,
.recommend-item,
.setting-item {
  padding: 14px 16px;
}

.alert-item p,
.timeline-item p,
.recommend-item p,
.setting-item p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.inspection-grid,
.inventory-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.inspection-item,
.inventory-health-item {
  padding: 18px;
}

.inspection-item strong,
.inventory-health-item strong {
  display: block;
  margin-top: 12px;
  font-size: 28px;
}

.bars {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.bar-item {
  display: grid;
  grid-template-columns: 90px 1fr 40px;
  align-items: center;
  gap: 12px;
}

.bar-track,
.progress-track {
  width: 100%;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(130, 214, 190, 0.1);
}

.bar-track {
  height: 10px;
}

.bar-fill,
.progress-fill {
  height: 100%;
  border-radius: inherit;
}

.bar-fill {
  background: linear-gradient(90deg, var(--cyan), var(--green));
}

.progress-track {
  margin-top: 12px;
  height: 10px;
}

.progress-fill {
  background: linear-gradient(90deg, var(--blue), var(--cyan));
}

.timeline-item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.prep-list {
  margin: 0;
  padding-left: 20px;
  color: var(--text);
  line-height: 2;
}

.drawer {
  position: fixed;
  top: 24px;
  right: 24px;
  bottom: 24px;
  width: 420px;
  z-index: 30;
  border-radius: 24px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  transform: translateX(calc(100% + 24px));
  transition: transform 0.26s ease;
  background: var(--panel-strong);
}

.drawer.open {
  transform: translateX(0);
}

.drawer-head {
  justify-content: space-between;
  gap: 12px;
}

.drawer-body {
  margin-top: 20px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.drawer-body::-webkit-scrollbar,
.search-results::-webkit-scrollbar {
  width: 8px;
}

.drawer-body::-webkit-scrollbar-thumb,
.search-results::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(111, 238, 243, 0.22);
}

.icon-button {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  color: var(--text);
  background: rgba(7, 22, 19, 0.92);
  border: 1px solid var(--line);
  font-size: 24px;
  line-height: 1;
}

.drawer-card {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(7, 22, 19, 0.92);
}

.drawer-tags {
  margin-top: 10px;
}

.tag {
  display: inline-flex;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(111, 238, 243, 0.08);
  color: var(--cyan);
  font-size: 12px;
}

.spec-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.spec-item span {
  color: var(--muted);
  font-size: 12px;
}

.spec-item strong {
  display: block;
  margin-top: 6px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  place-items: center;
  background: rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(8px);
}

.modal-backdrop.open {
  display: grid;
}

.modal-card {
  width: min(560px, calc(100vw - 32px));
  padding: 22px;
  border-radius: 24px;
}

.modal-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.modal-form label {
  display: grid;
  gap: 8px;
}

.ghost-button {
  color: var(--text);
}

.modal-actions {
  justify-content: flex-end;
  margin-top: 18px;
}

@media (max-width: 1260px) {
  .hero-grid,
  .overview-lower,
  .command-lower,
  .table-layout,
  .listing-grid,
  .dual-grid,
  .settings-bottom-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .dashboard-shell {
    padding: 0;
  }

  .dashboard {
    grid-template-columns: 1fr;
  }

  .topbar,
  .topbar-tools,
  .listing-toolbar,
  .listing-summary {
    flex-direction: column;
    align-items: stretch;
  }

  .search-box {
    min-width: 0;
  }
}

@media (max-width: 720px) {
  .stats-cluster,
  .inspection-grid,
  .inventory-cards,
  .spec-grid {
    grid-template-columns: 1fr;
  }

  .command-form {
    grid-template-columns: 1fr;
  }

  .drawer {
    top: 10px;
    right: 10px;
    bottom: 10px;
    left: 10px;
    width: auto;
  }
}
