/* =========================================================================
   AXIOM DESIGN SYSTEM — SCOPED FOUNDATIONS & COMPONENTS PARA WPDEX
   Escopo restrito: Tokens, Botões, Badges, Spec Lists e Modal Técnico
   Sem impacto global em body, button, input, canvas ou dialog externos.
   ========================================================================= */

:root {
  /* Axiom Core Neutrals & Tokens (Confirmed & Measured) */
  --ax-obsidian: #141414;
  --ax-void: #1C1C1C;
  --ax-graphite: #3D3D3D;
  --ax-stage: #0A0A0A;
  --ax-raised: #232323;
  --ax-field: #262626;
  --ax-sunken: #0E0E0E;
  --ax-line: #2A2A2A;
  --ax-line-strong: #3D3D3D;

  --ax-text: #FFFFFF;
  --ax-text-2: #8C8C8C;
  --ax-text-3: #595959;
  --ax-ember: #00B8F0;

  /* Semântica Industrial WPDEX Integrada */
  --wp-danger: #f0503c;
  --wp-warn: #e2a33a;
  --wp-ok: #4fbf8a;
  --wp-accent: #3cc6db;
  --wp-mono: "Cascadia Mono", "Consolas", ui-monospace, monospace;

  /* Tipografia Axiom */
  --font-sans: "Inter Tight", "Inter", "Helvetica Neue", Arial, sans-serif;

  /* Espaçamentos e Raios */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;

  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-pill: 999px;

  --h-sm: 28px;
  --h-md: 34px;
  --h-lg: 38px;

  --dur-1: 120ms;
  --dur-2: 220ms;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --focus-ring: 0 0 0 2px var(--ax-stage), 0 0 0 4px rgba(0, 184, 240, 0.45);
}

/* =========================================================================
   1. GRUPO DE HISTÓRICO CAD (DESFAZER / REFAZER NA BARRA PRINCIPAL)
   ========================================================================= */

.ax-history-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 6px;
  border-radius: var(--r-md);
  background: var(--ax-obsidian);
  border: 1px solid var(--ax-line);
}

/* Botões Axiom Scoped */
.ax-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: var(--h-md);
  padding: 0 14px;
  border-radius: var(--r-sm);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: -0.01em;
  white-space: nowrap;
  background: var(--ax-void);
  color: var(--ax-text);
  border: 1px solid var(--ax-line);
  cursor: pointer;
  outline: none;
  transition: background var(--dur-1) var(--ease),
    border-color var(--dur-1) var(--ease),
    color var(--dur-1) var(--ease),
    opacity var(--dur-1),
    transform var(--dur-1);
}

.ax-btn:hover:not(:disabled) {
  background: var(--ax-raised);
  border-color: var(--ax-line-strong);
  color: #FFFFFF;
}

.ax-btn:active:not(:disabled) {
  transform: translateY(1px);
}

.ax-btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  pointer-events: none;
  background: var(--ax-obsidian);
  border-color: var(--ax-line);
  color: var(--ax-text-3);
}

.ax-btn:focus-visible {
  box-shadow: var(--focus-ring);
}

.ax-btn--sm {
  height: var(--h-sm);
  padding: 0 10px;
  font-size: 11px;
  border-radius: var(--r-sm);
}

.ax-btn--primary {
  background: var(--ax-ember);
  border-color: var(--ax-ember);
  color: #FFFFFF;
  font-weight: 600;
}

.ax-btn--primary:hover:not(:disabled) {
  background: #1bc4f5;
  border-color: #1bc4f5;
  color: #FFFFFF;
}

.ax-btn--secondary {
  background: var(--ax-field);
  border-color: var(--ax-line);
  color: var(--ax-text);
}

.ax-btn--secondary:hover:not(:disabled) {
  background: var(--ax-raised);
  border-color: var(--ax-graphite);
}

