:root {
    --primary-color: #2563eb;
    --primary-color-hover: #1d4ed8;
    --bg-color: #f1f5f9;
    --text-color: #1e293b;
    --sidebar-bg: #0f172a;
    --sidebar-text: #cbd5e1;
    --sidebar-hover: #1e293b;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
}

/* Login Page Base */
.login-body {
    min-height: 100vh;
    display: flex;
    align-items: stretch;
    margin: 0;
    padding: 0;
    background: #0f172a;
}

.login-container {
    background: white;
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.login-container h2 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    text-align: center;
}

.demo-info {
    margin-top: 1rem;
    font-size: 0.85rem;
    color: #6c757d;
    text-align: center;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 1rem;
}

.btn {
    display: inline-block;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border-radius: 0.25rem;
    border: 1px solid transparent;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out;
}

.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

/* ── Toast notifications ─────────────────────────────── */
.toast-container {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.85rem 1.2rem;
    border-radius: 0.45rem;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
    font-size: 0.9rem;
    min-width: 260px;
    max-width: 360px;
    color: #fff;
    animation: toastIn 0.25s ease forwards, toastOut 0.35s ease 3.2s forwards;
}

.toast i {
    font-size: 1.05rem;
    flex-shrink: 0;
}

.toast-warning {
    background-color: #f59e0b;
}

.toast-info {
    background-color: #3b82f6;
}

.toast-success {
    background-color: #10b981;
}

.toast-error {
    background-color: #ef4444;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(110%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(110%);
    }
}

.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    width: 100%;
    border: none;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}

.btn-outline {
    color: #ffffff;
    border: 1px solid #fff;
    background: transparent;
    padding: 0.25rem 0.5rem;
}

.btn-outline:hover {
    background: #fff;
    color: #333;
}

.error-msg {
    color: #dc3545;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.success-msg {
    color: #198754;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    background: #d1e7dd;
    border: 1px solid #badbcc;
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
}

.pin-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.25rem 0 0.75rem;
    color: #888;
    font-size: 0.85rem;
}

.pin-divider::before,
.pin-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #ddd;
}

.pin-divider span {
    padding: 0 0.75rem;
}

.pin-info {
    color: #555;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* Dashboard Layout */
.app-container {
    display: flex;
    min-height: calc(100vh - 64px);
}

#main-header {
    background: #0f172a;
    color: white;
    height: 64px;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

#main-header nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    height: 100%;
}

.logo {
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: -0.02em;
    color: #fff;
}

.user-menu {
    position: relative;
    flex: 0 0 auto;
}

.user-menu-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    min-height: 40px;
    max-width: min(320px, 42vw);
    padding: 0.28rem 0.5rem 0.28rem 0.35rem;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: #f8fafc;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.user-menu-trigger:hover,
.user-menu-trigger:focus-visible,
.user-menu.open .user-menu-trigger {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(191, 219, 254, 0.48);
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.16);
    outline: none;
}

.user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    color: #0f172a;
    background: linear-gradient(180deg, #dbeafe 0%, #93c5fd 100%);
    border: 1px solid rgba(255, 255, 255, 0.45);
    font-size: 0.78rem;
    font-weight: 850;
}

.user-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0;
}

.user-menu-chevron {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    color: #ffffff;
    background: rgba(96, 165, 250, 0.28);
    border: 1px solid rgba(191, 219, 254, 0.26);
    font-size: 0.74rem;
    transition: transform 0.15s ease;
}

.user-menu-chevron::before {
    content: "";
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid currentColor;
}

.user-menu.open .user-menu-chevron {
    transform: rotate(180deg);
}

.user-menu-dropdown {
    position: absolute;
    top: calc(100% + 0.55rem);
    right: 0;
    z-index: 1200;
    min-width: 210px;
    padding: 0.42rem;
    border: 1px solid #dbe4ef;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.18);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 0.14s ease, transform 0.14s ease, visibility 0.14s ease;
}

.user-menu.open .user-menu-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-menu-item {
    width: 100%;
    min-height: 40px;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem 0.72rem;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #334155;
    cursor: pointer;
    text-align: left;
    font-size: 0.92rem;
    font-weight: 700;
}

