/* ============================================
   CludDeportivos - Design System
   Inspired by modern SaaS (Stripe, Linear, Notion)
   ============================================ */

:root {
  /* === Brand Colors === */
  --brand-primary: #1e3a8a;
  --brand-primary-hover: #1e40af;
  --brand-primary-light: #eff6ff;
  --brand-accent: #f59e0b;
  --brand-accent-hover: #d97706;

  /* === Semantic Colors === */
  --color-success: #059669;
  --color-success-light: #d1fae5;
  --color-warning: #d97706;
  --color-warning-light: #fef3c7;
  --color-danger: #dc2626;
  --color-danger-light: #fee2e2;
  --color-info: #0891b2;
  --color-info-light: #cffafe;

  /* === Neutral Palette === */
  --neutral-50: #f8fafc;
  --neutral-100: #f1f5f9;
  --neutral-200: #e2e8f0;
  --neutral-300: #cbd5e1;
  --neutral-400: #94a3b8;
  --neutral-500: #64748b;
  --neutral-600: #475569;
  --neutral-700: #334155;
  --neutral-800: #1e293b;
  --neutral-900: #0f172a;

  /* === Surface === */
  --bg-page: #f8fafc;
  --bg-surface: #ffffff;
  --bg-sidebar: #0f172a;
  --bg-sidebar-hover: #1e293b;
  --border-default: #e2e8f0;
  --border-strong: #cbd5e1;

  /* === Text === */
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-on-dark: #f1f5f9;
  --text-on-primary: #ffffff;

  /* === Radius === */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;

  /* === Shadows === */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -1px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -2px rgba(15, 23, 42, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.10), 0 10px 10px -5px rgba(15, 23, 42, 0.04);

  /* === Transitions === */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   Base
   ============================================ */
* { box-sizing: border-box; }

html {
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@media (min-width: 768px) {
  html { font-size: 15px; }
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-feature-settings: 'cv11', 'ss01';
  font-weight: 400;
  color: var(--text-primary);
  background-color: var(--bg-page);
  line-height: 1.5;
  letter-spacing: -0.01em;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

h1 { font-size: 1.875rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }
h5 { font-size: 1rem; }

a {
  color: var(--brand-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover { color: var(--brand-primary-hover); }

/* ============================================
   Buttons
   ============================================ */
.btn {
  font-weight: 500;
  font-size: 0.875rem;
  letter-spacing: -0.01em;
  border-radius: var(--radius-md);
  padding: 0.5rem 1rem;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  box-shadow: var(--shadow-xs);
}

.btn:focus, .btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.15);
}

.btn-primary {
  background-color: var(--brand-primary);
  border-color: var(--brand-primary);
  color: var(--text-on-primary);
}

.btn-primary:hover, .btn-primary:focus {
  background-color: var(--brand-primary-hover);
  border-color: var(--brand-primary-hover);
  color: var(--text-on-primary);
}

.btn-secondary, .btn-light {
  background-color: var(--bg-surface);
  border-color: var(--border-default);
  color: var(--text-primary);
}

.btn-secondary:hover, .btn-light:hover {
  background-color: var(--neutral-50);
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.btn-success {
  background-color: var(--color-success);
  border-color: var(--color-success);
  color: white;
}

.btn-warning {
  background-color: var(--brand-accent);
  border-color: var(--brand-accent);
  color: white;
}

.btn-warning:hover {
  background-color: var(--brand-accent-hover);
  border-color: var(--brand-accent-hover);
  color: white;
}

.btn-danger {
  background-color: var(--color-danger);
  border-color: var(--color-danger);
  color: white;
}

.btn-outline-primary {
  background-color: transparent;
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}

.btn-outline-primary:hover {
  background-color: var(--brand-primary);
  color: white;
}

.btn-sm {
  font-size: 0.8125rem;
  padding: 0.375rem 0.75rem;
}

.btn-lg {
  font-size: 1rem;
  padding: 0.75rem 1.5rem;
}

/* ============================================
   Forms
   ============================================ */
.form-control, .form-select {
  font-size: 0.875rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  padding: 0.5rem 0.75rem;
  transition: all var(--transition-fast);
  background-color: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: var(--shadow-xs);
}

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

.form-control::placeholder { color: var(--text-muted); }

.form-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.375rem;
}

.form-check-input:checked {
  background-color: var(--brand-primary);
  border-color: var(--brand-primary);
}

.form-check-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* ============================================
   Cards
   ============================================ */
.card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--transition-base);
}

.card:hover { box-shadow: var(--shadow-sm); }

.card-header {
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-default);
  padding: 1rem 1.25rem;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text-primary);
}

