/* panel.css — estructura del panel de Ticketer (menú lateral, barras, tarjetas). Paleta: índigo → cian. */
:root { --sb-w: 240px; --sb-mini: 72px; --top: 56px; --tk1: #6366f1; --tk2: #06b6d4; --tk-grad: linear-gradient(135deg, #6366f1 0%, #06b6d4 100%); }
body { padding-top: var(--bar); }
@media (min-width: 992px) { body { padding-left: var(--sb-w); transition: padding-left .2s; } html.sb-mini body { padding-left: var(--sb-mini); } .topbar { display: none !important; } }
@media (max-width: 991.98px) { body { padding-top: calc(var(--top) + var(--bar)); } }
.main { padding: 28px 28px 60px; max-width: 1280px; }
@media (max-width: 575px) { .main { padding: 18px 14px 50px; } }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { font-size: 1.55rem; margin: 0; }
.page-head p { margin: 2px 0 0; color: #94a3b8; font-size: .9rem; }

/* Menú lateral */
.sb { position: fixed; top: var(--bar); left: 0; bottom: 0; width: var(--sb-w); z-index: 1045; display: flex; flex-direction: column; background: #0f172a;
      border-right: 1px solid rgba(148,163,184,.12); transition: width .2s, transform .25s; overflow: hidden; font-size: .9rem; }
.sb-head { display: flex; align-items: center; gap: .6rem; padding: 1rem; border-bottom: 1px solid rgba(148,163,184,.12); min-height: 64px; }
.sb-logo { flex: 0 0 36px; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-size: 1.1rem; text-decoration: none; background: var(--tk-grad); }
.sb-brand { font-weight: 700; font-size: 1.12rem; white-space: nowrap; text-decoration: none; background: linear-gradient(135deg,#a5b4fc,#67e8f9);
            -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.sb-gym { padding: .7rem 1rem; border-bottom: 1px solid rgba(148,163,184,.12); color: #94a3b8; font-size: .78rem; white-space: nowrap; }
.sb-gym strong { display: block; color: #f8fafc; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; }
.sb-nav { flex: 1; overflow-y: auto; padding: .75rem .6rem; scrollbar-width: none; -ms-overflow-style: none; }
.sb-nav::-webkit-scrollbar { display: none; }
.sb-link { display: flex; align-items: center; gap: .75rem; padding: .6rem .75rem; margin-bottom: 2px; border-radius: .55rem; color: #94a3b8; text-decoration: none; white-space: nowrap; }
.sb-link i { flex: 0 0 22px; font-size: 1.15rem; text-align: center; }
.sb-link:hover { background: rgba(148,163,184,.08); color: #f8fafc; }
.sb-link.active { background: rgba(99,102,241,.18); color: #c7d2fe; box-shadow: inset 3px 0 0 var(--tk2); }
.sb-foot { border-top: 1px solid rgba(148,163,184,.12); padding: .6rem; display: flex; gap: .35rem; }
.sb-foot .sb-link { flex: 1; justify-content: center; margin: 0; padding: .5rem; }
.sb-foot .sb-link span { font-size: .8rem; }
.sb-foot button.sb-link { background: none; border: 0; flex: 0 0 auto; }
@media (min-width: 992px) {
    html.sb-mini .sb:is(:not(:hover), .nohover) { width: var(--sb-mini); }
    html.sb-mini .sb:is(:not(:hover), .nohover) .hide { display: none !important; }
    html.sb-mini .sb:is(:not(:hover), .nohover) .sb-link, html.sb-mini .sb:is(:not(:hover), .nohover) .sb-head { justify-content: center; padding-left: .5rem; padding-right: .5rem; }
    html.sb-mini .sb:is(:not(:hover), .nohover) .sb-foot { flex-direction: column; }
    html.sb-mini .sb:hover:not(.nohover) { box-shadow: 12px 0 32px rgba(0,0,0,.45); }
    html.sb-mini .sb-collapse i { display: inline-block; transform: rotate(180deg); }
}
.topbar { position: fixed; top: var(--bar); left: 0; right: 0; height: var(--top); z-index: 1040; display: flex; align-items: center; gap: .75rem; padding: 0 .9rem;
          background: #0f172a; border-bottom: 1px solid rgba(148,163,184,.12); }
.burger { background: none; border: 1px solid rgba(148,163,184,.22); color: #f8fafc; border-radius: .5rem; width: 40px; height: 38px; font-size: 1.3rem; }
.backdrop { position: fixed; inset: 0; background: rgba(2,6,23,.6); z-index: 1044; opacity: 0; pointer-events: none; transition: opacity .2s; }
@media (max-width: 991.98px) { .sb { transform: translateX(-100%); width: 270px; } html.sb-open .sb { transform: none; } html.sb-open .backdrop { opacity: 1; pointer-events: auto; } .sb-collapse { display: none !important; } }

/* Barras de demo / soporte */
.demo-bar { position: fixed; top: 0; left: 0; right: 0; height: 34px; z-index: 1060; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0 1rem;
            background: var(--tk-grad); color: #fff; font-size: .84rem; font-weight: 500; white-space: nowrap; overflow: hidden; }
.demo-bar.soporte { background: linear-gradient(90deg,#b45309,#dc2626); }
.demo-bar a { color: #fff; background: rgba(2,6,23,.3); padding: .15rem .75rem; border-radius: 999px; text-decoration: none; font-weight: 600; }
@media (max-width: 700px) { .demo-full { display: none; } }

/* Botones con la paleta de Ticketer */
.btn-primary { --bs-btn-bg: #6366f1; --bs-btn-border-color: #6366f1; --bs-btn-hover-bg: #4f46e5; --bs-btn-hover-border-color: #4f46e5;
               --bs-btn-active-bg: #4338ca; --bs-btn-active-border-color: #4338ca; --bs-btn-disabled-bg: #6366f1; --bs-btn-disabled-border-color: #6366f1; }
.btn-grad { background: var(--tk-grad); border: 0; color: #fff; font-weight: 600; }
.btn-grad:hover, .btn-grad:focus { color: #fff; filter: brightness(1.08); }
.form-check-input:checked { background-color: #6366f1; border-color: #6366f1; }
.form-control:focus, .form-select:focus { border-color: #818cf8; box-shadow: 0 0 0 3px rgba(167,139,250,.15); }

/* Tarjetas y KPIs */
.kpi { padding: 18px 20px; border-radius: .85rem; background: #1e293b; border: 1px solid rgba(148,163,184,.12); height: 100%; }
.kpi .lbl { color: #94a3b8; font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.kpi .val { font-size: 1.8rem; font-weight: 700; margin-top: 4px; line-height: 1.1; }
.kpi .sub { color: #94a3b8; font-size: .8rem; margin-top: 4px; }
.panel { background: #1e293b; border: 1px solid rgba(148,163,184,.12); border-radius: .85rem; padding: 20px; }
.panel h2 { font-size: 1.02rem; margin: 0 0 14px; }
.muted { color: #94a3b8; }
.table td, .table th { vertical-align: middle; }

/* Gráfico de visitas (barras CSS) */
.chart { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding-top: 18px; }
.chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.chart .bar { width: 100%; max-width: 34px; border-radius: 6px 6px 2px 2px; background: var(--tk-grad); min-height: 3px; position: relative; }
.chart .bar span { position: absolute; top: -18px; left: 50%; transform: translateX(-50%); font-size: .68rem; color: #cbd5e1; white-space: nowrap; }
@media (max-width: 575px) { .chart { gap: 3px; } .chart .bar span { font-size: .56rem; top: -15px; } }
.chart .d { font-size: .66rem; color: #64748b; margin-top: 6px; text-align: center; line-height: 1.2; }
.chart .hoy .bar { box-shadow: 0 0 0 2px rgba(6,182,212,.45); }

/* Checklist */
.check { display: flex; align-items: center; gap: .6rem; padding: .45rem 0; font-size: .9rem; }
.check i { font-size: 1.1rem; }
.check.ok i { color: #10b981; } .check.no i { color: #475569; }
.check a { margin-left: auto; font-size: .8rem; }

/* Carta (administración) */
.cat-card { background: #1e293b; border: 1px solid rgba(148,163,184,.12); border-radius: .85rem; margin-bottom: 16px; overflow: hidden; }
.cat-card.inactiva { opacity: .6; }
.cat-head { display: flex; align-items: center; gap: .5rem; padding: 12px 14px; background: #172033; border-bottom: 1px solid rgba(148,163,184,.12); }
.cat-head h2 { font-size: 1rem; margin: 0; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item { display: flex; align-items: center; gap: .75rem; padding: 10px 14px; border-bottom: 1px solid rgba(148,163,184,.08); }
.item:last-child { border-bottom: 0; }
.item.oculto-carta { opacity: .5; }
.item-foto { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; flex: 0 0 52px; background: #0f172a; display: grid; place-items: center; color: #475569; font-size: 1.3rem; }
.item-body { flex: 1; min-width: 0; }
.item-nombre { font-weight: 600; font-size: .93rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-meta { font-size: .78rem; color: #94a3b8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-precio { font-weight: 700; white-space: nowrap; color: #67e8f9; font-size: .93rem; }
.btn-icon { width: 34px; height: 34px; padding: 0; display: inline-grid; place-items: center; border-radius: .5rem; }
.acciones { display: flex; gap: 4px; flex: 0 0 auto; }
@media (max-width: 575px) { .acciones .solo-pc { display: none; } .item { flex-wrap: wrap; } .item .acciones { width: 100%; justify-content: flex-end; } }
.chip-etq { display: inline-flex; align-items: center; gap: .3rem; font-size: .8rem; padding: .3rem .65rem; border-radius: 999px; border: 1px solid rgba(148,163,184,.25); cursor: pointer; user-select: none; margin: 0 .3rem .4rem 0; }
.chip-etq input { display: none; }
.chip-etq:has(input:checked) { background: rgba(99,102,241,.25); border-color: #818cf8; color: #e0e7ff; }
.foto-prev { width: 100%; max-height: 180px; object-fit: cover; border-radius: .6rem; background: #0f172a; }

/* Vista previa en celular (Diseño) */
.phone { width: 100%; max-width: 360px; margin: 0 auto; border: 10px solid #020617; border-radius: 34px; overflow: hidden; background: #020617; box-shadow: 0 24px 50px -18px rgba(0,0,0,.7); position: relative; }
.phone::before { content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 110px; height: 18px; background: #020617; border-radius: 0 0 12px 12px; z-index: 2; }
.phone iframe { width: 100%; height: 640px; border: 0; display: block; }
.swatch { width: 44px; height: 38px; padding: 3px; border-radius: .5rem; }

/* QR */
.qr-box { background: #fff; border-radius: 1rem; padding: 18px; max-width: 320px; margin: 0 auto; }
.qr-box img, .qr-box canvas, .qr-box svg { width: 100%; height: auto; display: block; }
.estilo { border: 2px solid rgba(148,163,184,.2); border-radius: .8rem; padding: 8px; text-align: center; cursor: pointer; background: #fff; }
.estilo img { width: 100%; display: block; }
.estilo span { display: block; color: #1e293b; font-size: .78rem; font-weight: 600; margin-top: 4px; }
.estilo:has(input:checked) { border-color: #06b6d4; box-shadow: 0 0 0 3px rgba(6,182,212,.35); }
.estilo input { display: none; }

/* ── Ticketer ─────────────────────────────────────────────── */
.min-w-0 { min-width: 0; }
.nav-pills .nav-link { color: #94a3b8; border-radius: 999px; padding: .4rem 1rem; }
.nav-pills .nav-link.active { background: var(--tk-grad); color: #fff; }
.ev-fecha { color: #67e8f9; font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 2px; }
.ev-nums { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 14px; text-align: center; font-size: .72rem; color: #94a3b8; }
.ev-nums span { display: block; font-size: 1.05rem; font-weight: 700; color: #f8fafc; }
@media (max-width: 420px) { .ev-nums { grid-template-columns: repeat(2, 1fr); row-gap: 10px; } }
.prox { background: linear-gradient(135deg, rgba(99,102,241,.16), rgba(6,182,212,.1)); border-color: rgba(103,232,249,.25); }
.chart-box { position: relative; height: 240px; }
.chart-box.sm { height: 210px; }
.tk-num { font-variant-numeric: tabular-nums; color: #67e8f9; font-weight: 700; font-size: .85rem; min-width: 52px; }
.tk-estado { font-size: .78rem; color: #94a3b8; white-space: nowrap; }
.tk-estado.ok { color: #34d399; }
@media (max-width: 575px) { .tk-num { min-width: 0; } .tk-estado { order: 3; } }
.ac-list { position: absolute; left: 0; right: 0; top: 100%; z-index: 20; background: #0f172a; border: 1px solid rgba(148,163,184,.25); border-radius: .6rem; margin-top: 4px; overflow: hidden; box-shadow: 0 16px 30px -12px rgba(0,0,0,.7); }
.ac-item { display: flex; justify-content: space-between; gap: 10px; width: 100%; text-align: left; background: none; border: 0; color: #f8fafc; padding: .6rem .8rem; border-bottom: 1px solid rgba(148,163,184,.08); font-size: .9rem; }
.ac-item span { color: #94a3b8; font-size: .8rem; }
.ac-item:hover, .ac-item:focus { background: rgba(99,102,241,.18); }
.btn-check:checked + .btn-outline-light { background: var(--tk-grad); border-color: transparent; color: #fff; }

/* Control de ingreso */
.scan-wrap { max-width: 520px; margin: 0 auto; }
.scan-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; font-size: .74rem; color: #94a3b8; margin-bottom: 8px; }
.scan-stats span { display: block; font-size: 1.6rem; font-weight: 800; color: #f8fafc; line-height: 1.1; }
.scan-cam { position: relative; background: #0f172a; border: 1px solid rgba(148,163,184,.15); border-radius: 1rem; overflow: hidden; min-height: 300px; }
.scan-cam #lector { width: 100%; }
.scan-cam #lector video { border-radius: 1rem; }
.scan-placeholder { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; }
.scan-placeholder > i { font-size: 2.6rem; color: #475569; }
.scan-result { margin-top: 14px; border-radius: 1rem; overflow: hidden; border: 2px solid; background: #0f172a; }
.res-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.res-head i { font-size: 2.2rem; }
.res-tit { font-size: 1.3rem; font-weight: 800; line-height: 1.1; }
.res-sub { font-size: .85rem; opacity: .85; }
.res-body { padding: 4px 16px 8px; }
.res-row { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid rgba(148,163,184,.1); font-size: .9rem; }
.res-row span { color: #94a3b8; }
.res-acc { padding: 12px 16px 16px; }
.r-valida { border-color: #06b6d4; } .r-valida .res-head { background: rgba(6,182,212,.14); color: #67e8f9; }
.r-ok { border-color: #10b981; } .r-ok .res-head { background: rgba(16,185,129,.16); color: #6ee7b7; }
.r-usada, .r-invalida { border-color: #ef4444; } .r-usada .res-head, .r-invalida .res-head { background: rgba(239,68,68,.15); color: #fca5a5; }
.r-otro_evento { border-color: #f59e0b; } .r-otro_evento .res-head { background: rgba(245,158,11,.15); color: #fcd34d; }

/* Verde lleno para las acciones clave (marcar ingreso, WhatsApp) */
.btn-success { --bs-btn-bg: #10b981; --bs-btn-border-color: #10b981; --bs-btn-color: #fff; --bs-btn-hover-bg: #059669; --bs-btn-hover-border-color: #059669; --bs-btn-hover-color: #fff;
               --bs-btn-active-bg: #047857; --bs-btn-disabled-bg: #10b981; --bs-btn-disabled-border-color: #10b981; background: #10b981 !important; color: #fff !important; font-weight: 700; }
.btn-success:disabled { opacity: .45; }
.btn-success:hover, .btn-success:active, .btn-success:focus { background: #059669 !important; color: #fff !important; border-color: #059669 !important; }
