/* =====================================================
   custom.css – Canto das Letras
   Responsividade e melhorias visuais globais
   ===================================================== */

/* ── Base ── */
body {
  background-color: #f8f9fa;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  line-height: 1.6;
}

/* ── Cards ── */
.card {
  border-radius: 0.75rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* ── Formulários – campos maiores para toque ── */
.form-control,
.form-select {
  min-height: 48px;
  font-size: 1rem;
  border-radius: 8px;
  padding: 0.55rem 0.9rem;
}

textarea.form-control {
  min-height: 100px;
}

.form-label {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
  color: #374151;
}

/* ── Botões – tamanho mínimo para toque ── */
.btn {
  min-height: 44px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.5rem 1.1rem;
}

.btn-sm {
  min-height: 36px;
  font-size: 0.85rem;
  padding: 0.35rem 0.75rem;
}

.btn-lg {
  min-height: 52px;
}

/* ── Tabelas responsivas ── */
.table-responsive {
  border-radius: 0.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table th {
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.table td { vertical-align: middle; }

/* ── Autocomplete / sugestões ── */
#suggestions,
#vendedores,
#autores {
  border: 1px solid #dee2e6;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  max-height: 220px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

#suggestions .list-group-item,
#vendedores .list-group-item,
#autores .list-group-item {
  min-height: 48px;
  font-size: 0.95rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
}

/* ── Wrapper de formulários ── */
.form-wrapper {
  max-width: 860px;
  margin: 1.5rem auto 2rem;
  padding: 0 0.5rem;
}

/* ── Form card (shadow-sm + rounded) ── */
.form-card {
  background: #fff;
  border-radius: 0.75rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
  padding: 1.5rem;
}

/* ── Alertas ── */
.alert { border-radius: 10px; font-size: 0.95rem; }

/* ── Seção de título ── */
.page-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: #222;
  margin-bottom: 1.25rem;
}

/* ── Input group (R$) ── */
.input-group-text {
  min-height: 48px;
  background: #f1f3f5;
  border-color: #ced4da;
  font-weight: 600;
}

/* ── Footer ── */
footer.site-footer {
  background-color: #f7f7f7;
  border-top: 4px solid #9170E4;
  padding: 1.25rem 1rem;
  text-align: center;
}

/* ── DataTables: mobile friendly ── */
table.dataTable {
  width: 100% !important;
}

.dataTables_wrapper .dataTables_filter input {
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid #ced4da;
  padding: 0.4rem 0.75rem;
}

.dataTables_wrapper .dataTables_length select {
  min-height: 42px;
  border-radius: 8px;
}

/* ── Export buttons ── */
.export-btns { display: flex; flex-wrap: wrap; gap: 0.5rem; }

/* ── Login page ── */
.login-container {
  width: 100%;
  max-width: 420px;
  padding: 2rem 1.5rem;
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 6px 30px rgba(0,0,0,0.1);
}
.login-logo { display: block; margin: 0 auto 1.25rem; max-width: 140px; }
.login-title {
  text-align: center;
  font-size: 1.05rem;
  margin-bottom: 1.5rem;
  color: #555;
  line-height: 1.5;
}

/* ── Responsividade móvel específica ── */
@media (max-width: 767.98px) {
  .form-wrapper { margin: 1rem auto 1.5rem; padding: 0 0.25rem; }
  .form-card { padding: 1.1rem; }
  .page-title { font-size: 1.2rem; }

  /* Stack col-md-* em mobile */
  .row.g-3 > [class*="col-md-"] { margin-bottom: 0; }

  /* Botões empilhados */
  .export-btns { flex-direction: column; }
  .export-btns .btn { width: 100%; }

  /* Tabela: cabeçalho menor */
  .table th { font-size: 0.78rem; }
  .table td { font-size: 0.88rem; }

  /* Botão de submit: full width no mobile */
  .btn-submit-mobile { width: 100%; }
}

@media (max-width: 479.98px) {
  .form-control, .form-select { min-height: 52px; font-size: 1.05rem; }
  .btn { min-height: 50px; font-size: 1rem; }
  .login-container { padding: 1.5rem 1rem; }
}

/* ── Modal de inventário (movimentação de estoque) ── */
.modal-inv {
  position: fixed; top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  display: flex; justify-content: center; align-items: center;
  z-index: 1055;
  padding: 1rem;
}
.modal-inv-content {
  background: #fff;
  padding: 1.5rem;
  border-radius: 0.75rem;
  max-width: 600px;
  width: 100%;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  max-height: 90vh;
  overflow-y: auto;
}
@media (max-width: 575.98px) {
  .modal-inv-content { padding: 1rem; }
  .modal-inv-content .table th,
  .modal-inv-content .table td { font-size: 0.85rem; padding: 0.5rem 0.4rem; }
}
