/* assets/css/style.css - Sistema Académico 2026 Eben Ezer School */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
  /* TEMA INSTITUCIONAL UNIFICADO: AZUL MILITAR + DORADO + VERDE SUAVE */
  --primary-navy: #1B2A4A;
  --primary-navy-dark: #0D1B2A;
  --primary-navy-light: #28385E;
  --bg-gradient: linear-gradient(135deg, #0D1B2A 0%, #1B2A4A 60%, #16223B 100%);
  
  /* DORADO DE REALCE */
  --accent-gold: #D97706;
  --accent-gold-light: #F59E0B;
  --accent-gold-bright: #FBBF24;
  --gold-gradient: linear-gradient(135deg, #D97706 0%, #F59E0B 100%);
  
  /* VERDE SUAVE SECUNDARIO DE ESTADO */
  --accent-green-soft: #059669;
  --accent-green-light: #10B981;
  --bg-green-soft: #DCFCE7;
  --text-green-soft: #047857;
  --green-gradient: linear-gradient(135deg, #059669 0%, #10B981 100%);
  
  /* SUPERFICIES Y TEXTOS */
  --surface-light: #FFFFFF;
  --surface-muted: #F8FAFC;
  --border-color: #E2E8F0;
  --text-main: #0D1B2A;
  --text-muted: #64748B;
  
  /* CALIFICACIONES MINEDU PERÚ */
  --nota-ad: #059669;
  --nota-a: #2563EB;
  --nota-b: #D97706;
  --nota-c: #DC2626;

  --shadow-sm: 0 2px 6px rgba(13, 27, 42, 0.06);
  --shadow-md: 0 6px 16px rgba(13, 27, 42, 0.10);
  --shadow-lg: 0 12px 30px rgba(13, 27, 42, 0.16);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
  background-color: #e8eef5;
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  color: var(--primary-navy-dark);
}

/* Layout App Container */
.app-wrapper {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* Sidebar Desktop */
.sidebar {
  width: 260px;
  background: var(--primary-navy-dark);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.35s ease, opacity 0.35s ease !important;
  box-shadow: 4px 0 15px rgba(0,0,0,0.15);
}

.main-content {
  transition: margin-left 0.35s cubic-bezier(0.4, 0, 0.2, 1), width 0.35s cubic-bezier(0.4, 0, 0.2, 1), max-width 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* BOTÓN ESCUDO CON NAVEGACIÓN DESLIZABLE DE SIDEBAR (SOLO MODO ESCRITORIO PC) */
.sidebar-emblem-toggle-btn {
  display: inline-flex !important;
}

.sidebar-emblem-toggle-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* OCULTAR EL BOTÓN ESCUDO DE ESCONDER MENÚ EN MODO MÓVIL (PANTALLAS <= 992px) */
@media (max-width: 992px) {
  .sidebar-emblem-toggle-btn {
    display: none !important;
  }
}

/* ESTADO COLAPSADO DE SIDEBAR EN MODO DESKOP (SOLO PC >= 993px) */
@media (min-width: 993px) {
  .app-wrapper.sidebar-collapsed .sidebar,
  body.sidebar-collapsed .sidebar {
    transform: translateX(-100%) !important;
    visibility: hidden !important;
    opacity: 0 !important;
  }

  .app-wrapper.sidebar-collapsed .main-content,
  body.sidebar-collapsed .main-content {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }
}

.sidebar-header {
  padding: 20px;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  background: rgba(0,0,0,0.15);
}

.sidebar-header img {
  height: 65px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 5px rgba(0,0,0,0.3));
}

.sidebar-header h3 {
  color: #ffffff;
  font-size: 1.1rem;
  margin-top: 8px;
  letter-spacing: 0.5px;
}

.sidebar-user {
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
}

.user-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent-gold);
  background: #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--primary-navy-dark);
  flex-shrink: 0;
}

.user-avatar-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary-navy);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  border: 2px solid var(--accent-gold);
  flex-shrink: 0;
}

.sidebar-nav {
  list-style: none;
  padding: 15px 10px;
  flex: 1;
  overflow-y: auto;
}

.sidebar-nav li {
  margin-bottom: 6px;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: #94a3b8;
  text-decoration: none;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  background: rgba(255,255,255,0.12);
  color: #ffffff;
}

