/* ==========================================================================
   VERIPIX — SISTEMA DE CONFERÊNCIA E PERÍCIA DE COMPROVANTES BANCÁRIOS
   Design System Institucional FinTech (Sóbrio, Técnico, Sem Clichês Visuais)
   ========================================================================== */

:root {
  --bg-main: #090d16;
  --bg-surface: #0f1623;
  --bg-elevated: #151e2e;
  --bg-subtle: #1a2436;

  --border-hairline: #1e293b;
  --border-strong: #334155;
  --border-focus: #3b82f6;

  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --accent-primary: #10b981;
  --accent-primary-hover: #059669;
  --accent-blue: #2563eb;
  --accent-blue-hover: #1d4ed8;

  --status-ok-bg: rgba(16, 185, 129, 0.1);
  --status-ok-border: rgba(16, 185, 129, 0.3);
  --status-ok-text: #34d399;

  --status-warn-bg: rgba(245, 158, 11, 0.1);
  --status-warn-border: rgba(245, 158, 11, 0.3);
  --status-warn-text: #fbbf24;

  --status-fail-bg: rgba(239, 68, 68, 0.1);
  --status-fail-border: rgba(239, 68, 68, 0.32);
  --status-fail-text: #f87171;

  --font-sans: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--bg-main);
  min-height: 100vh;
  overflow-x: hidden;
}

.hidden {
  display: none !important;
}

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ==========================================================================
   1. BARRA INSTITUCIONAL SUPERIOR E NAVEGAÇÃO
   ========================================================================== */
.top-institutional-bar {
  background: #060910;
  border-bottom: 1px solid var(--border-hairline);
  padding: 0.45rem 0;
  font-size: 0.74rem;
  color: var(--text-muted);
}

.top-institutional-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.protocol-list {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 0.7rem;
}

.protocol-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-muted);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-primary);
}

.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(9, 13, 22, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-hairline);
  padding: 0.85rem 0;
}

.nav-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-primary);
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-primary);
}

.brand-title {
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.brand-subtitle {
  display: block;
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.01em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 500;
  padding: 0.4rem 0.65rem;
  border-radius: var(--radius-xs);
  transition: color 0.15s, background 0.15s;
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
}

/* ==========================================================================
   2. BOTÕES E CONTROLES SÓBRIOS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.84rem;
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent-primary);
  color: #04130d;
  font-weight: 700;
}

.btn-primary:hover {
  background: var(--accent-primary-hover);
  color: #ffffff;
}

.btn-blue {
  background: var(--accent-blue);
  color: #ffffff;
}

.btn-blue:hover {
  background: var(--accent-blue-hover);
}

.btn-outline {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border-strong);
}

.btn-outline:hover {
  border-color: var(--text-muted);
  color: var(--text-primary);
  background: var(--bg-subtle);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.14);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.24);
  color: #ffffff;
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid transparent;
}

.btn-ghost:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
}

.btn-xs {
  padding: 0.34rem 0.68rem;
  font-size: 0.75rem;
}

.btn-sm {
  padding: 0.45rem 0.85rem;
  font-size: 0.79rem;
}

.btn-lg {
  padding: 0.78rem 1.45rem;
  font-size: 0.92rem;
}

.btn-block {
  width: 100%;
}

/* ==========================================================================
   3. CABEÇALHO TÉCNICO E PAINEL DE OPERAÇÃO (WORKBENCH)
   ========================================================================== */
.workbench-section {
  padding: 2.25rem 0 2.5rem;
}

.workbench-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-bottom: 1.65rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-hairline);
}

.workbench-title-group {
  max-width: 760px;
}

.eyebrow-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.71rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-primary);
  margin-bottom: 0.45rem;
}

.workbench-title {
  font-size: clamp(1.55rem, 2.5vw, 2.15rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.workbench-subtitle {
  font-size: 0.92rem;
  color: var(--text-muted);
}

.quota-status-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.1rem;
  min-width: 280px;
}

.quota-status-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.78rem;
  margin-bottom: 0.45rem;
}

.quota-plan-name {
  font-weight: 600;
  color: var(--text-secondary);
}

.quota-counter-text {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--accent-primary);
  font-weight: 600;
}

