:root {
  color-scheme: dark;
  --bg-page: #050505;
  --bg-panel: #0a0a0a;
  --bg-panel-alt: #0f0f0f;
  --stroke: rgba(255, 255, 255, 0.07);
  --text-primary: #e8eaed;
  --text-secondary: rgba(232, 234, 237, 0.65);
  --text-tertiary: rgba(232, 234, 237, 0.35);
  --accent: #ff2442;
  --accent-soft: rgba(255, 36, 66, 0.2);

  /* ── Metallic surfaces ── */
  --metal-sheen: linear-gradient(
    148deg,
    rgba(255, 255, 255, 0.09) 0%,
    rgba(255, 255, 255, 0.03) 28%,
    transparent 52%,
    rgba(0, 0, 0, 0.28) 100%
  );
  --metal-panel-bg: linear-gradient(
    192deg,
    #13161b 0%,
    #0b0d11 40%,
    #080a0d 72%,
    #0d1014 100%
  );
  --metal-scratch: repeating-linear-gradient(
    92deg,
    transparent,
    transparent 3px,
    rgba(255, 255, 255, 0.012) 3px,
    rgba(255, 255, 255, 0.012) 4px
  );

  --font-mono: "IBM Plex Mono", ui-monospace, "Cascadia Code", "Segoe UI Mono", monospace;

  /* ── Noise / grain ── */
  --noise-dense: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");

  /* ── Hazard tape — brighter, more visible ── */
  --hazard-black: #08080a;
  --hazard-yellow: #b09418;
  --hazard-tape-h: repeating-linear-gradient(
    -45deg,
    var(--hazard-black)  0px,
    var(--hazard-black)  8px,
    var(--hazard-yellow) 8px,
    var(--hazard-yellow) 16px
  );
  --hazard-tape-v: repeating-linear-gradient(
    180deg,
    var(--hazard-black)  0px,
    var(--hazard-black)  6px,
    var(--hazard-yellow) 6px,
    var(--hazard-yellow) 12px
  );
  /* Thin accent tape (1-colour orange-ish glow line) */
  --accent-tape: repeating-linear-gradient(
    90deg,
    rgba(255, 36, 66, 0.9) 0px,
    rgba(255, 80, 36, 0.7) 4px,
    rgba(255, 36, 66, 0.9) 8px
  );

  --radius-lg: 10px;
  --radius-md: 7px;
  --radius-sm: 5px;
  --transition: 160ms ease;
  /* Preview 1:1 + toolbar + chips; teto da grelha (ligeiramente mais baixo para dar ar ao dataset em baixo) */
  --gg-preview-cap: min(52vh, min(88vw, 680px));
  /* Dropzone + Inspect + gaps + faixa de métricas sob o output */
  --gg-workspace-chrome: clamp(8.25rem, 14.5vh, 11.5rem);
  --gg-main-max-height: calc(var(--gg-preview-cap) + var(--gg-workspace-chrome));
}

* {
  box-sizing: border-box;
}

/* Raiz com scroll explícito — evita alguns motores a comportarem-se como “app fullscreen” */
html {
  height: auto;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}

body {
  position: relative;
  z-index: 0;
  margin: 0;
  min-height: 100vh;
  height: auto;
  max-height: none;
  overflow-x: hidden;
  overflow-y: auto;
  font-family: "Space Grotesk", system-ui, -apple-system, sans-serif;
  background-color: #040507;
  /* Heavy industrial floor: fine diamond-plate double grid + rust vignette */
  background-image:
    linear-gradient(rgba(255,255,255,0.024) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.024) 1px, transparent 1px),
    linear-gradient(rgba(255,255,255,0.009) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.009) 1px, transparent 1px),
    radial-gradient(ellipse at 80% 5%, rgba(255,36,66,0.065) 0%, transparent 50%),
    radial-gradient(ellipse at 12% 88%, rgba(180,130,0,0.045) 0%, transparent 40%),
    linear-gradient(180deg, #131720 0%, #060809 50%, #020304 100%);
  background-size:
    40px 40px,
    40px 40px,
    8px 8px,
    8px 8px,
    100% 100%,
    100% 100%,
    100% 100%;
  color: var(--text-primary);
}

/* Scroll do documento mantido no browser */
html {
  overflow-y: auto;
}

body {
  overflow-y: auto;
}

/* Film-grain noise overlay */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  background-image: var(--noise-dense);
  background-repeat: repeat;
  background-size: 128px 128px;
  opacity: 0.055;
  pointer-events: none;
  z-index: 0;
  mix-blend-mode: overlay;
}

