/* ============================================================
   BINGO PABLISTA - Sistema de Boletas
   Design System Profesional
   ============================================================ */

:root {
    --primary: #0f172a;
    --primary-2: #1e293b;
    --accent: #6366f1;
    --accent-2: #8b5cf6;
    --rose: #f43f5e;
    --gold: #fbbf24;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #0ea5e9;
    --sidebar-w: 272px;
    --topbar-h: 66px;
    --bg: #f4f6fb;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --border: #e5e9f2;
    --border-strong: #d7dcea;
    --text: #1e293b;
    --text-muted: #64748b;
    --text-soft: #94a3b8;
    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow-sm: 0 2px 6px rgba(15, 23, 42, 0.05);
    --shadow: 0 8px 24px rgba(15, 23, 42, 0.07);
    --shadow-lg: 0 22px 48px rgba(15, 23, 42, 0.14);
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 8px;
    --gradient-accent: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --gradient-dark: linear-gradient(180deg, #0f172a 0%, #16203a 100%);
    --transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background:
        radial-gradient(1000px 480px at 85% -10%, rgba(99, 102, 241, 0.07), transparent 60%),
        radial-gradient(800px 400px at -5% 10%, rgba(139, 92, 246, 0.06), transparent 55%),
        var(--bg);
    background-attachment: fixed;
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: var(--accent); }

::selection { background: rgba(99, 102, 241, 0.18); }

/* ============ SCROLLBAR ============ */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ============ LAYOUT ============ */
.app-layout { min-height: 100vh; }

.app-main {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-content {
    flex: 1;
    padding: 1.9rem 2.1rem;
    max-width: 1440px;
    width: 100%;
    animation: fadeUp 0.35s ease-out;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============ PAGE HEADER ============ */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.6rem;
}

.page-header-title {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.page-header-icon {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    background: var(--gradient-accent);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: 0 10px 22px rgba(99, 102, 241, 0.28);
    flex-shrink: 0;
}

.page-header-title h4 {
    font-weight: 800;
    font-size: 1.35rem;
    letter-spacing: -0.3px;
    margin: 0;
    color: var(--text);
}

.page-header-title .page-subtitle {
    color: var(--text-muted);
    font-size: 0.83rem;
    margin-top: 2px;
}

.page-header-actions {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.chip-meta {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 50rem;
    padding: 0.45rem 0.9rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    box-shadow: var(--shadow-xs);
}

.chip-meta i { color: var(--accent); }

/* ============ SIDEBAR ============ */
.app-sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: var(--sidebar-w);
    background: var(--gradient-dark);
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: transform 0.28s ease;
    box-shadow: 6px 0 30px rgba(15, 23, 42, 0.22);
}

.sidebar {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.15) transparent;
}
.sidebar::-webkit-scrollbar { width: 5px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.3rem 1.25rem 1.1rem;
    background: linear-gradient(180deg, rgba(255,255,255,0.06), transparent);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    position: sticky;
    top: 0;
    z-index: 2;
}

.sidebar-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 13px;
    background: rgba(255,255,255,0.94);
    padding: 4px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.28);
}

.sidebar-brand h3 {
    color: #fff;
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0.2px;
    margin: 0;
}

.sidebar-brand small {
    color: var(--gold);
    font-size: 0.7rem;
    font-weight: 600;
}

.sidebar-close {
    position: absolute;
    top: 1rem;
    right: 0.9rem;
    color: rgba(255,255,255,0.7);
}

.sidebar-nav { flex: 1; padding: 0.8rem 0.9rem; }

.sidebar-section {
    color: rgba(255,255,255,0.38);
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    padding: 1.15rem 0.75rem 0.45rem;
}

.sidebar-section:first-child { padding-top: 0.4rem; }

