/* ============================================================
   PERIÓDICO ESCOLAR — DESIGN SYSTEM
   Modo oscuro editorial. Variables en :root para cambio rápido.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600&family=Strichpunkt+Sans:wght@400..900&display=swap');

:root {
  /* Superficies */
  --bg-page:        #0a0d14;
  --bg-nav:         #060810;
  --bg-sidebar:     #0e1220;
  --bg-card:        #131929;
  --bg-card-hover:  #1a2236;
  --bg-input:       #0e1220;
  --bg-overlay:     rgba(6, 8, 16, 0.85);

  /* Acento principal */
  --accent:         #e8543a;
  --accent-dim:     rgba(232, 84, 58, 0.15);
  --accent-hover:   #f0674f;

  /* Texto */
  --text-primary:   #eef0f6;
  --text-secondary: #8892a4;
  --text-muted:     #4a5568;
  --text-nav:       #c8d0df;

  /* Bordes */
  --border:         rgba(255,255,255,0.07);
  --border-accent:  rgba(232, 84, 58, 0.4);

  /* Sombras */
  --shadow-sm:      0 2px 8px rgba(0,0,0,0.4);
  --shadow-md:      0 8px 32px rgba(0,0,0,0.5);
  --shadow-accent:  0 4px 24px rgba(232, 84, 58, 0.25);

  /* Dimensiones de layout */
  --nav-height:     64px;
  --sidebar-width:  240px;
  --sidebar-collapsed: 64px;

  /* Tipografía */
  --font-display:   'Strichpunkt Sans', sans-serif;
  --font-body:      'DM Sans', sans-serif;

  /* Transiciones */
  --transition:     0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg-page);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: var(--font-body); }

/* ── Scrollbar ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-nav); }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-height);
  background: var(--bg-nav);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  z-index: 100;
  gap: 1rem;
}

/* Logo */
.navbar__brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: var(--sidebar-width);
  flex-shrink: 0;
}

.navbar__logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 6px;
}

.navbar__logo-placeholder {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: var(--accent-dim);
  border: 1px solid var(--border-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--accent);
  font-weight: 700;
  flex-shrink: 0;
}

.navbar__site-name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Centro del nav */
.navbar__center {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Acciones del nav (derecha) */
.navbar__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.navbar__links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
}

.navbar__links a {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.9rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-nav);
  transition: background var(--transition), color var(--transition);
}

.navbar__links a:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text-primary);
}

.navbar__links a.active {
  background: var(--accent-dim);
  color: var(--accent);
}

/* Botón hamburguesa */
.navbar__toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-nav);
  padding: 0.4rem;
  border-radius: 6px;
  transition: background var(--transition);
}
.navbar__toggle:hover { background: rgba(255,255,255,0.06); }
.navbar__toggle svg { width: 22px; height: 22px; display: block; }

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  position: fixed;
  top: var(--nav-height);
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 90;
  transition: transform var(--transition), width var(--transition);
}

.sidebar__section {
  padding: 1.25rem 0.75rem 0.5rem;
}

.sidebar__label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 0.75rem;
  margin-bottom: 0.4rem;
}

.sidebar__nav {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.sidebar__nav a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--text-secondary);
  transition: background var(--transition), color var(--transition), padding var(--transition);
  position: relative;
}

.sidebar__nav a:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text-primary);
}

.sidebar__nav a.active {
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 500;
}

.sidebar__nav a.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 60%;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}

.sidebar__icon {
  width: 18px; height: 18px;
  flex-shrink: 0;
  opacity: 0.7;
  transition: opacity var(--transition);
}
.sidebar__nav a:hover .sidebar__icon,
.sidebar__nav a.active .sidebar__icon { opacity: 1; }

.sidebar__divider {
  height: 1px;
  background: var(--border);
  margin: 0.5rem 1rem;
}

.sidebar__footer {
  margin-top: auto;
  padding: 1rem 0.75rem;
  border-top: 1px solid var(--border);
}

.sidebar__footer a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: background var(--transition), color var(--transition);
}