.quota-progress-track {
  width: 100%;
  height: 5px;
  background: var(--bg-subtle);
  border-radius: 99px;
  overflow: hidden;
}

.quota-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent-primary);
  transition: width 0.3s ease;
}

/* Grid Principal de Operação: Esquerda = Leitor de Arquivos | Direita = Validador BACEN/FEBRABAN */
.workbench-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1.25rem;
  align-items: stretch;
}

.panel-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.panel-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-hairline);
}

.panel-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.panel-card-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border-hairline);
  padding: 0.18rem 0.5rem;
  border-radius: var(--radius-xs);
}

/* Dropzone Técnica */
.dropzone-area {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: rgba(15, 22, 35, 0.6);
  padding: 2rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.dropzone-area:hover,
.dropzone-area.dragover {
  border-color: var(--accent-primary);
  background: rgba(16, 185, 129, 0.04);
}

.dropzone-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 0.9rem;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}

.dropzone-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.dropzone-desc {
  font-size: 0.83rem;
  color: var(--text-muted);
  max-width: 480px;
  margin: 0 auto 1.1rem;
}

.supported-tags {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.2rem;
}

.spec-tag {
  font-family: var(--font-mono);
  font-size: 0.69rem;
  color: var(--text-secondary);
  background: var(--bg-elevated);
  border: 1px solid var(--border-hairline);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-xs);
}

/* Amostras de Teste Técnico */
.sample-triggers-bar {
  margin-top: 1.1rem;
  padding-top: 0.95rem;
  border-top: 1px solid var(--border-hairline);
}

.sample-triggers-label {
  display: block;
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-bottom: 0.55rem;
  font-weight: 500;
}

.sample-triggers-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.btn-sample {
  background: var(--bg-elevated);
  border: 1px solid var(--border-hairline);
  color: var(--text-secondary);
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-xs);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  transition: border-color 0.15s, background 0.15s;
}

.btn-sample:hover {
  border-color: var(--border-strong);
  background: var(--bg-subtle);
  color: var(--text-primary);
}

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

.indicator-danger { background: #ef4444; }
.indicator-warn { background: #f59e0b; }
.indicator-ok { background: #10b981; }

/* Painel Direito: Consulta Matemática Direta (E2E / Boleto) */
.form-group {
  margin-bottom: 0.85rem;
}

.form-label {
  display: block;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.form-input,
.form-select {
  width: 100%;
  background: var(--bg-main);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xs);
  padding: 0.58rem 0.75rem;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.79rem;
  transition: border-color 0.15s;
}

.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: var(--accent-blue);
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 0.65rem;
}

.validation-output-box {
  margin-top: 0.85rem;
  padding: 0.8rem;
  border-radius: var(--radius-xs);
  background: var(--bg-main);
  border: 1px solid var(--border-strong);
  font-size: 0.78rem;
  line-height: 1.45;
}

.institutions-box {
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border-hairline);
}

.institutions-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.73rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.institutions-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.32rem;
}

.inst-badge {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  padding: 0.15rem 0.45rem;
  border-radius: 3px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-hairline);
  color: var(--text-muted);
}

/* ==========================================================================
   4. MESA DE RESULTADOS, INDICADORES E RAIO-X ELA
   ========================================================================== */
.audit-workspace-section {
  padding: 0.5rem 0 3.5rem;
}

.kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.kpi-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.2rem;
}

.kpi-box-label {
  font-size: 0.74rem;
  color: var(--text-muted);
  font-weight: 500;
  display: block;
  margin-bottom: 0.3rem;
}

.kpi-box-value {
  font-family: var(--font-mono);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text-primary);
  display: block;
}

.kpi-box-sub {
  font-size: 0.73rem;
  color: var(--text-dim);
  margin-top: 0.25rem;
  display: block;
}

.kpi-box-danger {
  border-color: var(--status-fail-border);
}

.kpi-box-danger .kpi-box-value {
  color: var(--status-fail-text);
}

.workspace-split {
  display: grid;
  grid-template-columns: 1.5fr 0.8fr;
  gap: 1.25rem;
}