/* Ícones nos botões */
.ax-btn .ic,
.ax-modal .ic {
  width: 14px;
  height: 14px;
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Tag secundária de atalho de teclado */
.ax-kbd {
  display: inline-block;
  padding: 1px 4px;
  font-family: var(--wp-mono);
  font-size: 9.5px;
  font-weight: 500;
  line-height: 1;
  color: var(--ax-text-2);
  background: var(--ax-sunken);
  border: 1px solid var(--ax-line);
  border-radius: var(--r-xs);
  margin-left: 2px;
}

.ax-btn:disabled .ax-kbd {
  color: var(--ax-text-3);
  border-color: transparent;
  background: transparent;
}

/* =========================================================================
   2. BADGES SEMÂNTICOS INDUSTRIAIS AXIOM
   ========================================================================= */

.ax-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 20px;
  padding: 0 8px;
  border-radius: var(--r-pill);
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.ax-badge--crit {
  background: rgba(240, 80, 60, 0.16);
  color: #ff6b57;
  border: 1px solid rgba(240, 80, 60, 0.35);
}

.ax-badge--warn {
  background: rgba(226, 163, 58, 0.16);
  color: #f5af42;
  border: 1px solid rgba(226, 163, 58, 0.35);
}

.ax-badge--safe {
  background: rgba(79, 191, 138, 0.16);
  color: #5be3a5;
  border: 1px solid rgba(79, 191, 138, 0.35);
}

.ax-badge--inconcl {
  background: rgba(140, 140, 140, 0.16);
  color: #a6a6a6;
  border: 1px solid rgba(140, 140, 140, 0.35);
}

/* =========================================================================
   3. NOVO MODAL INDUSTRIAL DE OCORRÊNCIA (AXIOM CAD/CAM)
   ========================================================================= */

dialog.ax-modal {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--ax-text);
  max-width: min(1040px, 94vw);
  width: 100%;
  margin: auto;
  overflow: visible;
}

dialog.ax-modal::backdrop {
  background: rgba(4, 5, 8, 0.82);
  backdrop-filter: blur(5px);
}

dialog.ax-modal[open] {
  animation: ax-modal-in var(--dur-2) var(--ease);
}

@keyframes ax-modal-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.99);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.ax-modal__wrap {
  position: relative;
  border-radius: var(--r-lg);
  background: #0b0e14;
  border: 1px solid #1e2636;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.03);
  padding: 24px 28px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
}

/* Reset quando valDetailSection estiver contido no modal */
.ax-modal .val-detail-section,
.ax-modal__wrap#valDetailSection {
  border-top: 0;
  background: transparent;
  padding: 0;
  flex-shrink: initial;
}

/* Botão Fechar Acessível com excelente distanciamento */
.ax-modal__x {
  position: absolute;
  right: 22px;
  top: 20px;
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  background: #11151f;
  border: 1px solid #202838;
  display: grid;
  place-items: center;
  color: var(--ax-text-2);
  cursor: pointer;
  outline: none;
  transition: all var(--dur-1) var(--ease);
  z-index: 2;
}

.ax-modal__x:hover {
  background: #18202f;
  border-color: #38bdf8;
  color: #ffffff;
}

.ax-modal__x:focus-visible {
  box-shadow: var(--focus-ring);
}

/* Cabeçalho Industrial Refinado */
.ax-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #1a2230;
  padding-bottom: 16px;
  padding-right: 68px; /* Folga ampla entre o contador e o botão fechar */
}

.ax-modal__header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.ax-modal__icon-badge {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: #121722;
  border: 1px solid #222b3d;
  display: grid;
  place-items: center;
  color: #38bdf8;
  flex: none;
}

.ax-modal__title-box {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.ax-modal__title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ax-modal__title {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #f1f5f9;
}

.ax-modal__counter {
  font-family: var(--wp-mono);
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  background: #0e121a;
  border: 1px solid #1a2230;
  padding: 3px 8px;
  border-radius: 4px;
}

/* Grid de Conteúdo Principal (2 Colunas) */
.ax-modal__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 20px;
  align-items: stretch;
}

@media (max-width: 860px) {
  .ax-modal__grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* Coluna Esquerda: Frame Visual CAD */
.ax-modal__col-visual {
  display: flex;
  flex-direction: column;
}

.ax-thumb-frame {
  display: flex;
  flex-direction: column;
  border-radius: var(--r-md);
  background: #07090e;
  border: 1px solid #1c2332;
  overflow: hidden;
  height: 100%;
}

.ax-thumb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #0d1118;
  border-bottom: 1px solid #1a2230;
  font-family: var(--wp-mono);
  font-size: 10px;
}

.ax-thumb-header-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #64748b;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.ax-pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 6px #38bdf8;
}

.ax-thumb-scale {
  color: #38bdf8;
  font-weight: 700;
  font-size: 9.5px;
  letter-spacing: 0.04em;
}

.ax-thumb-canvas-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #07090e;
  width: 100%;
}

