/* =====================================================
   LOGIN — tarjeta central enmarcada (framed split card)
   Rediseño 2026: fondo ambiental + imagen contenida + entrada
   ===================================================== */
.auth-split {
  /* Paleta propia del login (fija) */
  --lg-bg: #0d0a19;
  --lg-bg-2: #16112a;
  --lg-panel: #14102563;
  --lg-text: #f2f0fb;
  --lg-muted: #a9a1c8;
  --lg-accent: #c4b5fd;
  --lg-brand: #6d28d9;
  --lg-brand-2: #7c3aed;
  --lg-border: rgba(255, 255, 255, 0.09);
  --lg-field: rgba(255, 255, 255, 0.05);
  --lg-title: #ffffff;
  --lg-input-text: #ffffff;
  --lg-divider: rgba(255, 255, 255, 0.12);

  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: clamp(10px, 1.6vw, 22px);
  background:
    radial-gradient(900px 700px at 12% 8%, rgba(124, 58, 237, 0.26), transparent 60%),
    radial-gradient(760px 620px at 92% 96%, rgba(167, 139, 250, 0.16), transparent 62%),
    linear-gradient(160deg, #100c20 0%, var(--lg-bg) 60%, #0a0714 100%);
  overflow: hidden;
}
/* ---------- FONDO ANIMADO (aurora + partículas + foco) ---------- */
/* Capa de partículas luminosas (canvas) */
.auth-particles {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
/* Foco de luz que sigue al cursor */
.auth-spotlight {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(
    300px circle at var(--mx, 50%) var(--my, 28%),
    rgba(167, 139, 250, 0.22),
    transparent 68%
  );
  transition: background 0.12s ease-out;
}

.auth-aurora {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}
.auth-aurora span {
  position: absolute;
  display: block;
  border-radius: 50%;
  filter: blur(64px);
  opacity: 0.6;
  mix-blend-mode: screen;
  will-change: transform;
}
.auth-aurora span:nth-child(1) {
  width: 46vw;
  height: 46vw;
  min-width: 360px;
  min-height: 360px;
  top: -16vh;
  left: -8vw;
  background: radial-gradient(circle at 32% 32%, #7c3aed, transparent 68%);
  animation: auroraDrift1 22s ease-in-out infinite alternate;
}
.auth-aurora span:nth-child(2) {
  width: 40vw;
  height: 40vw;
  min-width: 320px;
  min-height: 320px;
  bottom: -18vh;
  right: -6vw;
  background: radial-gradient(circle at 50% 50%, #6366f1, transparent 68%);
  animation: auroraDrift2 27s ease-in-out infinite alternate;
}
.auth-aurora span:nth-child(3) {
  width: 34vw;
  height: 34vw;
  min-width: 280px;
  min-height: 280px;
  top: 28%;
  left: 42%;
  background: radial-gradient(circle at 50% 50%, #a855f7, transparent 70%);
  animation: auroraDrift3 31s ease-in-out infinite alternate;
}
.auth-aurora span:nth-child(4) {
  width: 30vw;
  height: 30vw;
  min-width: 240px;
  min-height: 240px;
  bottom: 4%;
  left: 6%;
  opacity: 0.42;
  background: radial-gradient(circle at 50% 50%, #c026d3, transparent 72%);
  animation: auroraDrift4 25s ease-in-out infinite alternate;
}
@keyframes auroraDrift1 {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(16vw, 10vh) scale(1.2); }
}
@keyframes auroraDrift2 {
  from { transform: translate(0, 0) scale(1.1); }
  to { transform: translate(-14vw, -8vh) scale(1); }
}
@keyframes auroraDrift3 {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(-11vw, 12vh) scale(1.25); }
}
@keyframes auroraDrift4 {
  from { transform: translate(0, 0) scale(1.05); }
  to { transform: translate(12vw, -10vh) scale(1); }
}

/* ================= TARJETA ================= */
.auth-card {
  position: relative;
  z-index: 1;
  width: min(1240px, 100%);
  min-height: clamp(520px, 82vh, 720px);
  max-height: min(96vh, 820px);
  display: grid;
  grid-template-columns: 1.1fr minmax(360px, 430px);
  border-radius: 26px;
  overflow: hidden;
  background: var(--lg-bg-2);
  box-shadow:
    0 40px 100px rgba(0, 0, 0, 0.6),
    0 0 0 1px var(--lg-border),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  animation: authCardIn 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes authCardIn {
  from {
    opacity: 0;
    transform: translateY(28px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@media (max-width: 860px) {
  .auth-card {
    grid-template-columns: 1fr;
    grid-template-rows: clamp(180px, 26vh, 240px) 1fr;
    min-height: 0;
    max-height: none;
    width: min(460px, 100%);
  }
}

/* ================= IMAGEN ================= */
.auth-media {
  position: relative;
  overflow: hidden;
  background: var(--lg-bg-2);
}
/* Capa de fondo desenfocada: rellena los laterales sin franjas vacías */
.auth-media__bg {
  position: absolute;
  inset: -6%;
  background-image: var(--hero-img);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  filter: blur(26px) brightness(0.5) saturate(1.15);
  transform: scale(1.12);
  animation: authKen 28s ease-in-out infinite alternate;
  transform-origin: center;
  will-change: transform;
  z-index: 0;
}
/* Imagen real: completa, centrada y siempre visible (no se recorta) */
.auth-media__img {
  position: absolute;
  inset: 0;
  background-image: var(--hero-img);
  background-position: center;
  background-size: contain;
  background-repeat: no-repeat;
  z-index: 1;
  animation: authImgIn 1s cubic-bezier(0.22, 1, 0.36, 1) 0.15s both;
}
@keyframes authKen {
  from {
    transform: scale(1.12);
  }
  to {
    transform: scale(1.22) translate(1.5%, -1.5%);
  }
}
@keyframes authImgIn {
  from {
    opacity: 0;
    transform: scale(1.04);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Scrims SÓLO en los bordes: la imagen se mantiene limpia en el centro.
   - abajo: legibilidad del caption
   - derecha: fundido suave hacia el panel del formulario */
.auth-media__scrim {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background:
    linear-gradient(90deg, transparent 80%, rgba(15, 12, 29, 0.55) 100%),
    linear-gradient(0deg, rgba(11, 8, 22, 0.72) 0%, transparent 34%),
    linear-gradient(180deg, rgba(11, 8, 22, 0.28) 0%, transparent 20%);
}
@media (max-width: 860px) {
  .auth-media__scrim {
    background:
      linear-gradient(0deg, rgba(11, 8, 22, 0.7) 0%, transparent 62%),
      linear-gradient(180deg, rgba(11, 8, 22, 0.35) 0%, transparent 30%);
  }
}

/* Escudo: pastilla glass, arriba a la izquierda, sin tapar el sujeto */
.auth-media__badge {
  position: absolute;
  top: 22px;
  left: 22px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  padding: 9px;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.42),
    inset 0 0 0 1px rgba(255, 255, 255, 0.6);
  animation:
    authBadgeIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.35s both,
    authFloat 6s ease-in-out 1.1s infinite;
}
.auth-media__badge img {
  height: 46px;
  width: auto;
  display: block;
}
@keyframes authBadgeIn {
  from {
    opacity: 0;
    transform: translateY(-14px) scale(0.85);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes authFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

/* Caption sobre la imagen (abajo-izquierda) */
.auth-media__caption {
  position: absolute;
  left: clamp(24px, 3vw, 48px);
  bottom: clamp(28px, 4vw, 52px);
  right: clamp(24px, 12%, 120px);
  z-index: 3;
  color: #fff;
  animation: authCaptionIn 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.5s both;
}
.auth-media__caption h2 {
  font-size: clamp(22px, 2.4vw, 32px);
  font-weight: 800;
  line-height: 1.15;
  margin: 0;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.55);
}
.auth-media__caption p {
  margin: 12px 0 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.5);
}
.auth-media__caption .auth-media__line {
  width: 46px;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--lg-accent), transparent);
}
@keyframes authCaptionIn {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@media (max-width: 860px) {
  .auth-media__caption {
    display: none;
  }
}

/* ================= PANEL FORMULARIO ================= */
.auth-side {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: clamp(30px, 4vw, 52px);
  color: var(--lg-text);
  background:
    radial-gradient(
      680px 520px at 120% -10%,
      rgba(124, 58, 237, 0.24),
      transparent 60%
    ),
    radial-gradient(
      520px 420px at -10% 110%,
      rgba(167, 139, 250, 0.12),
      transparent 60%
    ),
    linear-gradient(180deg, var(--lg-bg-2), var(--lg-bg));
}
/* Línea divisoria sutil entre imagen y formulario (solo desktop) */
.auth-side::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--lg-divider), transparent);
  pointer-events: none;
}
@media (max-width: 860px) {
  .auth-side::before {
    display: none;
  }
}

/* Contenedor del formulario (limpio; el marco es la tarjeta) */
.auth-form {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 320px;
}

.auth-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--lg-accent);
  margin: 0;
}
.auth-title {
  font-size: clamp(25px, 2.6vw, 30px);
  font-weight: 800;
  line-height: 1.12;
  margin: 8px 0 0;
  color: var(--lg-title);
  letter-spacing: -0.01em;
}
.auth-bar {
  width: 44px;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--lg-brand-2), var(--lg-accent));
  margin: 12px 0;
}
.auth-sub {
  font-size: 13.5px;
  color: var(--lg-muted);
  margin: 0;
}

.auth-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 18px 0 22px;
}
.auth-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border-radius: 20px;
  font-size: 12.5px;
  background: var(--lg-field);
  border: 1px solid var(--lg-border);
  color: var(--lg-text);
  transition:
    transform 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease;
}
.auth-chip:hover {
  transform: translateY(-2px);
  background: rgba(167, 139, 250, 0.16);
  border-color: var(--lg-accent);
}

