/*
  LuckHaus 14.0.1 - Global readability correction.
  Presentation only. No business logic, API or database changes.
*/

html {
  font-size: 17px !important;
  -webkit-text-size-adjust: 100% !important;
  text-size-adjust: 100% !important;
}

body {
  font-size: 17px !important;
  line-height: 1.58 !important;
}

body :where(
  p,
  li,
  label,
  input,
  select,
  textarea,
  button,
  .btn,
  td,
  th,
  summary,
  option
) {
  font-size: 17px !important;
  line-height: 1.45 !important;
}

body :where(
  nav,
  nav a,
  .nav,
  .nav a,
  .nav-link,
  .sidebar,
  .sidebar a,
  .topbar,
  .topbar a,
  .menu,
  .menu a,
  .dropdown-menu,
  .dropdown-menu a,
  .tabs,
  .tabs a,
  .pagination,
  .pagination a
) {
  font-size: 16px !important;
}

body main span:not([class*="icon"]):not([aria-hidden="true"]),
body .card span:not([class*="icon"]):not([aria-hidden="true"]),
body .panel span:not([class*="icon"]):not([aria-hidden="true"]),
body .form-group span:not([class*="icon"]):not([aria-hidden="true"]),
body .field span:not([class*="icon"]):not([aria-hidden="true"]) {
  font-size: 16px !important;
  line-height: 1.45 !important;
}

body :where(
  small,
  .small,
  .text-small,
  .muted,
  .help-text,
  .form-help,
  .hint,
  .caption,
  .eyebrow,
  .kicker,
  .meta
) {
  font-size: 15px !important;
  line-height: 1.42 !important;
}

body :where(.badge, .pill, .status, .tag, .chip) {
  font-size: 14px !important;
  line-height: 1.3 !important;
}

body h1 {
  font-size: clamp(29px, 2.7vw, 36px) !important;
  line-height: 1.14 !important;
}

body h2 {
  font-size: clamp(25px, 2.2vw, 31px) !important;
  line-height: 1.18 !important;
}

body h3 {
  font-size: clamp(22px, 1.8vw, 26px) !important;
  line-height: 1.22 !important;
}

body h4,
body h5,
body h6 {
  font-size: clamp(19px, 1.35vw, 23px) !important;
  line-height: 1.28 !important;
}

body input,
body select,
body textarea,
body button,
body .btn {
  min-height: 48px !important;
}

body table,
body .table-responsive {
  line-height: 1.42 !important;
}

body th,
body td {
  padding-top: 12px !important;
  padding-bottom: 12px !important;
}

.public-how-to-pay-compact {
  width: min(100%, 640px) !important;
  margin: 12px auto 16px !important;
  padding: 14px 16px !important;
  gap: 8px !important;
  border-radius: 16px !important;
}

.public-how-to-pay-compact :where(h1, h2, h3, h4) {
  margin-top: 0 !important;
  margin-bottom: 7px !important;
  font-size: 22px !important;
  line-height: 1.2 !important;
}

.public-how-to-pay-compact :where(p, li, span) {
  margin-top: 4px !important;
  margin-bottom: 4px !important;
  font-size: 16px !important;
  line-height: 1.38 !important;
}

.public-plin-payment-card,
.public-plin-payment-card--compact {
  width: min(100%, 560px) !important;
  margin: 12px auto 18px !important;
  padding: 16px 18px !important;
  border-width: 2px !important;
  border-radius: 18px !important;
  box-shadow:
    0 12px 30px rgba(22, 92, 145, 0.16),
    0 0 0 4px rgba(35, 134, 216, 0.07) !important;
}

.public-plin-payment-card__header {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  margin-bottom: 8px !important;
}

.public-plin-payment-card__logo {
  width: 62px !important;
  min-width: 62px !important;
  height: 46px !important;
  font-size: 24px !important;
}

.public-plin-payment-card__title {
  margin: 0 !important;
  font-size: 27px !important;
  line-height: 1.15 !important;
}

.public-plin-payment-card__label {
  margin: 7px 0 2px !important;
  font-size: 15px !important;
  line-height: 1.2 !important;
}

.public-plin-payment-card__number {
  margin: 0 0 5px !important;
  font-size: 40px !important;
  line-height: 1.05 !important;
  letter-spacing: 0.035em !important;
}

.public-plin-payment-card__holder {
  margin: 0 !important;
  font-size: 20px !important;
  line-height: 1.25 !important;
}

