/* RESET */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', sans-serif;
  background-color: #f5f5fc;
  display: flex;
  height: 100vh;
  color: #333;
  line-height: 1.6;
}

/* SIDEBAR */
.sidebar {
  background-color: #6c2bd9;
  width: 220px;
  padding: 2rem 1rem;
  color: white;
}

.sidebar h2 {
  font-size: 1.4rem;
  text-align: center;
  margin-bottom: 2rem;
}

.menu a {
  display: flex;
  align-items: center;
  color: white;
  text-decoration: none;
  padding: 0.8rem 1rem;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  transition: background 0.2s ease-in-out;
}

.menu a:hover,
.menu a.active {
  background-color: rgba(255, 255, 255, 0.15);
}

.menu i {
  margin-right: 10px;
}

/* CONTEÚDO */
.content {
  flex-grow: 1;
  padding: 2rem;
  overflow-y: auto;
}

/* TOPBAR */
.topbar {
  margin-bottom: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.topbar h1 {
  font-size: 1.8rem;
  color: #5e3ea1;
}

/* TABELA */
.group-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1.5rem;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  overflow: hidden;
}

.group-table th,
.group-table td {
  padding: 1rem;
  text-align: center;
  border-bottom: 1px solid #eee;
  font-size: 0.95rem;
}

.group-table th {
  background-color: #f3f3f3;
  font-weight: bold;
  color: #333;
}

.group-table td form {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  align-items: center;
}

.entrada-input {
  width: 60px;
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.95rem;
}

/* BOTÕES DENTRO DA TABELA */
.group-table button {
  background-color: #4c61c0;
  color: white;
  padding: 0.4rem 0.8rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
  font-size: 0.9rem;
}

.group-table button:hover {
  background-color: #3e51a5;
}

.group-table a {
  color: #4c61c0;
  text-decoration: underline;
  font-weight: 500;
}

