/* ================================
   ELECTROTEC GLASS UI SYSTEM
   Sistema de diseño centralizado
   ================================ */

/* Importar fuentes de Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Montserrat:wght@400;500;600;700;800&display=swap');

/* ================================
   VARIABLES CSS (CUSTOM PROPERTIES)
   ================================ */
:root {
  /* Colores Primarios */
  --primary-blue: #2A2F6C;
  --secondary-blue: #5C66CC;

  /* Superficie Glass UI */
  --surface-glass: rgba(255, 255, 255, 0.25);
  --surface-glass-hover: rgba(255, 255, 255, 0.35);
  --surface-glass-subtle: rgba(255, 255, 255, 0.15);
  --border-glass: rgba(255, 255, 255, 0.40);
  --border-glass-subtle: rgba(255, 255, 255, 0.20);

  /* Texto */
  --text-primary: #FFFFFF;
  --text-muted: rgba(255, 255, 255, 0.70);
  --text-secondary: rgba(255, 255, 255, 0.85);

  /* Colores Semánticos */
  --success: #10B981;
  --warning: #F59E0B;
  --error: #EF4444;
  --info: #3B82F6;

  /* Fondos para inputs */
  --input-bg: rgba(0, 0, 0, 0.2);
  --input-bg-focus: rgba(0, 0, 0, 0.3);

  /* Sombras */
  --shadow-glass: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
  --shadow-soft: 0 4px 16px 0 rgba(31, 38, 135, 0.25);
  --shadow-button: 0 4px 12px 0 rgba(42, 47, 108, 0.4);

  /* Blur */
  --blur-glass: 12px;
  --blur-subtle: 8px;
  --blur-strong: 16px;

  /* Radios */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;

  /* Espaciado */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  --spacing-2xl: 48px;
  --spacing-3xl: 64px;

  /* Tipografía */
  --font-heading: 'Montserrat', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* Transiciones */
  --transition-fast: 0.15s ease-out;
  --transition-normal: 0.3s ease-out;
  --transition-slow: 0.5s ease-out;
}

/* ================================
   RESET Y BASE STYLES
   ================================ */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-primary);
  background: radial-gradient(circle at 20% 20%, #2A2F6C 0%, #1a1d4a 35%, #0f1229 100%);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Fondo decorativo adicional */
body::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 70% 30%, rgba(92, 102, 204, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 30% 70%, rgba(42, 47, 108, 0.1) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
  animation: float 20s ease-in-out infinite;
}

@keyframes float {
  0%, 100% {
    transform: translate(0, 0) rotate(0deg);
  }

  33% {
    transform: translate(-20px, -20px) rotate(1deg);
  }

  66% {
    transform: translate(20px, -10px) rotate(-1deg);
  }
}

/* ================================
   TIPOGRAFÍA
   ================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
  margin-bottom: var(--spacing-md);
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
}

h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
}

h3 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 600;
}

h4 {
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
  font-weight: 600;
}

h5 {
  font-size: clamp(1.125rem, 2vw, 1.25rem);
  font-weight: 500;
}

h6 {
  font-size: 1rem;
  font-weight: 500;
}

p {
  margin-bottom: var(--spacing-md);
  color: var(--text-secondary);
}

.text-muted {
  color: var(--text-muted);
}

.text-primary {
  color: var(--text-primary);
}

.text-secondary {
  color: var(--text-secondary);
}

.lead {
  font-size: 1.25rem;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-muted);
}

/* ================================
   COMPONENTES GLASS UI
   ================================ */

/* Glass Base */
.glass {
  background: var(--surface-glass);
  backdrop-filter: blur(var(--blur-glass));
  -webkit-backdrop-filter: blur(var(--blur-glass));
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-glass);
  transition: all var(--transition-normal);
}

.glass-subtle {
  background: var(--surface-glass-subtle);
  backdrop-filter: blur(var(--blur-subtle));
  -webkit-backdrop-filter: blur(var(--blur-subtle));
  border: 1px solid var(--border-glass-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
}

.glass:hover {
  background: var(--surface-glass-hover);
  transform: translateY(-2px);
}

/* Cards */
.card {
  padding: var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
}

.card-sm {
  padding: var(--spacing-md);
}

.card-lg {
  padding: var(--spacing-xl);
}

.card-header {
  margin-bottom: var(--spacing-lg);
  padding-bottom: var(--spacing-md);
  border-bottom: 1px solid var(--border-glass-subtle);
}

.card-body {
  flex: 1;
}

.card-footer {
  margin-top: var(--spacing-lg);
  padding-top: var(--spacing-md);
  border-top: 1px solid var(--border-glass-subtle);
}

/* ================================
   BOTONES
   ================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  padding: 12px 24px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  text-align: center;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  min-height: 44px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Botón Primario (Sólido) */
.btn-primary {
  background: var(--primary-blue);
  color: var(--text-primary);
  box-shadow: var(--shadow-button);
}

.btn-primary:hover:not(:disabled) {
  background: var(--secondary-blue);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px 0 rgba(42, 47, 108, 0.5);
}

/* Botón Secundario (Glass) */
.btn-secondary {
  background: var(--surface-glass);
  backdrop-filter: blur(var(--blur-subtle));
  -webkit-backdrop-filter: blur(var(--blur-subtle));
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  box-shadow: var(--shadow-soft);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--surface-glass-hover);
  transform: translateY(-1px);
}

/* Botón de Outline */
.btn-outline {
  background: transparent;
  border: 2px solid var(--border-glass);
  color: var(--text-primary);
}

.btn-outline:hover:not(:disabled) {
  background: var(--surface-glass-subtle);
  border-color: var(--text-primary);
}

/* Tamaños de botones */
.btn-sm {
  padding: 8px 16px;
  font-size: 0.875rem;
  min-height: 36px;
}

.btn-lg {
  padding: 16px 32px;
  font-size: 1.125rem;
  min-height: 52px;
}

.btn-xl {
  padding: 20px 40px;
  font-size: 1.25rem;
  min-height: 60px;
}

/* Botón de ancho completo */
.btn-block {
  width: 100%;
}

/* ================================
   FORMULARIOS
   ================================ */
