/* Centro de Día — diseño profesional, accesible y adaptable */

:root {
  --font-sans: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", sans-serif;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-heading: "Outfit", var(--font-sans);

  --bg: #e8ecf3;
  --bg-mesh: radial-gradient(ellipse 120% 80% at 0% 0%, rgba(13, 148, 136, 0.18), transparent 52%),
    radial-gradient(ellipse 95% 65% at 100% 8%, rgba(30, 58, 95, 0.14), transparent 48%),
    radial-gradient(ellipse 75% 55% at 50% 100%, rgba(148, 163, 184, 0.14), transparent 42%),
    radial-gradient(ellipse 50% 40% at 85% 45%, rgba(217, 119, 6, 0.05), transparent 55%);
  --surface: #ffffff;
  --surface-glass: rgba(255, 255, 255, 0.72);
  --surface-muted: #f1f5f9;

  --text: #0f172a;
  --text-secondary: #475569;
  --muted: #64748b;

  --primary: #0d9488;
  --primary-light: #2dd4bf;
  --primary-hover: #0f766e;
  --primary-soft: rgba(13, 148, 136, 0.14);
  --primary-ring: rgba(13, 148, 136, 0.4);

  --accent-navy: #1e3a5f;
  --accent-amber: #d97706;
  --accent-amber-soft: rgba(217, 119, 6, 0.12);
  --sidebar-from: #1e293b;
  --sidebar-to: #0f172a;

  --border: #e2e8f0;
  --border-strong: #cbd5e1;

  --radius: 14px;
  --radius-lg: 18px;
  --radius-sm: 8px;
  --radius-pill: 999px;

  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 20px rgba(15, 23, 42, 0.06);
  --shadow-card: 0 2px 8px rgba(15, 23, 42, 0.06), 0 12px 40px rgba(15, 23, 42, 0.08);
  --shadow-header: 0 4px 24px rgba(13, 148, 136, 0.15);
  --shadow-nav: 4px 0 32px rgba(0, 0, 0, 0.2);

  --sidebar-w: min(280px, 88vw);
  --touch-min: 44px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: clamp(0.9375rem, 0.9rem + 0.2vw, 1rem);
  background-color: var(--bg);
  background-image: var(--bg-mesh);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.6;
  -webkit-tap-highlight-color: rgba(13, 148, 136, 0.15);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.06'/%3E%3C/svg%3E");
  z-index: 0;
}

body.layout-auth::before {
  opacity: 0.22;
}

body.layout-auth::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 90% 70% at 10% 15%, rgba(45, 212, 191, 0.28), transparent 55%),
    radial-gradient(ellipse 70% 55% at 92% 8%, rgba(99, 102, 241, 0.18), transparent 50%),
    radial-gradient(ellipse 80% 60% at 78% 92%, rgba(13, 148, 136, 0.22), transparent 55%),
    radial-gradient(ellipse 50% 40% at 45% 55%, rgba(217, 119, 6, 0.06), transparent 60%);
}

/* Cookies / privacidad */
.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 300;
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--border);
  box-shadow: 0 -10px 35px rgba(15, 23, 42, 0.12);
  backdrop-filter: blur(10px);
}

.cookie-banner__inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  justify-content: space-between;
  padding: 0.9rem 1rem;
}

.cookie-banner__desc {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
  max-width: 60ch;
}

.cookie-banner__actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  min-width: 260px;
}

.cookie-modal[hidden] {
  display: none;
}

.cookie-modal {
  position: fixed;
  inset: 0;
  z-index: 400;
}

.cookie-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
}

.cookie-modal__box {
  position: relative;
  max-width: 720px;
  margin: 8vh auto 0;
}