/* Horizontal hazard tape at very top of page (thick industrial strip) */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: var(--hazard-tape-h);
  opacity: 0.55;
  pointer-events: none;
  z-index: 9999;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  border: none;
  background: none;
  cursor: pointer;
}

button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.glassguard {
  position: relative;
  z-index: 1;
  width: min(1800px, 92vw);
  max-width: 1800px;
  margin: clamp(24px, 3vh, 40px) auto;
  display: block;
  padding: 0 clamp(16px, 2vw, 24px);
  padding-left: calc(clamp(16px, 2vw, 24px) + 6px);
  /* Altura = só o conteúdo; scroll no html/body (sem min-height:100vh que ancorava ao ecrã) */
  height: auto;
  max-height: none;
  overflow-x: hidden;
  overflow-y: visible;
}

.glassguard > * + * {
  margin-top: clamp(20px, 2.5vw, 32px);
}

/* Empilha main + dataset; altura = conteúdo (sem teto à viewport — scroll é no body) */
/* Layout sequencial simples: header -> main -> dataset -> footer */

/* Hazard tape left edge — wider and more visible */
.glassguard::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 6px;
  border-radius: 0 2px 2px 0;
  background: var(--hazard-tape-v);
  opacity: 0.6;
  pointer-events: none;
}

.gg-header {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: clamp(18px, 2vw, 28px);
  padding: clamp(14px, 1.8vw, 22px) clamp(18px, 2.2vw, 28px);
  padding-bottom: calc(clamp(14px, 1.8vw, 22px) + 6px);
  /* Brushed-metal panel: top highlight + angled sheen + dark steel gradient */
  background:
    var(--metal-sheen),
    var(--metal-scratch),
    linear-gradient(180deg, #1c2129 0%, #0e1116 45%, #090c10 100%);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -1px 0 rgba(0, 0, 0, 0.5),
    0 2px 0 rgba(0, 0, 0, 0.7),
    0 16px 48px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(12px);
  flex-shrink: 0;
  overflow: hidden;
}

/* Corner rivets — bigger and more visible */
.gg-header::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    radial-gradient(circle at 16px 50%, #4a5160 0 3px, #22272e 3px 5px, transparent 5px),
    radial-gradient(circle at calc(100% - 16px) 50%, #4a5160 0 3px, #22272e 3px 5px, transparent 5px),
    radial-gradient(circle at 16px 18px, #4a5160 0 2.5px, #22272e 2.5px 4px, transparent 4px),
    radial-gradient(circle at calc(100% - 16px) 18px, #4a5160 0 2.5px, #22272e 2.5px 4px, transparent 4px),
    radial-gradient(circle at 16px calc(100% - 18px), #4a5160 0 2.5px, #22272e 2.5px 4px, transparent 4px),
    radial-gradient(circle at calc(100% - 16px) calc(100% - 18px), #4a5160 0 2.5px, #22272e 2.5px 4px, transparent 4px);
}

/* Hazard tape bottom strip — thick and bold */
.gg-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 5px;
  background: var(--hazard-tape-h);
  opacity: 0.55;
  pointer-events: none;
}

.gg-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Carimbo tipo painel de fábrica */
.gg-brand::after {
  content: "QC / A-1";
  font-family: var(--font-mono);
  font-size: 0.5rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  color: rgba(200, 200, 205, 0.45);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  padding: 4px 6px;
  line-height: 1;
  margin-left: 4px;
  align-self: center;
  opacity: 0.9;
}

.brand-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background:
    linear-gradient(145deg, rgba(255,255,255,0.12) 0%, transparent 50%),
    var(--metal-scratch),
    linear-gradient(180deg, #202530 0%, #0e1018 100%);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-top: 1px solid rgba(255,255,255,0.2);
  border-bottom: 1px solid rgba(0,0,0,0.6);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -8px 16px rgba(255, 36, 66, 0.08),
    0 3px 0 rgba(0,0,0,0.6),
    0 6px 16px rgba(0,0,0,0.4);
  display: grid;
  place-items: center;
}

.brand-icon svg path {
  fill: rgba(255, 255, 255, 0.78);
}

.brand-copy {
  display: grid;
  gap: 2px;
}

.brand-copy strong {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: clamp(0.88rem, 1.1vw, 1.1rem);
}

.brand-copy span {
  font-size: clamp(0.64rem, 0.9vw, 0.82rem);
  letter-spacing: 0.1em;
  color: var(--text-tertiary);
}

.gg-meta {
  display: flex;
  gap: 16px;
}

.gg-meta .meta-item {
  padding: 8px 14px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.05) 0%, transparent 35%),
    rgba(6, 7, 9, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-left: 3px solid rgba(255, 180, 0, 0.35);
  border-radius: 3px;
  display: grid;
  gap: 4px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 2px 6px rgba(0,0,0,0.4);
}

.meta-item span {
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.meta-item strong {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: rgba(240, 242, 245, 0.95);
}

.gg-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
}

.ghost-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  border-bottom: 1px solid rgba(0, 0, 0, 0.5);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.01) 100%),
    rgba(18, 20, 24, 0.9);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.06),
    0 2px 0 rgba(0,0,0,0.5),
    0 4px 12px rgba(0,0,0,0.3);
  color: inherit;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background var(--transition), border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.ghost-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.ghost-btn:hover {
  background:
    linear-gradient(180deg, rgba(255,36,66,0.15) 0%, rgba(255,36,66,0.05) 100%),
    rgba(18, 20, 24, 0.9);
  border-color: rgba(255, 36, 66, 0.4);
  box-shadow:
    inset 0 1px 0 rgba(255,80,80,0.1),
    0 2px 0 rgba(0,0,0,0.5),
    0 6px 18px rgba(255,36,66,0.15);
  transform: translateY(-1px);
}

.ghost-btn:focus-visible {
  outline: 2px solid rgba(255, 36, 66, 0.65);
  outline-offset: 3px;
}

.gg-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  border-bottom: 1px solid rgba(0, 0, 0, 0.45);
  background:
    linear-gradient(180deg, #1c2230 0%, #0d1018 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    inset 0 -1px 0 rgba(0, 0, 0, 0.5),
    0 2px 0 rgba(0,0,0,0.5);
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.gg-status:has(.status-chip.live) {
  border-color: rgba(255, 36, 66, 0.4);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 0 0 1px rgba(255, 36, 66, 0.15),
    0 0 12px rgba(255, 36, 66, 0.1);
}

.status-chip .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-tertiary);
  transition: background var(--transition), box-shadow var(--transition);
}

