/* PANEL DE ADMINISTRACIÓN CORPORATIVO - ECOSOFT WEBINARS */

html, body {
  max-width: 100%;
  overflow-x: hidden;
}

.admin-body {
  background-color: #F8FAFC;
  color: #1E293B;
  min-height: 100vh;
  font-family: var(--font-body);
}

.admin-header {
  background: #FFFFFF;
  border-bottom: 1px solid #E2E8F0;
  padding: 14px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.admin-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-title {
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: #0F172A;
}

.admin-title img {
  height: 40px;
  width: auto;
}

.admin-tag {
  background: #EFF6FF;
  color: #2563EB;
  border: 1px solid #BFDBFE;
  font-size: 0.72rem;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-weight: 700;
}

/* PANTALLA DE LOGIN LIMPIA Y CLARA */
.admin-login-wrapper {
  min-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
  text-align: center;
}

.login-credentials-badge {
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  border-radius: 8px;
  padding: 12px;
  margin: 20px 0;
  font-size: 0.88rem;
  color: #1E40AF;
  text-align: left;
}

/* KPIS GRID */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.kpi-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.kpi-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--primary);
}

.kpi-label {
  font-size: 0.85rem;
  color: #64748B;
  font-weight: 600;
  font-family: var(--font-heading);
}

.kpi-value {
  font-size: 1.85rem;
  font-weight: 800;
  color: #0F172A;
  font-family: var(--font-heading);
  letter-spacing: -0.02em;
}

.kpi-subtext {
  font-size: 0.78rem;
  color: #94A3B8;
}

/* ADMIN CARDS & SECTIONS */
.admin-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.admin-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid #F1F5F9;
  flex-wrap: wrap;
  gap: 12px;
}

.admin-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #0F172A;
}

/* TABS NAVIGATION */
.admin-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 2px solid #E2E8F0;
  margin-bottom: 24px;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}

.admin-tab-btn {
  background: transparent;
  border: none;
  padding: 10px 18px;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  color: #64748B;
  cursor: pointer;
  border-radius: 6px 6px 0 0;
  position: relative;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.admin-tab-btn:hover {
  color: #0F172A;
  background: #F1F5F9;
}

.admin-tab-btn.active {
  color: var(--primary);
  background: #FFFFFF;
}

.admin-tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--primary);
  border-radius: 3px;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

/* TABLES WITH RESPONSIVE CONTAINER */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 16px;
  border: 1px solid #E2E8F0;
  border-radius: var(--radius-md);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  min-width: 600px;
}

.admin-table th {
  background: #F8FAFC;
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  color: #475569;
  border-bottom: 1px solid #E2E8F0;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.admin-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #F1F5F9;
  color: #1E293B;
  vertical-align: middle;
}

.admin-table tr:hover td {
  background: #F8FAFC;
}

/* BADGES DE ESTADO EN ESPAÑOL */
.badge-upcoming-custom {
  background: #E0F2FE;
  color: #0369A1;
  border: 1px solid #BAE6FD;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
}

.badge-live-pulse {
  background: #DC2626;
  color: #FFFFFF;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.badge-draft {
  background: #F1F5F9;
  color: #475569;
  border: 1px solid #CBD5E1;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-trash {
  background: #FEE2E2;
  color: #991B1B;
  border: 1px solid #FECACA;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
}

.badge-published {
  background: #DCFCE7;
  color: #15803D;
  border: 1px solid #BBF7D0;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
}

.badge-hidden {
  background: #FEF3C7;
  color: #92400E;
  border: 1px solid #FDE68A;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
}

/* CHARTS GRID */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  margin: 24px 0;
}

.chart-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.chart-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0F172A;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* FILTROS COMPARTIDOS */
.filters-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  background: #FFFFFF;
  padding: 16px 20px;
  border: 1px solid #E2E8F0;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
}

.filter-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-item label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #64748B;
  white-space: nowrap;
}

/* FORMULARIOS DE SESIÓN Y GRABACIÓN */
.form-section-block {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: var(--radius-md);
  padding: 22px;
  margin-bottom: 22px;
}

.form-section-legend {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0F172A;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-section-desc {
  font-size: 0.85rem;
  color: #64748B;
  margin-bottom: 16px;
}

/* COMPONENTE SUBIDOR DE IMÁGENES */
.image-uploader-box {
  border: 2px dashed #CBD5E1;
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  background: #FFFFFF;
  transition: all 0.2s ease;
  position: relative;
}

.image-uploader-box.dragover {
  border-color: var(--primary);
  background: #EFF6FF;
}

.uploader-preview-container {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 16px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  padding: 12px;
  border-radius: var(--radius-sm);
  flex-wrap: wrap;
}

.uploader-preview-img {
  width: 120px;
  height: 68px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #CBD5E1;
}

.uploader-progress {
  height: 6px;
  background: #E2E8F0;
  border-radius: 3px;
  overflow: hidden;
  margin-top: 10px;
  display: none;
}

.uploader-progress-bar {
  height: 100%;
  background: var(--primary);
  width: 0%;
  transition: width 0.2s ease;
}

/* MODAL OVERLAYS */
.admin-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(3px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.admin-modal-overlay.active {
  display: flex;
}

.admin-modal-content {
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 620px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

.admin-modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid #E2E8F0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-modal-body {
  padding: 24px;
  max-height: 80vh;
  overflow-y: auto;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #F1F5F9;
  font-size: 0.92rem;
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-label {
  color: #64748B;
  font-weight: 600;
}

.detail-value {
  color: #0F172A;
  font-weight: 500;
  text-align: right;
}

/* TOAST NOTIFICATIONS */
.toast-notice {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #0F172A;
  color: #FFFFFF;
  padding: 14px 22px;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  display: none;
  align-items: center;
  gap: 10px;
  font-size: 0.92rem;
  z-index: 2000;
  transition: all 0.3s ease;
}

.toast-notice.success {
  background: #065F46;
  border-left: 4px solid #34D399;
}

.toast-notice.error {
  background: #991B1B;
  border-left: 4px solid #F87171;
}

/* RESPONSIVE MEDIA QUERIES PARA MÓVIL (< 768px y 390px) */
@media (max-width: 768px) {
  .admin-header {
    padding: 10px 0;
  }
  .admin-nav {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .admin-title {
    justify-content: space-between;
  }
  .admin-title img {
    height: 32px;
  }
  .admin-nav-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-start;
  }
  .admin-tabs {
    gap: 4px;
    padding-bottom: 6px;
  }
  .admin-tab-btn {
    padding: 8px 12px;
    font-size: 0.85rem;
  }
  .kpi-grid {
    grid-template-columns: 1fr;
  }
  .charts-grid {
    grid-template-columns: 1fr !important;
  }
  .admin-card {
    padding: 18px;
  }
  .filters-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 14px;
  }
  .filter-item {
    flex-direction: column;
    align-items: stretch;
  }
  .filter-item input, .filter-item select {
    width: 100% !important;
  }
}
