/* ───────────────────────────────────────────────
   Dashboard NORA – Versión LITE / Minimal
   Activo solo con html.dash-mode
   ─────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@500;600;700&display=swap');

html.dash-mode,
html.dash-mode body {
  --brand: #00274E;
  --accent: #CBA052;
  --ink: #111827;
  --muted: #6b7280;
  --border: #e2e8f0;
  --bg: #f3f4f8;
  --surface: #ffffff;

  --radius-sm: 8px;
  --radius: 12px;
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, .06);

  /* Tipografía base dashboard: Montserrat + fallback.
     Si viene de Bootstrap, se respeta con --bs-body-font-family. */
  --dash-font: var(--bs-body-font-family, 'Montserrat', system-ui, -apple-system,
      'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif);

  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-size: 16px;
  /* ↑ fuente general dashboard */
  font-family: var(--dash-font);
  -webkit-font-smoothing: antialiased;
}

html.dash-mode,
html.dash-mode body {
  box-sizing: border-box;
  overflow-x: hidden;
  /* corta el scroll lateral sobrante */
}

html.dash-mode *,
html.dash-mode *::before,
html.dash-mode *::after {
  box-sizing: inherit;
}


/* Focus accesible */
html.dash-mode :is(a, button, input, select, textarea, [role="tab"]):focus-visible {
  outline: 2px solid #0b9dcc;
  outline-offset: 2px;
}

/* ───────── Layout general ───────── */

html.dash-mode #dash-view {
  min-height: 100vh;
}

html.dash-mode .dash-shell {
  min-height: 100vh;
  padding-block: 24px 40px;
  padding-inline: 24px 48px;
  /* pegado a la izquierda, margen extra a la derecha */
}

html.dash-mode .dash-container {
  width: 100%;
  max-width: none;
  /* sin límite de ancho de “container” */
  margin-inline: 0;
}

/* Piel de fondo ligera */
html.dash-mode .dash-shell {
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, .9) 0, transparent 55%),
    linear-gradient(180deg, #eef2f7 0, #e5e9f3 100%);
}

/* =========================================================
   LAYOUT DASHBOARD – SIDEBAR IZQUIERDA (para mountSkeleton)
   ========================================================= */

/* Root del dashboard */
html.dash-mode #dash-root {
  min-height: calc(100vh - 140px);
}

/* Grid: sidebar + contenido */
html.dash-mode .dash-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 24px;
  align-items: flex-start;
}

/* Sidebar tipo Brevo */
html.dash-mode .dash-sidebar {
  position: sticky;
  top: 0.75rem;
  align-self: flex-start;
}

html.dash-mode .dash-sidebar-inner {
  background: #f8fafc;
  border-radius: 0;
  /* sin burbuja, columna “plana” */
  border: none;
  border-right: 1px solid #e2e8f0;
  /* solo línea vertical derecha */
  box-shadow: none;
  padding: 16px 18px 24px 4px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Título pequeño del sidebar */
html.dash-mode .dash-sidebar-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6b7280;
}

/* Lista de tabs verticales */
html.dash-mode .dash-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Botón de pestaña – SIN pastilla azul */
html.dash-mode .dash-tab {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 8px;
  color: #4b5563;
  text-decoration: none;
  border: 1px solid transparent;
  font-size: 0.95rem;
  /* un pelín más grande */
  font-weight: 500;
  background: transparent;
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease,
    transform 0.12s ease;
}

html.dash-mode .dash-tab svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: block;
}

html.dash-mode .dash-tab:hover {
  text-decoration: none;
  background: rgba(15, 23, 42, .03);
  border-color: transparent;
  color: #111827;
  transform: translateX(1px);
}

/* Estado activo: solo texto marca + barrita izquierda muy discreta */
html.dash-mode .dash-tab[aria-current="page"],
html.dash-mode .dash-tab[aria-selected="true"] {
  background: transparent;
  color: var(--brand);
  border-color: transparent;
  font-weight: 600;
}

html.dash-mode .dash-tab[aria-current="page"]::before,
html.dash-mode .dash-tab[aria-selected="true"]::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  border-radius: 999px;
  background: var(--brand);
}

/* Contenido principal */
html.dash-mode .dash-main {
  min-width: 0;
}

/* Header superior dentro del main */
html.dash-mode .dash-main-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 12px;
}

html.dash-mode .dash-main-title {
  font-size: 1.3rem;
  font-weight: 600;
  color: #0f172a;
}

html.dash-mode .dash-main-subtitle {
  font-size: 0.95rem;
  color: #6b7280;
}

/* Responsive: sidebar pasa arriba horizontal */
@media (max-width: 992px) {
  html.dash-mode .dash-layout {
    grid-template-columns: 1fr;
  }

  html.dash-mode .dash-sidebar {
    position: static;
  }

  html.dash-mode .dash-sidebar-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-right: none;
    border-bottom: 1px solid #e2e8f0;
  }

  html.dash-mode .dash-nav {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  html.dash-mode .dash-tab {
    white-space: nowrap;
    padding-inline: 10px;
  }
}

/* ───────── Cards base ───────── */

html.dash-mode .card {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  background: var(--surface);
}

html.dash-mode .card .card-body {
  padding: 16px 18px;
}

/* tablas con altura controlada */
html.dash-mode .table-scroll-10 {
  max-height: clamp(260px, 55vh, 520px);
  /* ajusta estos números si quieres */
  overflow: auto;
}

/* ───────── Tablas (PDFs / facturas / borradores) ───────── */

html.dash-mode table.table {
  margin-bottom: 0;
  font-size: .9rem;
}

html.dash-mode table.table th {
  font-weight: 600;
  color: #4b5563;
  white-space: nowrap;
}

html.dash-mode table.table td {
  vertical-align: middle;
}

/* Zebra + hover suaves */
html.dash-mode .table-zebra tbody tr:nth-child(odd) {
  background: rgba(15, 23, 42, .015);
}

html.dash-mode .table-hover tbody tr:hover {
  background: rgba(15, 23, 42, .05);
}

/* Columna acciones estrecha */
html.dash-mode .col-actions,
html.dash-mode td.text-end {
  white-space: nowrap;
}