.status-chip.live .dot {
  background: var(--accent);
  box-shadow: 0 0 8px rgba(255, 36, 66, 0.5);
}

.status-chip.error .dot {
  background: #ff5f7d;
  box-shadow: 0 0 10px rgba(255, 95, 125, 0.45);
}

/*
 * Grelha com altura natural: sem teto fixo à viewport (antes height/max-height + overflow:hidden
 * criavam “dashboard” com scroll interno na paleta e tudo espremido). Scroll = browser.
 */
.gg-main {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  grid-template-rows: minmax(0, 1fr);
  column-gap: clamp(18px, 2vw, 28px);
  row-gap: clamp(10px, 1.2vw, 18px);
  min-height: 0;
  height: var(--gg-main-max-height);
  max-height: var(--gg-main-max-height);
  align-items: start;
  align-content: start;
  overflow: hidden;
}

.panel {
  position: relative;
  background:
    var(--metal-sheen),
    var(--metal-scratch),
    var(--metal-panel-bg);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-top: 1px solid rgba(255, 255, 255, 0.13);
  border-bottom: 1px solid rgba(0, 0, 0, 0.5);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    inset 0 -1px 0 rgba(0, 0, 0, 0.45),
    0 2px 0 rgba(0, 0, 0, 0.6),
    0 10px 40px rgba(0, 0, 0, 0.4);
  padding: clamp(16px, 2vw, 24px);
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 1.5vw, 18px);
  min-height: auto;
}

/* Panel ::before — rivet cluster in top-left */
.panel::before {
  content: "";
  position: absolute;
  top: 10px;
  left: 10px;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background:
    radial-gradient(circle at 0px 0px, #505b68 0 2.5px, #1d2228 2.5px 4px, transparent 4px),
    radial-gradient(circle at 14px 0px, #505b68 0 2.5px, #1d2228 2.5px 4px, transparent 4px),
    radial-gradient(circle at 0px 14px, #505b68 0 2.5px, #1d2228 2.5px 4px, transparent 4px);
  opacity: 0.7;
  z-index: 0;
}

/* Corner bracket — bottom-right engineering marking */
.panel::after {
  content: "";
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 22px;
  height: 22px;
  border-bottom: 2px solid rgba(255, 200, 0, 0.18);
  border-right: 2px solid rgba(255, 200, 0, 0.18);
  border-radius: 0 0 var(--radius-sm) 0;
  opacity: 1;
  pointer-events: none;
}

.panel.overview.production-dataset-panel::after {
  display: none;
}

.panel.palette {
  min-height: 0;
  height: 100%;
}

.panel.workspace {
  min-height: 0;
  height: 100%;
}

/* Amostras com scroll interno */
.palette-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: clamp(10px, 1.2vw, 14px);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  background:
    var(--metal-scratch),
    linear-gradient(165deg, rgba(255,255,255,0.025) 0%, transparent 45%),
    rgba(4, 5, 7, 0.97);
  box-shadow:
    inset 0 2px 8px rgba(0,0,0,0.5),
    inset 0 0 0 1px rgba(0,0,0,0.4);
  scrollbar-gutter: stable;
}

.palette-scroll:focus-within {
  border-color: rgba(255, 36, 66, 0.4);
  box-shadow:
    inset 0 2px 8px rgba(0,0,0,0.5),
    inset 0 0 0 1px rgba(255,36,66,0.15);
}

.palette-scroll::-webkit-scrollbar {
  width: 6px;
}

.palette-scroll::-webkit-scrollbar-track {
  background: rgba(0,0,0,0.3);
}

.palette-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 36, 66, 0.4);
  border-radius: 2px;
  border: 1px solid rgba(0,0,0,0.3);
}