/* Campos (fuerzan estilo oscuro, ignorando el tema del portal) */
.auth-field {
  margin-bottom: 15px;
}
.auth-side .form-label {
  font-weight: 500;
  font-size: 13.5px;
  margin-bottom: 6px;
  color: var(--lg-text);
}
.auth-side .form-control {
  background: var(--lg-field);
  border: 1px solid var(--lg-border);
  color: var(--lg-input-text);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 15px;
  transition:
    background 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease,
    transform 0.12s ease;
}
.auth-side .form-control::placeholder {
  color: var(--lg-muted);
  opacity: 1;
}
.auth-side .form-control:focus {
  background: rgba(127, 100, 200, 0.09);
  border-color: var(--lg-accent);
  color: var(--lg-input-text);
  transform: translateY(-1px);
  box-shadow: 0 0 0 0.2rem rgba(167, 139, 250, 0.22);
}
.auth-side .input-group .form-control {
  border-right: none;
}
.auth-side .input-group .btn.btn-theme {
  background: var(--lg-field);
  border: 1px solid var(--lg-border);
  border-left: none;
  color: var(--lg-text);
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}
.auth-side .input-group .btn.btn-theme:hover {
  background: rgba(255, 255, 255, 0.1);
}

.auth-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 2px 0 18px;
}
.auth-side .form-check-input {
  background-color: var(--lg-field);
  border-color: var(--lg-border);
}
.auth-side .form-check-input:checked {
  background-color: var(--lg-brand);
  border-color: var(--lg-brand);
}
.auth-side .form-check-label {
  color: var(--lg-muted);
  font-size: 13.5px;
}