/* ───────── PERFIL (logo + cuenta) ───────── */

html.dash-mode .brand-card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
}

html.dash-mode .profile-brand-logo {
  min-width: 160px;
  min-height: 70px;
  max-width: 220px;
  border-radius: var(--radius);
  border: 1px dashed #cbd5e1;
  background: #f9fafb;
  display: flex;
  align-items: center;
  justify-content: center;
}

html.dash-mode .profile-brand-logo img {
  max-width: 180px;
  max-height: 64px;
  object-fit: contain;
}


html.dash-mode .small-muted {
  font-size: .8rem;
  color: var(--muted);
}

/* ───────── “Mis PDFs” ───────── */

html.dash-mode .pdfs-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 8px;
}

html.dash-mode .pdfs-toolbar .form-control,
html.dash-mode .pdfs-toolbar .form-select {
  max-width: 260px;
}

/* truncated nombre PDF */
html.dash-mode .text-truncate-1 {
  max-width: 420px;
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* Badges estado PDF (si los usas) */
html.dash-mode .badge-status {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
}

html.dash-mode .badge-status.ok {
  color: #0a6;
  background: #e6f7f0;
}

html.dash-mode .badge-status.pending {
  color: #b76e00;
  background: #fff6e6;
}

html.dash-mode .badge-status.error {
  color: #b80d0d;
  background: #ffe9e9;
}

/* Empty state PDFs */
html.dash-mode .empty-state {
  border: 1px dashed rgba(15, 23, 42, .18);
  border-radius: 10px;
  padding: 20px 16px;
  text-align: center;
  background: linear-gradient(180deg, #f9fafb 0, #f1f5f9 100%);
}

html.dash-mode .empty-state p {
  margin-bottom: 8px;
  color: var(--muted);
}


/* ───────── MIS PDFS – refinado ───────── */

html.dash-mode .pdfs-hero-card .btn {
  border-radius: 999px;
  font-weight: 600;
}

html.dash-mode .pdfs-hero-card p {
  font-size: 0.85rem;
}

html.dash-mode .pdfs-ccaa {
  border-top: 1px dashed rgba(148, 163, 184, 0.6);
  padding-top: 0.6rem;
}

/* Ajuste de toolbar para PDFs (ya tenías .pdfs-toolbar base) */
html.dash-mode .pdfs-toolbar {
  margin-bottom: 10px;
}

html.dash-mode .pdfs-toolbar input[type="search"],
html.dash-mode .pdfs-toolbar input[type="text"],
html.dash-mode .pdfs-toolbar input[type="email"],
html.dash-mode .pdfs-toolbar .form-control {
  max-width: 260px;
}

/* Tablas de PDFs más legibles */
html.dash-mode #sec-pdfs table.table th,
html.dash-mode #sec-pdfs table.table td {
  font-size: 0.9rem;
}

html.dash-mode #sec-pdfs .text-muted.small {
  font-size: 0.8rem;
}


/* ───────── Plan (barra + texto) ───────── */

html.dash-mode .progress {
  height: 10px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}

html.dash-mode .progress-bar {
  background: linear-gradient(90deg, var(--accent), #f5d4a2);
}

/* Roadmap caja suave */
html.dash-mode #planRoadmap {
  border-radius: var(--radius-sm);
  border-color: #e2e8f0;
  background: #f8fafc;
  font-size: .85rem;
}

/* ───────── Pricing (tarjetas de plan) ───────── */

html.dash-mode .pricing-wrap {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

html.dash-mode .price-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 14px;
  background: #fff;
}

html.dash-mode .price-card .price-name {
  font-weight: 700;
  color: var(--brand);
}

html.dash-mode .price-card .price-val {
  font-size: 1.3rem;
  font-weight: 800;
}

html.dash-mode .price-card .features {
  list-style: none;
  padding-left: 0;
  margin: 8px 0 0;
}

html.dash-mode .price-card .features li {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  font-size: .9rem;
}

html.dash-mode .price-card .tick {
  font-weight: 900;
  line-height: 1;
  color: #16a34a;
}

/* tarjeta plan actual */
html.dash-mode .price-card.current {
  outline: 2px solid var(--brand);
}

/* Flex controls */
html.dash-mode .flex-ctrl {
  margin-top: 4px;
}

html.dash-mode #flexQtyInput {
  max-width: 120px;
  text-align: right;
}

html.dash-mode #flexQtyRange {
  width: 100%;
}

/* ───────── Servicios (NIE / Licencia) ───────── */

html.dash-mode .svc-body {
  position: relative;
}

/* velo para bloquear servicios en plan free */
html.dash-mode .svc-veil {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, .9), rgba(255, 255, 255, .96));
  z-index: 5;
  text-align: center;
}

html.dash-mode .svc-veil .inner {
  background: #fff;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border);
  padding: 16px 18px;
}

/* selector de servicio (NIE / LAT) */
html.dash-mode .svc-chooser {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

html.dash-mode .svc-tile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  transition: box-shadow .12s ease, transform .12s ease, border-color .12s ease;
}

html.dash-mode .svc-tile:hover,
html.dash-mode .svc-tile:focus-visible {
  border-color: var(--brand);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

html.dash-mode .svc-card {
  border-radius: var(--radius-sm);
}

/* cajita “seguridad / confianza” */
html.dash-mode .trust {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: #f1faf7;
  border: 1px solid #cfe9dd;
  color: #14532d;
  font-size: .9rem;
}

/* estimación */
html.dash-mode .svc-est {
  font-size: .9rem;
  color: var(--muted);
}

html.dash-mode .svc-est strong {
  color: var(--ink);
}

/* ───────── Legal ───────── */

html.dash-mode .js-legal-toc {
  list-style: none;
  padding-left: 0;
  margin-bottom: 0;
}

html.dash-mode .js-legal-toc li+li {
  margin-top: 6px;
}

html.dash-mode .js-legal-toc a {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--brand);
  text-decoration: none;
  font-size: .9rem;
}

html.dash-mode .js-legal-toc a:hover {
  border-color: var(--brand);
}