/* CARDS */
.cards {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.card {
  background-color: #f8f8fc;
  padding: 20px;
  border-radius: 12px;
  text-align: center;
  border: 1px solid #e3dfff;
  max-width: 230px;
  flex: 1 1 200px;
}

.card h3 {
  font-size: 1rem;
  margin-bottom: 10px;
  color: #555;
}

.card .big {
  font-size: 26px;
  font-weight: bold;
  color: #5e3ea1;
}

/* ETIQUETAS */
.etiqueta {
  display: inline-block;
  font-size: 11px;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 8px;
  margin-top: 4px;
  margin-right: 4px;
  background-color: #e6e6ff;
  color: #5e3ea1;
}

.etiqueta.alta {
  background-color: #e0f7ea;
  color: #2e7d32;
}

.etiqueta.baixa {
  background-color: #ffebee;
  color: #c62828;
}

.etiqueta.sem {
  background-color: #fffde7;
  color: #f57f17;
}

/* BOTÕES GERAIS */
.btn {
  display: inline-block;
  padding: 8px 14px;
  background-color: #5e3ea1;
  color: white;
  border: none;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.9rem;
  transition: background 0.2s ease;
  font-weight: 500;
}

.btn:hover {
  background-color: #432a85;
}

.btn.danger {
  background-color: #e57373;
  color: white;
}

.btn.danger:hover {
  background-color: #c94444;
}

/* MENSAGENS */
.copiado-msg {
  display: none;
  color: green;
  font-size: 0.85rem;
  margin-left: 6px;
}

/* LISTA DE LINKS */
.product-list {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.product-card {
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  width: 230px;
  text-align: left;
  border: 1px solid #eee;
}

.product-card strong {
  font-size: 1rem;
  color: #333;
}

.product-card small {
  color: #666;
}

.product-card button {
  background-color: #4c61c0;
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  margin-top: 6px;
}

.product-card button:hover {
  background-color: #3e51a5;
}

/* SCROLL */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-thumb {
  background-color: #c4b9eb;
  border-radius: 6px;
}
::-webkit-scrollbar-track {
  background-color: transparent;
}

/* =========================================================
   ADIÇÕES — inline edit, seletor de período e botões dark
   ========================================================= */

/* Campos editáveis (inline) */
.editable {
  padding: 4px 6px;
  border-radius: 8px;
  cursor: text;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}
.editable:focus {
  background: #f3f4f6;
  outline: 1px dashed #bbb;
  box-shadow: 0 0 0 3px rgba(108,43,217,0.08);
}

/* Badge / feedback de salvo */
.save-hint {
  display: inline-block;
  margin-left: 8px;
  font-size: 12px;
  color: #2e7d32;
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity .25s ease, transform .25s ease;
}
.save-hint.show { opacity: 1; transform: translateY(0); }

/* Barra de filtros compacta (uma caixa) */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.datebox {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid #e8e6ff;
  padding: 10px 12px;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.datebox label {
  font-size: 13px;
  color: #555;
  margin-right: 4px;
}

/* Pílulas de período */
.pill-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.pill {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid #e6ddff;
  background: #f7f6ff;
  color: #4b2ca1;
  cursor: pointer;
  user-select: none;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.pill:hover { background: #efeaff; }
.pill.active {
  background: #4b2ca1;
  color: #fff;
  border-color: #4b2ca1;
}

/* Select mês */
.select-month {
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 10px;
  font-size: 14px;
  background: #fff;
}

/* Botões “dark” */
.btn.dark { background-color: #1f2937; color: #fff; }
.btn.dark:hover { background-color: #111827; }

/* Variação cinza escuro */
.btn.gray-dark { background-color: #374151; color: #fff; }
.btn.gray-dark:hover { background-color: #2b3440; }

/* Botão outline roxo */
.btn.outline {
  background: transparent;
  color: #6c2bd9;
  border: 1px solid #e6ddff;
}
.btn.outline:hover { background: #f4efff; }

/* Ações e paginação */
.td-actions { white-space: nowrap; }
.actions {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.input {
  padding: 9px 12px;
  border: 1px solid #ddd;
  border-radius: 10px;
  font-size: 14px;
}
.input.month { padding-right: 6px; }
.pagination {
  display: flex; gap: 10px; justify-content: flex-end; align-items: center;
  margin-top: 10px; font-size: 13px;
}
.pagination a { color: #6c2bd9; text-decoration: none; }
.pagination .current {
  background: #f4efff; border: 1px solid #e6ddff; padding: 4px 8px;
  border-radius: 8px; color: #4b2ca1;
}

/* =========================================================
   PAINEL ADMIN – ajustes de layout (autores + tabela)
   ========================================================= */

/* container da página admin (equiv. à classe .wrap no HTML) */
.wrap {
  max-width: 1280px;          /* mais largura p/ não cortar botão */
  margin: 0 auto;
  padding: 32px 40px;         /* laterais maiores */
}

/* bloco “Autores permitidos” (encosta mais na tabela) */
.authors {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 6px 22px rgba(17,12,34,.06);
  padding: 18px 26px;
  margin-bottom: 10px;        /* ↓ distância reduzida */
}

/* bloco da tabela */
.table-block {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 6px 22px rgba(17,12,34,.06);
  padding: 18px 24px;         /* laterais confortáveis */
}
.table-block .toolbar { margin-bottom: 8px; }
.table-block .table-wrap { overflow-x: auto; margin-top: 4px; }

.table-block table { min-width: 980px; }
.table-block th, .table-block td { padding: 8px 10px; }

/* última coluna: não quebrar + botão com largura mínima */
.table-block td:last-child { white-space: nowrap; }
.table-block td:last-child .btn { min-width: 84px; } /* “Salvar” sempre visível */
.table-block td:last-child .input { max-width: 180px; }

/* badges (OK / N/A) */
.badge { display:inline-block; padding:2px 8px; border-radius:999px; font-size:11px; font-weight:700; }
.badge.ok { background:#dcfce7; color:#166534; }
.badge.fail { background:#fee2e2; color:#991b1b; }

/* linha do UID com botão copiar */
.uid-row { display:flex; align-items:center; gap:8px; }
.copy {
  padding: 5px 9px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fafafa;
  cursor: pointer;
  font-size: 12px;
}

/* responsivo */
@media (max-width: 900px) {
  .wrap { padding: 24px 18px; }
  .authors, .table-block { padding: 16px; }
  .table-block table { min-width: 860px; }
}
