@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

:root {
    --emerald-50: #ecfdf5;
    --emerald-100: #d1fae5;
    --emerald-200: #a7f3d0;
    --emerald-300: #6ee7b7;
    --emerald-400: #34d399;
    --emerald-500: #10b981;
    --emerald-600: #0F6946;
    --emerald-700: #065f46;
    --emerald-800: #064e3b;
    --emerald-900: #022c22;

    --yellow-50: #fffbeb;
    --yellow-100: #fef3c7;
    --yellow-400: #fbbf24;
    --yellow-500: #f59e0b;

    --red-50: #fef2f2;
    --red-100: #fee2e2;
    --red-400: #f87171;
    --red-500: #ef4444;
    --red-600: #dc2626;

    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    --primary: #0F6946;
    --primary-light: #10b981;
    --primary-dark: #065f46;
    --primary-bg: #ecfdf5;

    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;

    --border: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --transition: all 0.2s ease;
    --transition-slow: all 0.35s ease;

    --font: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font);
    font-size: 15px;
    font-weight: 400;
    line-height: 1.6;
    color: var(--gray-800);
    background-color: var(--gray-50);
    padding-bottom: 70px;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

h1 { font-size: 1.8rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.9rem; }

p { margin-bottom: 1rem; }
a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-dark); }

img { max-width: 100%; height: auto; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.5rem 0; }

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -8px;
}

.col, [class*="col-"] {
    padding: 8px;
    width: 100%;
}

@media (min-width: 576px) {
    .col-sm-6 { width: 50%; }
    .col-sm-4 { width: 33.333%; }
    .col-sm-3 { width: 25%; }
}

@media (min-width: 768px) {
    body { padding-bottom: 0; }
    .col-md-8 { width: 66.666%; }
    .col-md-6 { width: 50%; }
    .col-md-4 { width: 33.333%; }
    .col-md-3 { width: 25%; }
}

@media (min-width: 992px) {
    .col-lg-8 { width: 66.666%; }
    .col-lg-6 { width: 50%; }
    .col-lg-4 { width: 33.333%; }
    .col-lg-3 { width: 25%; }
}

/* ============ BUTTONS ============ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-family: var(--font);
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.5;
    border: 1.5px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
    user-select: none;
    position: relative;
    overflow: hidden;
}

.btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(15, 105, 70, 0.2);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-sm { padding: 7px 14px; font-size: 0.82rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-block { display: flex; width: 100%; }

.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 2px 4px rgba(15, 105, 70, 0.2);
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15, 105, 70, 0.3);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-outline-primary {
    background-color: transparent;
    border-color: var(--primary);
    color: var(--primary);
}

.btn-outline-primary:hover:not(:disabled) {
    background-color: var(--primary);
    color: #fff;
}

.btn-light {
    background-color: #fff;
    border-color: var(--border);
    color: var(--gray-700);
}

.btn-light:hover:not(:disabled) {
    background-color: var(--gray-50);
    border-color: var(--gray-300);
}

.btn-success {
    background-color: var(--success);
    border-color: var(--success);
    color: #fff;
}

.btn-success:hover:not(:disabled) { background-color: #059669; border-color: #059669; color: #fff; }

.btn-warning {
    background-color: var(--warning);
    border-color: var(--warning);
    color: #fff;
}

.btn-warning:hover:not(:disabled) { background-color: #d97706; border-color: #d97706; color: #fff; }

.btn-danger {
    background-color: var(--danger);
    border-color: var(--danger);
    color: #fff;
}

.btn-danger:hover:not(:disabled) { background-color: var(--red-600); border-color: var(--red-600); color: #fff; }

.btn-loading::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 8px;
}

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

/* ============ CARDS ============ */
.card {
    background-color: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
}

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

.card-body { padding: 20px; }
.card-header {
    padding: 16px 20px;
    background-color: var(--gray-50);
    border-bottom: 1px solid var(--border);
    font-weight: 600;
}

.card-footer {
    padding: 16px 20px;
    background-color: var(--gray-50);
    border-top: 1px solid var(--border);
}

/* ============ TASK CARDS ============ */
.task-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background-color: #fff;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    cursor: pointer;
    position: relative;
}

.task-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--emerald-200);
}

.task-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-lg);
    opacity: 0;
    pointer-events: none;
    box-shadow: 0 0 0 3px rgba(15, 105, 70, 0.1);
    transition: var(--transition);
}

.task-card:hover::after {
    opacity: 1;
}

.task-card-img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    background: linear-gradient(135deg, var(--emerald-50), var(--emerald-100));
}

