:root {
    --primary: #0ea5e9;
    --primary-dark: #0284c7;
    --secondary: #06b6d4;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --dark: #0f172a;
    --sidebar-width: 260px;
}

* { box-sizing: border-box; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #f1f5f9;
    color: #334155;
}

/* ===== AUTH PAGES ===== */
.auth-body {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #0ea5e9 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-card {
    background: #fff;
    border-radius: 20px;
    padding: 48px 40px;
    width: 100%;
    max-width: 460px;
    box-shadow: 0 30px 60px rgba(0,0,0,0.3);
    animation: slideUp 0.4s ease;
}

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

.auth-logo {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    margin-bottom: 8px;
}

.auth-logo i { font-size: 2rem; }

/* ===== SIDEBAR ===== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--sidebar-width);
    background: var(--dark);
    z-index: 1000;
    overflow-y: auto;
    transition: transform 0.3s ease;
}

.sidebar-brand {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.sidebar-nav {
    padding: 16px 0;
}

.nav-section {
    padding: 8px 20px 4px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #475569;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 20px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.sidebar-link:hover, .sidebar-link.active {
    color: #fff;
    background: rgba(14, 165, 233, 0.12);
    border-left-color: var(--primary);
}

.sidebar-link i { width: 18px; text-align: center; font-size: 0.95rem; }

.sidebar-user {
    position: absolute;
    bottom: 0;
    width: 100%;
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
    background: rgba(0,0,0,0.2);
}

.sidebar-user .user-name { color: #fff; font-size: 0.85rem; font-weight: 600; }
.sidebar-user .user-role { color: #64748b; font-size: 0.75rem; }

/* ===== MAIN CONTENT ===== */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.topbar {
    background: #fff;
    height: 64px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.topbar-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--dark);
    flex: 1;
}

.page-body { padding: 28px 24px; }

/* ===== STAT CARDS ===== */
.stat-card {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.stat-card:hover { transform: translateY(-3px); box-shadow: 0 12px 24px rgba(0,0,0,0.08); }

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 80px; height: 80px;
    border-radius: 0 0 0 80px;
    opacity: 0.08;
}

.stat-card.primary::before { background: var(--primary); }
.stat-card.success::before { background: var(--success); }
.stat-card.warning::before { background: var(--warning); }
.stat-card.danger::before { background: var(--danger); }
.stat-card.purple::before { background: #8b5cf6; }

.stat-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem;
    margin-bottom: 16px;
}

.stat-icon.primary { background: rgba(14,165,233,0.12); color: var(--primary); }
.stat-icon.success { background: rgba(16,185,129,0.12); color: var(--success); }
.stat-icon.warning { background: rgba(245,158,11,0.12); color: var(--warning); }
.stat-icon.danger { background: rgba(239,68,68,0.12); color: var(--danger); }
.stat-icon.purple { background: rgba(139,92,246,0.12); color: #8b5cf6; }

.stat-value { font-size: 1.8rem; font-weight: 800; color: var(--dark); line-height: 1; margin-bottom: 6px; }
.stat-label { font-size: 0.82rem; color: #64748b; font-weight: 500; }

/* ===== CARDS ===== */
.card {
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: none;
}

.card-header {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    padding: 20px 24px;
    font-weight: 700;
    border-radius: 16px 16px 0 0 !important;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-body { padding: 24px; }

/* ===== TABLES ===== */
.table { margin: 0; }
.table thead th {
    background: #f8fafc;
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
}

.table tbody td { padding: 14px 16px; vertical-align: middle; color: #334155; }
.table tbody tr:hover { background: #f8fafc; }

/* ===== BADGES ===== */
.badge-status {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-available { background: rgba(16,185,129,0.12); color: var(--success); }
.badge-active { background: rgba(14,165,233,0.12); color: var(--primary); }
.badge-used { background: rgba(100,116,139,0.12); color: #64748b; }
.badge-expired { background: rgba(239,68,68,0.12); color: var(--danger); }
.badge-pending { background: rgba(245,158,11,0.12); color: var(--warning); }
.badge-completed { background: rgba(16,185,129,0.12); color: var(--success); }
.badge-failed { background: rgba(239,68,68,0.12); color: var(--danger); }

/* ===== TICKETS ===== */
.ticket-card {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    border-radius: 16px;
    color: #fff;
    padding: 24px;
    position: relative;
    overflow: hidden;
    margin-bottom: 16px;
}

.ticket-card::after {
    content: '';
    position: absolute;
    right: -30px; top: -30px;
    width: 140px; height: 140px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
}

.ticket-code {
    font-family: 'Courier New', monospace;
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: 4px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.ticket-perforations {
    display: flex;
    justify-content: space-between;
    margin: 16px -24px;
    position: relative;
}

.ticket-perforations::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 16px; right: 16px;
    border-top: 2px dashed rgba(255,255,255,0.3);
    transform: translateY(-50%);
}

/* ===== PLANS ===== */
.plan-card {
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    height: 100%;
}

.plan-card:hover, .plan-card.selected {
    border-color: var(--primary);
    background: rgba(14,165,233,0.05);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(14,165,233,0.15);
}

.plan-price {
    font-size: 2rem;
    font-weight: 800;
    color: var(--dark);
    line-height: 1;
}

.plan-duration {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    margin: 8px 0;
}

/* ===== LANDING PAGE ===== */
.hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 60%, #0ea5e9 100%);
    min-height: 100vh;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.hero::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%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.navbar-custom {
    background: rgba(15,23,42,0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding: 16px 0;
}

.navbar-brand-text {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary) !important;
}

.feature-icon {
    width: 60px; height: 60px;
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.6rem;
    margin: 0 auto 20px;
}

.pricing-card {
    background: #fff;
    border-radius: 20px;
    padding: 32px 24px;
    text-align: center;
    border: 2px solid #e2e8f0;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.pricing-card.featured {
    border-color: var(--primary);
    transform: scale(1.05);
}

.pricing-card:hover { box-shadow: 0 20px 40px rgba(0,0,0,0.1); }

.pricing-card .badge-featured {
    position: absolute;
    top: 16px; right: 16px;
    background: var(--primary);
    color: #fff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
}

/* ===== BUTTONS ===== */
.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }

.btn-icon {
    width: 36px; height: 36px;
    border-radius: 8px;
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0;
    font-size: 0.85rem;
}

/* ===== FORM ===== */
.form-control, .form-select {
    border-radius: 10px;
    border-color: #e2e8f0;
    padding: 10px 14px;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(14,165,233,0.15);
}

/* ===== QR CODE ===== */
.qr-wrapper {
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    display: inline-block;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .page-body { padding: 16px; }
}

/* ===== PRINT TICKET ===== */
@media print {
    .no-print { display: none !important; }
    .ticket-print-card {
        border: 2px solid #000;
        border-radius: 8px;
        padding: 20px;
        margin: 10px;
        page-break-inside: avoid;
        width: 280px;
        display: inline-block;
    }
}

/* ===== UTILITIES ===== */
.text-gradient {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
}

.rounded-xl { border-radius: 16px !important; }
.rounded-2xl { border-radius: 20px !important; }
.fw-800 { font-weight: 800; }

.avatar {
    width: 38px; height: 38px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: #fff;
    background: var(--primary);
    flex-shrink: 0;
}
