/* ===== Panel Admin — Tema morado moderno (full) ===== */
:root {
  --panel-bg: #000000;
  --panel-bg-elevated: #0d0d0d;
  --panel-surface: #141414;
  --panel-surface-hover: #1a1a1a;
  --panel-border: rgba(255,255,255,0.06);
  --panel-border-light: rgba(255,255,255,0.08);
  --panel-text: #f5f5f5;
  --panel-text-secondary: #a0a0a0;
  --panel-text-muted: #6b6b6b;
  --panel-accent: #9664FA;
  --panel-accent-hover: #A06EF0;
  --panel-accent-mid: #8250C8;
  --panel-accent-deep: #502878;
  --panel-accent-glow: rgba(150, 100, 250, 0.25);
  --panel-danger: #c084fc;
  --panel-success: #22c55e;
  --panel-warning: #eab308;
  --panel-radius: 12px;
  --panel-radius-lg: 16px;
  --panel-radius-xl: 20px;
  --panel-shadow: 0 4px 24px rgba(0,0,0,0.5);
  --panel-shadow-card: 0 2px 12px rgba(0,0,0,0.25);
  --panel-shadow-card-hover: 0 12px 40px rgba(0,0,0,0.35), 0 0 0 1px rgba(150, 100, 250, 0.08);
}

/* Forzar Tabler/Bootstrap a morado en páginas theme-dark */
html.theme-dark {
  --tblr-primary: #9664FA !important;
  --tblr-blue: #9664FA !important;
  --tblr-azure: #A06EF0 !important;
  --tblr-indigo: #8250C8 !important;
  --tblr-purple: #9664FA !important;
  --tblr-pink: #c084fc !important;
  --tblr-body-bg: #000000 !important;
  --tblr-bg-surface: #141414 !important;
  --bs-primary: #9664FA !important;
  --bs-primary-rgb: 150, 100, 250 !important;
}

/* Anular Tabler/Bootstrap: forzar negro y púrpura en todo el panel */
html.theme-dark {
  background: #000000 !important;
  background-color: #000000 !important;
}

html.theme-dark body.theme-dark,
body.theme-dark {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif !important;
  background: #000000 !important;
  background-color: #000000 !important;
  background-image: radial-gradient(ellipse 100% 60% at 50% -10%, rgba(150, 100, 250, 0.06), transparent),
                    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(80, 40, 120, 0.04), transparent) !important;
  color: #f5f5f5 !important;
  line-height: 1.5;
  min-height: 100vh;
  position: relative;
}

/* Luces de fondo (orbes) — todo en tonos morados, sin rojo */
body.theme-dark::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(ellipse 80% 60% at 10% 50%, rgba(150, 100, 250, 0.18), transparent 50%),
    radial-gradient(ellipse 70% 50% at 90% 50%, rgba(130, 80, 200, 0.12), transparent 50%),
    radial-gradient(ellipse 100% 80% at 50% 50%, rgba(150, 100, 250, 0.06) 0%, transparent 50%);
  background-size: 100% 100%;
  background-repeat: no-repeat;
}

body.theme-dark .wrapper {
  position: relative;
  z-index: 1;
}
html.theme-dark .bg-primary,
html.theme-dark .bg-white,
html.theme-dark .bg-light,
body.theme-dark .bg-primary,
body.theme-dark .bg-white,
body.theme-dark .bg-light {
  background-color: transparent !important;
  background: transparent !important;
}

* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* — Forzar tema oscuro en todo el layout (prioridad sobre Tabler) — */
body.theme-dark {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif !important;
  background: #000000 !important;
  background-color: #000000 !important;
  background-image: radial-gradient(ellipse 100% 60% at 50% -10%, rgba(150, 100, 250, 0.06), transparent),
                    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(80, 40, 120, 0.04), transparent) !important;
  color: #f5f5f5 !important;
  line-height: 1.5;
  min-height: 100vh;
}

body.theme-dark .wrapper {
  background: transparent !important;
  min-height: 100vh;
}

body.theme-dark .content {
  background: transparent !important;
  padding-top: 0 !important;
  padding-bottom: 2rem !important;
}

