/* =============================================
   🎨 VARIABLES GLOBALES (6 colores principales)
   ============================================= */


/* =============================================
   🔧 RESET Y BASE
   ============================================= */
* {
  font-size: .94rem;
}

body {
  color: var(--text-primary) !important;
}

.global-tech-bg {
  z-index: -1000;
}

.global-tech-bg-admin,
.global-tech-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: linear-gradient(135deg, var(--box) 0%, var(--primary) 50%, var(--box-dark) 100%) !important;
  overflow: hidden;
  pointer-events: none;
}

/* Si tu sistema usa modo oscuro basado en tus variables, podemos hacer que el fondo se adapte */
@media (prefers-color-scheme: dark) {
  .global-tech-bg-admin {
    background: radial-gradient(circle at 20% 20%, var(--box) 0%, var(--primary) 60%, var(--dark) 100%) !important;
  }
}

.global-bg-geometry {
  width: 100%;
  height: 100%;
  opacity: 0.75;
  /* Suave para que no compita con las tablas y textos del sistema */
}

.select2-container .select2-selection--single,
.select2-container .select2-selection--multiple,
.card,
.card-header,
input,
select,
button,
a.btn,
.dark-mode .card,
.dark-mode .card-header {
  border-radius: 15px !important;
}

/* =============================================
   🎨 LOGO Y COLORES TEMÁTICOS
   ============================================= */

.layout-navbar-fixed .wrapper .brand-link {
  height: calc(3.5rem + 1px) !important;
}

.bg-gradient-dark {
  background: var(--dark) linear-gradient(180deg, var(--box), var(--dark)) repeat-x !important;
  color: #fff;
}

.logo-color-container {
  display: flex;
  align-items: center;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.15rem;
  line-height: 1;
}

.logo-color-container>span {
  font-size: 1.4rem;
  display: inline-block;
  background: linear-gradient(180deg, var(--white) 0%, var(--gray) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0px 2px 4px rgba(0, 0, 0, 0.2);
}

.logo-color-blue {
  color: var(--white);
}

.logo-color-cyan {
  color: var(--white);
}

.logo-color-orange {
  color: var(--white);
}

.logo-color-green {
  color: var(--white);
}


ul#nav-link-title,
ul#nav-link-setting-acount {
  display: none !important;
}


img#smallIconfile {
  width: 45px !important;
  border-radius: 100% 100% !important;
  height: 45px !important;
  object-fit: contain !important;
  padding: .1rem;
}


.card-login {
  border-top-right-radius: 5px;
  border-bottom-right-radius: 5px;
  position: relative;
  max-height: 600px;
}

.card-login::before,
.card-login::after {
  content: '';
  position: absolute;
  top: 0;
  left: -1;
  width: 10px;
}

.card-login::before {
  border-top-left-radius: 6px;
  background-color: var(--gray);
  height: 20%;
}

.card-login::after {
  border-bottom-left-radius: 6px;
  background-color: var(--primary);
  top: 20%;
  height: 80%;
}

/* =============================================
   🎨 BOTONES Y GRADIENTES
   ============================================= */
.bg-success,
.btn-success {
  background-color: var(--success) !important;
  color: var(--white) !important;
  border-color: var(--success) !important;
}

.btn-primary {
  background-color: var(--primary) !important;
  border-color: var(--primary) !important;
  color: var(--white) !important;
}

.btn-primary:hover {
  background-color: var(--white) !important;
  border-color: var(--primary) !important;
  color: var(--primary) !important;
}

.btn-outline-primary {
  color: var(--primary) !important;
  border-color: var(--primary) !important;
}

.btn-outline-primary:hover {
  color: var(--white) !important;
  background-color: var(--primary) !important;
  border-color: var(--primary) !important;
}

