/* =====================================================================
   EventPass · Sistema de diseño
   Bootstrap 5 + glassmorphism + modo claro/oscuro
   ===================================================================== */

:root {
    --ep-primary: #6C5CE7;
    --ep-secondary: #00CEC9;
    --ep-primary-rgb: 108, 92, 231;

    --ep-bg: #F4F5FB;
    --ep-bg-grad-1: rgba(108, 92, 231, .16);
    --ep-bg-grad-2: rgba(0, 206, 201, .14);
    --ep-surface: rgba(255, 255, 255, .72);
    --ep-surface-solid: #FFFFFF;
    --ep-border: rgba(15, 23, 42, .08);
    --ep-text: #111827;
    --ep-muted: #6B7280;
    --ep-shadow: 0 10px 30px -12px rgba(15, 23, 42, .18);
    --ep-shadow-lg: 0 24px 60px -20px rgba(15, 23, 42, .30);
    --ep-radius: 18px;
    --ep-radius-sm: 12px;
    --ep-sidebar-w: 268px;
}

[data-bs-theme="dark"] {
    --ep-bg: #0B0F1A;
    --ep-bg-grad-1: rgba(108, 92, 231, .26);
    --ep-bg-grad-2: rgba(0, 206, 201, .18);
    --ep-surface: rgba(23, 28, 45, .72);
    --ep-surface-solid: #171C2D;
    --ep-border: rgba(255, 255, 255, .09);
    --ep-text: #E8EAF2;
    --ep-muted: #9AA3B8;
    --ep-shadow: 0 10px 30px -12px rgba(0, 0, 0, .55);
    --ep-shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, .7);
}

/* ------------------------------------------------------------------ */
/* Base                                                                */
/* ------------------------------------------------------------------ */

html, body { height: 100%; }

body {
    background-color: var(--ep-bg);
    background-image:
        radial-gradient(1100px 620px at 8% -8%, var(--ep-bg-grad-1), transparent 62%),
        radial-gradient(900px 560px at 100% 0%, var(--ep-bg-grad-2), transparent 58%);
    background-attachment: fixed;
    color: var(--ep-text);
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    font-size: .945rem;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 { font-weight: 650; letter-spacing: -.015em; }
a { text-decoration: none; }
.text-muted { color: var(--ep-muted) !important; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(128, 138, 160, .35); border-radius: 999px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(128, 138, 160, .6); background-clip: content-box; }

/* ------------------------------------------------------------------ */
/* Superficies                                                         */
/* ------------------------------------------------------------------ */

.ep-glass {
    background: var(--ep-surface);
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    border: 1px solid var(--ep-border);
    border-radius: var(--ep-radius);
    box-shadow: var(--ep-shadow);
}

.card {
    background: var(--ep-surface);
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    border: 1px solid var(--ep-border);
    border-radius: var(--ep-radius);
    box-shadow: var(--ep-shadow);
    transition: transform .22s cubic-bezier(.2, .8, .2, 1), box-shadow .22s ease;
}

.card-header, .card-footer { background: transparent; border-color: var(--ep-border); }

.card-hover:hover { transform: translateY(-3px); box-shadow: var(--ep-shadow-lg); }

.ep-solid { background: var(--ep-surface-solid); }

/* ------------------------------------------------------------------ */
/* Layout                                                              */
/* ------------------------------------------------------------------ */

.ep-shell { display: flex; min-height: 100vh; }

.ep-sidebar {
    width: var(--ep-sidebar-w);
    flex: 0 0 var(--ep-sidebar-w);
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 1rem .85rem;
    display: flex;
    flex-direction: column;
    gap: .35rem;
    overflow-y: auto;
    background: var(--ep-surface);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border-right: 1px solid var(--ep-border);
    z-index: 1030;
}

.ep-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }

.ep-topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    padding: .7rem 1.25rem;
    display: flex;
    align-items: center;
    gap: .75rem;
    background: var(--ep-surface);
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    border-bottom: 1px solid var(--ep-border);
}