.cookie-opt {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

@media (max-width: 720px) {
  .cookie-banner__inner {
    flex-direction: column;
    align-items: stretch;
  }
  .cookie-banner__actions {
    min-width: 0;
    justify-content: flex-start;
  }
  .cookie-modal__box {
    margin: 10vh 1rem 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.layout-auth::after {
    background:
      radial-gradient(ellipse 90% 70% at 10% 15%, rgba(45, 212, 191, 0.22), transparent 55%),
      radial-gradient(ellipse 70% 55% at 92% 8%, rgba(99, 102, 241, 0.12), transparent 50%);
  }
}

.layout > * {
  position: relative;
  z-index: 1;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.15s ease, background-color 0.15s ease;
}
a:hover,
a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}
a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.layout {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
}

/* ——— Autenticación (login, páginas estrechas) ——— */
body.layout-auth {
  background: linear-gradient(155deg, #0f172a 0%, #1e3a5f 42%, #134e4a 100%);
  min-height: 100vh;
  min-height: 100dvh;
}

body.layout-auth .layout {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

body.layout-auth .auth-main {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 0;
}

body.layout-auth .card {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.22), 0 0 0 1px rgba(255, 255, 255, 0.06) inset;
}

body.layout-auth .msg {
  border-radius: var(--radius-sm);
}

body.layout-auth .main--narrow .page-header {
  background: linear-gradient(135deg, rgba(13, 148, 136, 0.16) 0%, rgba(30, 58, 95, 0.12) 48%, rgba(255, 255, 255, 0.72) 100%);
  border: 1px solid rgba(13, 148, 136, 0.22);
  box-shadow: 0 8px 36px rgba(15, 23, 42, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

body.layout-auth .main--narrow .page-header__glow {
  opacity: 0.55;
}

body.layout-auth .main__surface--auth {
  position: relative;
  width: 100%;
  max-width: 460px;
  margin-left: auto;
  margin-right: auto;
  padding: clamp(1.25rem, 4vw, 1.65rem) clamp(1rem, 3vw, 1.5rem) clamp(1.35rem, 3vw, 1.75rem);
  background: linear-gradient(168deg, rgba(255, 255, 255, 0.99) 0%, rgba(248, 250, 252, 0.97) 45%, rgba(241, 245, 249, 0.95) 100%);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: calc(var(--radius-lg) + 2px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.85) inset,
    0 28px 56px rgba(15, 23, 42, 0.18),
    0 0 0 1px rgba(15, 23, 42, 0.04);
}

body.layout-auth .main__surface--auth::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.55) 0%, transparent 38%);
  opacity: 0.9;
}

body.layout-auth .main__surface--auth > * {
  position: relative;
  z-index: 1;
}

/* ——— Navegación móvil ——— */
.nav-toggle {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.nav-toggle-btn {
  display: none;
  align-items: center;
  justify-content: flex-start;
  min-height: var(--touch-min);
  padding: 0 1rem;
  margin: 0;
  background: linear-gradient(90deg, var(--sidebar-from), var(--sidebar-to));
  color: #f1f5f9;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
  letter-spacing: 0.02em;
  -webkit-appearance: none;
  appearance: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-toggle-btn__icon {
  display: inline-block;
  width: 1.1rem;
  height: 2px;
  margin-right: 0.65rem;
  background: currentColor;
  box-shadow: 0 6px 0 currentColor, 0 -6px 0 currentColor;
  vertical-align: middle;
  flex-shrink: 0;
}

.nav-toggle-btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: -2px;
}

.nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(2px);
  z-index: 90;
  cursor: pointer;
}

/* ——— Barra lateral ——— */
.sidebar {
  position: relative;
  width: 258px;
  background: linear-gradient(165deg, #1e3b52 0%, var(--sidebar-from) 38%, var(--sidebar-to) 100%);
  color: #e2e8f0;
  padding: 0 0 1.25rem;
  flex-shrink: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.04);
}

.sidebar::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.45;
  background-image:
    radial-gradient(ellipse 100% 80% at 0% 0%, rgba(45, 212, 191, 0.12), transparent 55%),
    repeating-linear-gradient(
      -12deg,
      transparent,
      transparent 2px,
      rgba(255, 255, 255, 0.02) 2px,
      rgba(255, 255, 255, 0.02) 3px
    );
}

.sidebar > * {
  position: relative;
  z-index: 1;
}

.sidebar__brand {
  padding: 1.35rem 1.25rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 0.5rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, transparent 100%);
}

.sidebar__brand-link {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.05rem, 1rem + 0.25vw, 1.2rem);
  color: #f8fafc !important;
  text-decoration: none !important;
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.sidebar__brand-link:hover {
  color: #fff !important;
  text-decoration: none !important;
}

.sidebar__brand-tag {
  display: inline-block;
  margin-top: 0.45rem;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(148, 163, 184, 0.95);
}

.sidebar__user {
  padding: 0.85rem 1.25rem 1rem;
  margin: 0 0.75rem 0.65rem;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.8125rem;
  line-height: 1.45;
}

.sidebar__user-role {
  font-weight: 600;
  color: #f1f5f9;
  font-size: 0.8rem;
}

.sidebar__user-org {
  margin-top: 0.35rem;
  color: #94a3b8;
}

.sidebar__user-name {
  margin-top: 0.4rem;
  color: #cbd5e1;
  font-weight: 500;
}

.sidebar__hint {
  padding: 0 1.25rem 0.75rem;
  font-size: 0.8rem;
  color: #94a3b8;
  line-height: 1.4;
  margin: 0;
}