.sidebar-nav a.active {
  background: linear-gradient(90deg, var(--accent-gold) 0%, #b45309 100%);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.3);
}

/* Sidebar Submenu Styling */
.sidebar-submenu {
  list-style: none;
  padding-left: 14px;
  margin-top: 4px;
}

.sidebar-submenu li a {
  padding: 8px 14px;
  font-size: 0.85rem;
  color: #cbd5e1;
}

.sidebar-submenu li a:hover,
.sidebar-submenu li a.active {
  color: #ffffff;
  background: rgba(255,255,255,0.15);
}

.has-submenu > a {
  justify-content: space-between;
}

.submenu-arrow {
  font-size: 0.75rem;
  transition: transform 0.2s ease;
}

.has-submenu.open .submenu-arrow {
  transform: rotate(180deg);
}

/* Main Content Body */
.main-content {
  flex: 1;
  margin-left: 260px;
  padding: 24px;
  padding-bottom: 90px; /* space for mobile nav */
  transition: all 0.3s ease;
}

/* Top Header Bar */
.top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface-light);
  padding: 16px 24px;
  border-radius: var(--radius-md);
  border: 2px solid var(--primary-navy);
  border-top: 4px solid var(--accent-gold);
  box-shadow: 0 8px 24px rgba(13, 27, 42, 0.12);
  margin-bottom: 24px;
}

.mobile-menu-toggle,
.mobile-menu-backdrop {
  display: none;
}

.page-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-title h2 {
  font-size: 1.4rem;
  color: var(--primary-navy-dark);
  font-weight: 900;
}

.role-badge {
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1.5px solid currentColor;
}