.ep-content { padding: 1.4rem 1.25rem 3rem; flex: 1 1 auto; }

.ep-brand {
    display: flex; align-items: center; gap: .65rem;
    padding: .55rem .6rem 1rem;
    font-weight: 750; font-size: 1.12rem; letter-spacing: -.03em;
    color: var(--ep-text);
}

.ep-brand-mark {
    width: 38px; height: 38px; flex: none;
    display: grid; place-items: center;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--ep-primary), var(--ep-secondary));
    color: #fff; font-size: 1.1rem;
    box-shadow: 0 8px 20px -8px rgba(var(--ep-primary-rgb), .9);
}

.ep-nav-label {
    font-size: .68rem; text-transform: uppercase; letter-spacing: .09em;
    color: var(--ep-muted); font-weight: 700;
    padding: 1rem .75rem .35rem;
}

.ep-nav-link {
    display: flex; align-items: center; gap: .72rem;
    padding: .6rem .75rem;
    border-radius: var(--ep-radius-sm);
    color: var(--ep-text);
    font-weight: 500;
    transition: background .16s ease, color .16s ease, transform .16s ease;
    position: relative;
}
.ep-nav-link i { font-size: 1.05rem; width: 1.25rem; text-align: center; opacity: .8; }
.ep-nav-link:hover { background: rgba(var(--ep-primary-rgb), .1); color: var(--ep-primary); }
.ep-nav-link.active {
    background: linear-gradient(135deg, rgba(var(--ep-primary-rgb), .18), rgba(var(--ep-primary-rgb), .06));
    color: var(--ep-primary);
    font-weight: 650;
}
.ep-nav-link.active::before {
    content: ''; position: absolute; left: -.85rem; top: 50%; transform: translateY(-50%);
    width: 4px; height: 24px; border-radius: 0 4px 4px 0; background: var(--ep-primary);
}
.ep-nav-link .badge { margin-left: auto; }

@media (max-width: 991.98px) {
    .ep-sidebar {
        position: fixed; left: 0; top: 0; bottom: 0;
        transform: translateX(-102%);
        transition: transform .28s cubic-bezier(.2, .8, .2, 1);
        box-shadow: var(--ep-shadow-lg);
    }
    .ep-sidebar.open { transform: translateX(0); }
    .ep-backdrop {
        position: fixed; inset: 0; background: rgba(2, 6, 23, .5);
        backdrop-filter: blur(2px); z-index: 1029;
    }
    .ep-content { padding: 1rem .85rem 5.5rem; }
}

/* ------------------------------------------------------------------ */
/* Tarjetas KPI                                                        */
/* ------------------------------------------------------------------ */

.ep-stat { padding: 1.1rem 1.15rem; border-radius: var(--ep-radius); position: relative; overflow: hidden; }
.ep-stat .ep-stat-icon {
    width: 42px; height: 42px; border-radius: 12px;
    display: grid; place-items: center; font-size: 1.15rem; margin-bottom: .75rem;
}
.ep-stat .ep-stat-value { font-size: 1.85rem; font-weight: 750; line-height: 1.05; letter-spacing: -.03em; }
.ep-stat .ep-stat-label { font-size: .8rem; color: var(--ep-muted); font-weight: 550; }
.ep-stat .ep-stat-trend { font-size: .76rem; font-weight: 600; }
.ep-stat::after {
    content: ''; position: absolute; right: -30px; top: -30px;
    width: 120px; height: 120px; border-radius: 50%; opacity: .07;
    background: currentColor;
}