/* ───────── Facturación ───────── */

html.dash-mode .badge {
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
}

html.dash-mode .bg-success-subtle {
  background: #e7f7ee !important;
  color: #166534 !important;
}

html.dash-mode .bg-danger-subtle {
  background: #fde8ea !important;
  color: #b91c1c !important;
}

html.dash-mode .bg-secondary-subtle {
  background: #e5e7eb !important;
  color: #374151 !important;
}

/* ───────── Mini modales (nombre PDF, etc.) ───────── */

html.dash-mode .mini-modal-backdrop {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .45);
  z-index: 1000;
}

html.dash-mode .mini-modal {
  width: min(420px, 96vw);
  border-radius: var(--radius);
  background: #fff;
  padding: 16px 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
}

/* ───────── Responsive extra ───────── */

@media (max-width: 992px) {
  html.dash-mode .pricing-wrap {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  html.dash-mode .svc-chooser {
    grid-template-columns: 1fr;
  }

  html.dash-mode #sec-legal .row {
    display: block;
  }
}

@media (max-width: 576px) {
  html.dash-mode .pdfs-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  html.dash-mode .pdfs-toolbar .form-control,
  html.dash-mode .pdfs-toolbar .form-select {
    max-width: 100%;
  }

  html.dash-mode .table-responsive {
    overflow-x: auto;
  }

  html.dash-mode table.table {
    min-width: 520px;
  }
}

/* ▸ Dashboard: container alineado a la izquierda pero con ancho máximo
   para dejar aire a la derecha en pantallas grandes */
html.dash-mode body>.container-xxl,
html.dash-mode body>.container,
html.dash-mode body>.container-fluid {
  max-width: 1620px !important;
  /* límite de ancho (puedes subirlo/bajarlo) */
  margin-left: 0 !important;
  /* pegado al borde izquierdo */
  margin-right: auto !important;
  /* el espacio sobrante queda a la derecha */
  padding-left: 0 !important;
  padding-right: 0 !important;
}


/* ───────── PERFIL (logo + cuenta) refinado ───────── */

html.dash-mode .brand-card {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 20px;
}

@media (max-width: 768px) {
  html.dash-mode .brand-card {
    flex-direction: column;
  }
}

html.dash-mode .profile-brand-logo {
  min-width: 180px;
  max-width: 220px;
  min-height: 80px;
  border-radius: 12px;
  border: 1px dashed #cbd5e1;
  background: #f9fafb;
  display: flex;
  align-items: center;
  justify-content: center;
}

html.dash-mode .profile-brand-logo img {
  max-width: 180px;
  max-height: 64px;
  object-fit: contain;
}


html.dash-mode .brand-actions {
  flex: 1;
  min-width: 0;
}

html.dash-mode .brand-actions .form-text {
  font-size: 0.8rem;
}

/* Bloque de cuenta: solo un separador elegante, nada cargado */
html.dash-mode .account-card {
  padding-top: 18px;
  margin-top: 8px;
  border-top: 1px dashed rgba(148, 163, 184, 0.6);
}

html.dash-mode .account-card .btn {
  border-radius: 999px;
  font-size: 0.85rem;
  padding-inline: 14px;
}

/* Texto pequeño más legible en todo el perfil */
html.dash-mode #sec-perfil .small,
html.dash-mode #sec-perfil .form-text {
  font-size: 0.8rem;
}


/* ───────── MI PLAN – uso y pricing ───────── */

html.dash-mode #sec-plan .card-body {
  padding: 16px 18px 18px;
}

html.dash-mode .plan-usage-meta {
  font-size: 0.9rem;
}

html.dash-mode .plan-renew-meta>div {
  line-height: 1.3;
}

/* Barra de progreso más elegante */
html.dash-mode #sec-plan .progress {
  height: 0.6rem;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}

html.dash-mode #usageBar {
  background: linear-gradient(90deg, var(--accent), #f5d4a2);
}

/* Roadmap suave */
html.dash-mode .plan-roadmap {
  font-size: 0.85rem;
  background: #f8fafc;
  border-color: #e2e8f0;
}

html.dash-mode .plan-roadmap ul {
  padding-left: 1.1rem;
}

html.dash-mode .plan-roadmap li+li {
  margin-top: 0.25rem;
}

/* Pricing: alineación fina */
html.dash-mode #sec-plan .price-head {
  align-items: flex-start;
}

html.dash-mode #sec-plan .price-tag {
  text-align: right;
  max-width: 140px;
}

/* Hacer que Pro destaque un poco más sin estridencias */
html.dash-mode #planCardPro {
  border-width: 2px;
  border-color: var(--brand);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

/* ───────── Servicios legales (NIE / Licencia) ───────── */

html.dash-mode .svc-body {
  position: relative;
}

/* Velo bloqueo plan free */
html.dash-mode .svc-veil {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, .94), rgba(255, 255, 255, .98));
  z-index: 5;
  text-align: center;
}

html.dash-mode .svc-veil .inner {
  background: #ffffff;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border);
  padding: 16px 20px;
  max-width: 360px;
}

/* Lead bajo el título */
html.dash-mode .svc-lead {
  font-size: 0.9rem;
}

/* Selector de servicios */
html.dash-mode .svc-chooser {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

@media (max-width: 768px) {
  html.dash-mode .svc-chooser {
    grid-template-columns: 1fr;
  }
}

/* Tarjeta de selección: sin iconos, más seria */
html.dash-mode .svc-tile {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #ffffff;
  cursor: pointer;
  transition:
    background 0.12s ease,
    border-color 0.12s ease,
    box-shadow 0.12s ease,
    transform 0.08s ease;
}

html.dash-mode .svc-tile:hover,
html.dash-mode .svc-tile:focus-visible {
  border-color: var(--brand);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

html.dash-mode .svc-tile-main {
  min-width: 0;
}

html.dash-mode .svc-tile-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
}

html.dash-mode .svc-tile-sub {
  font-size: 0.82rem;
  color: var(--muted);
}

html.dash-mode .svc-tile-meta {
  display: flex;
  align-items: center;
}

html.dash-mode .svc-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #111827;
  font-size: 0.75rem;
  font-weight: 500;
}