.panel header h2 {
  margin: 0;
  font-family: var(--font-mono);
  font-size: clamp(0.66rem, 0.95vw, 0.82rem);
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(230, 232, 236, 0.92);
}

.panel header p {
  margin: 4px 0 0;
  font-size: clamp(0.62rem, 0.9vw, 0.78rem);
  color: var(--text-tertiary);
}

.palette .swatch-grid {
  display: grid;
  gap: clamp(6px, 0.85vw, 10px);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-content: start;
}

.sample-card {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.035) 0%, transparent 40%),
    rgba(8, 9, 11, 0.95);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(0,0,0,0.5);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.05),
    0 2px 0 rgba(0,0,0,0.4);
  padding: 6px;
  display: grid;
  grid-template-rows: auto auto;
  gap: 4px;
  min-width: 0;
  transition: transform var(--transition), border var(--transition), box-shadow var(--transition);
}

.sample-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  height: auto;
  object-fit: contain;
  object-position: center;
  border-radius: var(--radius-sm);
  background: rgba(4, 5, 6, 0.96);
  border: 1px solid rgba(255,255,255,0.04);
}

.sample-card span {
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.25;
}

.sample-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255,255,255,0.14);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.07),
    0 10px 24px rgba(0,0,0,0.6);
}

.sample-card.active {
  border: 1px solid rgba(255, 36, 66, 0.65);
  box-shadow:
    inset 0 1px 0 rgba(255,80,80,0.1),
    0 0 0 1px rgba(255,36,66,0.2),
    0 8px 24px rgba(255,36,66,0.25);
}


.workspace {
  --preview-slate-max: var(--gg-preview-cap);
  gap: clamp(16px, 2vw, 24px);
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.workspace-top {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-shrink: 0;
}

.dropzone {
  position: relative;
  flex: 1;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px dashed rgba(255, 200, 0, 0.18);
  background:
    var(--metal-scratch),
    linear-gradient(145deg, rgba(255,255,255,0.03) 0%, transparent 55%),
    rgba(5, 6, 8, 0.98);
  box-shadow:
    inset 0 2px 6px rgba(0,0,0,0.4),
    inset 0 1px 0 rgba(255,255,255,0.03);
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.dropzone.dragover {
  border-color: rgba(255, 36, 66, 0.6);
  border-style: solid;
  box-shadow:
    0 18px 40px rgba(255, 36, 66, 0.22),
    inset 0 2px 6px rgba(0,0,0,0.4),
    inset 0 0 0 1px rgba(255,36,66,0.12);
  transform: translateY(-2px);
}

.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.dropzone-icon svg {
  fill: var(--accent);
}

.dropzone-copy p {
  margin: 0;
  font-size: 0.68rem;
  color: var(--text-secondary);
}

.dropzone-copy p span {
  color: var(--accent);
}

.primary-btn {
  padding: 9px 20px;
  border-radius: 4px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.12) 0%, rgba(255,255,255,0.02) 45%),
    linear-gradient(135deg, rgba(255, 36, 66, 0.55), rgba(200, 20, 48, 0.45));
  border: 1px solid rgba(255, 36, 66, 0.6);
  border-top: 1px solid rgba(255, 80, 100, 0.5);
  border-bottom: 1px solid rgba(140, 10, 28, 0.8);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 2px 0 rgba(100, 0, 18, 0.8),
    0 6px 20px rgba(255, 36, 66, 0.2);
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  transition: transform var(--transition), box-shadow var(--transition);
}

.primary-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

.primary-btn:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 2px 0 rgba(100, 0, 18, 0.8),
    0 8px 28px rgba(255, 36, 66, 0.38),
    0 0 16px rgba(255, 36, 66, 0.15);
}

