/* =========================================================
   page-utvm.css  (ADMIN + PÁGINAS)
   - Usa variables definidas en index.css (:root)
   - Incluye FIX para conflicto de .card (index.css)
   ========================================================= */

/* =========================
   1) BASE WRAPPER
   ========================= */
.page-utvm{
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

/* =========================
   2) HERO / ENCABEZADO SIMPLE
   ========================= */
.page-hero{
  background: var(--grad-menu);
  color: var(--white);
  padding: 16px 0;
  box-shadow: var(--shadow-soft);
}

.page-hero .hero-title{
  margin: 0;
  font-weight: 900;
  letter-spacing: .4px;
}

.page-hero .hero-sub{
  margin: 0;
  opacity: .9;
  font-weight: 600;
  font-size: .95rem;
}

.hero-actions{
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.hero-logo{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--white);
}

.hero-logo img{
  height: 54px;
  width: auto;
}

@media (max-width: 576px){
  .hero-logo img{ height: 44px; }
}

/* =========================
   3) BOTONES GENÉRICOS UTVM
   ========================= */
.btn-utvm{
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(0,0,0,.12);
  transition: transform .15s ease, filter .15s ease;
}
.btn-utvm:hover{
  transform: translateY(-1px);
  filter: brightness(.98);
}

.btn-utvm-primary{
  background: var(--grad-menu);
  color: var(--white);
}

.btn-utvm-accent{
  background: linear-gradient(to bottom, var(--accent), #f2b83c);
  color: var(--white);
}

/* =========================
   4) CARD / FORM / TABLA (GENÉRICO)
   ========================= */
.page-card{
  background: var(--white);
  border: 1px solid rgba(0,0,0,.06);
  border-radius: 18px;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.page-card-header{
  padding: 14px 18px;
  background: rgba(0,0,0,.03);
  font-weight: 900;
  color: var(--primary-dark);
}

.page-card-body{ padding: 18px; }

/* Inputs */
.page-utvm .form-control,
.page-utvm .form-select{
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.12);
  padding: 12px 14px;
}

.page-utvm .form-control:focus,
.page-utvm .form-select:focus{
  border-color: var(--hover);
  box-shadow: 0 0 0 .2rem rgba(25,171,239,.18);
}

/* Tabla genérica (si la usas) */
.table-utvm thead th{
  background: var(--accent) !important;
  color: var(--white) !important;
  border: 0 !important;
}
.table-utvm tbody td{
  background: #f8f9fa;
  border: 0;
  color: #495057;
  vertical-align: top;
}

/* =========================
   5) OFFCANVAS ADMIN (MENÚ)
   ========================= */
.offcanvas-utvm{
  background: var(--grad-menu) !important;
  color: var(--white) !important;
  border-left: 0;
  box-shadow: 0 18px 50px rgba(0,0,0,.35);
}

.offcanvas-utvm__header{
  border-bottom: 1px solid rgba(255,255,255,.18);
}

.offcanvas-utvm .offcanvas-body{
  padding: 18px 14px 22px;
}

.offcanvas-utvm .navbar-nav{
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  justify-items: stretch;
  align-items: stretch;
}

@media (max-width: 420px){
  .offcanvas-utvm .navbar-nav{
    grid-template-columns: 1fr;
  }
}

/* Links como cards */
.offcanvas-utvm__link{
  background: rgba(255,255,255,.10);
  border-radius: 14px;
  padding: 14px 10px;
  text-align: center;
  transition: transform .15s ease, background-color .2s ease;
  border: 1px solid rgba(255,255,255,.12);
}

.offcanvas-utvm__link:hover{
  background: rgba(255,255,255,.16);
  transform: translateY(-2px);
}

.offcanvas-utvm__link i{
  font-size: 46px !important;
  display: block;
  margin-bottom: 6px;
  color: rgba(255,255,255,.95);
}

.offcanvas-utvm__link div{
  font-weight: 700;
  font-size: 14px;
  line-height: 1.15;
}

.offcanvas-utvm hr{
  grid-column: 1 / -1;
  opacity: .35;
  margin: 6px 0;
}

/* Logout resaltado */
.offcanvas-utvm .logout-link{
  background: rgba(255, 120, 120, .14);
  border: 1px solid rgba(255, 170, 170, .35);
}
.offcanvas-utvm .logout-link i,
.offcanvas-utvm .logout-link div{
  color: #ffd0d0 !important;
}

/* =========================
   6) ADMIN UI (HEADER + LISTADOS)
   ========================= */
.admin-header{
  height: 86px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: var(--grad-menu);
  z-index: 1030;
  border-bottom: 1px solid rgba(255,255,255,.15);
}

.admin-header__logo{
  width: 150px;
  height: auto;
}

.admin-header__title{
  margin: 0;
  color: var(--white);
  font-weight: 900;
  letter-spacing: .6px;
}

.admin-menu-btn{
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 14px;
  background: rgba(255,255,255,.10);
  color: var(--white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.admin-menu-btn i{ font-size: 34px; }

.admin-spacer{
  height: 110px; /* compensa fixed-top */
}

.admin-section-head{
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.admin-section-title{
  font-weight: 900;
  color: var(--primary-dark);
  margin: 0;
}

.admin-section-subtitle{
  color: rgba(0,0,0,.55);
}

/* =========================
   7) BOTONES ADMIN (PALETA NUEVA)
   - Primario: AMARILLO
   - Secundario: AZUL
   ========================= */
.admin-btn-primary{
  background: linear-gradient(to bottom, var(--accent), #f2b83c);
  color: var(--white) !important;
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 900;
  box-shadow: 0 10px 25px rgba(0,0,0,.12);
  transition: transform .15s ease, filter .15s ease;
}
.admin-btn-primary:hover{
  transform: translateY(-1px);
  filter: brightness(.98);
}

.admin-btn-secondary{
  background: var(--grad-menu);
  color: var(--white) !important;
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 900;
  box-shadow: 0 10px 25px rgba(0,0,0,.10);
  transition: transform .15s ease, filter .15s ease;
}
.admin-btn-secondary:hover{
  transform: translateY(-1px);
  filter: brightness(1.02);
}

/* =========================
   8) ADMIN: CARDS / TABLAS / BADGES
   ========================= */
.admin-card{
  border-radius: 18px;
  overflow: hidden;
}

.admin-table{
  width: 100% !important;
}

.admin-table thead th{
  background: var(--primary-dark);
  color: var(--white);
  border: 0;
  padding: 14px 12px;
  font-weight: 900;
  white-space: nowrap;
}

.admin-table tbody td{
  padding: 12px;
  border-color: rgba(0,0,0,.06);
  background: var(--white);
}

.admin-badge{
  background: rgba(0,56,120,.10);
  color: var(--primary-dark);
  border: 1px solid rgba(0,56,120,.18);
  padding: 8px 10px;
  border-radius: 999px;
  font-weight: 900;
}

/* Botones icono */
.admin-icon-btn{
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.04);
}
.admin-icon-btn i{ font-size: 22px; }

.admin-icon-btn--edit{
  background: rgba(25,171,239,.16);
  color: var(--primary-dark);
}

.admin-icon-btn--delete{
  background: rgba(237,171,32,.22);
  color: #7a2a1a;
}

/* =========================
   9) ADMIN: MODALES
   ========================= */
.admin-modal{
  border-radius: 18px;
  overflow: hidden;
}
.admin-modal .modal-header{
  background: var(--primary-dark);
  color: var(--white);
}
.admin-modal .modal-title{
  font-weight: 900;
}

/* =========================
   10) FIXES IMPORTANTES (CONFLICTOS CON index.css)
   index.css trae: .card{ width:300px }
   => Eso rompe cards de admin (se ven arrinconados)
   ========================= */
.admin-card.card,
.page-card.card{
  width: 100% !important;
  max-width: 100% !important;
}

/* Si hay .card dentro de páginas admin/page-utvm */
.page-utvm .card{
  width: auto !important;
  max-width: 100% !important;
}

/* Contenedor estándar admin (opcional usar en HTML) */
.admin-container{
  width: 100%;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}

/* =========================================================
   TABLA AMPLIA PARA CONSTANCIAS / ENCUESTAS
   ========================================================= */

.admin-table-wide{
  width: 100%;
  min-width: 950px; /* obliga a usar scroll si no cabe */
  border-collapse: separate;
  border-spacing: 0;
}

.admin-table-wide thead th{
  background: var(--primary-dark);
  color: var(--white);
  font-weight: 900;
  padding: 14px 16px;
  white-space: nowrap;
}

.admin-table-wide tbody td{
  padding: 14px 16px;
  background: var(--white);
  border-bottom: 1px solid rgba(0,0,0,.06);
  vertical-align: middle;
  white-space: nowrap;
}

.admin-table-wide tbody tr:hover td{
  background: rgba(0,56,120,.03);
}

/* Columna de nombre permite salto de línea */
.admin-table-wide td.col-nombre{
  white-space: normal;
  min-width: 220px;
}

/* Columna correo más amplia */
.admin-table-wide td.col-correo{
  min-width: 240px;
}

/* Columna taller */
.admin-table-wide td.col-taller{
  min-width: 260px;
  white-space: normal;
}

/* Badge matrícula */
.admin-badge-id{
  background: rgba(0,56,120,.12);
  color: var(--primary-dark);
  border: 1px solid rgba(0,56,120,.25);
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 900;
  display: inline-block;
}
/* =========================================================
   TABLA SIN SCROLL (DESKTOP): 6 COLUMNAS SIEMPRE VISIBLES
   ========================================================= */

.table-fit-6{
  width: 100% !important;
  table-layout: fixed;          /* clave: reparte el ancho */
  border-collapse: separate;
  border-spacing: 0;
}

/* Encabezado */
.table-fit-6 thead th{
  background: var(--primary-dark);
  color: var(--white);
  font-weight: 900;
  padding: 10px 10px;
  font-size: .92rem;
  white-space: nowrap;
}

/* Cuerpo */
.table-fit-6 tbody td{
  padding: 10px 10px;
  font-size: .92rem;
  border-bottom: 1px solid rgba(0,0,0,.06);
  background: var(--white);
  vertical-align: top;
}

/* Hover suave */
.table-fit-6 tbody tr:hover td{
  background: rgba(0,56,120,.03);
}

/* Permitir que columnas largas se partan (sin ensanchar) */
.table-fit-6 td,
.table-fit-6 th{
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Columnas largas: permitir salto de línea y cortar palabras */
.table-fit-6 .col-alumno,
.table-fit-6 .col-correo,
.table-fit-6 .col-taller{
  white-space: normal;
  overflow: hidden;
  text-overflow: clip;
  word-break: break-word;       /* correos/taller largo */
  overflow-wrap: anywhere;
}

/* Columnas cortas: centradas y compactas */
.table-fit-6 .col-asistencia,
.table-fit-6 .col-constancia,
.table-fit-6 .col-matricula{
  white-space: nowrap;
  text-align: center;
  vertical-align: middle;
}

/* Badge matrícula compacto */
.admin-badge-id{
  background: rgba(0,56,120,.12);
  color: var(--primary-dark);
  border: 1px solid rgba(0,56,120,.25);
  padding: 4px 8px;
  border-radius: 999px;
  font-weight: 900;
  display: inline-block;
  font-size: .82rem;
}

/* Ajuste de anchos (suma 100%) */
.table-fit-6 col.w-matricula { width: 12%; }
.table-fit-6 col.w-alumno    { width: 20%; }
.table-fit-6 col.w-correo    { width: 22%; }
.table-fit-6 col.w-taller    { width: 24%; }
.table-fit-6 col.w-const     { width: 14%; }
.table-fit-6 col.w-asist     { width: 8%;  }

/* En pantallas medianas/pequeñas sí permitimos scroll horizontal */
@media (max-width: 992px){
  .table-fit-6{
    table-layout: auto;
    min-width: 980px; /* aquí sí se vale scroll */
  }
}