.table-panel,
.ela-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.panel-toolbar {
  padding: 0.9rem 1.15rem;
  border-bottom: 1px solid var(--border-hairline);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.panel-toolbar-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.filter-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border-hairline);
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-xs);
  cursor: pointer;
}

.filter-btn.active {
  background: var(--bg-subtle);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

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

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.data-table th {
  background: #0b101b;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.7rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--border-hairline);
}

.data-table td {
  padding: 0.8rem 0.85rem;
  border-bottom: 1px solid var(--border-hairline);
  vertical-align: middle;
}

.row-divergent {
  background: rgba(239, 68, 68, 0.04);
}

.cell-primary {
  font-weight: 600;
  color: var(--text-primary);
}

.cell-secondary {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.mono-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-secondary);
  background: var(--bg-elevated);
  padding: 0.18rem 0.45rem;
  border-radius: 3px;
  border: 1px solid var(--border-hairline);
}

.mono-val {
  font-family: var(--font-mono);
  font-weight: 600;
}

.score-pill {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.71rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-xs);
}

.score-pill.high {
  background: var(--status-ok-bg);
  color: var(--status-ok-text);
  border: 1px solid var(--status-ok-border);
}

.score-pill.medium {
  background: var(--status-warn-bg);
  color: var(--status-warn-text);
  border: 1px solid var(--status-warn-border);
}

.score-pill.low {
  background: var(--status-fail-bg);
  color: var(--status-fail-text);
  border: 1px solid var(--status-fail-border);
}

.status-pill {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.69rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-xs);
}

.status-divergent {
  background: var(--status-fail-bg);
  color: var(--status-fail-text);
  border: 1px solid var(--status-fail-border);
}

.status-ok {
  background: var(--status-ok-bg);
  color: var(--status-ok-text);
  border: 1px solid var(--status-ok-border);
}

.empty-state {
  text-align: center;
  padding: 2.2rem 1rem;
  color: var(--text-muted);
}

.empty-state p {
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.empty-state span {
  font-size: 0.78rem;
}

/* ELA Inspector Lateral */
.ela-body {
  padding: 1rem;
}

.ela-canvas-frame {
  position: relative;
  background: #05080f;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-xs);
  height: 210px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.ela-canvas-frame canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.ela-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  text-align: center;
  background: #070b13;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.ela-caption {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* ==========================================================================
   5. ESPECIFICAÇÕES TÉCNICAS (METODOLOGIA EM 6 EIXOS)
   ========================================================================== */
.methodology-section {
  padding: 3rem 0;
  border-top: 1px solid var(--border-hairline);
}

.section-heading {
  max-width: 680px;
  margin-bottom: 2rem;
}

.section-heading h2 {
  font-size: 1.45rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.section-heading p {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.methodology-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.method-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.method-code {
  font-family: var(--font-mono);
  font-size: 0.69rem;
  color: var(--accent-primary);
  display: block;
  margin-bottom: 0.45rem;
}

.method-card h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  color: var(--text-primary);
}

.method-card p {
  font-size: 0.81rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ==========================================================================
   6. PLANOS COMERCIAIS (R$ 9,90 | R$ 25,90 | R$ 49,90)
   ========================================================================== */
.pricing-section {
  padding: 3rem 0 4rem;
  border-top: 1px solid var(--border-hairline);
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  align-items: stretch;
}

.plan-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 1.75rem 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
}

.plan-card-featured {
  border-color: var(--accent-primary);
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.04) 0%, var(--bg-surface) 35%);
}

.plan-tag-top {
  position: absolute;
  top: -11px;
  left: 1.5rem;
  background: var(--accent-primary);
  color: #04130d;
  font-family: var(--font-mono);
  font-size: 0.67rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.18rem 0.65rem;
  border-radius: var(--radius-xs);
}

.plan-segment {
  font-family: var(--font-mono);
  font-size: 0.71rem;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.plan-name {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.plan-price-row {
  display: flex;
  align-items: baseline;
  gap: 0.2rem;
  margin-bottom: 0.5rem;
}

.plan-currency {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
}

.plan-value {
  font-family: var(--font-mono);
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.03em;
}

.plan-cycle {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.plan-allowance {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--accent-primary);
  background: var(--status-ok-bg);
  border: 1px solid var(--status-ok-border);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-xs);
  margin-bottom: 1.15rem;
}

.plan-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-bottom: 1.5rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.plan-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.plan-list li::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-primary);
  margin-top: 0.45rem;
  flex-shrink: 0;
}