.user-menu-item:hover,
.user-menu-item:focus-visible {
    background: #f8fafc;
    color: #0f172a;
    outline: none;
}

.user-menu-item i {
    width: 1rem;
    color: #64748b;
    text-align: center;
}

aside#sidebar-menu {
    width: 250px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    transition: width 0.3s ease, transform 0.3s ease;
    overflow-x: hidden;
    white-space: nowrap;
    flex-shrink: 0;
}

aside#sidebar-menu.collapsed {
    width: 0;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem 1.25rem 1rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(255, 255, 255, 0.02);
}

.sidebar-brand-logo {
    display: block;
    width: min(180px, 100%);
    height: auto;
    object-fit: contain;
}

@media (max-width: 768px) {
    aside#sidebar-menu {
        position: fixed;
        left: 0;
        height: calc(100vh - 64px);
        z-index: 1050;
        transform: translateX(-100%);
        width: 250px;
    }

    aside#sidebar-menu.open {
        transform: translateX(0);
    }

    main[role="main"] {
        padding: 1rem !important;
        width: 100%;
        box-sizing: border-box;
    }

    #main-header nav {
        padding: 0 1rem !important;
        box-sizing: border-box;
    }

    .logo {
        font-size: 1.1rem;
    }

    .user-menu-trigger {
        max-width: 48vw;
        gap: 0.45rem;
    }

    .user-name {
        font-size: 0.84rem;
    }

    .user-menu-dropdown {
        min-width: 190px;
    }
}

#menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

#menu-list li a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: background 0.2s;
}

#menu-list li a i {
    width: 1.1rem;
    text-align: center;
    font-size: 0.95rem;
    flex-shrink: 0;
    color: #475569;
    transition: color 0.2s;
}

#menu-list li a:hover i,
#menu-list li a.active i {
    color: #60a5fa;
}

#menu-list li a:hover {
    background: var(--sidebar-hover);
}

#menu-list li a.active {
    background: rgba(59, 130, 246, 0.12);
    border-left: 3px solid #3b82f6;
    padding-left: calc(1.5rem - 3px);
    color: #93c5fd;
}

.child-menu {
    list-style: none;
    padding: 0;
    background: rgba(0, 0, 0, 0.2);
}

.child-menu li a {
    padding-left: 2.5rem;
    font-size: 0.95rem;
}

main[role="main"] {
    flex: 1;
    padding: 2rem;
    background: #f1f5f9;
    transition: opacity 0.12s ease;
}

main[role="main"].page-transitioning {
    opacity: 0.4;
    pointer-events: none;
}

/* ===== Loading Spinner (CSS-only) ===== */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
    flex-shrink: 0;
}

.spinner-dark {
    border-color: rgba(0, 0, 0, 0.12);
    border-top-color: #0d6efd;
}

.spinner-lg {
    width: 2.5rem;
    height: 2.5rem;
    border-width: 3px;
}

.btn-loading {
    opacity: 0.85;
    pointer-events: none;
}

.btn-loading .spinner {
    margin-right: 6px;
}

/* ===== Mis Abonos ===== */
.mis-abonos-container {
    padding: 0.5rem 0;
}

.page-header {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.page-header h2 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.4rem;
}

.table-loading {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 1.5rem 0;
    color: #555;
    font-size: 0.95rem;
}

.alert-success {
    background: #d1e7dd;
    border: 1px solid #badbcc;
    color: #0a3622;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
}

.alert-danger {
    background: #f8d7da;
    border: 1px solid #f5c2c7;
    color: #58151c;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
}

/* ── Tabulator — diseño moderno ─────────────────────────────────── */
#mis-abonos-table .tabulator {
    border: none;
    border-radius: 0;
    overflow: hidden;
    font-size: 0.875rem;
    background: #fff;
}

#mis-abonos-table .tabulator-header {
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
}

#mis-abonos-table .tabulator-col {
    background: #f8fafc;
    border-right: 1px solid #e2e8f0;
    padding: 0.7rem 0.9rem;
}