.public-plin-payment-card__warning {
  margin: 10px 0 0 !important;
  padding: 8px 10px !important;
  font-size: 15px !important;
  line-height: 1.35 !important;
  border-radius: 11px !important;
}

@media (min-width: 1100px) {
  html,
  body {
    font-size: 17px !important;
  }

  body :where(
    p,
    li,
    label,
    input,
    select,
    textarea,
    button,
    .btn,
    td,
    th,
    summary,
    option
  ) {
    font-size: 17px !important;
  }

  body main span:not([class*="icon"]):not([aria-hidden="true"]),
  body .card span:not([class*="icon"]):not([aria-hidden="true"]),
  body .panel span:not([class*="icon"]):not([aria-hidden="true"]) {
    font-size: 16px !important;
  }
}

@media (max-width: 768px) {
  html,
  body {
    font-size: 18px !important;
  }

  body :where(
    p,
    li,
    label,
    input,
    select,
    textarea,
    button,
    .btn,
    td,
    th,
    summary,
    option
  ) {
    font-size: 18px !important;
  }

  body main span:not([class*="icon"]):not([aria-hidden="true"]),
  body .card span:not([class*="icon"]):not([aria-hidden="true"]),
  body .panel span:not([class*="icon"]):not([aria-hidden="true"]) {
    font-size: 17px !important;
  }

  body h1 {
    font-size: 30px !important;
  }

  body h2 {
    font-size: 26px !important;
  }

  body h3 {
    font-size: 23px !important;
  }

  .public-how-to-pay-compact {
    margin: 9px 0 13px !important;
    padding: 12px 13px !important;
  }

  .public-plin-payment-card,
  .public-plin-payment-card--compact {
    width: 100% !important;
    margin: 9px 0 15px !important;
    padding: 14px 12px !important;
  }

  .public-plin-payment-card__header {
    gap: 8px !important;
  }

  .public-plin-payment-card__logo {
    width: 54px !important;
    min-width: 54px !important;
    height: 40px !important;
    font-size: 21px !important;
  }

  .public-plin-payment-card__title {
    font-size: 23px !important;
  }

  .public-plin-payment-card__number {
    font-size: 33px !important;
    letter-spacing: 0.02em !important;
  }

  .public-plin-payment-card__holder {
    font-size: 18px !important;
  }
}

/* Mobile remains exactly at the approved LuckHaus 14.0.1 level. */
@media (max-width: 768px) {
  body :where(
    nav, nav a, .nav, .nav a, .nav-link,
    .sidebar, .sidebar a, .topbar, .topbar a,
    .menu, .menu a, .dropdown-menu, .dropdown-menu a,
    .tabs, .tabs a, .pagination, .pagination a
  ) {
    font-size: 17px !important;
  }

  body :where(
    small, .small, .text-small, .muted, .help-text,
    .form-help, .hint, .caption, .eyebrow, .kicker, .meta
  ) {
    font-size: 16px !important;
    line-height: 1.42 !important;
  }

  body :where(.badge, .pill, .status, .tag, .chip) {
    font-size: 15px !important;
  }

  body h4, body h5, body h6 {
    font-size: clamp(20px, 1.5vw, 24px) !important;
  }
}

/* ============================================================
   LuckHaus 14.0.1 · Fase 14
   Visual + responsive + rendimiento seguro
   Scope: presentación únicamente. Sin cambios de lógica, rutas o DB.
   ============================================================ */

:root {
  --lh14-font-body: 14px;
  --lh14-font-secondary: 13px;
  --lh14-font-nav: 14px;
  --lh14-font-subnav: 13px;
  --lh14-font-control: 14px;
  --lh14-font-table: 13px;
  --lh14-font-badge: 12px;
  --lh14-title-page: 24px;
  --lh14-title-section: 18px;
  --lh14-title-card: 16px;
  --lh14-kpi: 26px;
  --lh14-radius: 14px;
  --lh14-radius-sm: 10px;
  --lh14-gap: 14px;
  --lh14-pad: 16px;
  --lh14-sidebar: 252px;
  --lh14-control-height: 40px;
  --lh14-shadow: 0 8px 24px rgba(15, 23, 42, .07);
}