.form-control {
  width: 100%;
  padding: 12px 16px;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text-primary);
  background: var(--input-bg);
  border: 1px solid var(--border-glass-subtle);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.form-control::placeholder {
  color: var(--text-muted);
}

.form-control:focus {
  outline: none;
  background: var(--input-bg-focus);
  border-color: var(--secondary-blue);
  box-shadow: 0 0 0 3px rgba(92, 102, 204, 0.2);
}

.form-group {
  margin-bottom: var(--spacing-lg);
}

.form-label {
  display: block;
  margin-bottom: var(--spacing-sm);
  font-weight: 500;
  color: var(--text-primary);
}

.form-select {
  width: 100%;
  padding: 12px 16px;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text-primary);
  background: var(--input-bg) url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e") no-repeat right 12px center;
  background-size: 16px 12px;
  border: 1px solid var(--border-glass-subtle);
  border-radius: var(--radius-sm);
  padding-right: 40px;
  transition: all var(--transition-fast);
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

.form-select:focus {
  outline: none;
  background-color: var(--input-bg-focus);
  border-color: var(--secondary-blue);
  box-shadow: 0 0 0 3px rgba(92, 102, 204, 0.2);
}

.form-select option {
  background-color: var(--input-bg);
  color: var(--text-primary);
}

/* ================================
   LAYOUT COMPONENTS
   ================================ */

/* Container */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-lg);
}

.container-fluid {
  width: 100%;
  padding: 0 var(--spacing-lg);
}

/* Grid */
.row {
  display: flex;
  flex-wrap: wrap;
  margin: 0 calc(-1 * var(--spacing-sm));
}

.col {
  flex: 1;
  padding: 0 var(--spacing-sm);
}

.col-12 {
  flex: 0 0 100%;
  max-width: 100%;
}

.col-6 {
  flex: 0 0 50%;
  max-width: 50%;
}

.col-4 {
  flex: 0 0 33.333333%;
  max-width: 33.333333%;
}

.col-3 {
  flex: 0 0 25%;
  max-width: 25%;
}

/* Flexbox utilities */
.d-flex {
  display: flex;
}

.d-block {
  display: block;
}

.d-inline-block {
  display: inline-block;
}

.d-none {
  display: none;
}

.justify-content-center {
  justify-content: center;
}

.justify-content-between {
  justify-content: space-between;
}

.justify-content-end {
  justify-content: flex-end;
}

.align-items-center {
  align-items: center;
}

.align-items-start {
  align-items: flex-start;
}

.align-items-end {
  align-items: flex-end;
}

.flex-column {
  flex-direction: column;
}

.flex-wrap {
  flex-wrap: wrap;
}

.flex-grow-1 {
  flex-grow: 1;
}

/* Text alignment */
.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

/* ================================
   SIDEBAR Y NAVEGACIÓN
   ================================ */
.sidebar {
  width: 260px;
  min-height: 100vh;
  padding: var(--spacing-xl) var(--spacing-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%);
  backdrop-filter: blur(var(--blur-glass));
  -webkit-backdrop-filter: blur(var(--blur-glass));
  border-right: 1px solid var(--border-glass-subtle);
  position: relative;
  transition: width var(--transition-normal), padding var(--transition-normal);
  overflow: hidden;
}

/* Sidebar colapsado (solo desktop) */
.sidebar[data-collapsed="true"] {
  width: 80px;
  padding: var(--spacing-xl) var(--spacing-sm);
}

/* Botón de toggle para colapsar */
.sidebar-toggle-btn {
  position: absolute;
  top: var(--spacing-md);
  right: var(--spacing-md);
  background: var(--surface-glass-subtle);
  border: 1px solid var(--border-glass-subtle);
  border-radius: var(--radius-md);
  padding: var(--spacing-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  backdrop-filter: blur(var(--blur-subtle));
  -webkit-backdrop-filter: blur(var(--blur-subtle));
  z-index: 10;
}

.sidebar-toggle-btn:hover {
  background: var(--surface-glass);
  color: var(--text-primary);
  transform: scale(1.05);
}

.sidebar[data-collapsed="true"] .sidebar-toggle-btn {
  right: var(--spacing-xs);
}

.sidebar[data-collapsed="true"] .sidebar-toggle-btn .toggle-icon {
  transform: rotate(180deg);
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-xl);
  transition: all var(--transition-normal);
}

.brand-logo {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--secondary-blue), var(--primary-blue));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-heading);
  border: 1px solid var(--border-glass-subtle);
  box-shadow: var(--shadow-soft);
  /* Aquí irá el logo cuando lo proporciones */
}

.brand-text {
  text-align: center;
  transition: all var(--transition-normal);
  overflow: hidden;
}

.brand-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-primary);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin: var(--spacing-xs) 0 0 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

/* Estados del brand cuando está colapsado */
.sidebar[data-collapsed="true"] .brand-text {
  opacity: 0;
  transform: scale(0.8);
  visibility: hidden;
}

.sidebar[data-collapsed="true"] .brand {
  margin-bottom: var(--spacing-lg);
}

.nav {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.nav-item {
  padding: var(--spacing-md);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  text-decoration: none;
  transition: all var(--transition-fast);
  font-weight: 500;
}

.nav-item:hover {
  background: var(--surface-glass-subtle);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--surface-glass);
  color: var(--text-primary);
  border: 1px solid var(--border-glass-subtle);
  box-shadow: var(--shadow-soft);
}

/* ================================
   SIDEBAR ENHANCEMENTS
   ================================ */

/* Área de marca mejorada */
.brand {
  padding: var(--spacing-lg) 0;
  border-bottom: 1px solid var(--border-glass-subtle);
  margin-bottom: var(--spacing-lg);
}

.brand-logo-container {
  position: relative;
  display: inline-block;
}

.brand-logo {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  object-fit: contain;
  background: var(--surface-glass-subtle);
  border: 2px solid var(--border-glass);
  box-shadow: var(--shadow-soft);
  transition: all var(--transition-normal);
  padding: var(--spacing-sm);
}

.brand-logo:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-glass);
}

.brand-title {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--text-primary);
  margin: var(--spacing-sm) 0 var(--spacing-xs);
  letter-spacing: 0.3px;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  margin: 0;
}