.workspace-bottom {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  gap: clamp(8px, 1vw, 12px);
  overflow: visible;
}

.workspace-main {
  container-type: size;
  display: flex;
  flex-direction: column;
  gap: clamp(6px, 0.9vw, 10px);
  flex: 1;
  min-height: 0;
  min-width: 0;
}

/* Faixa compacta de métricas sob o output */
.workspace-side {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-width: 0;
  flex: 0 0 auto;
}

.project-details {
  flex: unset;
  min-height: auto;
  margin-top: 0;
  padding: 11px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background:
    var(--metal-sheen),
    var(--metal-scratch),
    linear-gradient(188deg, #111519 0%, #080a0d 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom: 1px solid rgba(0,0,0,0.4);
  border-radius: var(--radius-md);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 2px 0 rgba(0,0,0,0.4);
  min-width: 0;
}

.project-details__intro {
  margin: 0;
  font-size: 0.58rem;
  line-height: 1.45;
  color: var(--text-tertiary);
  opacity: 0.92;
}

.project-details__rows {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.project-details__rows--footer {
  flex-direction: row;
  flex-wrap: wrap;
  gap: clamp(16px, 3vw, 32px);
  align-items: flex-start;
}

.project-details__rows--footer .project-details__block {
  flex: 1 1 min(100%, 14rem);
  min-width: min(100%, 12rem);
}

.project-details--footer {
  width: 100%;
  max-width: 100%;
  padding: clamp(18px, 2.2vw, 26px) clamp(14px, 2vw, 20px);
}

.project-details--footer .inspection-details__title {
  padding-top: clamp(4px, 0.55vw, 10px);
}

.project-details__block {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.project-details__field-label {
  margin: 0;
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.project-details__field-label--sub {
  margin-top: 3px;
  font-size: 0.52rem;
  letter-spacing: 0.1em;
  opacity: 0.95;
}

.project-details__field-value {
  margin: 0;
  font-size: clamp(0.68rem, 0.9vw, 0.8rem);
  font-weight: 600;
  line-height: 1.35;
  color: var(--accent);
}

.project-details__link {
  align-self: flex-start;
  margin: 0;
  font-size: 0.58rem;
  line-height: 1.4;
  letter-spacing: 0.04em;
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(255, 36, 66, 0.45);
  text-underline-offset: 2px;
  opacity: 0.92;
}

.project-details__link:hover {
  opacity: 1;
  text-decoration-color: rgba(255, 36, 66, 0.85);
}

.project-details__link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Quadrado máximo: largura total do workspace até ao teto --gg-preview-cap */
.workspace-main > .result-shell {
  align-self: center;
  flex: 0 0 auto;
  width: min(100%, var(--gg-preview-cap));
  max-width: 100%;
  aspect-ratio: 1;
  height: auto;
  box-sizing: border-box;
}

@supports (width: 1cqw) {
  .workspace-main > .result-shell {
    width: min(100cqw, var(--gg-preview-cap));
  }
}

.result-shell {
  position: relative;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  border-bottom: 1px solid rgba(0,0,0,0.6);
  background:
    linear-gradient(160deg, rgba(255,255,255,0.04) 0%, transparent 40%),
    linear-gradient(180deg, #0e1115 0%, #050607 100%);
  box-sizing: border-box;
  margin-inline: 0;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
  place-items: stretch;
  overflow: hidden;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    inset 0 -1px 0 rgba(0,0,0,0.5),
    inset 0 0 0 1px rgba(0,0,0,0.5),
    0 3px 0 rgba(0,0,0,0.7),
    0 12px 32px rgba(0,0,0,0.5);
}

/* Heavy rivets + corner crosshair in inspection viewport */
.result-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;
  background:
    /* Top-left rivet cluster */
    radial-gradient(circle at 12px 12px, #5a6370 0 3px, #1e2228 3px 5px, transparent 5px),
    radial-gradient(circle at 26px 12px, #4a5360 0 2px, #1e2228 2px 3.5px, transparent 3.5px),
    radial-gradient(circle at 12px 26px, #4a5360 0 2px, #1e2228 2px 3.5px, transparent 3.5px),
    /* Top-right rivet cluster */
    radial-gradient(circle at calc(100% - 12px) 12px, #5a6370 0 3px, #1e2228 3px 5px, transparent 5px),
    radial-gradient(circle at calc(100% - 26px) 12px, #4a5360 0 2px, #1e2228 2px 3.5px, transparent 3.5px),
    radial-gradient(circle at calc(100% - 12px) 26px, #4a5360 0 2px, #1e2228 2px 3.5px, transparent 3.5px),
    /* Bottom rivets */
    radial-gradient(circle at 12px calc(100% - 12px), #5a6370 0 3px, #1e2228 3px 5px, transparent 5px),
    radial-gradient(circle at calc(100% - 12px) calc(100% - 12px), #5a6370 0 3px, #1e2228 3px 5px, transparent 5px);
  opacity: 0.8;
}

.result-shell > .preview-stage,
.result-shell > .result-placeholder {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  min-height: 0;
  width: 100%;
  height: 100%;
}

.result-shell.boxed {
  border-color: rgba(255, 44, 70, 0.16);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2), inset 0 0 0 1px rgba(255, 44, 70, 0.12);
}

.result-shell.ready .preview-stage {
  display: block;
  position: relative;
  z-index: 1;
}

.preview-stage {
  position: relative;
  display: none;
}

.preview-stage img {
  display: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-width: 100%;
  min-height: 100%;
  object-fit: cover;
  object-position: center;
}

.result-shell.ready .preview-stage img {
  display: block;
}

.preview-stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  display: block;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.preview-stage canvas[data-empty="false"] {
  opacity: 1;
}

/* Veredicto sobre a imagem — estilo etiqueta industrial */
.preview-verdict {
  position: absolute;
  z-index: 2;
  top: 10px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: calc(100% - 20px);
  padding: 4px 10px 4px 8px;
  border-radius: 3px;
  background:
    linear-gradient(180deg, rgba(20,24,30,0.96) 0%, rgba(10,12,16,0.98) 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-top: 1px solid rgba(255,255,255,0.18);
  border-bottom: 1px solid rgba(0,0,0,0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.06),
    0 2px 0 rgba(0,0,0,0.6),
    0 6px 18px rgba(0,0,0,0.5);
  pointer-events: none;
}

.preview-verdict__text {
  margin: 0;
  font-size: clamp(0.6rem, 1.5vw, 0.72rem);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-primary);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preview-verdict.is-anomaly {
  border-color: rgba(255, 36, 66, 0.45);
  background: rgba(18, 6, 10, 0.92);
}

.preview-verdict.is-anomaly .preview-verdict__text {
  color: #ffb3c0;
}

.result-shell.ready .result-placeholder {
  display: none;
}

.result-placeholder {
  position: relative;
  z-index: 1;
  display: grid;
  gap: clamp(12px, 1.5vw, 20px);
  place-items: center;
  color: var(--text-tertiary);
  font-size: clamp(0.64rem, 0.9vw, 0.82rem);
  padding: clamp(10px, 1.5vh, 20px);
}

.result-placeholder svg {
  width: clamp(48px, 6vw, 80px);
  height: clamp(48px, 6vw, 80px);
  fill: var(--accent);
}

.progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 3;
  width: 100%;
  height: 2px;
  background: rgba(255, 36, 66, 0.18);
  overflow: hidden;
}

.progress-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255, 36, 66, 0), var(--accent), rgba(255, 36, 66, 0));
  animation: progress 1.05s linear infinite;
}

@keyframes progress {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* Título reutilizado no rodapé (Project details) */
.inspection-details__title {
  margin: 0;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.inspection-details {
  background:
    var(--metal-scratch),
    rgba(8, 9, 11, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(0,0,0,0.45);
  border-radius: var(--radius-sm);
  padding: 5px 6px;
  min-width: 0;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.04),
    0 2px 0 rgba(0,0,0,0.4);
}

.inspection-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  justify-content: center;
  gap: 4px 5px;
}

.inspection-chip {
  flex: 1 1 auto;
  min-width: min(100%, 4.75rem);
  max-width: 100%;
  display: grid;
  gap: 1px;
  padding: 3px 5px;
  border-radius: 3px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.04) 0%, transparent 50%),
    rgba(9, 10, 13, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(0,0,0,0.4);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 1px 0 rgba(0,0,0,0.4);
  text-align: center;
}

.inspection-chip__label {
  font-size: 0.48rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  line-height: 1.1;
}

.inspection-chip__value {
  margin: 0;
  font-family: var(--font-mono);
  font-size: clamp(0.52rem, 1.3vw, 0.64rem);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.verdict-indicator {
  display: none;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
  color: var(--accent);
}

.preview-verdict.is-anomaly .verdict-indicator {
  display: inline-flex;
}

.verdict-indicator__icon {
  display: block;
  flex-shrink: 0;
  opacity: 0.95;
}

.verdict-indicator__dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(255, 36, 66, 0.65);
  flex-shrink: 0;
}

.gg-footer {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: clamp(14px, 2vw, 20px);
  font-size: clamp(0.6rem, 0.85vw, 0.78rem);
  color: var(--text-tertiary);
  padding: calc(clamp(12px, 1.5vw, 20px) + 3px) 0 clamp(12px, 1.5vw, 20px);
  /* Sem margin-top:auto: o rodapé fica no fim do conteúdo; o scroll é na página, não “preso” à viewport */
  flex-shrink: 0;
  border-top: none;
}

.gg-footer::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 5px;
  background: var(--hazard-tape-h);
  opacity: 0.5;
  pointer-events: none;
  border-radius: 2px;
}

.gg-footer__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px 16px;
}

.toast-stack {
  position: fixed;
  top: 18px;
  right: 18px;
  display: grid;
  gap: 8px;
  z-index: 30;
  pointer-events: none;
}

.toast {
  padding: 9px 14px;
  border-radius: 3px;
  background:
    var(--metal-scratch),
    linear-gradient(180deg, #1a1e26 0%, #0d1016 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  border-bottom: 1px solid rgba(0,0,0,0.55);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.06),
    0 2px 0 rgba(0,0,0,0.6),
    0 16px 32px rgba(0, 0, 0, 0.6);
  font-size: 0.64rem;
  letter-spacing: 0.04em;
  transform: translateY(-10px);
  opacity: 0;
  animation: toastIn 180ms ease forwards;
}

.toast[data-variant="error"] {
  border-color: rgba(255, 95, 125, 0.42);
  background: rgba(255, 95, 125, 0.26);
}

.toast[data-variant="success"] {
  border-color: rgba(255, 36, 66, 0.44);
  background: rgba(255, 36, 66, 0.24);
}

@keyframes toastIn {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (min-width: 1920px) {
  .glassguard {
    width: min(1800px, 92vw);
  }
  
  .gg-main {
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  }
}

@media (min-width: 2560px) {
  .glassguard {
    width: min(2000px, 90vw);
  }
}

@media (max-width: 1200px) {
  .gg-main {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) minmax(0, 1.2fr);
    height: min(var(--gg-main-max-height), 88vh);
    max-height: min(var(--gg-main-max-height), 88vh);
  }
}

@media (max-width: 860px) {
  .gg-header {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 16px;
  }

  .gg-brand::after {
    display: none;
  }

  .gg-main {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .workspace-top {
    flex-direction: column;
    align-items: stretch;
  }

  .primary-btn {
    width: 100%;
  }

  .production-line-toolbar .primary-btn {
    width: auto;
  }
}

@media (max-width: 600px) {
  .glassguard {
    margin: 24px auto;
  }

  .panel {
    padding: 18px;
  }

  .gg-footer__meta {
    flex-direction: column;
    text-align: center;
    justify-content: center;
  }
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

@keyframes rotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.result-shell.loading img,
.result-shell.loading .result-placeholder {
  opacity: 0.22;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(5, 5, 5, 0.82);
  backdrop-filter: blur(16px);
  z-index: 80;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--transition), visibility var(--transition);
}

.loading-overlay.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

.loading-card {
  position: relative;
  background:
    var(--metal-sheen),
    var(--metal-scratch),
    linear-gradient(185deg, #181d24 0%, #0a0d11 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  border-bottom: 1px solid rgba(0,0,0,0.6);
  border-radius: var(--radius-md);
  padding: 24px 28px;
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 320px;
  box-shadow:
    0 32px 60px rgba(0, 0, 0, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 3px 0 rgba(0,0,0,0.7);
}

.loading-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: grid;
  place-items: center;
  position: relative;
}

.loading-icon::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px solid rgba(255, 36, 66, 0.35);
  animation: rotate 1.6s linear infinite;
}

.loading-outline {
  fill: none;
  stroke: rgba(255, 255, 255, 0.85);
  stroke-width: 1.6;
}

.loading-liquid {
  fill: rgba(255, 36, 66, 0.32);
}

.loading-spark {
  fill: rgba(255, 36, 66, 0.72);
}

.loading-copy {
  display: grid;
  gap: 4px;
}

.loading-copy strong {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.loading-copy span {
  font-size: 0.68rem;
  color: var(--text-secondary);
}

.inspection-details.is-loading .inspection-chip {
  position: relative;
  color: transparent;
}

.inspection-details.is-loading .inspection-chip > * {
  visibility: hidden;
}

.inspection-details.is-loading .inspection-chip::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 5px;
  background: linear-gradient(90deg, rgba(12, 12, 12, 0.7), rgba(255, 36, 66, 0.2), rgba(12, 12, 12, 0.7));
  animation: shimmer 1.1s linear infinite;
}

.preview-verdict.is-loading {
  position: relative;
  color: transparent;
}

.preview-verdict.is-loading .preview-verdict__text,
.preview-verdict.is-loading .verdict-indicator {
  visibility: hidden;
}

.preview-verdict.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(12, 12, 12, 0.7), rgba(255, 36, 66, 0.2), rgba(12, 12, 12, 0.7));
  animation: shimmer 1.1s linear infinite;
}

/* ============================================================================
   Global Native UI Overrides
   ============================================================================ */

/* Scrollbars - Webkit */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-page);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 36, 66, 0.4);
  border-radius: 4px;
  transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 36, 66, 0.6);
}

/* Scrollbars - Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 36, 66, 0.4) var(--bg-page);
}

/* Text Selection */
::selection {
  background: rgba(255, 36, 66, 0.3);
  color: var(--text-primary);
}

::-moz-selection {
  background: rgba(255, 36, 66, 0.3);
  color: var(--text-primary);
}

/* Inputs & Dropdowns */
input,
textarea,
select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background: var(--bg-panel);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 8px 12px;
  font: inherit;
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ff2442' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-color: var(--accent);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-tertiary);
}

/* Dataset: altura por conteúdo + mínimos explícitos na zona da tabela (pai já não tem teto flex à viewport) */
.panel.overview.production-dataset-panel {
  display: block;
  align-self: stretch;
  min-width: 0;
  min-height: 42rem;
  width: 100%;
  overflow-x: hidden;
  overflow-y: visible;
}

.production-dataset-panel__header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 1rem 1.25rem;
  flex-shrink: 0;
  padding-top: clamp(6px, 0.9vw, 12px);
  padding-bottom: clamp(10px, 1.2vw, 14px);
  margin-bottom: clamp(10px, 1.2vw, 14px);
  border-bottom: 2px solid rgba(255, 180, 0, 0.12);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.4);
}