.sidebar__footer a:hover {
  background: rgba(232, 84, 58, 0.1);
  color: var(--accent);
}

/* ============================================================
   LAYOUT PRINCIPAL
   ============================================================ */
.page-wrapper {
  padding-top: var(--nav-height);
  padding-left: var(--sidebar-width);
  min-height: 100vh;
  transition: padding-left var(--transition);
}

.page-content {
  padding: 2rem 2.5rem;
  max-width: 1400px;
}

/* ============================================================
   TIPOGRAFÍA DE CONTENIDO
   ============================================================ */
.page-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
}

.page-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

/* ============================================================
   TARJETAS
   ============================================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  transition: background var(--transition), border-color var(--transition);
}

.card:hover { background: var(--bg-card-hover); border-color: rgba(255,255,255,0.1); }

/* ============================================================
   BOTONES
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.25rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-accent);
}
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: rgba(255,255,255,0.05); color: var(--text-primary); border-color: rgba(255,255,255,0.12); }

.btn-danger {
  background: rgba(220, 53, 69, 0.15);
  color: #e05c6a;
  border: 1px solid rgba(220, 53, 69, 0.25);
}
.btn-danger:hover { background: rgba(220, 53, 69, 0.25); }

/* ============================================================
   TABLAS
   ============================================================ */
.table-wrapper {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

thead tr {
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--border);
}

thead th {
  padding: 0.85rem 1.25rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: rgba(255,255,255,0.025); }

tbody td {
  padding: 0.85rem 1.25rem;
  color: var(--text-secondary);
  vertical-align: middle;
}

tbody td:first-child { color: var(--text-primary); font-weight: 500; }

/* ============================================================
   FORMULARIOS
   ============================================================ */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 1.25rem;
}

label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
textarea,
select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.65rem 1rem;
  font-size: 0.9rem;
  font-family: var(--font-body);
  color: var(--text-primary);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  width: 100%;
}

input::placeholder, textarea::placeholder { color: var(--text-muted); }

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

select option { background: var(--bg-card); }

textarea { resize: vertical; min-height: 120px; }

/* Mensaje de error */
.alert-error {
  background: rgba(220, 53, 69, 0.1);
  border: 1px solid rgba(220, 53, 69, 0.25);
  color: #e05c6a;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-page);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}

/* Textura de fondo sutil */
.login-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(ellipse 80% 60% at 20% 40%, rgba(232,84,58,0.06) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 70%, rgba(60,80,140,0.07) 0%, transparent 55%);
  pointer-events: none;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow-md);
  position: relative;
  z-index: 1;
  animation: fadeUp 0.4s ease both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.login-card__logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
  text-align: center;
}

.login-card__logo img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 10px;
}

.login-card__logo-placeholder {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  background: var(--accent-dim);
  border: 1px solid var(--border-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--accent);
  font-weight: 900;
}

.login-card__title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-top: 0.25rem;
}

.login-card__subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
}

.login-card .btn-primary {
  width: 100%;
  justify-content: center;
  padding: 0.75rem;
  font-size: 0.9rem;
  margin-top: 0.5rem;
  border-radius: 8px;
}

/* ============================================================
   OVERLAY para sidebar en mobile
   ============================================================ */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  z-index: 85;
  opacity: 0;
  transition: opacity var(--transition);
}
.sidebar-overlay.visible { opacity: 1; }

/* ============================================================
   BADGES / ETIQUETAS
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.badge-accent  { background: var(--accent-dim); color: var(--accent); }
.badge-success { background: rgba(52,211,153,0.12); color: #34d399; }
.badge-warning { background: rgba(251,191,36,0.12); color: #fbbf24; }
.badge-muted   { background: rgba(255,255,255,0.05); color: var(--text-muted); }

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Tablet */
@media (max-width: 1024px) {
  .page-content { padding: 1.5rem; }
  .navbar__site-name { font-size: 1rem; }
}

