@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  color: #0f172a;
  min-height: 100vh;
}

/* ---- Login ---- */
.contenedor-login {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 30%, #1e3a8a 0%, #0b1e36 60%, #071324 100%);
  position: relative;
  overflow: hidden;
}

.contenedor-login::before {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(249, 115, 22, 0.25) 0%, rgba(249, 115, 22, 0) 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.tarjeta-login {
  position: relative;
  z-index: 2;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  padding: 44px 38px;
  border-radius: 22px;
  box-shadow: 0 25px 60px rgba(7, 19, 36, 0.6), 0 0 30px rgba(249, 115, 22, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.8);
  width: 380px;
  animation: slideUp 0.5s ease;
}

.tarjeta-login p.sub {
  text-align: center;
  color: #475569;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 28px;
}

/* ---- Inputs ---- */
input,
select,
textarea {
  width: 100%;
  padding: 11px 14px;
  margin-bottom: 14px;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #f8fafc;
  color: #0f172a;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #1d4ed8;
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.25);
  background: #fff;
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23475569' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

/* ---- Buttons ---- */
button {
  cursor: pointer;
  border: none;
  border-radius: 10px;
  padding: 11px 18px;
  font-size: 14px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  transition: all 0.2s ease;
}

button:active {
  transform: scale(0.97);
}

button.primario {
  background: linear-gradient(135deg, #0b2545 0%, #1d4ed8 50%, #ea580c 100%);
  color: #fff;
  width: 100%;
  box-shadow: 0 4px 15px rgba(234, 88, 12, 0.35);
}

button.primario:hover {
  background: linear-gradient(135deg, #133c55 0%, #1e40af 50%, #f97316 100%);
  box-shadow: 0 6px 20px rgba(249, 115, 22, 0.5);
  transform: translateY(-1px);
}

button.secundario {
  background: #e2e8f0;
  color: #0f172a;
}

button.secundario:hover {
  background: #cbd5e1;
}

button.peligro {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  color: #fff;
}

button.peligro:hover {
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.35);
}

button.exito {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  color: #fff;
}

button.exito:hover {
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

button.advertencia {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  color: #fff;
}

button.advertencia:hover {
  box-shadow: 0 4px 14px rgba(234, 88, 12, 0.35);
}

button.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 8px;
}

.acciones-btn {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* ---- Mensajes ---- */
.mensaje-error {
  background: #fef2f2;
  color: #991b1b;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 14px;
  display: none;
  border-left: 4px solid #dc2626;
}

.mensaje-exito {
  background: #ecfdf5;
  color: #065f46;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 14px;
  display: none;
  border-left: 4px solid #10b981;
}

/* ---- Barra superior ---- */
.barra-superior {
  background: linear-gradient(135deg, #0b1e36 0%, #172554 50%, #091322 100%);
  color: #fff;
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 20px rgba(7, 19, 36, 0.4);
  border-bottom: 3px solid #ea580c;
}

.barra-superior .titulo {
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.3px;
}

.usuario-info {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}

/* ---- Contenido ---- */
.contenido {
  padding: 28px;
  max-width: 1080px;
  margin: 0 auto;
}

/* ---- Panel (tarjeta) ---- */
.panel {
  background: #ffffff;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 6px 25px rgba(11, 30, 54, 0.07);
  margin-bottom: 22px;
  border: 1px solid #e2e8f0;
  animation: fadeIn 0.3s ease;
}

.panel h2 {
  font-size: 18px;
  font-weight: 800;
  color: #0b2545;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-left: 4px solid #ea580c;
  padding-left: 12px;
}

/* ---- Grids ---- */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.checkbox-estados {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
  border: 1.5px solid #cbd5e1;
  padding: 14px;
  border-radius: 10px;
  margin-bottom: 14px;
  background: #f8fafc;
}

.checkbox-estados label {
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ---- Tables ---- */
.tabla-wrapper {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid #e2e8f0;
}

th {
  color: #ffffff;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: #0b1e36;
}

tr:hover td {
  background: #f1f5f9;
}

/* ---- Badges ---- */
.badge {
  padding: 4px 11px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  display: inline-block;
}

.badge.pendiente {
  background: #fef3c7;
  color: #92400e;
}

.badge.entregada,
.badge.pagado {
  background: #d1fae5;
  color: #065f46;
}

.badge.no_pagado {
  background: #fee2e2;
  color: #991b1b;
}

.badge.activo {
  background: #d1fae5;
  color: #065f46;
}

.badge.inactivo {
  background: #fee2e2;
  color: #991b1b;
}

/* ---- Tarjeta estado ---- */
.tarjeta-estado {
  background: #ffffff;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 15px rgba(11, 30, 54, 0.06);
  cursor: pointer;
  text-align: center;
  font-weight: 700;
  transition: all 0.25s ease;
  border: 2px solid #e2e8f0;
  color: #0b2545;
}

.tarjeta-estado:hover {
  transform: translateY(-4px);
  border-color: #ea580c;
  box-shadow: 0 10px 25px rgba(234, 88, 12, 0.2);
}

.grid-estados {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

/* ---- Tarjetas de módulos (menú) ---- */
.grid-modulos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 18px;
}

.tarjeta-modulo {
  background: #ffffff;
  border-radius: 16px;
  padding: 28px 20px;
  text-align: center;
  box-shadow: 0 4px 15px rgba(11, 30, 54, 0.06);
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  color: #0b2545;
  transition: all 0.25s ease;
  border: 2px solid #e2e8f0;
  position: relative;
  overflow: hidden;
}

.tarjeta-modulo::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(135deg, #0b2545 0%, #ea580c 100%);
  opacity: 0;
  transition: opacity 0.25s;
}

.tarjeta-modulo:hover {
  transform: translateY(-4px);
  border-color: #ea580c;
  box-shadow: 0 10px 25px rgba(234, 88, 12, 0.2);
}

.tarjeta-modulo:hover::before {
  opacity: 1;
}

.tarjeta-modulo .icono {
  font-size: 36px;
  display: block;
  margin-bottom: 10px;
}

/* ---- Modal ---- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(11, 30, 54, 0.6);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

.modal-contenido {
  background: #fff;
  border-radius: 20px;
  padding: 32px;
  width: 440px;
  max-width: 90vw;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 25px 60px rgba(11, 30, 54, 0.35);
  animation: slideUp 0.3s ease;
  border: 1px solid #e2e8f0;
}

.modal-contenido h3 {
  font-size: 18px;
  font-weight: 800;
  color: #0b2545;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-contenido.ancho {
  width: 750px;
  max-width: 95vw;
}

/* ---- Utilidades ---- */
.oculto {
  display: none !important;
}

.enlace-volver {
  color: #1d4ed8;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 16px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.2s;
}

.enlace-volver:hover {
  color: #ea580c;
}

.separator {
  border: none;
  border-top: 1.5px solid #cbd5e1;
  margin: 20px 0;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #e2e8f0;
  font-size: 13px;
}

.info-row .label {
  color: #64748b;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
}

/* ---- Animations ---- */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---- Toast notification ---- */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 14px 22px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  z-index: 2000;
  animation: slideUp 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.toast.exito {
  background: linear-gradient(135deg, #059669, #10b981);
}

.toast.error {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
    pointer-events: none;
  }
}