/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #667eea;
    --primary-dark: #5a67d8;
    --secondary: #764ba2;
    --success: #48bb78;
    --danger: #fc8181;
    --warning: #f6ad55;
    --info: #63b3ed;
    --dark: #2d3748;
    --gray: #718096;
    --light-gray: #e2e8f0;
    --bg: #f7fafc;
    --white: #ffffff;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 10px 30px rgba(0, 0, 0, 0.15);
    --radius: 12px;
    --transition: all 0.3s ease;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg);
    color: var(--dark);
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ===== LOGIN / REGISTER PAGE ===== */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    padding: 20px;
}

.auth-box {
    background: var(--white);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 440px;
    padding: 40px;
    position: relative;
    overflow: hidden;
}

.auth-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.auth-logo {
    text-align: center;
    margin-bottom: 30px;
}

.auth-logo h1 {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 5px;
}

.auth-logo p {
    color: var(--gray);
    font-size: 14px;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: 250px;
    height: 100vh;
    background: var(--white);
    position: fixed;
    left: 0;
    top: 0;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
    overflow-y: auto;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid var(--light-gray);
}

.sidebar-header h3 {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-header .logo-icon {
    font-size: 32px;
    color: var(--primary);
    display: block;
    margin-bottom: 5px;
}

.sidebar-menu {
    list-style: none;
    padding: 10px 0;
}

.sidebar-menu li {
    margin: 2px 15px;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    border-radius: 10px;
    color: var(--gray);
    font-weight: 500;
    transition: var(--transition);
    font-size: 14px;
}

.sidebar-menu li a:hover {
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary);
}

.sidebar-menu li a.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--white);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.sidebar-menu li a i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.sidebar-menu .user-info {
    padding: 15px 20px;
    border-top: 1px solid var(--light-gray);
    margin-top: 10px;
}

.sidebar-menu .user-info .name {
    font-weight: 600;
    color: var(--dark);
}

.sidebar-menu .user-info .role {
    font-size: 12px;
    color: var(--gray);
}

/* ===== MAIN CONTENT ===== */
.main-content {
    margin-left: 250px;
    min-height: 100vh;
    padding: 0;
}

.content {
    padding: 20px 30px;
}

/* ===== TOP BAR ===== */
.topbar {
    background: var(--white);
    padding: 15px 30px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 999;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.topbar-left .menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--dark);
    cursor: pointer;
}

.topbar-left h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--dark);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.topbar-right .notification {
    position: relative;
    cursor: pointer;
}

.topbar-right .notification .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger);
    color: var(--white);
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.topbar-right .user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.topbar-right .user-profile .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 18px;
}

.topbar-right .user-profile .user-name {
    font-weight: 500;
    font-size: 14px;
}

/* ===== STATS CARDS ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--white);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 15px;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.stat-icon.primary { background: rgba(102, 126, 234, 0.1); color: var(--primary); }
.stat-icon.success { background: rgba(72, 187, 120, 0.1); color: var(--success); }
.stat-icon.danger { background: rgba(252, 129, 129, 0.1); color: var(--danger); }
.stat-icon.warning { background: rgba(246, 173, 85, 0.1); color: var(--warning); }
.stat-icon.info { background: rgba(99, 179, 237, 0.1); color: var(--info); }

.stat-info h3 {
    font-size: 22px;
    font-weight: 700;
    color: var(--dark);
}

.stat-info p {
    font-size: 13px;
    color: var(--gray);
    margin-top: 2px;
}

/* ===== WELCOME BANNER ===== */
.welcome-banner {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--white);
    padding: 25px 30px;
    border-radius: var(--radius);
    margin-bottom: 25px;
}

.welcome-banner h1 {
    font-size: 24px;
    font-weight: 600;
}

.welcome-banner p {
    opacity: 0.9;
    margin-top: 5px;
}

/* ===== CARDS ===== */
.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 25px;
    margin-bottom: 25px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--light-gray);
}

.card-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.card-header .view-all {
    color: var(--primary);
    font-size: 14px;
    font-weight: 500;
}

/* ===== TABLES ===== */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.table thead {
    background: var(--bg);
}

.table th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: var(--gray);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--light-gray);
    color: var(--dark);
}

.table tbody tr:hover {
    background: rgba(102, 126, 234, 0.02);
}

/* ===== STATUS BADGES ===== */
.badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    display: inline-block;
}

.badge-success {
    background: #c6f6d5;
    color: #276749;
}

.badge-pending {
    background: #fefcbf;
    color: #975a16;
}

.badge-failed {
    background: #fed7d7;
    color: #9b2c2c;
}

.badge-active {
    background: #c6f6d5;
    color: #276749;
}

.badge-inactive {
    background: #fed7d7;
    color: #9b2c2c;
}