/* Mobile */
@media (max-width: 768px) {
  :root {
    --sidebar-width: 0px;
  }

  .navbar {
    padding: 0 1rem;
  }

  .navbar__brand {
    min-width: unset;
  }

  .navbar__toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .navbar__links {
    display: none;
  }

  .sidebar {
    width: 240px;
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay {
    display: block;
  }

  .page-wrapper {
    padding-left: 0;
  }

  .page-content {
    padding: 1.25rem 1rem;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .page-title { font-size: 1.5rem; }

  .login-card { padding: 2rem 1.25rem; }
}

@media (max-width: 480px) {
  .page-title { font-size: 1.3rem; }
  .table-wrapper { font-size: 0.82rem; }
}

/* ============================================================
   DASHBOARD
   ============================================================ */

/* Hero de bienvenida */
.dashboard-hero {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem 2.5rem;
  margin-bottom: 2rem;
  overflow: hidden;
  animation: fadeUp 0.35s ease both;
}

.dashboard-hero__text {
  position: relative;
  z-index: 1;
}

.dashboard-hero__greeting {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0.3rem;
}

.dashboard-hero__name {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 0.75rem;
}

.dashboard-hero__role {
  font-size: 0.75rem;
}

/* Decoración de fondo del hero */
.dashboard-hero__decoration {
  position: absolute;
  right: -40px;
  top: -40px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-dim) 0%, transparent 70%);
  pointer-events: none;
}

/* Etiqueta de sección */
.dashboard-section-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

/* Grid de accesos rápidos */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

/* Tarjeta de acceso rápido */
.dashboard-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
  color: inherit;
  text-decoration: none;
  transition:
    background var(--transition),
    border-color var(--transition),
    transform var(--transition),
    box-shadow var(--transition);
  animation: fadeUp 0.35s ease both;
}

.dashboard-card:nth-child(1) { animation-delay: 0.05s; }
.dashboard-card:nth-child(2) { animation-delay: 0.1s;  }
.dashboard-card:nth-child(3) { animation-delay: 0.15s; }

.dashboard-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.dashboard-card__icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--accent-dim);
  border: 1px solid var(--border-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  transition: background var(--transition);
}

.dashboard-card__icon svg {
  width: 22px;
  height: 22px;
}

.dashboard-card:hover .dashboard-card__icon {
  background: rgba(232, 84, 58, 0.22);
}

.dashboard-card__body {
  flex: 1;
  min-width: 0;
}

.dashboard-card__title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
}

.dashboard-card__desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.dashboard-card__arrow {
  flex-shrink: 0;
  color: var(--text-muted);
  transition: color var(--transition), transform var(--transition);
}

.dashboard-card__arrow svg {
  width: 18px;
  height: 18px;
}

.dashboard-card:hover .dashboard-card__arrow {
  color: var(--accent);
  transform: translateX(3px);
}

/* Responsive dashboard */
@media (max-width: 768px) {
  .dashboard-hero {
    padding: 1.5rem;
  }

  .dashboard-hero__name {
    font-size: 1.6rem;
  }

  .dashboard-hero__decoration {
    width: 160px;
    height: 160px;
    right: -20px;
    top: -20px;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .dashboard-hero__name { font-size: 1.35rem; }
  .dashboard-card { padding: 1.1rem; }
}

/* ============================================================
   ALERTAS
   ============================================================ */
.alert {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  margin-bottom: 1.25rem;
}

.alert-success {
  background: rgba(52, 211, 153, 0.1);
  border: 1px solid rgba(52, 211, 153, 0.25);
  color: #34d399;
}

/* ============================================================
   TABLA — ACCIONES
   ============================================================ */
.table-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  text-decoration: none;
  flex-shrink: 0;
}

.btn-icon svg { width: 15px; height: 15px; }

.btn-icon:hover {
  background: rgba(255,255,255,0.07);
  color: var(--text-primary);
}

.btn-icon--danger:hover {
  background: rgba(220, 53, 69, 0.15);
  color: #e05c6a;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 4rem 2rem;
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.empty-state__icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--accent-dim);
  border: 1px solid var(--border-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  margin-bottom: 0.25rem;
}