/* Botón volver */
html.dash-mode .svc-back {
  margin-bottom: 6px;
}

html.dash-mode .svc-back .btn-link {
  padding-left: 0;
  font-size: 0.85rem;
}

/* Card detalle servicio */
html.dash-mode .svc-card {
  border-radius: var(--radius-sm);
}

/* Caja de confianza / explicación legal */
html.dash-mode .trust {
  border-radius: var(--radius-sm);
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  padding: 10px 12px;
  margin-bottom: 10px;
  font-size: 0.85rem;
}

html.dash-mode .trust-title {
  font-weight: 600;
  color: var(--brand);
  margin-bottom: 2px;
}

html.dash-mode .trust-text {
  color: var(--muted);
}

/* Estimación */
html.dash-mode .svc-est {
  font-size: 0.85rem;
  color: var(--muted);
}

html.dash-mode .svc-est strong {
  color: var(--ink);
}

/* Acciones */
html.dash-mode .svc-actions {
  display: flex;
  flex-shrink: 0;
  gap: 8px;
  justify-content: flex-end;
}

@media (max-width: 768px) {
  html.dash-mode .svc-actions {
    width: 100%;
    justify-content: stretch;
  }

  html.dash-mode .svc-actions .btn {
    width: 100%;
  }
}

/* ───────── Legal (términos, privacidad, etc.) ───────── */

html.dash-mode .legal-header {
  border-bottom: 1px solid rgba(148, 163, 184, 0.35);
  padding-bottom: 8px;
  margin-bottom: 16px;
}

html.dash-mode .legal-lead {
  font-size: 0.9rem;
}

html.dash-mode .legal-meta {
  font-size: 0.8rem;
}

html.dash-mode .legal-meta-value {
  font-weight: 600;
  color: var(--brand);
}

/* Layout general */
html.dash-mode .legal-layout {
  align-items: flex-start;
}

/* Card del índice */
html.dash-mode .legal-toc-card {
  border-radius: var(--radius-sm);
  border-color: #e2e8f0;
  background: #f8fafc;
}

/* Lista índice */
html.dash-mode .js-legal-toc {
  padding-left: 0;
  margin-bottom: 0;
}

html.dash-mode .js-legal-toc li+li {
  margin-top: 4px;
}

html.dash-mode .js-legal-toc a {
  display: block;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--brand);
  text-decoration: none;
  font-size: 0.88rem;
}

html.dash-mode .js-legal-toc a:hover {
  border-color: #d1d5db;
  background: #eef2ff;
}

/* CONTENIDO LEGAL
   - Sin scroll interno en desktop
   - Reseteamos contador propio "dash-legal-section"
*/
html.dash-mode .legal-content {
  counter-reset: dash-legal-section;
  max-height: none;
  overflow: visible;
  padding-right: 4px;
}

@media (max-width: 992px) {
  html.dash-mode .legal-content {
    max-height: none;
    overflow: visible;
  }
}

/* Cada bloque de artículo */
html.dash-mode .legal-article {
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

html.dash-mode .legal-article:last-child {
  border-bottom: none;
}

/* Título numerado */
html.dash-mode .legal-section-title {
  font-weight: 600;
  color: var(--brand);
  margin-bottom: 4px;
  position: relative;
}

/* 👉 Numeración 1., 2., 3.… */
html.dash-mode .legal-section-title::before {
  counter-increment: dash-legal-section;
  content: counter(dash-legal-section) ". ";
  font-weight: 600;
  margin-right: 0.35rem;
  color: var(--brand);
}

/* Texto general */
html.dash-mode .legal-article p,
html.dash-mode .legal-article li {
  font-size: 0.9rem;
}

html.dash-mode .legal-article ul {
  padding-left: 1.1rem;
}


/* ───────── Facturación (Mis facturas) ───────── */

html.dash-mode .inv-header {
  border-bottom: 1px solid rgba(148, 163, 184, 0.35);
  padding-bottom: 8px;
}

html.dash-mode .inv-header .small {
  font-size: 0.88rem;
}

html.dash-mode .inv-meta {
  font-size: 0.8rem;
}

html.dash-mode .inv-meta-value {
  font-weight: 600;
  color: var(--brand);
}

/* Toolbar */
html.dash-mode .inv-toolbar {
  font-size: 0.86rem;
}

html.dash-mode .inv-toolbar .form-control,
html.dash-mode .inv-toolbar .form-select {
  max-width: 220px;
}

/* Tabla de facturas */
html.dash-mode #sec-invoices table.table th {
  font-weight: 600;
  color: #4b5563;
  white-space: nowrap;
}

html.dash-mode #sec-invoices table.table td {
  vertical-align: middle;
  font-size: 0.9rem;
}

/* Leyenda de estados */
html.dash-mode .inv-status-legend {
  border-top: 1px dashed rgba(226, 232, 240, 0.9);
  padding-top: 6px;
}

html.dash-mode .inv-status-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 999px;
}

html.dash-mode .inv-status-dot-ok {
  background: #16a34a;
}

html.dash-mode .inv-status-dot-open {
  background: #f59e0b;
}

html.dash-mode .inv-status-dot-canceled {
  background: #dc2626;
}

/* Home Dashboard */

.dashboard-home-content {
  max-width: 1280px;
  margin: 0 auto;
}

.dashboard-home-hero {
  border-radius: 1rem;
}

@media (max-width: 768px) {
  .dashboard-home-hero .card-body {
    padding: 1.25rem 1rem;
  }
}

/* ───── DASHBOARD HOME LAYOUT ───── */

.dashboard-home-root {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 0 2.5rem;
}

/* Hero */

