/* RESET */
* { 
  margin: 0; 
  padding: 0; 
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #EfEfEF;
}

/* ══════════════════════════════════════════
   LAYOUT PRINCIPAL — sidebar + conteúdo
══════════════════════════════════════════ */

.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  width: 260px;
  flex-shrink: 0;
  background: #124b5f;
  color: white;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.sidebar-logo {
  padding: 20px 16px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
}

.sidebar-logo img {
  width: 100%;
  max-width: 180px;
  height: auto;
  display: block;
  filter: brightness(0) invert(1);
  opacity: 0.9;

}

.sidebar-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
  padding: 18px 16px 8px;
  flex-shrink: 0;
}

/* Área de scroll dos itens */
.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
}

.sidebar-scroll::-webkit-scrollbar { width: 4px; }
.sidebar-scroll::-webkit-scrollbar-thumb {
  background: rgba(79,184,238,0.4);
  border-radius: 4px;
}

/* Item do menu */
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.75);
  border-left: 3px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  user-select: none;
}

.sidebar-item:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}

.sidebar-item.ativo {
  background: rgba(79,184,238,0.15);
  color: #81cbf0;
  border-left-color: #81cbf0;
}

.sidebar-item .item-numero {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}

.sidebar-item.ativo .item-numero {
  background: #4FB8EE;
  color: #124b5f;
}

.sidebar-item .badge-enviada {
  margin-left: auto;
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  background: rgba(46,158,143,0.25);
  color: #6ee7d8;
}

/* Separador */
.sidebar-sep {
  height: 1px;
  background: rgba(255,255,255,0.1);
  margin: 8px 16px;
}

/* Rodapé da sidebar */
.sidebar-footer {
  flex-shrink: 0;
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 8px 0;
}

.sidebar-footer .sidebar-item {
  color: rgba(255,255,255,0.55);
  font-size: 13px;
}

.sidebar-footer .sidebar-item:hover {
  color: #fff;
}

/* ── Área de conteúdo ── */
.main-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* Barra de progresso no topo do conteúdo */
.progress {
  height: 4px;
  background: #d0dde3;
  flex-shrink: 0;
}

/* Topbar similar to home page */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 28px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(215, 227, 235, 0.9);
  position: sticky;
  top: 0;
  z-index: 10;
}

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

.brand-logo {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, #1C799B, #3aa3cb);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 22px;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(28, 121, 155, 0.22);
  flex-shrink: 0;
}

.brand-text {
  min-width: 0;
}

.brand-text .kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #607d8b;
  margin-bottom: 4px;
}

.brand-text h1 {
  margin: 0;
  font-size: 18px;
  color: #263238;
  line-height: 1.2;
}

.brand-text p {
  margin: 4px 0 0;
  font-size: 13px;
  color: #607d8b;
}

.user-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #dde3e8;
  border-radius: 999px;
  padding: 8px 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.user-box .avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #1C799B;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  flex-shrink: 0;
}

