/* ========================================================
   DRAW2CHAR AI - Estilos del Panel de Administración
   ======================================================== */

.admin-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  max-width: 1600px;
  margin: 1.5rem auto;
  padding: 0 1.5rem;
  gap: 2rem;
  min-height: calc(100vh - 120px);
}

@media (max-width: 900px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }
}

/* Sidebar de Navegación Admin */
.admin-sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  height: fit-content;
}

.admin-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.admin-menu-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.925rem;
  cursor: pointer;
  transition: var(--transition);
}

.admin-menu-item:hover, .admin-menu-item.active {
  background: rgba(99, 102, 241, 0.12);
  color: #fff;
  border-left: 3px solid var(--primary);
}

/* Tarjetas de Métricas */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.metric-icon-box {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.icon-blue   { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.icon-purple { background: rgba(168, 85, 247, 0.15); color: #c084fc; }
.icon-green  { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.icon-amber  { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }

.metric-value {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.2;
}

.metric-label {
  font-size: 0.825rem;
  color: var(--text-muted);
}

/* Secciones de Contenido */
.admin-tab-content {
  display: none;
}

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

/* Formularios de Configuración */
.form-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 2rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.form-input, .form-select {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition);
}

.form-input:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.25);
}

.input-with-button {
  display: flex;
  gap: 0.5rem;
}

/* Switch Toggle Switches */
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-color);
}

.switch-label-title {
  font-size: 0.95rem;
  font-weight: 600;
}

.switch-label-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider-switch {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--bg-elevated);
  border: 1px solid var(--border-color);
  transition: .3s;
  border-radius: 34px;
}

.slider-switch:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: #fff;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .slider-switch {
  background-color: var(--primary);
}

input:checked + .slider-switch:before {
  transform: translateX(22px);
}

/* Tablas Administrativas */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

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

.admin-table th {
  background: var(--bg-elevated);
  padding: 1rem;
  font-weight: 700;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
}

.admin-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-card);
}

.admin-table tr:hover td {
  background: var(--bg-card-hover);
}

/* Insignias de Estado */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
}

.badge-success { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.badge-danger  { background: rgba(244, 63, 94, 0.15);  color: #f43f5e; }
.badge-info    { background: rgba(99, 102, 241, 0.15); color: #a5b4fc; }

/* ========================================================
   PANTALLA DE LOGIN DEL PANEL DE ADMINISTRACIÓN
   ======================================================== */
.admin-auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 2500;
  background: rgba(10, 11, 16, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.admin-auth-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.admin-login-card {
  max-width: 460px;
  width: 100%;
  background: var(--bg-card);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  box-shadow: 0 0 50px rgba(99, 102, 241, 0.25);
  position: relative;
  overflow: hidden;
  animation: adminCardPop 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes adminCardPop {
  from { transform: scale(0.92) translateY(20px); opacity: 0; }
  to   { transform: scale(1) translateY(0); opacity: 1; }
}

.admin-shield-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(168, 85, 247, 0.3));
  border: 2px solid var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.85rem;
  margin: 0 auto 1.25rem;
  box-shadow: 0 0 25px rgba(99, 102, 241, 0.4);
}

.admin-badge-pill {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #a5b4fc;
  background: rgba(99, 102, 241, 0.15);
  padding: 0.2rem 0.75rem;
  border-radius: var(--radius-full);
  margin-bottom: 0.5rem;
}

.admin-info-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  font-size: 0.825rem;
  color: var(--text-secondary);
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.admin-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
}