.card-body { padding: 1.25rem; }

.card-title {
  color: var(--text-primary);
  font-weight: 600;
}

/* === KPI Cards === */
.kpi-card {
  background: var(--bg-surface);
  padding: 1.25rem;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.kpi-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.kpi-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--brand-primary);
}

.kpi-card.success::before { background: var(--color-success); }
.kpi-card.warning::before { background: var(--brand-accent); }
.kpi-card.danger::before { background: var(--color-danger); }
.kpi-card.info::before { background: var(--color-info); }

.kpi-label {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.kpi-value {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.kpi-icon {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 1.5rem;
  color: var(--neutral-300);
}

/* ============================================
   Tables
   ============================================ */
.table {
  font-size: 0.875rem;
  color: var(--text-primary);
  margin-bottom: 0;
}

.table thead th {
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background-color: var(--neutral-50);
  border-bottom: 1px solid var(--border-default);
  padding: 0.75rem 1rem;
}

.table tbody td {
  padding: 0.875rem 1rem;
  vertical-align: middle;
  border-bottom: 1px solid var(--border-default);
}

.table-hover tbody tr:hover { background-color: var(--neutral-50); }
.table-striped tbody tr:nth-of-type(odd) { background-color: var(--neutral-50); }

/* Wrapper sidebar+main: en mobile mantiene la altura mínima (scroll normal de página). */
.app-shell { min-height: calc(100vh - 60px); }

/* ============================================
   Layout de altura fija (desktop): la PÁGINA no scrollea.
   Header, sidebar y footer quedan fijos; solo scrollea el área de contenido
   (.app-main). Así no hay scroll de "toda la pantalla" ni doble barra.
   En mobile (<992px) se mantiene el scroll normal de la página.
   ============================================ */
@media (min-width: 992px) {
  body:not(.login-page) {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden; /* la PÁGINA no scrollea */
  }
  .app-shell {
    flex: 1 1 auto;
    min-height: 0;
  }
  /* prefijo body:not(.login-page) para ganar especificidad sobre las reglas base
     .app-sidebar/.app-main { min-height: calc(100vh-60px) } que están más abajo en el archivo */
  body:not(.login-page) .app-sidebar {
    min-height: 0;
    flex-shrink: 0; /* el menú NUNCA se encoge (si no, contenido ancho lo comprime) */
    overflow-y: auto; /* sidebar largo scrollea por su cuenta */
  }
  body:not(.login-page) .app-main {
    min-height: 0;
    min-width: 0; /* permite que app-main se achique en vez de empujar al sidebar */
    overflow-x: hidden;
    overflow-y: auto; /* fallback: páginas sin tabla (formularios) scrollean acá */
  }

  /* Páginas de listado: título y buscador quedan FIJOS y SOLO la tabla scrollea.
     app-main se vuelve columna flex; el bloque que contiene la tabla ocupa el
     alto restante y la .table-scroll scrollea internamente con el thead fijo. */
  .app-main:has(.table-scroll) {
    display: flex;
    flex-direction: column;
    /* el scroll lo maneja la tabla; si alguna estructura no encaja, app-main
       scrollea como fallback (hereda overflow-y:auto) y nada queda recortado */
  }
  .app-main:has(.table-scroll) > * {
    flex: 0 0 auto; /* título, alertas, buscador: altura natural */
  }
  .app-main:has(.table-scroll) > .table-scroll,
  .app-main:has(.table-scroll) > .card:has(> .table-scroll) {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }
  .app-main:has(.table-scroll) > .card:has(> .table-scroll) > .table-scroll {
    flex: 1 1 auto;
    min-height: 0;
  }
  .table-scroll {
    overflow-y: auto;
    overflow-x: hidden;
  }
  .table-scroll thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    box-shadow: inset 0 -1px 0 var(--border-default);
  }
}

/* ============================================
   Badges
   ============================================ */
.badge {
  font-weight: 500;
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  letter-spacing: 0;
}

.badge.bg-primary { background-color: var(--brand-primary) !important; }
.badge.bg-success {
  background-color: var(--color-success-light) !important;
  color: var(--color-success);
}
.badge.bg-warning {
  background-color: var(--color-warning-light) !important;
  color: var(--color-warning);
}
.badge.bg-danger {
  background-color: var(--color-danger-light) !important;
  color: var(--color-danger);
}
.badge.bg-info {
  background-color: var(--color-info-light) !important;
  color: var(--color-info);
}
.badge.bg-secondary {
  background-color: var(--neutral-100) !important;
  color: var(--neutral-700);
}

/* ============================================
   Alerts — Modern Design System
   ============================================ */
.alert {
  border-radius: var(--radius-lg, 12px);
  border: none;
  border-left: 4px solid transparent;
  padding: 1rem 1.125rem;
  font-size: 0.875rem;
  line-height: 1.5;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
  position: relative;
  overflow: hidden;
  animation: alertSlideIn 0.3s ease-out;
}

@keyframes alertSlideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.alert::before {
  font-family: "bootstrap-icons";
  font-size: 1.125rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 1px;
}

.alert .btn-close {
  padding: 0.75rem;
  margin: -0.5rem -0.5rem -0.5rem auto;
  opacity: 0.4;
  filter: none;
  transition: opacity 0.2s;
}

.alert .btn-close:hover {
  opacity: 0.8;
}

.alert-success {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  border-left-color: var(--color-success);
  color: #065f46;
}

.alert-success::before {
  content: "\F26B";
  color: var(--color-success);
}

.alert-danger {
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
  border-left-color: var(--color-danger);
  color: #991b1b;
}

.alert-danger::before {
  content: "\F622";
  color: var(--color-danger);
}

.alert-warning {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border-left-color: var(--color-warning);
  color: #92400e;
}

.alert-warning::before {
  content: "\F33B";
  color: var(--color-warning);
}

.alert-info {
  background: linear-gradient(135deg, #ecfeff 0%, #cffafe 100%);
  border-left-color: var(--color-info);
  color: #155e75;
}

.alert-info::before {
  content: "\F430";
  color: var(--color-info);
}

.alert a {
  color: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.alert a:hover {
  opacity: 0.8;
}

.alert strong {
  font-weight: 600;
}

@media (max-width: 576px) {
  .alert {
    padding: 0.875rem 1rem;
    font-size: 0.8125rem;
    border-radius: var(--radius-md, 8px);
  }

  .alert::before {
    font-size: 1rem;
  }
}

/* ============================================
   App Layout: Header
   ============================================ */
.app-header {
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-default);
  box-shadow: var(--shadow-xs);
  padding: 0.875rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 1020;
}

.app-header .navbar-brand {
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--text-primary) !important;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.app-header .brand-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-hover) 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1rem;
}