/* Checkbox de selección — más espacio para que no se corte */
#mis-abonos-table .tabulator-col:first-child,
#mis-abonos-table .tabulator-cell:first-child {
    padding: 0.5rem 0;
    text-align: center;
    overflow: visible;
}

#mis-abonos-table .tabulator-col:first-child .tabulator-col-title {
    display: flex;
    justify-content: center;
    align-items: center;
    text-transform: none;
    font-size: 1rem;
}

#mis-abonos-table .tabulator-col-title {
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
}

#mis-abonos-table .tabulator-row {
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: background 0.12s ease;
}

#mis-abonos-table .tabulator-row:hover {
    background: #f5f8ff !important;
}

#mis-abonos-table .tabulator-row.tabulator-row-selected {
    background: #eff6ff !important;
    border-left: 3px solid #3b82f6;
}

#mis-abonos-table .tabulator-cell {
    padding: 0.72rem 0.9rem;
    color: #334155;
    border-right: 1px solid #f1f5f9;
}

/* ── Modal de confirmación ──────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: modalFadeIn 0.18s ease;
}

.modal-box {
    background: #fff;
    border-radius: 0.85rem;
    padding: 2rem 2.25rem 1.75rem;
    max-width: 420px;
    width: 90%;
    text-align: center;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.18);
    animation: modalSlideUp 0.2s ease;
}

.modal-icon {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.55rem;
    margin: 0 auto 1.1rem;
}

.modal-icon-warning {
    background: linear-gradient(180deg, #fff7ed 0%, #ffedd5 100%);
    color: #ea580c;
    border: 1px solid #fed7aa;
    box-shadow: 0 10px 24px rgba(234, 88, 12, 0.16);
}

.modal-warning-svg {
    width: 38px;
    height: 38px;
    display: block;
}

.modal-warning-triangle {
    fill: #f97316;
}

.modal-warning-mark {
    fill: none;
    stroke: #fff;
    stroke-width: 5;
    stroke-linecap: round;
}

.modal-warning-dot {
    fill: #fff;
}

.modal-icon-resale {
    position: relative;
    background: linear-gradient(180deg, #ecfeff 0%, #dbeafe 100%);
    color: #0f766e;
    border: 1px solid #bae6fd;
    box-shadow: 0 10px 24px rgba(14, 165, 233, 0.18);
}

.modal-icon-resale .fa-chair {
    transform: translateX(-4px);
}

.modal-icon-resale .fa-arrow-right-arrow-left {
    position: absolute;
    right: 11px;
    bottom: 12px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: #10b981;
    border: 2px solid #fff;
    font-size: 0.66rem;
    box-shadow: 0 6px 14px rgba(16, 185, 129, 0.28);
}

.modal-title {
    margin: 0 0 0.6rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
}

.modal-body {
    color: #64748b;
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0 0 1.6rem;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.btn-outline-neutral {
    border: 1px solid #cbd5e1;
    color: #475569;
    background: transparent;
    padding: 0.6rem 1.4rem;
    border-radius: 0.25rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease;
}

.btn-outline-neutral:hover {
    background: #f1f5f9;
}

.btn-danger {
    background: #ef4444;
    color: #fff;
    padding: 0.6rem 1.4rem;
    border-radius: 0.25rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: background 0.15s ease;
}

.btn-danger:hover {
    background: #dc2626;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes modalSlideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ===== Ventas Page ===== */
.ventas-container {
    padding: 0.5rem 0;
}

.ventas-header {
    margin-bottom: 1.75rem;
}

.ventas-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.ventas-title i {
    color: #3b82f6;
    font-size: 1.15rem;
}

.ventas-empty {
    text-align: center;
    padding: 3.5rem 0;
    color: #94a3b8;
}

.ventas-empty i {
    font-size: 2.5rem;
    margin-bottom: 0.85rem;
    display: block;
}

.ventas-empty p {
    margin: 0;
    font-size: 0.93rem;
}

/* ── Tabulator — Ventas (diseño moderno) ─────────────────────────── */
#ventas-table .tabulator {
    border: none;
    border-radius: 0;
    overflow: hidden;
    font-size: 0.875rem;
    background: #fff;
}