body.theme-dark .container-xl {
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  padding-top: 1.5rem;
  padding-bottom: 2rem;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

/* — Navbar: fondo negro semitransparente con blur y borde sutil — */
body.theme-dark .navbar,
body.theme-dark .navbar-dark,
body.theme-dark header.navbar {
  background: rgba(20, 10, 35, 0.88) !important;
  background-color: rgba(20, 10, 35, 0.88) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(150, 100, 250, 0.08) !important;
  padding: 0.65rem 0 !important;
  box-shadow: 0 1px 0 rgba(150, 100, 250, 0.04);
}

body.theme-dark .navbar .container-xl {
  padding-top: 0;
  padding-bottom: 0;
}

body.theme-dark .navbar .navbar-nav {
  gap: 0.15rem;
}

body.theme-dark .navbar .nav-link {
  color: var(--panel-text-secondary) !important;
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0.5rem 0.85rem !important;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
}

body.theme-dark .navbar .nav-link:hover {
  color: #9664FA !important;
  background: rgba(150, 100, 250, 0.12) !important;
}

body.theme-dark .navbar .nav-link.text-muted {
  color: var(--panel-text-muted) !important;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: default;
}

body.theme-dark .navbar .nav-link-title {
  color: inherit;
}

body.theme-dark .navbar-brand-panel {
  color: #f5f5f5 !important;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.025em;
  margin-right: 1.5rem;
  padding: 0.4rem 0;
  text-decoration: none;
  transition: color 0.2s ease;
}

body.theme-dark .navbar-brand-panel:hover {
  color: #B794F6 !important;
}

body.theme-dark .navbar-toggler {
  border-color: rgba(150, 100, 250, 0.2) !important;
  border-radius: var(--panel-radius);
  padding: 0.45rem 0.6rem;
}

body.theme-dark .navbar-toggler-icon {
  filter: invert(1);
  opacity: 0.9;
}

body.theme-dark .card {
  background: #141414 !important;
  background-color: #141414 !important;
  border-radius: var(--panel-radius-lg);
  border: 1px solid rgba(255,255,255,0.06) !important;
  box-shadow: var(--panel-shadow-card);
  transition: box-shadow 0.25s ease, border-color 0.25s ease, transform 0.2s ease;
  overflow: hidden;
}

body.theme-dark .card:hover {
  border-color: rgba(150, 100, 250, 0.18) !important;
  box-shadow: var(--panel-shadow-card-hover);
  transform: translateY(-2px);
}

body.theme-dark .card-sm .card-body {
  padding: 1rem 1.25rem;
}

body.theme-dark .card-header {
  background: rgba(150, 100, 250, 0.04) !important;
  background-color: rgba(20, 20, 20, 0.8) !important;
  border-bottom: 1px solid rgba(150, 100, 250, 0.08) !important;
  font-weight: 600;
  padding: 1.1rem 1.5rem;
  font-size: 0.95rem;
  color: #f5f5f5 !important;
  letter-spacing: -0.01em;
}

body.theme-dark .card-header .card-title {
  margin: 0;
  color: var(--panel-text) !important;
  letter-spacing: -0.01em;
}

body.theme-dark .card-body {
  padding: 1.25rem 1.5rem;
  color: #f5f5f5 !important;
  background: #141414 !important;
  background-color: #141414 !important;
}

body.theme-dark .btn {
  font-weight: 600;
  border-radius: var(--panel-radius);
  padding: 0.55rem 1.1rem;
  font-size: 0.9rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

body.theme-dark .btn:hover {
  transform: translateY(-1px);
}

body.theme-dark .btn-primary {
  background: linear-gradient(135deg, #9664FA 0%, #8250C8 100%) !important;
  background-color: #9664FA !important;
  border: none !important;
  color: #fff !important;
  box-shadow: 0 4px 16px rgba(150, 100, 250, 0.35);
}

body.theme-dark .btn-primary:hover {
  background: linear-gradient(135deg, #A06EF0 0%, #9664FA 100%) !important;
  background-color: #A06EF0 !important;
  box-shadow: 0 6px 24px rgba(150, 100, 250, 0.4);
  color: #fff !important;
  transform: translateY(-2px);
}

body.theme-dark .btn-dark {
  background: var(--panel-surface-hover) !important;
  border: 1px solid rgba(150, 100, 250, 0.15) !important;
  color: var(--panel-text) !important;
  border-radius: var(--panel-radius);
}

body.theme-dark .btn-dark:hover {
  background: rgba(150, 100, 250, 0.12) !important;
  border-color: rgba(150, 100, 250, 0.3) !important;
  color: #B794F6 !important;
}

body.theme-dark .btn-icon {
  padding: 0.5rem 0.75rem;
  border-radius: var(--panel-radius);
}

body.theme-dark .btn-outline-primary {
  border-color: var(--panel-accent);
  color: var(--panel-accent);
}

body.theme-dark .btn-outline-primary:hover {
  background: rgba(150, 100, 250, 0.15);
  color: var(--panel-accent-hover);
  border-color: var(--panel-accent-hover);
}

body.theme-dark .form-control,
body.theme-dark .form-select {
  background: #0d0d0d !important;
  background-color: #0d0d0d !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  color: #f5f5f5 !important;
  border-radius: var(--panel-radius);
  padding: 0.65rem 1rem;
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

body.theme-dark .form-control:focus,
body.theme-dark .form-select:focus {
  border-color: #9664FA !important;
  box-shadow: 0 0 0 3px rgba(150, 100, 250, 0.22) !important;
  outline: none;
}

body.theme-dark .form-control::placeholder {
  color: var(--panel-text-muted);
}

body.theme-dark input[type="file"] {
  color: var(--panel-text-secondary);
  font-size: 0.9rem;
}

/* Añadir días: cuadrito gris a la izquierda, botón +D tipo badge morado a la derecha */
body.theme-dark .add-days-form {
  display: inline-flex;
  align-items: center;
  flex-direction: row;
  gap: 6px;
  vertical-align: middle;
}
body.theme-dark .add-days-form input.add-days-input,
body.theme-dark input.add-days-input {
  width: 36px;
  height: 22px;
  padding: 0 5px;
  font-size: 0.7rem;
  line-height: 22px;
  text-align: center;
  background: #252525 !important;
  background-color: #252525 !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  color: #fff !important;
  border-radius: 6px;
  -moz-appearance: textfield;
  appearance: none;
  transition: border-color 0.2s;
  order: 1;
}
body.theme-dark .add-days-form input.add-days-input::-webkit-outer-spin-button,
body.theme-dark .add-days-form input.add-days-input::-webkit-inner-spin-button,
body.theme-dark input.add-days-input::-webkit-outer-spin-button,
body.theme-dark input.add-days-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
  display: none;
}
body.theme-dark .add-days-form input.add-days-input::placeholder,
body.theme-dark input.add-days-input::placeholder {
  color: #5a5a5a;
}
body.theme-dark .add-days-form input.add-days-input:focus,
body.theme-dark input.add-days-input:focus {
  outline: none;
  border-color: rgba(150, 100, 250, 0.4) !important;
  background: #252525 !important;
  background-color: #252525 !important;
  color: #fff !important;
}
/* +D mismo estilo que badges (Delete, Ban, etc.) pero morado y redondeado */
body.theme-dark .add-days-form .add-days-btn,
body.theme-dark button.add-days-btn {
  font-weight: 600;
  font-size: 0.7rem;
  padding: 0.4em 0.75em;
  line-height: 1.2;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(150, 100, 250, 0.25) !important;
  background-color: rgba(150, 100, 250, 0.25) !important;
  color: #B794F6 !important;
  text-decoration: none;
  transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
  order: 2;
}
body.theme-dark .add-days-form .add-days-btn:hover,
body.theme-dark button.add-days-btn:hover {
  opacity: 0.95;
  transform: translateY(-0.5px);
  background: rgba(150, 100, 250, 0.35) !important;
  background-color: rgba(150, 100, 250, 0.35) !important;
  color: #C4A8FF !important;
}

body.theme-dark .table {
  color: var(--panel-text) !important;
  background: transparent !important;
}

body.theme-dark .table th {
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--panel-text-muted) !important;
  border-bottom: 1px solid rgba(150, 100, 250, 0.1) !important;
  padding: 0.9rem 1rem;
  background: rgba(150, 100, 250, 0.03) !important;
}

body.theme-dark .table td {
  border-bottom: 1px solid var(--panel-border) !important;
  padding: 0.9rem 1rem;
  vertical-align: middle !important;
  color: var(--panel-text) !important;
}

body.theme-dark .table tbody tr {
  transition: background 0.15s ease;
}

body.theme-dark .table tbody tr:hover {
  background: rgba(150, 100, 250, 0.04) !important;
}

body.theme-dark .table-vcenter td {
  vertical-align: middle !important;
}

body.theme-dark .table-responsive {
  border-radius: 0 0 var(--panel-radius-lg) var(--panel-radius-lg);
  border: none !important;
  background: #141414 !important;
  background-color: #141414 !important;
  border-top: 1px solid rgba(150, 100, 250, 0.06) !important;
}

body.theme-dark .card-table {
  margin-bottom: 0;
}

body.theme-dark .badge {
  font-weight: 600;
  font-size: 0.7rem;
  padding: 0.4em 0.75em;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
}

body.theme-dark .badge:hover {
  opacity: 0.95;
  transform: translateY(-0.5px);
}

body.theme-dark .badge[href]:hover {
  box-shadow: 0 0 0 1px rgba(150, 100, 250, 0.3);
}

body.theme-dark .badge.bg-green-lt { background: rgba(34, 197, 94, 0.2); color: #4ade80; }
body.theme-dark .badge.bg-red-lt { background: rgba(192, 132, 252, 0.25); color: #c084fc; }
body.theme-dark .badge.bg-yellow-lt { background: rgba(234, 179, 8, 0.2); color: #facc15; }
body.theme-dark .badge.bg-blue-lt { background: rgba(150, 100, 250, 0.2); color: #B794F6; }
body.theme-dark .badge.bg-azure-lt { background: rgba(150, 100, 250, 0.15); color: #C4A8FF; }
body.theme-dark .badge.bg-secondary { background: rgba(255,255,255,0.1); color: var(--panel-text-secondary); }

body.theme-dark .text-muted {
  color: var(--panel-text-muted) !important;
}

body.theme-dark .alert {
  border-radius: var(--panel-radius);
  border: 1px solid;
}

body.theme-dark .alert-warning {
  background: rgba(234, 179, 8, 0.1);
  border-color: rgba(234, 179, 8, 0.3);
  color: var(--panel-text);
}

body.theme-dark .alert-success,
body.theme-dark .alert-info {
  background: rgba(150, 100, 250, 0.08);
  border-color: rgba(150, 100, 250, 0.2);
  color: var(--panel-text);
}

body.theme-dark .page-header {
  padding-top: 0.5rem;
  margin-bottom: 1.75rem;
}

body.theme-dark .page-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  color: var(--panel-text) !important;
  letter-spacing: -0.035em;
  line-height: 1.25;
  position: relative;
  padding-bottom: 0.6rem;
}

body.theme-dark .page-title::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 3rem;
  height: 3px;
  background: linear-gradient(90deg, #9664FA, #8250C8);
  border-radius: 2px;
}

body.theme-dark .page-header .text-muted {
  font-size: 0.95rem;
  color: var(--panel-text-muted) !important;
  line-height: 1.5;
}

body.theme-dark .form-label {
  font-weight: 500;
  margin-bottom: 0.4rem;
  color: var(--panel-text-secondary);
  font-size: 0.9rem;
}

/* Anular fondos claros y azules de Tabler */
body.theme-dark .bg-white,
body.theme-dark .bg-light,
body.theme-dark .card.bg-white {
  background: #141414 !important;
  background-color: #141414 !important;
}

body.theme-dark .text-primary,
body.theme-dark .link-primary {
  color: #9664FA !important;
}

body.theme-dark textarea.form-control {
  min-height: 100px;
}

body.theme-dark strong {
  color: var(--panel-text);
}

body.theme-dark .alert-panel {
  border-radius: var(--panel-radius);
}

body.theme-dark code {
  background: var(--panel-bg-elevated);
  color: var(--panel-accent);
  padding: 0.2em 0.5em;
  border-radius: 6px;
  font-size: 0.85em;
  border: 1px solid var(--panel-border);
}

body.theme-dark .stat-card {
  background: #141414;
  background-color: #141414;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--panel-radius-lg);
  padding: 1.6rem 1.85rem;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease;
  position: relative;
  overflow: hidden;
}

body.theme-dark .stat-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, #9664FA, #8250C8);
  opacity: 0;
  transition: opacity 0.25s ease;
}

body.theme-dark .stat-card:hover {
  border-color: rgba(150, 100, 250, 0.2);
  box-shadow: var(--panel-shadow-card-hover);
  transform: translateY(-2px);
}

body.theme-dark .stat-card:hover::before {
  opacity: 1;
}

body.theme-dark .stat-card .stat-value {
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--panel-text);
  letter-spacing: -0.04em;
  line-height: 1.2;
}

body.theme-dark .stat-card .stat-label {
  font-size: 0.875rem;
  color: var(--panel-text-muted);
  margin-top: 0.35rem;
  font-weight: 500;
}

/* Row cards spacing */
body.theme-dark .row-cards > .col,
body.theme-dark .row-cards > [class*="col-"] {
  margin-bottom: 1.25rem;
}

body.theme-dark hr {
  border-color: var(--panel-border) !important;
  opacity: 0.8;
}

body.theme-dark .list-inline-item {
  color: var(--panel-text-secondary);
}

body.theme-dark .dropdown-menu {
  background: var(--panel-surface) !important;
  border: 1px solid rgba(150, 100, 250, 0.12) !important;
  border-radius: var(--panel-radius);
  box-shadow: var(--panel-shadow), 0 0 0 1px rgba(150, 100, 250, 0.05);
}

body.theme-dark .dropdown-item {
  color: var(--panel-text) !important;
  padding: 0.6rem 1rem;
  border-radius: 6px;
  transition: background 0.15s ease, color 0.15s ease;
}

body.theme-dark .dropdown-item:hover {
  background: rgba(150, 100, 250, 0.12) !important;
  color: #B794F6 !important;
}

/* Links como botones secundarios */
body.theme-dark a.btn {
  text-decoration: none;
}

/* Inputs en tablas más compactos */
body.theme-dark .table-responsive {
  border-radius: 0 0 var(--panel-radius-lg) var(--panel-radius-lg);
}

/* ===== Páginas sueltas (login + selector panel) — tema negro + morado (sin rojo) ===== */
body.auth-page,
body.panel-selector {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif !important;
  background-color: #000000 !important;
  background-image: radial-gradient(ellipse 80% 60% at 10% 50%, rgba(150, 100, 250, 0.2), transparent 50%),
                    radial-gradient(ellipse 70% 50% at 90% 50%, rgba(130, 80, 200, 0.14), transparent 50%),
                    radial-gradient(ellipse 50% 50% at 50% 50%, rgba(150, 100, 250, 0.12) 0%, transparent 60%) !important;
  color: #f5f5f5 !important;
  min-height: 100vh !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

body.auth-page .auth-card {
  background: #141414;
  border: 1px solid rgba(150, 100, 250, 0.12);
  border-radius: 16px;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.03);
  padding: 2.25rem 2rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

body.auth-page .auth-card:focus-within {
  border-color: rgba(150, 100, 250, 0.3);
  box-shadow: 0 12px 40px rgba(0,0,0,0.45), 0 0 24px rgba(150, 100, 250, 0.08);
}

body.auth-page .auth-card .form-control {
  background: #0d0d0d;
  border: 1px solid rgba(255,255,255,0.08);
  color: #f5f5f5;
  border-radius: 12px;
  padding: 0.8rem 1.1rem;
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

body.auth-page .auth-card .form-control:focus {
  border-color: #9664FA;
  box-shadow: 0 0 0 3px rgba(150, 100, 250, 0.22);
  outline: none;
}

body.auth-page .auth-card .form-control::placeholder {
  color: #6b6b6b;
}

body.auth-page .auth-card .btn-primary {
  background: linear-gradient(135deg, #9664FA 0%, #8250C8 100%);
  border: none;
  color: #fff;
  font-weight: 600;
  padding: 0.85rem 1.5rem;
  border-radius: 12px;
  font-size: 1rem;
  box-shadow: 0 4px 20px rgba(150, 100, 250, 0.35);
  transition: transform 0.2s ease, box-shadow 0.25s ease;
}

body.auth-page .auth-card .btn-primary:hover {
  background: linear-gradient(135deg, #A06EF0 0%, #9664FA 100%);
  box-shadow: 0 6px 28px rgba(150, 100, 250, 0.4);
  transform: translateY(-2px);
  color: #fff;
}

body.auth-page .auth-title {
  color: #f5f5f5;
  font-weight: 700;
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  letter-spacing: -0.03em;
}

body.auth-page .auth-footer,
body.auth-page .text-muted {
  color: #6b6b6b !important;
  font-size: 0.85rem;
}

body.panel-selector {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

body.panel-selector .card-panel,
body.panel-selector .card {
  background: #141414 !important;
  background-color: #141414 !important;
  border: 1px solid rgba(255,255,255,0.06) !important;
  border-radius: 16px;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
  text-decoration: none;
  color: inherit;
  display: block;
  max-width: 320px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.25);
  overflow: hidden;
  position: relative;
}

body.panel-selector .card-panel::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: 4px 0 0 4px;
}

body.panel-selector .card-panel.clr::before {
  background: linear-gradient(180deg, #9664FA, #8250C8);
}

body.panel-selector .card-panel.gl1::before {
  background: linear-gradient(180deg, #A78BFA, #8250C8);
}

body.panel-selector .card-panel:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.35), 0 0 20px rgba(150, 100, 250, 0.06);
  border-color: rgba(150, 100, 250, 0.25) !important;
}

body.panel-selector .card-panel .card-body {
  padding: 2rem;
}

body.panel-selector .card-panel .card-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

body.panel-selector .card-panel.clr .card-title {
  color: #9664FA;
}

body.panel-selector .card-panel.gl1 .card-title {
  color: #A78BFA;
}

body.panel-selector .card-text {
  color: #6b6b6b;
  font-size: 0.9rem;
}

body.panel-selector .selector-title {
  color: #f5f5f5;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.03em;
}

body.panel-selector .selector-sub {
  color: #6b6b6b;
  font-size: 0.95rem;
  margin-bottom: 2rem;
}

body.panel-selector .row {
  gap: 1.5rem;
  justify-content: center;
}

body.panel-selector .text-muted {
  color: #6b6b6b !important;
  font-size: 0.85rem;
}

/* Footer del panel admin — tema morado moderno */
body.theme-dark .footer,
body.theme-dark .footer-transparent {
  background: transparent !important;
  border-top: 1px solid rgba(150, 100, 250, 0.08);
  color: var(--panel-text-muted);
  margin-top: auto;
  padding: 1.25rem 0;
}

body.theme-dark .footer .container {
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
}

body.theme-dark .footer .link-secondary,
body.theme-dark .footer .footer-link {
  color: var(--panel-text-muted) !important;
  font-size: 0.9rem;
  text-decoration: none;
  transition: color 0.2s ease;
}

body.theme-dark .footer .link-secondary:hover,
body.theme-dark .footer .footer-link:hover {
  color: #9664FA !important;
}

body.theme-dark .footer .icon {
  color: #9664FA !important;
  vertical-align: middle;
  margin-left: 0.25rem;
}

/* Tema morado: forzar primary/blue/azure de Tabler/Bootstrap */
body.theme-dark .bg-primary,
body.theme-dark .bg-blue,
body.theme-dark .bg-azure { background-color: #9664FA !important; }
body.theme-dark .text-primary,
body.theme-dark .text-blue,
body.theme-dark .text-azure { color: #B794F6 !important; }
body.theme-dark .border-primary,
body.theme-dark .border-blue,
body.theme-dark .border-azure { border-color: rgba(150, 100, 250, 0.4) !important; }
body.theme-dark .btn-outline-primary,
body.theme-dark .btn-outline-blue,
body.theme-dark .btn-outline-azure {
  border-color: #9664FA !important;
  color: #B794F6 !important;
}
body.theme-dark .btn-outline-primary:hover,
body.theme-dark .btn-outline-blue:hover,
body.theme-dark .btn-outline-azure:hover {
  background: rgba(150, 100, 250, 0.15) !important;
  border-color: #B794F6 !important;
  color: #C4A8FF !important;
}
body.theme-dark .pagination .page-link {
  color: var(--panel-text);
  border-color: var(--panel-border);
  border-radius: var(--panel-radius);
}
body.theme-dark .pagination .page-link:hover {
  background: rgba(150, 100, 250, 0.12);
  border-color: rgba(150, 100, 250, 0.25);
  color: #B794F6;
}
body.theme-dark .pagination .page-item.active .page-link {
  background: #9664FA !important;
  border-color: #9664FA !important;
  color: #fff !important;
}

/* Ancho automático desde sm (Tabler no siempre incluye w-sm-auto) */
@media (min-width: 576px) {
  .w-sm-auto {
    width: auto !important;
  }
}

/* — Móvil: sin desbordamiento horizontal, menú táctil, tablas con scroll suave — */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body.theme-dark {
  overflow-x: clip;
  max-width: 100%;
}

body.theme-dark .wrapper {
  min-height: 100vh;
  min-height: 100dvh;
}

body.theme-dark .table-responsive {
  -webkit-overflow-scrolling: touch;
  overflow-x: auto;
  max-width: 100%;
}

body.theme-dark .container-xl {
  padding-left: max(1.5rem, env(safe-area-inset-left, 0px));
  padding-right: max(1.5rem, env(safe-area-inset-right, 0px));
}

body.theme-dark .navbar .container-xl {
  padding-left: max(1rem, env(safe-area-inset-left, 0px));
  padding-right: max(1rem, env(safe-area-inset-right, 0px));
}

@media (max-width: 767.98px) {
  body.theme-dark .navbar .navbar-collapse {
    max-height: min(70vh, calc(100dvh - 5rem));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.5rem;
  }

  body.theme-dark .navbar .nav-link {
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  body.theme-dark .navbar-toggler {
    min-width: 44px;
    min-height: 44px;
  }

  body.theme-dark .page-title {
    font-size: 1.4rem;
  }

  body.theme-dark .stat-card .stat-value {
    font-size: 1.75rem;
  }

  body.theme-dark .table th,
  body.theme-dark .table td {
    padding: 0.65rem 0.75rem;
    font-size: 0.8125rem;
  }
}

body.auth-page,
body.panel-selector {
  padding-left: max(1.5rem, env(safe-area-inset-left, 0px));
  padding-right: max(1.5rem, env(safe-area-inset-right, 0px));
  padding-bottom: max(1.5rem, env(safe-area-inset-bottom, 0px));
}

body.auth-page {
  min-height: 100vh;
  min-height: 100dvh;
}

body.panel-selector {
  min-height: 100vh;
  min-height: 100dvh;
}

@media (min-width: 992px) {
  .w-lg-auto {
    width: auto !important;
  }
}

/* Filtro staff logs: ancho completo en móvil */
.staff-log-filter-select {
  width: 100%;
  max-width: 100%;
}
@media (min-width: 576px) {
  .staff-log-filter-select {
    max-width: 280px;
    width: auto;
    min-width: 200px;
  }
}

/* Celdas con muchos botones/badges (screenshot, builds) */
body.theme-dark .table-cell-actions {
  white-space: normal;
  vertical-align: top;
  min-width: 10.5rem;
}
body.theme-dark .table-cell-actions .badge,
body.theme-dark .table-cell-actions a.badge {
  display: inline-block;
  margin: 0.15rem 0.35rem 0.15rem 0;
}

/* Lista de keys en textarea (generate keys) */
body.theme-dark .textarea-keys-list {
  word-break: break-word;
  overflow-wrap: anywhere;
  font-size: 0.8125rem;
}

/* Grid: evita que columnas empujen el ancho de la página (flex) */
body.theme-dark .row-cards > [class*="col-"],
body.theme-dark .content .row > [class*="col-"] {
  min-width: 0;
}

/* Tablas: scroll horizontal usable en WebKit/Android; textos largos */
body.theme-dark .table-responsive {
  touch-action: pan-x pan-y;
  overscroll-behavior-x: contain;
}

body.theme-dark .table-responsive > .table {
  margin-bottom: 0;
}

body.theme-dark .table-responsive .table td,
body.theme-dark .table-responsive .table th {
  word-break: break-word;
  overflow-wrap: anywhere;
}

body.theme-dark .table-responsive .table code {
  word-break: break-all;
  white-space: pre-wrap;
}

/* Tarjetas con tabla: el scroll horizontal no queda recortado por overflow del card */
body.theme-dark .card:has(> .table-responsive),
body.theme-dark .card:has(> .card-body > .table-responsive) {
  overflow: visible;
}