.sidebar a {
  color: #e2e8f0;
  display: flex;
  align-items: center;
  padding: 0.62rem 1.25rem;
  min-height: var(--touch-min);
  text-decoration: none !important;
  font-size: 0.92rem;
  font-weight: 500;
  border-left: 3px solid transparent;
  margin: 0 0.35rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.sidebar a:hover,
.sidebar a:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.sidebar a:focus-visible {
  outline: none;
  border-left-color: var(--primary);
}

.sidebar__details {
  margin: 0.15rem 0;
  padding: 0;
  border: none;
}

.sidebar__summary {
  cursor: pointer;
  list-style: none;
  color: #e2e8f0;
  padding: 0.62rem 1.25rem;
  min-height: var(--touch-min);
  font-size: 0.92rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  margin: 0 0.35rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  border-left: 3px solid transparent;
  transition: background 0.15s ease;
}

.sidebar__summary::-webkit-details-marker {
  display: none;
}

.sidebar__summary::after {
  content: "";
  margin-left: auto;
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid #94a3b8;
  border-bottom: 2px solid #94a3b8;
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

.sidebar__details[open] .sidebar__summary::after {
  transform: rotate(-135deg);
  margin-top: 0.2rem;
}

.sidebar__summary:hover {
  background: rgba(255, 255, 255, 0.06);
}

.sidebar__sub {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.25rem 0 0.5rem 0.5rem;
}

.sidebar__sub a {
  font-size: 0.875rem;
  padding-left: 1.5rem;
  font-weight: 450;
}

.sep {
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin: 1rem 1.25rem;
}

/* ——— Contenido principal ——— */
.main {
  flex: 1;
  padding: 1.25rem clamp(0.65rem, 2.2vw, 1.75rem) 2.25rem;
  max-width: 1220px;
  width: 100%;
  margin: 0 auto;
  min-width: 0;
}

.main__surface {
  position: relative;
  background: linear-gradient(168deg, rgba(255, 255, 255, 0.99) 0%, rgba(248, 250, 252, 0.97) 55%, rgba(241, 245, 249, 0.96) 100%);
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: var(--radius-lg);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.75) inset,
    var(--shadow-card),
    0 0 0 1px rgba(15, 23, 42, 0.035);
  padding: clamp(1.15rem, 2.5vw, 1.75rem) clamp(1rem, 2.5vw, 1.85rem) clamp(1.5rem, 3vw, 2rem);
}

.main__surface::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.95) 20%, rgba(45, 212, 191, 0.35) 50%, rgba(255, 255, 255, 0.95) 80%, transparent);
  pointer-events: none;
  z-index: 2;
}

.main__surface > * {
  position: relative;
  z-index: 1;
}

@media (max-width: 768px) {
  .main__surface {
    border-radius: var(--radius);
    padding: 1rem 0.85rem 1.35rem;
    min-height: 0;
  }
}

.main--narrow {
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
  padding-top: clamp(1rem, 4vw, 2rem);
  padding-bottom: clamp(1rem, 4vw, 2rem);
}

body.layout-auth .main--narrow {
  background: transparent;
  box-shadow: none;
  border: none;
}

.page-header {
  position: relative;
  margin: 0 0 1.65rem;
  padding: 1.15rem 1.15rem 1.2rem 1.25rem;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(13, 148, 136, 0.13) 0%, rgba(30, 58, 95, 0.1) 42%, rgba(255, 255, 255, 0.72) 100%);
  border: 1px solid rgba(13, 148, 136, 0.2);
  box-shadow: var(--shadow-header), inset 0 1px 0 rgba(255, 255, 255, 0.65);
  overflow: hidden;
}

.page-header::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image: repeating-linear-gradient(
    -18deg,
    transparent,
    transparent 11px,
    rgba(13, 148, 136, 0.06) 11px,
    rgba(13, 148, 136, 0.06) 12px
  );
  border-radius: inherit;
}

.page-header::before {
  content: "";
  position: absolute;
  left: 1.25rem;
  right: 1.25rem;
  bottom: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(90deg, var(--primary) 0%, var(--accent-navy) 42%, var(--accent-amber) 100%);
  opacity: 0.85;
  pointer-events: none;
  z-index: 2;
}

.page-header__glow {
  position: absolute;
  width: 240px;
  height: 240px;
  right: -70px;
  top: -110px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(45, 212, 191, 0.42) 0%, rgba(30, 58, 95, 0.08) 45%, transparent 72%);
  pointer-events: none;
  z-index: 0;
}

.page-header__inner {
  position: relative;
  z-index: 3;
}

.page-header__text {
  min-width: 0;
  padding-top: 0.1rem;
}

.page-header__title {
  margin: 0 0 0.4rem;
  font-family: var(--font-heading);
  font-weight: 650;
  font-size: clamp(1.5rem, 1.2rem + 1.1vw, 2rem);
  color: var(--text);
  letter-spacing: -0.035em;
  line-height: 1.15;
}

