/* ==========================================================================
   ASFINANCIEROS - ESTILOS DEL PANEL ADMINISTRATIVO CMS (ADMIN.CSS)
   ========================================================================== */

.admin-body {
  background-color: #f8fafc;
  color: var(--text-main);
  font-family: var(--font-main);
  min-height: 100vh;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

/* Pantalla Modal de Login */
.admin-login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(12px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.admin-login-card {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-lg);
  max-width: 460px;
  width: 100%;
  padding: 2.5rem;
  box-shadow: 0 25px 60px rgba(15, 23, 42, 0.2);
  text-align: left;
}

.admin-brand-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e2e8f0;
}

.admin-logo {
  max-width: 180px;
  height: auto;
}

.admin-badge {
  padding: 0.3rem 0.75rem;
  background: #eff6ff;
  border: 1px solid #93c5fd;
  border-radius: 30px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #0052cc;
}

.admin-login-card h2 {
  font-size: 1.6rem;
  color: #0f172a;
  margin-bottom: 0.4rem;
}

.admin-login-card p {
  font-size: 0.88rem;
  color: #475569;
  margin-bottom: 1.8rem;
}

.admin-login-footer {
  margin-top: 1.8rem;
  padding-top: 1rem;
  border-top: 1px solid #e2e8f0;
  text-align: center;
}

/* Layout del Dashboard */
.admin-wrapper {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 10;
}

/* Sidebar Navigation */
.admin-sidebar {
  width: 280px;
  background: #0f172a;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  padding: 2rem 1.2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
}

.sidebar-brand {
  margin-bottom: 2rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-logo {
  max-width: 190px;
  height: auto;
  margin-bottom: 1rem;
  display: block;
}

.sidebar-user-info {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: #ffffff;
}

.user-role {
  font-size: 0.78rem;
  color: var(--primary-cyan);
}

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

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.85rem 1.1rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: var(--font-main);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
}

.nav-item:hover {
  background: rgba(0, 102, 255, 0.15);
  color: #fff;
  border-color: rgba(0, 212, 255, 0.2);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(0, 102, 255, 0.3) 0%, rgba(0, 212, 255, 0.15) 100%);
  border: 1px solid var(--primary-cyan);
  color: #ffffff;
  box-shadow: 0 0 15px rgba(0, 212, 255, 0.2);
}

.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-top: 1.2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-danger-link {
  background: none;
  border: none;
  color: #f87171;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.4rem;
  transition: var(--transition);
  text-align: center;
}

.btn-danger-link:hover {
  color: #ef4444;
  text-decoration: underline;
}

/* Área de Contenido Principal */
.admin-main {
  margin-left: 280px;
  flex: 1;
  padding: 2.2rem 2.5rem;
  min-height: 100vh;
}

.admin-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.2rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid #e2e8f0;
}

.admin-topbar h1 {
  font-family: var(--font-display);
  font-size: 1.9rem;
  color: #0f172a;
}

.topbar-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: #15803d;
  background: #f0fdf4;
  padding: 0.4rem 0.9rem;
  border-radius: 30px;
  border: 1px solid #86efac;
}

/* Tab Panes */
.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
  animation: fadeInRight 0.4s ease;
}

.card-admin-box {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-lg);
  padding: 2.2rem;
  box-shadow: 0 4px 20px rgba(0, 50, 120, 0.05);
}

.card-admin-box h2 {
  font-size: 1.35rem;
  color: #0f172a;
  margin-bottom: 0.4rem;
}

.card-admin-box p {
  font-size: 0.9rem;
  color: #475569;
  margin-bottom: 1.8rem;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.2rem;
}

.full-width {
  grid-column: 1 / -1;
}

.admin-grid-layout {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.8rem;
}

/* Tablas Administrativas */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

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

.admin-table th {
  background: #f1f5f9;
  color: #0052cc;
  padding: 1rem 1.2rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid #cbd5e1;
}

.admin-table td {
  padding: 1rem 1.2rem;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
}

.admin-table tbody tr:hover {
  background: #f8fafc;
}

/* Consola de Salida de Ingesta */
.ingesta-console-output {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: var(--radius-sm);
  padding: 1.2rem;
  font-family: monospace;
  font-size: 0.85rem;
  color: #38ef7d;
  white-space: pre-wrap;
  max-height: 250px;
  overflow-y: auto;
}

/* Estilos de Gestión de Servicios e Imágenes CMS */
.cms-service-item-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1.5rem;
  align-items: start;
  transition: var(--transition);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.cms-service-item-card:hover {
  border-color: #0066ff;
  box-shadow: 0 10px 25px rgba(0, 102, 255, 0.08);
}

.cms-service-preview-box {
  width: 100%;
  height: 140px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cms-service-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cms-upload-btn-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.8rem;
  background: rgba(0, 102, 255, 0.2);
  border: 1px solid var(--primary-cyan);
  border-radius: var(--radius-sm);
  color: var(--primary-cyan);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 0.5rem;
  transition: var(--transition);
}

.cms-upload-btn-label:hover {
  background: var(--primary-cyan);
  color: #030811;
}

/* Guía Técnica para el Administrador */
.cms-guidance-box {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-left: 4px solid #0284c7;
  border-radius: var(--radius-sm);
  padding: 1.2rem;
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
  margin-bottom: 1.5rem;
}

.cms-guidance-icon {
  color: #0284c7;
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  padding-top: 0.15rem;
}

.cms-guidance-content {
  font-size: 0.88rem;
  color: #0c4a6e;
  line-height: 1.6;
}

.cms-guidance-list {
  margin: 0.5rem 0 0 1.2rem;
  padding: 0;
}

.cms-guidance-list li {
  margin-bottom: 0.35rem;
}

.cms-guidance-list code {
  background: #e0f2fe;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-weight: 700;
  color: #0369a1;
}

/* Controles Globales del Carrusel */
.carousel-global-controls {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 1.5rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 1.2rem;
  margin-bottom: 1.5rem;
}

.checkbox-inline-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: #334155;
  cursor: pointer;
}

.checkbox-inline-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #0066ff;
  cursor: pointer;
}

/* Tarjeta de Slide de Banner */
.cms-banner-slide-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 1.4rem;
  margin-bottom: 1.2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
  transition: var(--transition);
}

.cms-banner-slide-card:hover {
  border-color: #0284c7;
  box-shadow: 0 8px 20px rgba(2, 132, 199, 0.08);
}

.cms-banner-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.2rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid #f1f5f9;
}

.cms-banner-number-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #eff6ff;
  color: #0052cc;
  font-weight: 700;
  font-size: 0.82rem;
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
}

.cms-banner-actions-bar {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.btn-order-action {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #475569;
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.6rem;
  font-size: 0.8rem;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

.btn-order-action:hover:not(:disabled) {
  background: #e2e8f0;
  color: #0f172a;
}

.btn-order-action:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-delete-slide {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #ef4444;
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.btn-delete-slide:hover {
  background: #ef4444;
  color: #ffffff;
}

.cms-banner-layout-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.5rem;
  align-items: start;
}

.cms-banner-preview-box {
  width: 100%;
  height: 160px;
  background: #0b192c;
  border: 1px dashed #94a3b8;
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cms-banner-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 1024px) {
  .admin-sidebar {
    width: 220px;
  }
  .admin-main {
    margin-left: 220px;
    padding: 1.5rem;
  }
  .admin-grid-layout,
  .form-grid-2,
  .carousel-global-controls,
  .cms-banner-layout-grid,
  .cms-service-item-card {
    grid-template-columns: 1fr;
  }
}