/* Gradientes */
.bg-gradient-success {
  border-color: var(--success) !important;
  background: linear-gradient(120deg, var(--success) 58%, #6f579d 100%) !important;
}

.bg-gradient-yellow {
  border-color: #bd6e06 !important;
  color: var(--white) !important;
  background: linear-gradient(120deg, var(--warning) 58%, #FFC107 100%) !important;
}

.bg-gradient-primary {
  background: linear-gradient(120deg, var(--primary) 58%, var(--dark-sidebar-primary) 100%) !important;
  color: var(--white) !important;
  border-color: var(--primary) !important;
}


.bg-gradient-primary,
.btn-gradient-primary {
  background: linear-gradient(120deg, var(--primary) 58%, var(--dark-sidebar-primary) 100%) !important;
  color: var(--white) !important;
  border-color: var(--primary) !important;

}

/* =============================================
   📋 SIDEBAR Y NAVEGACIÓN
   ============================================= */
.sidebar-success,
.sidebar a:hover {
  color: var(--dark) !important;
  background-color: var(--secondary) !important;
}


/* =============================================
   📋 SCROLL
   ============================================= */

/* CLASE BASE: Controla el comportamiento y el look */
.custom-scroll {
  overflow-y: auto;
  overflow-x: hidden;
}

/* Estilización del scrollbar (se aplica a cualquier .custom-scroll) */
.custom-scroll::-webkit-scrollbar {
  width: 6px;
}

.custom-scroll::-webkit-scrollbar-track {
  background: var(--gray);
  border-radius: 10px;
}

.custom-scroll::-webkit-scrollbar-thumb {
  background: var(--box-dark);
  /* Dorado Midnight Gold */
  border-radius: 10px;
}

.custom-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--box);
  /* Marrón Primary */
}


/* =============================================
   🦶 FOOTER FIJO
   ============================================= */
.main-footer-general {
  bottom: 0;
  left: 0;
  position: fixed;
  right: 0;
  height: 68px;
  z-index: 1032;
  padding: .5rem;
}

/* =============================================
   🌙 MODO OSCURO (Dark Mode)
   ============================================= */
.dark-mode,
.dark-mode .content-wrapper {
  background-color: var(--dark) !important;
  color: var(--white) !important;
}

.dark-mode .bg-gradient-dark {
  background: var(--dark) linear-gradient(180deg, var(--box-dark), var(--dark)) repeat-x !important;
  color: #fff;
}


.dark-mode .sidebar-success,
.dark-mode .card-header {
  background-image: linear-gradient(90deg, var(--dark-sidebar-primary), var(--dark-sidebar-secondary)) !important;
  color: var(--white) !important;
}

.dark-mode .card {
  box-shadow: 0 1px 2px rgba(var(--black-rgb), 0.4), 0 2px 8px rgba(var(--black-rgb), 0.5), 0 0 0 1px rgba(var(--white-rgb), 0.6) !important;
  color: var(--white) !important;
}

.dark-mode .text-secondary,
.dark-mode .card-title {
  color: var(--disabled) !important;
}

.dark-mode .bg-gradient-primary,
.dark-mode .btn-gradient-primary {
  background: linear-gradient(120deg, var(--primary) 58%, var(--dark-sidebar-primary) 100%) !important;
  color: var(--white) !important;
  border-color: var(--primary) !important;
}

/* Dark mode para cards de permisos */
.dark-mode .pf-card-modulo {
  background-color: #1f2229;
  border-color: #3a3f4b;
}

.dark-mode .pf-card-modulo .pf-card-header {
  background: #252b37;
  border-bottom-color: #3a3f4b;
}

.dark-mode .pf-card-modulo .pf-card-header .pf-mod-titulo {
  color: var(--accent);
}

.dark-mode .pf-objeto-nombre {
  color: #e2e8f0;
}

.dark-mode .pf-objeto-codigo {
  color: #8a99b4;
}