html {
  font-size: 16px !important;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body,
body.luckhaus-theme {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  font-size: var(--lh14-font-body) !important;
  line-height: 1.45 !important;
  letter-spacing: 0 !important;
}

body :where(p, li, dd, dt, label, td, th, input, select, textarea, button, a) {
  line-height: 1.4;
}

body :where(small, .small, .tiny, .muted, .help-text, .form-help, .hint, .caption, .meta) {
  font-size: var(--lh14-font-secondary) !important;
  line-height: 1.4 !important;
}

body :where(.badge, .pill, .status, .tag, .chip, .nav-count, .bingo-status-badge, .dashboard-module-status) {
  font-size: var(--lh14-font-badge) !important;
  line-height: 1.2 !important;
}

body :where(h1, .page-heading h1, .page-title) {
  font-size: var(--lh14-title-page) !important;
  line-height: 1.16 !important;
  letter-spacing: -.02em !important;
}

body :where(h2, .section-title, .home-section-head h2, .dashboard-module-head h2) {
  font-size: var(--lh14-title-section) !important;
  line-height: 1.2 !important;
  letter-spacing: -.015em !important;
}

body :where(h3, .card h3, .panel-card h3, .settings-card h3, .workspace-panel h3) {
  font-size: var(--lh14-title-card) !important;
  line-height: 1.25 !important;
}

body :where(h4, h5, h6) {
  font-size: 15px !important;
  line-height: 1.3 !important;
}

body :where(.eyebrow, .kicker, .nav-section-caption) {
  font-size: 11px !important;
  line-height: 1.2 !important;
  letter-spacing: .08em !important;
}

/* Shell y navegación: misma funcionalidad, menor densidad visual. */
.app-shell {
  min-width: 0;
}

.sidebar,
.organized-sidebar {
  width: var(--lh14-sidebar) !important;
  min-width: var(--lh14-sidebar) !important;
}

.sidebar-head {
  padding: 14px 14px 12px !important;
}

.luckhaus-brand {
  gap: 10px !important;
}

.luckhaus-brand img {
  width: 38px !important;
  height: 38px !important;
}

.luckhaus-brand strong {
  font-size: 15px !important;
  line-height: 1.2 !important;
}

.luckhaus-brand small {
  font-size: 11.5px !important;
}

.side-nav,
.organized-nav,
.role-navigation {
  font-size: var(--lh14-font-nav) !important;
  padding-inline: 10px !important;
}

.nav-section-caption {
  margin: 14px 8px 6px !important;
}

.nav-section-spaced {
  margin-top: 16px !important;
}

.nav-primary,
.nav-group > summary,
.nav-submenu > a,
.more-group > summary,
.more-group a {
  min-height: 38px !important;
  border-radius: 9px !important;
}

.nav-primary,
.nav-group > summary {
  font-size: var(--lh14-font-nav) !important;
  padding: 9px 10px !important;
  gap: 9px !important;
}

.nav-primary em,
.nav-primary small,
.nav-group > summary small {
  font-size: 11.5px !important;
}

.nav-submenu {
  padding-block: 3px 5px !important;
}

.nav-submenu > a,
.more-group a {
  font-size: var(--lh14-font-subnav) !important;
  padding: 8px 10px 8px 34px !important;
  gap: 8px !important;
}

/* Contenido: más área útil y jerarquía compacta. */
main,
#mainContent,
.main-content,
.page-content,
.workspace-shell {
  min-width: 0;
}

.page-heading,
.home-section-head,
.dashboard-module-head,
.wizard-panel-heading {
  gap: 10px !important;
}

.page-heading {
  margin-bottom: 14px !important;
}

.card,
.panel,
.panel-card,
.workspace-panel,
.settings-panel,
.settings-card,
.wizard-panel,
.bingo-manage-card,
.readiness-card,
.public-module-panel,
.dashboard-module {
  border-radius: var(--lh14-radius) !important;
  box-shadow: var(--lh14-shadow) !important;
}

.card,
.panel-card,
.workspace-panel,
.settings-panel,
.settings-card,
.wizard-panel,
.bingo-manage-card,
.readiness-card,
.public-module-panel {
  padding: var(--lh14-pad) !important;
}

.dashboard-module {
  padding: 16px !important;
}

.dashboard-module-current,
.dashboard-module-metrics,
.dashboard-module-actions,
.dashboard-control-grid,
.dashboard-today-grid,
.home-control-grid,
.form-grid,
.bingo-form-grid,
.flyer-grid-preset {
  gap: var(--lh14-gap) !important;
}

.dashboard-module-current strong,
.dashboard-primary-sale strong,
.dashboard-module-actions strong,
.dashboard-control-grid strong,
.home-control-card strong {
  font-size: 14px !important;
  line-height: 1.25 !important;
}

.dashboard-module-current > b,
.dashboard-module-metrics strong,
.dashboard-today-module b,
.kpi,
.metric-value,
.stat-value {
  font-size: var(--lh14-kpi) !important;
  line-height: 1.05 !important;
}

.dashboard-primary-sale {
  padding: 13px 14px !important;
  border-radius: 12px !important;
  gap: 12px !important;
}

.dashboard-primary-sale p,
.dashboard-module-actions small,
.dashboard-control-grid small,
.home-control-card small {
  font-size: 12.5px !important;
  line-height: 1.35 !important;
}

.dashboard-module-actions > a,
.dashboard-module-actions > button,
.dashboard-control-grid > a,
.home-control-card {
  padding: 12px 13px !important;
  min-height: 62px !important;
  border-radius: 11px !important;
}

.dashboard-control-grid,
.home-control-grid {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)) !important;
}

