﻿:root {
  --bg: #050505;
  --panel: #121214;
  --panel-soft: #171719;
  --card: #151518;
  --border: #2f2f36;
  --line: #3a2a20;
  --orange: #ff6a00;
  --orange-2: #e34a00;
  --pink: #ff2f86;
  --text: #ffffff;
  --muted: #b9c0cf;
  --success: #80e28a;
  --danger: #ff4d6d;
  --warning: #ffd166;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, Arial, sans-serif;
}

body {
  background:
    linear-gradient(135deg, rgba(255, 106, 0, .08), transparent 28%),
    linear-gradient(180deg, #050505 0%, #0b0b0d 46%, #050505 100%);
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 24px;
  border-bottom: 0;
  background: linear-gradient(90deg, #050505 0%, #15110e 70%, #2a1205 100%);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.brand-logo {
  width: 68px;
  height: 68px;
  object-fit: contain;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
}

.brand h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1;
  font-weight: 900;
}

.brand h1 span {
  color: var(--orange);
}

.brand p {
  margin: 5px 0 0;
  color: #ffd7a8;
  font-size: 13px;
  font-weight: 700;
}

.topbar-actions,
.quick-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.run-btn,
.upload-btn,
.ghost-btn {
  min-height: 42px;
  border-radius: 8px;
  border: 0;
  padding: 10px 16px;
  color: #fff;
  font-weight: 900;
  white-space: nowrap;
}

.run-btn,
.upload-btn {
  background: linear-gradient(135deg, var(--orange), var(--orange-2));
  box-shadow: 0 12px 26px rgba(255, 106, 0, .24);
}

.run-btn.secondary {
  background: linear-gradient(135deg, #ff8a1c, #c43000);
}

.ghost-btn {
  border: 1px solid rgba(255, 106, 0, .55);
  color: #ffb16b;
  background: rgba(255, 106, 0, .075);
}

.ghost-btn.danger {
  border-color: rgba(255, 77, 109, .65);
  color: #ff9fb3;
  background: rgba(255, 77, 109, .08);
}

/* Prévia: resultado visual isolado do orçamento, usando a linguagem do portal. */
.previa-btn {
  background: linear-gradient(135deg, #ff8a1c, #c43000);
  box-shadow: 0 9px 18px rgba(227, 74, 0, .28);
}
.previa-panel .panel-body { display: grid; gap: 14px; }
.previa-progress { display: grid; gap: 8px; padding: 13px 14px; border: 1px solid #f5b27b; border-radius: 9px; background: linear-gradient(90deg, #fff8f1, #fff); box-shadow: 0 7px 18px rgba(227, 74, 0, .08); }
.previa-progress-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #702900; }
.previa-progress-heading span { font-size: 13px; font-weight: 900; }
.previa-progress-track { margin: 0; height: 10px; background: #e8edf3; border-color: #d7dde5; }
.previa-progress p { margin: 0; color: #52606e; font-size: 13px; font-weight: 700; }
.previa-progress.is-complete { border-color: #92d2a3; background: linear-gradient(90deg, #f0fff4, #fff); }
.previa-progress.is-complete .previa-progress-heading { color: #17663a; }
.previa-progress.is-complete .progress span { background: linear-gradient(90deg, #22a06b, #64d98c); }
.previa-progress.is-error { border-color: #ef9ca9; background: linear-gradient(90deg, #fff1f3, #fff); }
.previa-progress.is-error .previa-progress-heading { color: #a51d35; }
.previa-progress.is-error .progress span { background: #e13b58; }
.queue-progress { display: grid; gap: 8px; margin: 14px 0; padding: 13px 14px; border: 1px solid #285e7d; border-radius: 9px; background: linear-gradient(90deg, #0b1a28, #101014); box-shadow: 0 7px 18px rgba(35, 149, 210, .08); }
.queue-progress-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #eaf6ff; }
.queue-progress-heading span { font-size: 13px; font-weight: 900; }
.queue-progress-track { margin: 0; height: 10px; background: #090f16; border-color: #30495a; }
.queue-progress p { margin: 0; color: #b8c9d8; font-size: 13px; font-weight: 700; }
.queue-progress.is-complete { border-color: #3b9b69; background: linear-gradient(90deg, #102619, #101014); }
.queue-progress.is-complete .queue-progress-heading { color: #9ef0ba; }
.queue-progress.is-complete .progress span { background: linear-gradient(90deg, #22a06b, #64d98c); }
.queue-progress.is-error { border-color: #9f3d51; background: linear-gradient(90deg, #2b1219, #101014); }
.queue-progress.is-error .queue-progress-heading { color: #ffb1bf; }
.queue-progress.is-error .progress span { background: #e13b58; }
.previa-summary { margin-top: 0; }
.previa-metric { border-top: 3px solid #f06a00; }
.previa-technical { min-width: 0; }
.previa-report-section { margin: 0; }
.previa-checklist,
.previa-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 9px;
  margin-top: 12px;
}
.previa-checklist > div,
.previa-detail-grid > span {
  display: grid;
  gap: 4px;
  padding: 9px 10px;
  border: 1px solid #d7dde5;
  border-radius: 7px;
  background: #f7f9fc;
}
.previa-checklist small,
.previa-detail-grid small {
  color: #5f6b7a;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}
.previa-checklist strong,
.previa-detail-grid strong { color: #151a22; overflow-wrap: anywhere; }
.previa-damage { border-left-color: #f06a00; }
.previa-damage-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.previa-damage-head .badge { flex: 0 0 auto; }
.previa-damage-visual {
  position: relative;
  min-height: 220px;
  margin: 14px 0;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border: 1px solid #ccd7e4;
  border-radius: 12px;
  background: #0b1625;
  isolation: isolate;
}
.previa-damage-visual-background {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: blur(3px) brightness(.76) saturate(.92);
}
.previa-damage-zoom-lens {
  position: absolute;
  z-index: 2;
  display: block;
  width: clamp(210px, 30%, 290px);
  overflow: hidden;
  aspect-ratio: 1;
  border: 3px solid #14b8f0;
  border-radius: 50%;
  background: #0b1625;
  box-shadow: 0 12px 34px rgba(0, 0, 0, .38), inset 0 0 0 2px rgba(255, 255, 255, .9);
  opacity: 0;
  transition: opacity .18s ease, box-shadow .18s ease;
}
.previa-damage-visual.is-ready .previa-damage-zoom-lens { opacity: 1; }
.previa-damage-zoom-source {
  position: absolute;
  max-width: none;
  max-height: none;
  object-fit: fill;
  filter: none;
}
.previa-damage-visual figcaption {
  position: absolute;
  z-index: 3;
  right: 10px;
  bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
  max-width: calc(100% - 20px);
  padding: 6px 9px;
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 7px;
  background: rgba(4, 12, 23, .78);
  color: #fff;
  font-size: 12px;
  line-height: 1.25;
  backdrop-filter: blur(6px);
}
.previa-damage-original-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 3px 8px;
  border: 1px solid rgba(20, 184, 240, .7);
  border-radius: 6px;
  background: rgba(11, 31, 48, .88);
  color: #dff7ff;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color .16s ease, background-color .16s ease, color .16s ease;
}
.previa-damage-original-link:hover {
  border-color: #5ed7ff;
  background: rgba(20, 184, 240, .18);
  color: #fff;
}
.previa-damage-original-link:focus-visible {
  outline: 2px solid #5ed7ff;
  outline-offset: 2px;
}
@media (max-width: 640px) {
  .previa-damage-visual { min-height: 190px; aspect-ratio: 4 / 3; }
  .previa-damage-zoom-lens { width: clamp(160px, 52%, 220px); }
  .previa-damage-visual figcaption { left: 10px; justify-content: space-between; }
}
.previa-vehicle-damage-map[hidden] { display: none; }
.previa-vehicle-damage-map {
  display: grid;
  gap: 12px;
  min-width: 0;
  margin: 0;
  padding: 4px 0 2px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #eaf2ff;
}
.previa-map-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.previa-map-heading h3 { margin: 0 0 5px; color: #83d6ff; font-size: 16px; font-weight: 500; }
.previa-map-heading p { margin: 0; color: #aebed0; font-size: 12px; line-height: 1.4; }
.previa-map-vehicle-class {
  flex: 0 0 auto;
  padding: 5px 8px;
  border: 1px solid #31516b;
  border-radius: 999px;
  color: #bfe9ff;
  background: #123149;
  font-size: 11px;
  font-weight: 400;
}
.previa-map-figure { margin: 0; }
.previa-map-canvas {
  position: relative;
  width: min(100%, 1050px);
  margin: 0 auto;
  overflow: hidden;
  aspect-ratio: 3 / 2;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.previa-map-canvas > img,
.previa-map-overlay {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}
.previa-map-canvas > img { object-fit: contain; opacity: .96; }
.previa-map-overlay { z-index: 2; overflow: visible; }
.previa-map-marker { outline: none; pointer-events: auto; }
.previa-map-marker circle {
  fill: none;
  stroke: #ff4059;
  stroke-width: 4;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 0 4px rgba(255, 45, 76, .95));
  transform-box: fill-box;
  transform-origin: center;
  transition: stroke .16s ease, filter .16s ease, transform .16s ease;
}
.previa-map-marker:hover circle,
.previa-map-marker:focus-visible circle {
  stroke: #ff8a9b;
  filter: drop-shadow(0 0 7px rgba(255, 64, 89, 1));
  transform: scale(1.12);
}
.previa-map-marker:focus-visible circle { outline: none; }
.previa-map-orientation {
  position: absolute;
  z-index: 3;
  padding: 3px 6px;
  border: 1px solid rgba(83, 192, 246, .38);
  border-radius: 5px;
  color: #bfe9ff;
  background: rgba(5, 15, 25, .82);
  font-size: 10px;
  font-weight: 400;
  line-height: 1.1;
  pointer-events: none;
}
.previa-map-front { left: 8px; top: 50%; transform: translateY(-50%) rotate(-90deg); }
.previa-map-rear { right: 8px; top: 50%; transform: translateY(-50%) rotate(90deg); }
.previa-map-right { left: 50%; top: 8px; transform: translateX(-50%); }
.previa-map-left { left: 50%; bottom: 8px; transform: translateX(-50%); }
.previa-map-figure figcaption { margin-top: 7px; color: #8fa5ba; font-size: 11px; text-align: center; }
.previa-map-legend {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 7px 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.previa-map-legend li { display: flex; align-items: flex-start; gap: 8px; min-width: 0; color: #c7d6e6; font-size: 11px; line-height: 1.4; }
.previa-map-legend-ring { flex: 0 0 12px; width: 12px; height: 12px; margin-top: 1px; border: 2px solid #ff4059; border-radius: 50%; background: transparent; box-shadow: 0 0 5px rgba(255, 64, 89, .55); }
.previa-map-empty,
.previa-map-unpositioned { margin: 0; color: #9fb1c4; font-size: 11px; line-height: 1.4; }
.previa-map-unpositioned { padding-top: 4px; border-top: 0; }
@media (max-width: 700px) {
  .previa-vehicle-damage-map { padding: 4px 0 2px; }
  .previa-map-heading { align-items: stretch; flex-direction: column; }
  .previa-map-vehicle-class { align-self: flex-start; }
  .previa-map-orientation { padding: 2px 4px; font-size: 8px; }
  .previa-map-marker circle { stroke-width: 3; }
  .previa-map-legend { grid-template-columns: 1fr; }
}
.previa-json-wrap {
  overflow: hidden;
  border: 1px solid #d7dde5;
  border-radius: 8px;
  background: #f7f9fc;
}
.previa-json-wrap summary { padding: 12px; color: #9b3900; cursor: pointer; font-weight: 900; }
.previa-json-wrap pre { max-height: 420px; margin: 0; overflow: auto; border: 0; border-radius: 0; }

/* Laudos shadow: linguagem visual clara, sem aparência de autorização formal. */
.reports-shadow-panel .panel-body { display: grid; gap: 14px; }
.reports-shadow-summary { margin-top: 0; }
.reports-shadow-metric { border-top: 3px solid #f06a00; background: #f7f9fc; color: #151a22; }
.reports-shadow-metric small, .reports-shadow-metric strong { color: #151a22; }
.reports-shadow-content { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr)); gap: 14px; }
.report-shadow-card { min-width: 0; padding: 16px; border: 1px solid #d7dde5; border-left: 4px solid #f06a00; border-radius: 9px; background: linear-gradient(180deg, #fff, #f7f9fc); color: #151a22; box-shadow: 0 8px 20px rgba(20, 27, 36, .08); }
.report-shadow-card h3 { margin: 0 0 10px; color: #151a22; }
.report-shadow-card p { color: #27313f; overflow-wrap: anywhere; }
.report-shadow-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.report-shadow-warning { padding: 10px 12px; border: 1px solid #f5b27b; border-radius: 7px; background: #fff8f1; color: #702900 !important; }
.report-shadow-reconciliation { grid-column: 1 / -1; }
.reports-reconciliation-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 9px; }
.reports-reconciliation-grid span { display: grid; gap: 4px; padding: 10px; border: 1px solid #d7dde5; border-radius: 7px; background: #fff; }
.reports-reconciliation-grid small { color: #5f6b7a; font-size: 11px; font-weight: 900; text-transform: uppercase; }
.reports-reconciliation-grid strong { color: #151a22; }
.report-shadow-invariant { padding: 10px 12px; border: 1px solid #92d2a3; border-radius: 7px; background: #f0fff4; color: #17663a !important; font-weight: 800; }

.run-btn:hover,
.upload-btn:hover,
.ghost-btn:hover {
  filter: brightness(1.08);
}

.status-strip {
  display: grid;
  grid-template-columns: 1.25fr 1fr 1fr 1fr;
  gap: 1px;
  border-bottom: 1px solid #222;
  background: #222;
}

.status-strip > div {
  min-width: 0;
  padding: 13px 18px;
  background: #0b0b0d;
}

.status-strip small,
.metric small,
.card small,
.finance small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.status-strip strong,
.metric strong,
.card strong {
  display: block;
  margin-top: 6px;
  overflow-wrap: anywhere;
}

.tabs {
  display: flex;
  overflow-x: auto;
  gap: 0;
  padding-left: 28px;
  border-bottom: 1px solid #222;
  background: #070707;
}

.tab {
  min-width: 104px;
  padding: 15px 14px;
  border: 0;
  border-bottom: 3px solid transparent;
  color: #bfc8d8;
  background: transparent;
  font-size: 13px;
  font-weight: 900;
}

.tab.active {
  color: #fff;
  background: #211006;
  border-bottom-color: var(--orange);
}

.workspace {
  padding: 20px;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.panel {
  overflow: hidden;
  margin-bottom: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 18px 36px rgba(0, 0, 0, .35);
}

.panel-title {
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 106, 0, .45);
  background: linear-gradient(90deg, #1b100b, #331606, #e34a00);
  font-size: 20px;
  font-weight: 900;
}

.panel-body {
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
  padding: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 14px;
}

.form-grid.compact {
  grid-template-columns: 1.4fr .7fr 1fr;
}

label {
  display: grid;
  gap: 7px;
  color: #c9d2e3;
  font-weight: 800;
}

.full {
  margin-top: 14px;
}

input,
textarea,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid #333842;
  border-radius: 8px;
  padding: 11px 12px;
  color: #fff;
  background: #0d0d10;
  outline: none;
}

textarea {
  min-height: 132px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(255, 106, 0, .85);
  box-shadow: 0 0 0 3px rgba(255, 106, 0, .12);
}

.quick-row {
  margin-top: 14px;
}

.intake-actions {
  justify-content: flex-start;
}

.croqui-intake {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid rgba(66, 185, 255, .38);
  border-radius: 10px;
  background: rgba(38, 134, 196, .08);
}

.croqui-intake > div:first-child { margin-bottom: 12px; }
.croqui-intake p { margin: 5px 0; color: var(--muted); }

.upload-zone {
  display: grid;
  place-items: center;
  min-height: 190px;
  padding: 24px;
  border: 1px dashed rgba(255, 106, 0, .75);
  border-radius: 8px;
  background: rgba(255, 106, 0, .045);
  text-align: center;
}

.upload-zone strong {
  font-size: 22px;
}

.upload-zone span {
  margin-top: 6px;
  color: var(--muted);
}

.hidden-file {
  position: absolute;
  left: -99999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.metric-grid,
.card-grid,
.finance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
  gap: 12px;
  margin-top: 14px;
}

.metric,
.card,
.finance {
  min-width: 0;
  max-width: 100%;
  min-height: 76px;
  border: 1px solid #2d2d34;
  border-radius: 8px;
  padding: 14px;
  background: linear-gradient(180deg, #17171b, #111113);
}

.finance .value {
  margin-top: 7px;
  font-size: 20px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.finance.good .value {
  color: var(--success);
}

.finance.warn .value {
  color: var(--warning);
}

.thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.thumb {
  overflow: hidden;
  border: 1px solid #2d2d34;
  border-radius: 8px;
  background: #101014;
}

.thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #050506;
}

.thumb div {
  padding: 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.thumb .thumb-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  font-weight: 400;
}

.thumb-caption-name {
  min-width: 0;
  overflow-wrap: anywhere;
}

.evidence-photo-open-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid rgba(57, 185, 255, .72);
  border-radius: 6px;
  color: #39b9ff;
  background: rgba(20, 124, 196, .14);
  text-decoration: none;
  transition: color .18s ease, background-color .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.evidence-photo-open-link svg {
  width: 16px;
  height: 16px;
}

.evidence-photo-open-link:hover {
  color: #8cddff;
  border-color: #57c9ff;
  background: rgba(30, 157, 225, .22);
  box-shadow: 0 0 0 1px rgba(57, 185, 255, .12), 0 0 12px rgba(30, 157, 225, .16);
}

.evidence-photo-open-link:focus-visible {
  outline: 2px solid #57d7ff;
  outline-offset: 2px;
}

.progress {
  overflow: hidden;
  height: 12px;
  margin-top: 14px;
  border-radius: 999px;
  background: #09090b;
  border: 1px solid #2d2d34;
}

.progress span {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--orange), var(--pink));
  transition: width .25s ease;
}

.damage-list {
  display: grid;
  gap: 12px;
}

.damage {
  border: 1px solid #2d2d34;
  border-left: 4px solid var(--orange);
  border-radius: 8px;
  padding: 14px;
  background: #101014;
}

.damage h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.damage p,
.narrative p,
.report p {
  color: #d3d8e5;
  line-height: 1.48;
}

.table-wrap {
  overflow-x: auto;
  margin-top: 14px;
}

.budget-draft-toolbar,
.manual-budget-panel {
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid rgba(255, 106, 0, .42);
  border-radius: 8px;
  background: #11100f;
}

.budget-draft-toolbar {
  display: grid;
  gap: 12px;
}

.budget-draft-toolbar p,
.manual-budget-panel p {
  margin: 6px 0 0;
}

.budget-select-all {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(255, 106, 0, .45);
  border-radius: 8px;
  color: #ffd7a8;
  background: rgba(255, 106, 0, .07);
}

.budget-row-selected {
  background: rgba(255, 106, 0, .12);
}

.budget-row-selected td {
  border-bottom-color: rgba(255, 106, 0, .65);
}

.manual-budget-panel h3 {
  margin: 0;
  font-size: 16px;
}

input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--orange);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #101013;
}

th,
td {
  padding: 11px;
  border-bottom: 1px solid #2c2c31;
  text-align: left;
  vertical-align: top;
}

th {
  color: #ffd7a8;
  border-bottom: 0;
  font-size: 12px;
  text-transform: uppercase;
}

td small {
  color: var(--muted);
}

.badge {
  display: inline-block;
  border: 1px solid rgba(255, 106, 0, .5);
  border-radius: 999px;
  padding: 4px 9px;
  color: #ffb16b;
  background: rgba(255, 106, 0, .08);
  font-size: 12px;
  font-weight: 900;
}

.badge.good {
  border-color: rgba(128, 226, 138, .5);
  color: var(--success);
  background: rgba(128, 226, 138, .08);
}

.badge.warn {
  border-color: rgba(255, 209, 102, .5);
  color: var(--warning);
  background: rgba(255, 209, 102, .08);
}

.badge.danger {
  border-color: rgba(255, 77, 109, .55);
  color: #ff9fb3;
  background: rgba(255, 77, 109, .08);
}

.report {
  display: grid;
  min-width: 0;
  max-width: 100%;
  gap: 14px;
  margin-top: 14px;
}

.chat-messages {
  display: grid;
  gap: 10px;
  max-height: 52vh;
  min-height: 280px;
  overflow: auto;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid #2d2d34;
  border-radius: 8px;
  background: #08080a;
}

.chat-message {
  max-width: min(820px, 92%);
  border: 1px solid #31313a;
  border-radius: 8px;
  padding: 11px 13px;
  background: #16161b;
}

.chat-message.operator {
  justify-self: end;
  border-color: rgba(255, 106, 0, .55);
  background: #291406;
}

.chat-message.assistant { justify-self: start; }
.chat-message strong { color: #ffd7a8; }
.chat-message p { margin: 7px 0 0; line-height: 1.45; white-space: pre-wrap; }

.chat-compose {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 12px;
}

.chat-compose textarea { min-height: 72px; }
.chat-proposal { margin-top: 12px; }
.chat-change-preview { border: 1px solid rgba(255, 209, 102, .6); border-radius: 8px; padding: 14px; background: rgba(255, 209, 102, .06); }
.chat-change-preview strong { color: var(--warning); }
.chat-change-preview p, .chat-change-preview li { color: #e1e6f0; line-height: 1.45; }

/* Chat flutuante: o módulo deixa a navegação principal sem alterar sua lógica. */
.chat-float-panel {
  position: fixed;
  right: 24px;
  bottom: 88px;
  z-index: 60;
  width: min(700px, calc(100vw - 32px));
  max-height: min(76vh, 760px);
  filter: drop-shadow(0 18px 35px rgba(22, 24, 31, .28));
}

.chat-float-panel[hidden] { display: none !important; }
.chat-float-panel .panel { margin: 0; max-height: inherit; overflow: hidden; }
.chat-float-panel .panel-body { max-height: calc(min(76vh, 760px) - 60px); overflow: auto; }
.chat-panel-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.chat-close-btn {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.58);
  border-radius: 50%;
  color: #fff;
  background: rgba(0,0,0,.16);
  font: 900 24px/1 Arial, sans-serif;
  cursor: pointer;
}
.chat-close-btn:hover { background: rgba(0,0,0,.32); }
.chat-float-panel .chat-messages { min-height: 220px; max-height: 36vh; }
.chat-float-panel .chat-quick-actions { gap: 7px; }

.chat-launcher {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 61;
  display: inline-flex;
  min-height: 52px;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  border: 1px solid #a33d00;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, #ff7b14, #df4a00);
  box-shadow: 0 12px 25px rgba(198, 60, 0, .34);
  font: 800 13px/1 Arial, sans-serif;
  cursor: pointer;
}
.chat-launcher svg { width: 22px; height: 22px; fill: currentColor; }
.chat-launcher:hover { transform: translateY(-2px); box-shadow: 0 16px 28px rgba(198, 60, 0, .42); }
.chat-launcher:focus-visible, .chat-close-btn:focus-visible { outline: 3px solid rgba(255, 203, 117, .85); outline-offset: 3px; }

@media (max-width: 560px) {
  .chat-compose { grid-template-columns: 1fr; }
  .chat-float-panel { right: 12px; bottom: 74px; width: calc(100vw - 24px); max-height: 78vh; }
  .chat-float-panel .panel-body { max-height: calc(78vh - 56px); padding: 12px; }
  .chat-float-panel .chat-messages { min-height: 190px; max-height: 35vh; }
  .chat-launcher { right: 12px; bottom: 14px; min-height: 48px; padding: 0 14px; }
}

.report-section,
.narrative {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid #2d2d34;
  border-radius: 8px;
  padding: 16px;
  background: #111114;
}

.report-section h3 {
  margin: 0 0 12px;
  color: #ffd7a8;
}

.report-section p,
.narrative p {
  overflow-wrap: anywhere;
  word-break: normal;
}

.ghost-link {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 106, 0, .55);
  border-radius: 8px;
  padding: 10px 16px;
  color: #ffb16b;
  background: rgba(255, 106, 0, .075);
  font-weight: 900;
  text-decoration: none;
}

.location-actions {
  margin: 14px 0;
}

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

.location-media figure {
  overflow: hidden;
  margin: 0;
  border: 1px solid #2f2f36;
  border-radius: 8px;
  background: #08080a;
}

.location-media img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #050506;
}

.location-media figcaption,
.muted-note {
  margin: 0;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.croqui-card {
  margin-top: 14px;
  border: 1px solid rgba(255, 106, 0, .35);
  border-radius: 8px;
  padding: 12px;
  background: #0d0d10;
}

.croqui-card h4 {
  margin: 0 0 10px;
  color: #ffd7a8;
}

.croqui-card p {
  margin: 10px 0 0;
  color: #d8deeb;
}

.croqui-svg {
  display: block;
  width: 100%;
  max-height: 420px;
  border-radius: 8px;
  background: #0b0b0d;
}

.croqui-card-premium {
  background: #080d10;
}

.croqui-technical-state {
  margin-top: 10px;
  border-left: 3px solid #ff6a00;
  padding: 8px 10px;
  background: rgba(255, 255, 255, .035);
}

.croqui-technical-state p {
  margin: 4px 0;
  font-size: 12px;
}

.croqui-rendered {
  width: 100%;
  aspect-ratio: 16 / 10;
  max-height: 720px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
  background: #0b0f12;
}

.croqui-rendered svg,
.croqui-rendered-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.croqui-layered-scene {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
  background: #111;
}

.croqui-layered-map,
.croqui-layered-overlay {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.croqui-layered-map {
  object-fit: cover;
}

.croqui-layered-map.missing {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 800;
}

.croqui-layered-overlay {
  pointer-events: none;
}

.croqui-premium-bitmap {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
  background: #111;
}

.budget-parts-table th:last-child,
.budget-parts-table td:last-child {
  min-width: 170px;
  max-width: 210px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.operational-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(105px, 1fr));
  gap: 7px 12px;
  min-width: 230px;
}

.operational-summary span {
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-bottom: 1px solid rgba(255, 255, 255, .09);
  padding-bottom: 5px;
}

.operational-summary small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.operational-summary b { line-height: 1.3; }

.croqui-premium-pending {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(255, 106, 0, .28);
  border-radius: 8px;
  padding: 14px;
  background: #0b0b0d;
}

.croqui-premium-pending strong {
  color: #ffd7a8;
}

.croqui-premium-pending span {
  color: var(--muted);
  line-height: 1.5;
}

.croqui-premium-pending details {
  color: #d8deeb;
}

pre {
  overflow: auto;
  max-height: 66vh;
  margin-top: 14px;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 14px;
  color: #e8edf7;
  background: #050506;
}

@media (max-width: 980px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .status-strip,
  .form-grid,
  .form-grid.compact {
    grid-template-columns: 1fr;
  }

  .tabs {
    padding-left: 0;
  }
}

/* Tema operacional escuro: substitui a camada clara residual e elimina a acao laranja. */
:root {
  --bg: #080d14;
  --panel: #111925;
  --panel-soft: #152132;
  --card: #172334;
  --border: #2d4056;
  --line: #31465f;
  --text: #eaf2ff;
  --muted: #aebed0;
  --orange: #39b9ff;
  --orange-2: #1977ca;
}
html, body, body { background: #080d14; color: var(--text); }
body { background: radial-gradient(circle at top right, rgba(57,185,255,.10), transparent 30%), linear-gradient(180deg,#080d14 0%,#0c1420 100%); }
.panel, .panel-body, .metric, .card, .finance, .thumb, .damage, .report-section, .narrative,
.budget-draft-toolbar, .manual-budget-panel, .croqui-card, .enriched-budget-item, .piece-technical-section,
.enriched-metadata-card, .parts-quote-block, .chat-messages, .chat-message, .chat-message.operator,
table, .croqui-automatic-panel .mini-grid > span {
  color: var(--text) !important;
  background: #111b28 !important;
  border-color: var(--border) !important;
}
.metric, .card, .finance, .parts-quote-block { background: linear-gradient(180deg,#182536,#101a27) !important; }
.panel-title { color: #eff8ff !important; }
.panel-body, label, .damage p, .narrative p, .report p, .croqui-card p, .chat-message p,
.metric small, .card small, .finance small, .thumb div, td small, .location-media figcaption, .muted-note,
.croqui-automatic-panel .mini-grid strong, .croqui-automatic-panel .mini-grid b { color: var(--muted) !important; }
.finance, .finance small, .finance strong, .finance .value, .finance.good .value, .finance.warn .value { color: #eff8ff !important; }
.report-section h3, .croqui-card h4, .parts-quote-block h3 { color: #83d6ff !important; }
input, textarea, select { color: #edf6ff !important; background: #0c1520 !important; border-color: #38536f !important; }
input:focus, textarea:focus, select:focus { border-color: #39b9ff !important; background: #101d2a !important; }
.ghost-btn, .ghost-link, .run-btn, .upload-btn, .previa-btn {
  color: #eaf7ff !important;
  border: 1px solid rgba(76, 190, 255, .72) !important;
  background: linear-gradient(135deg,#147cc4,#245a9a) !important;
  box-shadow: 0 7px 16px rgba(17, 121, 194, .20) !important;
}
.ghost-btn:hover, .ghost-link:hover, .run-btn:hover, .upload-btn:hover { background: linear-gradient(135deg,#2398e2,#2e6bb1) !important; }
.ghost-btn.danger { color: #ffdce2 !important; border-color: #b73e59 !important; background: linear-gradient(135deg,#85263d,#5d1e31) !important; }
.budget-select-all, .badge { color: #bfe9ff !important; background: #123149 !important; }
.budget-row-selected, tbody tr:hover { background: #18334c !important; }
th { color: #bfe9ff !important; background: #142537 !important; }
tbody tr:nth-child(even) { background: #101a27 !important; }

@media (max-width: 560px) {
  .workspace {
    padding: 12px;
  }

  .brand-logo {
    width: 58px;
    height: 58px;
  }

  .brand h1 {
    font-size: 23px;
  }

  .topbar-actions,
  .quick-row {
    width: 100%;
  }

  .run-btn,
  .upload-btn,
  .ghost-btn,
  .ghost-link {
    width: 100%;
  }

  .location-media {
    grid-template-columns: 1fr;
  }
}
/* =========================================================
   ZYNTRA — Scroll horizontal premium nas abas
========================================================= */

.tabs {
  display: flex !important;
  align-items: stretch !important;
  gap: 0 !important;

  width: 100% !important;
  max-width: 100% !important;

  overflow-x: auto !important;
  overflow-y: hidden !important;

  white-space: nowrap !important;
  scroll-behavior: smooth !important;
  scrollbar-width: thin !important;
  scrollbar-color: rgba(255,106,0,.85) rgba(255,255,255,.08) !important;

  -webkit-overflow-scrolling: touch !important;
}

.tabs::-webkit-scrollbar {
  height: 8px !important;
}

.tabs::-webkit-scrollbar-track {
  background: rgba(255,255,255,.08) !important;
  border-radius: 999px !important;
}

.tabs::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg,#ff6a00,#e34a00) !important;
  border-radius: 999px !important;
  box-shadow: 0 0 12px rgba(255,106,0,.45) !important;
}

.tabs::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(90deg,#ff8a00,#ff4a00) !important;
}

.tabs .tab {
  flex: 0 0 auto !important;
  min-width: max-content !important;
}

/* ===========================================================
   ZYNTRA PREMIUM TABBAR V2
=========================================================== */

.tabs{

    position:relative;

    display:flex;
    align-items:center;

    gap:12px;

    padding:0 24px;

    overflow-x:auto;
    overflow-y:hidden;

    white-space:nowrap;

    scroll-behavior:smooth;

    scrollbar-width:none;

    -ms-overflow-style:none;

    -webkit-overflow-scrolling:touch;

}

.tabs::-webkit-scrollbar{

    display:none;

}

.tabs::before{

    content:"";

    position:sticky;

    left:0;

    width:40px;

    min-width:40px;

    height:100%;

    background:linear-gradient(90deg,#0a0b12 20%,transparent);

    pointer-events:none;

    z-index:5;

}

.tabs::after{

    content:"";

    position:sticky;

    right:0;

    width:40px;

    min-width:40px;

    height:100%;

    margin-left:auto;

    background:linear-gradient(-90deg,#0a0b12 20%,transparent);

    pointer-events:none;

    z-index:5;

}

.tab{

    flex:0 0 auto;

    min-width:max-content;

    padding:15px 22px;

    border-radius:12px;

    transition:.25s;

}

.tab:hover{

    transform:translateY(-2px);

    box-shadow:0 0 16px rgba(255,106,0,.18);

}

.tab.active{

    box-shadow:

    0 0 18px rgba(255,106,0,.25);

}


/* =========================================================
   ZYNTRA — Inputs sem negrito + labels destacados
========================================================= */

input,
select,
textarea {
  font-weight: 500 !important;
}

input::placeholder,
textarea::placeholder {
  font-weight: 500 !important;
  opacity: .72;
}

label,
.form-group label,
.field label,
.input-label {
  font-weight: 800 !important;
}

input[type="date"] {
  cursor: pointer;
}

input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  filter: invert(58%) sepia(98%) saturate(1800%) hue-rotate(2deg) brightness(105%);
  opacity: 1;
}

.vision-diagnostics {
  display: grid;
  gap: 12px;
}

.vision-diagnostics-danger {
  border: 1px solid rgba(255, 77, 109, .45);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 77, 109, .08);
}

.vision-alert {
  margin: 0;
  color: #ffb3c0;
  font-weight: 800;
}

.enriched-budget-section {
  margin-top: 18px;
}

.enriched-budget-list {
  display: grid;
  gap: 10px;
}

.enriched-budget-item {
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 10px;
  background: rgba(255, 255, 255, .035);
  overflow: hidden;
}

.enriched-budget-heading,
.enriched-budget-item summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  cursor: pointer;
}

.enriched-budget-heading strong,
.enriched-budget-item summary strong {
  flex: 1 1 280px;
}

.enriched-budget-heading {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.piece-technical-narrative {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
}

.piece-technical-section {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 8px;
  background: rgba(0, 0, 0, .12);
}

.piece-technical-section h4,
.piece-technical-section p {
  margin: 0;
}

.piece-technical-section p + p {
  margin-top: 7px;
}

.piece-technical-section p {
  overflow-wrap: anywhere;
}

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

.enriched-raw-data > summary {
  border-top: 1px solid rgba(255, 255, 255, .1);
}

.enriched-budget-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
  padding: 0 12px 12px;
}

.enriched-metadata-card {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 8px;
  background: rgba(0, 0, 0, .16);
}

.enriched-metadata-card p,
.enriched-metadata-card ul {
  margin: 8px 0 0;
}

.enriched-metadata-card pre {
  max-height: 320px;
  margin: 8px 0 0;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.enriched-metadata-card a {
  color: var(--accent, #ffc247);
  overflow-wrap: anywhere;
}

/* Mantem as tabelas extensas dentro da largura visivel do painel. */
#budgetTables,
#deliveryReport,
#budgetTables .table-wrap,
#deliveryReport .table-wrap {
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

#budgetTables .table-wrap,
#deliveryReport .table-wrap {
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-gutter: stable;
  overscroll-behavior-inline: contain;
}

#budgetTables table,
#deliveryReport table {
  width: 100%;
  max-width: 100%;
  table-layout: fixed;
}

#budgetTables th,
#budgetTables td,
#deliveryReport th,
#deliveryReport td {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
}

#budgetTables th,
#deliveryReport th {
  padding-inline: 7px;
  font-size: 11px;
}

#budgetTables td,
#deliveryReport td {
  padding-inline: 7px;
  font-size: 14px;
}

#budgetTables th:first-child,
#budgetTables td:first-child {
  width: 34px;
  padding-inline: 5px;
}

.outside-notice-damages table {
  width: 100%;
  table-layout: fixed;
}

.outside-notice-damages th:nth-child(1), .outside-notice-damages td:nth-child(1) { width: 22%; }
.outside-notice-damages th:nth-child(2), .outside-notice-damages td:nth-child(2) { width: 25%; }
.outside-notice-damages th:nth-child(3), .outside-notice-damages td:nth-child(3) { width: 5%; white-space: nowrap; }
.outside-notice-damages th:nth-child(4), .outside-notice-damages td:nth-child(4) { width: 23%; }
.outside-notice-damages th:nth-child(5), .outside-notice-damages td:nth-child(5) { width: 25%; }
.outside-notice-damages td {
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
  vertical-align: top;
}

@media (max-width: 980px) {
  #budgetTables table,
  #deliveryReport table {
    min-width: 920px;
    table-layout: auto;
  }
}

/* =========================================================
   Tema claro do conteudo: barras do produto e conversas tecnicas continuam
   escuras; formularios mantem os campos escuros para preservar o fluxo atual.
========================================================= */
:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --card: #ffffff;
  --border: #d7dde5;
  --line: #e1e6ed;
  --text: #151a22;
  --muted: #5f6b7a;
}

html, body { background: #f4f6f8; color: #151a22; }
body {
  background: radial-gradient(circle at top right, rgba(255,106,0,.08), transparent 28%), linear-gradient(180deg,#fff 0%,#f3f5f8 100%);
}

/* Topbar, status e navegacao preservam o visual escuro. */
.topbar, .status-strip, .status-strip > div, .tabs { color: #fff; }

/* Continuidade visual: a faixa superior acompanha o gradiente da barra de status. */
.topbar {
  background: linear-gradient(90deg, #050505 0%, #17120f 34%, #777a7d 66%, #f6f8fb 100%);
}

/* Barra operacional: escura sob a marca e progressivamente clara à direita. */
.status-strip {
  gap: 1px;
  border-bottom-color: #cbd3dd;
  background: linear-gradient(90deg, #080808 0%, #17120f 29%, #777a7d 62%, #f6f8fb 100%);
}
.status-strip > div {
  background: transparent;
  border-right: 1px solid rgba(255, 255, 255, .24);
}
.status-strip > div:nth-child(1) small,
.status-strip > div:nth-child(2) small { color: #cbd5e1; }
.status-strip > div:nth-child(1) strong,
.status-strip > div:nth-child(2) strong { color: #fff; }
.status-strip > div:nth-child(3) small { color: #29313a; }
.status-strip > div:nth-child(3) strong { color: #151a22; }
.status-strip > div:nth-child(4) small { color: #475569; }
.status-strip > div:nth-child(4) strong { color: #111827; }

.panel {
  background: #fff;
  border-color: #d7dde5;
  box-shadow: 0 14px 32px rgba(28,39,56,.12);
}
.panel-title { color: #fff; }
.panel-body, label { color: #1f2937; }

/* Caixas de edicao claras, com contraste de leitura operacional. */
input, textarea, select {
  color: #161b22;
  background: #e7ebf0;
  border-color: #b9c2cd;
}
input::placeholder, textarea::placeholder { color: #657180; }
input:focus, textarea:focus, select:focus {
  border-color: #e35b00;
  background: #f5f7fa;
}

.upload-zone { color: #151a22; background: #fff8f2; }
.upload-zone span { color: #5f6b7a; }

.metric, .card, .finance, .thumb, .damage, .report-section, .narrative,
.budget-draft-toolbar, .manual-budget-panel, .croqui-card, .enriched-budget-item,
.piece-technical-section, .enriched-metadata-card {
  color: #151a22;
  background: #fff;
  border-color: #d7dde5;
}
.metric, .card, .finance { background: linear-gradient(180deg,#fff,#f7f9fc); }
.metric small, .card small, .finance small, .thumb div, td small,
.location-media figcaption, .muted-note { color: #5f6b7a; }

/* Cards financeiros compactos e neutros: valor sempre em preto. */
.metric,
.card,
.finance {
  min-height: 61px;
  padding: 11px;
}
.finance .value,
.finance.good .value,
.finance.warn .value {
  color: #000;
  font-size: 16px;
}

/* Totais: a cor comunica apenas legibilidade; não diferencia valores por status. */
.finance,
.finance small,
.finance strong,
.finance .value,
.finance.good .value,
.finance.warn .value {
  color: #000 !important;
}

/* KPIs: contrato por caso e disponibilidade das métricas do motor. */
.kpi-contract-notice {
  margin-top: 14px;
  padding: 11px 13px;
  color: #155f2a;
  background: #effaf1;
  border: 1px solid #b9dfbf;
  border-radius: 8px;
  font-weight: 750;
  line-height: 1.4;
}

.kpi-contract-notice.is-warning {
  color: #8a4a00;
  background: #fff8e9;
  border-color: #f0cd87;
}

.kpi-availability-grid .card { min-height: 56px; }
.kpi-availability-grid .card:nth-child(1) { border-top: 3px solid #2d8a45; }
.kpi-availability-grid .card:nth-child(2) { border-top: 3px solid #4f86c6; }
.kpi-availability-grid .card:nth-child(3) { border-top: 3px solid #d98b00; }
.kpi-availability-grid .card:nth-child(4) { border-top: 3px solid #8b96a5; }

.kpi-snapshot-list { margin-top: 18px; }
.kpi-snapshot-list h3 { margin: 0 0 4px; color: #a53a00; }
.kpi-snapshot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(330px, 100%), 1fr));
  gap: 12px;
  margin-top: 12px;
}
.kpi-snapshot-card {
  min-width: 0;
  padding: 13px;
  color: #151a22;
  background: linear-gradient(180deg, #fff, #f7f9fc);
  border: 1px solid #d7dde5;
  border-radius: 8px;
}
.kpi-snapshot-card header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.kpi-snapshot-card header strong { overflow-wrap: anywhere; }
.kpi-snapshot-card header span {
  flex: 0 0 auto;
  padding: 3px 7px;
  color: #5a3700;
  background: #fff1d9;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
}
.kpi-snapshot-card > small { display: block; margin-top: 5px; color: #5f6b7a; }
.kpi-snapshot-metrics { display: grid; gap: 5px; margin-top: 11px; }
.kpi-metric-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  padding-top: 5px;
  border-top: 1px solid #e5e9ee;
  font-size: 12px;
}
.kpi-metric-line span { color: #4b5563; }
.kpi-metric-line strong { color: #000; }
.kpi-availability {
  padding: 2px 5px;
  border-radius: 999px;
  font-size: 9px;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}
.kpi-status-calculado { color: #146b2e; background: #e7f7e9; }
.kpi-status-zero_confirmado { color: #185b9d; background: #e7f0fb; }
.kpi-status-pendente { color: #875000; background: #fff0d4; }
.kpi-status-indisponivel { color: #5a6674; background: #e8edf2; }
.damage p, .narrative p, .report p, .croqui-card p,
.chat-change-preview p, .chat-change-preview li { color: #374151; }
.report-section h3, .croqui-card h4 { color: #a53a00; }
.budget-draft-toolbar, .manual-budget-panel { background: #fffaf5; }
.budget-select-all, .badge { color: #9b3900; background: #fff3e8; }
.budget-row-selected, tbody tr:hover { background: #fff0e4; }

.croqui-automatic-panel {
  display: grid;
  gap: 10px;
}
.croqui-automatic-panel .mini-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}
.croqui-automatic-panel .mini-grid > span {
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  border: 1px solid #d7dde5;
  border-radius: 6px;
  background: #f5f7fa;
}
.croqui-automatic-panel .mini-grid strong {
  color: #475569;
  font-size: 11px;
  text-transform: uppercase;
}
.croqui-automatic-panel .mini-grid b {
  color: #151a22;
  font-size: 12px;
  overflow-wrap: anywhere;
}

/* Acoes em fundo claro usam laranja cheio, texto branco e profundidade. */
.ghost-btn,
.ghost-link {
  color: #151a22;
  border-color: #e34a00;
  background: linear-gradient(135deg, #ff7800, #e34a00);
  box-shadow: 0 9px 18px rgba(227, 74, 0, .26);
}
.ghost-btn:hover,
.ghost-link:hover {
  color: #151a22;
  filter: brightness(1.08);
  box-shadow: 0 12px 22px rgba(227, 74, 0, .34);
}
.ghost-btn.danger {
  color: #fff;
  border-color: #d9294d;
  background: linear-gradient(135deg, #ff5b78, #d9294d);
  box-shadow: 0 9px 18px rgba(217, 41, 77, .22);
}

/* Acoes internas mais compactas: cerca de 30% menores que as do cabeçalho. */
.panel-body .run-btn,
.panel-body .upload-btn,
.panel-body .ghost-btn,
.panel-body .ghost-link {
  min-height: 30px;
  padding: 6px 11px;
  border-radius: 6px;
  font-size: 12px;
  box-shadow: 0 6px 13px rgba(227, 74, 0, .20);
}
.panel-body .ghost-btn.danger {
  box-shadow: 0 6px 13px rgba(217, 41, 77, .18);
}

/* Cabeçalho mais enxuto; a analise direta permanece disponivel no codigo,
   mas nao faz parte da navegacao visual principal. */
.topbar-actions { gap: 8px; }
.topbar-actions .run-btn,
.topbar-actions .upload-btn,
.topbar-actions .ghost-btn {
  min-height: 30px;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  box-shadow: 0 6px 13px rgba(227, 74, 0, .20);
}
#runDirectBtn { display: none; }

table { color: #151a22; background: #fff; }
th, td { border-bottom-color: #e1e6ed; }
th { color: #8c3300; background: #fff7f0; }
tbody tr:nth-child(even) { background: #fafbfd; }

/* Conversas, JSON e evidencias tecnicas mantem o contraste escuro. */
.chat-messages, .chat-message, .chat-message.operator, pre, .croqui-svg,
.croqui-rendered, .croqui-layered-scene, .croqui-premium-bitmap,
.croqui-premium-pending { color: #fff; }

/* Conversa clara: separa a area operacional do JSON/evidencias tecnicas. */
.chat-messages {
  background: #ffffff;
  border-color: #d7dde5;
}
.chat-message {
  color: #151a22;
  background: #eef1f5;
  border-color: #c9d1db;
}
.chat-message.operator {
  color: #151a22;
  background: #fff0e4;
  border-color: #f0ae7d;
}
.chat-message strong { color: #9b3900; }
.chat-message p { color: #151a22; }
.tabs::before { background: linear-gradient(90deg,#070707 20%,transparent); }
.tabs::after { background: linear-gradient(-90deg,#070707 20%,transparent); }

/* Consulta OEM: módulo visual isolado do orçamento da vistoria. */
.parts-quote-panel .panel-body {
  display: grid;
  gap: 16px;
}

.parts-quote-block {
  min-width: 0;
  border: 1px solid #d7dde5;
  border-radius: 10px;
  padding: 14px;
  background: linear-gradient(180deg, #fff, #f8fafc);
  box-shadow: 0 8px 20px rgba(28, 39, 56, .08);
}

.parts-quote-block h3 {
  margin: 0 0 12px;
  color: #8c3300;
}

.parts-quote-identify {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.parts-search-grid {
  grid-template-columns: minmax(240px, 1fr) auto minmax(220px, 1fr) auto;
  align-items: end;
}

.parts-search-action {
  display: flex;
  align-items: end;
  min-height: 61px;
}

.parts-search-results,
.parts-quote-items {
  margin-top: 12px;
  min-width: 0;
}

.parts-quote-table small {
  display: block;
  margin-top: 4px;
}

.parts-quote-table input,
.parts-quote-table select {
  min-width: 78px;
  padding: 6px 7px;
  font-size: 12px;
}

.parts-quote-table select[data-parts-field="status"] {
  display: block;
  width: 100%;
  margin-top: 7px;
}

#partsVehicleStatus[data-tone="success"] { color: #187a2f; }
#partsVehicleStatus[data-tone="warning"] { color: #9a5b00; }
#partsVehicleStatus[data-tone="danger"] { color: #b4233f; }

@media (max-width: 980px) {
  .parts-quote-identify,
  .parts-search-grid {
    grid-template-columns: 1fr;
  }
  .parts-search-action {
    min-height: auto;
  }
  .parts-quote-table {
    min-width: 980px;
  }
}

/* Tema operacional escuro: regra final para neutralizar a camada clara residual. */
:root { --bg:#080d14; --panel:#111925; --panel-soft:#152132; --card:#172334; --border:#2d4056; --line:#31465f; --text:#eaf2ff; --muted:#aebed0; --orange:#39b9ff; --orange-2:#1977ca; }
html, body { background:#080d14; color:var(--text); }
body { background:radial-gradient(circle at top right,rgba(57,185,255,.10),transparent 30%),linear-gradient(180deg,#080d14 0%,#0c1420 100%); }
.panel, .panel-body, .metric, .card, .finance, .thumb, .damage, .report-section, .narrative, .budget-draft-toolbar, .manual-budget-panel, .croqui-card, .enriched-budget-item, .piece-technical-section, .enriched-metadata-card, .parts-quote-block, .chat-messages, .chat-message, .chat-message.operator, table, .croqui-automatic-panel .mini-grid > span { color:var(--text)!important; background:#111b28!important; border-color:var(--border)!important; }
.metric, .card, .finance, .parts-quote-block { background:linear-gradient(180deg,#182536,#101a27)!important; }
.panel-title { color:#eff8ff!important; }
.panel-body, label, .damage p, .narrative p, .report p, .croqui-card p, .chat-message p, .metric small, .card small, .finance small, .thumb div, td small, .location-media figcaption, .muted-note, .croqui-automatic-panel .mini-grid strong, .croqui-automatic-panel .mini-grid b { color:var(--muted)!important; }
.finance, .finance small, .finance strong, .finance .value, .finance.good .value, .finance.warn .value { color:#eff8ff!important; }
.report-section h3, .croqui-card h4, .parts-quote-block h3 { color:#83d6ff!important; }
input, textarea, select { color:#edf6ff!important; background:#0c1520!important; border-color:#38536f!important; }
input:focus, textarea:focus, select:focus { border-color:#39b9ff!important; background:#101d2a!important; }
.ghost-btn, .ghost-link, .run-btn, .upload-btn, .previa-btn { color:#eaf7ff!important; border:1px solid rgba(76,190,255,.72)!important; background:linear-gradient(135deg,#147cc4,#245a9a)!important; box-shadow:0 7px 16px rgba(17,121,194,.20)!important; }
.ghost-btn:hover, .ghost-link:hover, .run-btn:hover, .upload-btn:hover { background:linear-gradient(135deg,#2398e2,#2e6bb1)!important; }
.ghost-btn.danger { color:#ffdce2!important; border-color:#b73e59!important; background:linear-gradient(135deg,#85263d,#5d1e31)!important; }
.budget-select-all, .badge { color:#bfe9ff!important; background:#123149!important; }
.budget-row-selected, tbody tr:hover { background:#18334c!important; }
th { color:#bfe9ff!important; background:#142537!important; }
tbody tr:nth-child(even) { background:#101a27!important; }

/* Campo de item manual: evita autofill de credenciais e mantém o tema operacional. */
#manualBudgetDescription { color:var(--text); background:#111b28; border-color:var(--border); }
#manualBudgetDescription:-webkit-autofill, #manualBudgetDescription:-webkit-autofill:hover, #manualBudgetDescription:-webkit-autofill:focus { -webkit-text-fill-color:var(--text); -webkit-box-shadow:0 0 0 1000px #111b28 inset; box-shadow:0 0 0 1000px #111b28 inset; caret-color:var(--text); transition:background-color 9999s ease-out 0s; }

/* Dialogos de revisão: substituem os prompts do navegador e preservam a marca do app. */
.zyntra-dialog-overlay { position:fixed; inset:0; z-index:9999; display:grid; place-items:center; padding:20px; background:rgba(2,7,14,.72); }
.zyntra-dialog { width:min(460px,100%); display:grid; gap:16px; padding:22px; border:1px solid #42617f; border-radius:12px; color:var(--text); background:linear-gradient(180deg,#172637,#0e1825); box-shadow:0 22px 65px rgba(0,0,0,.55); }
.zyntra-dialog-brand { color:#83d6ff; font-weight:800; font-size:15px; letter-spacing:.04em; }
.zyntra-dialog label { display:grid; gap:8px; color:var(--text); font-weight:650; }
.zyntra-dialog-input { width:100%; box-sizing:border-box; min-height:42px; }
.zyntra-dialog-actions { display:flex; justify-content:flex-end; gap:10px; }
/* Cartões de anexos que não são imagens. */
.document-thumb-content { display:flex; min-height:96px; align-items:flex-start; gap:10px; }
.document-thumb-icon { display:grid; flex:0 0 32px; width:32px; height:32px; place-items:center; border:1px solid rgba(57,185,255,.35); border-radius:8px; color:#83d6ff; background:rgba(57,185,255,.09); }
.document-thumb-icon svg { width:18px; height:18px; }
.document-thumb-content > span:last-child { min-width:0; overflow-wrap:anywhere; }

/* Árvores usadas somente na consulta manual de peças. */
.parts-catalog-tree { margin:12px 0 14px; padding:13px; border:1px solid #31506c; border-radius:10px; background:linear-gradient(180deg,rgba(22,39,56,.96),rgba(12,24,36,.96)); }
.parts-catalog-tree-heading { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:8px; color:#dff4ff; }
.parts-catalog-tree-heading span { font-weight:400; }
.parts-catalog-tree-heading span:last-child { padding:3px 8px; border:1px solid rgba(57,185,255,.42); border-radius:999px; color:#83d6ff; background:rgba(57,185,255,.08); }
.parts-catalog-tree > p { margin:7px 0 10px; color:var(--muted); font-size:12px; }
.parts-catalog-tree-list, .parts-catalog-tree-list ul { margin:0; padding:0; list-style:none; }
.parts-catalog-tree-node { position:relative; display:grid; grid-template-columns:18px minmax(0,1fr) auto; gap:8px; align-items:center; min-height:42px; padding:7px 8px; border:1px solid rgba(89,123,154,.34); border-radius:8px; color:var(--text); background:rgba(7,16,25,.44); }
.parts-catalog-tree-node + .parts-catalog-tree-node { margin-top:6px; }
.parts-catalog-tree-node > ul { grid-column:2 / -1; margin-top:4px; padding-left:17px; border-left:1px solid rgba(57,185,255,.34); }
.parts-catalog-tree-node > ul > .parts-catalog-tree-node::before { content:""; position:absolute; left:-18px; top:21px; width:16px; border-top:1px solid rgba(57,185,255,.34); }
.parts-catalog-tree-dot { width:10px; height:10px; border:2px solid #39b9ff; border-radius:50%; box-shadow:0 0 0 3px rgba(57,185,255,.10); }
.parts-catalog-tree-node.is-root > .parts-catalog-tree-dot,
.parts-catalog-tree-node.is-group > .parts-catalog-tree-dot { width:12px; height:12px; background:#39b9ff; box-shadow:0 0 12px rgba(57,185,255,.42); }
.parts-catalog-tree-node.is-subgroup > .parts-catalog-tree-dot { border-color:#83d6ff; }
.parts-catalog-tree-node.is-unavailable > .parts-catalog-tree-dot { border-color:#75869a; box-shadow:none; }
.parts-catalog-tree-copy { display:grid; min-width:0; gap:2px; font-weight:400; }
.parts-catalog-tree-copy small { color:var(--muted); font-weight:400; }
.parts-catalog-tree-add { min-height:27px!important; padding:4px 8px!important; font-size:11px!important; font-weight:400!important; }
.parts-catalog-tree-warning { color:#f5bf72!important; }

@media (max-width:700px) {
  .parts-catalog-tree-node { grid-template-columns:16px minmax(0,1fr); }
  .parts-catalog-tree-add { grid-column:2; justify-self:start; }
  .parts-catalog-tree-node > ul { grid-column:1 / -1; margin-left:8px; }
}