.nav-link-custom {
    color: rgba(255,255,255,0.74) !important;
    padding: 0.62rem 0.8rem !important;
    margin-bottom: 0.22rem;
    border-radius: 11px;
    font-size: 0.87rem;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-link-custom i {
    margin-right: 0.75rem;
    width: 20px;
    text-align: center;
    font-size: 0.95rem;
    transition: var(--transition);
}

.nav-link-custom:hover {
    color: #fff !important;
    background: rgba(255,255,255,0.07);
    transform: translateX(3px);
}

.nav-link-custom.active {
    color: #fff !important;
    background: var(--gradient-accent);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

.nav-link-custom.active::before {
    content: '';
    position: absolute;
    left: -0.9rem;
    top: 20%;
    bottom: 20%;
    width: 4px;
    border-radius: 0 4px 4px 0;
    background: var(--gradient-accent);
}

.nav-link-custom.active i { color: #fff; }

.sidebar-footer {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding: 0.8rem 0.9rem 1.1rem;
    background: rgba(0,0,0,0.1);
}

.sidebar-footer .log-out:hover { background: rgba(244,63,94,0.16); color: #fda4af !important; }

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(3px);
    z-index: 1030;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease;
}

.sidebar-backdrop.show { opacity: 1; pointer-events: auto; }

/* ============ TOPBAR ============ */
.app-topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    height: var(--topbar-h);
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 1.7rem;
}

.topbar-title span { display: block; margin-bottom: 3px; letter-spacing: 0.4px; }
.topbar-title h6 { font-size: 0.98rem; letter-spacing: -0.2px; }

.btn-icon {
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
}
.btn-icon:hover { background: #f8fafc; color: var(--accent); border-color: var(--accent); transform: translateY(-1px); }

.topbar-user {
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 13px;
    padding: 0.32rem 0.75rem;
    transition: var(--transition);
    box-shadow: var(--shadow-xs);
}
.topbar-user:hover { border-color: var(--accent); box-shadow: var(--shadow); transform: translateY(-1px); }

.avatar {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: var(--gradient-accent);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.95rem;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
}

.dropdown-menu {
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    padding: 0.4rem;
}

.dropdown-item { border-radius: 9px; padding: 0.5rem 0.75rem; font-size: 0.88rem; }
.dropdown-item:hover { background: var(--surface-soft); }

/* ============ CARDS ============ */
.card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xs);
    transition: box-shadow 0.22s ease, transform 0.22s ease;
    background: var(--surface);
    overflow: hidden;
}

.card:hover { box-shadow: var(--shadow); }

.card-header {
    background: linear-gradient(180deg, #ffffff, #fbfcff);
    border-bottom: 1px solid var(--border);
    border-radius: var(--radius) var(--radius) 0 0 !important;
    padding: 1.05rem 1.3rem;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.card-header h5, .card-header h6 {
    margin: 0;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: -0.2px;
}

.card-header h5 i, .card-header h6 i { color: var(--accent); }

.card-body { padding: 1.3rem; }

.card-title-sm {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--text-soft);
    margin-bottom: 0.4rem;
}

/* ============ STAT CARDS ============ */
.stat-card {
    padding: 1.4rem 1.5rem;
    border-radius: var(--radius);
    color: #fff;
    margin-bottom: 1rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
    border: none;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
    isolation: isolate;
}
.stat-card:hover { transform: translateY(-4px); box-shadow: 0 18px 36px rgba(15, 23, 42, 0.18); }

.stat-card::after {
    content: '';
    position: absolute;
    right: -28px;
    top: -34px;
    width: 130px;
    height: 130px;
    background: rgba(255,255,255,0.16);
    border-radius: 50%;
    z-index: -1;
}

.stat-card::before {
    content: '';
    position: absolute;
    right: 34px;
    bottom: -46px;
    width: 96px;
    height: 96px;
    border: 1.5px solid rgba(255,255,255,0.18);
    border-radius: 50%;
    z-index: -1;
}

.stat-icon {
    font-size: 2rem;
    opacity: 0.4;
    position: absolute;
    right: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
}

.stat-number {
    font-size: 1.9rem;
    font-weight: 800;
    line-height: 1.1;
    position: relative;
    z-index: 1;
    letter-spacing: -0.5px;
}

.stat-label {
    opacity: 0.92;
    font-size: 0.82rem;
    font-weight: 500;
    margin-top: 0.2rem;
    position: relative;
    z-index: 1;
}

.stat-primary { background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%); }
.stat-success { background: linear-gradient(135deg, #10b981 0%, #34d399 100%); }
.stat-warning { background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%); }
.stat-info    { background: linear-gradient(135deg, #0ea5e9 0%, #38bdf8 100%); }
.stat-danger  { background: linear-gradient(135deg, #ef4444 0%, #f87171 100%); }

/* ============ BUTTONS ============ */
.btn-custom {
    border-radius: 11px;
    padding: 0.58rem 1.45rem;
    font-weight: 600;
    font-size: 0.87rem;
    transition: var(--transition);
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
}

.btn-custom:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(15,23,42,0.16); }
.btn-custom:active { transform: translateY(0); }

.btn-custom.btn-lg { padding: 0.78rem 1.8rem; font-size: 0.95rem; border-radius: 13px; }

.btn-primary { background: var(--accent); border-color: var(--accent); }
.btn-primary:hover, .btn-primary:focus { background: #4f46e5; border-color: #4f46e5; }
.btn-info { background: var(--info); border-color: var(--info); }
.btn-success { background: var(--success); border-color: var(--success); }
.btn-success:hover, .btn-success:focus { background: #059669; border-color: #059669; }
.btn-danger { background: var(--danger); border-color: var(--danger); }
.btn-warning { background: var(--warning); border-color: var(--warning); }
.btn-outline-custom {
    border: 1px solid var(--border-strong);
    color: var(--text);
    background: var(--surface);
    border-radius: 11px;
    transition: var(--transition);
}
.btn-outline-custom:hover { border-color: var(--accent); color: var(--accent); background: #eef2ff; }

.btn-sm.btn-custom { padding: 0.38rem 0.85rem; font-size: 0.78rem; border-radius: 9px; }

/* ============ BADGES ============ */
.badge-estado {
    padding: 0.38rem 0.9rem;
    border-radius: 50rem;
    font-weight: 600;
    font-size: 0.74rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
}

.badge-pagada { background: #d1fae5; color: #065f46; }
.badge-pendiente { background: #fef3c7; color: #92400e; }
.badge-sinboleta { background: #f1f5f9; color: #475569; }

.badge { font-weight: 600; }

/* ============ TABLES ============ */
.table-custom {
    --bs-table-bg: transparent;
    border-color: var(--border);
}

.table-custom thead th {
    background: linear-gradient(180deg, #f8fafc, #f1f5f9) !important;
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.7px;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border) !important;
    padding: 0.9rem 1.1rem;
    white-space: nowrap;
}

.table-custom td {
    padding: 0.85rem 1.1rem;
    vertical-align: middle;
    border-color: #f1f5f9;
    font-size: 0.87rem;
}

.table-hover tbody tr { transition: background 0.15s ease; }
.table-hover tbody tr:hover { background: #f6f8fc; }

.table-responsive { border-radius: var(--radius-sm); }

.table thead.sticky-top { top: var(--topbar-h); z-index: 1; }

/* Fila marcada como seleccionada */
.fila-seleccionada, .table .fila-seleccionada {
    background: #eef2ff !important;
    box-shadow: inset 3px 0 0 var(--accent);
}

/* ============ FORM CONTROLS ============ */
.form-control, .form-select {
    border-radius: 11px;
    border: 1px solid var(--border-strong);
    padding: 0.58rem 0.9rem;
    font-size: 0.9rem;
    transition: var(--transition);
}

.form-control:focus, .form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 0.22rem rgba(99, 102, 241, 0.13);
}

.form-label { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); letter-spacing: 0.2px; }

.input-group-text {
    border-radius: 11px;
    background: var(--surface-soft);
    color: var(--text-muted);
}

/* Campo con icono dentro */
.search-wrap { position: relative; }
.search-wrap .form-control { padding-left: 2.6rem; }
.search-wrap i {
    position: absolute;
    left: 0.95rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-soft);
    font-size: 0.9rem;
    z-index: 5;
    pointer-events: none;
}

/* ============ PAGINATION ============ */
.pagination .page-link {
    border-radius: 9px;
    margin: 0 0.15rem;
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 0.85rem;
    font-weight: 600;
    transition: var(--transition);
}
.pagination .page-link:hover { color: var(--accent); border-color: var(--accent); background: #eef2ff; transform: translateY(-1px); }
.pagination .active .page-link { background: var(--accent); border-color: var(--accent); box-shadow: 0 6px 14px rgba(99,102,241,0.3); }

/* ============ STEPPER ============ */
.stepper {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 1.6rem;
    flex-wrap: wrap;
}

.step {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.6rem 1.1rem;
    border-radius: 13px;
    border: 1px solid var(--border);
    background: var(--surface);
    transition: var(--transition);
    cursor: default;
}

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-weight: 800;
    font-size: 0.82rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.step-label { font-size: 0.84rem; font-weight: 600; color: var(--text-muted); }

.step.active {
    border-color: rgba(99, 102, 241, 0.5);
    background: #f4f5ff;
    box-shadow: 0 6px 18px rgba(99, 102, 241, 0.14);
}

.step.active .step-number {
    background: var(--gradient-accent);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 6px 14px rgba(99, 102, 241, 0.35);
}

.step.active .step-label { color: var(--accent); }

.step.done .step-number { background: var(--success); border-color: transparent; color: #fff; }
.step.done .step-label { color: var(--success); }

.step-connector {
    width: 26px;
    height: 2px;
    background: var(--border-strong);
    border-radius: 2px;
}
.step-connector.done { background: var(--success); }

/* ============ STUDENT PICKER (ASIGNAR) ============ */
.picker-panel {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    overflow: hidden;
}

.picker-toolbar {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface-soft);
    display: flex;
    gap: 0.7rem;
    flex-wrap: wrap;
}

.picker-list {
    max-height: 430px;
    overflow-y: auto;
}

.picker-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.8rem 1.1rem;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: background 0.16s ease;
}

.picker-item:last-child { border-bottom: none; }
.picker-item:hover { background: #f6f8fc; }
.picker-item.selected { background: #eef2ff; box-shadow: inset 3px 0 0 var(--accent); }

.picker-avatar {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--gradient-accent);
    color: #fff;
    font-weight: 800;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 5px 12px rgba(99, 102, 241, 0.25);
}

.picker-avatar.gold { background: linear-gradient(135deg, #f59e0b, #fbbf24); box-shadow: 0 5px 12px rgba(245, 158, 11, 0.3); }
.picker-avatar.cyan { background: linear-gradient(135deg, #0ea5e9, #38bdf8); box-shadow: 0 5px 12px rgba(14, 165, 233, 0.3); }
.picker-avatar.pink { background: linear-gradient(135deg, #ec4899, #f472b6); box-shadow: 0 5px 12px rgba(236, 72, 153, 0.3); }

.picker-name { font-weight: 600; font-size: 0.9rem; line-height: 1.2; }
.picker-grade { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }

.picker-selected-badge {
    margin-left: auto;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--success);
    color: #fff;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
}
.picker-item.selected .picker-selected-badge { display: inline-flex; }

/* Chips de grados */
.grado-chips { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.grado-chip {
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.32rem 0.75rem;
    border-radius: 50rem;
    cursor: pointer;
    transition: var(--transition);
}
.grado-chip:hover { border-color: var(--accent); color: var(--accent); }
.grado-chip.active {
    background: var(--gradient-accent);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* ============ TICKET SELECTOR (ASIGNAR) ============ */
.ticket-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.7rem;
    max-height: 380px;
    overflow-y: auto;
    padding: 0.15rem;
}

.ticket-card {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    padding: 0.9rem 0.85rem;
    cursor: pointer;
    text-align: center;
    transition: var(--transition);
    position: relative;
}

.ticket-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
    box-shadow: 0 10px 22px rgba(99, 102, 241, 0.16);
}

.ticket-card.selected {
    border-color: var(--accent);
    background: #f4f5ff;
    box-shadow: 0 10px 24px rgba(99, 102, 241, 0.22);
}

.ticket-card.selected::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: -7px;
    right: -7px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--success);
    color: #fff;
    font-size: 0.65rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.4);
}

.ticket-number {
    font-weight: 800;
    font-size: 1rem;
    color: var(--text);
    letter-spacing: -0.2px;
}

.ticket-price {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--accent);
    margin-top: 3px;
}

.ticket-icon { font-size: 1.3rem; color: var(--text-soft); margin-bottom: 4px; }
.ticket-card.selected .ticket-icon { color: var(--accent); transform: scale(1.12); }

/* ============ RESUMEN (ASIGNAR) ============ */
.summary-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: linear-gradient(180deg, #ffffff, #fbfcff);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    position: sticky;
    top: calc(var(--topbar-h) + 1.2rem);
}

.summary-card .summary-head {
    background: var(--gradient-accent);
    color: #fff;
    padding: 1rem 1.3rem;
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.summary-card .summary-head i { font-size: 1.1rem; }
.summary-card .summary-head h6 { margin: 0; font-weight: 700; font-size: 0.95rem; }

.summary-body { padding: 1.3rem; }

.summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.55rem 0;
    border-bottom: 1px dashed var(--border);
    gap: 0.5rem;
}

.summary-row:last-of-type { border-bottom: none; }
.summary-row .sum-label { color: var(--text-muted); font-size: 0.82rem; font-weight: 500; }
.summary-row .sum-value { font-weight: 700; font-size: 0.9rem; text-align: right; }

.summary-placeholder {
    border: 1.5px dashed var(--border-strong);
    border-radius: 12px;
    padding: 1.1rem;
    color: var(--text-soft);
    font-size: 0.83rem;
    text-align: center;
}

.summary-total {
    background: var(--surface-soft);
    border-radius: 12px;
    padding: 0.9rem 1.1rem;
    margin: 0.7rem 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.summary-total .total-label { font-size: 0.8rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.6px; }
.summary-total .total-amount { font-size: 1.45rem; font-weight: 800; color: var(--accent); letter-spacing: -0.5px; }

/* ============ EMPTY STATE ============ */
.empty-state {
    text-align: center;
    padding: 3.2rem 1.5rem;
    color: var(--text-muted);
}

.empty-state .empty-icon {
    width: 74px;
    height: 74px;
    border-radius: 50%;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: var(--text-soft);
    margin-bottom: 1rem;
}

.empty-state h6 { font-weight: 700; color: var(--text); font-size: 1rem; }
.empty-state p { font-size: 0.85rem; margin-bottom: 0.3rem; }

/* ============ LOGIN ============ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background:
        radial-gradient(900px 480px at 85% -10%, rgba(99, 102, 241, 0.28), transparent 60%),
        radial-gradient(700px 420px at -5% 10%, rgba(244, 63, 94, 0.16), transparent 55%),
        linear-gradient(135deg, #0f172a 0%, #1e293b 45%, #312e81 100%);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    width: 540px;
    height: 540px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99,102,241,0.3) 0%, transparent 65%);
    top: -170px;
    right: -130px;
    animation: float 7s ease-in-out infinite;
}

.login-page::after {
    content: '';
    position: absolute;
    width: 480px;
    height: 480px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(244,63,94,0.2) 0%, transparent 65%);
    bottom: -150px;
    left: -130px;
    animation: float 9s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-18px, 18px) scale(1.06); }
}

.login-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 430px;
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(12px);
    border-radius: 24px;
    padding: 2.9rem 2.6rem;
    box-shadow: var(--shadow-lg);
    animation: fadeUp 0.5s ease-out;
}

.login-logo { text-align: center; margin-bottom: 2rem; }

.login-logo img {
    max-height: 96px;
    object-fit: contain;
    margin-bottom: 1rem;
    filter: drop-shadow(0 8px 20px rgba(15,23,42,0.2));
}

.login-logo h2 {
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
    letter-spacing: -0.3px;
    font-size: 1.45rem;
}

.login-logo p { color: var(--text-muted); font-size: 0.9rem; margin: 0.25rem 0 0; }

.login-card .input-group-text {
    background: var(--surface-soft);
    border-right: 0;
}

.login-card .form-control {
    border-left: 0;
    padding: 0.8rem 0.9rem;
    border-radius: 0 11px 11px 0;
}

.login-card .btn-login {
    background: var(--gradient-accent);
    border: none;
    border-radius: 13px;
    padding: 0.9rem;
    font-weight: 700;
    font-size: 0.92rem;
    color: #fff;
    width: 100%;
    letter-spacing: 1px;
    transition: var(--transition);
    box-shadow: 0 12px 26px rgba(99, 102, 241, 0.38);
}

.login-card .btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 34px rgba(99, 102, 241, 0.46);
}

/* ============ SCANNER / RESULTADOS ============ */
.qr-scanner-container {
    max-width: 100%;
    margin: 0 auto;
}

.qr-scanner-container video { border-radius: var(--radius); width: 100%; }

#qr-reader { border: none !important; }
#qr-reader button { border-radius: 10px !important; }
#qr-reader img[alt='Info icon'] { display: none; }

.qr-result { text-align: center; padding: 2rem 1rem; }

.qr-result .icon-check { font-size: 4.5rem; color: var(--success); }
.qr-result .icon-times { font-size: 4.5rem; color: var(--danger); }

/* ============ FLASH / ALERTS ============ */
.alert-floating {
    position: fixed;
    top: calc(var(--topbar-h) + 0.8rem);
    right: 1.25rem;
    z-index: 2100;
    min-width: 320px;
    max-width: 440px;
    border: none;
    border-radius: 14px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.2);
    animation: slideInRight 0.32s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.95rem 1.15rem;
}

.alert-floating .btn-close { margin-left: auto; }

.alert-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-danger, .alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.alert-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

@keyframes slideInRight {
    from { transform: translateX(110%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ============ MODAL ============ */
.modal-content {
    border: none;
    border-radius: 18px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.modal-header {
    border-bottom: 1px solid var(--border);
    background: var(--surface-soft);
    padding: 1.05rem 1.3rem;
}

.modal-footer {
    border-top: 1px solid var(--border);
    padding: 0.9rem 1.3rem;
}

/* ============ FOOTER ============ */
.app-footer {
    text-align: center;
    color: var(--text-soft);
    font-size: 0.78rem;
    padding: 1.15rem;
    border-top: 1px solid var(--border);
    background: rgba(255,255,255,0.7);
    backdrop-filter: blur(6px);
}

/* ============ MODULO ASIGNAR (minimal) ============ */
.asg-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.asg-hero h4 {
    margin: 0;
    font-weight: 800;
    font-size: 1.6rem;
    letter-spacing: -0.4px;
    color: var(--text);
}

.asg-hero p { margin: 0.35rem 0 0; color: var(--text-muted); font-size: 0.9rem; }

.asg-stats { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.asg-stat {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    background: #fff;
    border: 1px solid var(--border);
    padding: 0.42rem 0.9rem;
    border-radius: 50rem;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.asg-stat b { color: var(--accent); }

.asg-progress {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 1.3rem 0 1.6rem;
}

.asg-prog-step {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-soft);
    transition: color 0.25s;
}

.asg-prog-step .asg-prog-dot {
    width: 27px;
    height: 27px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1.5px solid var(--border-strong);
    background: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-soft);
    transition: all 0.25s;
}

.asg-prog-step.active { color: var(--text); }
.asg-prog-step.active .asg-prog-dot { border-color: var(--accent); color: var(--accent); background: #eef2ff; }

.asg-prog-step.done .asg-prog-dot { background: var(--accent); border-color: var(--accent); color: #fff; }

.asg-prog-line { flex: 0 0 46px; height: 2px; background: var(--border); border-radius: 2px; transition: background 0.25s; }
.asg-prog-line.done { background: var(--accent); }

.asg-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 1.5rem;
    align-items: start;
}

.asg-panel {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow-xs);
    overflow: hidden;
    margin-bottom: 1.3rem;
}

.asg-panel-head {
    padding: 1.05rem 1.3rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.asg-panel-title {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-weight: 700;
    font-size: 0.95rem;
}

.asg-panel-title .asg-num {
    width: 25px;
    height: 25px;
    border-radius: 8px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.asg-panel-title.active .asg-num { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 4px 10px rgba(99,102,241,.28); }

.asg-panel-body { padding: 1.25rem; }

.asg-search { position: relative; }
.asg-search i { position: absolute; left: 0.95rem; top: 50%; transform: translateY(-50%); color: var(--text-soft); font-size: 0.85rem; z-index: 2; }
.asg-search input { padding-left: 2.5rem; }

.asg-chips { display: flex; gap: 0.45rem; flex-wrap: wrap; }

.asg-chip {
    padding: 0.35rem 0.85rem;
    border: 1px solid var(--border-strong);
    border-radius: 50rem;
    background: #fff;
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.18s;
}

.asg-chip:hover { border-color: var(--accent); color: var(--accent); }

.asg-chip.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 4px 10px rgba(99,102,241,.25);
}

.asg-list { max-height: 430px; overflow-y: auto; }

.asg-student {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.8rem 1.15rem;
    border-bottom: 1px solid #f1f3f7;
    cursor: pointer;
    transition: background 0.15s;
    position: relative;
}

.asg-student:last-child { border-bottom: 0; }
.asg-student:hover { background: #f8faff; }

.asg-student.selected { background: #eef2ff; box-shadow: inset 3px 0 0 var(--accent); }

.asg-avatar {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.asg-avatar.tone-1 { background: #eef2ff; color: #4338ca; }
.asg-avatar.tone-2 { background: #f5f3ff; color: #6d28d9; }
.asg-avatar.tone-3 { background: #e0f2fe; color: #0369a1; }
.asg-avatar.tone-4 { background: #ecfdf5; color: #047857; }
.asg-avatar.tone-5 { background: #fdf2f8; color: #be185d; }

.asg-student-info .asg-name { font-weight: 600; font-size: 0.9rem; color: var(--text); }
.asg-student-info .asg-grade { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }

.asg-student-flag {
    margin-left: auto;
    display: none;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--success);
}

.asg-student.selected .asg-student-flag { display: inline-flex; }

.asg-count { font-size: 0.76rem; font-weight: 600; color: var(--text-soft); }

.asg-footer {
    padding: 1rem 1.3rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
    background: #fcfdff;
}

.asg-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: none;
    border-radius: 10px;
    padding: 0.65rem 1.4rem;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    transition: all 0.2s;
}

.asg-btn:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; transform: none !important; }

.asg-btn-primary { background: var(--accent); color: #fff; box-shadow: 0 8px 18px rgba(99,102,241,.28); }
.asg-btn-primary:hover:not(:disabled) { background: #4f46e5; transform: translateY(-2px); box-shadow: 0 12px 24px rgba(99,102,241,.36); }

.asg-btn-ghost { background: #fff; color: var(--text-muted); border: 1px solid var(--border-strong); }
.asg-btn-ghost:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }

.asg-tickets {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.7rem;
    max-height: 410px;
    overflow-y: auto;
    padding: 0.1rem;
}

.asg-ticket {
    border: 1px solid var(--border);
    border-radius: 13px;
    padding: 1rem 0.8rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.18s;
    position: relative;
    background: #fff;
    display: block;
    margin: 0;
}

.asg-ticket .ticket-input { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }

.asg-ticket:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); transform: translateY(-2px); }

.asg-ticket.selected { border-color: var(--accent); background: #f1f3ff; box-shadow: 0 8px 20px rgba(99,102,241,.12); }

.asg-ticket.selected::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: -7px;
    right: -7px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--success);
    color: #fff;
    font-size: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(16,185,129,.35);
}

.asg-ticket-ico { font-size: 1.25rem; color: var(--text-soft); margin-bottom: 0.35rem; }
.asg-ticket.selected .asg-ticket-ico { color: var(--accent); }

.asg-ticket-code { font-weight: 800; font-size: 0.95rem; letter-spacing: -0.2px; color: var(--text); }
.asg-ticket-price { margin-top: 4px; font-size: 0.78rem; font-weight: 600; color: var(--accent); }

.asg-summary {
    position: sticky;
    top: calc(var(--topbar-h) + 1.2rem);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.asg-summary-head {
    padding: 1.05rem 1.3rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 700;
    font-size: 0.92rem;
}

.asg-summary-head i { color: var(--accent); }

.asg-summary-body { padding: 1.3rem; }

.asg-summary-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 1.1px;
    text-transform: uppercase;
    color: var(--text-soft);
    margin-bottom: 0.5rem;
}

.asg-placeholder {
    border: 1.5px dashed var(--border-strong);
    border-radius: 12px;
    padding: 1.3rem 1rem;
    text-align: center;
    color: var(--text-soft);
    font-size: 0.83rem;
}

.asg-placeholder i { font-size: 1.3rem; display: block; margin-bottom: 0.55rem; }

.asg-user-row { display: flex; align-items: center; gap: 0.8rem; }

.asg-user-meta .asg-name { font-weight: 700; font-size: 0.92rem; color: var(--text); }
.asg-user-meta .asg-grade { font-size: 0.76rem; color: var(--text-muted); margin-top: 2px; }

.asg-link-btn {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 0.76rem;
    font-weight: 600;
    padding: 0;
    cursor: pointer;
}
.asg-link-btn:hover { text-decoration: underline; }

.asg-divider { height: 1px; background: var(--border); margin: 1rem 0; }

.asg-kv { display: flex; justify-content: space-between; align-items: center; padding: 0.45rem 0; gap: 0.75rem; }
.asg-kv .asg-k { color: var(--text-muted); font-size: 0.82rem; }
.asg-kv .asg-v { font-weight: 700; font-size: 0.9rem; text-align: right; }

.asg-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8faff;
    border: 1px solid #e7eaff;
    border-radius: 12px;
    padding: 0.85rem 1rem;
    margin: 0.6rem 0 1.1rem;
}

.asg-total .asg-tl { font-size: 0.74rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.6px; }
.asg-total .asg-ta { font-size: 1.4rem; font-weight: 800; color: var(--accent); letter-spacing: -0.5px; }

.asg-submit {
    width: 100%;
    background: var(--gradient-accent);
    border: none;
    border-radius: 11px;
    padding: 0.85rem;
    color: #fff;
    font-weight: 700;
    font-size: 0.92rem;
    letter-spacing: 0.3px;
    box-shadow: 0 10px 22px rgba(99,102,241,.3);
    transition: all 0.2s;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.asg-submit:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 14px 28px rgba(99,102,241,.4); }
.asg-submit:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }

.asg-note { text-align: center; font-size: 0.74rem; color: var(--text-soft); margin-top: 0.9rem; }

.asg-empty { text-align: center; padding: 2.6rem 1.2rem; }
.asg-empty i { font-size: 1.8rem; color: var(--text-soft); margin-bottom: 0.7rem; }
.asg-empty h6 { font-size: 0.95rem; font-weight: 700; }
.asg-empty p { font-size: 0.82rem; color: var(--text-muted); margin: 0.15rem 0 0; }

.asg-fade { animation: fadeUp 0.3s ease-out; }

@media (max-width: 991.98px) {
    .asg-layout { grid-template-columns: 1fr; }
    .asg-summary { position: static; }
}

/* ============ RESPONSIVE ============ */
@media (min-width: 992px) {
    .menu-toggle, .sidebar-close { display: none; }
}

@media (max-width: 991.98px) {
    .app-sidebar { transform: translateX(-100%); }
    .app-sidebar.open { transform: translateX(0); }
    .app-main { margin-left: 0; }
    .app-content { padding: 1.3rem 1rem; }
}

@media (max-width: 575.98px) {
    .stat-number { font-size: 1.5rem; }
    .login-card { padding: 2.1rem 1.5rem; }
    .alert-floating { min-width: 0; left: 1rem; right: 1rem; }
    .btn-custom { width: 100%; margin-bottom: 0.35rem; }
    .page-header-title h4 { font-size: 1.15rem; }
    .page-header-icon { width: 42px; height: 42px; font-size: 1rem; }
    .ticket-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
}