.production-dataset-panel__header > div:first-child {
  flex: 1 1 min(100%, 22rem);
  min-width: 0;
}

.production-dataset-panel__header h2 {
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: 0.2em;
}

.production-dataset-panel__header > div:first-child p {
  margin: 0.35rem 0 0;
  max-width: 52ch;
  color: var(--text-tertiary);
  font-size: 0.88rem;
  line-height: 1.45;
}

.production-line-toolbar {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
  margin-inline-start: auto;
}

.production-line-toolbar .primary-btn {
  min-width: 6.5rem;
}

.production-line-toolbar .production-line-stop-btn {
  border-radius: var(--radius-md);
  letter-spacing: 0.14em;
}

.production-line-toolbar .production-line-stop-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.production-line-toolbar .production-line-stop-btn:disabled:hover {
  background: rgba(12, 12, 12, 0.6);
  border-color: rgba(255, 255, 255, 0.08);
  transform: none;
}

.production-table-scroll {
  position: relative;
  display: block;
  min-width: 0;
  width: 100%;
  min-height: 34rem;
  height: 34rem;
  max-height: none;
  overflow-x: auto;
  overflow-y: auto;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(0,0,0,0.5);
  background:
    var(--metal-scratch),
    rgba(5, 6, 8, 0.98);
  box-shadow:
    inset 0 2px 10px rgba(0,0,0,0.5),
    0 2px 0 rgba(0,0,0,0.4);
}