.app-header .user-button {
  background: transparent;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.app-header .user-button:hover {
  background-color: var(--neutral-50);
  border-color: var(--border-strong);
}

.app-header .user-avatar {
  width: 24px;
  height: 24px;
  background: var(--brand-primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
}

/* ============================================
   App Layout: Sidebar
   ============================================ */
.app-sidebar {
  background-color: var(--bg-sidebar);
  width: 260px;
  min-height: calc(100vh - 60px);
  padding: 1rem 0;
  display: flex;
  flex-direction: column;
}

.sidebar-section-title {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--neutral-500);
  padding: 0.75rem 1.25rem 0.5rem;
}

.sidebar-nav {
  list-style: none;
  padding: 0;
  margin: 0;
  flex-grow: 1;
}

.sidebar-nav .nav-item { margin: 0 0.5rem; }

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--neutral-400);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  text-decoration: none;
  margin-bottom: 0.125rem;
}

.sidebar-nav .nav-link:hover {
  background-color: var(--bg-sidebar-hover);
  color: var(--text-on-dark);
}

.sidebar-nav .nav-link.active {
  background-color: var(--brand-primary);
  color: white;
}

.sidebar-nav .nav-link i {
  font-size: 1rem;
  width: 18px;
  text-align: center;
}

.sidebar-footer {
  padding: 0.5rem;
  border-top: 1px solid var(--neutral-800);
  margin-top: auto;
}