.tone-primary { color: var(--ep-primary); }
.tone-primary .ep-stat-icon { background: rgba(var(--ep-primary-rgb), .14); color: var(--ep-primary); }
.tone-success { color: #10B981; }
.tone-success .ep-stat-icon { background: rgba(16, 185, 129, .14); color: #10B981; }
.tone-info    { color: #0EA5E9; }
.tone-info .ep-stat-icon { background: rgba(14, 165, 233, .14); color: #0EA5E9; }
.tone-warning { color: #F59E0B; }
.tone-warning .ep-stat-icon { background: rgba(245, 158, 11, .16); color: #F59E0B; }
.tone-danger  { color: #EF4444; }
.tone-danger .ep-stat-icon { background: rgba(239, 68, 68, .14); color: #EF4444; }
.tone-purple  { color: #A855F7; }
.tone-purple .ep-stat-icon { background: rgba(168, 85, 247, .14); color: #A855F7; }
.ep-stat .ep-stat-value, .ep-stat .ep-stat-label { color: var(--ep-text); }

/* ------------------------------------------------------------------ */
/* Controles                                                           */
/* ------------------------------------------------------------------ */

.btn { border-radius: 11px; font-weight: 550; transition: transform .14s ease, box-shadow .14s ease, background .14s ease; }
.btn:active { transform: translateY(1px); }
.btn-lg { border-radius: 14px; }

.btn-primary {
    background: linear-gradient(135deg, var(--ep-primary), color-mix(in srgb, var(--ep-primary) 65%, var(--ep-secondary)));
    border: none;
    box-shadow: 0 10px 24px -12px rgba(var(--ep-primary-rgb), .95);
}
.btn-primary:hover { filter: brightness(1.06); box-shadow: 0 14px 30px -12px rgba(var(--ep-primary-rgb), 1); }

.form-control, .form-select {
    border-radius: 11px;
    border-color: var(--ep-border);
    background: var(--ep-surface-solid);
    padding: .55rem .8rem;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.form-control:focus, .form-select:focus {
    border-color: var(--ep-primary);
    box-shadow: 0 0 0 .2rem rgba(var(--ep-primary-rgb), .18);
}
.form-label { font-weight: 600; font-size: .84rem; margin-bottom: .3rem; }
.input-group-text { border-radius: 11px; border-color: var(--ep-border); background: transparent; }

.ep-search { position: relative; }
.ep-search .bi { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--ep-muted); pointer-events: none; }
.ep-search .form-control { padding-left: 2.4rem; }

.badge { font-weight: 600; border-radius: 8px; padding: .38em .62em; }

.table { --bs-table-bg: transparent; margin-bottom: 0; }
.table > :not(caption) > * > * { padding: .72rem .8rem; border-color: var(--ep-border); }
.table thead th {
    font-size: .74rem; text-transform: uppercase; letter-spacing: .05em;
    color: var(--ep-muted); font-weight: 700; border-bottom-width: 1px; white-space: nowrap;
}
.table-hover > tbody > tr:hover > * { background: rgba(var(--ep-primary-rgb), .05); }
.ep-table-wrap { border-radius: var(--ep-radius); overflow: hidden; }

.modal-content { border-radius: var(--ep-radius); border: 1px solid var(--ep-border); background: var(--ep-surface-solid); }
.dropdown-menu { border-radius: 14px; border-color: var(--ep-border); box-shadow: var(--ep-shadow-lg); background: var(--ep-surface-solid); padding: .4rem; }
.dropdown-item { border-radius: 9px; padding: .5rem .7rem; font-size: .9rem; }

.offcanvas { background: var(--ep-surface-solid); }

.ep-avatar {
    width: 38px; height: 38px; border-radius: 50%;
    display: grid; place-items: center; font-weight: 700; font-size: .82rem;
    background: linear-gradient(135deg, var(--ep-primary), var(--ep-secondary)); color: #fff; flex: none;
}
.ep-avatar-sm { width: 30px; height: 30px; font-size: .7rem; }
.ep-avatar-lg { width: 62px; height: 62px; font-size: 1.2rem; }
.ep-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

.ep-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }

.ep-empty { text-align: center; padding: 3rem 1rem; color: var(--ep-muted); }
.ep-empty i { font-size: 3rem; opacity: .35; display: block; margin-bottom: .75rem; }

/* ------------------------------------------------------------------ */
/* Check-in                                                            */
/* ------------------------------------------------------------------ */

.ep-scanner-box {
    border-radius: var(--ep-radius);
    overflow: hidden;
    background: #0B0F1A;
    aspect-ratio: 4 / 3;
    position: relative;
}
.ep-scanner-box video, .ep-scanner-box canvas { width: 100% !important; height: 100% !important; object-fit: cover; }
#ep-reader__dashboard_section_csr button { border-radius: 10px !important; }

.ep-result {
    border-radius: var(--ep-radius);
    padding: 1.5rem;
    animation: ep-pop .32s cubic-bezier(.2, .9, .25, 1.2);
}
@keyframes ep-pop { from { opacity: 0; transform: scale(.94) translateY(10px); } to { opacity: 1; transform: none; } }

.ep-result-ok      { background: linear-gradient(135deg, #10B981, #059669); color: #fff; }
.ep-result-warn    { background: linear-gradient(135deg, #F59E0B, #D97706); color: #fff; }
.ep-result-danger  { background: linear-gradient(135deg, #EF4444, #B91C1C); color: #fff; }
.ep-result-vip     { background: linear-gradient(135deg, #C9A227, #92400E); color: #fff; }
.ep-result h2 { font-size: 1.9rem; margin: 0; }
.ep-result .ep-result-icon { font-size: 3.2rem; line-height: 1; }

.btn-checkin {
    font-size: 1.15rem; font-weight: 700; padding: 1rem 1.5rem; border-radius: 16px; width: 100%;
}

.ep-fullscreen-flash {
    position: fixed; inset: 0; z-index: 2000;
    display: grid; place-items: center; text-align: center; color: #fff;
    animation: ep-fade .25s ease;
}
@keyframes ep-fade { from { opacity: 0; } to { opacity: 1; } }

/* Panel tipo aeropuerto */
.ep-board { font-variant-numeric: tabular-nums; }
.ep-board-row {
    display: grid; grid-template-columns: 46px 1fr 120px 90px 110px;
    gap: .75rem; align-items: center;
    padding: .85rem 1rem; border-radius: 14px;
    background: var(--ep-surface); border: 1px solid var(--ep-border);
    animation: ep-slide-in .4s cubic-bezier(.2, .9, .25, 1);
}
@keyframes ep-slide-in { from { opacity: 0; transform: translateX(-18px); } to { opacity: 1; transform: none; } }
.ep-board-row.is-new { box-shadow: 0 0 0 2px rgba(16, 185, 129, .5); }
@media (max-width: 767.98px) { .ep-board-row { grid-template-columns: 40px 1fr 80px; } .ep-board-hide-sm { display: none; } }

/* Pantalla LED */
.ep-led {
    min-height: 100vh; display: grid; place-items: center; text-align: center;
    background: radial-gradient(circle at 50% 30%, #1e1b4b, #020617 70%);
    color: #fff; padding: 2rem;
}
.ep-led .ep-led-name { font-size: clamp(2.5rem, 9vw, 7rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.05; }
.ep-led .ep-led-msg  { font-size: clamp(1.1rem, 3vw, 2rem); opacity: .85; }

/* ------------------------------------------------------------------ */
/* Mesas y plano                                                       */
/* ------------------------------------------------------------------ */

.ep-table-card { border-radius: 16px; border: 1px solid var(--ep-border); background: var(--ep-surface); overflow: hidden; }
.ep-table-card .ep-table-head { padding: .6rem .85rem; display: flex; align-items: center; gap: .5rem; color: #fff; }
.ep-seat-list { min-height: 60px; padding: .5rem; display: flex; flex-direction: column; gap: .35rem; }
.ep-seat-list.drag-over { background: rgba(var(--ep-primary-rgb), .08); }
.ep-guest-chip {
    display: flex; align-items: center; gap: .5rem;
    padding: .4rem .55rem; border-radius: 10px; font-size: .84rem;
    background: var(--ep-surface-solid); border: 1px solid var(--ep-border);
    cursor: grab; user-select: none;
}
.ep-guest-chip:active { cursor: grabbing; }
.ep-guest-chip.sortable-ghost { opacity: .35; }
.ep-table-full .ep-table-head { filter: saturate(.5); }

.ep-canvas {
    position: relative; overflow: auto;
    background:
        linear-gradient(90deg, var(--ep-border) 1px, transparent 1px) 0 0 / 40px 40px,
        linear-gradient(var(--ep-border) 1px, transparent 1px) 0 0 / 40px 40px,
        var(--ep-surface-solid);
    border: 1px solid var(--ep-border);
    border-radius: var(--ep-radius);
    min-height: 620px;
}
.ep-canvas-inner { position: relative; width: 1200px; height: 800px; }
.ep-node {
    position: absolute; display: grid; place-items: center; text-align: center;
    border-radius: 12px; color: #fff; font-weight: 650; font-size: .8rem;
    cursor: move; user-select: none; padding: .25rem;
    box-shadow: 0 6px 18px -8px rgba(0, 0, 0, .5);
    transition: box-shadow .15s ease;
}
.ep-node.round { border-radius: 50%; }
.ep-node.selected { outline: 3px solid var(--ep-primary); outline-offset: 3px; }
.ep-node small { display: block; font-weight: 500; opacity: .85; font-size: .68rem; }

/* ------------------------------------------------------------------ */
/* Invitación pública                                                  */
/* ------------------------------------------------------------------ */

.ep-invite {
    max-width: 460px; margin: 0 auto; border-radius: 24px; overflow: hidden;
    background: var(--ep-surface-solid); box-shadow: var(--ep-shadow-lg);
    border: 1px solid var(--ep-border);
}
.ep-invite-hero { padding: 2.4rem 1.75rem; text-align: center; color: #fff; position: relative; }
.ep-invite-hero h1 { font-size: 1.65rem; margin: .4rem 0 .2rem; }
.ep-invite-qr { background: #fff; padding: 1rem; border-radius: 18px; display: inline-block; }
.ep-invite-meta { display: flex; gap: .6rem; align-items: flex-start; padding: .55rem 0; }
.ep-invite-meta i { color: var(--ep-primary); font-size: 1.05rem; width: 1.4rem; }

/* ------------------------------------------------------------------ */
/* Utilidades                                                          */
/* ------------------------------------------------------------------ */

.ep-progress { height: 8px; border-radius: 999px; background: rgba(128, 138, 160, .2); overflow: hidden; }
.ep-progress > div { height: 100%; border-radius: 999px; transition: width .5s cubic-bezier(.2, .8, .2, 1); }

.ep-scroll-x { overflow-x: auto; }
.cursor-pointer { cursor: pointer; }
.ep-sticky-actions { position: sticky; bottom: 0; padding: .85rem 0; background: linear-gradient(to top, var(--ep-bg) 60%, transparent); }

.ep-fab {
    position: fixed; right: 1rem; bottom: 1rem; z-index: 1040;
    width: 58px; height: 58px; border-radius: 50%; border: none;
    display: grid; place-items: center; font-size: 1.5rem; color: #fff;
    background: linear-gradient(135deg, var(--ep-primary), var(--ep-secondary));
    box-shadow: 0 14px 30px -10px rgba(var(--ep-primary-rgb), .9);
}

.ep-offline-bar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1050;
    padding: .55rem 1rem; text-align: center; font-size: .85rem; font-weight: 600;
    background: #F59E0B; color: #1F2937;
}

@media print {
    .ep-sidebar, .ep-topbar, .no-print, .ep-fab { display: none !important; }
    body { background: #fff !important; }
    .card, .ep-glass { box-shadow: none !important; border: 1px solid #ddd !important; backdrop-filter: none !important; background: #fff !important; }
    .ep-content { padding: 0 !important; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
