:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --border: #dbe4ee;
  --text: #1f2937;
  --muted: #64748b;
  --primary: #0f766e;
  --primary-dark: #115e59;
  --ok: #047857;
  --warn: #b45309;
  --shadow: 0 16px 42px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
}

.sidebar {
  background: #122033;
  color: #e5edf6;
  padding: 18px 14px;
}

.brand {
  height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: #ffffff;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  font-size: 12px;
}

.nav {
  margin-top: 22px;
  display: grid;
  gap: 8px;
}

.nav-item {
  height: 40px;
  border: 0;
  border-radius: 6px;
  color: #cbd5e1;
  background: transparent;
  text-align: left;
  padding: 0 12px;
}

.nav-item:hover,
.nav-item.active {
  color: #ffffff;
  background: rgba(15, 118, 110, 0.9);
}

.main {
  min-width: 0;
  padding: 22px;
  display: grid;
  gap: 16px;
  align-content: start;
}

.topbar {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar-actions {
  display: flex;
  gap: 10px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 24px;
  line-height: 1.3;
}

h2 {
  font-size: 18px;
}

h3 {
  font-size: 15px;
}

.topbar p,
.panel-head p {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.6;
}

.primary-button {
  height: 36px;
  border: 1px solid var(--primary);
  border-radius: 6px;
  padding: 0 16px;
  color: #ffffff;
  background: var(--primary);
  font-weight: 700;
}

.secondary-button {
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0 14px;
  color: var(--text);
  background: #ffffff;
  font-weight: 700;
}

.secondary-button:hover {
  border-color: var(--primary);
  color: var(--primary-dark);
}

.primary-button:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.summary-grid article,
.panel,
.config-grid article {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.summary-grid article {
  min-width: 0;
  padding: 16px;
}

.summary-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.summary-grid strong {
  display: block;
  margin-top: 8px;
  font-size: 20px;
  color: var(--primary-dark);
  overflow-wrap: anywhere;
}

.panel {
  min-width: 0;
  overflow: hidden;
}

.panel.hidden {
  display: none;
}

.process-panel {
  position: relative;
  color: #dff8ff;
  background:
    linear-gradient(120deg, rgba(20, 184, 166, 0.16), transparent 32%),
    linear-gradient(260deg, rgba(56, 189, 248, 0.14), transparent 30%),
    linear-gradient(135deg, #08111f 0%, #0f1c2f 48%, #111827 100%);
  border-color: rgba(103, 232, 249, 0.2);
  box-shadow: 0 22px 60px rgba(2, 8, 23, 0.28);
  isolation: isolate;
}

.process-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent, rgba(103, 232, 249, 0.08), transparent),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 28%);
  opacity: 0.72;
  z-index: -1;
}

.process-head {
  border-bottom-color: rgba(148, 163, 184, 0.18);
}

.process-head h2,
.process-head p {
  color: #e0f2fe;
}