.dashboard-home-hero {
  border-radius: 20px;
  background: linear-gradient(135deg, #0b9dcc 0%, #003d8e 40%, #052544 100%);
  color: #fff;
  border: none;
  overflow: hidden;
}

.dashboard-home-hero .card-body {
  padding: 1.75rem 1.75rem 1.5rem;
}

.dashboard-home-hero h1 {
  font-size: 1.4rem;
  letter-spacing: 0.01em;
  color: #00274E;
}

.dashboard-home-hero p {
  color: #00274E;
}

.dashboard-home-hero .btn-primary {
  background-color: #ebca9f;
  border-color: #ebca9f;
  color: #1f2933;
  font-weight: 600;
}

.dashboard-home-hero .btn-primary:hover {
  background-color: #f4d8b6;
  border-color: #f4d8b6;
}

.dashboard-home-hero .btn-link {
  color: #f9fafb;
}

.dashboard-home-hero-badge {
  font-size: .78rem;
  max-width: 220px;
  text-align: right;
  color: rgba(255, 255, 255, 0.75);
}

/* Plan card */

.dashboard-home-plan.card {
  border-radius: 16px;
  border: 1px solid #e5e7eb;
}

.dashboard-home-plan .card-body {
  padding: 1.25rem 1.4rem;
}

.dashboard-home-plan-title {
  font-size: .9rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #6b7280;
}

.dashboard-home-plan-current {
  font-size: .95rem;
  font-weight: 600;
}

.dashboard-home-plan-usage {
  font-size: .8rem;
  color: #6b7280;
}

.dashboard-home-plan .progress {
  height: 8px;
  border-radius: 999px;
  background-color: #e5e7eb;
}

.dashboard-home-plan .progress-bar {
  border-radius: 999px;
  background: linear-gradient(90deg, #0b9dcc 0%, #003d8e 100%);
}

/* Onboarding */

.dashboard-home-onboarding {
  border-radius: 16px;
  border: 1px solid rgba(11, 157, 204, 0.35);
  background: linear-gradient(135deg, #ecf5fb 0%, #ffffff 60%);
}

.dashboard-home-onboarding h2 {
  font-size: .95rem;
}

.dashboard-home-onboarding li {
  padding: .15rem 0;
}

/* Servicios */

.dashboard-home-services.card {
  border-radius: 16px;
  border: 1px solid #e5e7eb;
}

.dashboard-home-services .card-body {
  padding: 1.4rem 1.5rem 1.25rem;
}

.dashboard-home-services-subtitle {
  font-size: .85rem;
  color: #6b7280;
}

.dashboard-home-service-tile {
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  background-color: #f9fafb;
  transition: box-shadow .15s ease, transform .12s ease, border-color .15s ease, background-color .15s ease;
}

.dashboard-home-service-tile:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.09);
  border-color: #0b9dcc;
  background-color: #ffffff;
}

.dashboard-home-service-tile h3 {
  font-size: .9rem;
}

.dashboard-home-service-tile p {
  font-size: .8rem;
  color: #6b7280;
}

/* Estudios recientes */

.dashboard-home-recent.card {
  border-radius: 16px;
  border: 1px solid #e5e7eb;
}

.dashboard-home-recent .card-body {
  padding: 1.25rem 1.5rem 1rem;
}

.dashboard-home-recent-title {
  font-size: .95rem;
}

.dashboard-home-recent-item {
  font-size: .85rem;
}

.dashboard-home-recent-item .small {
  font-size: .78rem;
}

/* Botón link "Ver todos mis PDFs" */

.dashboard-home-link {
  font-size: .82rem;
}

/* Responsive tweaks */

@media (max-width: 768px) {
  .dashboard-home-hero .card-body {
    padding: 1.2rem 1.1rem 1.1rem;
  }

  .dashboard-home-hero h1 {
    font-size: 1.15rem;
  }

  .dashboard-home-root {
    padding-inline: .5rem;
  }
}

/* ───────── Ajustes responsive fuertes (añadir al final) ───────── */

/* ≤ 992px: sidebar arriba, menos padding lateral, home a ancho completo */
@media (max-width: 992px) {
  html.dash-mode .dash-shell {
    padding-block: 16px 28px;
    padding-inline: 16px;
    /* antes 24/48, demasiado en móvil */
  }

  html.dash-mode .dash-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  html.dash-mode .dash-sidebar {
    position: static;
  }

  html.dash-mode .dash-sidebar-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-right: none;
    border-bottom: 1px solid #e2e8f0;
    padding-inline: 8px;
  }

  html.dash-mode .dash-nav {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  html.dash-mode .dash-tab {
    white-space: nowrap;
    padding-inline: 10px;
  }

  /* Home centrada pero sin max-width agresivo */
  .dashboard-home-content {
    max-width: 100%;
    padding-inline: 0.75rem;
  }

  html.dash-mode .dash-main-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}

/* ≤ 768px: cards apiladas y botones a ancho completo donde tiene sentido */
@media (max-width: 768px) {

  /* Hero */
  .dashboard-home-hero .card-body {
    padding: 1.2rem 1.1rem 1.1rem;
  }

  .dashboard-home-hero h1 {
    font-size: 1.15rem;
  }

  /* Card de plan: botones debajo y full width */
  .dashboard-home-plan .card-body {
    flex-direction: column;
    align-items: flex-start;
  }

  .dashboard-home-plan .card-body>.d-flex {
    width: 100%;
  }

  .dashboard-home-plan .card-body .btn {
    width: 100%;
  }

  /* Servicios: un poco menos de padding */
  .dashboard-home-services .card-body {
    padding: 1.1rem 1rem 1rem;
  }

  /* Tiles de servicios: margen entre ellas en mobile */
  .dashboard-home-service-tile {
    margin-bottom: 0.25rem;
  }

  /* Onboarding: texto más compacto */
  .dashboard-home-onboarding .card-body {
    padding: 1rem 1rem 0.9rem;
  }

  /* Cabeceras de sección en general */
  html.dash-mode .dash-main-title {
    font-size: 1.1rem;
  }

  html.dash-mode .dash-main-subtitle {
    font-size: 0.9rem;
  }

  /* Brand card (perfil) vertical */
  html.dash-mode .brand-card {
    flex-direction: column;
  }
}

/* ≤ 576px: toolbar en columna y tablas scrollables */
@media (max-width: 576px) {
  html.dash-mode .dash-shell {
    padding-inline: 12px;
    padding-block: 12px 24px;
  }

  .dashboard-home-content {
    padding-inline: 0.5rem;
  }

  .dashboard-home-recent .card-body {
    padding: 1rem;
  }

  /* Toolbar de PDFs/Facturas en columna */
  html.dash-mode .pdfs-toolbar,
  html.dash-mode .inv-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  html.dash-mode .pdfs-toolbar .form-control,
  html.dash-mode .pdfs-toolbar .form-select,
  html.dash-mode .inv-toolbar .form-control,
  html.dash-mode .inv-toolbar .form-select {
    max-width: 100%;
  }

  /* Tablas con scroll horizontal */
  html.dash-mode .table-responsive {
    overflow-x: auto;
  }

  html.dash-mode table.table {
    min-width: 540px;
  }

  /* Botones de servicios a ancho completo */
  .dashboard-home-service-tile .btn {
    width: 100%;
  }
}

/* ───────── Sidebar como “drawer” en móvil ───────── */

@media (max-width: 768px) {
  html.dash-mode .dash-layout {
    grid-template-columns: 1fr;
    /* solo contenido, sin segunda columna fija */
  }

  html.dash-mode .dash-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 240px;
    transform: translateX(-100%);
    transition: transform 0.18s ease-out;
    background: #f8fafc;
    z-index: 900;
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.35);
    padding-top: 16px;
  }

  html.dash-mode .dash-sidebar-inner {
    border-right: none;
    border-bottom: none;
    height: 100%;
    padding: 16px 14px 24px 10px;
  }

  /* Cuando se abre desde JS */
  html.dash-mode .dash-sidebar.dash-sidebar--open {
    transform: translateX(0);
  }

  /* El main ocupa toda la pantalla */
  html.dash-mode .dash-main {
    min-width: 0;
  }

  /* Nav en columna (sin scroll horizontal de tabs) */
  html.dash-mode .dash-nav {
    flex-direction: column;
    overflow-x: visible;
  }
}