.production-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

.production-table thead th {
  position: static;
  padding: 0.55rem 0.65rem;
  text-align: left;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(200, 205, 215, 0.6);
  background:
    linear-gradient(180deg, #1a1e26 0%, #0e1118 100%);
  border-bottom: 2px solid rgba(255, 180, 0, 0.15);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.07),
    0 2px 6px rgba(0,0,0,0.4);
  white-space: nowrap;
}

.production-table tbody td {
  padding: 0.45rem 0.65rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  vertical-align: middle;
}

.production-table tbody tr:last-child td {
  border-bottom: none;
}

.production-table tbody tr:hover td {
  background: rgba(255,255,255,0.025);
}

.production-table tbody tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.018);
}

.production-verdict {
  font-weight: 600;
  letter-spacing: 0.04em;
}

.production-verdict--normal {
  color: #7dffb0;
}

.production-verdict--anomaly {
  color: #ff8a9a;
}

.production-verdict--error {
  color: var(--text-tertiary);
}

.production-table-empty {
  display: none;
  margin: 0;
  padding: 1.25rem 1rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-tertiary);
}

/* Estado vazio: cabeçalho da tabela + mensagem visíveis (tbody vazio) */
.production-table-scroll:not(.has-rows) .production-table-empty {
  display: block;
}

/* Focus Ring */
*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}