.sidebar-footer button {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--neutral-400);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.sidebar-footer button:hover {
  color: var(--text-on-dark);
  background-color: var(--bg-sidebar-hover);
}

/* ============================================
   App Layout: Main
   ============================================ */
.app-main {
  flex-grow: 1;
  background-color: var(--bg-page);
  padding: 1.5rem 2rem;
  min-height: calc(100vh - 60px);
}

.page-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-default);
}

.page-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 0.25rem;
  letter-spacing: -0.02em;
}

.page-subtitle {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin: 0;
}

/* ============================================
   App Layout: Footer
   ============================================ */
.app-footer {
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-default);
  padding: 1rem 1.5rem;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* ============================================
   Login Page
   ============================================ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 50%, #1e40af 100%);
  padding: 2rem 1rem;
  position: relative;
  overflow: hidden;
  font-family: 'Inter', -apple-system, sans-serif;
}

.login-page::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.15) 0%, transparent 70%);
  border-radius: 50%;
}

.login-page::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.2) 0%, transparent 70%);
  border-radius: 50%;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
  position: relative;
  z-index: 1;
  overflow: hidden;
}

.login-brand {
  padding: 2.5rem 2rem 1.5rem;
  text-align: center;
}

.login-brand-logo {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.75rem;
  box-shadow: 0 10px 20px -5px rgba(30, 58, 138, 0.4);
}

.login-brand-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 0.25rem;
  letter-spacing: -0.02em;
}

.login-brand-subtitle {
  font-size: 0.875rem;
  color: #475569;
  margin: 0;
}

.login-form {
  padding: 0 2rem 2rem;
}

.login-form .form-control {
  padding: 0.625rem 0.875rem;
  font-size: 0.9375rem;
}

.login-form .btn-primary {
  width: 100%;
  padding: 0.75rem 1.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  margin-top: 0.5rem;
}

/* ============================================
   Utilities
   ============================================ */
.text-muted { color: var(--text-muted) !important; }
.text-secondary-custom { color: var(--text-secondary) !important; }

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track { background: var(--neutral-100); }

::-webkit-scrollbar-thumb {
  background: var(--neutral-300);
  border-radius: var(--radius-md);
}

::-webkit-scrollbar-thumb:hover { background: var(--neutral-400); }

/* Focus accessibility */
*:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Mobile responsive */
@media (max-width: 768px) {
  html, body { overflow-x: hidden; max-width: 100vw; }
  .app-main { padding: 1rem 0.875rem; }
  .page-title { font-size: 1.25rem; }
  .app-sidebar { width: 100%; }
  .app-header { padding: 0.625rem 0.875rem; }
  .navbar-brand { font-size: 1rem; }
  .navbar-brand .brand-icon { font-size: 1.125rem; }
  .card { border-radius: 10px; }
  .card-body { padding: 1rem; }
  .table-responsive { font-size: 0.875rem; }
  .btn { min-height: 40px; }
  .btn-sm { min-height: 34px; }
  .form-control, .form-select { font-size: 16px; min-height: 42px; } /* 16px evita zoom iOS */
  h1.h2 { font-size: 1.25rem; }
  .stat-card { padding: 1rem; }
}

