/* ============================================================
   assets/css/estilos.css
   Sistema CRUD de Alumnos — Estilos personalizados
   ============================================================ */

/* ── Variables de color ─────────────────────────────────── */
:root {
  --azul-principal: #0d6efd;
  --azul-oscuro:    #0a58ca;
  --azul-claro:     #cfe2ff;
  --sidebar-bg:     #1a2035;
  --sidebar-hover:  #243050;
  --sidebar-active: #0d6efd;
  --sidebar-text:   #b0bec5;
  --topbar-bg:      #ffffff;
  --body-bg:        #f0f2f5;
  --card-shadow:    0 2px 12px rgba(0,0,0,.08);
  --transition:     .2s ease;
}

/* ── Reset & Base ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  background-color: var(--body-bg);
  color: #343a40;
  min-height: 100vh;
}

/* ── LOGIN ──────────────────────────────────────────────── */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0d6efd 0%, #0a3880 100%);
  padding: 1rem;
}

.login-card {
  width: 100%;
  max-width: 960px;
  border-radius: 1.25rem;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  display: flex;
  min-height: 540px;
}

.login-left {
  background: linear-gradient(160deg, #0d6efd 0%, #051d60 100%);
  color: #fff;
  padding: 3rem 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.login-left::before {
  content: '';
  position: absolute;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: rgba(255,255,255,.06);
  top: -80px;
  right: -80px;
}

.login-left::after {
  content: '';
  position: absolute;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: rgba(255,255,255,.06);
  bottom: -60px;
  left: -60px;
}

.login-left .brand-icon {
  font-size: 3rem;
  margin-bottom: 1.5rem;
  opacity: .9;
}

.login-left h1 {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.login-left p {
  opacity: .8;
  font-size: .95rem;
  line-height: 1.7;
}

.login-left .feature-list {
  list-style: none;
  padding: 0;
  margin-top: 1.5rem;
}

.login-left .feature-list li {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .6rem;
  font-size: .9rem;
  opacity: .85;
}

.login-right {
  background: #fff;
  padding: 3rem 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-right h2 {
  font-size: 1.6rem;
  font-weight: 700;
  color: #1a2035;
  margin-bottom: .4rem;
}

.login-right .subtitle {
  color: #6c757d;
  font-size: .9rem;
  margin-bottom: 2rem;
}

.form-floating label { color: #6c757d; }

.form-control:focus {
  border-color: var(--azul-principal);
  box-shadow: 0 0 0 .2rem rgba(13,110,253,.15);
}

.btn-login {
  background: linear-gradient(90deg, #0d6efd, #0a58ca);
  border: none;
  font-weight: 600;
  letter-spacing: .3px;
  transition: opacity var(--transition), transform var(--transition);
}

.btn-login:hover {
  opacity: .92;
  transform: translateY(-1px);
}

/* ── LAYOUT PRINCIPAL ───────────────────────────────────── */
.wrapper { display: flex; width: 100%; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: 260px;
  min-height: 100vh;
  background: var(--sidebar-bg);
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition);
}

.sidebar-brand {
  padding: 1.4rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,.07);
  display: flex;
  align-items: center;
  gap: .75rem;
  text-decoration: none;
}

.sidebar-brand .brand-logo {
  width: 36px;
  height: 36px;
  background: var(--azul-principal);
  border-radius: .5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: #fff;
  flex-shrink: 0;
}

.sidebar-brand span {
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.2;
}

.sidebar-brand small {
  color: var(--sidebar-text);
  font-size: .72rem;
  font-weight: 400;
  display: block;
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0;
  overflow-y: auto;
}

.nav-section-title {
  color: rgba(176,190,197,.5);
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .5rem 1.5rem;
  margin-top: .5rem;
}

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: .75rem;
  color: var(--sidebar-text);
  padding: .65rem 1.5rem;
  border-radius: 0;
  font-size: .875rem;
  transition: all var(--transition);
  border-left: 3px solid transparent;
}

.sidebar-nav .nav-link i {
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
}

.sidebar-nav .nav-link:hover {
  background: var(--sidebar-hover);
  color: #fff;
  border-left-color: rgba(13,110,253,.5);
}

.sidebar-nav .nav-link.active {
  background: rgba(13,110,253,.15);
  color: #fff;
  border-left-color: var(--azul-principal);
}

.sidebar-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(255,255,255,.07);
}

.sidebar-footer .user-info {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.user-avatar {
  width: 36px;
  height: 36px;
  background: var(--azul-principal);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: .875rem;
  flex-shrink: 0;
}

.user-name {
  color: #fff;
  font-size: .85rem;
  font-weight: 600;
  line-height: 1.2;
}

.user-role {
  color: var(--sidebar-text);
  font-size: .72rem;
}

/* Contenido principal */
.main-content {
  margin-left: 260px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Topbar */
.topbar {
  background: var(--topbar-bg);
  height: 64px;
  border-bottom: 1px solid #e9ecef;
  display: flex;
  align-items: center;
  padding: 0 1.75rem;
  position: sticky;
  top: 0;
  z-index: 900;
  gap: 1rem;
}

.topbar-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: #1a2035;
  flex: 1;
}

.topbar .btn-topbar {
  background: none;
  border: 1px solid #dee2e6;
  border-radius: .5rem;
  color: #495057;
  padding: .35rem .75rem;
  font-size: .85rem;
  transition: all var(--transition);
}

.topbar .btn-topbar:hover {
  background: var(--azul-claro);
  border-color: var(--azul-principal);
  color: var(--azul-principal);
}

/* Page content */
.page-content {
  padding: 1.75rem;
  flex: 1;
}

/* ── TARJETAS ESTADÍSTICAS ──────────────────────────────── */
.stat-card {
  background: #fff;
  border-radius: .875rem;
  padding: 1.5rem;
  box-shadow: var(--card-shadow);
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: transform var(--transition), box-shadow var(--transition);
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
}

.stat-icon {
  width: 56px;
  height: 56px;
  border-radius: .75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.stat-icon.blue   { background: #cfe2ff; color: #0d6efd; }
.stat-icon.green  { background: #d1e7dd; color: #198754; }
.stat-icon.orange { background: #fff3cd; color: #fd7e14; }
.stat-icon.purple { background: #e2d9f3; color: #6f42c1; }

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1;
  color: #1a2035;
}

.stat-label {
  font-size: .8rem;
  color: #6c757d;
  font-weight: 500;
  margin-top: .2rem;
}

/* ── TARJETA CONTENIDO ──────────────────────────────────── */
.content-card {
  background: #fff;
  border-radius: .875rem;
  box-shadow: var(--card-shadow);
  overflow: hidden;
}

.content-card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #f0f2f5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .75rem;
}

.content-card-header h5 {
  font-weight: 600;
  color: #1a2035;
  margin: 0;
  font-size: 1rem;
}

.content-card-body { padding: 1.5rem; }

/* ── TABLA ──────────────────────────────────────────────── */
.table-custom thead th {
  background: #f8f9fa;
  color: #495057;
  font-size: .78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  border-bottom: 2px solid #e9ecef;
  white-space: nowrap;
  padding: .875rem 1rem;
}

.table-custom tbody td {
  vertical-align: middle;
  padding: .875rem 1rem;
  border-bottom: 1px solid #f0f2f5;
  font-size: .875rem;
}

.table-custom tbody tr:last-child td { border-bottom: none; }

.table-custom tbody tr:hover { background: #f8f9ff; }

.badge-activo   { background: #d1e7dd; color: #0a3622; }
.badge-inactivo { background: #f8d7da; color: #58151c; }

/* Botones acción tabla */
.btn-accion {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: .4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .875rem;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.btn-accion.editar  { background: #cfe2ff; color: #0d6efd; }
.btn-accion.eliminar { background: #f8d7da; color: #dc3545; }

.btn-accion:hover { filter: brightness(.9); transform: scale(1.08); }

/* ── FORMULARIOS ────────────────────────────────────────── */
.form-label { font-weight: 500; font-size: .875rem; color: #495057; }

.form-control, .form-select {
  border-radius: .5rem;
  border-color: #dee2e6;
  font-size: .9rem;
  padding: .55rem .9rem;
}

.form-control:focus, .form-select:focus {
  border-color: var(--azul-principal);
  box-shadow: 0 0 0 .2rem rgba(13,110,253,.12);
}

.invalid-feedback { font-size: .8rem; }

/* ── ALERTAS ────────────────────────────────────────────── */
.alert { border-radius: .75rem; border: none; font-size: .875rem; }
.alert-dismissible .btn-close { padding: .85rem; }

/* ── PAGINACIÓN ─────────────────────────────────────────── */
.pagination .page-link {
  border-radius: .4rem !important;
  margin: 0 .15rem;
  border-color: #dee2e6;
  color: var(--azul-principal);
  font-size: .85rem;
}

.pagination .page-item.active .page-link {
  background: var(--azul-principal);
  border-color: var(--azul-principal);
}

/* ── BÚSQUEDA ───────────────────────────────────────────── */
.search-box { position: relative; }

.search-box input {
  padding-left: 2.4rem;
  border-radius: .5rem;
}

.search-box .search-icon {
  position: absolute;
  left: .75rem;
  top: 50%;
  transform: translateY(-50%);
  color: #adb5bd;
  font-size: .9rem;
  pointer-events: none;
}

/* ── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .login-card {
    flex-direction: column;
  }

  .login-left {
    padding: 2rem 1.5rem;
  }
}

@media (max-width: 575.98px) {
  .page-content { padding: 1rem; }

  .content-card-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .stat-value { font-size: 1.4rem; }
}

/* ── UTILIDADES ─────────────────────────────────────────── */
.text-muted-sm { color: #adb5bd; font-size: .8rem; }
.fw-600 { font-weight: 600; }
.rounded-lg { border-radius: .875rem !important; }

/* Overlay sidebar mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 999;
}

.sidebar-overlay.show { display: block; }