.ax-thumb-canvas,
#valThumbCanvas.ax-thumb-canvas {
  display: block;
  width: 100% !important;
  height: 270px !important;
  max-width: 520px;
  background: #07090e;
}

.ax-thumb-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 8px 12px;
  background: #0d1118;
  border-top: 1px solid #1a2230;
  font-family: var(--font-sans);
  font-size: 10.5px;
  color: #94a3b8;
}

.leg-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.leg-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
}

/* Coluna Direita: Diagnóstico Operacional */
.ax-modal__col-specs {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Card Principal de Diagnóstico Operacional */
.ax-diag-card {
  background: #0d1118;
  border: 1px solid #1d2535;
  border-radius: var(--r-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ax-diag-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ax-diag-caption {
  font-family: var(--wp-mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #64748b;
  text-transform: uppercase;
}

.ax-diag-metrics {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 10px;
  background: #07090e;
  border: 1px solid #18202e;
  border-radius: 6px;
  padding: 10px 12px;
}

.ax-diag-metric-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ax-diag-label {
  font-size: 10.5px;
  color: #8da2bb;
  font-weight: 500;
}

.ax-diag-val-hero {
  font-family: var(--wp-mono);
  font-size: 18px;
  font-weight: 700;
  color: #f1f5f9;
  letter-spacing: -0.01em;
}

.ax-diag-val-limit {
  font-family: var(--wp-mono);
  font-size: 13px;
  font-weight: 600;
  color: #cbd5e1;
  margin-top: 3px;
}

.ax-diag-diff-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 12px;
  background: #07090e;
  border: 1px solid #18202e;
  border-radius: 6px;
}

.ax-diag-diff-label {
  font-size: 10.5px;
  color: #8da2bb;
  font-weight: 500;
}

.ax-diag-message {
  font-size: 11.5px;
  line-height: 1.5;
  color: #e2e8f0;
  background: rgba(56, 189, 248, 0.04);
  border-left: 3px solid #38bdf8;
  padding: 9px 12px;
  border-radius: 0 4px 4px 0;
}

.ax-diag-message.crit {
  border-left-color: #ef4444;
  background: rgba(239, 68, 68, 0.05);
}

.ax-diag-message.warn {
  border-left-color: #f59e0b;
  background: rgba(245, 158, 11, 0.05);
}

.ax-diag-message.safe {
  border-left-color: #10b981;
  background: rgba(16, 185, 129, 0.05);
}

/* Accordion de Detalhes Técnicos sob Demanda */
.ax-tech-details {
  border: 1px solid #1d2535;
  border-radius: 6px;
  background: #0d1118;
  overflow: hidden;
}

.ax-tech-details-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #0d1118;
  font-size: 11px;
  font-weight: 600;
  color: #8da2bb;
  cursor: pointer;
  user-select: none;
  list-style: none;
  transition: all var(--dur-1) var(--ease);
}

.ax-tech-details-summary::-webkit-details-marker {
  display: none;
}

.ax-tech-details-summary:hover {
  background: #131924;
  color: #f1f5f9;
}

.ax-tech-details-title {
  display: flex;
  align-items: center;
  gap: 7px;
}

.ax-tech-details-summary .chevron-ic {
  width: 14px;
  height: 14px;
  transition: transform var(--dur-1) var(--ease);
}

.ax-tech-details[open] .ax-tech-details-summary .chevron-ic {
  transform: rotate(180deg);
}

.ax-tech-details-body {
  padding: 8px 12px 10px 12px;
  border-top: 1px solid #1a2230;
  background: #07090e;
}

.ax-tech-spec {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 0;
  padding: 0;
}

.ax-tech-spec-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 0;
  font-size: 11px;
}

.ax-tech-spec-dt {
  color: #64748b;
  font-weight: 500;
}

.ax-tech-spec-dd {
  font-family: var(--wp-mono);
  color: #cbd5e1;
  text-align: right;
  margin: 0;
}

/* Rodapé do Modal com Ações */
.ax-modal__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 20px;
  margin-top: 6px;
  border-top: 1px solid #1a2230;
  flex-wrap: wrap;
}

.ax-modal__nav-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ax-modal__action-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Botões do Rodapé do Modal com espaçamento e proporções industriais */
.ax-modal__footer .ax-btn {
  height: 34px;
  padding: 0 16px;
  font-size: 12px;
  gap: 8px;
  border-radius: var(--r-sm);
}