/* Botón con degradado + brillo */
.auth-submit {
  position: relative;
  overflow: hidden;
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 13px 16px;
  font-size: 15.5px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(100deg, var(--lg-brand), var(--lg-brand-2));
  box-shadow: 0 10px 26px rgba(109, 40, 217, 0.4);
  transition:
    transform 0.12s ease,
    box-shadow 0.25s ease;
}
.auth-submit:hover {
  transform: translateY(-2px);
  background: linear-gradient(100deg, #5b21b6, var(--lg-brand-2));
  box-shadow: 0 16px 34px rgba(109, 40, 217, 0.55);
}
.auth-submit:active {
  transform: translateY(0);
}
.auth-submit::after {
  content: "";
  position: absolute;
  top: 0;
  left: -120%;
  width: 55%;
  height: 100%;
  background: linear-gradient(
    120deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
  transform: skewX(-20deg);
  transition: left 0.6s ease;
}
.auth-submit:hover::after {
  left: 130%;
}

.auth-note {
  margin-top: 20px;
  padding: 12px 14px;
  border-radius: 11px;
  background: var(--lg-field);
  border: 1px solid var(--lg-border);
  font-size: 12px;
  color: var(--lg-muted);
  line-height: 1.55;
}
.auth-legal {
  margin-top: 12px;
  text-align: center;
  font-size: 12px;
  color: var(--lg-muted);
}
.auth-legal a {
  color: var(--lg-accent);
  text-decoration: none;
}
.auth-legal a:hover {
  text-decoration: underline;
}
.auth-help {
  margin: 12px 0 0;
  text-align: center;
  font-size: 12px;
  color: var(--lg-muted);
}

/* Entrada escalonada de los bloques del formulario */
.auth-reveal {
  opacity: 0;
  transform: translateY(14px);
  animation: authRise 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes authRise {
  to {
    opacity: 1;
    transform: none;
  }
}

/* ============ BOTÓN CLARO / OSCURO (flotante) ============ */
.auth-theme-toggle {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  color: var(--lg-text);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--lg-border);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  cursor: pointer;
  transition:
    transform 0.16s ease,
    background 0.16s ease,
    border-color 0.16s ease;
  animation: authRise 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.45s both;
}
.auth-theme-toggle:hover {
  transform: translateY(-2px);
  background: rgba(167, 139, 250, 0.2);
  border-color: var(--lg-accent);
}
.auth-theme-toggle .js-theme-icon {
  font-size: 15px;
}

/* ================= LOGIN: SIEMPRE OSCURO =================
   La pantalla de login NO responde al tema claro/oscuro: se ve
   siempre oscura (marco + tarjeta + formulario), aunque el usuario
   tenga el portal en modo claro. Por eso aquí NO hay overrides
   [data-theme="light"] para .auth-*: siempre aplican los estilos
   oscuros de base. El resto del portal sí cambia con data-theme. */

@media (prefers-reduced-motion: reduce) {
  /* Nota: la AURORA del fondo se mantiene animada aposta (decisión de diseño,
     fondo decorativo). Las animaciones de ENTRADA sí se desactivan. */
  .auth-card,
  .auth-media__bg,
  .auth-media__img,
  .auth-media__badge,
  .auth-media__caption,
  .auth-theme-toggle,
  .auth-reveal {
    animation: none !important;
  }
  .auth-reveal,
  .auth-card,
  .auth-theme-toggle,
  .auth-media__caption {
    opacity: 1;
    transform: none;
  }
}

/* =========================================================
   PORTAL / APP — shell global (reconstruido)
   Layout, sidebar, topbar, menú, cards, botones y tema claro/oscuro.
   Las vistas concretas conservan sus propios <style> (heroes, etc.).
   ========================================================= */
:root {
  --app-bg: #eceef5;
  --app-surface: #ffffff;
  --app-surface-2: #f5f6fb;
  --app-text: #1e2330;
  --app-muted: #6b7183;
  --app-heading: #141824;
  --app-border: rgba(20, 22, 45, 0.1);
  --app-radius: 16px;
  --app-shadow: 0 12px 32px rgba(20, 22, 45, 0.1);

  /* Sidebar — CLARO por defecto (sigue el tema) */
  --side-bg: linear-gradient(185deg, #ffffff 0%, #f5f4fc 100%);
  --side-text: #241d3d;
  --side-muted: #6c6788;
  --side-border: rgba(20, 22, 45, 0.09);
  --side-hover: rgba(124, 58, 237, 0.08);
  --side-active: linear-gradient(90deg, var(--brand-primary, #6d28d9), #7c3aed);
  --side-btn-bg: rgba(20, 22, 45, 0.05);
  --side-btn-hover: rgba(124, 58, 237, 0.12);
  --side-logo-shadow: 0 4px 10px rgba(20, 22, 45, 0.18);
}
:root[data-theme="dark"] {
  --app-bg: #0e0b1a;
  --app-surface: #17132a;
  --app-surface-2: #1d1836;
  --app-text: #e9e6f6;
  --app-muted: #a79fc6;
  --app-heading: #ffffff;
  --app-border: rgba(255, 255, 255, 0.09);
  --app-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);

  /* Sidebar — OSCURO de marca en modo oscuro */
  --side-bg: linear-gradient(185deg, #1d1738 0%, #140f28 62%, #100b20 100%);
  --side-text: #ece9f8;
  --side-muted: #a79fc6;
  --side-border: rgba(255, 255, 255, 0.08);
  --side-hover: rgba(255, 255, 255, 0.07);
  --side-btn-bg: rgba(255, 255, 255, 0.08);
  --side-btn-hover: rgba(255, 255, 255, 0.16);
  --side-logo-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

body {
  background: var(--app-bg);
  color: var(--app-text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ---------- LAYOUT ---------- */
.layout {
  display: grid;
  grid-template-columns: minmax(238px, 266px) minmax(0, 1fr);
  align-items: start;
  min-height: 100vh;
  min-height: 100dvh;
}
@media (max-width: 991.98px) {
  .layout {
    grid-template-columns: 1fr;
  }
}
.content {
  min-width: 0;
}

/* ---------- SIDEBAR (escritorio) ---------- */
.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  padding: 20px 14px 18px;
  background: var(--side-bg);
  color: var(--side-text);
  border-right: 1px solid var(--side-border);
}
.sidebar .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px 18px;
}
.sidebar .brand img {
  height: 46px;
  width: auto;
  flex: 0 0 auto;
  filter: drop-shadow(var(--side-logo-shadow));
}
.sidebar .brand .title {
  font-weight: 700;
  font-size: 14.5px;
  line-height: 1.25;
  color: var(--side-text);
}

/* ---------- NAVEGACIÓN (sidebar + offcanvas móvil) ---------- */
.nav-section {
  gap: 3px;
}
.sidebar .nav-link,
.offcanvas-dark .nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 11px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--side-muted);
  transition:
    background 0.16s ease,
    color 0.16s ease,
    transform 0.12s ease;
}
.sidebar .nav-link:hover,
.offcanvas-dark .nav-link:hover {
  background: var(--side-hover);
  color: var(--side-text);
  transform: translateX(2px);
}
.sidebar .nav-link.active,
.offcanvas-dark .nav-link.active {
  background: var(--side-active);
  color: #fff;
  box-shadow: 0 8px 20px rgba(109, 40, 217, 0.35);
}
.sidebar .nav-link.disabled,
.offcanvas-dark .nav-link.disabled {
  opacity: 0.45;
  pointer-events: none;
}
.sidebar hr,
.offcanvas-dark hr {
  border-color: var(--side-border);
  opacity: 1;
  margin: 12px 4px;
}

/* ---------- TOPBAR (móvil) ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: var(--side-bg);
  color: var(--side-text);
  border-bottom: 1px solid var(--side-border);
}
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  flex: 1 1 auto;
}
.topbar-crest {
  height: 30px;
  width: auto;
  flex: 0 0 auto;
  border-radius: 7px;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.28));
}
.topbar .slug {
  font-weight: 600;
  font-size: 14px;
  line-height: 1.15;
  color: var(--side-text);
  margin: 0 !important;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar .user {
  font-size: 13px;
  color: var(--side-muted);
  max-width: 42vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- OFFCANVAS oscuro (menú móvil) ---------- */
.offcanvas-dark {
  background: var(--side-bg);
  color: var(--side-text);
}
.offcanvas-dark .offcanvas-header {
  border-bottom: 1px solid var(--side-border);
}

/* ---------- BOTONES ---------- */
.btn-brand {
  border: none;
  color: #fff;
  border-radius: 11px;
  font-weight: 600;
  background: linear-gradient(100deg, #6d28d9, #7c3aed);
  box-shadow: 0 8px 20px rgba(109, 40, 217, 0.3);
  transition:
    transform 0.12s ease,
    box-shadow 0.25s ease;
}
.btn-brand:hover,
.btn-brand:focus {
  color: #fff;
  background: linear-gradient(100deg, #5b21b6, #7c3aed);
  box-shadow: 0 12px 26px rgba(109, 40, 217, 0.42);
  transform: translateY(-1px);
}
.btn-theme {
  border-radius: 10px;
  font-weight: 500;
  background: var(--app-surface-2);
  border: 1px solid var(--app-border);
  color: var(--app-text);
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease;
}
.btn-theme:hover {
  background: rgba(124, 58, 237, 0.1);
  border-color: var(--brand-accent, #a78bfa);
  color: var(--app-text);
}
/* btn-theme dentro del sidebar/topbar: sigue el tema del panel */
.sidebar .btn-theme,
.topbar .btn-theme {
  background: var(--side-btn-bg);
  border-color: var(--side-border);
  color: var(--side-text);
}
.sidebar .btn-theme:hover,
.topbar .btn-theme:hover {
  background: var(--side-btn-hover);
  color: var(--side-text);
}

/* ---------- CARDS ---------- */
.layout .card {
  background: var(--app-surface);
  color: var(--app-text);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
}
.layout .card .card-title,
.layout .card h1,
.layout .card h2,
.layout .card h3,
.layout .card h4,
.layout .card h5 {
  color: var(--app-heading);
}
.hover-rise {
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease;
}
.hover-rise:hover {
  transform: translateY(-3px);
  box-shadow: var(--app-shadow);
  border-color: rgba(124, 58, 237, 0.35);
}
.layout .text-muted {
  color: var(--app-muted) !important;
}

/* Selección de fila en tablas (app.js -> .has-check) */
.layout tr.has-check > * {
  background: rgba(124, 58, 237, 0.12) !important;
}

/* Enlaces del contenido (no toca login: login no está en .layout) */
.layout .content a:not(.nav-link):not(.btn):not(.page-link):not(.dropdown-item) {
  color: #7c3aed;
}
:root[data-theme="dark"]
  .layout
  .content
  a:not(.nav-link):not(.btn):not(.page-link):not(.dropdown-item) {
  color: var(--brand-accent, #a78bfa);
}

/* ---------- MODO OSCURO: superficies Bootstrap (solo dentro de .layout) ---------- */
:root[data-theme="dark"] .layout .form-control,
:root[data-theme="dark"] .layout .form-select {
  background: var(--app-surface-2);
  border-color: var(--app-border);
  color: var(--app-text);
}
:root[data-theme="dark"] .layout .form-control::placeholder {
  color: var(--app-muted);
}
:root[data-theme="dark"] .layout .table {
  --bs-table-color: var(--app-text);
  --bs-table-bg: transparent;
  --bs-table-border-color: var(--app-border);
}
:root[data-theme="dark"] .layout .list-group-item {
  background: transparent;
  color: var(--app-text);
  border-color: var(--app-border);
}

/* ============================================================
   RGPD — pantalla de aceptación (incidencia nº 786)
   ============================================================ */
.rgpd-card .rgpd-icono {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  background: rgba(124, 58, 237, 0.12);
}
.rgpd-extra {
  border-left: 3px solid var(--brand-accent, #a78bfa);
  padding: 0.5rem 0.85rem;
  background: rgba(124, 58, 237, 0.06);
  border-radius: 0 10px 10px 0;
}

/* ============================================================
   DOCUMENTOS DEL EXPEDIENTE (incidencias nº 786 y 787)
   ============================================================ */
.tabla-documentos td,
.tabla-documentos th {
  vertical-align: middle;
}
.tabla-documentos .btn {
  white-space: nowrap;
}

/* ============================================================
   RECIBO DE CUOTA — respaldo HTML (incidencia nº 727)
   Página suelta: no vive dentro de .layout, así que se pinta sola.
   ============================================================ */
.recibo-body {
  background: #f1f5f9;
  color: #111827;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  margin: 0;
  padding: 1.5rem;
}
.recibo-hoja {
  max-width: 720px;
  margin: 0 auto;
  background: #fff;
  border-radius: 14px;
  padding: 2rem 2.25rem;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
}
.recibo-cab {
  text-align: center;
  border-bottom: 2px solid #e5e7eb;
  padding-bottom: 0.9rem;
  margin-bottom: 1.2rem;
}
.recibo-cab h1 {
  font-size: 1.15rem;
  margin: 0 0 0.35rem;
  letter-spacing: 0.02em;
}
.recibo-cab div {
  font-size: 0.82rem;
  color: #6b7280;
}
.recibo-titulo {
  text-align: center;
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  margin: 0 0 0.25rem;
}
.recibo-meta {
  text-align: center;
  font-size: 0.85rem;
  color: #6b7280;
  margin-bottom: 1.4rem;
}
.recibo-bloque {
  margin-bottom: 1.2rem;
  font-size: 0.9rem;
}
.recibo-bloque h3 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #6b7280;
  margin: 0 0 0.4rem;
}
.recibo-tabla {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin-bottom: 1.2rem;
}
.recibo-tabla th,
.recibo-tabla td {
  border: 1px solid #d1d5db;
  padding: 0.55rem 0.7rem;
  text-align: left;
}
.recibo-tabla .num {
  text-align: right;
}
.recibo-texto {
  font-size: 0.9rem;
  line-height: 1.55;
}
.recibo-firma {
  margin-top: 2rem;
  font-size: 0.9rem;
}
.recibo-firma .mt {
  margin-top: 2.5rem;
}
.recibo-pie {
  margin-top: 1.8rem;
  font-size: 0.72rem;
  color: #6b7280;
  font-style: italic;
}
.recibo-acciones {
  margin-top: 1.5rem;
  text-align: center;
}
.recibo-acciones button,
.carnet-acciones button {
  border: 0;
  border-radius: 999px;
  padding: 0.6rem 1.4rem;
  background: #5b21b6;
  color: #fff;
  font-size: 0.9rem;
  cursor: pointer;
}

/* ============================================================
   CARNET DE HERMANO — respaldo HTML (incidencia nº 850)
   Tamaño tarjeta: 85,6 × 54 mm
   ============================================================ */
.carnet-body {
  background: #f1f5f9;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  margin: 0;
  padding: 2rem 1rem;
}
.carnet {
  width: 85.6mm;
  height: 54mm;
  margin: 0 auto;
  background: #fff;
  border-radius: 3mm;
  overflow: hidden;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.22);
  display: flex;
  flex-direction: column;
}
.carnet-cab {
  background: #5b21b6;
  color: #fff;
  font-size: 8pt;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 2.2mm 3mm;
  line-height: 1.25;
}
.carnet-cuerpo {
  flex: 1;
  padding: 2.5mm 3mm;
}
.carnet-etiqueta {
  font-size: 6pt;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #6b7280;
}
.carnet-nombre {
  font-size: 11pt;
  font-weight: 700;
  margin: 1mm 0 2mm;
  line-height: 1.15;
}
.carnet-campo {
  display: flex;
  justify-content: space-between;
  gap: 3mm;
  font-size: 7.5pt;
  padding: 0.5mm 0;
}
.carnet-campo span {
  color: #6b7280;
}
.carnet-pie {
  background: #f0f0f5;
  color: #5a5a5a;
  font-size: 6pt;
  padding: 1.6mm 3mm;
  display: flex;
  justify-content: space-between;
}
.carnet-acciones {
  margin-top: 1.5rem;
  text-align: center;
}

@media print {
  .no-print {
    display: none !important;
  }
  .recibo-body,
  .carnet-body {
    background: #fff;
    padding: 0;
  }
  .recibo-hoja,
  .carnet {
    box-shadow: none;
  }
}
