/* ── Variables ─────────────────────────────────────────────────── */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #8b5cf6;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;
    --dark: #0f172a;
    --body-bg: #f1f5f9;
    --card-shadow: 0 1px 3px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.06);
    --sidebar-width: 240px;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* ── Reset / Base ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
body { font-family: 'Inter', system-ui, sans-serif; background: var(--body-bg); color: #1e293b; }
.fw-black { font-weight: 900 !important; }
.py-6 { padding-top: 5rem !important; padding-bottom: 5rem !important; }
.px-6 { padding-left: 3rem !important; padding-right: 3rem !important; }
.text-white-75 { color: rgba(255,255,255,.75) !important; }
.x-small { font-size: .75rem; }

/* ── Gradient Background ───────────────────────────────────────── */
.bg-primary-gradient { background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%) !important; }

/* ── Navbar ────────────────────────────────────────────────────── */
.navbar.bg-primary-gradient { border-bottom: 1px solid rgba(255,255,255,.1); }
.navbar-brand { letter-spacing: -.5px; }
.nav-link { font-weight: 500; }

/* ── Hero ──────────────────────────────────────────────────────── */
.hero-section {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #6366f1 100%);
    position: relative;
    overflow: hidden;
    padding: 5rem 0;
}
.hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Ccircle cx='30' cy='30' r='30'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-overlay { display: none; }
.min-vh-hero { min-height: 70vh; padding: 2rem 0; }
.badge-hero {
    background: rgba(255,255,255,.15);
    color: #fff;
    border: 1px solid rgba(255,255,255,.25);
    backdrop-filter: blur(4px);
    font-size: .8rem;
    padding: .4em .8em;
    border-radius: 999px;
}
.text-gradient-gold {
    background: linear-gradient(90deg, #fbbf24, #f59e0b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.btn-gold {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    border: none;
    font-weight: 700;
    transition: all .2s;
}
.btn-gold:hover { background: linear-gradient(135deg, #d97706, #b45309); color: #fff; transform: translateY(-1px); }

/* Ticket card in hero */
.hero-illustration { display: flex; justify-content: center; }
.ticket-card {
    background: rgba(255,255,255,.15);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,.25);
    border-radius: 20px;
    padding: 2rem;
    min-width: 280px;
}
.ticket-header { color: #fff; font-weight: 700; font-size: 1.1rem; margin-bottom: 1rem; }
.ticket-numbers { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.ticket-num {
    background: rgba(255,255,255,.2);
    color: #fff;
    font-weight: 700;
    padding: .4rem .7rem;
    border-radius: 8px;
    font-size: .9rem;
}
.ticket-price { color: rgba(255,255,255,.8); font-size: .9rem; }
.ticket-badges { display: flex; gap: .5rem; flex-wrap: wrap; }
.num-badge { padding: .3em .6em; border-radius: 6px; font-size: .75rem; font-weight: 600; }
.num-available { background: rgba(16,185,129,.2); color: #10b981; }
.num-reserved  { background: rgba(245,158,11,.2); color: #f59e0b; }
.num-paid      { background: rgba(239,68,68,.2);  color: #ef4444; }

/* ── Step Cards ────────────────────────────────────────────────── */
.step-card {
    background: #fff;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--card-shadow);
    position: relative;
}
.step-number {
    position: absolute;
    top: -1rem;
    left: 1.5rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    font-weight: 900;
    font-size: 1.25rem;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.step-icon {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 1rem auto;
}

/* ── Benefit items ─────────────────────────────────────────────── */
.benefit-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}
.benefit-visual { background: #fff; border-radius: 20px; box-shadow: var(--card-shadow); }
.stat-mini-card {
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

/* ── Rifa Cards ────────────────────────────────────────────────── */
.rifa-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    overflow: hidden;
    transition: transform .2s, box-shadow .2s;
}
.rifa-card:hover { transform: translateY(-4px); box-shadow: 0 8px 32px rgba(0,0,0,.12); }
.rifa-card-img { height: 200px; overflow: hidden; }
.rifa-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.rifa-card:hover .rifa-card-img img { transform: scale(1.05); }
.rifa-card-no-img { height: 200px; background: #f1f5f9; }

/* ── CTA Section ───────────────────────────────────────────────── */
.cta-section { background: linear-gradient(135deg, #4f46e5, #7c3aed); }

/* ── Footer ────────────────────────────────────────────────────── */
.footer-dark { background: #0f172a; }
.footer-dark .text-muted { color: #94a3b8 !important; }
.footer-dark a.text-muted,
.footer-dark a.text-muted:visited { color: #94a3b8 !important; }
.footer-dark a:hover { color: #fff !important; }

/* ── Auth ──────────────────────────────────────────────────────── */
.auth-body {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}
.auth-container { width: 100%; max-width: 420px; }
.brand-logo {
    width: 64px;
    height: 64px;
    background: rgba(255,255,255,.15);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,.25);
}
.auth-card {
    background: rgba(255,255,255,.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 20px;
    padding: 2rem;
    color: #fff;
}
.auth-card-header h2 { color: #fff; }
.auth-body .form-label { color: rgba(255,255,255,.9); }
.input-group-auth .input-group-text {
    background: rgba(255,255,255,.1);
    border-color: rgba(255,255,255,.2);
    color: rgba(255,255,255,.7);
}
.form-control-auth {
    background: rgba(255,255,255,.1);
    border-color: rgba(255,255,255,.2);
    color: #fff;
}
.form-control-auth::placeholder { color: rgba(255,255,255,.5); }
.form-control-auth:focus {
    background: rgba(255,255,255,.15);
    border-color: rgba(255,255,255,.5);
    color: #fff;
    box-shadow: 0 0 0 3px rgba(255,255,255,.1);
}
.btn-primary-auth {
    background: #fff;
    color: var(--primary);
    border: none;
    font-weight: 700;
    padding: .75rem;
    border-radius: 10px;
    transition: all .2s;
}
.btn-primary-auth:hover { background: #f1f5f9; color: var(--primary-dark); }

/* ── Stat Cards ────────────────────────────────────────────────── */
.stat-card {
    background: #fff;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--card-shadow);
    position: relative;
    overflow: hidden;
}
.stat-card::before {
    content: '';
    position: absolute;
    top: -20px;
    right: -20px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    opacity: .06;
}
.stat-card-primary::before { background: var(--primary); }
.stat-card-success::before { background: var(--success); }
.stat-card-warning::before { background: var(--warning); }
.stat-card-info::before    { background: var(--info); }
.stat-card-icon { font-size: 1.5rem; margin-bottom: .75rem; }
.stat-card-primary .stat-card-icon { color: var(--primary); }
.stat-card-success .stat-card-icon { color: var(--success); }
.stat-card-warning .stat-card-icon { color: var(--warning); }
.stat-card-info .stat-card-icon    { color: var(--info); }
.stat-card-value { font-size: 1.75rem; font-weight: 900; line-height: 1.2; color: #0f172a; }
.stat-card-label { color: #64748b; font-size: .85rem; font-weight: 500; }

/* ── Public Rifa Page ──────────────────────────────────────────── */
.rifa-show-header {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
}
.rifa-main-img { height: 380px; object-fit: cover; }
.rifa-no-image { height: 380px; background: #f1f5f9; border-radius: 12px; }
.rifa-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.rifa-info-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: .75rem 1rem;
}
.rifa-info-label { display: block; font-size: .75rem; color: #64748b; margin-bottom: .15rem; }
.rifa-info-value { display: block; }

/* Numbers grid */
.numbers-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.number-btn {
    width: 52px;
    height: 38px;
    border: 2px solid transparent;
    border-radius: 8px;
    font-size: .8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all .12s;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}
.number-btn.num-available {
    background: #dcfce7;
    color: #15803d;
    border-color: #86efac;
}
.number-btn.num-available:hover {
    background: #16a34a;
    color: #fff;
    border-color: #16a34a;
    transform: scale(1.08);
}
.number-btn.num-available.selected {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary-dark);
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(99,102,241,.4);
}
.number-btn.num-reserved {
    background: #fef3c7;
    color: #92400e;
    border-color: #fcd34d;
    cursor: not-allowed;
    opacity: .85;
}
.number-btn.num-paid {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fca5a5;
    cursor: not-allowed;
    opacity: .85;
}
.legend-dot { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }

/* ── Admin Layout ──────────────────────────────────────────────── */
.admin-body { background: var(--body-bg); margin: 0; padding: 0; overflow-x: hidden; }

.admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--dark);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: width .25s ease;
    overflow-y: auto;
    overflow-x: hidden;
}
.admin-sidebar.collapsed { width: 64px; }

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 1.25rem 1rem;
    color: #fff;
    font-weight: 800;
    font-size: 1rem;
    border-bottom: 1px solid rgba(255,255,255,.08);
    white-space: nowrap;
    overflow: hidden;
}
.admin-sidebar.collapsed .sidebar-brand span { display: none; }

.sidebar-nav { padding: 1rem 0.5rem; flex: 1; }
.sidebar-section-title {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: #94a3b8;
    padding: 0 .5rem;
    margin-bottom: .5rem;
}
.admin-sidebar.collapsed .sidebar-section-title { display: none; }

.sidebar-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .6rem .75rem;
    color: #94a3b8;
    text-decoration: none;
    border-radius: 10px;
    font-size: .9rem;
    font-weight: 500;
    transition: all .15s;
    white-space: nowrap;
    overflow: hidden;
    margin-bottom: 2px;
}
.sidebar-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar-link.active { background: var(--primary); color: #fff; }
.sidebar-link i { font-size: 1rem; min-width: 20px; text-align: center; }
.admin-sidebar.collapsed .sidebar-link span { display: none; }

.sidebar-footer {
    padding: 1rem 0.5rem;
    border-top: 1px solid rgba(255,255,255,.08);
}
.sidebar-user {
    display: flex;
    align-items: center;
    gap: .5rem;
    color: #cbd5e1;
    font-size: .85rem;
    padding: .5rem .75rem;
    white-space: nowrap;
    overflow: hidden;
}
.admin-sidebar.collapsed .sidebar-user span { display: none; }

.admin-main {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left .25s ease;
}
.admin-main.expanded { margin-left: 64px; }

.admin-topbar {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 100;
    gap: 1rem;
}
.sidebar-toggle { font-size: 1.25rem; }

.admin-content {
    padding: 2rem 1.5rem;
    flex: 1;
}

/* ── Toast copy ────────────────────────────────────────────────── */
.toast-copy {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: #0f172a;
    color: #fff;
    padding: .75rem 1.25rem;
    border-radius: 10px;
    font-size: .9rem;
    font-weight: 500;
    z-index: 9999;
    animation: fadeInUp .3s ease;
    box-shadow: 0 4px 20px rgba(0,0,0,.25);
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Admin sidebar overlay (mobile) ────────────────────────────── */
.admin-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 999;
    cursor: pointer;
}
.admin-overlay.active { display: block; }

/* ── Table → Cards on mobile ───────────────────────────────────── */
@media (max-width: 576px) {
    .table-mobile-cards { border-collapse: separate; border-spacing: 0; }
    .table-mobile-cards thead { display: none; }
    .table-mobile-cards tbody tr {
        display: block;
        background: #fff;
        border-radius: 12px;
        border: 1px solid #e2e8f0;
        box-shadow: 0 1px 4px rgba(0,0,0,.05);
        margin-bottom: .75rem;
        overflow: hidden;
    }
    .table-mobile-cards tbody td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: .55rem .875rem;
        border-bottom: 1px solid #f1f5f9 !important;
        border-top: none !important;
        font-size: .8rem;
        gap: .5rem;
        min-height: 36px;
    }
    .table-mobile-cards tbody td:last-child { border-bottom: none !important; }
    .table-mobile-cards tbody td[data-label]::before {
        content: attr(data-label);
        font-size: .7rem;
        font-weight: 700;
        color: #64748b;
        text-transform: uppercase;
        letter-spacing: .04em;
        white-space: nowrap;
        flex-shrink: 0;
        min-width: 80px;
    }
    /* First cell (name/title) gets slightly highlighted */
    .table-mobile-cards tbody tr td:first-child {
        background: #f8fafc;
        font-weight: 600;
        border-bottom: 2px solid #e2e8f0 !important;
    }
    .table-mobile-cards tbody tr td:first-child::before { display: none; }
}

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .admin-sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-width);
    }
    .admin-sidebar.open { transform: translateX(0); }
    .admin-main { margin-left: 0; }
    .rifa-main-img { height: 220px; }
    .rifa-info-grid { grid-template-columns: 1fr; }
    .number-btn { width: 44px; height: 34px; font-size: .75rem; }
    .hero-stats { gap: 1.5rem !important; }
    .min-vh-hero { min-height: auto; }
    .numbers-grid { gap: 3px; }
    /* Admin topbar tighter on mobile */
    .admin-content { padding: 1rem; }
    .admin-topbar { padding: .75rem 1rem; }
    /* Stack form filter rows on mobile */
    .admin-filter-row .col-md-5,
    .admin-filter-row .col-md-3 { width: 100%; }
}

@media (max-width: 480px) {
    .number-btn { width: 38px; height: 30px; font-size: .7rem; }
    /* Stat cards: always 2 per row on phones */
    .stat-card-value { font-size: 1.4rem; }
}