#ventas-table .tabulator-header {
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
}

#ventas-table .tabulator-col {
    background: #f8fafc;
    border-right: 1px solid #e2e8f0;
    padding: 0.7rem 0.9rem;
}

#ventas-table .tabulator-col-title {
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
}

#ventas-table .tabulator-row {
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.1s ease;
}

#ventas-table .tabulator-row:hover {
    background: #f5f8ff !important;
}

#ventas-table .tabulator-cell {
    padding: 0.72rem 0.9rem;
    color: #334155;
    border-right: 1px solid #f1f5f9;
}

/* ── Paginación ─────────────────────────────────────────────────── */
#ventas-table .tabulator-footer {
    background: #fafbfc;
    border-top: 1px solid #e8edf2;
    padding: 0.6rem 0.9rem;
}

#ventas-table .tabulator-footer-contents {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

#ventas-table .tabulator-paginator {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex-wrap: wrap;
}

#ventas-table .tabulator-paginator label {
    font-size: 0.77rem;
    color: #94a3b8;
    margin-right: 0.1rem;
}

#ventas-table .tabulator-page-size {
    border: 1px solid #e2e8f0;
    border-radius: 0.4rem;
    padding: 0.28rem 0.55rem;
    font-size: 0.8rem;
    color: #374151;
    background: #fff;
    cursor: pointer;
    outline: none;
    margin-right: 0.6rem;
    transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

#ventas-table .tabulator-page-size:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.12);
}

#ventas-table .tabulator-page {
    min-width: 30px;
    height: 30px;
    padding: 0 0.45rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.4rem;
    background: #fff;
    color: #475569;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.1s ease, border-color 0.1s ease, color 0.1s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

#ventas-table .tabulator-page:hover:not(:disabled) {
    background: #f1f5f9;
    border-color: #b6c0ce;
    color: #1e293b;
}

#ventas-table .tabulator-page.active {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
    font-weight: 600;
}

#ventas-table .tabulator-page:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

#ventas-table .tabulator-pages {
    display: inline-flex;
    gap: 0.25rem;
}

#ventas-table .tabulator-page-counter {
    font-size: 0.77rem;
    color: #94a3b8;
}

.precio-cell {
    font-weight: 600;
    color: #15803d;
}

/* ── Tabulator — loading overlay moderno ────────────────────────── */
#ventas-table .tabulator-alert {
    background: rgba(248, 250, 252, 0.82);
    backdrop-filter: blur(3px);
}

#ventas-table .tabulator-alert .tabulator-alert-msg {
    background: transparent;
    border: none !important;
    box-shadow: none;
    padding: 0;
    font-size: 0;
    /* oculta cualquier texto residual */
}

/* ── Loader de doble anillo (puro CSS) ──────────────────────────── */
.tbl-loader {
    width: 44px;
    height: 44px;
    position: relative;
}

.tbl-loader::before,
.tbl-loader::after {
    content: '';
    box-sizing: border-box;
    position: absolute;
    border-radius: 50%;
}

/* Anillo exterior — gira en sentido horario */
.tbl-loader::before {
    inset: 0;
    border: 3.5px solid #e2e8f0;
    border-top-color: #3b82f6;
    border-right-color: #3b82f6;
    animation: tbl-spin-cw 0.75s linear infinite;
}

/* Anillo interior — gira en sentido antihorario */
.tbl-loader::after {
    inset: 10px;
    border: 3px solid #e2e8f0;
    border-bottom-color: #93c5fd;
    border-left-color: #93c5fd;
    animation: tbl-spin-ccw 0.9s linear infinite;
}

@keyframes tbl-spin-cw {
    to {
        transform: rotate(360deg);
    }
}

@keyframes tbl-spin-ccw {
    to {
        transform: rotate(-360deg);
    }
}

/* Filtro de fechas para juegos disponibles */
.eventos-filtro {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.filtro-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.filtro-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.filtro-group input.form-control {
    padding: 0.45rem 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.9rem;
    background: #fff;
    cursor: pointer;
    min-width: 160px;
}

.filtro-group input.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
}