/* Navegación mejorada */
.nav {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
  padding: 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-md) var(--spacing-lg);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  text-decoration: none;
  transition: all var(--transition-fast);
  font-weight: 500;
  font-size: 0.9rem;
  position: relative;
  overflow: hidden;
}

.nav-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: var(--secondary-blue);
  transform: scaleY(0);
  transition: transform var(--transition-fast);
}

.nav-item:hover {
  background: var(--surface-glass-subtle);
  color: var(--text-primary);
  transform: translateX(4px);
  box-shadow: var(--shadow-soft);
}

.nav-item:hover::before {
  transform: scaleY(1);
}

.nav-item.active {
  background: var(--surface-glass);
  color: var(--text-primary);
  border: 1px solid var(--border-glass-subtle);
  box-shadow: var(--shadow-soft);
  transform: translateX(2px);
}

.nav-item.active::before {
  transform: scaleY(1);
  background: var(--secondary-blue);
}

/* Iconos de navegación */
.nav-icon-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.nav-icon {
  width: 20px;
  height: 20px;
  opacity: 0.7;
  transition: all var(--transition-fast);
}

.nav-item:hover .nav-icon,
.nav-item.active .nav-icon {
  opacity: 1;
  transform: scale(1.1);
}

.nav-item.active .nav-icon {
  filter: drop-shadow(0 0 4px rgba(92, 102, 204, 0.4));
}

/* Etiquetas de navegación */
.nav-label {
  font-weight: 500;
  font-size: 0.9rem;
  transition: all var(--transition-fast);
  white-space: nowrap;
  overflow: hidden;
}

.nav-item:hover .nav-label,
.nav-item.active .nav-label {
  font-weight: 600;
}

/* Estados del nav cuando está colapsado */
.sidebar[data-collapsed="true"] .nav-label {
  opacity: 0;
  transform: translateX(-10px);
  visibility: hidden;
}

.sidebar[data-collapsed="true"] .nav-item {
  justify-content: center;
  padding: var(--spacing-md);
}

.sidebar[data-collapsed="true"] .nav-icon-wrapper {
  margin: 0;
}

/* Tooltips para sidebar colapsado */
.sidebar[data-collapsed="true"] .nav-item {
  position: relative;
}

.sidebar[data-collapsed="true"] .nav-item::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + var(--spacing-md));
  top: 50%;
  transform: translateY(-50%);
  background: var(--surface-glass);
  backdrop-filter: blur(var(--blur-subtle));
  -webkit-backdrop-filter: blur(var(--blur-subtle));
  color: var(--text-primary);
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-fast);
  z-index: 1000;
  border: 1px solid var(--border-glass-subtle);
  box-shadow: var(--shadow-soft);
}

.sidebar[data-collapsed="true"] .nav-item:hover::after {
  opacity: 1;
  visibility: visible;
}

/* Footer del sidebar */
.sidebar-footer {
  margin-top: auto;
  padding-top: var(--spacing-lg);
  border-top: 1px solid var(--border-glass-subtle);
  transition: all var(--transition-normal);
}

.status-indicator {
  background: var(--surface-glass-subtle);
  border: 1px solid var(--border-glass-subtle);
  backdrop-filter: blur(var(--blur-subtle));
  -webkit-backdrop-filter: blur(var(--blur-subtle));
  transition: all var(--transition-normal);
}

.status-indicator small {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 500;
}

.status-indicator svg {
  fill: var(--success);
  stroke: var(--success);
  opacity: 0.8;
  flex-shrink: 0;
}

.status-text {
  transition: all var(--transition-normal);
  white-space: nowrap;
  overflow: hidden;
}

/* Footer cuando está colapsado */
.sidebar[data-collapsed="true"] .status-indicator {
  padding: var(--spacing-sm) !important;
}

.sidebar[data-collapsed="true"] .status-text {
  opacity: 0;
  transform: scale(0.8);
  visibility: hidden;
  width: 0;
  margin-left: 0;
}

/* Animaciones del sidebar */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.sidebar {
  animation: slideIn 0.6s ease-out;
}

.nav-item {
  animation: slideIn 0.4s ease-out;
  animation-delay: calc(var(--item-index, 0) * 0.1s);
}

/* Estados de carga y transiciones suaves */
.nav-item:focus {
  outline: 2px solid var(--secondary-blue);
  outline-offset: 2px;
}

.nav-item:focus:not(:focus-visible) {
  outline: none;
}

/* Mejoras de accesibilidad */
@media (prefers-reduced-motion: reduce) {

  .nav-item,
  .brand-logo,
  .sidebar {
    animation: none;
    transition: none;
  }

  .nav-item:hover {
    transform: none;
  }

  .brand-logo:hover {
    transform: none;
  }
}

/* Estados de interacción mejorados */
.nav-item:active {
  transform: translateX(2px) scale(0.98);
}

.nav-item.active:active {
  transform: translateX(2px) scale(0.98);
}

/* Botón móvil para abrir sidebar */
.sidebar-mobile-toggle {
  position: fixed;
  top: var(--spacing-lg);
  left: var(--spacing-lg);
  z-index: 1001;
  background: var(--surface-glass);
  backdrop-filter: blur(var(--blur-subtle));
  -webkit-backdrop-filter: blur(var(--blur-subtle));
  border: 1px solid var(--border-glass-subtle);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-soft);
}

.sidebar-mobile-toggle:hover {
  background: var(--surface-glass-hover);
  transform: scale(1.05);
  box-shadow: var(--shadow-glass);
}

.sidebar-mobile-toggle:active {
  transform: scale(0.95);
}

.hamburger-icon {
  display: block;
  transition: transform var(--transition-fast);
}

