/* ========================================================
   FESBO - admin.css
   Hoja de Estilos Oficial del Panel Administrativo y Login
   Fundación Educativa Simón Bolívar
   ======================================================== */

:root {
  /* Paleta Corporativa FESBO */
  --oro-primario: #f59e0b;
  --oro-brillante: #fbbf24;
  --oro-hover: #d97706;
  --oro-dark: #b45309;
  --oro-glow: rgba(245, 158, 11, 0.35);
  --oro-border: rgba(245, 158, 11, 0.4);

  /* Fondos y Superficies Noche / Navy */
  --admin-bg: #030c1d;
  --admin-sidebar-bg: #051329;
  --admin-card-bg: rgba(10, 24, 50, 0.75);
  --admin-card-hover: rgba(13, 33, 70, 0.9);
  --admin-surface: #0a1832;
  --admin-surface-alt: #0d2146;
  --admin-border: rgba(255, 255, 255, 0.08);
  --admin-border-focus: rgba(245, 158, 11, 0.5);

  /* Tipografías y Colores */
  --admin-text-main: #e2e8f0;
  --admin-text-muted: #94a3b8;
  --admin-text-heading: #ffffff;
  --admin-radius-sm: 8px;
  --admin-radius-md: 14px;
  --admin-radius-lg: 20px;
  --admin-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.4);
  --admin-shadow-glow: 0 0 25px rgba(245, 158, 11, 0.2);
}

/* ========================================================
   RESETEO BASE Y TIPOGRAFÍA
   ======================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body.login-body,
body.admin-body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--admin-bg);
  color: var(--admin-text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.font-cinzel {
  font-family: 'Cinzel', serif;
  letter-spacing: 0.02em;
}

/* ========================================================
   1. PANTALLA DE INICIO DE SESIÓN (LOGIN)
   ======================================================== */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(circle at 50% 10%, #0d2146 0%, #051329 55%, #030c1d 100%);
  position: relative;
  overflow-x: hidden;
}

.login-body::before {
  content: "";
  position: absolute;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 650px;
  height: 650px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.12) 0%, rgba(245, 158, 11, 0) 70%);
  pointer-events: none;
  z-index: 0;
}

.login-card-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 460px;
  background: var(--admin-card-bg);
  border: 1px solid var(--admin-border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: var(--admin-radius-lg);
  padding: 40px 36px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(245, 158, 11, 0.15);
  text-align: center;
  animation: loginFadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.login-brand-logo {
  width: 76px;
  height: 76px;
  object-fit: contain;
  margin: 0 auto 16px;
  filter: drop-shadow(0 6px 14px rgba(245, 158, 11, 0.35));
  transition: transform 0.3s ease;
}

.login-brand-logo:hover {
  transform: scale(1.06) rotate(2deg);
}

.login-title {
  font-size: 23px;
  font-weight: 800;
  color: var(--admin-text-heading);
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.login-subtitle {
  font-size: 13px;
  color: var(--admin-text-muted);
  margin-bottom: 24px;
}

.login-demo-helper {
  background: rgba(13, 33, 70, 0.6);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--admin-radius-md);
  padding: 14px 16px;
  text-align: left;
  margin-bottom: 22px;
}

.form-field-group {
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  text-align: left;
}

.form-field-group label {
  font-size: 12.5px;
  font-weight: 700;
  color: #cbd5e1;
  letter-spacing: 0.02em;
}

.form-field-group input,
.form-field-group select,
.form-field-group textarea {
  width: 100%;
  padding: 12px 15px;
  border-radius: var(--admin-radius-sm);
  background: rgba(5, 19, 41, 0.85);
  border: 1px solid var(--admin-border);
  color: #ffffff;
  font-size: 13.5px;
  font-family: inherit;
  transition: all 0.25s ease;
  outline: none;
}

.form-field-group input:focus,
.form-field-group select:focus,
.form-field-group textarea:focus {
  border-color: var(--oro-primario);
  box-shadow: 0 0 0 3px var(--oro-glow);
  background: rgba(10, 24, 50, 0.95);
}

.form-field-group select option {
  background-color: #051329;
  color: #ffffff;
}

.form-grid-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 600px) {
  .form-grid-two {
    grid-template-columns: 1fr;
  }
}