.ax-modal__footer .ax-btn--primary {
  background: #0284c7;
  border-color: #38bdf8;
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.25);
}

.ax-modal__footer .ax-btn--primary:hover:not(:disabled) {
  background: #0369a1;
  border-color: #7dd3fc;
  color: #ffffff;
}

/* =========================================================================
   4. LISTA DE DIAGNÓSTICO INDUSTRIAL COMPACTA (AXIOM FOUNDATIONS + COMPONENTS)
   ========================================================================= */

.ax-occ-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 4px 0 12px 0;
}

/* Grupo Expansível de Ocorrências */
.ax-occ-group {
  border: 1px solid var(--ax-line);
  border-radius: var(--r-sm);
  background: var(--ax-obsidian);
  overflow: hidden;
  transition: border-color var(--dur-1) var(--ease);
}

.ax-occ-group.has-crit {
  border-left: 2.5px solid var(--wp-danger);
}

.ax-occ-group.has-warn:not(.has-crit) {
  border-left: 2.5px solid var(--wp-warn);
}

.ax-occ-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  background: var(--ax-void);
  cursor: pointer;
  user-select: none;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  color: var(--ax-text);
  border-bottom: 1px solid transparent;
  transition: background var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease);
}

.ax-occ-group-header:hover {
  background: var(--ax-raised);
}

.ax-occ-group:not(.collapsed) .ax-occ-group-header {
  border-bottom-color: var(--ax-line);
}

.ax-occ-group-title {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.ax-occ-group-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  color: var(--ax-text-2);
  transition: transform var(--dur-1) var(--ease);
  font-size: 11px;
}

.ax-occ-group.collapsed .ax-occ-group-chevron {
  transform: rotate(-90deg);
}

.ax-occ-group-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ax-occ-group-badges {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.ax-occ-group-count {
  font-family: var(--wp-mono);
  font-size: 10px;
  padding: 1px 5px;
  border-radius: var(--r-xs);
  background: rgba(255, 255, 255, 0.05);
  color: var(--ax-text-2);
}

.ax-occ-group-count.crit {
  background: rgba(240, 80, 60, 0.15);
  color: var(--wp-danger);
  font-weight: 700;
}

.ax-occ-group-count.warn {
  background: rgba(226, 163, 58, 0.15);
  color: var(--wp-warn);
  font-weight: 700;
}

.ax-occ-group-body {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: rgba(255, 255, 255, 0.03);
}

.ax-occ-group.collapsed .ax-occ-group-body {
  display: none;
}

/* Linha Compacta de Ocorrência Industrial */
.ax-occ-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: var(--ax-obsidian);
  cursor: pointer;
  outline: none;
  position: relative;
  min-height: 33px;
  gap: 8px;
  transition: background var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
}

.ax-occ-row:hover {
  background: var(--ax-void);
}

.ax-occ-row:focus-visible {
  box-shadow: inset 0 0 0 1.5px var(--ax-ember);
}

.ax-occ-row.selected {
  background: rgba(0, 184, 240, 0.08);
}

.ax-occ-row.selected::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--ax-ember);
}

.ax-occ-row.crit.selected::before {
  background: var(--wp-danger);
}

.ax-occ-row.warn.selected::before {
  background: var(--wp-warn);
}

/* Estrutura interna da linha */
.ax-occ-left {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  flex: 1;
}

