/* ==========================================================================
   PANEL DE CONTROL - COMUNIC ARTE SAN LUIS
   Estilos del Gestor de Contenidos (CMS / Admin Dashboard)
   ========================================================================== */

.admin-body {
  background-color: var(--bg-page);
  color: var(--text-primary);
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
}

/* --------------------------------------------------------------------------
   1. LOGIN OVERLAY
   -------------------------------------------------------------------------- */
.admin-auth-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(59, 7, 100, 0.65);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.admin-auth-overlay.hidden {
  display: none !important;
}

.auth-card {
  background-color: var(--bg-surface);
  border: 1.5px solid var(--border-lila);
  border-radius: var(--radius-xl);
  padding: 2.75rem 2.25rem;
  max-width: 420px;
  width: 100%;
  box-shadow: var(--shadow-xl);
  text-align: center;
}

.auth-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 2rem;
}

.auth-brand .logo-badge {
  margin-bottom: 1rem;
  width: 52px;
  height: 52px;
}

.auth-brand h2 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--color-secondary);
  margin-bottom: 0.25rem;
}

.auth-brand p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.auth-form .form-group {
  margin-bottom: 1.5rem;
  text-align: left;
}

.auth-back-link {
  display: inline-block;
  margin-top: 1.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-primary);
}

.auth-back-link:hover {
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   2. MAIN ADMIN LAYOUT
   -------------------------------------------------------------------------- */
.admin-layout {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 100vh;
}

@media (min-width: 1024px) {
  .admin-layout {
    grid-template-columns: 280px 1fr;
  }
}

/* Sidebar */
.admin-sidebar {
  background-color: var(--bg-surface);
  border-right: 1.5px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  padding: 1.75rem 1.25rem;
}

.sidebar-header {
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 1.5rem;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex-grow: 1;
}

.sidebar-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.8rem 1rem;
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  text-align: left;
  transition: all var(--transition-fast);
}

.sidebar-btn svg {
  width: 20px;
  height: 20px;
  color: var(--color-primary);
  flex-shrink: 0;
}

.sidebar-btn:hover {
  background-color: var(--color-primary-light);
  color: var(--color-primary);
}

.sidebar-btn.active {
  background: linear-gradient(135deg, var(--color-primary-light), var(--bg-alt));
  border-color: var(--border-lila);
  color: var(--color-secondary);
  font-weight: 700;
}

.badge-count {
  margin-left: auto;
  font-size: 0.75rem;
  font-weight: 800;
  background-color: var(--color-primary);
  color: #fff8f3;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-full);
}

.sidebar-footer {
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.btn-logout {
  background: none;
  border: none;
  font-size: 0.85rem;
  font-weight: 600;
  color: #dc2626;
  cursor: pointer;
  padding: 0.5rem;
  text-align: center;
}

.btn-logout:hover {
  text-decoration: underline;
}

/* Main Area */
.admin-main {
  background-color: var(--bg-page);
  padding: 2.25rem 2rem;
  overflow-y: auto;
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
}

.topbar-title {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--color-secondary);
  line-height: 1.2;
}

.topbar-subtitle {
  font-size: 0.925rem;
  color: var(--text-secondary);
}

/* Stats Row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  margin-bottom: 2rem;
}

@media (min-width: 768px) {
  .stats-row {
    grid-template-columns: repeat(4, 1fr);
  }
}

.stat-box {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.stat-box-num {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--color-primary);
  line-height: 1.1;
  margin-bottom: 0.25rem;
}

.stat-box-label {
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Tab Management */
.admin-tab-content {
  display: none;
}

.admin-tab-content.active {
  display: block;
}

/* Panel Cards */
.admin-panel-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 2rem;
}

.panel-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.75rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.panel-card-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--color-secondary);
}

.panel-card-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.search-input {
  max-width: 280px;
}

/* Table */
.table-responsive {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.admin-table th {
  background-color: var(--bg-alt);
  padding: 0.85rem 1rem;
  font-size: 0.775rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-secondary);
  border-bottom: 1.5px solid var(--border-subtle);
}

.admin-table td {
  padding: 1rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.admin-table tr:hover td {
  background-color: rgba(243, 232, 255, 0.35);
}

.badge-tag-sm {
  display: inline-block;
  font-size: 0.725rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  background-color: var(--color-primary-light);
  color: var(--color-primary);
  border: 1px solid var(--border-lila);
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-icon {
  background: var(--bg-alt);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-icon:hover {
  background-color: var(--color-primary-light);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.btn-icon.danger {
  color: #dc2626;
}

.btn-icon.danger:hover {
  background-color: #fee2e2;
  border-color: #fca5a5;
}

/* Modal de Noticias */
.admin-modal {
  border: 1.5px solid var(--border-lila);
  border-radius: var(--radius-xl);
  padding: 0;
  max-width: 680px;
  width: 90%;
  box-shadow: var(--shadow-xl);
  background: var(--bg-surface);
  margin: auto;
}

.admin-modal::backdrop {
  background-color: rgba(59, 7, 100, 0.55);
  backdrop-filter: blur(6px);
}

.modal-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}