.sidebar.show ~ .sidebar-mobile-toggle .hamburger-icon {
  transform: rotate(90deg);
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .sidebar {
    width: 220px;
  }

  /* Desactivar colapso en tablets */
  .sidebar[data-collapsed="true"] {
    width: 220px;
    padding: var(--spacing-xl) var(--spacing-lg);
  }

  .sidebar[data-collapsed="true"] .nav-label,
  .sidebar[data-collapsed="true"] .brand-text,
  .sidebar[data-collapsed="true"] .status-text {
    opacity: 1;
    transform: none;
    visibility: visible;
  }

  .sidebar[data-collapsed="true"] .nav-item {
    justify-content: flex-start;
    padding: var(--spacing-md) var(--spacing-lg);
  }

  .sidebar[data-collapsed="true"] .nav-item::after {
    display: none;
  }

  .sidebar-toggle-btn {
    display: none !important;
  }

  .brand-title {
    font-size: 1.15rem;
  }

  .nav-item {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 0.85rem;
  }

  .nav-icon-wrapper {
    width: 20px;
    height: 20px;
  }

  .nav-icon {
    width: 18px;
    height: 18px;
  }
}

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    z-index: 1000;
    transition: left var(--transition-normal);
    backdrop-filter: blur(var(--blur-strong));
    -webkit-backdrop-filter: blur(var(--blur-strong));
  }

  .sidebar.show {
    left: 0;
    box-shadow: var(--shadow-glass);
  }

  /* Overlay para móvil */
  .sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
  }

  .sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
  }
}

@media (max-width: 480px) {
  .sidebar {
    width: 100vw;
    left: -100vw;
  }

  .brand-logo {
    width: 48px;
    height: 48px;
  }

  .brand-title {
    font-size: 1.1rem;
  }

  .nav-item {
    padding: var(--spacing-md);
    gap: var(--spacing-md);
  }
}

/* Main Content */
.main-content {
  flex: 1;
  padding: var(--spacing-xl);
  min-height: 100vh;
  transition: margin-left var(--transition-normal);
}

/* Ajustar contenido principal cuando sidebar está colapsado */
.sidebar[data-collapsed="true"] ~ .main-content,
.sidebar[data-collapsed="true"] + .main-content {
  margin-left: 80px;
}

.main-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--spacing-xl);
}

.main-header h2 {
  margin: 0;
  font-family: var(--font-heading);
}

.subtitle {
  color: var(--text-muted);
  margin-top: var(--spacing-xs);
  font-size: 1rem;
}

/* Layout principal con sidebar */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.app-layout .sidebar {
  flex-shrink: 0;
}

.app-layout .main-content {
  flex: 1;
  transition: all var(--transition-normal);
}

/* ================================
   COMPONENTES ESPECÍFICOS
   ================================ */

/* Hero Section */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  padding: var(--spacing-3xl) 0;
}

.hero-content {
  max-width: 800px;
  z-index: 2;
}

.hero-title {
  font-size: clamp(3rem, 6vw, 5rem);
  font-weight: 800;
  margin-bottom: var(--spacing-lg);
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--secondary-blue) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.5rem;
  color: var(--text-muted);
  margin-bottom: var(--spacing-2xl);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* Feature Cards */
.feature-card {
  text-align: center;
  height: 100%;
  padding: var(--spacing-xl);
  transition: all var(--transition-normal);
}

.feature-card:hover {
  transform: translateY(-8px);
}

.feature-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto var(--spacing-lg);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--secondary-blue), var(--primary-blue));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--text-primary);
  box-shadow: var(--shadow-soft);
}

/* Badges y Estados */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-success {
  background: var(--success);
  color: white;
}

.badge-warning {
  background: var(--warning);
  color: white;
}

.badge-error {
  background: var(--error);
  color: white;
}

.badge-info {
  background: var(--info);
  color: white;
}

.badge-glass {
  background: var(--surface-glass);
  color: var(--text-primary);
  border: 1px solid var(--border-glass-subtle);
}

/* ================================
   TABLAS
   ================================ */
.table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--spacing-lg);
}

.table th,
.table td {
  padding: var(--spacing-md);
  text-align: left;
  border-bottom: 1px solid var(--border-glass-subtle);
}

.table th {
  background: var(--surface-glass-subtle);
  font-weight: 600;
  color: var(--text-primary);
  position: sticky;
  top: 0;
}

.table tr:hover {
  background: var(--surface-glass-subtle);
}

.table-responsive {
  overflow-x: auto;
  border-radius: var(--radius-md);
}

/* ================================
   MODALES
   ================================ */
.modal {
  position: fixed !important;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(var(--blur-subtle));
  -webkit-backdrop-filter: blur(var(--blur-subtle));
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
  overflow-x: hidden;
  overflow-y: auto;
}

.modal.show {
  opacity: 1;
  visibility: visible;
}

.modal-dialog {
  position: relative;
  width: auto;
  max-width: 500px;
  margin: 0 !important;
  pointer-events: none;
}

.modal-dialog-centered {
  display: flex;
  align-items: center;
  min-height: auto;
}

.modal-content {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  pointer-events: auto;
  background: var(--surface-glass);
  backdrop-filter: blur(var(--blur-glass));
  -webkit-backdrop-filter: blur(var(--blur-glass));
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-glass);
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95);
  transition: all var(--transition-normal);
}

.modal.show .modal-content {
  transform: scale(1);
}