.dark-mode .pf-objeto-row {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.dark-mode .pf-toggle-slider {
  background: #4a4f5e;
}

.dark-mode .pf-toggle input:checked+.pf-toggle-slider {
  background: #2ea043;
}

.dark-mode .page-item.active .page-link {
  background-color: var(--primary) !important;
  border-color: var(--primary) !important;
  color: var(--white) !important;
}

.dark-mode .page-item:not(.active) .page-link {
  background-color: #343a40 !important;
  border-color: var(--white) !important;
  color: var(--white) !important;
}

.dark-mode .text-primary {
  color: var(--gray-light) !important;
}



/* =============================================
   🎯 UTILITIES Y CLASES DE ANCHO Y ALTO
   ============================================= */
.w-100,
.w-95,
.w-90,
.w-85,
.w-80,
.w-75,
.w-70,
.w-65,
.w-60,
.w-55,
.w-50,
.w-45,
.w-40,
.w-35,
.w-30,
.w-25,
.w-20,
.w-15,
.w-10,
.w-5 {
  width: var(--width, auto) !important;
}

.w-100 {
  --width: 100%;
  width: 100% !important;
}

.w-95 {
  width: 95% !important;
}

.w-90 {
  width: 90% !important;
}

.w-85 {
  width: 85% !important;
}

.w-80 {
  width: 80% !important;
}

.w-75 {
  width: 75% !important;
}

.w-70 {
  width: 70% !important;
}

.w-65 {
  width: 65% !important;
}

.w-60 {
  width: 60% !important;
}

.w-55 {
  width: 55% !important;
}

.w-50 {
  width: 50% !important;
}

.w-45 {
  width: 45% !important;
}

.w-40 {
  width: 40% !important;
}

.w-35 {
  width: 35% !important;
}

.w-30 {
  width: 30% !important;
}

.w-25 {
  width: 25% !important;
}

.w-20 {
  width: 20% !important;
}

.w-15 {
  width: 15% !important;
}

.w-10 {
  width: 10% !important;
}

.w-5 {
  width: 5% !important;
}

.min-vh-60 {
  min-height: 60vh !important;
}

.min-h-90,
.min-vh-90 {
  min-height: 90vh !important;
}

.h-95 {
  height: 95vh !important;
}

.h-90 {
  height: 90vh !important;
}

.h-85 {
  height: 85vh !important;
}

.h-80 {
  height: 80vh !important;
}

.h-75 {
  height: 75vh !important;
}

.h-70 {
  height: 70vh !important;
}

.h-65 {
  height: 65vh !important;
}

.h-60 {
  height: 60vh !important;
}

.h-55 {
  height: 55vh !important;
}

.h-50 {
  height: 50vh !important;
}

.h-45 {
  height: 45vh !important;
}

.h-40 {
  height: 40vh !important;
}

.h-35 {
  height: 35vh !important;
}

.h-30 {
  height: 30vh !important;
}

.h-25 {
  height: 25vh !important;
}

.h-20 {
  height: 20vh !important;
}

.h-15 {
  height: 15vh !important;
}

.h-10 {
  height: 10vh !important;
}

.h-5 {
  height: 5vh !important;
}


/* =============================================
   🎨 FORMULARIOS Y INPUTS
   ============================================= */
.form-check-input {
  border: 1px solid var(--primary) !important;
}

.form-check-input:checked {
  background-color: var(--primary) !important;
}

.form-check-input:focus {
  border-color: var(--primary) !important;
  outline: 0 !important;
  box-shadow: 0 0 0 .25rem rgba(26, 66, 127, .25) !important;
}

[type="text"]:focus,
[type="email"]:focus,
[type="password"]:focus,
textarea:focus,
select:focus {
  outline: 2px solid transparent !important;
  border-color: var(--primary) !important;
  box-shadow: inset 0 0 0 transparent !important;
}

.form-control:disabled,
.form-control[readonly],
.select2-container--disabled .select2-selection--single,
.select2-container--disabled .select2-selection--multiple {
  cursor: not-allowed !important;
  background-color: var(--disabled) !important;
  opacity: 1;
}

.select2-container .select2-selection--single,
.select2-container .select2-selection--multiple {
  font-size: 1rem !important;
  background-color: var(--white) !important;
  border: 1px solid #ced4da !important;
  transition: background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out, -webkit-box-shadow .15s ease-in-out !important;
}

.select2-container .select2-selection--single {
  padding: .46875rem .75rem !important;
  height: calc(2.25rem + 2px) !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered,
.select2-container--default .select2-selection--multiple .select2-selection__rendered {
  font-size: 1rem !important;
}



/* =============================================
   📊 TABLAS Y DATATABLES
   ============================================= */
.dataTable.cards tbody tr {
  float: left !important;
  width: calc(33.33% - 20px) !important;
  margin: 10px !important;
  border: 1px solid var(--gray) !important;
  border-radius: 15px !important;
  background: var(--light) !important;
  box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.1) !important;
  max-height: 550px !important;
  overflow: auto !important;
  display: block !important;
}

.dataTable.cards tbody td {
  display: block !important;
  padding: 8px 12px !important;
}

.dataTable.cards thead {
  display: none !important;
}

.dataTable.cards tbody td::before {
  content: attr(data-label) !important;
  font-weight: bold !important;
  display: block !important;
  margin-bottom: 4px !important;
  color: var(--primary) !important;
}

.page-link, .custom-control-label {
  color: var(--primary) !important;
}

.page-item.active .page-link {
  color: var(--white) !important;
  background-color: var(--primary) !important;
  border-color: var(--primary) !important;
}


/* =============================================
   🎨 BADGES Y ESTADOS
   ============================================= */
.estatus-pendiente {
  background-color: var(--warning) !important;
  color: #000 !important;
}

.estatus-enviado {
  background-color: #0dcaf0 !important;
  color: var(--white) !important;
}

.estatus-recibido {
  background-color: var(--success) !important;
  color: var(--white) !important;
}

.estatus-revision {
  background-color: var(--light) !important;
  color: #000 !important;
  border: 1px solid var(--gray-light);
}

.estatus-asignado {
  background-color: #0d6efd !important;
  color: var(--white) !important;
}

.estatus-aprobado {
  background-color: #157347 !important;
  color: var(--white) !important;
}

.estatus-rechazado {
  background-color: var(--error) !important;
  color: var(--white) !important;
}

.estatus-cerrada {
  background-color: var(--dark) !important;
  color: var(--white) !important;
}

.estatus-default {
  background-color: var(--gray) !important;
  color: var(--white) !important;
}

/* Todos los badges unificados */
.estatus-pendiente,
.estatus-enviado,
.estatus-recibido,
.estatus-revision,
.estatus-asignado,
.estatus-aprobado,
.estatus-rechazado,
.estatus-cerrada,
.estatus-default {
  padding: 0.35em 0.65em !important;
  font-size: 0.75em !important;
  font-weight: 700 !important;
  border-radius: 0.375rem !important;
  display: inline-block !important;
}

.control-sidebar {
    bottom: var(--footer-height); 
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}
 
.control-sidebar .control-sidebar-content {
    flex: 1 1 auto !important;
    overflow-y: auto !important;              /* solo el contenido scrollea */
}
.control-sidebar .card-footer {
    position: sticky !important;
    bottom: 0 !important;
    z-index: 2 !important;
}

/* Scrollbar estético */
.control-sidebar::-webkit-scrollbar {
    width: 8px !important;
}
.control-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,.3) !important;
    border-radius: 4px !important;
}