.plan-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* ==========================================================================
   7. DRAWER LATERAL DE PERÍCIA E MODAIS
   ========================================================================== */
.drawer-backdrop,
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(4, 7, 13, 0.82);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.drawer-backdrop.active,
.modal-backdrop.active {
  display: flex;
}

.drawer-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  width: 100%;
  max-width: 640px;
  max-height: 92vh;
  overflow-y: auto;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
  background: var(--bg-main);
  padding: 0.3rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-hairline);
  margin-bottom: 1.1rem;
}

.auth-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all 0.15s;
}

.auth-tab-btn.active {
  background: var(--bg-elevated);
  color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1rem 0;
  color: var(--text-dim);
  font-size: 0.74rem;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-hairline);
}

.checkout-split-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 1.15rem;
  align-items: stretch;
  text-align: left;
}

.checkout-method-box {
  background: var(--bg-main);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.checkout-plan-switcher {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.45rem;
  margin-top: 0.6rem;
}

.plan-switch-pill {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  color: var(--text-secondary);
  padding: 0.45rem 0.55rem;
  border-radius: var(--radius-xs);
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
}

.plan-switch-pill.active {
  border-color: var(--accent-primary);
  background: var(--status-ok-bg);
  color: var(--text-primary);
}

@media (max-width: 720px) {
  .checkout-split-grid,
  .checkout-plan-switcher {
    grid-template-columns: 1fr;
  }
}

.modal-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-hairline);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 0.98rem;
  font-weight: 700;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
}

.modal-body {
  padding: 1.25rem;
}

.modal-footer {
  padding: 0.9rem 1.25rem;
  border-top: 1px solid var(--border-hairline);
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
}

.forensic-check-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.forensic-check-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.65rem 0.8rem;
  border-radius: var(--radius-xs);
  background: var(--bg-main);
  border: 1px solid var(--border-hairline);
  font-size: 0.8rem;
}

.forensic-check-item.fail {
  border-color: var(--status-fail-border);
  background: var(--status-fail-bg);
}

.forensic-check-item.warn {
  border-color: var(--status-warn-border);
}

.forensic-check-item.pass {
  border-color: var(--status-ok-border);
}

.check-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  flex-shrink: 0;
}

.check-badge.fail { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }
.check-badge.warn { background: rgba(245, 158, 11, 0.2); color: #fcd34d; }
.check-badge.pass { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; }

.report-pre {
  background: #060910;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-xs);
  padding: 1rem;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  line-height: 1.55;
  color: var(--text-secondary);
  white-space: pre-wrap;
  max-height: 360px;
  overflow-y: auto;
}

/* Rodapé Institucional */
.footer {
  border-top: 1px solid var(--border-hairline);
  background: #060910;
  padding: 2rem 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.dev-credit-link {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.76rem;
}

.dev-credit-link:hover {
  border-color: var(--border-strong);
}

.dev-credit-link img {
  height: 20px;
  width: auto;
  border-radius: 3px;
}

/* Área de Impressão A4 */
#print-area {
  display: none;
}

@media print {
  body > *:not(#print-area) {
    display: none !important;
  }
  #print-area {
    display: block !important;
    background: #ffffff;
    color: #000000;
  }
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  padding: 0.7rem 1rem;
  border-radius: var(--radius-xs);
  font-size: 0.8rem;
  font-weight: 500;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  transition: opacity 0.25s;
}

.toast-danger { border-left: 3px solid #ef4444; }
.toast-warning { border-left: 3px solid #f59e0b; }
.toast-success { border-left: 3px solid #10b981; }

@media (max-width: 1024px) {
  .workbench-grid,
  .workspace-split,
  .methodology-grid,
  .pricing-grid {
    grid-template-columns: 1fr;
  }
  .kpi-strip {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .kpi-strip,
  .sample-triggers-grid,
  .form-row-2 {
    grid-template-columns: 1fr;
  }
}