.btn-secondary-action {
  background: rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius-sm);
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
  font-family: inherit;
}

.btn-secondary-action:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.btn-login-submit,
.btn-primary-action {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #00142e;
  border: none;
  border-radius: var(--admin-radius-sm);
  padding: 12px 20px;
  font-size: 13.5px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.35);
  transition: all 0.25s ease;
  font-family: inherit;
}

.btn-login-submit:hover,
.btn-primary-action:hover {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
}

.btn-login-submit:disabled,
.btn-primary-action:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.login-back-link {
  display: inline-block;
  margin-top: 22px;
  font-size: 12.5px;
  color: var(--admin-text-muted);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.login-back-link:hover {
  color: var(--oro-brillante);
}

/* ========================================================
   2. LAYOUT DEL PANEL ADMINISTRATIVO (DASHBOARD)
   ======================================================== */
.admin-wrapper {
  display: flex;
  min-height: 100vh;
}

/* 2.1 Barra Lateral (Sidebar) */
.admin-sidebar {
  width: 270px;
  background: var(--admin-sidebar-bg);
  border-right: 1px solid var(--admin-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 100;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-header {
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--admin-border);
}

.sidebar-logo-img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  filter: drop-shadow(0 3px 8px rgba(245, 158, 11, 0.35));
}

.sidebar-brand-info h2 {
  font-size: 16px;
  font-weight: 800;
  color: var(--admin-text-heading);
  letter-spacing: 0.04em;
  line-height: 1.2;
}

.sidebar-brand-info span {
  font-size: 11px;
  color: var(--oro-primario);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.sidebar-nav-container {
  padding: 20px 14px;
  flex: 1;
  overflow-y: auto;
}

.sidebar-section-title {
  font-size: 10.5px;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0 10px;
  margin: 16px 0 8px;
}

.sidebar-section-title:first-child {
  margin-top: 0;
}

.sidebar-menu-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--admin-radius-sm);
  color: #94a3b8;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
}

.sidebar-link.active {
  background: rgba(245, 158, 11, 0.15);
  color: var(--oro-brillante);
  border: 1px solid rgba(245, 158, 11, 0.3);
  font-weight: 700;
}

.sidebar-icon {
  font-size: 16px;
}

.sidebar-badge-count {
  margin-left: auto;
  font-size: 11px;
  font-weight: 800;
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 7px;
  border-radius: 9999px;
  color: #cbd5e1;
}

.sidebar-footer {
  padding: 16px 18px;
  border-top: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.2);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f59e0b 0%, #b45309 100%);
  color: #00142e;
  font-weight: 900;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

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