/* Panel de asientos de evento */
.asientos-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 1rem 0 0.75rem;
    border-top: 2px solid #e2e8f0;
}

.asientos-panel-header h4 {
    margin: 0;
    font-size: 1rem;
    color: #334155;
}

.asientos-panel-header h4 i {
    margin-right: 0.4rem;
    color: var(--primary-color);
}

.asientos-panel-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.asientos-selected-badge {
    min-height: 35px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.38rem;
    padding: 0.42rem 0.72rem;
    border-radius: 999px;
    color: #64748b;
    background: #f8fafc;
    border: 1px solid #dbe4ef;
    font-size: 0.82rem;
    font-weight: 750;
    white-space: nowrap;
    transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.asientos-selected-badge i {
    color: #94a3b8;
    font-size: 0.76rem;
}

.asientos-selected-badge.has-selection {
    color: #166534;
    background: #dcfce7;
    border-color: #bbf7d0;
}

.asientos-selected-badge.has-selection i {
    color: #16a34a;
}

/* Hint para indicar deslizar la tabla en mobile */
.swipe-hint {
    display: none;
}

@media (max-width: 768px) {
    .swipe-hint {
        display: flex;
        align-items: center;
        gap: 0.55rem;
        background: #eff6ff;
        color: #1d4ed8;
        border: 1px solid #bfdbfe;
        border-radius: 8px;
        padding: 0.55rem 0.85rem;
        font-size: 0.82rem;
        font-weight: 500;
        margin: 0.6rem 0 0.4rem;
        transition: opacity 0.3s ease, transform 0.3s ease;
    }

    .swipe-hint i {
        color: #2563eb;
        font-size: 0.95rem;
        animation: swipe-hint-arrow 1.6s ease-in-out infinite;
    }

    .swipe-hint.swipe-hint-hide {
        opacity: 0;
        transform: translateY(-6px);
        pointer-events: none;
    }
}

@keyframes swipe-hint-arrow {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(8px); }
}

/* ─── Login Form Redesign (lf-*) ────────────────────────────────────────── */

/* Wrapper: dos columnas en desktop */
.lf-wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* ── Panel izquierdo: marca ─────────────────────────────────────────────── */
.lf-brand {
    flex: 0 0 44%;
    background: linear-gradient(155deg, #162a4a 0%, #0f172a 55%, #0b1628 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 3.5rem;
    position: relative;
    overflow: hidden;
}

.lf-brand::before,
.lf-brand::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.lf-brand::before {
    width: 520px;
    height: 520px;
    right: -180px;
    top: -140px;
    border: 1px solid rgba(59, 130, 246, 0.12);
}

.lf-brand::after {
    width: 340px;
    height: 340px;
    left: -110px;
    bottom: -90px;
    border: 1px solid rgba(99, 179, 237, 0.08);
}

.lf-brand-inner {
    position: relative;
    z-index: 1;
    max-width: 360px;
    color: #fff;
}

.lf-brand-icon {
    width: 62px;
    height: 62px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.75rem;
    box-shadow: 0 8px 28px rgba(59, 130, 246, 0.38);
    color: #fff;
}

.lf-brand-icon svg {
    width: 30px;
    height: 30px;
}

.lf-brand-name {
    font-size: 2rem;
    font-weight: 800;
    color: #fff;
    margin: 0 0 0.5rem;
    letter-spacing: -0.03em;
    line-height: 1.15;
}

.lf-brand-name span {
    color: #60a5fa;
}

.lf-brand-tagline {
    font-size: 0.97rem;
    color: #94a3b8;
    line-height: 1.6;
    margin: 0 0 2rem;
}

.lf-brand-perks {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.lf-brand-perks li {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    font-size: 0.875rem;
    color: #cbd5e1;
}

.lf-brand-perks li::before {
    content: '';
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.18);
    border: 1px solid rgba(59, 130, 246, 0.38);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6l2.5 2.5 4.5-4.5' stroke='%2360a5fa' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 12px;
}

/* ── Panel derecho: formulario ──────────────────────────────────────────── */
.lf-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.5rem;
    background: #fff;
}

