/* Tickexpa v0.5.2 - selector global claro / oscuro */
html{color-scheme:light}
html[data-theme="dark"]{color-scheme:dark}

.theme-toggle{
  width:38px;height:38px;display:inline-grid;place-items:center;flex:0 0 38px;
  margin:0 5px 0 auto;padding:0;border:1px solid rgba(13,27,61,.14);
  border-radius:11px;background:#F0F2F5;color:#0D1B3D;cursor:pointer;
  transition:.2s ease;
}
.theme-toggle:hover{transform:translateY(-1px);box-shadow:0 7px 18px rgba(13,27,61,.10)}
.theme-toggle:focus-visible{outline:3px solid rgba(123,45,255,.25);outline-offset:2px}
.theme-toggle svg{
  width:18px;height:18px;display:block;fill:none;stroke:currentColor;
  stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;
}
html[data-theme="dark"] .theme-toggle{
  background:#1B1D23;color:#fff;border-color:rgba(255,255,255,.12);
}

/* Evita el flash blanco antes de aplicar la preferencia guardada */
html:not(.theme-ready) *,
html:not(.theme-ready) *::before,
html:not(.theme-ready) *::after{transition:none!important}

/* ===== MODO OSCURO ===== */
html[data-theme="dark"] body{background:#071229!important;color:#EAF0FF!important}
html[data-theme="dark"] a{color:#C6B7FF}
html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] strong{color:#F8FAFF}
html[data-theme="dark"] .muted,
html[data-theme="dark"] small,
html[data-theme="dark"] .field-help{color:#9EABC3!important}

/* Cabecera */
html[data-theme="dark"] .site-header{
  background:rgba(6,18,43,.98)!important;
  border-color:rgba(255,255,255,.09)!important;
  box-shadow:0 10px 30px rgba(0,0,0,.18)!important;
}
html[data-theme="dark"] .site-header a,
html[data-theme="dark"] .site-header .linkbtn{color:#F5F7FF!important}
html[data-theme="dark"] .site-header .menu-toggle{
  background:rgba(255,255,255,.06)!important;
  border-color:rgba(255,255,255,.14)!important;
}
html[data-theme="dark"] .site-header .menu-toggle span{background:#fff!important}
html[data-theme="dark"] .site-header .mobile-menu{
  background:#0B1A3B!important;
  border-color:rgba(255,255,255,.10)!important;
  box-shadow:0 20px 45px rgba(0,0,0,.25)!important;
}

/* Tarjetas y zonas claras */
html[data-theme="dark"] .panel,
html[data-theme="dark"] .eventcard,
html[data-theme="dark"] .eventbody,
html[data-theme="dark"] .ordercard,
html[data-theme="dark"] .qr-ticket,
html[data-theme="dark"] .ticket-option,
html[data-theme="dark"] .stat,
html[data-theme="dark"] .category-chip,
html[data-theme="dark"] .searchbar,
html[data-theme="dark"] .authbox,
html[data-theme="dark"] .empty,
html[data-theme="dark"] .notice,
html[data-theme="dark"] .checkoutbar,
html[data-theme="dark"] .facts,
html[data-theme="dark"] .settings-summary>div{
  background:#0F1D3A!important;
  border-color:#273858!important;
  color:#EAF0FF!important;
  box-shadow:0 9px 28px rgba(0,0,0,.12)!important;
}
html[data-theme="dark"] .eventcard p,
html[data-theme="dark"] .eventmeta,
html[data-theme="dark"] .facts span{color:#AAB7D0!important}

/* Home */
html[data-theme="dark"] .featured-section,
html[data-theme="dark"] .organizer-section,
html[data-theme="dark"] .category-strip{background:#071229!important}
html[data-theme="dark"] .txp-brand-strip{background:#071430!important}
html[data-theme="dark"] .txp-brand-card{
  background:#F9FBFF!important;
  border-color:rgba(255,255,255,.12)!important;
}

/* Formularios */
html[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
html[data-theme="dark"] select,
html[data-theme="dark"] textarea{
  background:#0A1731!important;
  border-color:#2A3A5C!important;
  color:#F5F8FF!important;
  box-shadow:none!important;
}
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder{color:#7889A8!important}
html[data-theme="dark"] select option{background:#0A1731;color:#F5F8FF}
html[data-theme="dark"] label{color:#C8D2E7}
html[data-theme="dark"] hr{border-color:#263654!important}

/* Tablas */
html[data-theme="dark"] table{color:#EAF0FF!important}
html[data-theme="dark"] th{
  background:#0A1731!important;color:#AEBAD1!important;border-color:#263654!important;
}
html[data-theme="dark"] td{
  background:#0F1D3A!important;border-color:#263654!important;
}
html[data-theme="dark"] tr:hover td{background:#132341!important}

/* Botones secundarios */
html[data-theme="dark"] .btn.ghost,
html[data-theme="dark"] .ghost,
html[data-theme="dark"] button.ghost{
  background:#101E3B!important;color:#F5F8FF!important;border-color:#334463!important;
}

/* Pagos / checkout */
html[data-theme="dark"] .provider-card,
html[data-theme="dark"] .provider-config,
html[data-theme="dark"] .checkline,
html[data-theme="dark"] .payment-method-card{
  background:#0F1D3A!important;border-color:#293A5A!important;color:#EAF0FF!important;
}

/* Administrador promociones */
html[data-theme="dark"] .txp-admin-addbox,
html[data-theme="dark"] .txp-admin-promo-item,
html[data-theme="dark"] .txp-admin-brand-item{
  background:#0F1D3A!important;border-color:#293A5A!important;
}
html[data-theme="dark"] .txp-admin-brand-logo{background:#F8FAFF!important}

/* Diseñador de recintos */
html[data-theme="dark"] .vd-page{background:#071229!important}
html[data-theme="dark"] .vd-sidebar,
html[data-theme="dark"] .vd-center{
  background:#0F1D3A!important;border-color:#263858!important;
}
html[data-theme="dark"] .vd-template-grid button,
html[data-theme="dark"] .vd-tool-list button,
html[data-theme="dark"] .vd-secondary-btn,
html[data-theme="dark"] .vd-level-list button,
html[data-theme="dark"] .vd-easy-add button,
html[data-theme="dark"] .vd-preset-item button,
html[data-theme="dark"] .vd-section-list button,
html[data-theme="dark"] .vd-zoom-controls button{
  background:#0A1731!important;border-color:#2B3C5D!important;color:#EEF3FF!important;
}
html[data-theme="dark"] .vd-stage-wrap{
  background:radial-gradient(circle at 50% 15%,#172846,#081329)!important;
}
html[data-theme="dark"] .vd-canvas{
  background-color:#101E39!important;border-color:#344664!important;
}
html[data-theme="dark"] .vd-inspector-empty,
html[data-theme="dark"] .vd-seat-quick,
html[data-theme="dark"] .vd-preset-empty{
  background:#0A1731!important;border-color:#2B3C5D!important;
}

/* Vista pública 2D/3D */
html[data-theme="dark"] .txp-venue-shell{
  background:#0F1D3A!important;border-color:#293A5A!important;
}
html[data-theme="dark"] .txp-venue-toolbar button,
html[data-theme="dark"] .txp-venue-level-tabs button{
  background:#0A1731!important;border-color:#2A3A5C!important;color:#EAF0FF!important;
}
html[data-theme="dark"] .txp-zone-card{background:#0F1D3A!important;color:#EAF0FF!important}

/* Footer */
html[data-theme="dark"] .footer{
  background:#071126!important;border-color:#1B2B49!important;color:#AEBAD0!important;
}
html[data-theme="dark"] .footer a{color:#C8D2E7!important}
html[data-theme="dark"] .footer-bottom{border-color:#1B2B49!important}

/* Transición solo después del primer render */
html.theme-ready body,
html.theme-ready .site-header,
html.theme-ready .panel,
html.theme-ready .eventcard,
html.theme-ready input,
html.theme-ready select,
html.theme-ready textarea,
html.theme-ready .footer{
  transition:background-color .22s ease,color .22s ease,border-color .22s ease,box-shadow .22s ease;
}

@media(max-width:620px){
  .theme-toggle{width:36px;height:36px;flex-basis:36px;border-radius:10px;margin-right:6px}
  .theme-toggle svg{width:17px;height:17px}
}
