/* ============================================================
   FILE NAME: css/reports.css
   Relatório de Vendas | EasyRest
   Estilos para a tela de relatório e impressão
   ============================================================ */

/* ── LAYOUT PRINCIPAL DO RELATÓRIO ────────────────────────── */
.reports-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: #0f1117;
  color: #e2e8f0;
  font-family: 'Inter', 'Segoe UI', sans-serif;
  overflow: hidden;
}

/* ── HEADER DO RELATÓRIO ──────────────────────────────────── */
.reports-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: #1a1d27;
  border-bottom: 1px solid #2a2d3e;
  z-index: 10;
}

.reports-header h2 {
  margin: 0;
  font-size: 1.5rem;
  color: #e2e8f0;
}

.reports-header .btn {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  border-radius: 8px;
  border: 1.5px solid #2a2d3e;
  background: #252836;
  color: #cbd5e1;
  cursor: pointer;
  transition: all 0.15s;
}

.reports-header .btn:hover {
  background: #2d3148;
  border-color: #3b82f6;
  color: #fff;
}

/* ── FILTROS DO RELATÓRIO ─────────────────────────────────── */
.reports-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: #1a1d27;
  border-bottom: 1px solid #2a2d3e;
}

.reports-filters label {
  font-size: 0.85rem;
  color: #94a3b8;
  margin-bottom: 0.25rem;
  display: block;
}

.reports-filters input[type="date"],
.reports-filters select {
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  border: 1.5px solid #2a2d3e;
  background: #252836;
  color: #e2e8f0;
  font-size: 0.9rem;
  outline: none;
  appearance: none; /* Remove estilo padrão do select */
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
}

.reports-filters input[type="date"]:focus,
.reports-filters select:focus {
  border-color: #3b82f6;
  background-color: #2d3148;
}

.reports-filters button {
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  border: none;
  background: #3b82f6;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.reports-filters button:hover {
  background: #2563eb;
}

.reports-filters button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ── CONTEÚDO DO RELATÓRIO ────────────────────────────────── */
.reports-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  background: #0f1117;
  color: #e2e8f0;
  scrollbar-width: thin;
  scrollbar-color: #2a2d3e transparent;
}

.reports-content::-webkit-scrollbar { width: 8px; }
.reports-content::-webkit-scrollbar-thumb {
  background: #2a2d3e;
  border-radius: 4px;
}
.reports-content::-webkit-scrollbar-track { background: transparent; }


.reports-content h3 {
  font-size: 1.3rem;
  color: #e2e8f0;
  margin-top: 2rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid #2a2d3e;
  padding-bottom: 0.5rem;
}

.reports-content h3:first-of-type {
  margin-top: 0;
}

.text-muted {
  color: #6b7280;
  text-align: center;
  padding: 2rem;
}

/* ── CARDS DE RESUMO ──────────────────────────────────────── */
.summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.summary-card {
  background: #1a1d27;
  border: 1px solid #2a2d3e;
  border-radius: 10px;
  padding: 1.25rem;
  text-align: center;
}

.summary-card h4 {
  margin-top: 0;
  font-size: 0.9rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.summary-card p {
  font-size: 1.8rem;
  font-weight: 700;
  color: #22c55e; /* Cor verde para valores positivos */
  margin-top: 0.5rem;
}

/* ── TABELAS DE DADOS ─────────────────────────────────────── */
.reports-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 2rem;
  background: #1a1d27;
  border-radius: 10px;
  overflow: hidden; /* Para bordas arredondadas */
}

.reports-table th,
.reports-table td {
  padding: 0.8rem 1rem;
  text-align: left;
  border-bottom: 1px solid #2a2d3e;
}

.reports-table th {
  background-color: #252836;
  color: #cbd5e1;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.reports-table td {
  font-size: 0.9rem;
  color: #e2e8f0;
}

.reports-table tbody tr:last-child td {
  border-bottom: none;
}

.reports-table tbody tr:hover {
  background-color: #252836;
}

/* ── DETALHES DOS PEDIDOS ─────────────────────────────────── */
.reports-details {
  margin-top: 2rem;
}

.pedido-detail-card {
  background: #1a1d27;
  border: 1px solid #2a2d3e;
  border-radius: 10px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.pedido-detail-card h4 {
  margin-top: 0;
  font-size: 1.1rem;
  color: #3b82f6;
  margin-bottom: 0.5rem;
}

.pedido-detail-card p {
  font-size: 0.85rem;
  color: #94a3b8;
  margin-bottom: 0.25rem;
}

.pedido-detail-card h5 {
  font-size: 0.95rem;
  color: #cbd5e1;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

.pedido-detail-card ul {
  list-style: none;
  padding-left: 0;
  margin-bottom: 1rem;
}

.pedido-detail-card li {
  font-size: 0.85rem;
  color: #e2e8f0;
  margin-bottom: 0.2rem;
}

.pedido-detail-card .total-pedido {
  font-weight: 700;
  font-size: 1rem;
  color: #22c55e;
  text-align: right;
  margin-top: 1rem;
}

/* ── ESTILOS DE IMPRESSÃO ─────────────────────────────────── */
@media print {
  body {
    background: #fff !important;
    color: #000 !important;
    margin: 0;
    padding: 0;
  }

  .reports-layout,
  .reports-header,
  .reports-filters,
  .reports-content::-webkit-scrollbar {
    display: none !important;
  }

  .printable-report {
    display: block;
    width: 100%;
    padding: 20px;
    box-sizing: border-box;
  }

  .printable-report h1 {
    font-size: 2em;
    color: #333;
    text-align: center;
    margin-bottom: 30px;
  }

  .printable-report h3 {
    font-size: 1.3em;
    color: #444;
    margin-top: 25px;
    margin-bottom: 15px;
    border-bottom: 1px solid #ccc;
    padding-bottom: 5px;
  }

  .summary-cards {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
  }

  .summary-card {
    background: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 15px;
    flex: 1;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  }

  .summary-card h4 {
    color: #666;
    font-size: 0.9em;
  }

  .summary-card p {
    color: #000;
    font-size: 1.5em;
  }

  .reports-table {
    background: #fff;
    border: 1px solid #ddd;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  }

  .reports-table th {
    background-color: #f2f2f2;
    color: #333;
    border-bottom: 1px solid #ddd;
  }

  .reports-table td {
    color: #555;
    border-bottom: 1px solid #eee;
  }

  .pedido-detail-card {
    background: #fdfdfd;
    border: 1px solid #eee;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  }

  .pedido-detail-card h4 {
    color: #2563eb;
  }

  .pedido-detail-card p,
  .pedido-detail-card li {
    color: #666;
  }

  .pedido-detail-card .total-pedido {
    color: #16a34a;
  }
}