.dashboard-today-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

/* Formularios y acciones. */
body :where(input, select, textarea) {
  font-size: var(--lh14-font-control) !important;
  min-height: var(--lh14-control-height) !important;
  border-radius: 9px !important;
}

body textarea {
  min-height: 92px !important;
}

body :where(.btn, button:not(.sidebar-close):not(.modal-close):not(.icon-button)) {
  font-size: var(--lh14-font-control) !important;
  min-height: var(--lh14-control-height) !important;
  border-radius: 9px !important;
  line-height: 1.2 !important;
}

.form-grid,
.bingo-form-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)) !important;
}

.wizard-actions,
.bingo-form-actions,
.mobile-stacked-actions,
.sticky-wizard-actions {
  gap: 10px !important;
}

/* Tabs y subpaneles: compactos y sin perder acciones. */
.workspace-tabs,
.tabs {
  gap: 6px !important;
  overflow-x: auto;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.workspace-tabs .tab,
.tabs .tab,
.tabs a,
.tab {
  font-size: 13px !important;
  min-height: 36px !important;
  padding: 8px 11px !important;
  white-space: nowrap;
}

/* Tablas: más información visible en escritorio; scroll seguro en móvil. */
table {
  font-size: var(--lh14-font-table) !important;
  line-height: 1.35 !important;
}

table :where(th, td) {
  padding: 9px 10px !important;
}

table th {
  font-size: 12px !important;
  line-height: 1.25 !important;
}

.table-wrap,
.table-scroll,
.responsive-table,
.card:has(> table),
.panel:has(> table) {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.pagination,
.pagination a,
.pagination button {
  font-size: 13px !important;
}

/* Alertas, estados y modales. */
.inline-alert,
.empty-state,
.event-start-readiness {
  padding: 12px 14px !important;
  border-radius: 11px !important;
}

.modal-card {
  width: min(94vw, 720px) !important;
  max-height: min(90vh, 860px) !important;
  overflow: auto !important;
  padding: 18px !important;
  border-radius: 16px !important;
  box-shadow: 0 18px 50px rgba(15, 23, 42, .16) !important;
}

/* Portal público: tipografía compacta sin alterar el flujo de compra. */
body.role-public :where(.public-event-head h1, .public-module-panel h2) {
  font-size: 22px !important;
}

body.role-public :where(.public-checkout-step, .public-pick-help, .public-plin-payment-card__label) {
  font-size: 13px !important;
}

/* Rendimiento visual: menos efectos caros sin cambiar comportamiento. */
.sidebar,
.topbar,
.card,
.panel-card,
.workspace-panel,
.dashboard-module,
.modal-card {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

body :where(.card, .panel-card, .workspace-panel, .dashboard-module, .settings-card, .home-control-card) {
  transition-property: border-color, background-color, color, transform !important;
  transition-duration: 120ms !important;
}

@media (min-width: 1100px) {
  .dashboard-modules,
  .dashboard-module-grid,
  .dashboard-main-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 16px !important;
  }

  body :where(.workspace-panel, .settings-panel, .wizard-panel, .card) {
    scroll-margin-top: 72px;
  }
}

@media (max-width: 900px) {
  :root {
    --lh14-pad: 15px;
    --lh14-gap: 12px;
  }

  .dashboard-today-grid,
  .dashboard-modules,
  .dashboard-module-grid,
  .dashboard-main-grid {
    grid-template-columns: 1fr !important;
  }

  .dashboard-control-grid,
  .home-control-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important;
  }
}

@media (max-width: 768px) {
  :root {
    --lh14-font-body: 15px;
    --lh14-font-secondary: 14px;
    --lh14-font-nav: 15px;
    --lh14-font-subnav: 14px;
    --lh14-font-control: 15px;
    --lh14-font-table: 14px;
    --lh14-font-badge: 12px;
    --lh14-title-page: 20px;
    --lh14-title-section: 18px;
    --lh14-title-card: 16px;
    --lh14-kpi: 23px;
    --lh14-control-height: 44px;
    --lh14-pad: 14px;
    --lh14-gap: 11px;
  }

  body,
  body.luckhaus-theme {
    font-size: var(--lh14-font-body) !important;
  }

  .sidebar,
  .organized-sidebar {
    width: min(88vw, 320px) !important;
    min-width: 0 !important;
  }

  .side-nav,
  .organized-nav,
  .role-navigation,
  .nav-primary,
  .nav-group > summary {
    font-size: var(--lh14-font-nav) !important;
  }

  .nav-submenu > a,
  .more-group a {
    font-size: var(--lh14-font-subnav) !important;
    min-height: 42px !important;
  }

  body :where(input, select, textarea) {
    font-size: 16px !important;
    min-height: 44px !important;
  }

  body :where(.btn, button:not(.sidebar-close):not(.modal-close):not(.icon-button)) {
    font-size: 15px !important;
    min-height: 44px !important;
  }

  .page-heading,
  .home-section-head,
  .dashboard-module-head,
  .wizard-panel-heading {
    align-items: flex-start !important;
    gap: 8px !important;
  }

  .card,
  .panel-card,
  .workspace-panel,
  .settings-panel,
  .settings-card,
  .wizard-panel,
  .bingo-manage-card,
  .readiness-card,
  .public-module-panel,
  .dashboard-module {
    padding: 14px !important;
    border-radius: 12px !important;
    box-shadow: 0 5px 16px rgba(15, 23, 42, .06) !important;
  }

  .dashboard-control-grid,
  .home-control-grid,
  .dashboard-today-grid,
  .form-grid,
  .bingo-form-grid,
  .flyer-grid-preset {
    grid-template-columns: 1fr !important;
  }

  .dashboard-module-actions > a,
  .dashboard-module-actions > button,
  .dashboard-control-grid > a,
  .home-control-card {
    min-height: 58px !important;
    padding: 11px 12px !important;
  }

  .workspace-tabs,
  .tabs {
    margin-inline: -4px !important;
    padding: 2px 4px 6px !important;
  }

  .workspace-tabs .tab,
  .tabs .tab,
  .tabs a,
  .tab {
    font-size: 14px !important;
    min-height: 40px !important;
  }

  table {
    font-size: 14px !important;
    min-width: max-content;
  }

  table :where(th, td) {
    padding: 9px 9px !important;
  }

  .modal-card {
    width: calc(100vw - 20px) !important;
    max-height: calc(100dvh - 20px) !important;
    padding: 15px !important;
    border-radius: 14px !important;
  }

  body.role-public :where(.public-event-head h1, .public-module-panel h2) {
    font-size: 20px !important;
  }
}

@media (max-width: 430px) {
  .dashboard-primary-sale {
    padding: 12px !important;
  }

  .dashboard-module-metrics {
    gap: 8px !important;
  }

  .dashboard-module-metrics > * {
    min-width: 0 !important;
  }

  .page-heading :where(.btn, button),
  .wizard-actions :where(.btn, button),
  .bingo-form-actions :where(.btn, button),
  .mobile-stacked-actions :where(.btn, button) {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto !important;
  }

  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* LuckHaus 14.0.1 · Fase 14 Revision 2 · calibracion flyer sobre imagen real */
.flyer-image-stage{
  position: relative !important;
  display: inline-block !important;
  width: fit-content !important;
  max-width: 100% !important;
  line-height: 0 !important;
  vertical-align: top !important;
}
.flyer-image-stage > img{
  display: block !important;
  width: auto;
  height: auto;
  max-width: 100% !important;
}
.flyer-rectangle-overlay{
  transform: none !important;
  transform-origin: 0 0 !important;
  box-sizing: border-box !important;
}
