:root {
  --header-bg: url('assets/images/historico-header.jpg');
  --header-overlay: rgba(0, 0, 0, 0.50);
  --primary:   #0f3c46;
  --secondary: #1f6f78;
  --bg:        #f4f6f8;
}

*, *::before, *::after {
  margin: 0; padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
}

body { background: var(--bg); color: #333; }

.page-title-bar {
  background: #fff;
  padding: 20px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e8ecee;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.page-title-bar h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 2px;
}

.page-title-bar p {
  font-size: 13px;
  color: #9aabb0;
}

.btn-study {
  background: var(--secondary);
  color: #fff;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s, transform 0.15s;
}
.btn-study:hover { background: var(--primary); transform: translateY(-1px); }

.page-container {
  max-width: 900px;
  margin: 28px auto 60px;
  padding: 0 24px;
}

/* Loading */
.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 60px 0;
  color: #9aabb0;
  font-size: 14px;
}

.spinner {
  width: 24px; height: 24px;
  border: 3px solid #dde6e8;
  border-top-color: var(--secondary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Estado vazio */
.empty-state {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 80px 20px;
  text-align: center;
}
.empty-icon  { font-size: 52px; }
.empty-state h2 { font-size: 20px; color: var(--primary); }
.empty-state p  { font-size: 14px; color: #9aabb0; margin-bottom: 8px; }

/* Tabela */
.table-wrap {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  overflow: hidden;
}

table { width: 100%; border-collapse: collapse; }

thead tr { background: var(--primary); }

thead th {
  padding: 14px 20px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  color: rgba(255,255,255,0.85);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

tbody tr {
  border-bottom: 1px solid #f0f4f5;
  transition: background 0.12s;
  animation: rowIn 0.3s ease both;
}
@keyframes rowIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: #f4fafb; }

td { padding: 14px 20px; font-size: 14px; color: #444; }

.date-text { color: #777; font-size: 13px; }
.deck-name { font-weight: 600; color: var(--primary); }

.error-row {
  text-align: center;
  color: #e74c3c;
  padding: 40px !important;
  font-size: 14px;
}

@media (max-width: 600px) {
  .page-title-bar { flex-direction: column; gap: 14px; align-items: flex-start; }
  thead th, td { padding: 11px 12px; font-size: 12px; }
}