.ax-occ-indicator {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.ax-occ-indicator.crit {
  background: var(--wp-danger);
  box-shadow: 0 0 6px rgba(240, 80, 60, 0.7);
}

.ax-occ-indicator.warn {
  background: var(--wp-warn);
  box-shadow: 0 0 5px rgba(226, 163, 58, 0.7);
}

.ax-occ-indicator.safe {
  background: var(--wp-ok);
}

.ax-occ-indicator.inconcl {
  background: var(--wp-accent);
}

.ax-occ-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.ax-occ-id-label {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  color: var(--ax-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ax-occ-sub-label {
  font-family: var(--font-sans);
  font-size: 9.5px;
  color: var(--ax-text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ax-occ-right {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}

.ax-occ-measure {
  font-family: var(--wp-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--ax-text);
  text-align: right;
  min-width: 58px;
}

.ax-occ-measure.crit {
  color: var(--wp-danger);
  font-weight: 700;
}

.ax-occ-measure.warn {
  color: var(--wp-warn);
  font-weight: 700;
}

.ax-occ-measure.safe {
  color: var(--wp-ok);
}

.ax-occ-status-tag {
  font-family: var(--font-sans);
  font-size: 8.5px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: var(--r-xs);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}

.ax-occ-status-tag.crit {
  background: rgba(240, 80, 60, 0.16);
  color: var(--wp-danger);
  border: 1px solid rgba(240, 80, 60, 0.35);
}

.ax-occ-status-tag.warn {
  background: rgba(226, 163, 58, 0.16);
  color: var(--wp-warn);
  border: 1px solid rgba(226, 163, 58, 0.35);
}

.ax-occ-status-tag.safe {
  background: rgba(79, 191, 138, 0.12);
  color: var(--wp-ok);
  border: 1px solid rgba(79, 191, 138, 0.25);
}

.ax-occ-status-tag.inconcl {
  background: rgba(60, 198, 219, 0.12);
  color: var(--wp-accent);
  border: 1px solid rgba(60, 198, 219, 0.25);
}

.ax-occ-arrow {
  color: var(--ax-text-3);
  font-size: 11px;
  transition: color var(--dur-1) var(--ease), transform var(--dur-1) var(--ease);
}

.ax-occ-row:hover .ax-occ-arrow {
  color: var(--ax-ember);
  transform: translateX(1px);
}

/* Seção de Ocorrências Conformes (Recolhida por padrão) */
.ax-occ-conforming-group {
  margin-top: 8px;
  border: 1px dashed var(--ax-line);
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.015);
  overflow: hidden;
}

.ax-occ-conforming-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  background: var(--ax-void);
  cursor: pointer;
  user-select: none;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  color: var(--ax-text-2);
  transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}

.ax-occ-conforming-header:hover {
  background: var(--ax-raised);
  color: var(--ax-text);
}

.ax-occ-conforming-title {
  display: flex;
  align-items: center;
  gap: 7px;
}

.ax-occ-conforming-badge {
  font-family: var(--wp-mono);
  font-size: 9.5px;
  padding: 1px 6px;
  border-radius: var(--r-xs);
  background: rgba(79, 191, 138, 0.12);
  color: var(--wp-ok);
  border: 1px solid rgba(79, 191, 138, 0.25);
  font-weight: 600;
}

/* =========================================================================
   5. HIERARQUIA OPERACIONAL DO MODAL TÉCNICO (AXIOM CAD/CAM SENIOR)
   ========================================================================= */

/* Bloco de Resumo Operacional Principal */
.ax-op-summary {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  background: var(--ax-void);
  border: 1px solid var(--ax-line);
  border-radius: var(--r-sm);
  margin-bottom: 10px;
}

.ax-op-metric-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 12px;
}

.ax-op-metric-label {
  color: var(--ax-text-2);
  font-weight: 500;
}

.ax-op-metric-val {
  font-family: var(--wp-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--ax-text);
}

.ax-op-metric-val.crit {
  color: var(--wp-danger);
}

.ax-op-metric-val.warn {
  color: var(--wp-warn);
}

.ax-op-metric-val.safe {
  color: var(--wp-ok);
}

/* Linha da Diferença / Déficit */
.ax-op-diff-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 6px;
  margin-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 11.5px;
}

.ax-op-diff-badge {
  font-family: var(--wp-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--r-xs);
}

.ax-op-diff-badge.crit {
  background: rgba(240, 80, 60, 0.16);
  color: var(--wp-danger);
  border: 1px solid rgba(240, 80, 60, 0.3);
}

.ax-op-diff-badge.warn {
  background: rgba(226, 163, 58, 0.16);
  color: var(--wp-warn);
  border: 1px solid rgba(226, 163, 58, 0.3);
}

.ax-op-diff-badge.safe {
  background: rgba(79, 191, 138, 0.12);
  color: var(--wp-ok);
  border: 1px solid rgba(79, 191, 138, 0.25);
}

/* Mensagem Operacional Direta */
.ax-op-message-card {
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--ax-line);
  border-left: 3px solid var(--ax-ember);
  border-radius: var(--r-sm);
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 1.5;
  color: var(--ax-text);
  margin-bottom: 12px;
}

.ax-op-message-card.crit {
  border-left-color: var(--wp-danger);
  background: rgba(240, 80, 60, 0.04);
}