.empty-state__icon svg { width: 24px; height: 24px; }

.empty-state__title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.empty-state__desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

/* ============================================================
   FORMULARIOS — LAYOUT
   ============================================================ */
.form-layout {
  max-width: 780px;
}

.form-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-required {
  color: var(--accent);
  margin-left: 2px;
}

.form-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding-top: 1.25rem;
  margin-top: 0.5rem;
  border-top: 1px solid var(--border);
}

/* ============================================================
   ARTÍCULO VER
   ============================================================ */
.articulo-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.articulo-meta__sep {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.articulo-meta__item {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.page-header-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.articulo-layout {
  max-width: 780px;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.articulo-resumen {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.7;
  padding: 1.25rem 1.5rem;
  border-left: 3px solid var(--accent);
  background: var(--bg-card);
  border-radius: 0 10px 10px 0;
}

.articulo-contenido {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.85;
  white-space: pre-wrap;
}

/* Responsive formularios y artículo */
@media (max-width: 640px) {
  .form-row { grid-template-columns: 1fr; }
  .form-card { padding: 1.25rem; }
  .form-footer { flex-direction: column-reverse; }
  .form-footer .btn { width: 100%; justify-content: center; }
  .articulo-resumen { font-size: 0.95rem; }
}

/* ============================================================
   TABLA — CELDA SECUNDARIA
   ============================================================ */
.td-secondary {
  color: var(--text-muted) !important;
  font-size: 0.82rem;
  font-weight: 400 !important;
}

/* ============================================================
   INPUT DATE — estilo consistente
   ============================================================ */
input[type="date"] {
  color-scheme: dark;
}

/* ============================================================
   Aporte Codex: imagenes multiples para articulos
   ============================================================ */
.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.image-grid img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-card);
}

.image-item {
  display: grid;
  gap: 0.5rem;
}
/* Fin aporte Codex: imagenes multiples para articulos */

/* ============================================================
   ARTÍCULO PÚBLICO — PORTADA Y GALERÍA
   ============================================================ */
.articulo-portada {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--border);
  margin-bottom: 0.5rem;
  cursor: zoom-in;
}

.articulo-galeria {
  margin-top: 2rem;
}

.articulo-galeria__label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.articulo-galeria__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr));
  gap: 1rem;
}

.articulo-galeria__img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  cursor: zoom-in;
}

/* ============================================================
   LIGHTBOX
   ============================================================ */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(6, 8, 16, 0.92);
  align-items: center;
  justify-content: center;
  visibility: hidden;
}
.lightbox.activo {
  display: flex;
  visibility: visible;
}
.lightbox__img {
  max-width: 90vw;
  max-height: 88vh;
  border-radius: 10px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.7);
  border: 1px solid var(--border);
  object-fit: contain;
  transition: opacity 0.2s ease;
}

/* Botón base compartido */
.lightbox__btn {
  position: fixed;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.3s ease;
  z-index: 1000;
}

.lightbox__btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* Cerrar */
.lightbox__close {
  top: 1.25rem;
  right: 1.25rem;
  width: 40px;
  height: 40px;
}

.lightbox__close:hover {
  transform: rotate(90deg) scale(1.15);
  background: red;
  color: #fff;
  border-color: #fff;
}

.lightbox__close i {
  font-size: 1.1rem;
}

/* Anterior / Siguiente */
.lightbox__prev {
  left: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox__next {
  right: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox__prev:hover,
 .lightbox__next:hover{
  background: rgb(0, 121, 0);
  color: #fff;
  border-color: #0f0;
  transform: translateY(-50%) scale(1.15);
}

/* .lightbox__next:hover {
  background: rgb(0, 121, 0);
  color: #fff;
  border-color: var(--accent);
  transform: translateY(-50%);
} */


.lightbox__prev i,
.lightbox__next i {
  font-size: 1rem;
}

/* Contador */
.lightbox__counter {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.8rem;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  z-index: 1000;
  font-family: var(--font-body);
}