.titulo-institucional {
  background: linear-gradient(90deg, var(--primary), var(--box-dark));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 800;
}

/* =============================================
   📱 RESPONSIVE
   ============================================= */
@media (max-width: 991px) {
  .dataTable.cards tbody tr {
    width: calc(50% - 20px) !important;
  }

  .control-sidebar {
    right: -100% !important;
    width: 100% !important;
  }

  .control-sidebar-slide-open .control-sidebar,
  .control-sidebar-slide-open .control-sidebar::before {
    right: 0 !important;
    top: 0 !important;
  }
}

@media (min-width: 992px) {
  ul#nav-link-setting-acount-mini {
    display: none !important;
  }

  ul#nav-link-title,
  ul#nav-link-setting-acount {
    display: flex !important;
  }

  .modal-lg,
  .modal-xl {
    max-width: 90% !important;
  }

  .modal-md {
    max-width: 60% !important;
  }



  .modal-sm {
    max-width: 40% !important;
  }

  .control-sidebar.control-sidebar-sm {
    right: -10% !important;
    width: 10% !important;
  }

  .control-sidebar.control-sidebar-md {
    right: -20% !important;
    width: 20% !important;
  }

  .control-sidebar.control-sidebar-lg {
    right: -45% !important;
    width: 45% !important;
  }

  .control-sidebar.control-sidebar-xl {
    right: -60% !important;
    width: 60% !important;
  }

  .control-sidebar-slide-open .control-sidebar,
  .control-sidebar-slide-open .control-sidebar::before {
    right: 0 !important;
  }
}

