/* =========================================================================
   AutoQuant — folha de estilo única (sem build step)
   -------------------------------------------------------------------------
   REGRA DESTE ARQUIVO: nenhum componente usa cor/fonte "solta" (hex ou rgba
   literal). Tudo vem dos tokens de :root / html.light-theme abaixo. Quando a
   identidade visual definitiva chegar, troca-se SÓ o bloco de tokens — nenhum
   seletor de componente precisa ser reescrito.
   ========================================================================= */

/* =========================================================================
   RESET
   ========================================================================= */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, select { font: inherit; color: inherit; }
a { color: inherit; }
ul, ol { list-style: none; }
svg { display: block; }
::selection { background: var(--selection); }

/* =========================================================================
   DESIGN TOKENS
   ========================================================================= */
:root {
  /* superfícies */
  --bg-base: #090B11;
  --bg-elevated: #12151C;
  --bg-card: rgba(22, 26, 32, 0.62);
  --bg-input: rgba(255, 255, 255, 0.035);
  --row-alt: rgba(255, 255, 255, 0.015);

  /* bordas */
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.16);

  /* marca */
  --primary: #00E0DD;
  --primary-dark: #00A8A5;
  --primary-soft: rgba(0, 224, 221, 0.12);
  --primary-border: rgba(0, 224, 221, 0.30);
  --on-primary: #062B2A;          /* texto sobre fundo --primary */
  --selection: rgba(0, 224, 221, 0.28);

  /* texto */
  --text-primary: #EAEBF1;
  --text-secondary: #8A91A8;
  --text-tertiary: #5A6178;

  /* semânticas */
  --success: #00D97F;
  --success-soft: rgba(0, 217, 127, 0.12);
  --warning: #FFB020;
  --warning-soft: rgba(255, 176, 32, 0.12);
  --danger: #FF4D4D;
  --danger-soft: rgba(255, 77, 77, 0.13);
  --danger-border: rgba(255, 77, 77, 0.35);

  /* brilhos de fundo da página */
  --glow-1: rgba(0, 224, 221, 0.05);
  --glow-2: rgba(0, 87, 92, 0.07);

  /* badges de categoria (classificação semântica) */
  --cat-default-bg: rgba(255, 255, 255, 0.035);
  --cat-default-fg: #8A91A8;
  --cat-comercial-bg: rgba(0, 224, 221, 0.12);
  --cat-comercial-fg: #00E0DD;
  --cat-hidraulica-bg: rgba(56, 152, 255, 0.14);
  --cat-hidraulica-fg: #6BB4FF;
  --cat-eletrica-bg: rgba(255, 176, 32, 0.12);
  --cat-eletrica-fg: #FFB020;
  --cat-estrutura-bg: rgba(168, 132, 255, 0.14);
  --cat-estrutura-fg: #B79BFF;
  --cat-arquitetura-bg: rgba(0, 217, 127, 0.12);
  --cat-arquitetura-fg: #00D97F;

  /* tipografia */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* forma */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --shadow-card: 0 20px 40px -24px rgba(0,0,0,.85), 0 8px 20px -14px rgba(0,120,120,.18), inset 0 1px 0 rgba(255,255,255,.06);
  --shadow-pop: 0 24px 48px -18px rgba(0,0,0,.65);

  /* layout */
  --sidebar-w: 76px;
  --content-max: 760px;
  --ease: cubic-bezier(.4,0,.2,1);
}