.lf-card {
    width: 100%;
    max-width: 420px;
}

/* Logo compacto: solo visible en mobile */
.lf-card-logo {
    display: none;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 2rem;
}

.lf-card-logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.lf-card-logo-icon svg {
    width: 20px;
    height: 20px;
}

.lf-card-logo-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
}

/* ── Tipografía del formulario ──────────────────────────────────────────── */
.lf-heading {
    font-size: 1.6rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 0.35rem;
    letter-spacing: -0.02em;
}

.lf-subheading {
    font-size: 0.9rem;
    color: #64748b;
    margin: 0 0 1.75rem;
    line-height: 1.55;
}

.lf-email-note {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    margin: -0.75rem 0 1.35rem;
    padding: 0.75rem 0.85rem;
    border: 1px solid #dbeafe;
    border-left: 3px solid #3b82f6;
    border-radius: 8px;
    background: #eff6ff;
    color: #1e3a8a;
    font-size: 0.86rem;
    line-height: 1.45;
}

.lf-email-note::before {
    content: 'i';
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin-top: 0.02rem;
    border-radius: 50%;
    background: #2563eb;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 800;
    line-height: 18px;
    text-align: center;
}

/* ── Campos ─────────────────────────────────────────────────────────────── */
.lf-field {
    margin-bottom: 1.1rem;
}

.lf-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.45rem;
}

.lf-input {
    width: 100%;
    padding: 0.78rem 1rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.95rem;
    color: #1e293b;
    background: #f8fafc;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    outline: none;
    box-sizing: border-box;
}

.lf-input:focus {
    border-color: #3b82f6;
    background: #fff;
    box-shadow: 0 0 0 3.5px rgba(59, 130, 246, 0.12);
}

.lf-input::placeholder {
    color: #9ca3af;
}

/* ── Alertas inline ─────────────────────────────────────────────────────── */
.lf-alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-left: 3.5px solid #ef4444;
    border-radius: 8px;
    padding: 0.7rem 0.9rem;
    font-size: 0.875rem;
    color: #b91c1c;
    margin-bottom: 1rem;
}

.lf-alert-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-left: 3.5px solid #10b981;
    border-radius: 8px;
    padding: 0.7rem 0.9rem;
    font-size: 0.875rem;
    color: #065f46;
    margin-bottom: 1rem;
}

/* ── Botón principal ────────────────────────────────────────────────────── */
.lf-btn {
    width: 100%;
    padding: 0.85rem 1rem;
    font-size: 0.975rem;
    font-weight: 600;
    border-radius: 10px;
    margin-top: 0.3rem;
    letter-spacing: 0.01em;
    transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.btn-primary.lf-btn {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border: none;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.28);
}

.btn-primary.lf-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 6px 22px rgba(37, 99, 235, 0.38);
    transform: translateY(-1px);
}

.btn-primary.lf-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.28);
}

/* ── Divisor ────────────────────────────────────────────────────────────── */
.lf-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.5rem 0 1rem;
    color: #94a3b8;
    font-size: 0.8rem;
}

.lf-divider::before,
.lf-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #e2e8f0;
}

.lf-divider span {
    padding: 0 0.75rem;
}

/* ── Botón secundario (ghost) ───────────────────────────────────────────── */
.lf-btn-ghost {
    background: transparent !important;
    border: 1.5px solid #e2e8f0 !important;
    color: #475569 !important;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.72rem 1rem;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.lf-btn-ghost:hover {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
    color: #1e293b !important;
}

/* ── Responsive: mobile-first ───────────────────────────────────────────── */
@media (max-width: 768px) {
    .lf-brand {
        display: none;
    }

    .lf-panel {
        background: #0f172a;
        align-items: flex-start;
        padding: 2.5rem 1.25rem;
    }

    .lf-card {
        background: #fff;
        border-radius: 20px;
        padding: 2rem 1.75rem 2.25rem;
        box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
        width: 100%;
    }

    .lf-card-logo {
        display: flex;
    }

    .lf-heading {
        font-size: 1.4rem;
    }
}