@media (max-width: 576px) {
  .dataTable.cards tbody tr {
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
}

@media (min-width: 576px) {
  .modal-sm.modal-dialog-scrollable .modal-content {
    max-height: 70vh !important;
  }
}


/* =============================================
   ⚡ ANIMACIONES Y OVERLAYS
   ============================================= */
@keyframes rotate {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.overlay i {
  animation: rotate 2s infinite linear;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px) !important;
  }

  to {
    opacity: 1;
    transform: translateX(0) !important;
  }
}

.row-animate {
  animation: slideInRight 0.5s ease-out forwards !important;
}

/* Preloader */
@keyframes animate-preloader {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

#preloader2 {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  overflow: hidden;
  background: #00000042;
}

#preloader2:before {
  content: "";
  position: fixed;
  top: calc(50% - 30px);
  left: calc(50% - 30px);
  border: 6px solid var(--primary);
  border-top-color: #5db3ff;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  animation: animate-preloader 1s linear infinite;
}

/* =============================================
   🎨 UTILITIES VARIOS
   ============================================= */
.requerid {
  color: var(--error) !important;
}

.border-primary {
  border-color: var(--primary) !important;
}

.text-primary {
  color: var(--primary) !important;
}

.bg-primary {
  background-color: var(--primary) !important;
}

.fixed-button {
  position: fixed;
  bottom: 80px;
  right: -20px;
  opacity: 0.5;
  transition: right 0.3s ease;
}

.fixed-button:hover {
  right: 2px;
  opacity: 1;
}

/* Scrollbar personalizado */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f0f0f0;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background-color: #888;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background-color: #555;
}

/* =============================================
   🎯 SELECT2 Y OTROS COMPONENTES
   ============================================= */
.select2-container--default .select2-results__option--highlighted[aria-selected] {
  background-color: var(--primary) !important;
  color: var(--white) !important;
}

.select2-container .select2-selection--single,
.select2-container .select2-selection--multiple {
  border-radius: 15px !important;
}

.error .invalid-feedback {
  display: inline-block !important;
  width: 100% !important;
  color: var(--error) !important;
  font-size: .8em !important;
}

/* =============================================
   🖼️ AVATARES Y MEDIOS
   ============================================= */
.avatar-info,
.avatar-info-sm {
  border-radius: 50%;
  margin-right: 10px;
  object-fit: contain !important;
  border: solid .5px var(--secondary);
}

.avatar-info {
  width: 90px;
  height: 95px;
}

.avatar-info-sm {
  width: 55px;
  height: 55px;
}

/* =============================================
   📦 MODALES
   ============================================= */
#ModalRegistro {
  z-index: 1050;
  height: 100vh;
  overflow-y: auto;
}

.modal-dialog {
  box-shadow: none !important;
}

/* =============================================
   🎨 CORRECCIONES BORDE REDONDEADO GLOBAL
   ============================================= */
.card,
.card-header,
.modal-content,
.btn,
select,
input,
.select2-container .select2-selection--single,
.select2-container .select2-selection--multiple {
  border-radius: 15px !important;
}

.select2-container--default.select2-container--disabled .select2-selection--single,
.select2-container--default.select2-container--disabled .select2-selection--multiple {
  background-color: var(--disabled) !important;
}

/* =============================================
   🧹 ESTILOS PARA MODALES DE PERFILES (EDICIÓN + VISUALIZACIÓN)
   ============================================= */

/* --- Base y colores con variables --- */
.bg-light-gray {
  background-color: var(--secondary);
}

/* =============================================
   📝 MODAL DE EDICIÓN (profiles-management.ctp)
   ============================================= */

/* Header mejorado */
.pf-modal-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--dark-sidebar-primary) 100%);
  padding: 1.25rem 1.5rem;
}

.pf-icon-container {
  width: 45px;
  height: 45px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.pf-code-label {
  font-family: 'Monaco', 'Consolas', monospace;
  font-size: 0.7rem;
  color: var(--gray);
}

/* Inputs y Formularios */
.pf-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--gray);
  letter-spacing: 0.3px;
  margin-bottom: 6px;
  display: block;
}

.pf-input {
  border-radius: 8px;
  border: 1px solid var(--gray-light);
  font-size: 0.85rem;
  padding: 0.6rem 0.75rem;
  transition: var(--transition-default);
}

.pf-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(76, 163, 217, 0.1);
}

