body {
  background: linear-gradient(135deg, #fdfbfb, #ebedee);
}

h1 {
  margin-bottom: 10px;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.top-bar a,
.top-bar button {
  padding: 6px 12px;
  border-radius: 6px;
  border: none;
  background: #444;
  color: #fff;
  cursor: pointer;
  text-decoration: none;
}

.controles {
  display: flex;
  gap: 20px;
  margin-bottom: 10px;
}

.info {
  margin-bottom: 15px;
  font-size: 14px;
}

.mes {
  margin-bottom: 30px;
}

.mes h2 {
  margin-bottom: 8px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.dia {
  background: #ffffff;
  padding: 10px 6px;
  text-align: center;
  cursor: pointer;
  border-radius: 6px;
  border: 1px solid #e0e0e0;
  font-size: 14px;
}

.dia:hover {
  background: #eee;
}

/* Embarque */
.verde {
  background: linear-gradient(135deg, #2ecc71, #27ae60) !important;
  color: #fff;
}

/* Offshore */
.amarelo {
  background: linear-gradient(135deg, #f9e79f, #f4d03f) !important;
}

/* Desembarque */
.vermelho {
  background: linear-gradient(135deg, #ec7063, #cb4335) !important;
  color: #fff;
}

/* Folga (branco limpo) */
.vazio {
  background: transparent;
}
/* DIAS DA SEMANA */
.dia.semana {
  font-weight: 700;
  font-size: 12px;
  background: #f0f0f0;
  cursor: default;
  border-radius: 6px;
  color: #555;
}
/* ===== TOPO MELHORADO (SEM QUEBRAR NADA) ===== */
.top-bar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;

  padding: 14px 18px;
  margin-bottom: 20px;

  background: linear-gradient(135deg, #ffffff, #f0f2f5);
  border-radius: 12px;

  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.top-title {
  text-align: center;
}

.top-title h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
}

.top-title p {
  margin-top: 4px;
  font-size: 13px;
  opacity: 0.7;
}

/* mantém compatibilidade */
.btn-voltar,
.top-bar button {
  padding: 8px 14px;
  border-radius: 8px;
  border: none;
  background: #444;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
}

.top-bar button {
  background: #c62828;
}

.top-bar button:hover {
  background: #a61c1c;
}

/* responsivo */
@media (max-width: 600px) {
  .top-bar {
    grid-template-columns: 1fr;
    text-align: center;
  }
}
/* =========================
   IMPRESSÃO – 3 x 4 MESES
========================= */
@media print {

  /* remove botões */
  .top-bar,
  .controles,
  .info {
    display: none !important;
  }

  /* FORÇA IMPRESSÃO COM CORES */
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
   body {
    transform: scale(0.92);
    transform-origin: top center;
  }
     .mes {
    padding: 6px !important;
    page-break-inside: avoid;
  }
    .dia {
    font-size: 10px !important;
    padding: 4px 2px !important;
  }

  .dia.semana {
    font-size: 9px !important;
  }
  .result-grid,
  #calendario {
    gap: 10px !important;
  }
}


  /* corpo limpo */
  body {
    background: #fff !important;
    padding: 0;
  }

  /* mantém o título */
  h1 {
    text-align: center;
    margin-bottom: 16px;
  }

  /* grade do calendário */
  #calendario {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 meses por linha */
    gap: 16px;
  }

  /* cada mês */
  .mes {
    page-break-inside: avoid;
    border: 1px solid #ccc;
    padding: 8px;
    border-radius: 8px;
  }

  .mes h2 {
    text-align: center;
    font-size: 14px;
    margin-bottom: 6px;
  }

  /* dias menores para caber */
  .dia {
    font-size: 11px;
    padding: 6px 4px;
  }

  .dia.semana {
    font-size: 10px;
    font-weight: bold;
  }