.task-card-body { padding: 16px; }
.task-card-title {
    font-size: 0.98rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.task-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--gray-100);
}

.task-card-reward {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
}

/* ============ BADGES & STATUS ============ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 999px;
    line-height: 1.4;
    white-space: nowrap;
}

.bg-emerald {
    background-color: var(--emerald-100);
    color: var(--emerald-700);
}

.bg-green {
    background-color: #dcfce7;
    color: #166534;
}

.bg-yellow {
    background-color: var(--yellow-100);
    color: #92400e;
}

.bg-red {
    background-color: var(--red-100);
    color: var(--red-600);
}

.bg-gray {
    background-color: var(--gray-100);
    color: var(--gray-600);
}

.bg-blue {
    background-color: #dbeafe;
    color: #1e40af;
}

.bg-purple {
    background-color: #f3e8ff;
    color: #7c3aed;
}

/* ============ MOBILE BOTTOM NAV ============ */
.mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background-color: #fff;
    border-top: 1px solid var(--border);
    display: flex;
    z-index: 1000;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.06);
}

.mobile-nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background: none;
    border: none;
    color: var(--gray-400);
    font-family: var(--font);
    font-size: 0.68rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    padding: 6px 4px;
}

.mobile-nav-btn svg {
    width: 22px;
    height: 22px;
    stroke-width: 1.8;
}

.mobile-nav-btn.active {
    color: var(--primary);
}

.mobile-nav-btn.active svg {
    stroke: var(--primary);
    transform: translateY(-1px);
}

.mobile-nav-btn:hover {
    color: var(--primary-light);
}

@media (min-width: 768px) {
    .mobile-nav { display: none; }
}

/* ============ WALLET CARD ============ */
.wallet-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: var(--radius-xl);
    padding: 24px;
    color: #fff;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(15, 105, 70, 0.25);
}

.wallet-card::before {
    content: '';
    position: absolute;
    top: -60px;
    right: -60px;
    width: 180px;
    height: 180px;
    background-color: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
}

.wallet-card::after {
    content: '';
    position: absolute;
    bottom: -40px;
    left: -30px;
    width: 140px;
    height: 140px;
    background-color: rgba(255, 255, 255, 0.06);
    border-radius: 50%;
}

.wallet-card-label {
    font-size: 0.82rem;
    opacity: 0.85;
    font-weight: 400;
    margin-bottom: 6px;
    position: relative;
    z-index: 1;
}

.wallet-card-balance {
    font-size: 2.4rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
}

.wallet-card-actions {
    display: flex;
    gap: 10px;
    position: relative;
    z-index: 1;
}

.wallet-card-actions .btn {
    flex: 1;
    background-color: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    color: #fff;
    backdrop-filter: blur(4px);
}

.wallet-card-actions .btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

/* ============ DASHBOARD STATS ============ */
.stats-card {
    background-color: #fff;
    border-radius: var(--radius-lg);
    padding: 20px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.stats-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stats-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    flex-shrink: 0;
}

.stats-icon svg { width: 22px; height: 22px; }
.stats-icon.emerald { background-color: var(--emerald-100); color: var(--primary); }
.stats-icon.yellow { background-color: var(--yellow-100); color: var(--yellow-500); }
.stats-icon.blue { background-color: #dbeafe; color: var(--info); }
.stats-icon.purple { background-color: #f3e8ff; color: #7c3aed; }
.stats-icon.red { background-color: var(--red-100); color: var(--danger); }

.stats-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.2;
    margin-bottom: 4px;
}

.stats-label {
    font-size: 0.85rem;
    color: var(--gray-500);
    font-weight: 500;
}

.stats-change {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.78rem;
    font-weight: 600;
    margin-top: 8px;
    padding: 3px 8px;
    border-radius: 999px;
}

.stats-change.up { background-color: var(--emerald-100); color: var(--emerald-700); }
.stats-change.down { background-color: var(--red-100); color: var(--red-600); }

/* ============ ADMIN SIDEBAR ============ */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 260px;
    background-color: var(--gray-900);
    color: var(--gray-300);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    overflow-y: auto;
}

.admin-sidebar-brand {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-sidebar-brand-logo {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
}

.admin-sidebar-brand-name {
    color: #fff;
    font-weight: 700;
    font-size: 1.05rem;
}

.admin-sidebar-nav {
    flex: 1;
    padding: 16px 12px;
}

.admin-sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    color: var(--gray-400);
    font-weight: 500;
    font-size: 0.9rem;
    border-radius: var(--radius);
    transition: var(--transition);
    margin-bottom: 2px;
    cursor: pointer;
}