/* Filtros con estilo "pill" */
.pf-search-wrapper {
  background: var(--secondary);
  border-radius: 30px;
  padding: 4px 15px;
  display: flex;
  align-items: center;
  min-width: 220px;
}

.pf-search-wrapper .icon {
  color: var(--gray);
  margin-right: 8px;
  font-size: 0.8rem;
}

.pf-search-wrapper select,
.pf-search-wrapper input {
  font-size: 0.8rem;
  height: auto;
  background: transparent;
}

/* Grid Estilo Masonry */
.pf-grid-layout {
  column-count: 2;
  column-gap: 1.5rem;
  display: block;
}

.pf-col-modulo {
  display: inline-block;
  width: 100%;
  break-inside: avoid;
  margin-bottom: 1.5rem;
}

/* Tarjetas de Módulo (EDICIÓN) */
.pf-card-modulo {
  background: var(--white);
  border-radius: 12px;
  border: 1px solid var(--gray-light);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: var(--transition-default);
}

.pf-card-modulo:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.pf-card-header {
  padding: 12px 16px;
  background: var(--white);
  border-bottom: 1px solid var(--gray-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pf-mod-titulo {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-primary);
}

.pf-mod-contador {
  font-size: 0.7rem;
  color: var(--gray);
  background: var(--secondary);
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}

/* Filas de Permiso (EDICIÓN con toggle) */
.pf-objeto-row {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid var(--gray-light);
  transition: var(--transition-default);
}

.pf-objeto-row:hover {
  background: var(--secondary);
}

.pf-objeto-nombre {
  font-size: 0.8rem;
  color: var(--text-primary);
  flex-grow: 1;
  font-weight: 500;
}

.pf-objeto-codigo {
  font-size: 0.65rem;
  color: var(--gray);
  margin-right: 15px;
  font-family: monospace;
}

/* Switch / Toggle Moderno (para EDICIÓN) */
.pf-toggle {
  position: relative;
  display: inline-block;
  width: 34px;
  height: 18px;
  flex-shrink: 0;
}

.pf-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.pf-toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--gray-light);
  transition: .3s;
  border-radius: 34px;
}

.pf-toggle-slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 2px;
  bottom: 2px;
  background-color: var(--white);
  transition: .3s;
  border-radius: 50%;
}

.pf-toggle input:checked+.pf-toggle-slider {
  background-color: var(--success);
}

.pf-toggle input:checked+.pf-toggle-slider:before {
  transform: translateX(16px);
}

.pf-toggle input:disabled+.pf-toggle-slider {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Resumen Footer (EDICIÓN) */
.pf-resumen-pill {
  background: var(--accent);
  color: var(--white);
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
}

/* =============================================
   👁️ MODAL DE VISUALIZACIÓN (profiles-view.ctp)
   ============================================= */

/* Icono y badges (visualización) */
.pf-code-badge {
  background: rgba(255, 255, 255, 0.15);
  padding: 2px 8px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.75rem;
  color: white;
}

/* Stats (estadísticas) */
.pf-stats-wrapper {
  gap: 15px;
  display: flex;
  align-items: center;
}

.pf-stat-item {
  display: flex;
  flex-direction: column;
}

.pf-stat-item .label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray);
  font-weight: 700;
}

.pf-stat-item .value {
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1;
  margin-top: 2px;
}

.pf-divider {
  width: 1px;
  height: 30px;
  background: var(--gray-light);
  align-self: center;
}

/* Search group (visualización) */
.pf-search-group {
  width: 220px;
}

.pf-search-group select {
  border-radius: 0 6px 6px 0 !important;
}

/* Filter group (botones de filtro) */
.pf-filter-group .btn {
  background: var(--white);
  font-weight: 600;
  font-size: 0.75rem;
  border-color: var(--gray-light);
}

.pf-filter-group .btn.active {
  background: var(--secondary);
  border-color: var(--gray) !important;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
  color: var(--primary);
}

/* Cards de visualización (pfv-card) */
.pfv-card {
  background: var(--white);
  border: 1px solid var(--gray-light);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
  transition: var(--transition-default);
  overflow: hidden;
}

.pfv-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.pfv-card-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--white);
}

.pf-mod-nombre {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
}

.pf-mod-nombre i {
  color: var(--gray);
  margin-right: 8px;
}

