/* Gestor Editorial - Estilos CSS consolidados */

/* Variables CSS */
:root {
  --bg: #111827;
  --fg: #fff;
  --muted: #9ca3af;
}

/* Estilos generales */
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: #f9fafb;
  color: #111;
}

/* Header y navegación */
header {
  background: var(--bg);
  color: var(--fg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  flex-wrap: wrap;
  gap: 10px;
}

.brand {
  font-weight: 700;
  font-size: 18px;
}

nav {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

nav a {
  color: var(--fg);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 6px;
  transition: background 0.2s;
}

nav a:hover,
nav a.active {
  background: #ffffff22;
}

.userbox {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.username {
  font-size: 14px;
  color: var(--muted);
}

.btn {
  background: #fff;
  color: #111827;
  padding: 6px 10px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 500;
}

.btn:hover {
  background: #f3f4f6;
}

/* Contenido principal */
main {
  max-width: 1100px;
  margin: 24px auto;
  padding: 0 16px;
}

/* Footer */
footer {
  max-width: 1100px;
  margin: 24px auto 48px;
  padding: 0 16px;
  color: #6b7280;
  font-size: 14px;
}

footer hr {
  border: none;
  border-top: 1px solid #e5e7eb;
  margin: 16px 0;
}

/* Formularios */
label {
  display: block;
  font-weight: 600;
  margin: 12px 0 6px;
}

input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 16px;
}

button {
  margin-top: 16px;
  width: 100%;
  padding: 10px 12px;
  background: #111827;
  color: #fff;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

button:hover {
  opacity: 0.9;
}

/* Textarea específico para importar */
textarea {
  width: 100%;
  height: 360px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
}

/* Tarjeta de login */
.card {
  max-width: 400px;
  margin: 12vh auto;
  background: #fff;
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
}

/* Mensajes de estado */
.msg {
  padding: 12px 14px;
  border-radius: 8px;
  margin-bottom: 12px;
}

.ok {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #10b981;
}

.error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #ef4444;
}

/* Textos de ayuda */
.help {
  color: #374151;
  font-size: 14px;
  line-height: 1.4;
}

.hint {
  color: #6b7280;
  font-size: 14px;
  margin-top: 8px;
}

/* Estilos específicos para body en login (fondo diferente) */
body.login-page {
  background: #f3f4f6;
}

/* ===============================
   Listado de editoriales
   =============================== */

/* contadores superiores */
.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-bottom: 1.5rem;
}
.stats p {
  background: #f3f4f6;
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 600;
  color: #111827;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* formulario de búsqueda y filtros */
.filter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 1rem;
  align-items: center;
}

.filter-form input[type="text"],
.filter-form select {
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  min-width: 180px;
  background-color: #fff;
}

.filter-form button {
  background: #2563eb;
  color: #fff;
  border: 0;
  border-radius: 6px;
  padding: 8px 14px;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.2s;
}
.filter-form button:hover {
  background: #1e40af;
}

/* tabla */
.table-wrapper {
  overflow-x: auto;
  margin-top: 1rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

thead {
  background: #111827;
  color: #fff;
}

thead th {
  padding: 10px 8px;
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
}

tbody td {
  padding: 8px 8px;
  border-top: 1px solid #e5e7eb;
  vertical-align: top;
}

tbody tr:nth-child(even) {
  background: #f9fafb;
}

tbody tr:hover {
  background: #eef2ff;
}

a {
  color: #2563eb;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* responsividad */
@media (max-width: 700px) {
  thead {
    display: none;
  }
  tbody,
  tr,
  td {
    display: block;
    width: 100%;
  }
  tr {
    margin-bottom: 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
  }
  td {
    border: none;
    padding: 8px 12px;
  }
  td::before {
    content: attr(data-label);
    font-weight: 600;
    color: #6b7280;
    display: block;
    margin-bottom: 2px;
  }
}

.pagination {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}
.page-link,
.page-current {
  padding: 6px 10px;
  border-radius: 6px;
  text-decoration: none;
  border: 1px solid #d1d5db;
  color: #1f2937;
  font-size: 14px;
}
.page-link:hover {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}
.page-current {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}