.admin-sidebar-link svg {
    width: 20px;
    height: 20px;
    stroke-width: 1.8;
    flex-shrink: 0;
}

.admin-sidebar-link:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.admin-sidebar-link.active {
    background-color: var(--primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(15, 105, 70, 0.4);
}

.admin-sidebar-section {
    padding: 12px 14px 8px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-sidebar-user {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-sidebar-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    flex-shrink: 0;
}

.admin-main {
    flex: 1;
    margin-left: 260px;
    min-height: 100vh;
}

.admin-topbar {
    background-color: #fff;
    border-bottom: 1px solid var(--border);
    padding: 16px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}

.admin-content { padding: 28px; }

@media (max-width: 767px) {
    .admin-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    .admin-sidebar.open { transform: translateX(0); }
    .admin-main { margin-left: 0; }
    .admin-content { padding: 16px; }
}

/* ============ FORM INPUTS ============ */
.form-group { margin-bottom: 18px; }

.form-label {
    display: block;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 7px;
}

.form-label .required { color: var(--danger); }

.form-control {
    display: block;
    width: 100%;
    padding: 11px 14px;
    font-family: var(--font);
    font-size: 0.92rem;
    line-height: 1.5;
    color: var(--gray-800);
    background-color: #fff;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    transition: var(--transition);
}

.form-control::placeholder { color: var(--gray-400); }

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(15, 105, 70, 0.12);
}

.form-control:disabled,
.form-control[readonly] {
    background-color: var(--gray-50);
    color: var(--gray-500);
    cursor: not-allowed;
}

textarea.form-control {
    min-height: 110px;
    resize: vertical;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px;
    padding-right: 40px;
}

.input-group {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    width: 100%;
}

.input-group-text {
    display: flex;
    align-items: center;
    padding: 11px 14px;
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--gray-600);
    background-color: var(--gray-50);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
}

.input-group > .form-control {
    position: relative;
    flex: 1 1 auto;
    width: 1%;
    min-width: 0;
}

.input-group > .form-control:not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group > .input-group-text:not(:first-child) { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: -1px; }

.form-text {
    display: block;
    margin-top: 6px;
    font-size: 0.8rem;
    color: var(--gray-500);
}

.form-error {
    border-color: var(--danger) !important;
}

.form-error-text {
    color: var(--danger);
    font-size: 0.8rem;
    margin-top: 6px;
    display: block;
}

/* ============ OTP INPUT ============ */
.otp-container {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
}

.otp-input {
    width: 48px;
    height: 52px;
    text-align: center;
    font-family: var(--font);
    font-size: 1.3rem;
    font-weight: 600;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    background-color: #fff;
    transition: var(--transition);
    -webkit-appearance: none;
    -moz-appearance: textfield;
}

.otp-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(15, 105, 70, 0.12);
}

.otp-input::-webkit-outer-spin-button,
.otp-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* ============ TOAST NOTIFICATIONS ============ */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 360px;
    width: calc(100% - 40px);
    pointer-events: none;
}

@media (max-width: 575px) {
    .toast-container {
        top: auto;
        bottom: 80px;
        right: 10px;
        left: 10px;
        max-width: none;
        width: auto;
    }
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background-color: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    border-left: 4px solid var(--gray-400);
    transform: translateX(120%);
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0;
    pointer-events: auto;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast.hide {
    transform: translateX(120%);
    opacity: 0;
}

.toast-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-top: 1px;
}