.page-header__lead {
  margin: 0;
  font-size: 0.97rem;
  color: var(--text-secondary);
  max-width: 58ch;
  line-height: 1.55;
}

.page-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin: 0 0 1.35rem;
}

.page-toolbar--end {
  justify-content: flex-end;
}

.page-toolbar--paciente {
  align-items: center;
}

.page-toolbar__icons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-right: 0.25rem;
}

.page-toolbar__icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--touch-min);
  min-width: var(--touch-min);
  height: var(--touch-min);
  padding: 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--accent-navy);
  box-shadow: var(--shadow);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.page-toolbar__icon-btn:hover,
.page-toolbar__icon-btn:focus-visible {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary-hover);
  text-decoration: none;
}

.page-toolbar__icon-svg {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}

.page-toolbar__icon-svg--inline {
  width: 1.05rem;
  height: 1.05rem;
  margin-right: 0.35rem;
  vertical-align: -0.2em;
}

.page-toolbar__btn-icon {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
}

/* Anclas en ficha de usuario (paciente): scroll cómodo bajo cabecera */
#datos,
#historial-situacion,
#contactos,
#clinico,
#imc {
  scroll-margin-top: 1rem;
}

.paciente-add-contacto {
  margin-top: 1rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
}

.paciente-add-contacto__summary {
  list-style: none;
  cursor: pointer;
  padding: 0.65rem 0.85rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--accent-navy);
  user-select: none;
}

.paciente-add-contacto__summary::-webkit-details-marker {
  display: none;
}

.paciente-add-contacto__summary::before {
  content: "";
  display: inline-block;
  width: 0.45em;
  height: 0.45em;
  margin-right: 0.5rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  vertical-align: 0.15em;
  transition: transform 0.2s ease;
}

.paciente-add-contacto[open] > .paciente-add-contacto__summary::before {
  transform: rotate(45deg);
  vertical-align: 0.05em;
}

.paciente-add-contacto__body {
  padding: 0 0.85rem 0.85rem;
  border-top: 1px solid var(--border);
}

.page-footnote {
  margin-top: 1.5rem;
  padding: 0.85rem 1rem;
  font-size: 0.875rem;
  color: var(--muted);
  background: var(--surface-muted);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  line-height: 1.5;
}

.page-footnote code {
  font-size: 0.8em;
  background: rgba(15, 23, 42, 0.06);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

h1:not(.page-header__title) {
  margin: 0 0 1rem;
  font-family: var(--font-heading);
  font-weight: 650;
  font-size: clamp(1.45rem, 1.15rem + 0.95vw, 1.85rem);
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1.2;
}

h2,
h3 {
  line-height: 1.3;
  font-family: var(--font-heading);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border);
  padding: clamp(1.1rem, 2.5vw, 1.4rem);
  margin-bottom: 1.25rem;
  position: relative;
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: linear-gradient(90deg, var(--primary), #14b8a6);
  opacity: 0.85;
}

.card--flat::before {
  display: none;
}

.main__surface .card {
  min-width: 0;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05), 0 8px 28px rgba(15, 23, 42, 0.06);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(252, 252, 253, 0.96) 100%);
  border-color: rgba(226, 232, 240, 0.95);
  transition: box-shadow 0.2s ease;
}

.main__surface .card:hover {
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.07), 0 14px 40px rgba(13, 148, 136, 0.08);
}

@media (prefers-reduced-motion: reduce) {
  .main__surface .card {
    transition: none;
  }
}

.main__surface .card--flat {
  background: var(--surface);
}

.table-shell {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  width: 100%;
  max-width: 100%;
  display: block;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
}

.table-shell table {
  margin: 0;
  width: max-content;
  min-width: 100%;
}

.table-shell th:first-child,
.table-shell td:first-child {
  padding-left: 1rem;
}

.table-shell th:last-child,
.table-shell td:last-child {
  padding-right: 1rem;
}

/* Asistente de scroll: volver arriba + horizontal (tabla / página) */
.table-scroll-assist {
  position: relative;
  width: 100%;
  max-width: 100%;
}

.table-scroll-assist .table-shell {
  width: 100%;
}

.table-scroll-assist__btn {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 4;
  width: 2.5rem;
  min-width: var(--touch-min);
  max-width: 3rem;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-navy);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.97) 0%, rgba(255, 255, 255, 0.82) 55%, transparent 100%);
  box-shadow: none;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.table-scroll-assist__btn--next {
  right: 0;
  background: linear-gradient(270deg, rgba(255, 255, 255, 0.97) 0%, rgba(255, 255, 255, 0.82) 55%, transparent 100%);
}

.table-scroll-assist__btn--prev {
  left: 0;
}