.role-admin { background: #fee2e2; color: #991b1b; }
.role-docente { background: #e0e7ff; color: #3730a3; }
.role-alumno { background: #dcfce7; color: #047857; }
.role-secretaria { background: #fef3c7; color: #92400e; }
.role-promotor { background: #fae8ff; color: #86198f; }
.role-padre { background: #e0f2fe; color: #075985; }

/* Grid Dashboard Cards & Panels Con Alto Realce */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.stat-card, .card, .panel-card, .card-panel {
  background: var(--surface-light);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: 0 8px 25px rgba(13, 27, 42, 0.10);
  display: flex;
  align-items: center;
  gap: 16px;
  border: 2px solid var(--primary-navy-light);
  border-top: 4px solid var(--accent-gold);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.stat-card:hover, .card:hover, .panel-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 30px rgba(13, 27, 42, 0.18);
  border-color: var(--accent-gold);
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.bg-blue { background: #1B2A4A; color: #FBBF24; }
.bg-gold { background: #D97706; color: #FFFFFF; }
.bg-green { background: #059669; color: #FFFFFF; }
.bg-purple { background: #6b21a8; color: #FFFFFF; }
.bg-red { background: #fee2e2; color: #b91c1c; }

.stat-info h4 {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 800;
}

.stat-info .stat-value {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--primary-navy-dark);
}

/* Contenedores de Tablas y Paneles Con Alto Realce */
.table-container, .panel-container, .content-panel {
  background: var(--surface-light);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 25px rgba(13, 27, 42, 0.10);
  border: 2px solid var(--primary-navy);
  border-top: 4px solid var(--accent-gold);
  padding: 18px;
  overflow-x: auto;
  margin-bottom: 24px;
}

.custom-table {
  width: 100% !important;
  border-collapse: collapse;
  text-align: left;
}

.custom-table th {
  background: var(--primary-navy);
  color: var(--accent-gold-bright);
  padding: 14px 18px;
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  border-bottom: 2px solid var(--border-military);
}
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  border-bottom: 2px solid var(--border-color);
}

.custom-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.95rem;
  vertical-align: middle;
}

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

/*  Badges */
.badge-nota {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: 800;
  font-size: 0.85rem;
  color: #ffffff;
  text-align: center;
  min-width: 42px;
}

.nota-AD { background: var(--nota-ad); }
.nota-A { background: var(--nota-a); }
.nota-B { background: var(--nota-b); }
.nota-C { background: var(--nota-c); }

/* DATATABLES MOBILE RESPONSIVE STYLING */
.dataTables_wrapper {
  font-size: 0.9rem;
  color: var(--text-main);
  padding: 8px 0;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
  margin-bottom: 16px;
}

.dataTables_wrapper .dataTables_filter input {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  font-size: 0.9rem;
  margin-left: 8px;
  outline: none;
  background: #ffffff;
}

.dataTables_wrapper .dataTables_filter input:focus {
  border-color: var(--primary-navy);
  box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.15);
}

.dataTables_wrapper .dataTables_length select {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  font-size: 0.9rem;
  background: #ffffff;
}

.dataTables_wrapper .dataTables_info {
  padding-top: 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

.dataTables_wrapper .dataTables_paginate {
  padding-top: 16px;
  display: flex;
  gap: 4px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
  padding: 6px 12px !important;
  border-radius: var(--radius-sm) !important;
  border: 1px solid var(--border-color) !important;
  background: #ffffff !important;
  color: var(--text-main) !important;
  font-weight: 700 !important;
  font-size: 0.85rem !important;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: var(--primary-navy) !important;
  color: #ffffff !important;
  border-color: var(--primary-navy) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
  background: linear-gradient(135deg, var(--accent-gold) 0%, #b45309 100%) !important;
  color: #ffffff !important;
  border-color: var(--accent-gold) !important;
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.3);
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover {
  opacity: 0.5;
  cursor: not-allowed;
  background: #f1f5f9 !important;
  color: #94a3b8 !important;
  border-color: #e2e8f0 !important;
}

/* MODAL DIALOG STYLES */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(5px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.2s ease-out;
}

.modal-overlay.active {
  display: flex;
}

.modal-card {
  background: #ffffff;
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px rgba(0,0,0,0.3);
  border: 1px solid var(--border-color);
  animation: slideUp 0.3s ease-out;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.modal-header h3 {
  font-size: 1.2rem;
  color: var(--primary-navy);
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-close-btn {
  background: transparent;
  border: none;
  font-size: 1.4rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.2s;
}

.modal-close-btn:hover {
  background: #fee2e2;
  color: #dc2626;
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: #f8fafc;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

/* GAMIFICATION ALUMNO STYLES */
.gamified-header {
  background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 50%, #8b5cf6 100%);
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.gamified-header::after {
  content: '🎮';
  position: absolute;
  right: -20px;
  bottom: -20px;
  font-size: 10rem;
  opacity: 0.1;
  pointer-events: none;
}

.player-profile {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.player-avatar-wrapper {
  position: relative;
}

.player-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 4px solid var(--accent-gold-light);
  box-shadow: 0 0 15px rgba(251, 191, 36, 0.5);
  object-fit: cover;
}

.level-badge {
  position: absolute;
  bottom: -6px;
  right: -6px;
  background: var(--accent-gold);
  color: #ffffff;
  font-weight: 800;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.8rem;
  border: 2px solid #ffffff;
}

.player-details h3 {
  color: #ffffff;
  font-size: 1.5rem;
  margin-bottom: 4px;
}

.player-stats-bar {
  display: flex;
  gap: 15px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.stat-pill {
  background: rgba(255,255,255,0.18);
  backdrop-filter: blur(10px);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.xp-progress-container {
  width: 100%;
  background: rgba(0,0,0,0.25);
  height: 14px;
  border-radius: 10px;
  overflow: hidden;
  margin-top: 14px;
}

.xp-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b 0%, #10b981 100%);
  border-radius: 10px;
  transition: width 0.5s ease;
}

/* Badge Cards */
.badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.badge-item {
  background: var(--surface-light);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  border: 1px solid var(--border-color);
  transition: transform 0.2s ease;
}

.badge-item:hover {
  transform: scale(1.03);
}

.badge-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #fef3c7;
  color: #d97706;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin: 0 auto 10px auto;
}

/* Forms & Inputs */
.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 0.9rem;
  color: var(--text-main);
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  font-size: 0.95rem;
  transition: border-color 0.2s ease;
  background: #ffffff;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-navy);
  box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.15);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--primary-navy);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--primary-navy-dark);
}

.btn-gold {
  background: var(--accent-gold);
  color: #ffffff;
}

.btn-gold:hover {
  background: #b45309;
}

.btn-danger {
  background: #dc2626;
  color: #ffffff;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.85rem;
}

/* Mobile Bottom Navigation Bar (100% Mobile Responsive) */
.mobile-nav-bar {
  display: none;
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  background: var(--primary-navy-dark, #0d1b2a) !important;
  border-top: 2px solid var(--primary-navy, #1b2a4a) !important;
  padding: 8px 12px;
  z-index: 999999 !important;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.4) !important;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  will-change: transform;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.mobile-nav-items {
  display: flex;
  justify-content: space-around;
  align-items: center;
  list-style: none;
}

.mobile-nav-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.7rem;
  font-weight: 600;
  gap: 4px;
}

.mobile-nav-link i {
  font-size: 1.2rem;
}

.mobile-nav-link.active {
  color: var(--accent-gold-light);
}

/* RESPONSIVE MEDIA QUERIES FOR MOBILE */
@media (max-width: 992px) {
  .sidebar {
    display: flex;
    width: min(86vw, 320px);
    transform: translateX(-105%);
    z-index: 3000;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  body.mobile-menu-open { overflow: hidden !important; }
  body.mobile-menu-open .sidebar {
    transform: translateX(0) !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 3000 !important;
  }

  .mobile-menu-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    border: 0;
    padding: 0;
    background: rgba(15, 23, 42, 0.52);
    z-index: 2900;
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, visibility .25s ease;
  }

  body.mobile-menu-open .mobile-menu-backdrop { opacity: 1; visibility: visible; }

  .mobile-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border: 0;
    border-radius: 10px;
    background: var(--primary-navy-dark);
    color: #fff;
    font-size: 1.15rem;
    cursor: pointer;
  }

  .main-content {
    margin-left: 0;
    padding: 16px;
    padding-bottom: 80px;
  }

  .mobile-nav-bar {
    display: block;
  }

  /* OCULTAR EL BOTÓN VISTA EN MODO MÓVIL (VISTA POR DEFECTO TARJETAS DE ALUMNOS) */
  #btnToggleVistaModo,
  .btn-vista,
  .btn-vista-toggle,
  .vista-toggle-btn,
  .btn-icon-action[title*="Vista"],
  [onclick*="toggleVista"] {
    display: none !important;
  }
}

@media (max-width: 768px) {
  .main-content { padding: 10px; padding-bottom: 88px; min-width: 0; }
  .top-header { padding: 10px 12px; margin-bottom: 14px; gap: 8px; flex-wrap: nowrap; }
  .page-title { min-width: 0; flex: 0 0 auto; overflow: hidden; }
  .page-title h2, .header-school-title { display: none !important; }
  .role-badge, .desktop-only-role { display: none !important; }
  .mobile-menu-toggle { display: inline-flex !important; flex: 0 0 38px; width: 38px; height: 38px; z-index: 10; }
  .user-profile-trigger strong { max-width: 120px !important; font-size: 0.82rem !important; }
  .user-profile-trigger span { font-size: 0.68rem !important; }
  .mobile-nav-bar { padding-bottom: max(8px, env(safe-area-inset-bottom)); }
  .mobile-nav-link { min-width: 48px; font-size: .64rem; }
  .table-responsive, .dataTables_wrapper { max-width: 100%; overflow-x: auto; }

  .dataTables_wrapper .dataTables_length,
  .dataTables_wrapper .dataTables_filter {
    text-align: left !important;
    float: none !important;
    width: 100%;
    margin-bottom: 12px;
  }

  .dataTables_wrapper .dataTables_filter input {
    width: 100%;
    margin-left: 0;
    margin-top: 4px;
  }

  .dataTables_wrapper .dataTables_paginate {
    justify-content: center !important;
  }

  /* AUTOMATIC TABLE-TO-CARD CONVERSION ON MOBILE */
  .table-responsive table,
  table.table,
  table.data-card-mobile,
  .table-container table,
  .dataTables_wrapper table {
    display: block !important;
    width: 100% !important;
    border: none !important;
  }

  .table-responsive table thead,
  table.table thead,
  .dataTables_wrapper table thead {
    display: none !important;
  }

  .table-responsive table tbody,
  table.table tbody,
  .dataTables_wrapper table tbody {
    display: block !important;
    width: 100% !important;
  }

  .table-responsive table tr,
  table.table tr,
  .dataTables_wrapper table tr {
    display: block !important;
    background: #ffffff !important;
    border: 1.5px solid #cbd5e1 !important;
    border-radius: 16px !important;
    margin-bottom: 16px !important;
    padding: 14px 16px !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08) !important;
    position: relative !important;
  }

  /* Gamer / Dark Theme Cards */
  body[style*="09132B"] table tr,
  body[style*="0f172a"] table tr,
  .gamer-card table tr,
  .dark-theme table tr {
    background: #0f172a !important;
    border-color: #1e293b !important;
    color: #f8fafc !important;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4) !important;
  }

  .table-responsive table td,
  table.table td,
  .dataTables_wrapper table td {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 10px 0 !important;
    border: none !important;
    border-bottom: 1px dashed #e2e8f0 !important;
    font-size: 0.88rem !important;
    text-align: right !important;
    min-height: 38px !important;
    word-break: break-word !important;
  }

  body[style*="09132B"] table td,
  body[style*="0f172a"] table td {
    border-bottom-color: #1e293b !important;
  }

  .table-responsive table td:last-child,
  table.table td:last-child,
  .dataTables_wrapper table td:last-child {
    border-bottom: none !important;
    margin-top: 6px !important;
    padding-top: 12px !important;
    justify-content: center !important;
    background: rgba(0, 0, 0, 0.02) !important;
    border-radius: 10px !important;
  }

  /* Etiqueta de la Columna (Título en Negrita a la Izquierda) */
  .table-responsive table td::before,
  table.table td::before,
  .dataTables_wrapper table td::before {
    content: attr(data-label);
    font-weight: 800 !important;
    color: var(--primary-navy, #1e3a8a) !important;
    text-align: left !important;
    margin-right: 12px !important;
    font-size: 0.8rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    flex-shrink: 0 !important;
  }

  body[style*="09132B"] table td::before,
  body[style*="0f172a"] table td::before {
    color: #38bdf8 !important;
  }
}