/* Home: buen comportamiento en móvil */

@media (max-width: 768px) {
  .dashboard-home-content {
    max-width: 100%;
    margin: 0;
    padding: 0 0.75rem 2.5rem;
  }

  .dashboard-home-hero .card-body {
    padding: 1.2rem 1.1rem 1.1rem;
  }

  .dashboard-home-plan .card-body {
    flex-direction: column;
    align-items: flex-start;
  }

  .dashboard-home-plan .card-body .btn {
    width: 100%;
  }

  .dashboard-home-services .card-body {
    padding: 1.1rem 1rem 1rem;
  }

  .dashboard-home-recent .card-body {
    padding: 1rem;
  }
}

/* Fondo más limpio en móvil: sin mancha lateral */
@media (max-width: 768px) {
  html.dash-mode .dash-shell {
    background: #f3f4f8;
    /* color liso, sin degradados raros */
  }
}

/* Header del dashboard en móvil: botón menú alineado a la derecha */
@media (max-width: 768px) {
  html.dash-mode .dash-main-header {
    position: relative;
    padding-right: 3rem;
    /* deja espacio para el botón */
    align-items: center;
  }

  html.dash-mode #dashMenuToggle {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
  }
}

/* ───────── Home: KPIs + Grid + Recientes SaaS ───────── */

/* ───── DASHBOARD HOME LAYOUT ───── */
html.dash-mode .dash-home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
  align-items: start;
}


@media (max-width: 992px) {
  html.dash-mode .dash-home-grid {
    grid-template-columns: 1fr;
  }
}

/* KPIs (si aún no los tenías definidos) */
html.dash-mode .dash-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 992px) {
  html.dash-mode .dash-kpis {
    grid-template-columns: 1fr;
  }
}

html.dash-mode .dash-kpi {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
}

html.dash-mode .dash-kpi__label {
  font-size: .78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
}

html.dash-mode .dash-kpi__value {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--ink);
  margin-top: 4px;
}

/* Recientes: lista estilo SaaS (sin list-group bootstrap) */
html.dash-mode .dash-recent-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

html.dash-mode .dash-recent-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}

html.dash-mode .dash-recent-title {
  font-weight: 600;
  font-size: .9rem;
  max-width: 560px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

html.dash-mode .dash-recent-meta {
  font-size: .78rem;
  color: var(--muted);
  margin-top: 2px;
}

/* Pills estado */
html.dash-mode .dash-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: .72rem;
  border: 1px solid var(--border);
  background: #f8fafc;
  color: #374151;
}

html.dash-mode .dash-pill--ok {
  border-color: rgba(22, 163, 74, .25);
  background: rgba(22, 163, 74, .08);
  color: #166534;
}

/* Eliminado el override que rompía la responsividad */

html.dash-mode .dashboard-home-hero .card-body {
  padding: 16px 18px;
}

html.dash-mode .dashboard-home-hero h1 {
  font-size: 1.25rem;
}

html.dash-mode .dashboard-home-hero p {
  max-width: 68ch;
}

html.dash-mode .dashboard-home-service-tile {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}

html.dash-mode .dashboard-home-service-tile:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

/* ==========================
   PREMIUM / LUXE OVERRIDE
   PON ESTO AL FINAL
   ========================== */

html.dash-mode,
html.dash-mode body {
  --bg: #fffefd;
  --surface: #ffffff;
  --border: rgba(15, 23, 42, .10);
  /* hairline */
  --shadow-sm: 0 10px 30px rgba(15, 23, 42, .06);
  --shadow-xs: 0 6px 18px rgba(15, 23, 42, .05);
}