.table-scroll-assist--overflow .table-scroll-assist__btn:not([hidden]) {
  opacity: 1;
  pointer-events: auto;
}

.table-scroll-assist__btn:hover,
.table-scroll-assist__btn:focus-visible {
  color: var(--primary-hover);
  background: linear-gradient(90deg, rgba(13, 148, 136, 0.12) 0%, transparent 100%);
}

.table-scroll-assist__btn--next:hover,
.table-scroll-assist__btn--next:focus-visible {
  background: linear-gradient(270deg, rgba(13, 148, 136, 0.12) 0%, transparent 100%);
}

.table-scroll-assist__btn:focus-visible {
  outline: 2px solid var(--primary-ring);
  outline-offset: -2px;
}

.scroll-assist-top {
  position: fixed;
  z-index: 800;
  right: max(0.75rem, env(safe-area-inset-right, 0px));
  bottom: max(1rem, env(safe-area-inset-bottom, 0px));
  width: var(--touch-min);
  height: var(--touch-min);
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--primary-hover);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.scroll-assist-top:hover,
.scroll-assist-top:focus-visible {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.scroll-assist-top:focus-visible {
  outline: 2px solid var(--primary-ring);
  outline-offset: 2px;
}

.scroll-assist-win-x {
  position: fixed;
  z-index: 799;
  left: max(0.35rem, env(safe-area-inset-left, 0px));
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.scroll-assist-win-x[hidden] {
  display: none !important;
}

.scroll-assist-win-x__btn {
  width: var(--touch-min);
  height: var(--touch-min);
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.94);
  color: var(--accent-navy);
  box-shadow: var(--shadow);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.scroll-assist-win-x__btn:hover:not(:disabled),
.scroll-assist-win-x__btn:focus-visible:not(:disabled) {
  background: var(--primary-soft);
  color: var(--primary-hover);
}

.scroll-assist-win-x__btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.scroll-assist-win-x__btn:focus-visible {
  outline: 2px solid var(--primary-ring);
  outline-offset: 2px;
}

.filtros-listado .select-multi {
  width: 100%;
  min-height: 7rem;
  font-size: 0.9rem;
  padding: 0.35rem;
}
.filtros-listado label {
  margin-bottom: 0.35rem;
}

.informes-pdf-form .grid2 {
  margin-top: 0.5rem;
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
  margin: 0 -0.25rem;
  padding: 0 0.25rem;
}

.table-wrap table {
  width: max-content;
  min-width: 100%;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: clamp(0.8125rem, 0.78rem + 0.2vw, 0.9rem);
  min-width: 0;
}

.main__surface .card table:not(.month-table):not(.data) {
  width: max-content;
  min-width: 100%;
}

/* Agenda (FullCalendar): anular regla de listados en tablas del calendario */
.main__surface .card.agenda-calendar-card table {
  width: 100%;
  min-width: 0;
}

th,
td {
  text-align: left;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

tbody tr {
  transition: background 0.12s ease;
}

tbody tr:hover {
  background: var(--surface-muted);
}

th {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: linear-gradient(180deg, #f8fafc, #f1f5f9);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--touch-min);
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: inherit;
  background: linear-gradient(180deg, #14b8a6 0%, var(--primary) 100%);
  color: #fff;
  text-decoration: none !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12), 0 2px 8px rgba(13, 148, 136, 0.25);
  -webkit-appearance: none;
  appearance: none;
  transition: transform 0.12s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.btn:hover {
  filter: brightness(1.05);
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.15), 0 4px 14px rgba(13, 148, 136, 0.35);
}
.btn:active {
  transform: translateY(1px);
}
.btn:focus-visible {
  outline: 2px solid var(--primary-ring);
  outline-offset: 2px;
}
.btn.secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}
.btn.secondary:hover {
  background: var(--surface-muted);
  filter: none;
}
.btn.danger {
  background: linear-gradient(180deg, #ef4444 0%, #b91c1c 100%);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
}

label {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

.muted {
  color: var(--muted);
}

input[type="text"],
input[type="search"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="number"],
input[type="color"],
input[type="file"],
select,
textarea {
  width: 100%;
  max-width: 100%;
  min-height: var(--touch-min);
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  background: var(--surface);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

textarea {
  min-height: 5.5rem;
  resize: vertical;
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.15rem;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.stat-card {
  background: linear-gradient(148deg, #ffffff 0%, #f8fafc 50%, #eef2f7 100%);
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: var(--radius);
  padding: 1.2rem 1.25rem 1.3rem;
  box-shadow: 0 4px 22px rgba(15, 23, 42, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.95);
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: "";
  position: absolute;
  top: -20%;
  right: -15%;
  width: 55%;
  height: 120%;
  background: radial-gradient(ellipse at 100% 0%, rgba(13, 148, 136, 0.09), transparent 65%);
  pointer-events: none;
}

.stat-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: linear-gradient(180deg, #2dd4bf, var(--primary) 45%, var(--accent-navy));
  border-radius: 5px 0 0 5px;
}

.stat-card__label {
  position: relative;
  z-index: 1;
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.stat-card__value {
  position: relative;
  z-index: 1;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 1.2rem + 1vw, 1.85rem);
  font-weight: 600;
  color: var(--accent-navy);
  letter-spacing: -0.02em;
}

.msg {
  padding: 0.85rem 1.05rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: 0.92rem;
  font-weight: 500;
  border: 1px solid transparent;
}
.msg.ok {
  background: #ecfdf5;
  color: #065f46;
  border-color: #a7f3d0;
}
.msg.error {
  background: #fef2f2;
  color: #991b1b;
  border-color: #fecaca;
}
.msg.info {
  background: #f0f9ff;
  color: #075985;
  border-color: #bae6fd;
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--primary-soft);
  color: var(--primary-hover);
  letter-spacing: 0.02em;
}

.badge--portal-si {
  background: #d1fae5;
  color: #047857;
  border: 1px solid #6ee7b7;
  font-size: 0.78rem;
  padding: 0.28rem 0.65rem;
}

.badge--portal-no {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  font-size: 0.78rem;
  padding: 0.28rem 0.65rem;
}

.portal-cuenta-fila--activa td {
  background: rgba(16, 185, 129, 0.06);
}

.portal-cuenta-fila--inactiva td {
  background: rgba(239, 68, 68, 0.05);
}

.portal-cuenta-fila--inactiva td:not(:last-child) {
  color: var(--text-secondary);
}

.portal-cuentas-table .badge {
  white-space: nowrap;
}

.trabajador-fila--activa td {
  background: rgba(16, 185, 129, 0.08);
}

.trabajador-fila--inactiva td {
  background: rgba(148, 163, 184, 0.14);
}

.trabajador-fila--inactiva td:not(:last-child) {
  color: var(--text-secondary);
}

.badge--trab-estado-activo {
  background: rgba(16, 185, 129, 0.2);
  color: #047857;
  border: 1px solid rgba(16, 185, 129, 0.45);
  font-weight: 600;
}

.badge--trab-estado-inactivo {
  background: rgba(148, 163, 184, 0.35);
  color: #475569;
  border: 1px solid rgba(100, 116, 139, 0.4);
  font-weight: 600;
}

.badge--trab-web-si {
  background: rgba(59, 130, 246, 0.15);
  color: #1d4ed8;
  border: 1px solid rgba(59, 130, 246, 0.35);
}

.badge--trab-web-no {
  background: rgba(148, 163, 184, 0.2);
  color: #64748b;
}

.portal-nueva-cuenta-details__summary {
  cursor: pointer;
  font-weight: 600;
  padding: 0 0 0.25rem;
  list-style: none;
}

.portal-nueva-cuenta-details__summary::-webkit-details-marker {
  display: none;
}

.portal-nueva-cuenta-details__summary::before {
  content: '▶';
  display: inline-block;
  margin-right: 0.35em;
  font-size: 0.65em;
  vertical-align: middle;
  transition: transform 0.15s ease;
}

.portal-nueva-cuenta-details[open] .portal-nueva-cuenta-details__summary::before {
  transform: rotate(90deg);
}

.portal-cuenta-activa-box {
  margin-top: 0.85rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
}

.portal-cuenta-activa-box--on {
  border-color: #34d399;
  background: linear-gradient(135deg, rgba(209, 250, 229, 0.65), rgba(236, 253, 245, 0.9));
}

.portal-cuenta-activa-box--off {
  border-color: #fca5a5;
  background: linear-gradient(135deg, rgba(254, 226, 226, 0.55), rgba(255, 251, 251, 0.95));
}

.portal-cuenta-activa-box__label {
  cursor: pointer;
  font-size: 1rem;
}

.portal-cuenta-activa-box__hint {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

pre {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 900px) {
  .grid2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .layout {
    flex-direction: column;
  }

  .nav-toggle-btn {
    display: flex;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-nav);
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    height: 100dvh;
    width: var(--sidebar-w);
    z-index: 100;
    padding-top: 0.35rem;
    transform: translateX(-100%);
    transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-nav);
  }

  .nav-toggle:checked ~ .sidebar {
    transform: translateX(0);
  }

  .nav-toggle:checked ~ .nav-backdrop {
    display: block;
  }

  .main {
    padding-top: 0.65rem;
  }
}

@media (max-width: 480px) {
  .main {
    padding-left: 0.65rem;
    padding-right: 0.65rem;
  }

  .btn {
    width: 100%;
    max-width: 100%;
  }

  .card .btn + .btn,
  .card .btn + a.btn {
    margin-top: 0.5rem;
  }
}

@supports (padding: max(0px)) {
  .sidebar {
    padding-left: max(0px, env(safe-area-inset-left));
    padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
  }

  .main {
    padding-left: max(0.75rem, env(safe-area-inset-left));
    padding-right: max(0.75rem, env(safe-area-inset-right));
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
  }

  .nav-toggle-btn {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }
}

.agenda-fullcalendar {
  --fc-border-color: var(--border);
  --fc-button-bg-color: var(--primary);
  --fc-button-border-color: var(--primary);
  --fc-button-text-color: #fff;
  --fc-button-hover-bg-color: var(--primary-hover);
  --fc-button-hover-border-color: var(--primary-hover);
  --fc-today-bg-color: rgba(13, 148, 136, 0.1);
}

.agenda-fullcalendar .fc .fc-button {
  font-family: inherit;
  font-weight: 600;
  text-transform: none;
  letter-spacing: normal;
}

.agenda-fullcalendar .fc .fc-button-primary:not(:disabled):active,
.agenda-fullcalendar .fc .fc-button-primary:not(:disabled).fc-button-active {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
}

@media (max-width: 767.98px) {
  .agenda-calendar-card {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }

  .agenda-fullcalendar .fc .fc-toolbar.fc-header-toolbar {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.65rem;
  }

  .agenda-fullcalendar .fc .fc-toolbar.fc-header-toolbar .fc-toolbar-chunk {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .agenda-fullcalendar .fc .fc-toolbar.fc-header-toolbar .fc-toolbar-chunk:first-child,
  .agenda-fullcalendar .fc .fc-toolbar.fc-header-toolbar .fc-toolbar-chunk:last-child {
    flex: 0 0 auto;
  }

  .agenda-fullcalendar .fc .fc-toolbar.fc-header-toolbar .fc-toolbar-chunk:nth-child(2) {
    flex: 1 1 auto;
    min-width: 0;
  }

  .agenda-fullcalendar .fc .fc-toolbar-title {
    font-size: 0.95rem;
    line-height: 1.25;
    white-space: normal;
    text-align: center;
    padding: 0 0.25rem;
  }

  .agenda-fullcalendar .fc .fc-toolbar.fc-footer-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    margin-top: 0.5rem;
    margin-bottom: 0.65rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
  }

  .agenda-fullcalendar .fc .fc-toolbar.fc-footer-toolbar .fc-toolbar-chunk {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem;
    width: 100%;
  }

  .agenda-fullcalendar .fc .fc-button {
    min-height: var(--touch-min);
    padding: 0.4em 0.55em;
    font-size: 0.8125rem;
    line-height: 1.2;
  }

  .agenda-fullcalendar .fc .fc-prev-button,
  .agenda-fullcalendar .fc .fc-next-button {
    min-width: var(--touch-min);
    padding-left: 0.35em;
    padding-right: 0.35em;
  }

  .agenda-fullcalendar .fc .fc-icon {
    font-size: 1.15em;
  }

  .agenda-fullcalendar .fc .fc-daygrid-body {
    font-size: 0.8125rem;
  }

  .agenda-fullcalendar .fc .fc-col-header-cell-cushion {
    padding: 0.35em 0.15em;
    font-size: 0.7rem;
    font-weight: 600;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar {
    transition: none;
  }
  .btn {
    transition: none;
  }
}

.pwa-banner {
  background: linear-gradient(135deg, var(--accent-navy) 0%, var(--sidebar-to) 100%);
  color: #e2e8f0;
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
  margin-bottom: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow);
}

.pwa-banner-inner {
  max-width: 720px;
}

.pwa-banner-title {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  font-family: var(--font-sans);
}

.pwa-banner-desc {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  opacity: 0.92;
  line-height: 1.45;
}

.pwa-banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.pwa-banner-actions .btn {
  min-height: 42px;
}

.pwa-btn-quiet {
  opacity: 0.9;
}

.pwa-banner .btn.secondary {
  background: rgba(255, 255, 255, 0.15);
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.pwa-banner .btn.secondary:hover {
  background: rgba(255, 255, 255, 0.25);
}

.pwa-ios-steps {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
  line-height: 1.6;
}

.pwa-ios-steps li {
  margin-bottom: 0.5rem;
}

.pwa-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.pwa-modal[hidden] {
  display: none !important;
}

.pwa-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
}

.pwa-modal-box {
  position: relative;
  z-index: 1;
  max-width: 420px;
  width: 100%;
  margin: 0;
}

.card:has(table) {
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
}

/* --- Guía de uso (ayuda por rol) --- */
.ayuda-doc {
  max-width: 52rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.ayuda-hero {
  padding: 1.35rem 1.5rem 1.5rem;
  border-left: 4px solid var(--primary);
}

.ayuda-hero__kicker {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.ayuda-hero__title {
  margin: 0 0 0.5rem;
  font-family: var(--font-heading);
  font-size: clamp(1.35rem, 1.1rem + 1.2vw, 1.65rem);
  font-weight: 700;
  color: var(--accent-navy);
  line-height: 1.25;
}

.ayuda-hero__lead {
  margin: 0;
  font-size: 1.02rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

.ayuda-badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-pill);
  background: var(--primary-soft);
  color: var(--primary-hover);
  font-weight: 600;
  font-size: 0.9em;
}

.ayuda-resumen {
  padding: 1.15rem 1.35rem;
  background: linear-gradient(135deg, rgba(13, 148, 136, 0.06), rgba(30, 58, 95, 0.05));
  border: 1px solid var(--border);
}

.ayuda-resumen__title {
  margin: 0 0 0.65rem;
  font-size: 1.05rem;
  font-family: var(--font-heading);
  color: var(--accent-navy);
}

.ayuda-resumen__text {
  margin: 0;
  line-height: 1.65;
  color: var(--text);
}

.ayuda-toc {
  padding: 1.1rem 1.35rem;
}

.ayuda-toc__title {
  margin: 0 0 0.65rem;
  font-size: 1rem;
  font-family: var(--font-heading);
  color: var(--accent-navy);
}

.ayuda-toc__list {
  margin: 0;
  padding-left: 1.2rem;
  line-height: 1.75;
  color: var(--text-secondary);
}

.ayuda-toc__list a {
  font-weight: 500;
}

.ayuda-section {
  padding: 1.2rem 1.35rem 1.35rem;
}

.ayuda-section h2 {
  margin: 0 0 0.75rem;
  font-size: 1.12rem;
  font-family: var(--font-heading);
  color: var(--accent-navy);
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.ayuda-section p {
  margin: 0 0 0.85rem;
  color: var(--text);
  line-height: 1.65;
}

.ayuda-section p:last-child {
  margin-bottom: 0;
}

.ayuda-section--muted {
  background: var(--surface-muted);
}

.ayuda-list {
  margin: 0 0 0.85rem;
  padding-left: 1.25rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.ayuda-list li {
  margin-bottom: 0.35rem;
}

.ayuda-steps {
  margin: 0 0 0.85rem;
  padding-left: 1.35rem;
  line-height: 1.75;
  color: var(--text);
}

.ayuda-steps li {
  margin-bottom: 0.45rem;
}

.ayuda-callout {
  margin: 1rem 0 0;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  line-height: 1.6;
}

.ayuda-callout--amber {
  background: var(--accent-amber-soft);
  border: 1px solid rgba(217, 119, 6, 0.28);
  color: var(--text);
}

.ayuda-callout--navy {
  background: rgba(30, 58, 95, 0.08);
  border: 1px solid rgba(30, 58, 95, 0.15);
  color: var(--text);
}

.ayuda-doc--portal {
  max-width: 48rem;
}

.ayuda-dl {
  margin: 0 0 0.5rem;
}

.ayuda-dl dt {
  margin-top: 0.85rem;
  font-weight: 700;
  font-family: var(--font-heading);
  color: var(--accent-navy);
  font-size: 0.98rem;
}

.ayuda-dl dt:first-child {
  margin-top: 0;
}

.ayuda-dl dd {
  margin: 0.35rem 0 0;
  padding-left: 0;
  color: var(--text-secondary);
  line-height: 1.65;
}

@media print {
  .scroll-assist-top,
  .scroll-assist-win-x,
  .table-scroll-assist__btn {
    display: none !important;
  }

  #pwa-banner,
  #pwa-ios-modal,
  #pwa-android-modal,
  .nav-toggle-btn,
  .nav-backdrop,
  .sidebar {
    display: none !important;
  }

  body::before {
    display: none !important;
  }

  .layout {
    display: block;
  }

  .main {
    max-width: none;
    padding: 0;
  }

  .main__surface {
    background: #fff;
    border: none;
    box-shadow: none;
    padding: 0;
  }

  .page-header {
    box-shadow: none;
    border: 1px solid #ccc;
    background: #f8fafc;
  }

  .page-header::before,
  .page-header::after {
    display: none !important;
  }

  .page-header__glow {
    display: none;
  }

  .card {
    box-shadow: none;
    border: 1px solid #ccc;
  }
  .card::before {
    display: none;
  }

  .stat-card::after {
    display: none !important;
  }
}
