/* tecnobolt2.css — Design System Martin Tools (Tema Claro & Azul França) + Relatórios A4 */

:root {
  --tb-primary: #004481;        /* Azul Canônico Martin Tools */
  --tb-primary-hover: #003366;
  --tb-accent: #0055ff;         /* Azul França Vibrante */
  --tb-accent-hover: #0044cc;
  --tb-accent-light: #eff6ff;
  --tb-accent-border: #bfdbfe;
  --tb-surface: #ffffff;
  --tb-bg: #f4f6f9;
  --tb-card-bg: #ffffff;
  --tb-border: #cbd5e1;
  --tb-border-light: #e2e8f0;
  --tb-text-dark: #0f172a;
  --tb-text-muted: #475569;
  --tb-success: #10b981;
  --tb-warning: #f59e0b;
  --tb-orange-border: #ea580c;
  --tb-orange-bg: #fff7ed;
  --tb-danger: #ef4444;
}

/* =========================================================================
   Hero Banner Corporativo TecnoBolt2
   ========================================================================= */
.tb2-hero {
  background: linear-gradient(135deg, #001a4d 0%, #004481 55%, #1a5a9e 100%);
  padding: 40px 24px 30px;
  text-align: center;
  position: relative;
  overflow: hidden;
  border-bottom: 4px solid var(--tb-accent);
  margin-top: var(--header-h, 140px);
}
.tb2-hero::after {
  content: '';
  position: absolute;
  top: -40%;
  right: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
  pointer-events: none;
}
.tb2-hero-content {
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}
.tb2-hero-content h1 {
  font-family: 'Oswald', sans-serif;
  font-size: 2.4rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 6px;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.tb2-hero-content h1 span {
  color: #38bdf8;
}
.tb2-hero-sub {
  color: rgba(255, 255, 255, 0.88);
  font-size: 1.02rem;
  margin: 0 0 16px;
  font-weight: 300;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}
.tb2-hero-badges {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}
.tb2-hero-badges span {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  backdrop-filter: blur(4px);
}

/* Container Principal Expandido e Widescreen */
main.container {
  max-width: 1440px !important;
  width: 96% !important;
  margin: 24px auto 40px !important;
  padding: 0 16px !important;
  background: var(--tb-bg);
}

/* Abas Superiores (Tabs) */
.tabs {
  display: flex !important;
  gap: 8px !important;
  margin-bottom: 22px !important;
  border-bottom: 2px solid var(--tb-border) !important;
  padding-bottom: 0 !important;
  flex-wrap: wrap !important;
}

.tab-btn {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 10px 18px !important;
  background: #ffffff !important;
  border: 1.5px solid var(--tb-border) !important;
  border-bottom: none !important;
  color: var(--tb-text-muted) !important;
  border-radius: 8px 8px 0 0 !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  font-family: 'Fira Sans', sans-serif !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.4px !important;
  margin-bottom: -2px !important;
}

.tab-btn:hover {
  background: var(--tb-accent-light) !important;
  color: var(--tb-primary) !important;
  border-color: var(--tb-accent-border) !important;
}

.tab-btn.active {
  background: var(--tb-primary) !important;
  color: #ffffff !important;
  border-color: var(--tb-primary) !important;
  box-shadow: 0 -2px 6px rgba(0, 68, 129, 0.15) !important;
}

.tab-btn.active .tab-icon {
  color: #38bdf8 !important;
}

/* Cartões Visuais (Tema Claro MSG) */
.card {
  background: var(--tb-card-bg) !important;
  border: 1px solid var(--tb-border-light) !important;
  border-radius: 8px !important;
  padding: 16px 18px !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05) !important;
  color: var(--tb-text-dark) !important;
}

.card-title {
  font-family: 'Oswald', sans-serif !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  color: var(--tb-primary) !important;
  text-transform: uppercase !important;
  letter-spacing: 0.3px !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

/* Formulários & Tipografia */
.form-group label {
  font-size: 12.5px !important;
  font-weight: 600 !important;
  color: var(--tb-text-dark) !important;
  margin-bottom: 5px !important;
}

.form-group input,
.form-group select {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1.5px solid #cbd5e1 !important;
  font-size: 13px !important;
  padding: 7px 11px !important;
  border-radius: 6px !important;
  transition: all 0.2s ease !important;
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--tb-accent) !important;
  box-shadow: 0 0 0 3px rgba(0, 85, 255, 0.15) !important;
  outline: none !important;
}

/* Famílias de Parafusos — Seletor em Grid de Tiles Claros com Azul França */
.tb-family-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.tb-family-card {
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  padding: 10px 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 90px;
}

.tb-family-card:hover {
  border-color: var(--tb-accent);
  background: #f0f7ff;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 85, 255, 0.1);
}

.tb-family-card.active {
  border-color: var(--tb-accent);
  border-width: 2px;
  background: #e0edff;
  box-shadow: 0 0 12px rgba(0, 85, 255, 0.25);
}

.tb-family-card i {
  font-size: 26px;
  color: var(--tb-primary);
  margin-bottom: 6px;
  transition: color 0.2s ease;
}

.tb-family-card.active i,
.tb-family-card:hover i {
  color: var(--tb-accent);
}

.tb-family-card .tb-family-name {
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
}

.tb-family-card .tb-family-std {
  font-size: 9.5px;
  color: #64748b;
  margin-top: 3px;
}

/* Painel de Visualização do Croqui SVG */
.tb-svg-wrapper {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  padding: 12px;
  text-align: center;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.04);
  margin-bottom: 12px;
}