.toast-icon svg { width: 14px; height: 14px; }
.toast.success { border-left-color: var(--success); }
.toast.success .toast-icon { background-color: var(--emerald-100); color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.error .toast-icon { background-color: var(--red-100); color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
.toast.warning .toast-icon { background-color: var(--yellow-100); color: var(--warning); }
.toast.info { border-left-color: var(--info); }
.toast.info .toast-icon { background-color: #dbeafe; color: var(--info); }

.toast-content { flex: 1; min-width: 0; }
.toast-title { font-weight: 600; font-size: 0.92rem; color: var(--gray-900); margin-bottom: 2px; }
.toast-message { font-size: 0.84rem; color: var(--gray-600); line-height: 1.5; }

.toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    padding: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: var(--transition);
}

.toast-close:hover {
    color: var(--gray-600);
    background-color: var(--gray-100);
}

/* ============ MODAL ============ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(17, 24, 39, 0.55);
    backdrop-filter: blur(3px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal {
    background-color: #fff;
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: scale(0.95) translateY(10px);
    transition: transform 0.25s ease;
}

.modal-overlay.show .modal {
    transform: scale(1) translateY(0);
}

.modal-lg { max-width: 640px; }

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    cursor: pointer;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.modal-close:hover {
    background-color: var(--gray-100);
    color: var(--gray-700);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

@media (max-width: 575px) {
    .modal-footer { justify-content: stretch; }
    .modal-footer .btn { flex: 1; }
}

/* ============ LOADING SPINNER ============ */
.loader {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loader-sm { width: 20px; height: 20px; border-width: 2px; }
.loader-lg { width: 56px; height: 56px; border-width: 4px; }
.loader-white { border-color: rgba(255,255,255,0.3); border-top-color: #fff; }

.loading-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    flex-direction: column;
    gap: 14px;
}

.loading-text {
    color: var(--gray-600);
    font-size: 0.9rem;
    font-weight: 500;
}

/* ============ EMPTY STATE ============ */
.empty-state {
    padding: 60px 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    color: var(--gray-400);
}

.empty-state-icon svg { width: 38px; height: 38px; stroke-width: 1.5; }

.empty-state-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 8px;
}

.empty-state-text {
    font-size: 0.88rem;
    color: var(--gray-500);
    max-width: 340px;
    margin-bottom: 20px;
}

/* ============ GRADIENT HERO SECTIONS ============ */
.hero-gradient {
    background: linear-gradient(135deg, var(--primary) 0%, var(--emerald-600) 50%, var(--primary-light) 100%);
    color: #fff;
    position: relative;
    overflow: hidden;
    padding: 48px 16px;
}

.hero-gradient::before {
    content: '';
    position: absolute;
    top: -100px;
    left: -100px;
    width: 320px;
    height: 320px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 50%;
}

.hero-gradient::after {
    content: '';
    position: absolute;
    bottom: -80px;
    right: -80px;
    width: 280px;
    height: 280px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
}

.hero-gradient-light {
    background: linear-gradient(135deg, var(--emerald-50) 0%, #f0fdf4 50%, var(--emerald-100) 100%);
    color: var(--gray-900);
    position: relative;
    overflow: hidden;
    padding: 40px 16px;
    border-bottom: 1px solid var(--emerald-100);
}

.hero-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}

.hero-subtitle {
    font-size: 0.98rem;
    opacity: 0.9;
    max-width: 520px;
    position: relative;
    z-index: 1;
}

.hero-gradient-light .hero-subtitle {
    color: var(--gray-600);
    opacity: 1;
}

/* ============ TABLE ============ */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background-color: #fff;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 640px;
}

thead { background-color: var(--gray-50); }

th {
    padding: 12px 16px;
    text-align: left;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-bottom: 1px solid var(--border);
}

td {
    padding: 14px 16px;
    font-size: 0.88rem;
    color: var(--gray-700);
    border-bottom: 1px solid var(--gray-100);
}

tbody tr:hover { background-color: var(--gray-50); }

tbody tr:last-child td { border-bottom: none; }

/* ============ LIST GROUP ============ */
.list-group {
    display: flex;
    flex-direction: column;
    padding-left: 0;
    margin-bottom: 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
    background-color: #fff;
}

.list-group-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--gray-100);
    transition: var(--transition);
}

.list-group-item:last-child { border-bottom: none; }
.list-group-item:hover { background-color: var(--gray-50); }