.process-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.live-indicator {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid rgba(125, 211, 252, 0.28);
  border-radius: 999px;
  color: #bae6fd;
  background: rgba(2, 8, 23, 0.42);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.live-indicator strong,
.live-indicator em {
  font-size: 12px;
  font-style: normal;
}

.live-indicator.active {
  color: #ffffff;
  border-color: rgba(94, 234, 212, 0.58);
  box-shadow: 0 0 18px rgba(45, 212, 191, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.live-indicator.just-updated {
  animation: liveBlink 0.7s ease-out;
}

.live-pulse {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #64748b;
}

.live-indicator.active .live-pulse {
  background: #34d399;
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.72);
  animation: livePulse 1.45s ease-out infinite;
}

.dark-button {
  color: #dff8ff;
  border-color: rgba(103, 232, 249, 0.35);
  background: rgba(15, 23, 42, 0.5);
}

.dark-button:hover {
  color: #ffffff;
  border-color: #67e8f9;
  background: rgba(14, 116, 144, 0.55);
}

.process-dashboard {
  position: relative;
  padding: 18px;
  background:
    linear-gradient(rgba(103, 232, 249, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(103, 232, 249, 0.04) 1px, transparent 1px);
  background-size: 36px 36px;
  overflow: hidden;
}

.process-scanline {
  position: absolute;
  left: 18px;
  right: 18px;
  top: 0;
  height: 120px;
  pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(103, 232, 249, 0.12), transparent);
  opacity: 0.65;
  transform: translateY(-120px);
  animation: scanSweep 5.2s linear infinite;
}

.process-hero {
  min-height: 112px;
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(260px, 1.2fr) minmax(360px, 1.4fr);
  gap: 16px;
  align-items: stretch;
}

.process-identity,
.process-hero-title,
.process-kpis,
.process-card {
  border: 1px solid rgba(125, 211, 252, 0.24);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 16px 40px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(14px);
}

.process-identity {
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.signal-dot {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: #22d3ee;
  box-shadow: 0 0 0 8px rgba(34, 211, 238, 0.14), 0 0 30px rgba(34, 211, 238, 0.65);
}

.signal-dot::after {
  content: "";
  position: absolute;
  inset: -11px;
  border: 1px solid rgba(103, 232, 249, 0.45);
  border-radius: inherit;
  animation: signalPulse 2.3s ease-out infinite;
}

.process-identity span,
.process-kpis span,
.node-core span,
.node-core em,
.process-card-head span {
  color: #93c5fd;
  font-size: 12px;
}

.process-identity strong {
  display: block;
  margin-top: 6px;
  color: #ffffff;
  font-size: 20px;
}

.process-hero-title {
  padding: 18px;
}

.process-hero-title h3 {
  color: #ffffff;
  font-size: 18px;
}

.process-hero-title p {
  margin-top: 10px;
  color: #bae6fd;
}

.process-kpis {
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.process-kpis div,
.rule-summary div {
  min-width: 0;
  padding: 10px;
  border-radius: 6px;
  background: rgba(8, 47, 73, 0.58);
}

.process-kpis strong,
.rule-summary strong {
  display: block;
  margin-top: 6px;
  color: #67e8f9;
  font-size: 22px;
  overflow-wrap: anywhere;
}

.agent-map {
  position: relative;
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(8, minmax(120px, 1fr));
  gap: 12px;
  overflow: hidden;
}

.agent-map::before {
  content: "";
  position: absolute;
  left: 6%;
  right: 6%;
  top: 50%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #22d3ee, #a78bfa, #34d399, transparent);
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.55);
}

.agent-flow {
  position: absolute;
  z-index: 0;
  left: 7%;
  top: calc(50% - 5px);
  width: 15%;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(103, 232, 249, 0.16), #67e8f9, transparent);
  filter: drop-shadow(0 0 12px rgba(103, 232, 249, 0.9));
  animation: flowTravel 3.8s cubic-bezier(0.55, 0, 0.2, 1) infinite;
}

.agent-node {
  position: relative;
  z-index: 1;
  min-height: 132px;
  padding: 12px;
  display: grid;
  gap: 12px;
  align-content: space-between;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.82);
  overflow: hidden;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.agent-node::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(148, 163, 184, 0.08), transparent 50%);
}

.agent-node.done {
  border-color: rgba(45, 212, 191, 0.62);
  box-shadow: 0 0 22px rgba(45, 212, 191, 0.16);
}

.agent-node.active {
  border-color: rgba(96, 165, 250, 0.72);
  box-shadow: 0 0 26px rgba(96, 165, 250, 0.28);
}

.agent-node.warn {
  border-color: rgba(251, 191, 36, 0.75);
  box-shadow: 0 0 22px rgba(251, 191, 36, 0.2);
}

.agent-node.pending {
  opacity: 0.72;
}

.agent-node.current {
  transform: translateY(-4px);
  border-color: rgba(103, 232, 249, 0.9);
  box-shadow: 0 0 34px rgba(103, 232, 249, 0.35), inset 0 0 24px rgba(34, 211, 238, 0.08);
}

.node-beam {
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.16) 46%, transparent 68%);
  transform: translateX(-140%);
}

.agent-node.current .node-beam {
  animation: nodeBeam 2.8s ease-in-out infinite;
}

.agent-node.current::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 0;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, #34d399, #67e8f9, #a78bfa);
  box-shadow: 0 0 14px rgba(103, 232, 249, 0.78);
}

.node-index {
  position: relative;
  z-index: 1;
  width: 38px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  color: #08111f;
  background: #67e8f9;
  font-weight: 800;
  font-size: 12px;
}

.node-core {
  position: relative;
  z-index: 1;
}

.node-core strong {
  display: block;
  margin: 7px 0;
  color: #ffffff;
  font-size: 15px;
  line-height: 1.3;
}

.node-core em {
  font-style: normal;
}

.process-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 16px;
}

.process-card {
  min-width: 0;
  padding: 16px;
}

.process-card-wide {
  min-height: 260px;
}

.live-stream-card {
  min-height: 280px;
}

.signal-card {
  min-height: 280px;
}

.process-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.process-card-head h3 {
  color: #ffffff;
  font-size: 15px;
}

.run-timeline {
  display: grid;
  gap: 12px;
}

.run-line {
  position: relative;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 12px;
}