@media (max-width: 576px) {
  .login-page { padding: 1rem 0.75rem; }
  .login-page::before {
    width: 320px; height: 320px;
    right: -30%; top: -20%;
    opacity: 0.6;
  }
  .login-page::after {
    width: 300px; height: 300px;
    left: -30%; bottom: -20%;
    opacity: 0.6;
  }
  .login-card { max-width: 100%; border-radius: 14px; }
  .login-brand { padding: 2rem 1.25rem 1rem; }
  .login-form { padding: 0 1.25rem 1.75rem; }
  .login-brand-logo { width: 56px; height: 56px; font-size: 1.5rem; }
  .login-brand-title { font-size: 1.25rem; }
}

/* ============================================
   Tablas → Tarjetas en móvil
   Marcar la tabla con .table-mobile-cards y
   cada <td> con data-label="Nombre Columna"
   ============================================ */
@media (max-width: 768px) {
  .table-mobile-cards { border: 0; }
  .table-mobile-cards thead { display: none; }
  .table-mobile-cards, .table-mobile-cards tbody,
  .table-mobile-cards tr, .table-mobile-cards td { display: block; width: 100%; }
  .table-mobile-cards tr {
    background: #fff;
    border: 1px solid var(--border-default, #e5e7eb);
    border-radius: 12px;
    padding: 0.875rem 1rem;
    margin-bottom: 0.875rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  }
  .table-mobile-cards tr.table-warning {
    background: #fff8e1;
    border-color: #f59e0b;
  }
  .table-mobile-cards td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border: 0 !important;
    border-bottom: 1px dashed var(--border-default, #f1f5f9) !important;
    text-align: right;
    font-size: 0.9375rem;
    min-height: 38px;
  }
  .table-mobile-cards td:last-child { border-bottom: 0 !important; padding-top: 0.75rem; }
  .table-mobile-cards td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--text-secondary, #475569);
    font-size: 0.8125rem;
    text-align: left;
    flex: 0 0 42%;
    text-transform: uppercase;
    letter-spacing: 0.02em;
  }
  .table-mobile-cards td[data-label=""]::before,
  .table-mobile-cards td.td-actions::before { content: none; }
  .table-mobile-cards td.td-actions {
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .table-mobile-cards .table-responsive,
  .table-responsive:has(.table-mobile-cards) {
    background: transparent;
    border: 0;
    box-shadow: none;
  }
  .table-mobile-cards td .btn-group { flex-wrap: wrap; gap: 0.25rem; }
  .table-mobile-cards td form { display: inline-block; }
}

/* Mobile offcanvas user section */
.mobile-user-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid var(--neutral-800);
  color: #fff;
}
.mobile-user-header .user-avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #1e40af);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 1.1rem; color: #fff;
  flex-shrink: 0;
}
.mobile-user-header .user-info { display: flex; flex-direction: column; min-width: 0; }
.mobile-user-header .user-name { font-weight: 600; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mobile-user-header .user-role { font-size: 0.75rem; opacity: 0.7; }

.mobile-account-section {
  border-top: 1px solid var(--neutral-800);
  margin-top: 0.5rem;
  padding-top: 0.5rem;
}
.mobile-logout-btn {
  display: flex; align-items: center; gap: 0.75rem;
  width: 100%;
  padding: 0.75rem 1.25rem;
  border: none; background: none;
  color: #fca5a5; font-size: 0.9375rem; text-align: left;
}
.mobile-logout-btn:hover { background: rgba(239, 68, 68, 0.1); color: #f87171; }