.tb-svg-wrapper svg {
  max-width: 100%;
  height: auto;
}

/* Alerta de Inox em Laranja (Galling / Compatibilidade Metalúrgica) */
.tb-alert-orange {
  background: #fff7ed;
  border: 1.5px solid #ea580c;
  border-radius: 6px;
  padding: 10px 14px;
  margin-top: 12px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  animation: fadeIn 0.3s ease;
}

.tb-alert-orange i {
  color: #ea580c;
  font-size: 18px;
  margin-top: 2px;
}

.tb-alert-orange strong {
  color: #9a3412;
  font-size: 12px;
  display: block;
  margin-bottom: 2px;
}

.tb-alert-orange p {
  color: #7c2d12;
  font-size: 11px;
  margin: 0;
  line-height: 1.45;
}

/* Indicadores de Engenharia Rápidos (Badges) */
.tb-eng-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 10px;
}

.tb-badge {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12px;
  color: #334155;
  display: flex;
  align-items: center;
  gap: 5px;
}

.tb-badge strong {
  color: var(--tb-primary);
  font-size: 13px;
}

.tb-badge.highlight {
  border-color: var(--tb-accent);
  background: #f0f7ff;
}

.tb-badge.highlight strong {
  color: var(--tb-accent);
  font-size: 14px;
}

/* Botões de Ação do Formulário & Relatórios */
.tb-action-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 14px;
}

.tb-btn-add {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 10px 22px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.25);
  transition: all 0.2s ease;
}

.tb-btn-add:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.35);
}