.run-line::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 18px;
  bottom: -12px;
  width: 1px;
  background: rgba(103, 232, 249, 0.22);
}

.run-line:last-child::before {
  display: none;
}

.run-dot {
  width: 17px;
  height: 17px;
  margin-top: 2px;
  border-radius: 999px;
  background: #34d399;
  box-shadow: 0 0 14px rgba(52, 211, 153, 0.64);
}

.run-line.warn .run-dot {
  background: #f59e0b;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.64);
}

.run-copy strong {
  color: #e0f2fe;
}

.run-copy span {
  display: block;
  margin-top: 4px;
  color: #93c5fd;
  font-size: 12px;
}

.run-copy p {
  margin-top: 6px;
  color: #cbd5e1;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.live-stream {
  display: grid;
  gap: 10px;
}

.stream-row {
  position: relative;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 34px;
  gap: 12px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 7px;
  background: linear-gradient(90deg, rgba(8, 47, 73, 0.42), rgba(15, 23, 42, 0.5));
  overflow: hidden;
}

.stream-row::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, #34d399, #67e8f9);
}

.stream-kind,
.stream-index {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  border-radius: 5px;
  color: #052e2b;
  background: #67e8f9;
  font-size: 12px;
  font-weight: 800;
}

.stream-row strong {
  display: block;
  color: #e0f2fe;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.stream-row em {
  display: block;
  margin-top: 4px;
  color: #93c5fd;
  font-size: 12px;
  font-style: normal;
}

.stream-index {
  color: #c4b5fd;
  background: rgba(49, 46, 129, 0.56);
}

.signal-rail {
  display: grid;
  gap: 10px;
}

.signal-step {
  position: relative;
  min-height: 32px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  color: #93c5fd;
}

.signal-step span {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #475569;
}

.signal-step.done span {
  background: #2dd4bf;
  box-shadow: 0 0 14px rgba(45, 212, 191, 0.55);
}

.signal-step.warn span {
  background: #f59e0b;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.55);
}

.signal-step.active span,
.signal-step.current span {
  background: #67e8f9;
  box-shadow: 0 0 16px rgba(103, 232, 249, 0.78);
}

.signal-step strong {
  color: inherit;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.signal-step.current strong {
  color: #ffffff;
}

.signal-meter {
  margin-top: 18px;
  padding: 13px;
  border: 1px solid rgba(125, 211, 252, 0.22);
  border-radius: 8px;
  background: rgba(2, 8, 23, 0.34);
}

.signal-meter-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(51, 65, 85, 0.8);
  overflow: hidden;
}

.signal-meter-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #34d399, #67e8f9, #a78bfa);
  box-shadow: 0 0 14px rgba(103, 232, 249, 0.68);
}

.signal-meter p {
  margin-top: 10px;
  color: #cbd5e1;
  line-height: 1.55;
}

.evidence-orbit {
  position: relative;
  height: 148px;
  display: grid;
  place-items: center;
}

.orbit-ring {
  position: absolute;
  border: 1px solid rgba(103, 232, 249, 0.36);
  border-radius: 999px;
}

.ring-one {
  width: 122px;
  height: 122px;
  animation: orbitSpin 12s linear infinite;
}

.ring-two {
  width: 76px;
  height: 76px;
  border-color: rgba(167, 139, 250, 0.42);
  animation: orbitSpin 8s linear infinite reverse;
}

.orbit-ring::after {
  content: "";
  position: absolute;
  top: -4px;
  left: 50%;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #67e8f9;
  box-shadow: 0 0 12px rgba(103, 232, 249, 0.8);
}

.orbit-center {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #08111f;
  background: linear-gradient(135deg, #67e8f9, #34d399);
  font-weight: 900;
}

.evidence-bars {
  display: grid;
  gap: 8px;
}

.evidence-bar,
.risk-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 6px;
  background: rgba(2, 8, 23, 0.28);
}

.evidence-bar span,
.risk-row p {
  color: #cbd5e1;
  line-height: 1.45;
}

.evidence-bar strong,
.risk-row span {
  color: #67e8f9;
  font-weight: 800;
}

.rule-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

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

.rule-tile {
  min-height: 24px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  color: #e2e8f0;
  background: rgba(100, 116, 139, 0.32);
  font-size: 11px;
  font-weight: 700;
}

.rule-tile.pass {
  color: #052e2b;
  background: #5eead4;
}

.rule-tile.fail {
  color: #450a0a;
  background: #fca5a5;
}

.rule-tile.hold {
  color: #422006;
  background: #fde68a;
}

.risk-feed {
  display: grid;
  gap: 10px;
}

.dark-empty {
  color: #93c5fd;
  border-color: rgba(103, 232, 249, 0.22);
}