/* ===== FORMS ===== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--dark);
    font-size: 14px;
}

.form-group label .required {
    color: var(--danger);
    margin-left: 3px;
}

.form-control {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid var(--light-gray);
    border-radius: 8px;
    font-size: 14px;
    transition: var(--transition);
    background: var(--bg);
    font-family: inherit;
}

.form-control:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: var(--white);
}

.form-control.error {
    border-color: var(--danger);
}

.form-control.success {
    border-color: var(--success);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%234a5568' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 40px;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--white);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-success {
    background: var(--success);
    color: var(--white);
}

.btn-success:hover {
    background: #38a169;
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-danger:hover {
    background: #e53e3e;
}

.btn-warning {
    background: var(--warning);
    color: var(--white);
}

.btn-warning:hover {
    background: #dd6b20;
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: var(--white);
}

.btn-sm {
    padding: 5px 12px;
    font-size: 12px;
}

.btn-lg {
    padding: 14px 30px;
    font-size: 16px;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* ===== ALERTS ===== */
.alert {
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

.alert-success {
    background: #c6f6d5;
    color: #276749;
    border: 1px solid #9ae6b4;
}

.alert-danger {
    background: #fed7d7;
    color: #9b2c2c;
    border: 1px solid #fc8181;
}

.alert-warning {
    background: #fefcbf;
    color: #975a16;
    border: 1px solid #f6ad55;
}

.alert-info {
    background: #bee3f8;
    color: #2a69ac;
    border: 1px solid #63b3ed;
}

.alert i {
    font-size: 18px;
}

/* ===== MODAL ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--white);
    border-radius: 20px;
    padding: 30px;
    max-width: 500px;
    width: 100%;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--gray);
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--danger);
    transform: rotate(90deg);
}

.modal-header {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-footer {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* ===== QR CODE MODAL ===== */
.qr-section {
    text-align: center;
}

.qr-img {
    width: 200px;
    height: 200px;
    margin: 15px auto;
    border: 3px solid var(--light-gray);
    border-radius: 12px;
    padding: 10px;
}

.payment-info {
    background: var(--bg);
    padding: 15px;
    border-radius: 10px;
    margin: 15px 0;
    text-align: left;
}

.payment-info p {
    margin: 5px 0;
    font-size: 14px;
}

.payment-info strong {
    color: var(--dark);
}

.countdown {
    font-size: 18px;
    font-weight: 700;
    color: var(--danger);
    margin: 15px 0;
}

.status-msg {
    padding: 12px;
    border-radius: 8px;
    margin: 10px 0;
    font-weight: 500;
}

.status-waiting {
    background: #fefcbf;
    color: #975a16;
}

.status-success {
    background: #c6f6d5;
    color: #276749;
}

/* ===== PROFILE PAGE ===== */
.profile-section {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 25px;
}

.profile-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 25px;
    text-align: center;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: 700;
    margin: 0 auto 15px;
}

.profile-name {
    font-size: 20px;
    font-weight: 600;
}

.profile-email {
    color: var(--gray);
    font-size: 14px;
    margin-top: 5px;
}

.profile-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--light-gray);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .profile-section {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .topbar-left .menu-toggle {
        display: block;
    }
    
    .topbar-left h2 {
        font-size: 16px;
    }
    
    .content {
        padding: 15px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .stat-info h3 {
        font-size: 18px;
    }
    
    .auth-box {
        padding: 25px;
        margin: 10px;
    }
    
    .modal-content {
        padding: 20px;
        margin: 10px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .topbar {
        padding: 12px 15px;
    }
    
    .topbar-right .user-profile .user-name {
        display: none;
    }
    
    .auth-logo h1 {
        font-size: 22px;
    }
    
    .profile-avatar {
        width: 80px;
        height: 80px;
        font-size: 28px;
    }
}

/* ===== SIDEBAR OVERLAY ===== */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.sidebar-overlay.active {
    display: block;
}

/* ===== UTILITY CLASSES ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.text-muted { color: var(--gray); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }

.mt-1 { margin-top: 5px; }
.mt-2 { margin-top: 10px; }
.mt-3 { margin-top: 20px; }
.mt-4 { margin-top: 30px; }

.mb-1 { margin-bottom: 5px; }
.mb-2 { margin-bottom: 10px; }
.mb-3 { margin-bottom: 20px; }
.mb-4 { margin-bottom: 30px; }

.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 5px; }
.gap-2 { gap: 10px; }
.gap-3 { gap: 20px; }

.flex-wrap { flex-wrap: wrap; }
.flex-column { flex-direction: column; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

.shadow { box-shadow: var(--shadow); }
.shadow-hover:hover { box-shadow: var(--shadow-hover); }

.rounded { border-radius: var(--radius); }
.rounded-full { border-radius: 50%; }

.hidden { display: none !important; }