@media (min-width: 769px) {
    .lf-panel {
        background: #fff;
    }

    .lf-card {
        padding: 1rem 0;
    }
}

/* ─── App pages — card layout ───────────────────────────────────────────── */

.app-page {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.app-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 4px 16px rgba(0, 0, 0, 0.04);
    padding: 1.5rem 1.75rem;
    border: 1px solid rgba(226, 232, 240, 0.6);
}

/* Quitar padding duplicado de los contenedores dentro de cards */
.app-card .mis-abonos-container,
.app-card .ventas-container {
    padding: 0;
}

/* Títulos de sección dentro de cards */
.page-header h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.01em;
}

.page-header h2 i {
    color: #3b82f6;
    margin-right: 0.1rem;
}

.ventas-title {
    font-size: 1.15rem !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    letter-spacing: -0.01em;
}

.ventas-title i {
    color: #3b82f6 !important;
}

/* Filtro de fechas refinado */
.filtro-group label {
    color: #374151;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.filtro-group input.form-control {
    border-radius: 8px;
    border-color: #e2e8f0;
    background: #f8fafc;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.filtro-group input.form-control:focus {
    border-color: #3b82f6;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

/* Botones de acción en page-header */
.btn-outline-neutral {
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
}

/* Loading state */
.table-loading {
    color: #64748b;
}

/* Mobile tweaks para cards */
@media (max-width: 768px) {
    .app-card {
        border-radius: 8px;
        padding: 1.25rem 1rem;
    }

    .app-page {
        gap: 1rem;
    }
}

/* ===== Data tables polish ===== */
#ventas-table,
#eventos-reventa-table,
#asientos-evento-table {
    width: 100%;
}

#ventas-table .tabulator,
#eventos-reventa-table .tabulator,
#asientos-evento-table .tabulator {
    border: 1px solid #d8e1ee;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

#ventas-table .tabulator-header,
#eventos-reventa-table .tabulator-header,
#asientos-evento-table .tabulator-header {
    background: linear-gradient(180deg, #f8fbff 0%, #eef4fb 100%);
    border-bottom: 1px solid #cbd5e1;
}

#ventas-table .tabulator-col,
#eventos-reventa-table .tabulator-col,
#asientos-evento-table .tabulator-col {
    background: transparent;
    border-right: 1px solid #dbe4ef;
    padding: 0.85rem 0.9rem;
}

#ventas-table .tabulator-col-title,
#eventos-reventa-table .tabulator-col-title,
#asientos-evento-table .tabulator-col-title {
    color: #334155;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.045em;
    text-transform: uppercase;
}

#ventas-table .tabulator-tableholder,
#eventos-reventa-table .tabulator-tableholder,
#asientos-evento-table .tabulator-tableholder {
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

#ventas-table .tabulator-row,
#eventos-reventa-table .tabulator-row,
#asientos-evento-table .tabulator-row {
    border-bottom: 1px solid #e8eef6;
    transition: background 0.15s ease, box-shadow 0.15s ease;
}

#ventas-table .tabulator-row.tabulator-row-even,
#eventos-reventa-table .tabulator-row.tabulator-row-even,
#asientos-evento-table .tabulator-row.tabulator-row-even {
    background: #fbfdff;
}

#ventas-table .tabulator-row:hover,
#eventos-reventa-table .tabulator-row:hover,
#asientos-evento-table .tabulator-row:hover {
    background: #eef7ff !important;
    box-shadow: inset 4px 0 0 #0ea5e9;
}

#asientos-evento-table .tabulator-row.tabulator-row-selected {
    background: #ecfdf5 !important;
    box-shadow: inset 4px 0 0 #10b981;
}

#ventas-table .tabulator-cell,
#eventos-reventa-table .tabulator-cell,
#asientos-evento-table .tabulator-cell {
    border-right: 1px solid #edf2f7;
    color: #263449;
    padding: 0.82rem 0.9rem;
}

#ventas-table .tabulator-footer {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border-top: 1px solid #dbe4ef;
}

.table-event-cell {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    max-width: 100%;
    min-width: 0;
    color: #172033;
    font-weight: 650;
}