html.light-theme {
  --bg-base: #F5F7FA;
  --bg-elevated: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-input: #F3F5F8;
  --row-alt: rgba(11, 15, 23, 0.02);
  --border-subtle: #E6E9EF;
  --border-strong: #D3D8E2;
  --text-primary: #0B0F17;
  --text-secondary: #5B6272;
  --text-tertiary: #8B92A6;
  --primary-soft: rgba(0, 168, 165, 0.10);
  --primary-border: rgba(0, 168, 165, 0.35);
  --selection: rgba(0, 168, 165, 0.22);
  --success-soft: rgba(0, 150, 100, 0.10);
  --warning-soft: rgba(180, 120, 10, 0.10);
  --danger-soft: rgba(220, 38, 38, 0.08);
  --danger-border: rgba(220, 38, 38, 0.30);
  --glow-1: rgba(0, 224, 221, 0.06);
  --glow-2: rgba(0, 87, 92, 0.04);
  --cat-default-bg: #F3F5F8;
  --cat-default-fg: #5B6272;
  --cat-comercial-bg: rgba(0, 168, 165, 0.12);
  --cat-comercial-fg: #00807E;
  --cat-hidraulica-bg: rgba(56, 152, 255, 0.12);
  --cat-hidraulica-fg: #1E6FD9;
  --cat-eletrica-bg: rgba(180, 120, 10, 0.12);
  --cat-eletrica-fg: #A06B00;
  --cat-estrutura-bg: rgba(124, 77, 255, 0.12);
  --cat-estrutura-fg: #6B3FE0;
  --cat-arquitetura-bg: rgba(0, 150, 100, 0.12);
  --cat-arquitetura-fg: #00795A;
  --shadow-card: 0 16px 32px -20px rgba(20,30,50,.14), 0 4px 10px -6px rgba(20,30,50,.08), inset 0 1px 0 rgba(255,255,255,.7);
  --shadow-pop: 0 20px 40px -16px rgba(20,30,50,.22);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* =========================================================================
   BASE
   ========================================================================= */
body {
  font-family: var(--font-sans);
  background: var(--bg-base);
  background-image:
    radial-gradient(circle at 14% 8%, var(--glow-1) 0%, transparent 45%),
    radial-gradient(circle at 88% 78%, var(--glow-2) 0%, transparent 50%);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  transition: background-color .3s var(--ease), color .3s var(--ease);
}
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* =========================================================================
   SIDEBAR (desktop)
   ========================================================================= */
.sidebar {
  position: fixed;
  left: 0; top: 0;
  width: var(--sidebar-w);
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 0;
  gap: 6px;
  z-index: 60;
  background: var(--bg-elevated);
  border-right: 1px solid var(--border-subtle);
}
.logo-btn {
  width: 34px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  color: var(--primary);
  margin-bottom: 18px;
  transition: transform .18s var(--ease);
}
.logo-btn:hover { transform: scale(1.08); }
.logo-btn svg { width: 100%; height: 100%; }

.nav-rail { display: flex; flex-direction: column; gap: 6px; }
.nav-btn {
  position: relative;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px;
  color: var(--text-secondary);
  transition: background .16s var(--ease), color .16s var(--ease);
}
.nav-btn .icon { width: 20px; height: 20px; }
.nav-btn:hover { color: var(--text-primary); background: var(--border-subtle); }
.nav-btn.active { color: var(--primary); background: var(--primary-soft); }
.nav-btn.active::before {
  content: ""; position: absolute; left: -12px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 18px; border-radius: 3px; background: var(--primary);
}
.nav-tooltip {
  position: absolute; left: calc(100% + 12px); top: 50%; transform: translateY(-50%) translateX(-4px);
  background: var(--bg-elevated); border: 1px solid var(--border-strong);
  padding: 6px 10px; border-radius: 8px; font-size: .78rem; font-weight: 500;
  white-space: nowrap; box-shadow: var(--shadow-pop);
  opacity: 0; pointer-events: none; transition: opacity .14s var(--ease), transform .14s var(--ease);
}
.nav-btn:hover .nav-tooltip, .nav-btn:focus-visible .nav-tooltip { opacity: 1; transform: translateY(-50%) translateX(0); }

.sidebar-spacer { flex: 1; }
.sidebar-bottom { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.icon-btn {
  width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  border-radius: 10px; color: var(--text-secondary);
  transition: background .16s var(--ease), color .16s var(--ease);
}
.icon-btn:hover { color: var(--text-primary); background: var(--border-subtle); }
.icon-btn .icon { width: 19px; height: 19px; }

#theme-toggle { cursor: pointer; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--primary-soft); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 700;
  border: 1px solid var(--primary-border);
}

/* =========================================================================
   NAV MOBILE (só aparece < 768px — ver bloco responsivo no fim)
   ========================================================================= */
.mobile-nav { display: none; }

/* =========================================================================
   LAYOUT / CONTEÚDO
   ========================================================================= */
.content {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  padding: 56px 32px 80px;
  display: flex;
  justify-content: center;
}
.page { display: none; width: 100%; max-width: var(--content-max); }
.page.ativo { display: block; animation: pageIn .32s var(--ease); }
.page[data-page="historico"].ativo, .page[data-page="comparacao"].ativo { max-width: 880px; }
@keyframes pageIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.page-head { text-align: center; margin-bottom: 36px; }
.page-head h1 { font-size: 2.35rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; margin-bottom: 10px; }
.page-head .accent { color: var(--primary); }
.page-head p { color: var(--text-secondary); font-size: 1rem; }

.panel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 40px;
}
@media (max-width: 640px) { .panel { padding: 24px 20px; } .page-head h1 { font-size: 1.7rem; } }

/* =========================================================================
   DROPZONE
   ========================================================================= */
.dropzone {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 6px;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 52px 24px;
  cursor: pointer;
  transition: border-color .16s var(--ease), background .16s var(--ease);
}
.dropzone:hover, .dropzone.dragover { border-color: var(--primary); background: var(--primary-soft); }
.dropzone.invalid { border-color: var(--danger); background: var(--danger-soft); }
.dz-icon {
  width: 56px; height: 56px; border-radius: 16px;
  background: var(--primary-soft); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 8px;
}
.dz-icon .icon { width: 26px; height: 26px; }
.dz-text { font-weight: 600; font-size: 1rem; }
.dz-hint { color: var(--text-secondary); font-size: .85rem; }
.format-badges { display: flex; gap: 6px; margin-top: 10px; }
.format-badges span {
  font-family: var(--font-mono); font-size: .68rem; font-weight: 600; letter-spacing: .03em;
  padding: 3px 8px; border-radius: 6px;
  background: var(--bg-input); border: 1px solid var(--border-subtle); color: var(--text-secondary);
}
.dropzone-compact { padding: 32px 20px; }
.dropzone-compact .dz-icon { width: 44px; height: 44px; margin-bottom: 4px; }
.dropzone-compact .dz-icon .icon { width: 20px; height: 20px; }

.field-error { color: var(--danger); font-size: .82rem; margin-top: 10px; min-height: 1em; text-align: center; }
.field-hint { color: var(--text-secondary); font-size: .82rem; }
.field-hint.center { text-align: center; margin-top: 12px; }

/* =========================================================================
   CHIPS DE ARQUIVO
   ========================================================================= */
.file-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.file-chip {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--bg-input); border: 1px solid var(--border-subtle);
}
.file-chip-icon {
  width: 36px; height: 36px; border-radius: 9px; flex-shrink: 0;
  background: var(--primary-soft); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
}
.file-chip-icon .icon { width: 17px; height: 17px; }
.file-chip-info { flex: 1; min-width: 0; }
.file-chip-name { font-weight: 600; font-size: .9rem; word-break: break-word; overflow-wrap: break-word; max-width: 250px; line-height: 1.3; }
.file-chip-size { color: var(--text-secondary); font-size: .78rem; font-family: var(--font-mono); }
.file-chip-remove {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary); transition: background .14s var(--ease), color .14s var(--ease);
}
.file-chip-remove .icon { width: 15px; height: 15px; }
.file-chip-remove:hover { background: var(--danger-soft); color: var(--danger); }