.tb-btn-reset {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.tb-btn-reset:hover {
  background: #e2e8f0;
  color: #0f172a;
  border-color: #94a3b8;
}

/* Barra de Emissão de Relatórios Rápidos (Abaixo do Configurador) */
.tb-reports-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  background: linear-gradient(90deg, #ffffff 0%, #f0f7ff 100%);
  border: 1.5px solid var(--tb-accent-border);
  border-radius: 8px;
  padding: 12px 16px;
  margin-top: 16px;
  margin-bottom: 14px;
  box-shadow: 0 2px 6px rgba(0, 85, 255, 0.05);
}

.tb-btn-report-purchasing {
  background: linear-gradient(135deg, #004481 0%, #0055ff 100%);
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 6px rgba(0, 85, 255, 0.25);
  transition: all 0.2s ease;
}

.tb-btn-report-purchasing:hover {
  background: linear-gradient(135deg, #003366 0%, #0044cc 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 85, 255, 0.35);
}

.tb-btn-report-torque {
  background: #ffffff;
  color: var(--tb-primary);
  border: 1.5px solid var(--tb-primary);
  border-radius: 6px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.tb-btn-report-torque:hover {
  background: #f0f7ff;
  border-color: var(--tb-accent);
  color: var(--tb-accent);
  transform: translateY(-1px);
}

/* Tabelas de Itens da Solicitação / Relatórios */
.tb-table-wrapper {
  overflow-x: auto;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  margin-top: 8px;
}

.tb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  text-align: left;
}

.tb-table th {
  background: #f8fafc;
  color: #475569;
  padding: 10px 12px;
  border-bottom: 1.5px solid #cbd5e1;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 10.5px;
  letter-spacing: 0.4px;
}

.tb-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #e2e8f0;
  color: #0f172a;
  vertical-align: middle;
}

.tb-table tr:hover td {
  background: #f0f7ff;
}

.tb-table .tb-mini-croqui {
  width: 85px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 1px;
}

.tb-table .tb-mini-croqui svg {
  width: 100%;
  height: 100%;
}

.tb-table .tb-pn-cell {
  font-family: monospace;
  font-weight: 700;
  color: var(--tb-primary);
  font-size: 12.5px;
}

.tb-table .tb-tag-badge {
  background: #e2e8f0;
  color: #334155;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 600;
}

/* Sub-linhas hierárquicas na tabela em tela */
.tb-table-subrow td {
  background: #f8fafc;
  padding: 4px 10px 4px 30px;
  font-size: 11px;
  color: #475569;
  border-bottom: 1px dotted #e2e8f0;
}

/* Botões de Ação na Linha */
.tb-btn-icon {
  background: transparent;
  border: 1px solid #cbd5e1;
  color: #64748b;
  border-radius: 4px;
  padding: 5px 8px;
  cursor: pointer;
  font-size: 11.5px;
  transition: all 0.15s ease;
}

.tb-btn-icon:hover {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #94a3b8;
}

.tb-btn-icon.delete:hover {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fca5a5;
}

/* =========================================================================
   ESTILOS DE IMPRESSÃO / PDF A4 (CANÔNICO MARTIN TOOLS — #PRINT-REPORT)
   ========================================================================= */
#print-report {
  display: none;
}

@media print {
  /* Oculta tudo fora do container de impressão */
  body > *:not(#print-report) {
    display: none !important;
  }

  body, html {
    background: #ffffff !important;
    color: #000000 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Exibe exclusivamente o relatório de impressão */
  body > #print-report {
    display: block !important;
    position: relative !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
    color: #000000 !important;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  }

  #print-report * {
    visibility: visible !important;
  }

  @page {
    size: A4 portrait;
    margin: 8mm 8mm 10mm 8mm;
  }

  .print-header-a4 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #004481;
    padding-bottom: 6px;
    margin-bottom: 8px;
  }

  .print-header-a4 .logo-text {
    font-size: 17px;
    font-weight: 900;
    color: #004481;
    letter-spacing: -0.3px;
  }

  .print-header-a4 .report-title {
    font-size: 13px;
    font-weight: 800;
    color: #004481;
    text-transform: uppercase;
    text-align: right;
  }

  .print-meta-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    background: #f8fafc;
    border: 1.5px solid #004481;
    border-radius: 4px;
    padding: 6px 8px;
    font-size: 9px;
    margin-bottom: 10px;
  }

  .print-meta-grid div strong {
    color: #004481;
    display: block;
    font-size: 8px;
    text-transform: uppercase;
  }

  .print-a4-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 8.5px;
    margin-bottom: 10px;
  }

  .print-a4-table th {
    background: #004481 !important;
    color: #ffffff !important;
    border: 1px solid #004481;
    padding: 5px 3px;
    font-weight: 700;
    text-align: center;
    text-transform: uppercase;
    font-size: 8px;
  }

  .print-a4-table td {
    border: 1px solid #cbd5e1;
    padding: 4px 3px;
    color: #0f172a;
    vertical-align: middle;
  }

  .print-a4-table tr.print-subrow td {
    background: #f8fafc !important;
    padding: 2px 4px 2px 14px;
    font-size: 7.5px;
    color: #334155;
    border-top: 1px dashed #e2e8f0;
  }

  .print-footer-a4 {
    margin-top: 12px;
    border-top: 1px solid #cbd5e1;
    padding-top: 4px;
    display: flex;
    justify-content: space-between;
    font-size: 8px;
    color: #64748b;
  }

  .print-sig-box {
    margin-top: 16px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    text-align: center;
    font-size: 8.5px;
  }

  .print-sig-line {
    border-top: 1px solid #000;
    padding-top: 3px;
    font-weight: 600;
  }
}