.modal-header {
  padding: var(--spacing-lg);
  border-bottom: 1px solid var(--border-glass-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-body {
  padding: var(--spacing-lg);
}

.modal-footer {
  padding: var(--spacing-lg);
  border-top: 1px solid var(--border-glass-subtle);
  display: flex;
  gap: var(--spacing-md);
  justify-content: flex-end;
}

/* ================================
   ALERTAS
   ================================ */
.alert {
  position: relative;
  padding: var(--spacing-md) var(--spacing-lg);
  border-radius: var(--radius-md);
  margin-bottom: var(--spacing-lg);
  border: 1px solid transparent;
  backdrop-filter: blur(var(--blur-subtle));
  -webkit-backdrop-filter: blur(var(--blur-subtle));
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 500;
}

.alert-success {
  background: rgba(16, 185, 129, 0.25);
  border-color: rgba(16, 185, 129, 0.4);
  color: var(--success);
}

.alert-warning {
  background: rgba(245, 158, 11, 0.25);
  border-color: rgba(245, 158, 11, 0.4);
  color: var(--warning);
}

.alert-danger {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.4);
  color: var(--error);
}

.alert-info {
  background: rgba(59, 130, 246, 0.25);
  border-color: rgba(59, 130, 246, 0.4);
  color: var(--info);
}

/* ================================
   UTILIDADES
   ================================ */

/* Espaciado */
.m-0 {
  margin: 0;
}

.mt-0 {
  margin-top: 0;
}

.mb-0 {
  margin-bottom: 0;
}

.ml-0 {
  margin-left: 0;
}

.mr-0 {
  margin-right: 0;
}

.m-1 {
  margin: var(--spacing-xs);
}

.m-2 {
  margin: var(--spacing-sm);
}

.m-3 {
  margin: var(--spacing-md);
}

.m-4 {
  margin: var(--spacing-lg);
}

.m-5 {
  margin: var(--spacing-xl);
}

.p-0 {
  padding: 0;
}

.p-1 {
  padding: var(--spacing-xs);
}

.p-2 {
  padding: var(--spacing-sm);
}

.p-3 {
  padding: var(--spacing-md);
}

.p-4 {
  padding: var(--spacing-lg);
}

.p-5 {
  padding: var(--spacing-xl);
}

/* Sombras */
.shadow-sm {
  box-shadow: var(--shadow-soft);
}

.shadow {
  box-shadow: var(--shadow-glass);
}

.shadow-none {
  box-shadow: none;
}

/* Bordes redondeados */
.rounded-sm {
  border-radius: var(--radius-sm);
}

.rounded {
  border-radius: var(--radius-md);
}

.rounded-lg {
  border-radius: var(--radius-lg);
}

.rounded-xl {
  border-radius: var(--radius-xl);
}

.rounded-full {
  border-radius: 50%;
}

/* ================================
   RESPONSIVE DESIGN
   ================================ */
@media (max-width: 1024px) {
  .sidebar {
    width: 220px;
    padding: var(--spacing-lg);
  }

  .main-content {
    padding: var(--spacing-lg);
  }

  .col-md-6 {
    flex: 0 0 50%;
    max-width: 50%;
  }

  .col-md-4 {
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
  }

  .col-md-3 {
    flex: 0 0 25%;
    max-width: 25%;
  }
}

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: -260px;
    top: 0;
    height: 100vh;
    z-index: 999;
    transition: left var(--transition-normal);
  }

  .sidebar.show {
    left: 0;
  }

  .main-content {
    width: 100%;
    padding: var(--spacing-md);
  }

  .main-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-md);
  }

  .hero-title {
    font-size: clamp(2rem, 8vw, 3rem);
  }

  .hero-subtitle {
    font-size: 1.125rem;
  }

  .col, .col-6, .col-4, .col-3 {
    flex: 0 0 100%;
    max-width: 100%;
    margin-bottom: var(--spacing-lg);
  }

  .btn {
    padding: 12px 20px;
    font-size: 0.9rem;
  }

  .modal-content {
    width: 95%;
    margin: var(--spacing-md);
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 var(--spacing-md);
  }

  .hero {
    padding: var(--spacing-2xl) 0;
  }

  .feature-card {
    padding: var(--spacing-lg);
  }

  .btn-xl {
    padding: 16px 24px;
    font-size: 1.125rem;
  }
}

/* ================================
   CLASES ESPECÍFICAS FALTANTES
   ================================ */

/* Botón azul personalizado (usado en archivos existentes) */
.btn-blue {
  background: var(--primary-blue);
  color: var(--text-primary);
  border: none;
  box-shadow: var(--shadow-button);
  transition: all var(--transition-fast);
}

.btn-blue:hover:not(:disabled) {
  background: var(--secondary-blue);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px 0 rgba(42, 47, 108, 0.5);
  color: var(--text-primary);
}

/* Card personalizada (usada en archivos existentes) */
.card-custom {
  background: var(--surface-glass);
  backdrop-filter: blur(var(--blur-glass));
  -webkit-backdrop-filter: blur(var(--blur-glass));
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-glass);
  transition: all var(--transition-normal);
}

.card-custom:hover {
  background: var(--surface-glass-hover);
  transform: translateY(-2px);
}

/* Tabla personalizada */
.table-custom {
  background: transparent;
  color: var(--text-primary);
}

.table-custom th {
  background: var(--surface-glass-subtle);
  color: var(--text-primary);
  font-weight: 600;
  border-bottom: 1px solid var(--border-glass-subtle);
  padding: var(--spacing-md);
}

.table-custom td {
  border-bottom: 1px solid var(--border-glass-subtle);
  padding: var(--spacing-md);
  color: var(--text-secondary);
}

.table-borderless th,
.table-borderless td {
  border: none;
}

.table-hover tbody tr:hover {
  background: var(--surface-glass-subtle);
}

/* Login Card (usada en index.php y login.php) */
.login-card {
  max-width: 400px;
  margin: 10vh auto;
  padding: var(--spacing-2xl);
  background: var(--surface-glass);
  backdrop-filter: blur(var(--blur-glass));
  -webkit-backdrop-filter: blur(var(--blur-glass));
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-glass);
}

.login-card .hero-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-primary);
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
  background: none;
  -webkit-text-fill-color: var(--text-primary);
  margin-bottom: var(--spacing-md);
  font-family: var(--font-heading);
}