.table-event-cell-with-thumb {
    min-height: 46px;
}

.table-event-cell > span:last-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.table-event-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #2563eb;
    background: #dbeafe;
    border: 1px solid #bfdbfe;
    flex: 0 0 auto;
}

.table-event-thumb {
    width: 58px;
    height: 38px;
    border-radius: 8px;
    object-fit: cover;
    background: #e2e8f0;
    border: 1px solid #cbd5e1;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.12);
    flex: 0 0 auto;
}

.table-date-pill,
.table-time-pill,
.table-count-pill,
.table-seat-chip,
.table-status-badge,
.precio-cell {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 28px;
    border-radius: 999px;
    white-space: nowrap;
    line-height: 1;
}

.table-date-pill {
    color: #1e40af;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    padding: 0.34rem 0.68rem;
    font-weight: 700;
    font-size: 0.8rem;
}

.table-time-pill {
    color: #7c2d12;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    padding: 0.34rem 0.64rem;
    font-weight: 750;
    font-size: 0.8rem;
}

.table-count-pill {
    color: #115e59;
    background: #ccfbf1;
    border: 1px solid #99f6e4;
    padding: 0.34rem 0.7rem;
    font-weight: 800;
    font-size: 0.8rem;
}

.table-seat-chip {
    min-width: 34px;
    color: #334155;
    background: #f8fafc;
    border: 1px solid #dbe4ef;
    padding: 0.34rem 0.62rem;
    font-weight: 750;
    font-size: 0.79rem;
}

.table-seat-chip-zone {
    color: #3730a3;
    background: #eef2ff;
    border-color: #c7d2fe;
}

.table-seat-chip-seat {
    color: #0f766e;
    background: #f0fdfa;
    border-color: #99f6e4;
}

.table-status-badge {
    padding: 0.36rem 0.78rem;
    font-size: 0.78rem;
    font-weight: 800;
    border: 1px solid transparent;
}

.table-status-available {
    color: #166534;
    background: #dcfce7;
    border-color: #bbf7d0;
}

.table-status-unavailable {
    color: #991b1b;
    background: #fee2e2;
    border-color: #fecaca;
}

.table-status-used {
    color: #475569;
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.table-status-neutral {
    color: #334155;
    background: #f8fafc;
    border-color: #dbe4ef;
}

.precio-cell {
    color: #166534;
    background: linear-gradient(180deg, #ecfdf5 0%, #dcfce7 100%);
    border: 1px solid #bbf7d0;
    padding: 0.38rem 0.74rem;
    font-size: 0.82rem;
    font-weight: 850;
}

#asientos-evento-table input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: #10b981;
    cursor: pointer;
}

.asientos-table-shell {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 0.2rem;
}

#asientos-evento-table.tabulator {
    display: block;
    width: 100% !important;
    min-width: 0;
}

#asientos-evento-table .tabulator-col {
    padding: 0.68rem 0.55rem;
}

#asientos-evento-table .tabulator-col-content {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

#asientos-evento-table .tabulator-row {
    min-height: 52px;
}

#asientos-evento-table .tabulator-cell {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 52px;
    box-sizing: border-box;
    vertical-align: top;
    padding: 0.58rem 0.55rem;
}

#asientos-evento-table .tabulator-col:first-child,
#asientos-evento-table .tabulator-cell:first-child {
    padding-left: 0;
    padding-right: 0;
}

#asientos-evento-table .tabulator-col:first-child .tabulator-col-content {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

#asientos-evento-table .tabulator-cell:first-child {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

@media (max-width: 768px) {
    #ventas-table .tabulator,
    #eventos-reventa-table .tabulator,
    #asientos-evento-table .tabulator {
        border-radius: 8px;
        box-shadow: none;
    }

    #ventas-table .tabulator-cell,
    #eventos-reventa-table .tabulator-cell,
    #asientos-evento-table .tabulator-cell {
        padding: 0.74rem 0.75rem;
    }

    .table-event-icon {
        width: 26px;
        height: 26px;
    }

    .table-event-thumb {
        width: 50px;
        height: 34px;
    }
}