.user-info {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.user-info strong {
  font-size: 13px;
  color: #263238;
}

.user-info span {
  font-size: 12px;
  color: #607d8b;
}

.progress-bar {
  height: 4px;
  background: #2c3e50;
  width: 0%;
  transition: width 0.3s;
}

.tabela-quantitativos { width: 100%; border-collapse: collapse; margin-top: 8px; }
.tabela-quantitativos th, .tabela-quantitativos td { border: 1px solid #e2e8f0; padding: 8px 10px; text-align: left; font-size: 14px; }
.tabela-quantitativos th { background: #f7fafc; font-weight: 600; }
.tabela-quantitativos td:last-child { text-align: right; font-variant-numeric: tabular-nums; }

/* Banner — fixo no topo do conteúdo */
.banner {
  width: 100%;
  min-height: 140px;
  background-color: #EfEfEF;
  background-image: url("../assets/header\ termo_fundo\ transparente.png");
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 10;
}
@media (max-width: 900px) {
  .banner { min-height: 110px; }
}

/* Container do formulário */
.container {
  flex: 1;
  max-width: 860px;
  width: 100%;
  margin: 0 auto;
  padding: 28px 24px 40px;
}

/* ══════════════════════════════════════════
   SEÇÕES DO FORMULÁRIO
══════════════════════════════════════════ */

.section {
  display: none;
  background: #E8ECEF;
  padding: 24px;
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.08);
}

.section.active { display: block; }

h2 { color: #124b5f; margin-bottom: 4px; }

label {
  margin-top: 15px;
  display: block;
  font-weight: 600;
  color: #2c3e50;
}

label.required::after {
  content: " *";
  color: #ff4d4f;
}

input, textarea {
  width: 100%;
  padding: 10px;
  margin-top: 5px;
  border-radius: 8px;
  border: 1px solid #B0BEC5;
  color: #2c3e50;
}

input.invalid,
textarea.invalid {
  border-color: #ff4d4f;
  background: #fff0f0;
}
textarea {
  min-height: 50px;
}
/* Radio */
.radio-group {
  display: flex;
  gap: 12px;
  margin-top: 10px;
  flex-wrap: wrap;
  padding: 4px;
  border: 1px solid transparent;
  border-radius: 8px;
}

.radio-group.invalid {
  border-color: #ff4d4f;
  background: #fff0f0;
}

.radio-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid #B0BEC5;
  transition: all 0.2s;
  color: #263238;
  margin-top: 0;
  font-weight: 500;
}

.radio-group label:hover {
  background: #A8DCD1;
  border-color: #2E9E8F;
}

.radio-group input[type="radio"] {
  width: auto;
  margin: 0;
  padding: 0;
  cursor: pointer;
}

/* Chips */
.chip-bar { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 20px; }
.chip {
  padding: 7px 14px;
  border-radius: 20px;
  border: 2px solid #1C799B;
  background: #fff;
  color: #1C799B;
  font-size: 13px;
  font-weight: normal;
  cursor: pointer;
  transition: all .18s;
  white-space: nowrap;
  text-transform: uppercase;
}
.chip:hover    { background: #7bd8e2; }
.chip-ativo    { background: #1C799B; color: #ffffff; }
.chip-aviso    { color: #888; font-style: italic; margin: 12px 0; }
.subtopico-title {
  font-size: 15px;
  font-weight: 700;
  color: #1C799B;
  margin: 24px 0 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid #1C799B;
}

/* ══════════════════════════════════════════
   BOTÕES E NAVEGAÇÃO
══════════════════════════════════════════ */

.nav {
  margin-top: 24px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

button {
  padding: 10px 15px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  min-width: 10px;
  font-size: 14px;
}

.btn-primary { background: #1C799B; color: white; }
.btn-green   { background: #2E9E8F; color: white; }
.btn-gray    { background: #B0BEC5; color: #263238; }
.btn-danger  { background: #e74c3c; color: white; }

.historico-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

/* ══════════════════════════════════════════
   TOAST
══════════════════════════════════════════ */

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  padding: 13px 18px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 4px 18px rgba(0,0,0,0.15);
  z-index: 9999;
  transition: transform .35s cubic-bezier(.34,1.56,.64,1), opacity .3s;
  opacity: 0;
  pointer-events: none;
  white-space: normal;
  max-width: 340px;
  text-align: center;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; pointer-events: auto; }
.toast-ok   { background: #1C799B; color: #fff; }
.toast-erro { background: #c0392b; color: #fff; }

/* ══════════════════════════════════════════
   BADGE DE USUÁRIO
══════════════════════════════════════════ */

#userBadge {
  position: fixed;
  top: 12px;
  right: 16px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(6px);
  border: 1px solid #dde3e8;
  border-radius: 24px;
  padding: 6px 14px 6px 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.10);
  font-size: 13px;
  font-weight: 600;
  color: #263238;
  pointer-events: none;
}

#userBadge .avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: #1C799B; color: #fff;
  font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════
   LOADING OVERLAY
══════════════════════════════════════════ */

#loadingOverlay {
  position: fixed; inset: 0;
  background: rgba(255,255,255,0.85);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  z-index: 9000; gap: 14px;
  font-size: 15px; color: #546E7A; font-weight: 600;
}
#loadingOverlay .spinner {
  width: 36px; height: 36px;
  border: 4px solid #d0e8f0;
  border-top-color: #1C799B;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ══════════════════════════════════════════
   MODO LEITURA
══════════════════════════════════════════ */

.modo-leitura-aviso {
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 13px;
  color: #856404;
  font-weight: 600;
}

/* ══════════════════════════════════════════
   UTILITÁRIOS
══════════════════════════════════════════ */

.campo, .campo .valor, textarea, input {
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* ══════════════════════════════════════════
   PDF
══════════════════════════════════════════ */

.pdf-subtitulo { font-size: 11px; color: #78909C; }
.pdf-campo     { margin-bottom: 14px; padding: 6px 0; border-bottom: 1px dashed #e0e0e0; }
.pdf-pergunta  { font-weight: 700; color: #1C799B; }
.pdf-valor     { background: #F4F8FA; border-left: 3px solid #1C799B; }
.pdf-header    { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.pdf-logo      { width: 120px; height: auto; }
.pdf-banner    { width: 100%; margin: 0; padding: 0; }
.pdf-banner img{ width: 100%; height: auto; display: block; }

/* ══════════════════════════════════════════
   RESPONSIVO — mobile (sidebar vira drawer)
══════════════════════════════════════════ */

@media (max-width: 768px) {
  .app-layout { display: block; }

  .sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    width: 260px;
    height: 100%;
    z-index: 1000;
    transition: left 0.3s;
  }

  .sidebar.open { left: 0; }

  .mobile-menu-btn {
    display: flex !important;
  }

  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 999;
  }
  .sidebar-overlay.open { display: block; }

  .main-content { padding-top: 52px; }

  .banner { min-height: 90px; }
}

/* Botão mobile — oculto no desktop */
.mobile-menu-btn {
  display: none;
  position: fixed;
  top: 12px;
  left: 14px;
  z-index: 998;
  background: #124b5f;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 9px 13px;
  font-size: 18px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}
/* ════
   GRUPO COLAPSÁVEL — sidebar "ATUAÇÃO GERAL"
════ */

.sidebar-grupo-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
  border-left: 3px solid transparent;
  transition: background 0.15s, color 0.15s;
  user-select: none;
}

.sidebar-grupo-header:hover {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.9);
}

.sidebar-grupo-header .grupo-seta {
  font-size: 10px;
  transition: transform 0.2s;
  flex-shrink: 0;
  color: rgba(255,255,255,0.45);
}

.sidebar-grupo-header .grupo-label {
  flex: 1;
}



.sidebar-grupo-filhos .sidebar-item {
  font-size: 12px;
  font-weight: 500;
  padding: 8px 16px 8px 28px;
  border-left: 3px solid transparent;
  color: rgba(255,255,255,0.65);
}

.sidebar-grupo-filhos .sidebar-item:hover {
  background: rgba(255,255,255,0.07);
  color: #fff;
}

.sidebar-grupo-filhos .sidebar-item.ativo {
  background: rgba(79,184,238,0.15);
  color: #4FB8EE;
  border-left-color: #4FB8EE;
}/* ════
   CAMPO NUMÉRICO — linha horizontal
════ */

.campo-numero-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border: 1px solid #d0dde3;
  border-radius: 8px;
  padding: 14px 16px;
  margin-top: 10px;
  gap: 16px;
}

.campo-numero-label {
  flex: 1;
  font-weight: 600;
  color: #263238;
  margin-top: 0;
}

.campo-numero-input {
  width: 130px !important;
  text-align: right;
  border: 1px solid #B0BEC5;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 14px;
  color: #263238;
  flex-shrink: 0;
}


.campo-numero-input.invalid {
  border-color: #ff4d4f;
  background: #fff0f0;
}
.chip-enviado {
  background: #e8fff7;
  border-color: #2E9E8F;
  color: #166b5f;
  font-weight: 700;
}
@media print {
  body.modal-printing > * {
    display: none !important;
  }

  body.modal-printing #printArea {
    display: block !important;
  }

  body.modal-printing #printArea * {
    visibility: visible !important;
  }

  /* esconda também a navegação/menu fixo da aplicação */
  body.modal-printing header,
  body.modal-printing nav,
  body.modal-printing .topbar,
  body.modal-printing .sidebar,
  body.modal-printing .menu,
  body.modal-printing .hamburger,
  body.modal-printing .btn-menu,
  body.modal-printing .floating-menu,
  body.modal-printing #loadingOverlay,
  body.modal-printing .toast {
    display: none !important;
  }
}
.date-range-group {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.date-range-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 140px;
}

.date-range-item label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: #546e7a;
}
/* aqui colocar campo 1 ao lado do outro 
.grupo-data-correcao {
  display: flex;
  gap: 24px;
  width: 100%;
}

.data-correcao {
  flex: 1;
  min-width: 0;
}
@media (max-width: 700px) {
  .grupo-data-correcao {
    display: block;
  }

  .data-correcao {
    width: 100%;
    margin-bottom: 12px;
  }
}*/


.campo-calculado {
  background: #f1f5f9;
  font-weight: bold;
  color: #2d3748;
}
.campo-calculado,
.campo-bloqueado {
  background: #eceff1 !important;
  color: #37474f;
  cursor: not-allowed;
}