/* Items de lista (visualización) */
.pfv-objeto-item {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid var(--gray-light);
  transition: var(--transition-default);
}

.pfv-objeto-item:last-child {
  border-bottom: none;
}

.pfv-objeto-item:hover {
  background: var(--secondary);
}

.pf-status-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 12px;
}

.pf-obj-info {
  flex-grow: 1;
}

.pf-obj-name {
  font-size: 0.8rem;
  color: var(--text-primary);
  font-weight: 500;
  display: block;
}

.pf-obj-code {
  font-size: 0.65rem;
  color: var(--gray);
  font-family: monospace;
}

/* Badges de acceso (Sí/No) */
.pf-access-pill {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  display: inline-block;
}

.pf-access-pill.si {
  background: #dcfce7;
  color: #166534;
}

.pf-access-pill.no {
  background: var(--secondary);
  color: var(--gray);
}

/* Alerta informativa */
.pf-alert-info {
  border-radius: 8px;
  color: var(--accent);
  background-color: #f0f9ff;
  border: none;
  font-size: 0.75rem;
}

/* Layout columnas para visualización */
.pf-grid-layout {
  column-count: 2;
  column-gap: 1.5rem;
  display: block;
}

.pf-col-card {
  display: inline-block;
  width: 100%;
  break-inside: avoid;
  margin-bottom: 1.5rem;
}

/* =============================================
   🌙 MODO OSCURO (para AMBOS modales)
   ============================================= */
.dark-mode .bg-light-gray {
  background-color: #1a1e26;
}

/* Dark mode para cards de edición */
.dark-mode .pf-card-modulo {
  background: #1f2229;
  border-color: #3a3f4b;
}

.dark-mode .pf-card-header {
  background: #252b37;
  border-bottom-color: #3a3f4b;
}

.dark-mode .pf-mod-titulo {
  color: var(--white);
}

.dark-mode .pf-mod-contador {
  background: #2d323e;
  color: var(--gray-light);
}

.dark-mode .pf-objeto-row {
  border-bottom-color: #2d323e;
}

.dark-mode .pf-objeto-row:hover {
  background: #252b37;
}

.dark-mode .pf-objeto-nombre {
  color: var(--white);
}

/* Dark mode para cards de visualización */
.dark-mode .pfv-card {
  background: #1f2229;
  border-color: #3a3f4b;
}

.dark-mode .pfv-card-header {
  background: #252b37;
  border-bottom-color: #3a3f4b;
}

.dark-mode .pf-mod-nombre {
  color: var(--white);
}

.dark-mode .pfv-objeto-item {
  border-bottom-color: #2d323e;
}

.dark-mode .pfv-objeto-item:hover {
  background: #252b37;
}

.dark-mode .pf-obj-name {
  color: var(--white);
}

/* Dark mode para filtros y wrappers */
.dark-mode .pf-search-wrapper {
  background: #252b37;
}

.dark-mode .pf-search-wrapper input,
.dark-mode .pf-search-wrapper select {
  color: var(--white);
}

.dark-mode .pf-filter-group .btn {
  background: #252b37;
  border-color: #3a3f4b;
  color: var(--white);
}

.dark-mode .pf-filter-group .btn.active {
  background: var(--primary);
  border-color: var(--primary) !important;
  color: white;
}

.dark-mode .pf-divider {
  background: #3a3f4b;
}

.dark-mode .pf-input {
  background: #1f2229;
  border-color: #3a3f4b;
  color: var(--white);
}

.dark-mode .pf-code-label {
  color: var(--gray-light);
}

.dark-mode .pf-access-pill.no {
  background: #2d323e;
  color: #94a3b8;
}

.dark-mode .pf-alert-info {
  background-color: #1e2a3a;
  color: var(--accent);
}

/* =============================================
   📱 RESPONSIVE
   ============================================= */
@media (max-width: 768px) {
  .pf-grid-layout {
    column-count: 1;
  }

  .pf-stats-wrapper {
    justify-content: space-around;
  }

  .pf-search-group {
    width: 100%;
    margin-bottom: 10px;
  }
}

@media (max-width: 999px) {
  .pf-objeto-row {
    flex-direction: column;
    align-items: flex-start;
  }
}