.link-btn {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--primary); font-weight: 600; font-size: .85rem;
  padding: 6px 2px; margin-bottom: 18px;
}
.link-btn .icon { width: 15px; height: 15px; }
.link-btn:hover { text-decoration: underline; }

/* =========================================================================
   OPÇÕES AVANÇADAS (<details>)
   ========================================================================= */
.advanced { border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); margin-bottom: 22px; overflow: hidden; }
.advanced summary {
  cursor: pointer; padding: 12px 16px; font-size: .88rem; font-weight: 600;
  color: var(--text-secondary); list-style: none; display: flex; align-items: center; gap: 8px;
}
.advanced summary::-webkit-details-marker { display: none; }
.advanced summary::before {
  content: ""; width: 8px; height: 8px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg); transition: transform .16s var(--ease);
}
.advanced[open] summary::before { transform: rotate(45deg); }
.advanced-body { padding: 4px 16px 18px; display: flex; flex-direction: column; gap: 8px; }
.advanced-body label { font-size: .82rem; font-weight: 600; color: var(--text-primary); }
.advanced-body input {
  background: var(--bg-input); border: 1px solid var(--border-subtle); border-radius: 8px;
  padding: 9px 12px; width: 160px; max-width: 100%; color: var(--text-primary);
  transition: border-color .14s var(--ease);
}
.advanced-body input:focus { border-color: var(--primary); }

/* =========================================================================
   BOTÕES
   ========================================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 22px; border-radius: 10px; font-weight: 600; font-size: .92rem;
  transition: filter .14s var(--ease), background .14s var(--ease), border-color .14s var(--ease), transform .1s var(--ease);
}
.btn .icon { width: 17px; height: 17px; }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary:disabled { background: var(--border-strong); color: var(--text-tertiary); cursor: not-allowed; filter: none; }
.btn-ghost { background: transparent; border: 1px solid var(--border-subtle); color: var(--text-primary); }
.btn-ghost:hover { border-color: var(--border-strong); background: var(--bg-input); }
.btn-outline { background: transparent; border: 1px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary-soft); }
.btn-outline:disabled { border-color: var(--border-strong); color: var(--text-tertiary); background: transparent; cursor: not-allowed; }
.btn-sm { padding: 9px 16px; font-size: .82rem; }
.btn-row { display: flex; flex-direction: column; gap: 10px; margin-top: 24px; }
.btn-row.center { align-items: center; }
.btn-row .btn { width: 100%; }
.btn-row.center .btn { width: auto; }
@media (min-width: 520px) {
  .btn-row:not(.center) { flex-direction: row; }
  .btn-row:not(.center) .btn { width: auto; }
}

/* =========================================================================
   PROGRESSO
   ========================================================================= */
.progress-visual { padding: 30px 0 22px; }
.progress-track { height: 6px; border-radius: 999px; background: var(--border-subtle); overflow: hidden; position: relative; }
.progress-fill {
  position: absolute; inset: 0; width: 34%; border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  animation: sweep 1.3s ease-in-out infinite;
}
@keyframes sweep { 0% { transform: translateX(-120%); } 100% { transform: translateX(340%); } }
.progress-info { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.progress-info.center { justify-content: center; }
.progress-step { font-family: var(--font-mono); font-size: .85rem; color: var(--text-secondary); word-break: break-word; }
.progress-timer { font-size: .85rem; color: var(--text-tertiary); flex-shrink: 0; }

/* =========================================================================
   RESULTADO
   ========================================================================= */
.result-hero { text-align: center; margin-bottom: 24px; }
.result-icon {
  width: 76px; height: 76px; border-radius: 50%;
  background: var(--success-soft); color: var(--success);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 18px;
}
.result-icon.error { background: var(--danger-soft); color: var(--danger); }
.result-icon svg { width: 34px; height: 34px; }
.result-icon .draw-path { stroke-dasharray: 32; stroke-dashoffset: 32; animation: draw .5s .1s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.result-hero h2 { font-size: 1.35rem; font-weight: 700; margin-bottom: 8px; }
.result-hero p { color: var(--text-secondary); font-size: .92rem; max-width: 40ch; margin: 0 auto; }

.result-meta { border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); overflow: hidden; margin-bottom: 18px; }
.meta-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; font-size: .86rem; }
.meta-row:not(:last-child) { border-bottom: 1px solid var(--border-subtle); }
.meta-row span:first-child { color: var(--text-secondary); flex-shrink: 0; }
.meta-row span:last-child { font-weight: 600; text-align: right; word-break: break-word; }

.status-pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: .74rem; font-weight: 700; }
.status-pill.success { background: var(--success-soft); color: var(--success); }
.status-pill.error { background: var(--danger-soft); color: var(--danger); }
.status-pill.warning { background: var(--warning-soft); color: var(--warning); }

