* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-soft: #f1f5f9;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --radius-xl: 28px;
  --radius-lg: 18px;
  --shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
}

body {
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text-main);
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

.admin-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
}

/* SIDEBAR */

.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 28px;
  background: #ffffff;
  border-right: 1px solid var(--border);
}

.logo {
  display: inline-block;
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: -0.06em;
  margin-bottom: 38px;
}

.logo span {
  color: var(--primary);
}

.admin-sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-sidebar nav a {
  padding: 12px 14px;
  border-radius: 12px;
  color: var(--text-muted);
  font-weight: 700;
  transition: all 0.2s ease;
}

.admin-sidebar nav a:hover,
.admin-sidebar nav a.active {
  background: #eff6ff;
  color: var(--primary);
}

/* CONTENT */

.admin-content {
  padding: 40px;
}

.admin-header {
  max-width: 1180px;
  margin: 0 auto 28px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.eyebrow {
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 10px;
}

.admin-header h1 {
  font-size: clamp(2.2rem, 5vw, 4.5rem);
  line-height: 0.95;
  letter-spacing: -0.07em;
  margin-bottom: 14px;
}

.admin-header p {
  color: var(--text-muted);
  max-width: 680px;
}

/* FORM */

.publish-form {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  gap: 24px;
}

.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
  box-shadow: var(--shadow);
}

.form-card-header {
  display: flex;
  gap: 18px;
  margin-bottom: 28px;
}

.form-card-header span {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: #eff6ff;
  color: var(--primary);
  display: grid;
  place-items: center;
  font-weight: 900;
}

.form-card-header h2 {
  font-size: 1.45rem;
  letter-spacing: -0.04em;
}

.form-card-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* FIELDS */

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field.full {
  grid-column: 1 / -1;
}

label {
  font-weight: 800;
  font-size: 0.9rem;
  color: #334155;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  background: #ffffff;
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text-main);
  outline: none;
  transition: all 0.2s ease;
}

input:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

textarea {
  resize: vertical;
}

/* COVER */

.cover-upload {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 24px;
}

.upload-box {
  min-height: 220px;
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius-lg);
  background: var(--surface-soft);
  display: grid;
  place-items: center;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.upload-box:hover {
  border-color: var(--primary);
  background: #eff6ff;
}

.upload-box input {
  display: none;
}

.upload-box strong {
  display: block;
  font-size: 1.15rem;
  margin-bottom: 6px;
}

.upload-box p {
  color: var(--text-muted);
}

.cover-preview {
  min-height: 220px;
  border-radius: var(--radius-lg);
  background: #e2e8f0;
  border: 1px solid var(--border);
  overflow: hidden;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  font-weight: 800;
}

.cover-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* SECTIONS */

.sections-wrapper {
  display: grid;
  gap: 18px;
}

.section-editor {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: #f8fafc;
}

.section-editor h3 {
  font-size: 1rem;
  color: var(--primary);
  margin-bottom: 14px;
}

.section-editor input {
  margin-bottom: 12px;
}

/* BUTTONS */

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
  padding-bottom: 60px;
}

.btn-primary,
.btn-secondary {
  border: none;
  border-radius: 999px;
  padding: 14px 22px;
  font-weight: 900;
  cursor: pointer;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.24);
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

.btn-secondary {
  background: white;
  color: var(--text-main);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--surface-soft);
}

/* RESPONSIVE */

@media (max-width: 980px) {
  .admin-page {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: relative;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .admin-sidebar nav {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .admin-content {
    padding: 28px 20px;
  }

  .admin-header {
    flex-direction: column;
  }

  .form-grid,
  .cover-upload {
    grid-template-columns: 1fr;
  }
}

/* =========================
   CONTROL DE REVISTAS ADMIN
========================= */

.admin-state {
  padding: 18px;
  border-radius: 14px;
  background: var(--surface-soft);
  color: var(--text-muted);
  font-weight: 700;
}

.admin-table-wrapper {
  width: 100%;
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 960px;
}

.admin-table th {
  text-align: left;
  padding: 14px;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.admin-table td {
  padding: 16px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.admin-table td strong {
  display: block;
  font-size: 0.98rem;
  margin-bottom: 4px;
}

.admin-table td span {
  display: block;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.admin-table td small {
  display: block;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.admin-cover-thumb {
  width: 72px;
  height: 96px;
  object-fit: cover;
  border-radius: 10px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
}

.status-pill {
  width: fit-content;
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 0.78rem !important;
  font-weight: 900;
}

.status-published {
  background: #dcfce7;
  color: #166534 !important;
}

.status-draft {
  background: #f1f5f9;
  color: #475569 !important;
}

.status-scheduled {
  background: #fef3c7;
  color: #92400e !important;
}

.admin-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-table {
  border: 1px solid var(--border);
  background: white;
  color: var(--text-main);
  border-radius: 999px;
  padding: 8px 11px;
  font-size: 0.78rem;
  font-weight: 900;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-table:hover {
  background: #eff6ff;
  color: var(--primary);
  border-color: #bfdbfe;
}

.btn-table:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-table.danger {
  color: #dc2626;
}

.btn-table.danger:hover {
  background: #fef2f2;
  border-color: #fecaca;
}
select {
  width: 100%;
  border: 1px solid var(--border);
  background: #ffffff;
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text-main);
  outline: none;
  transition: all 0.2s ease;
}

select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}