.ax-op-message-card.warn {
  border-left-color: var(--wp-warn);
  background: rgba(226, 163, 58, 0.04);
}

.ax-op-message-card.safe {
  border-left-color: var(--wp-ok);
  background: rgba(79, 191, 138, 0.04);
}

/* Seção Expansível "Detalhes Técnicos" */
.ax-tech-details {
  border: 1px solid var(--ax-line);
  border-radius: var(--r-sm);
  background: var(--ax-obsidian);
  overflow: hidden;
  margin-top: 6px;
}

.ax-tech-details-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--ax-void);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  color: var(--ax-text-2);
  cursor: pointer;
  user-select: none;
  list-style: none;
  transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}

.ax-tech-details-summary::-webkit-details-marker {
  display: none;
}

.ax-tech-details-summary:hover {
  background: var(--ax-raised);
  color: var(--ax-text);
}

.ax-tech-details-summary .chevron-ic {
  width: 14px;
  height: 14px;
  transition: transform var(--dur-1) var(--ease);
}

.ax-tech-details[open] .ax-tech-details-summary .chevron-ic {
  transform: rotate(180deg);
}

.ax-tech-details-body {
  padding: 8px 12px 10px 12px;
  border-top: 1px solid var(--ax-line);
  background: var(--ax-obsidian);
}

.ax-tech-spec {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 0;
  padding: 0;
}

.ax-tech-spec-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  padding: 2px 0;
}

.ax-tech-spec-dt {
  color: var(--ax-text-3);
  font-weight: 500;
}

.ax-tech-spec-dd {
  font-family: var(--wp-mono);
  color: var(--ax-text-2);
  font-size: 11px;
  margin: 0;
  text-align: right;
}

/* =========================================================================
   ESTADO B: INSPETOR CONTEXTUAL NÃO-BLOQUEANTE (AXIOM CAD/CAM)
   Integrado à barra lateral direita (#validatorSidebar)
   ========================================================================= */

.val-inspector-view {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  background: var(--ax-obsidian);
  color: var(--ax-text);
  overflow-y: auto;
}

/* 1. Barra de Navegação e Retorno */
.ax-inspector-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--ax-void);
  border-bottom: 1px solid var(--ax-line);
  position: sticky;
  top: 0;
  z-index: 10;
}

.ax-inspector-nav-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ax-inspector-counter {
  font-family: var(--wp-mono);
  font-size: 11px;
  color: var(--ax-text-3);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.ax-inspector-arrows {
  display: flex;
  gap: 4px;
}

/* 2. Cabeçalho da Ocorrência */
.ax-inspector-header {
  padding: 12px 14px 10px 14px;
  border-bottom: 1px solid var(--ax-line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02) 0%, transparent 100%);
}

.ax-inspector-title-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.ax-inspector-badge-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--r-sm);
  background: rgba(0, 184, 240, 0.1);
  border: 1px solid rgba(0, 184, 240, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ax-ember, #00B8F0);
  flex-shrink: 0;
  margin-top: 1px;
}

.ax-inspector-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.ax-inspector-title {
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 600;
  color: #f1f5f9;
  margin: 0;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 3. Conteúdo Scrollável */
.ax-inspector-content {
  padding: 12px 14px 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Card de Diagnóstico Operacional */
.ax-diag-card {
  background: var(--ax-void);
  border: 1px solid var(--ax-line);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ax-diag-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ax-diag-caption {
  font-family: var(--wp-mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  color: var(--ax-text-3);
  font-weight: 700;
  text-transform: uppercase;
}

.ax-diag-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--r-xs);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.ax-diag-metric-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ax-diag-label {
  font-size: 10px;
  color: var(--ax-text-3);
  font-weight: 500;
  white-space: nowrap;
}

.ax-diag-val-hero {
  font-family: var(--wp-mono);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.ax-diag-val-limit {
  font-family: var(--wp-mono);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ax-text-2);
}

.ax-diag-diff-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.ax-diag-diff-label {
  font-size: 11px;
  color: var(--ax-text-3);
}

.ax-diag-message {
  font-size: 11.5px;
  line-height: 1.5;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.02);
  border-left: 2px solid var(--ax-ember);
  padding: 6px 10px;
  border-radius: 0 var(--r-xs) var(--r-xs) 0;
}

/* 4. Ações Contextuais do Operador */
.ax-inspector-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ax-inspector-btn-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.ax-btn--full {
  width: 100%;
  justify-content: center;
}