.callout { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius-sm); font-size: .86rem; margin-bottom: 18px; }
.callout .icon { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.callout.warning { background: var(--warning-soft); color: var(--text-primary); border-left: 3px solid var(--warning); }
.callout.warning .icon { color: var(--warning); }

/* classificação semântica (Descrição / Categoria) */
.classification { margin-bottom: 18px; }
.classification-title { font-weight: 700; font-size: .9rem; margin-bottom: 10px; }
.dc-table-wrap { border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); overflow: hidden; }
.dc-table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.dc-table th { text-align: left; padding: 10px 14px; background: var(--bg-input); color: var(--text-secondary); font-weight: 600; border-bottom: 1px solid var(--border-subtle); }
.dc-table td { padding: 10px 14px; border-bottom: 1px solid var(--border-subtle); }
.dc-table tr:last-child td { border-bottom: none; }
.dc-descricao { word-break: break-word; }
.dc-badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .74rem; font-weight: 600;
  background: var(--cat-default-bg); color: var(--cat-default-fg); border: 1px solid var(--border-subtle);
}
.dc-badge.cat-comercial   { background: var(--cat-comercial-bg);   color: var(--cat-comercial-fg); }
.dc-badge.cat-hidraulica  { background: var(--cat-hidraulica-bg);  color: var(--cat-hidraulica-fg); }
.dc-badge.cat-eletrica    { background: var(--cat-eletrica-bg);    color: var(--cat-eletrica-fg); }
.dc-badge.cat-estrutura   { background: var(--cat-estrutura-bg);   color: var(--cat-estrutura-fg); }
.dc-badge.cat-arquitetura { background: var(--cat-arquitetura-bg); color: var(--cat-arquitetura-fg); }
.dc-vazio { text-align: center; padding: 26px 14px; color: var(--text-secondary); font-size: .85rem; }
.dc-vazio svg { width: 36px; height: 36px; margin: 0 auto 10px; opacity: .55; }

/* itens não-mapeados: cards recolhidos por grupo (motivo), pra não encher a tela */
.dc-resumo { font-size: .84rem; color: var(--text-secondary); margin-bottom: 12px; }
.dc-card-confirmado { opacity: .6; }