.login-card .text-muted {
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.login-card .form-label {
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
  font-weight: 500;
}

.login-card .btn {
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

/* ================================
   BOOTSTRAP COMPONENTS INTEGRATION
   ================================ */

/* List Group */
.list-group {
  display: flex;
  flex-direction: column;
  padding: 0;
  margin: 0;
  border-radius: var(--radius-md);
}

.list-group-flush {
  border-radius: 0;
}

.list-group-flush .list-group-item {
  border-width: 0 0 1px;
  border-radius: 0;
}

.list-group-item {
  position: relative;
  display: block;
  padding: var(--spacing-md);
  color: var(--text-muted);
  text-decoration: none;
  background: transparent;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
}

.list-group-item:hover,
.list-group-item:focus {
  color: var(--text-primary);
  background: var(--surface-glass-subtle);
  text-decoration: none;
}

.list-group-item-action {
  cursor: pointer;
}

.list-group-item.active {
  background: var(--surface-glass);
  color: var(--text-primary);
  border-color: var(--border-glass-subtle);
  box-shadow: var(--shadow-soft);
}

/* Badges con colores de fondo */
.bg-primary {
  background-color: var(--primary-blue) !important;
}

.bg-secondary {
  background-color: #6c757d !important;
}

.bg-success {
  background-color: var(--success) !important;
}

.bg-danger {
  background-color: var(--error) !important;
}

.bg-warning {
  background-color: var(--warning) !important;
}

.bg-info {
  background-color: var(--info) !important;
}

.bg-light {
  background-color: #f8f9fa !important;
}

.bg-dark {
  background-color: #343a40 !important;
}

/* Alert components */
.alert-dismissible {
  position: relative;
  padding-right: 3rem;
}

.alert-dismissible .btn-close {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 2;
  padding: 0.75rem;
}

.btn-close {
  box-sizing: content-box;
  width: 1em;
  height: 1em;
  padding: 0.25em;
  color: var(--text-primary);
  background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23ffffff'%3e%3cpath d='m.354 1.646 4 4a.5.5 0 0 1 0 .708l-4 4a.5.5 0 0 1-.708-.708L3.293 6.5.646 2.854a.5.5 0 0 1 .708-.708z'/%3e%3c/svg%3e") center/1em auto no-repeat;
  border: 0;
  border-radius: 0.375rem;
  opacity: 0.5;
  cursor: pointer;
}

.btn-close:hover {
  opacity: 0.75;
}

.fade {
  transition: opacity 0.15s linear;
}

.fade:not(.show) {
  opacity: 0;
}

.show {
  opacity: 1;
}

/* ================================
   UTILITY CLASSES (Bootstrap-like)
   ================================ */

/* Margin utilities */
.m-auto {
  margin: auto !important;
}

.mx-auto {
  margin-left: auto !important;
  margin-right: auto !important;
}

.my-auto {
  margin-top: auto !important;
  margin-bottom: auto !important;
}

.my-1 {
  margin-top: 0.25rem !important;
  margin-bottom: 0.25rem !important;
}

.my-2 {
  margin-top: 0.5rem !important;
  margin-bottom: 0.5rem !important;
}

.my-3 {
  margin-top: 1rem !important;
  margin-bottom: 1rem !important;
}

.my-4 {
  margin-top: 1.5rem !important;
  margin-bottom: 1.5rem !important;
}

.my-5 {
  margin-top: 3rem !important;
  margin-bottom: 3rem !important;
}

.mt-0 {
  margin-top: 0 !important;
}

.mt-1 {
  margin-top: 0.25rem !important;
}

.mt-2 {
  margin-top: 0.5rem !important;
}

.mt-3 {
  margin-top: 1rem !important;
}

.mt-4 {
  margin-top: 1.5rem !important;
}

.mt-5 {
  margin-top: 3rem !important;
}

.mb-0 {
  margin-bottom: 0 !important;
}

.mb-1 {
  margin-bottom: var(--spacing-xs) !important;
}

.mb-2 {
  margin-bottom: var(--spacing-sm) !important;
}

.mb-3 {
  margin-bottom: var(--spacing-md) !important;
}

.mb-4 {
  margin-bottom: var(--spacing-lg) !important;
}

.mb-5 {
  margin-bottom: var(--spacing-2xl) !important;
}

.ms-auto {
  margin-left: auto !important;
}

.me-auto {
  margin-right: auto !important;
}

/* Padding utilities */
.p-1 {
  padding: 0.25rem !important;
}

.p-2 {
  padding: 0.5rem !important;
}

.p-3 {
  padding: 1rem !important;
}

.p-4 {
  padding: 1.5rem !important;
}

.p-5 {
  padding: 3rem !important;
}

.py-1 {
  padding-top: 0.25rem !important;
  padding-bottom: 0.25rem !important;
}

.py-2 {
  padding-top: 0.5rem !important;
  padding-bottom: 0.5rem !important;
}

.py-3 {
  padding-top: 1rem !important;
  padding-bottom: 1rem !important;
}

.py-4 {
  padding-top: 1.5rem !important;
  padding-bottom: 1.5rem !important;
}

.py-5 {
  padding-top: 3rem !important;
  padding-bottom: 3rem !important;
}

.px-1 {
  padding-left: 0.25rem !important;
  padding-right: 0.25rem !important;
}

.px-2 {
  padding-left: 0.5rem !important;
  padding-right: 0.5rem !important;
}

.px-3 {
  padding-left: 1rem !important;
  padding-right: 1rem !important;
}

.px-4 {
  padding-left: 1.5rem !important;
  padding-right: 1.5rem !important;
}

.px-5 {
  padding-left: 3rem !important;
  padding-right: 3rem !important;
}

/* Width utilities */
.w-25 {
  width: 25% !important;
}

.w-50 {
  width: 50% !important;
}

.w-75 {
  width: 75% !important;
}

.w-100 {
  width: 100% !important;
}

.w-auto {
  width: auto !important;
}

/* Height utilities */
.h-25 {
  height: 25% !important;
}

.h-50 {
  height: 50% !important;
}

.h-75 {
  height: 75% !important;
}

.h-100 {
  height: 100% !important;
}

.h-auto {
  height: auto !important;
}

/* Display utilities */
.d-inline {
  display: inline !important;
}

.d-inline-block {
  display: inline-block !important;
}

.d-block {
  display: block !important;
}

.d-grid {
  display: grid !important;
}

.d-table {
  display: table !important;
}

.d-table-row {
  display: table-row !important;
}

.d-table-cell {
  display: table-cell !important;
}

.d-flex {
  display: flex !important;
}

.d-inline-flex {
  display: inline-flex !important;
}

.d-none {
  display: none !important;
}

/* Position utilities */
.position-static {
  position: static !important;
}

.position-relative {
  position: relative !important;
}

.position-absolute {
  position: absolute !important;
}

.position-fixed {
  position: fixed !important;
}

.position-sticky {
  position: sticky !important;
}

/* Z-index utilities */
.z-1 {
  z-index: 1 !important;
}

.z-2 {
  z-index: 2 !important;
}

.z-3 {
  z-index: 3 !important;
}

/* Overflow utilities */
.overflow-auto {
  overflow: auto !important;
}

.overflow-hidden {
  overflow: hidden !important;
}

.overflow-visible {
  overflow: visible !important;
}

.overflow-scroll {
  overflow: scroll !important;
}

/* Text utilities */
.text-start {
  text-align: left !important;
}

.text-end {
  text-align: right !important;
}

.text-center {
  text-align: center !important;
}

.text-justify {
  text-align: justify !important;
}

.text-wrap {
  white-space: normal !important;
}

.text-nowrap {
  white-space: nowrap !important;
}

.text-break {
  word-wrap: break-word !important;
  word-break: break-word !important;
}

.text-lowercase {
  text-transform: lowercase !important;
}

.text-uppercase {
  text-transform: uppercase !important;
}

.text-capitalize {
  text-transform: capitalize !important;
}

.fw-light {
  font-weight: 300 !important;
}

.fw-lighter {
  font-weight: lighter !important;
}

.fw-normal {
  font-weight: 400 !important;
}

.fw-bold {
  font-weight: 700 !important;
}

.fw-bolder {
  font-weight: bolder !important;
}

.fst-italic {
  font-style: italic !important;
}

.fst-normal {
  font-style: normal !important;
}

/* Border utilities */
.border {
  border: 1px solid var(--border-glass-subtle) !important;
}

.border-0 {
  border: 0 !important;
}

.border-top {
  border-top: 1px solid var(--border-glass-subtle) !important;
}

.border-end {
  border-right: 1px solid var(--border-glass-subtle) !important;
}

.border-bottom {
  border-bottom: 1px solid var(--border-glass-subtle) !important;
}

.border-start {
  border-left: 1px solid var(--border-glass-subtle) !important;
}

.rounded {
  border-radius: var(--radius-md) !important;
}

.rounded-0 {
  border-radius: 0 !important;
}

.rounded-1 {
  border-radius: var(--radius-sm) !important;
}

.rounded-2 {
  border-radius: var(--radius-md) !important;
}

.rounded-3 {
  border-radius: var(--radius-lg) !important;
}

.rounded-circle {
  border-radius: 50% !important;
}

/* Color utilities */
.text-primary {
  color: var(--primary-blue) !important;
}

.text-secondary {
  color: var(--text-secondary) !important;
}

.text-success {
  color: var(--success) !important;
}

.text-info {
  color: var(--info) !important;
}

.text-warning {
  color: var(--warning) !important;
}

.text-danger {
  color: var(--error) !important;
}

.text-light {
  color: #f8f9fa !important;
}

.text-dark {
  color: #343a40 !important;
}

.text-body {
  color: var(--text-primary) !important;
}

.text-muted {
  color: var(--text-muted) !important;
}

.text-white {
  color: #fff !important;
}

.text-black-50 {
  color: rgba(0, 0, 0, 0.5) !important;
}

.text-white-50 {
  color: rgba(255, 255, 255, 0.5) !important;
}

/* Small text elements */
small, .small {
  font-size: 0.875em;
  color: var(--text-muted);
}

/* ================================
   FORM ENHANCEMENTS
   ================================ */

/* Form group spacing */
.form-group {
  margin-bottom: 1rem;
}

/* Validation states */
.was-validated .form-control:valid,
.form-control.is-valid {
  border-color: var(--success);
  box-shadow: 0 0 0 0.25rem rgba(16, 185, 129, 0.25);
}

.was-validated .form-control:invalid,
.form-control.is-invalid {
  border-color: var(--error);
  box-shadow: 0 0 0 0.25rem rgba(239, 68, 68, 0.25);
}

.valid-feedback {
  display: block;
  width: 100%;
  margin-top: 0.25rem;
  font-size: 0.875em;
  color: var(--success);
}

.invalid-feedback {
  display: block;
  width: 100%;
  margin-top: 0.25rem;
  font-size: 0.875em;
  color: var(--error);
}

/* ================================
   NAVBAR ENHANCEMENT
   ================================ */
.navbar {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
}

.navbar-brand {
  padding-top: 0.3125rem;
  padding-bottom: 0.3125rem;
  margin-right: 1rem;
  font-size: 1.25rem;
  text-decoration: none;
  white-space: nowrap;
}

.navbar-nav {
  display: flex;
  flex-direction: column;
  padding-left: 0;
  margin-bottom: 0;
  list-style: none;
}

.navbar-nav .nav-link {
  padding-right: 0;
  padding-left: 0;
}

.nav-link {
  display: block;
  padding: 0.5rem 1rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out;
}

.nav-link:hover,
.nav-link:focus {
  color: var(--text-primary);
}

/* Grid enhancements for older Bootstrap compatibility */
.row {
  --bs-gutter-x: 1.5rem;
  --bs-gutter-y: 0;
  display: flex;
  flex-wrap: wrap;
  margin-top: calc(-1 * var(--bs-gutter-y));
  margin-right: calc(-0.5 * var(--bs-gutter-x));
  margin-left: calc(-0.5 * var(--bs-gutter-x));
}

.row>* {
  flex-shrink: 0;
  width: 100%;
  max-width: 100%;
  padding-right: calc(var(--bs-gutter-x) * 0.5);
  padding-left: calc(var(--bs-gutter-x) * 0.5);
  margin-top: var(--bs-gutter-y);
}

/* Column classes */
.col-1 {
  flex: 0 0 auto;
  width: 8.33333333%;
}

.col-2 {
  flex: 0 0 auto;
  width: 16.66666667%;
}

.col-3 {
  flex: 0 0 auto;
  width: 25%;
}

.col-4 {
  flex: 0 0 auto;
  width: 33.33333333%;
}

.col-5 {
  flex: 0 0 auto;
  width: 41.66666667%;
}

.col-6 {
  flex: 0 0 auto;
  width: 50%;
}

.col-7 {
  flex: 0 0 auto;
  width: 58.33333333%;
}

.col-8 {
  flex: 0 0 auto;
  width: 66.66666667%;
}

.col-9 {
  flex: 0 0 auto;
  width: 75%;
}

.col-10 {
  flex: 0 0 auto;
  width: 83.33333333%;
}

.col-11 {
  flex: 0 0 auto;
  width: 91.66666667%;
}

.col-12 {
  flex: 0 0 auto;
  width: 100%;
}

/* Gap utilities */
.gap-0 {
  gap: 0 !important;
}

.gap-1 {
  gap: 0.25rem !important;
}

.gap-2 {
  gap: 0.5rem !important;
}

.gap-3 {
  gap: 1rem !important;
}

.gap-4 {
  gap: 1.5rem !important;
}

.gap-5 {
  gap: 3rem !important;
}

/* Responsive grid */
@media (min-width: 576px) {
  .col-sm-1 {
    flex: 0 0 auto;
    width: 8.33333333%;
  }

  .col-sm-2 {
    flex: 0 0 auto;
    width: 16.66666667%;
  }

  .col-sm-3 {
    flex: 0 0 auto;
    width: 25%;
  }

  .col-sm-4 {
    flex: 0 0 auto;
    width: 33.33333333%;
  }

  .col-sm-5 {
    flex: 0 0 auto;
    width: 41.66666667%;
  }

  .col-sm-6 {
    flex: 0 0 auto;
    width: 50%;
  }

  .col-sm-7 {
    flex: 0 0 auto;
    width: 58.33333333%;
  }

  .col-sm-8 {
    flex: 0 0 auto;
    width: 66.66666667%;
  }

  .col-sm-9 {
    flex: 0 0 auto;
    width: 75%;
  }

  .col-sm-10 {
    flex: 0 0 auto;
    width: 83.33333333%;
  }

  .col-sm-11 {
    flex: 0 0 auto;
    width: 91.66666667%;
  }

  .col-sm-12 {
    flex: 0 0 auto;
    width: 100%;
  }
}

@media (min-width: 768px) {
  .col-md-1 {
    flex: 0 0 auto;
    width: 8.33333333%;
  }

  .col-md-2 {
    flex: 0 0 auto;
    width: 16.66666667%;
  }

  .col-md-3 {
    flex: 0 0 auto;
    width: 25%;
  }

  .col-md-4 {
    flex: 0 0 auto;
    width: 33.33333333%;
  }

  .col-md-5 {
    flex: 0 0 auto;
    width: 41.66666667%;
  }

  .col-md-6 {
    flex: 0 0 auto;
    width: 50%;
  }

  .col-md-7 {
    flex: 0 0 auto;
    width: 58.33333333%;
  }

  .col-md-8 {
    flex: 0 0 auto;
    width: 66.66666667%;
  }

  .col-md-9 {
    flex: 0 0 auto;
    width: 75%;
  }

  .col-md-10 {
    flex: 0 0 auto;
    width: 83.33333333%;
  }

  .col-md-11 {
    flex: 0 0 auto;
    width: 91.66666667%;
  }

  .col-md-12 {
    flex: 0 0 auto;
    width: 100%;
  }
}

@media (min-width: 992px) {
  .col-lg-1 {
    flex: 0 0 auto;
    width: 8.33333333%;
  }

  .col-lg-2 {
    flex: 0 0 auto;
    width: 16.66666667%;
  }

  .col-lg-3 {
    flex: 0 0 auto;
    width: 25%;
  }

  .col-lg-4 {
    flex: 0 0 auto;
    width: 33.33333333%;
  }

  .col-lg-5 {
    flex: 0 0 auto;
    width: 41.66666667%;
  }

  .col-lg-6 {
    flex: 0 0 auto;
    width: 50%;
  }

  .col-lg-7 {
    flex: 0 0 auto;
    width: 58.33333333%;
  }

  .col-lg-8 {
    flex: 0 0 auto;
    width: 66.66666667%;
  }

  .col-lg-9 {
    flex: 0 0 auto;
    width: 75%;
  }

  .col-lg-10 {
    flex: 0 0 auto;
    width: 83.33333333%;
  }

  .col-lg-11 {
    flex: 0 0 auto;
    width: 91.66666667%;
  }

  .col-lg-12 {
    flex: 0 0 auto;
    width: 100%;
  }
}

/* ================================
   BOOTSTRAP OVERRIDES & INTEGRATION
   ================================ */

/* Bootstrap Modal Integration - Centrado correcto */
.modal.fade .modal-dialog,
.modal.show .modal-dialog {
  transition: transform 0.3s ease-out;
  transform: none !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

.modal-backdrop {
  backdrop-filter: blur(var(--blur-subtle));
  -webkit-backdrop-filter: blur(var(--blur-subtle));
}

/* Bootstrap Input Groups */
.input-group {
  display: flex;
  gap: var(--spacing-sm);
}

.input-group .form-control {
  flex: 1;
}

/* Bootstrap Gap Utilities */
.g-3 {
  gap: 1rem;
}

.gap-2 {
  gap: var(--spacing-sm);
}

/* Bootstrap Form Check */
.form-check {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-sm);
}

.form-check-input {
  width: 1rem;
  height: 1rem;
  background: var(--input-bg);
  border: 1px solid var(--border-glass-subtle);
  border-radius: var(--radius-sm);
}

.form-check-input:checked {
  background: var(--primary-blue);
  border-color: var(--primary-blue);
}

.form-check-label {
  color: var(--text-primary);
  font-weight: 500;
}

/* Smooth Scrolling */
html {
  scroll-behavior: smooth;
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Print Styles */
@media print {
  body {
    background: white !important;
    color: black !important;
  }

  .sidebar {
    display: none;
  }

  .glass,
  .card {
    background: white !important;
    backdrop-filter: none !important;
    border: 1px solid #ccc !important;
  }
}

/* ================================
   MODAL FIX - CENTRADO FORZADO
   Debe estar al final para sobrescribir Bootstrap
   ================================ */
.modal.fade,
.modal.show,
.modal {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
}

.modal .modal-dialog,
.modal.fade .modal-dialog,
.modal.show .modal-dialog {
  margin: 0 auto !important;
  max-width: 500px;
  width: 90%;
  transform: none !important;
}

@media (min-width: 576px) {
  .modal .modal-dialog,
  .modal.fade .modal-dialog,
  .modal.show .modal-dialog {
    width: auto;
    min-width: 500px;
  }
}