/* Fondo más “hotel” y menos “SaaS barato” */
html.dash-mode .dash-shell {
  background:
    radial-gradient(900px 600px at 15% -10%, rgba(203, 160, 82, .18), transparent 60%),
    radial-gradient(900px 600px at 90% 0%, rgba(0, 39, 78, .10), transparent 55%),
    linear-gradient(180deg, var(--bg), #f3f0e9);
}

/* Cards: menos borde, más aire, sombra fina */
html.dash-mode .card {
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
  border-radius: 16px;
}

html.dash-mode .card .card-body {
  padding: 18px 20px;
}

/* Títulos: más “premium” */
html.dash-mode h1,
html.dash-mode .dash-main-title {
  letter-spacing: -0.02em;
}

html.dash-mode .dashboard-home-hero h1 {
  font-size: 1.35rem;
  font-weight: 700;
}

/* Botones: pill + borde fino */
html.dash-mode .btn {
  border-radius: 999px;
}

html.dash-mode .btn-primary {
  background: linear-gradient(180deg, #d6b36a, #cba052);
  border-color: rgba(0, 0, 0, 0);
  color: #0f172a;
  font-weight: 700;
}

html.dash-mode .btn-primary:hover {
  filter: brightness(1.03);
}

html.dash-mode .btn-outline-secondary,
html.dash-mode .btn-outline-primary {
  border-color: rgba(15, 23, 42, .18);
}

/* Sidebar: menos “lista” y más “hotel lobby” */
html.dash-mode .dash-sidebar-inner {
  background: rgba(255, 255, 255, .55);
  backdrop-filter: blur(10px);
  border-right: 1px solid rgba(15, 23, 42, .08);
}

/* Tab activo: subrayado dorado fino (lujo) */
html.dash-mode .dash-tab[aria-current="page"]::before,
html.dash-mode .dash-tab[aria-selected="true"]::before {
  width: 3px;
  background: linear-gradient(180deg, #e3c27a, #cba052);
}

/* KPI: que parezca “widget premium” */
/* KPIs con responsividad real */
html.dash-mode .dash-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

@media (max-width: 992px) {
  html.dash-mode .dash-kpis {
    grid-template-columns: 1fr;
  }
}

html.dash-mode .dash-kpi {
  background: rgba(255, 255, 255, .72);
  border: 1px solid rgba(15, 23, 42, .08);
  box-shadow: var(--shadow-xs);
  border-radius: 14px;
  padding: 14px 16px;
}

html.dash-mode .dash-kpi__label {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: rgba(15, 23, 42, .55);
}

html.dash-mode .dash-kpi__value {
  font-size: 1.25rem;
  font-weight: 750;
  color: #0f172a;
}

/* Hero: deja de ser “card blanca” y hazlo una pieza premium */
html.dash-mode .dashboard-home-hero {
  background:
    radial-gradient(700px 240px at 12% 0%, rgba(203, 160, 82, .22), transparent 60%),
    linear-gradient(180deg, rgba(255, 255, 255, .92), rgba(255, 255, 255, .75));
  border: 1px solid rgba(15, 23, 42, .08);
}

/* Listas: menos bordes, más separación */
html.dash-mode .list-group-item {
  border-color: rgba(15, 23, 42, .08) !important;
}

.dashboard-home-hero .card-body {
  padding: 14px 18px;
}

.dashboard-home-hero h1 {
  font-size: 1.15rem;
}

.dashboard-home-hero p {
  font-size: 0.85rem;
  opacity: .85;
}

.dashboard-home-recent.card {
  border: none;
  box-shadow: var(--shadow-sm);
}

.dashboard-home-recent .list-group-item {
  border: none;
  border-bottom: 1px solid rgba(15, 23, 42, .06);
}

.dashboard-home-plan .progress-bar {
  background: #cbd5e1;
  /* gris */
}

.dash-sidebar-inner {
  background: rgba(255, 255, 255, .45);
  backdrop-filter: blur(12px);
}

.dash-tab {
  font-weight: 500;
}

.dash-tab[aria-current="page"] {
  font-weight: 600;
}

/* ==========================
   DASH LUXE MODE (source of truth)
   Activa con: <html class="dash-mode dash-luxe">
   ========================== */

html.dash-mode.dash-luxe,
html.dash-mode.dash-luxe body {
  --brand: #00274E;
  --accent: #CBA052;

  --bg: #F7F4EE;
  /* marfil */
  --surface: rgba(255, 255, 255, .92);
  --ink: #0F172A;
  --muted: rgba(15, 23, 42, .60);

  --border: rgba(15, 23, 42, .10);

  --radius-sm: 10px;
  --radius: 16px;

  --shadow-1: 0 10px 30px rgba(15, 23, 42, .06);
  --shadow-2: 0 18px 60px rgba(15, 23, 42, .10);

  --ring: 0 0 0 3px rgba(203, 160, 82, .22);
}

/* Background “hotel lobby” */
html.dash-mode.dash-luxe .dash-shell {
  background:
    radial-gradient(900px 600px at 15% -10%, rgba(203, 160, 82, .18), transparent 60%),
    radial-gradient(900px 600px at 90% 0%, rgba(0, 39, 78, .10), transparent 55%),
    linear-gradient(180deg, var(--bg), #F3F0E9);
}

/* Cards */
html.dash-mode.dash-luxe .card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
}

html.dash-mode.dash-luxe .card .card-body {
  padding: 18px 20px;
}

/* Sidebar cristal */
html.dash-mode.dash-luxe .dash-sidebar-inner {
  background: rgba(255, 255, 255, .55);
  backdrop-filter: blur(10px);
  border-right: 1px solid rgba(15, 23, 42, .08);
  box-shadow: none;
}

/* Hero claro premium */
html.dash-mode.dash-luxe .dashboard-home-hero {
  background:
    radial-gradient(700px 240px at 12% 0%, rgba(203, 160, 82, .22), transparent 60%),
    linear-gradient(180deg, rgba(255, 255, 255, .92), rgba(255, 255, 255, .75));
  color: var(--ink);
  border: 1px solid rgba(15, 23, 42, .08);
}

html.dash-mode.dash-luxe .dashboard-home-hero h1,
html.dash-mode.dash-luxe .dashboard-home-hero p {
  color: var(--ink);
}

html.dash-mode.dash-luxe .dashboard-home-hero p {
  opacity: .78;
}

/* Buttons */
html.dash-mode.dash-luxe .btn {
  border-radius: 999px;
}

html.dash-mode.dash-luxe .btn-primary {
  background: linear-gradient(180deg, #D6B36A, var(--accent));
  border-color: transparent;
  color: #0F172A;
  font-weight: 700;
}

html.dash-mode.dash-luxe .btn-outline-secondary,
html.dash-mode.dash-luxe .btn-outline-primary {
  border-color: rgba(15, 23, 42, .18);
}

/* Progress neutra */
html.dash-mode.dash-luxe .progress {
  background: rgba(15, 23, 42, .10);
}

html.dash-mode.dash-luxe .progress-bar {
  background: rgba(15, 23, 42, .25);
}

/* Active indicator */
html.dash-mode.dash-luxe .dash-tab[aria-current="page"]::before,
html.dash-mode.dash-luxe .dash-tab[aria-selected="true"]::before {
  background: linear-gradient(180deg, #E3C27A, var(--accent));
}

/* Focus */
html.dash-mode.dash-luxe :is(a, button, input, select, textarea, [role="tab"]):focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

/* Typography: serif SOLO títulos */
html.dash-mode.dash-luxe h1,
html.dash-mode.dash-luxe h2,
html.dash-mode.dash-luxe h3,
html.dash-mode.dash-luxe .dash-main-title,
html.dash-mode.dash-luxe .dashboard-home-hero h1,
html.dash-mode.dash-luxe .price-card .price-name,
html.dash-mode.dash-luxe .price-card .price-val {
  font-family: var(--dash-serif);
  font-weight: 600;
  letter-spacing: -0.01em;
}

html.dash-mode.dash-luxe h1 {
  font-size: 1.55rem;
  line-height: 1.15;
}

html.dash-mode.dash-luxe h2 {
  line-height: 1.2;
}

/* Texto UI sigue sans */
html.dash-mode.dash-luxe :is(p, span, li, td, th, label, input, button, .btn) {
  font-family: var(--dash-font);
}

/* ───────── FINAL RESPONSIVE POLISH ───────── */

/* ───────── MOBILE NAV & HEADER REDESIGN ───────── */

@media (max-width: 768px) {

  /* Header Fijo y Elegante */
  html.dash-mode .dash-main-header {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(15, 23, 42, 0.05);
    padding: 0 16px !important;
    margin: -16px -12px 16px -12px !important;
    /* Más margen arriba para despegar de la muesca */
    height: 70px;
    /* Un pelín más alto para aire */
    display: flex;
    flex-direction: row !important;
    /* Forzar fila */
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  }

  html.dash-mode #dashHeaderTitle {
    font-size: 1.05rem !important;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--brand);
    margin: 0;
    white-space: nowrap;
  }

  /* Logo en header móvil: balanceado */
  html.dash-mode .dash-main-header img {
    height: 24px !important;
    /* Más pequeño para que no agobie */
    width: auto;
    object-fit: contain;
    margin-right: 4px;
  }

  /* Selector de idioma en header móvil: compacto */
  .lang-switcher-dash select {
    border: 1px solid rgba(15, 23, 42, 0.08);
    background-color: rgba(248, 250, 252, 0.9);
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.7rem !important;
    color: var(--brand);
    padding: 4px 20px 4px 8px !important;
  }



  /* Ocultar sidebar en móvil (se accede por Bottom Nav o Menú) */
  html.dash-mode .dash-sidebar {
    display: none !important;
  }

  /* Bottom Navigation Style */
  .dash-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 65px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 1001;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
  }

  .dash-bottom-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.65rem;
    font-weight: 500;
    gap: 4px;
    flex: 1;
    transition: color 0.2s ease;
  }

  .dash-bottom-item svg {
    width: 22px;
    height: 22px;
  }

  .dash-bottom-item.active {
    color: var(--brand);
    font-weight: 700;
  }

  .dash-bottom-item.active svg {
    stroke-width: 2.5;
  }


  /* Centro FAB en Bottom Nav */
  .dash-bottom-item--fab {
    margin-top: -30px;
  }

  .dash-bottom-fab-inner {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, #d6b36a, #cba052);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 6px 20px rgba(203, 160, 82, 0.4);
    border: 3px solid #fff;
  }

  .dash-bottom-fab-inner svg {
    width: 24px;
    height: 24px;
    stroke-width: 2.5;
  }

  /* Ajuste de padding inferior para el contenido para que no lo tape la nav */
  html.dash-mode .dash-shell {
    padding-inline: 16px !important;
    /* Más margen para que no se pegue a los bordes */
    padding-block: 10px 40px !important;
    padding-bottom: 90px !important;
    overflow-x: hidden;
    /* Evita scroll horizontal fantasma */
  }

  /* Evitar recortes en los items de estudios recientes */
  html.dash-mode .dash-recent-item {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px;
    padding: 14px 16px;
  }

  html.dash-mode .dash-recent-actions {
    text-align: right;
    border-top: 1px solid rgba(15, 23, 42, 0.05);
    padding-top: 8px;
    margin-top: 4px;
  }

  html.dash-mode .dash-recent-title {
    max-width: 100%;
    /* Permitir que ocupe todo el ancho */
    white-space: normal;
    /* Permitir envolver si es necesario */
    word-break: break-all;
  }

  /* Servicios: evitar que se corten */
  html.dash-mode .dashboard-home-services .card-body {
    padding: 16px 12px !important;
  }

  html.dash-mode .dashboard-home-services h2 {
    font-size: 1.1rem !important;
    line-height: 1.3;
  }

  /* Ocultar el botón original flotante ya que ahora está en la nav */
  #btnNewStudyMobile {
    display: none !important;
  }
}


@media (max-width: 576px) {
  html.dash-mode .dash-kpis {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  /* El tercer KPI (Plan) ocupará toda la fila si hay impar */
  html.dash-mode .dash-kpis .dash-kpi:last-child {
    grid-column: span 2;
  }

  html.dash-mode .dash-kpi {
    padding: 10px 12px;
  }

  html.dash-mode .dash-kpi__value {
    font-size: 1.15rem;
  }

  html.dash-mode .card-body {
    padding: 16px 14px !important;
  }

  /* Hero más profesional */
  html.dash-mode .dashboard-home-hero {
    margin-bottom: 1.25rem !important;
    border-radius: 20px !important;
  }

  html.dash-mode .dashboard-home-hero h1 {
    font-size: 1.2rem !important;
    line-height: 1.25;
  }
}