.user-info h4 {
  font-size: 12.5px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-sidebar-logout {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 15px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.btn-sidebar-logout:hover {
  background: rgba(239, 68, 68, 0.3);
  transform: scale(1.08);
}

/* 2.2 Área Principal (Main Content) */
.admin-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.admin-topbar {
  background: var(--admin-sidebar-bg);
  border-bottom: 1px solid var(--admin-border);
  padding: 18px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  position: sticky;
  top: 0;
  z-index: 90;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn-toggle-sidebar {
  display: none;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--admin-border);
  color: #ffffff;
  font-size: 18px;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.topbar-title-block h1 {
  font-size: 20px;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.25;
}

.topbar-title-block p {
  font-size: 12.5px;
  color: var(--admin-text-muted);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-right .btn-primary-action {
  width: auto;
  padding: 9px 18px;
  font-size: 12.5px;
}

.topbar-action-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--admin-border);
  color: #cbd5e1;
  padding: 9px 15px;
  border-radius: var(--admin-radius-sm);
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.topbar-action-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.admin-content {
  padding: 32px;
  flex: 1;
}

/* ========================================================
   3. TARJETAS, TABLA Y COMPONENTES
   ======================================================== */
.table-panel-card {
  background: var(--admin-card-bg);
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius-md);
  box-shadow: var(--admin-shadow);
  overflow: hidden;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.filter-chip-btn {
  background: rgba(255, 255, 255, 0.04);
  color: #94a3b8;
  border: 1px solid var(--admin-border);
  padding: 6px 12px;
  border-radius: 9999px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.filter-chip-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.filter-chip-btn.active {
  background: rgba(245, 158, 11, 0.18);
  color: var(--oro-brillante);
  border-color: rgba(245, 158, 11, 0.45);
}

.topbar-search-box {
  position: relative;
  min-width: 240px;
}

.topbar-search-box input {
  width: 100%;
  padding: 8px 12px 8px 34px;
  background: rgba(5, 19, 41, 0.8);
  border: 1px solid var(--admin-border);
  border-radius: 9999px;
  color: #ffffff;
  font-size: 12.5px;
  outline: none;
  transition: all 0.25s ease;
}

.topbar-search-box input:focus {
  border-color: var(--oro-primario);
  box-shadow: 0 0 0 3px var(--oro-glow);
}

.search-icon-inside {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  pointer-events: none;
  opacity: 0.6;
}

.table-responsive-wrapper {
  width: 100%;
  overflow-x: auto;
}

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

.admin-data-table th {
  background: rgba(0, 0, 0, 0.25);
  color: #94a3b8;
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 14px 20px;
  border-bottom: 1px solid var(--admin-border);
}

.admin-data-table td {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 13px;
  vertical-align: middle;
}

.admin-data-table tbody tr {
  transition: background-color 0.2s ease;
}

.admin-data-table tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.03);
}

/* Insignias de Estado */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.status-badge.approved {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.status-badge.review {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.status-badge.pending {
  background: rgba(148, 163, 184, 0.15);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.pct-tag {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
}

/* Botones de Acción de Tabla */
.btn-table-icon {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--admin-border);
  color: #cbd5e1;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.btn-table-icon:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  transform: translateY(-1px);
}

.btn-table-icon.btn-danger {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.3);
}

.btn-table-icon.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #ef4444;
}

/* ========================================================
   4. MODAL DE PUBLICACIÓN (CREAR / EDITAR)
   ======================================================== */
.admin-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 12, 29, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.admin-modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.admin-modal-box {
  background: #071936;
  border: 1px solid rgba(245, 158, 11, 0.3);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), 0 0 30px rgba(245, 158, 11, 0.15);
  border-radius: var(--admin-radius-lg);
  padding: 30px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95) translateY(15px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.admin-modal-backdrop.active .admin-modal-box {
  transform: scale(1) translateY(0);
}

.modal-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--admin-border);
  padding-bottom: 14px;
}

.modal-header-row h3 {
  font-size: 18px;
  font-weight: 800;
  color: #ffffff;
}

.btn-close-modal {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--admin-border);
  color: #94a3b8;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-close-modal:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.4);
}

.modal-actions-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--admin-border);
}

.modal-actions-footer button {
  width: auto;
}

/* ========================================================
   5. RESPONSIVE Y MEDIA QUERIES
   ======================================================== */
@media (max-width: 900px) {
  .admin-sidebar {
    position: fixed;
    transform: translateX(-100%);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
  }

  .admin-sidebar.active {
    transform: translateX(0);
  }

  .btn-toggle-sidebar {
    display: flex;
  }

  .admin-topbar {
    padding: 16px 20px;
  }

  .admin-content {
    padding: 20px;
  }
}

@media (max-width: 640px) {
  .topbar-right .btn-primary-action span:last-child {
    display: none;
  }

  .topbar-title-block p {
    display: none;
  }

  .modal-actions-footer {
    flex-direction: column-reverse;
  }

  .modal-actions-footer button {
    width: 100%;
  }
}