/* ============ UTILITIES ============ */
.text-primary { color: var(--primary) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-danger { color: var(--danger) !important; }
.text-muted { color: var(--gray-500) !important; }

.text-sm { font-size: 0.82rem; }
.text-lg { font-size: 1.1rem; }
.text-xl { font-size: 1.3rem; }
.text-2xl { font-size: 1.6rem; }
.text-3xl { font-size: 2rem; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.d-flex { display: flex; }
.d-block { display: block; }
.d-none { display: none; }
.flex-wrap { flex-wrap: wrap; }
.align-center { align-items: center; }
.align-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }

.w-100 { width: 100%; }
.w-auto { width: auto; }
.h-100 { height: 100%; }

.m-0 { margin: 0; }
.m-1 { margin: 4px; }
.m-2 { margin: 8px; }
.m-3 { margin: 12px; }
.m-4 { margin: 16px; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-5 { margin-top: 24px; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-5 { margin-bottom: 24px; }

.p-0 { padding: 0; }
.p-1 { padding: 4px; }
.p-2 { padding: 8px; }
.p-3 { padding: 12px; }
.p-4 { padding: 16px; }
.p-5 { padding: 24px; }

.py-3 { padding-top: 12px; padding-bottom: 12px; }
.py-4 { padding-top: 16px; padding-bottom: 16px; }
.px-3 { padding-left: 12px; padding-right: 12px; }
.px-4 { padding-left: 16px; padding-right: 16px; }

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.rounded { border-radius: var(--radius); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-pill { border-radius: 999px; }

.border { border: 1px solid var(--border); }
.border-0 { border: none !important; }
.bg-white { background-color: #fff; }
.bg-transparent { background-color: transparent; }

.shadow-none { box-shadow: none; }
.shadow { box-shadow: var(--shadow); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

.overflow-hidden { overflow: hidden; }
.overflow-x-auto { overflow-x: auto; }

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============ REFERRAL LINK BOX ============ */
.referral-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: var(--gray-50);
    border: 1.5px dashed var(--border);
    border-radius: var(--radius);
    padding: 4px 4px 4px 14px;
    transition: var(--transition);
}

.referral-box:hover {
    border-color: var(--emerald-300);
    background-color: var(--emerald-50);
}

.referral-link {
    flex: 1;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--primary);
    word-break: break-all;
    padding: 8px 0;
}

.referral-copy-btn {
    padding: 9px 14px;
    background-color: var(--primary);
    color: #fff;
    border: none;
    border-radius: calc(var(--radius) - 3px);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
    flex-shrink: 0;
}

.referral-copy-btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
}

.referral-copy-btn.copied {
    background-color: var(--success);
}

/* ============ COUNTDOWN TIMER ============ */
.countdown-timer {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.84rem;
    font-weight: 500;
    color: var(--gray-600);
}

.countdown-timer .count {
    background-color: var(--gray-100);
    padding: 2px 10px;
    border-radius: 999px;
    font-weight: 600;
    color: var(--primary);
    font-variant-numeric: tabular-nums;
}

.countdown-timer.expired .count {
    color: var(--gray-500);
    background-color: var(--gray-100);
}

/* ============ PAGINATION ============ */
.pagination {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    padding: 0;
    list-style: none;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background-color: #fff;
    color: var(--gray-600);
    font-weight: 500;
    font-size: 0.88rem;
    cursor: pointer;
    transition: var(--transition);
}

.page-link:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
}

.page-link.active {
    background-color: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.page-link:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============ AVATAR ============ */
.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    font-weight: 600;
    flex-shrink: 0;
    overflow: hidden;
}

.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 32px; height: 32px; font-size: 0.78rem; }
.avatar-md { width: 40px; height: 40px; font-size: 0.9rem; }
.avatar-lg { width: 56px; height: 56px; font-size: 1.1rem; }
.avatar-xl { width: 72px; height: 72px; font-size: 1.4rem; }

/* ============ TRANSACTION LIST ============ */
.txn-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--gray-100);
}

.txn-item:last-child { border-bottom: none; }

.txn-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.txn-icon.credit { background-color: var(--emerald-100); color: var(--primary); }
.txn-icon.debit { background-color: var(--red-100); color: var(--danger); }
.txn-icon svg { width: 20px; height: 20px; }

.txn-details { flex: 1; min-width: 0; }
.txn-title { font-size: 0.92rem; font-weight: 600; color: var(--gray-800); margin-bottom: 2px; }
.txn-date { font-size: 0.78rem; color: var(--gray-500); }

.txn-amount {
    font-weight: 700;
    font-size: 0.98rem;
    flex-shrink: 0;
}

.txn-amount.credit { color: var(--primary); }
.txn-amount.debit { color: var(--danger); }

/* ============ PROGRESS BAR ============ */
.progress {
    height: 8px;
    background-color: var(--gray-100);
    border-radius: 999px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: 999px;
    transition: width 0.4s ease;
}

/* ============ ANIMATION CLASSES ============ */
.fade-in {
    animation: fadeIn 0.3s ease forwards;
}

.slide-up {
    animation: slideUp 0.35s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* ============ DESKTOP ENHANCEMENTS ============ */
@media (min-width: 992px) {
    h1 { font-size: 2.2rem; }
    h2 { font-size: 1.8rem; }
    h3 { font-size: 1.4rem; }

    .hero-gradient { padding: 64px 28px; }
    .hero-title { font-size: 2.4rem; }
    .hero-subtitle { font-size: 1.05rem; }

    .wallet-card { padding: 32px; }
    .wallet-card-balance { font-size: 2.8rem; }

    .card-body { padding: 24px; }
}