.card-nao-mapeado {
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  background: rgba(255,255,255,0.03);
  margin-bottom: 10px;
  overflow: hidden;
}
.card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
}
.icone-seta {
  flex-shrink: 0;
  transition: transform 0.15s ease;
  color: rgba(255,255,255,0.6);
}
.card-header.expandido .icone-seta {
  transform: rotate(90deg);
}
.card-titulo {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.card-descricao {
  font-size: 14px;
  font-weight: 500;
  color: #fff;
}
.card-motivo {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
}
.card-contador {
  flex-shrink: 0;
  font-size: 12px;
  color: rgba(255,255,255,0.6);
  background: rgba(255,255,255,0.06);
  padding: 3px 10px;
  border-radius: 20px;
}
.card-corpo {
  padding: 4px 16px 16px 42px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
}
.subgrupos-ocultos {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.subgrupo {
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.subgrupo.dc-card-confirmado { opacity: .55; }
.subgrupo-titulo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.subgrupo-nome {
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  word-break: break-word;
}
.botao-ver-mais {
  align-self: flex-start;
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid rgba(20,184,166,0.4);
  background: transparent;
  color: #14b8a6;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.botao-ver-mais:hover { background: rgba(20,184,166,0.08); }

/* balde de itens diversos: grupos de 1-2 itens (nomes raros, sem
   repetição) — linhas compactas em vez de card cheio por item. */
.balde-diversos {
  margin-top: 4px;
  border-top: 1px dashed rgba(255,255,255,0.12);
  padding-top: 10px;
}
.balde-diversos-titulo {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: rgba(255,255,255,0.65);
  padding: 4px 0;
}
.balde-diversos-titulo .icone-seta { flex-shrink: 0; transition: transform 0.15s ease; color: rgba(255,255,255,0.5); }
.balde-diversos-titulo.expandido .icone-seta { transform: rotate(90deg); }
.balde-diversos-corpo {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
}
.linha-diversa {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  background: rgba(255,255,255,0.02);
  flex-wrap: wrap;
}
.linha-diversa-nome {
  flex: 1;
  min-width: 140px;
  font-size: 12px;
  color: rgba(255,255,255,0.85);
  word-break: break-word;
}
.dropdown-sigla-compacto { width: auto; min-width: 140px; padding: 5px 8px; font-size: 12px; }
.botao-confirmar-compacto { padding: 5px 12px; font-size: 12px; }
.dropdown-sigla, .campo-sigla-nova, .campo-disciplina-nova, .campo-tipo-schema-novo {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 12px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(0,0,0,0.35);
  color: #fff;
  font-size: 14px;
}
.dropdown-sigla:focus, .campo-sigla-nova:focus, .campo-disciplina-nova:focus, .campo-tipo-schema-novo:focus {
  outline: none;
  border-color: #14b8a6;
}
.campo-sigla-nova::placeholder, .campo-disciplina-nova::placeholder {
  color: rgba(255,255,255,0.45);
}
.dropdown-sigla option, .campo-tipo-schema-novo option {
  color: #000;
}
.card-nova-sigla-campos {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border-radius: 8px;
  background: rgba(20,184,166,0.06);
  border: 1px solid rgba(20,184,166,0.2);
}
.botao-confirmar {
  align-self: flex-start;
  padding: 8px 20px;
  border-radius: 6px;
  border: none;
  background: #14b8a6;
  color: #000;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}
.botao-confirmar:hover { filter: brightness(1.08); }
.botao-confirmar:disabled { opacity: .6; cursor: default; }
.card-status { font-size: .8rem; color: var(--text-secondary); }

.result-error {
  background: var(--danger-soft); border: 1px solid var(--danger-border); color: var(--danger);
  border-radius: var(--radius-sm); padding: 14px 16px; font-size: .86rem; margin-bottom: 18px;
  word-break: break-word;
}

/* =========================================================================
   CARD DE SUPORTE
   ========================================================================= */
.support-card {
  margin-top: 20px; display: flex; align-items: center; gap: 16px;
  padding: 18px 22px; border-radius: var(--radius-md);
  background: var(--bg-card); border: 1px solid var(--border-subtle);
}
.support-icon {
  width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
  background: var(--primary-soft); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
}
.support-icon .icon { width: 19px; height: 19px; }
.support-body { flex: 1; }
.support-body strong { font-size: .92rem; }
.support-body p { color: var(--text-secondary); font-size: .82rem; margin-top: 2px; }
@media (max-width: 560px) { .support-card { flex-wrap: wrap; } .support-body { width: 100%; order: 3; } }

/* =========================================================================
   POC BEDROCK (bloco isolado — some junto com bedrock-teste.js)
   ========================================================================= */
.poc-bedrock { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--border-subtle); }
.poc-loading { text-align: center; padding: 16px; color: var(--text-secondary); font-size: .86rem; }
.poc-note { color: var(--text-secondary); font-size: .78rem; margin-bottom: 10px; }
.poc-note.right { text-align: right; margin: 10px 0 0; }
.poc-error {
  background: var(--danger-soft); border: 1px solid var(--danger-border); color: var(--danger);
  border-radius: var(--radius-sm); padding: 12px 14px; font-size: .84rem; margin-bottom: 12px;
}
.poc-table-wrap { border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); overflow: auto; }
.poc-table { width: 100%; border-collapse: collapse; font-size: .82rem; min-width: 520px; }
.poc-table th {
  position: sticky; top: 0; z-index: 1;
  background: var(--bg-elevated); text-align: left; padding: 10px 12px;
  color: var(--text-secondary); font-weight: 600; border-bottom: 1px solid var(--border-subtle);
}
.poc-table td { padding: 10px 12px; border-bottom: 1px solid var(--border-subtle); word-break: break-word; }
.poc-table tr:last-child td { border-bottom: none; }

/* spinner reaproveitado pelo POC */
.spinner {
  width: 32px; height: 32px; margin: 0 auto 8px;
  border: 2px solid var(--border-subtle); border-top-color: var(--primary);
  border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* =========================================================================
   HISTÓRICO — FILTROS
   ========================================================================= */
.filters-bar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 24px; align-items: center; }
.input-icon { position: relative; flex: 1; min-width: 180px; }
.input-icon .icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-tertiary); }
.input-icon input { width: 100%; padding: 10px 14px 10px 38px; }
.input-icon.compact { max-width: 220px; flex: initial; }

.filters-bar input[type="text"], .filters-bar select,
.input-icon input, .cmp-table-controls input {
  background: var(--bg-input); border: 1px solid var(--border-subtle); border-radius: 10px;
  padding: 10px 14px; color: var(--text-primary); transition: border-color .14s var(--ease);
}
.filters-bar select { padding-right: 30px; cursor: pointer; min-width: 148px; }
.filters-bar input:focus, .filters-bar select:focus, .input-icon input:focus { border-color: var(--primary); }

/* =========================================================================
   HISTÓRICO — LISTA
   ========================================================================= */
#historico-lista-container {
  max-height: 65vh;
  overflow-y: auto;
  padding-right: 4px;
}
.hist-section:not(:last-child) { margin-bottom: 22px; }
.hist-section-title { font-size: .76rem; font-weight: 700; letter-spacing: .04em; color: var(--text-tertiary); text-transform: uppercase; margin-bottom: 10px; }
.history-item {
  display: flex; align-items: center; gap: 14px;
  padding: 15px 18px; border-radius: var(--radius-md);
  background: var(--bg-elevated); border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--border-subtle);
  transition: border-color .14s var(--ease), transform .14s var(--ease);
}
.history-item + .history-item { margin-top: 8px; }
.history-item:hover { transform: translateY(-1px); border-color: var(--border-strong); }
.history-item.sucesso { border-left-color: var(--success); }
.history-item.erro { border-left-color: var(--danger); }
.history-icon {
  width: 36px; height: 36px; border-radius: 9px; flex-shrink: 0;
  background: var(--bg-input); color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
}
.history-item.sucesso .history-icon { color: var(--success); }
.history-item.erro .history-icon { color: var(--danger); }
.history-icon .icon { width: 17px; height: 17px; }
.history-info { flex: 1; min-width: 0; }
.history-name { font-weight: 600; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-meta { color: var(--text-secondary); font-size: .78rem; margin-top: 2px; font-family: var(--font-mono); }
.history-erro-msg { color: var(--danger); font-size: .78rem; margin-top: 4px; word-break: break-word; }
.history-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.history-btn { padding: 7px 14px; border-radius: 8px; font-size: .78rem; font-weight: 600; background: var(--primary-soft); color: var(--primary); }
.history-btn:hover { filter: brightness(1.1); }
.history-expired { color: var(--text-tertiary); font-size: .76rem; }
@media (max-width: 560px) {
  .history-item { flex-wrap: wrap; }
  .history-name { white-space: normal; }
}

/* skeleton (shimmer) */
.skeleton-item {
  display: flex; align-items: center; gap: 14px; padding: 15px 18px;
  border-radius: var(--radius-md); background: var(--bg-elevated);
  border: 1px solid var(--border-subtle); margin-bottom: 8px;
}
.skeleton-block {
  border-radius: 6px;
  background: linear-gradient(90deg, var(--bg-input) 25%, var(--border-subtle) 37%, var(--bg-input) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.sk-icon { width: 36px; height: 36px; border-radius: 9px; flex-shrink: 0; }
.sk-lines { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.sk-line { height: 10px; border-radius: 5px; }
.sk-line.w40 { width: 40%; }
.sk-line.w25 { width: 25%; }
.sk-pill { width: 74px; height: 28px; border-radius: 8px; flex-shrink: 0; }

/* estados vazio / erro */
.state-block { text-align: center; padding: 56px 20px; color: var(--text-secondary); }
.state-block .icon { width: 44px; height: 44px; margin: 0 auto 14px; opacity: .55; }
.state-block .state-title { font-weight: 600; color: var(--text-primary); margin-bottom: 6px; }
.state-block .state-text { font-size: .87rem; max-width: 38ch; margin: 0 auto 18px; }
.state-block .state-detail { font-family: var(--font-mono); font-size: .74rem; color: var(--text-tertiary); margin-top: 14px; word-break: break-word; }
.state-block.error .icon { color: var(--danger); opacity: .8; }

.load-more-row { text-align: center; margin-top: 20px; }

/* =========================================================================
   COMPARAÇÃO
   ========================================================================= */
.cmp-grid { display: grid; grid-template-columns: 1fr; gap: 20px; margin-bottom: 8px; }
@media (min-width: 680px) { .cmp-grid { grid-template-columns: 1fr 1fr; } }
.cmp-slot-title { font-weight: 600; font-size: .88rem; margin-bottom: 10px; }

.cmp-hero { display: flex; flex-direction: column; align-items: center; margin-bottom: 28px; }

/* Barras 3D (Similaridade / Cobertura / Itens Extras) — substituem o gauge
   circular. Cada barra é frente + topo (skewX) + lateral (skewY), num
   bloco com leve transparência (opacity no container, não nas faces
   isoladas, pra não criar sobreposição visível nas bordas). */
.cmp-hero-barras { padding: 6px 0 2px; }
.barras3d-container {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 52px;
  height: 236px; /* 170px de barra + espaço pro valor e label acima/abaixo */
}
.barra3d-grupo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  height: 100%;
  justify-content: flex-end;
}
.barra3d-valor { font-size: 1.15rem; font-weight: 700; }
.barra3d-wrapper {
  position: relative;
  width: 52px;
  height: 2px; /* valor real setado via JS, em px, proporcional entre as 3 barras */
  margin-right: 12px; /* espaço pra face lateral não cortar no container */
  transition: height .6s var(--ease);
}
.barra3d { position: absolute; inset: 0; opacity: .7; }
.barra3d-frente { position: absolute; left: 0; right: 0; top: 11px; bottom: 0; }
.barra3d-topo {
  position: absolute; left: 0; right: 0; top: 0; height: 11px;
  transform: skewX(-42deg); transform-origin: bottom left;
}
.barra3d-lateral {
  position: absolute; right: -11px; top: 11px; bottom: 0; width: 11px;
  transform: skewY(-42deg); transform-origin: top left;
}
.barra3d-label { font-size: .74rem; color: var(--text-secondary); text-align: center; max-width: 96px; }

.cor-rosa .barra3d-frente { background: linear-gradient(135deg, #ED93B1, #D4537E, #993556); }
.cor-rosa .barra3d-topo { background: #ED93B1; }
.cor-rosa .barra3d-lateral { background: #993556; }

.cor-roxa .barra3d-frente { background: linear-gradient(135deg, #AFA9EC, #7F77DD, #3C3489); }
.cor-roxa .barra3d-topo { background: #AFA9EC; }
.cor-roxa .barra3d-lateral { background: #3C3489; }

.cor-verde .barra3d-frente { background: linear-gradient(135deg, #9FE1CB, #5DCAA5, #0F6E56); }
.cor-verde .barra3d-topo { background: #9FE1CB; }
.cor-verde .barra3d-lateral { background: #0F6E56; }

.cmp-gauge { width: 140px; height: 140px; transform: rotate(-90deg); }
.gauge-track { fill: none; stroke: var(--border-subtle); stroke-width: 10; }
.gauge-fill { fill: none; stroke: var(--success); stroke-width: 10; stroke-linecap: round; transition: stroke-dashoffset .8s var(--ease), stroke .3s var(--ease); }
.gauge-fill.medio { stroke: var(--warning); }
.gauge-fill.baixo { stroke: var(--danger); }
/* o valor fica dentro do anel; a legenda desce para fora dele (evita colisão
   com o traço do gauge em telas estreitas) */
.cmp-gauge-label { display: flex; flex-direction: column; align-items: center; margin-top: -88px; }
.cmp-gauge-value { font-size: 1.9rem; font-weight: 700; }
.cmp-gauge-label span:last-child { font-size: .78rem; color: var(--text-secondary); margin-top: 46px; }

.cmp-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 28px; }
.cmp-stat { text-align: center; padding: 16px 8px; border-radius: var(--radius-sm); background: var(--bg-elevated); border: 1px solid var(--border-subtle); }
.cmp-stat-value { font-size: 1.4rem; font-weight: 700; font-family: var(--font-mono); }
.cmp-stat-label { font-size: .74rem; color: var(--text-secondary); margin-top: 4px; }
.cmp-stat.match .cmp-stat-value { color: var(--success); }
.cmp-stat.divergente .cmp-stat-value { color: var(--danger); }
.cmp-stat.neutro .cmp-stat-value { color: var(--primary); }

.cmp-table-controls { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.chip-group { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  padding: 7px 13px; border-radius: 999px; font-size: .8rem; font-weight: 600;
  border: 1px solid var(--border-subtle); color: var(--text-secondary);
  transition: background .14s var(--ease), border-color .14s var(--ease), color .14s var(--ease);
}
.chip:hover { border-color: var(--border-strong); color: var(--text-primary); }
.chip.active { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }

.table-wrapper { border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); overflow: auto; max-height: 360px; }
.table-wrapper::-webkit-scrollbar { width: 6px; height: 6px; }
.table-wrapper::-webkit-scrollbar-track { background: transparent; }
.table-wrapper::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.12); border-radius: 3px; }
.table-wrapper::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.20); }
.data-table { width: 100%; border-collapse: collapse; font-size: .84rem; min-width: 560px; }
.data-table thead th {
  position: sticky; top: 0; z-index: 1;
  background: var(--bg-elevated); text-align: left; padding: 11px 14px;
  color: var(--text-secondary); font-weight: 600; border-bottom: 1px solid var(--border-subtle);
}
.data-table td { padding: 11px 14px; border-bottom: 1px solid var(--border-subtle); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:nth-child(even) { background: var(--row-alt); }
.data-table tbody tr.row-divergente { background: var(--danger-soft); }
.data-table tbody tr.row-atencao { background: var(--warning-soft); }
.data-table tbody tr.row-neutro { background: var(--primary-soft); }
.data-table td.cmp-vazio { text-align: center; padding: 30px 14px; color: var(--text-secondary); }
.col-prox { font-family: var(--font-mono); }
.comp-badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: .74rem; font-weight: 700; }
.comp-badge .icon { width: 12px; height: 12px; }
.comp-badge.match { background: var(--success-soft); color: var(--success); }
.comp-badge.parcial { background: rgba(127, 119, 221, 0.16); color: #AFA9EC; }
.comp-badge.divergente { background: var(--danger-soft); color: var(--danger); }
.comp-badge.atencao { background: var(--warning-soft); color: var(--warning); }
.comp-badge.neutro { background: var(--primary-soft); color: var(--primary); }

/* Consolidação de linhas da comparação: 1 linha por aba, expansível */
.cmp-linha-aba.cmp-expandivel { cursor: pointer; }
.cmp-linha-aba .icone-seta { flex-shrink: 0; vertical-align: -3px; transition: transform 0.15s ease; color: var(--text-secondary); }
.cmp-linha-aba.expandido .icone-seta { transform: rotate(90deg); }
.cmp-linha-detalhe td { padding-left: 28px; opacity: 0.85; }
.cmp-extra-indicador { margin-left: 8px; font-size: .72rem; font-weight: 600; color: var(--text-secondary); }

/* =========================================================================
   TOASTS
   ========================================================================= */
.toast-region {
  position: fixed; bottom: 24px; right: 24px; z-index: 200;
  display: flex; flex-direction: column; gap: 10px;
  max-width: min(340px, calc(100vw - 32px));
}
.toast {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--bg-elevated); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); padding: 13px 14px; box-shadow: var(--shadow-pop);
  font-size: .84rem; animation: toastIn .22s var(--ease);
}
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.toast .icon { width: 17px; height: 17px; flex-shrink: 0; margin-top: 1px; }
.toast.success .icon { color: var(--success); }
.toast.error .icon { color: var(--danger); }
.toast.info .icon { color: var(--primary); }

/* =========================================================================
   RESPONSIVO — TROCA SIDEBAR -> NAV INFERIOR
   ========================================================================= */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .content { margin-left: 0; padding: 28px 16px 96px; }
  .mobile-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    background: var(--bg-elevated); border-top: 1px solid var(--border-subtle);
    padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
  }
  .mobile-nav-btn {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 6px 0; border-radius: 10px; color: var(--text-secondary);
    font-size: .68rem; font-weight: 600;
  }
  .mobile-nav-btn .icon { width: 19px; height: 19px; }
  .mobile-nav-btn.active { color: var(--primary); }
  .toast-region { right: 12px; bottom: 78px; left: 12px; max-width: none; }
  .cmp-table-controls { flex-direction: column; align-items: stretch; }
  .input-icon.compact { max-width: none; }
}

/* telas estreitas (360px): nada pode gerar scroll horizontal */
@media (max-width: 380px) {
  .page-head h1 { font-size: 1.5rem; }
  .panel { padding: 20px 14px; }
  .dropzone { padding: 36px 14px; }
  .cmp-stats { grid-template-columns: 1fr; }
  .cmp-stat { display: flex; align-items: baseline; justify-content: space-between; text-align: left; padding: 12px 14px; }
  .cmp-stat-label { margin-top: 0; }
  .filters-bar select { min-width: 0; width: 100%; }
}

/* =========================================================================
   COMPARAÇÃO AVANÇADA - NOVA PÁGINA
   ========================================================================= */
.cmp-upload-container {
  display: flex; flex-direction: column; align-items: center; gap: 24px;
  padding: 40px 0;
}

.cmp-upload-grid {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 24px;
  align-items: start; width: 100%; max-width: 600px;
}

.cmp-upload-slot {
  display: flex; flex-direction: column; gap: 12px;
}

.cmp-dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 32px 20px; border: 2px dashed var(--border-subtle);
  border-radius: var(--radius-md); background: var(--bg-card); cursor: pointer;
  transition: all .25s var(--ease); min-height: 140px;
}

.cmp-dropzone:hover {
  border-color: var(--primary); background: var(--primary-soft);
}

.cmp-dropzone.dragover {
  border-color: var(--primary); background: var(--primary-soft);
  transform: scale(1.03); box-shadow: 0 0 0 2px var(--primary-soft);
}

.cmp-dropzone.invalid {
  border-color: var(--danger); background: var(--danger-soft);
}

.cmp-dz-text {
  font-weight: 600; color: var(--text-primary); font-size: .95rem;
}

.cmp-dz-hint {
  font-size: .8rem; color: var(--text-tertiary);
}

.cmp-upload-divider {
  width: 1px; background: var(--border-subtle); height: 140px;
}

.btn-large {
  padding: 12px 40px; font-size: 1rem;
}

/* Processing State */
.cmp-processor {
  display: flex; flex-direction: column; align-items: center; gap: 40px;
  padding: 50px 40px; animation: fadeIn .3s var(--ease);
}

.cmp-circle-progress {
  position: relative; width: 220px; height: 220px;
}

.cmp-circle-svg {
  width: 100%; height: 100%;
}

.cmp-circle-bg {
  fill: none; stroke: var(--border-subtle); stroke-width: 10;
}

.cmp-circle-fill {
  fill: none; stroke: url(#gradient-gauge); stroke-width: 10;
  stroke-dasharray: 534.1; stroke-dashoffset: 534.1;
  stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50%;
  transition: stroke-dashoffset .4s cubic-bezier(.4, 0, .2, 1);
}

.cmp-circle-center {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  text-align: center;
}

.cmp-circle-value {
  display: block; font-size: 3.5rem; font-weight: 800; color: var(--primary);
}

.cmp-circle-unit {
  font-size: 1.2rem; color: var(--text-secondary); font-weight: 600;
}

.cmp-processing-status {
  text-align: center; max-width: 400px;
}

.cmp-status-text {
  color: var(--text-secondary); font-size: .95rem; margin-bottom: 24px;
  min-height: 20px;
}

.cmp-progress-steps {
  display: flex; justify-content: center; gap: 24px;
}

.cmp-progress-step {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  opacity: 0.5; transition: all .3s var(--ease);
}

.cmp-progress-step.active {
  opacity: 1;
}

.cmp-step-indicator {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--text-tertiary); transition: all .3s var(--ease);
}

.cmp-progress-step.active .cmp-step-indicator {
  width: 14px; height: 14px; background: var(--primary);
  box-shadow: 0 0 0 8px var(--primary-soft);
}

.cmp-progress-step span {
  font-size: .8rem; color: var(--text-secondary); font-weight: 500;
}

/* Result State */
.cmp-result-header {
  display: grid; grid-template-columns: 1fr 1fr; gap: 40px;
  align-items: center; padding-bottom: 40px; border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 40px;
}

.cmp-result-gauge {
  position: relative; width: 180px; height: 180px; margin: 0 auto;
}

.cmp-gauge-svg {
  width: 100%; height: 100%;
}

.cmp-gauge-bg {
  fill: none; stroke: var(--border-subtle); stroke-width: 8;
}

.cmp-gauge-fill {
  fill: none; stroke: url(#gradient-gauge); stroke-width: 8;
  stroke-dasharray: 439.8; stroke-dashoffset: 43.98;
  stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50%;
  transition: stroke-dashoffset .6s var(--ease);
}

.cmp-gauge-center {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  text-align: center;
}

.cmp-gauge-value {
  display: block; font-size: 2.2rem; font-weight: 700; color: var(--primary);
}

.cmp-gauge-label {
  font-size: .85rem; color: var(--text-secondary); margin-top: 4px;
}

.cmp-result-stats {
  display: flex; flex-direction: column; gap: 12px;
}

.cmp-stat-box {
  padding: 16px; border-radius: var(--radius-md); background: var(--bg-card);
  border-left: 4px solid var(--border-subtle); transition: all .3s var(--ease);
}

.cmp-stat-box.match {
  border-left-color: var(--success); background: rgba(0, 217, 127, 0.05);
}

.cmp-stat-box.partial {
  border-left-color: var(--warning); background: rgba(255, 176, 32, 0.05);
}

.cmp-stat-box.divergent {
  border-left-color: var(--danger); background: rgba(255, 77, 77, 0.05);
}

.cmp-stat-box:hover {
  transform: translateX(4px);
}

.cmp-stat-number {
  font-size: 2rem; font-weight: 700; color: var(--text-primary); display: block;
}

.cmp-stat-title {
  font-size: .85rem; color: var(--text-secondary); margin-top: 4px;
}

.cmp-table-section {
  display: flex; flex-direction: column; gap: 20px;
}

.cmp-table-controls {
  display: flex; gap: 16px; align-items: center;
}

.cmp-filter-chips {
  display: flex; gap: 8px;
}

.cmp-result-table {
  width: 100%;
}

.cmp-result-table thead th {
  padding: 12px 14px; font-size: .85rem; font-weight: 600;
  text-align: left; color: var(--text-secondary); border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-card);
}

.cmp-result-table tbody tr {
  border-bottom: 1px solid var(--border-subtle); transition: background .2s var(--ease);
}

.cmp-result-table tbody tr:hover {
  background: var(--bg-card);
}

.cmp-result-table tbody td {
  padding: 14px; font-size: .9rem; color: var(--text-primary);
}

.cmp-result-table .comp-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 12px; font-size: .8rem; font-weight: 600;
}

.comp-badge.match {
  background: var(--success-soft); color: var(--success);
}

.comp-badge.partial {
  background: var(--warning-soft); color: var(--warning);
}

.comp-badge.divergent {
  background: var(--danger-soft); color: var(--danger);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-width: 768px) {
  .cmp-upload-grid { grid-template-columns: 1fr; }
  .cmp-result-header { grid-template-columns: 1fr; gap: 20px; }
  .cmp-processor { padding: 40px 24px; }
  .cmp-btn-row { flex-direction: column; }
  .btn { width: 100%; }
}