@keyframes signalPulse {
  from {
    opacity: 0.9;
    transform: scale(0.72);
  }
  to {
    opacity: 0;
    transform: scale(1.35);
  }
}

@keyframes orbitSpin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes livePulse {
  to {
    box-shadow: 0 0 0 9px rgba(52, 211, 153, 0);
  }
}

@keyframes liveBlink {
  0% {
    transform: translateY(0);
  }
  45% {
    transform: translateY(-1px);
    box-shadow: 0 0 22px rgba(103, 232, 249, 0.34);
  }
  100% {
    transform: translateY(0);
  }
}

@keyframes scanSweep {
  to {
    transform: translateY(760px);
  }
}

@keyframes flowTravel {
  0% {
    transform: translateX(-70%);
    opacity: 0;
  }
  12% {
    opacity: 1;
  }
  82% {
    opacity: 1;
  }
  100% {
    transform: translateX(520%);
    opacity: 0;
  }
}

@keyframes nodeBeam {
  0% {
    transform: translateX(-140%);
  }
  42%,
  100% {
    transform: translateX(140%);
  }
}

.panel-head {
  min-height: 72px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

input,
select {
  height: 34px;
  min-width: 160px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  padding: 0 10px;
}

input:focus,
select:focus {
  border-color: var(--primary);
  outline: 2px solid rgba(15, 118, 110, 0.14);
}

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

table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

th {
  color: #475569;
  background: var(--surface-soft);
  font-weight: 700;
  white-space: nowrap;
}

td {
  color: #334155;
}

.message-content {
  max-width: 520px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.55;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  color: var(--primary-dark);
  background: #dff7ef;
  font-size: 12px;
  font-weight: 700;
}

.badge.warn {
  color: var(--warn);
  background: #fff4de;
}

.warn-text {
  color: var(--warn) !important;
}

.config-grid {
  padding: 18px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.config-grid article {
  min-width: 0;
  padding: 16px;
}

dl {
  margin: 14px 0 0;
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 10px 12px;
}

dt {
  color: var(--muted);
}

dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 600;
}

.task-layout {
  padding: 16px;
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 16px;
}

.task-list {
  display: grid;
  align-content: start;
  gap: 10px;
}

.task-item {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--text);
  text-align: left;
}

.task-item.active {
  border-color: var(--primary);
  box-shadow: inset 3px 0 0 var(--primary);
}

.task-item strong {
  display: block;
  overflow-wrap: anywhere;
}

.task-item span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.task-detail {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.detail-head {
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-soft);
}

.detail-head p {
  margin-top: 6px;
  color: var(--muted);
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.detail-meta span {
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--primary-dark);
  background: #dff7ef;
  font-size: 12px;
  font-weight: 700;
}

.detail-block {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.detail-block:last-child {
  border-bottom: 0;
}

.detail-block h4 {
  margin: 0 0 10px;
  font-size: 14px;
}

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

.mini-table {
  min-width: 760px;
}

.mini-table th,
.mini-table td {
  padding: 9px 10px;
}

.confirm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.confirm-actions button {
  min-height: 26px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #ffffff;
  color: var(--text);
  font-size: 12px;
}

.confirm-actions button:hover {
  border-color: var(--primary);
  color: var(--primary-dark);
}

.admin-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.62);
}

.admin-gate.hidden {
  display: none;
}

.login-panel {
  width: min(420px, 100%);
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.login-panel h2 {
  font-size: 20px;
}

.login-panel p {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.6;
}

.login-panel input,
.login-panel button {
  width: 100%;
  margin-top: 14px;
}

.login-error {
  min-height: 20px;
  margin-top: 10px;
  color: #b91c1c;
  font-size: 12px;
}

pre {
  max-height: 360px;
  margin: 0;
  padding: 12px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #0f172a;
  color: #e5edf6;
  white-space: pre-wrap;
  line-height: 1.6;
}

.empty {
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.empty.small {
  padding: 12px;
  border: 1px dashed var(--border);
  border-radius: 6px;
  text-align: left;
}

@media (max-width: 980px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 10;
    padding: 12px;
  }

  .brand {
    height: 36px;
  }

  .nav {
    margin-top: 10px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .summary-grid,
  .config-grid {
    grid-template-columns: 1fr;
  }

  .task-layout {
    grid-template-columns: 1fr;
  }

  .topbar,
  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .process-hero,
  .process-grid {
    grid-template-columns: 1fr;
  }

  .agent-map {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .agent-map::before {
    display: none;
  }

  .process-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filters,
  input,
  select,
  .primary-button,
  .secondary-button {
    width: 100%;
  }
}
