/* ============================================================
   GARDEN CASH — Main Stylesheet
   ============================================================ */

:root {
    --primary:     #6c3fc5;
    --primary-dark:#4e2a9e;
    --gold:        #f0c040;
    --green:       #2dc897;
    --sidebar-w:   260px;
    --topbar-h:    60px;
    --bg:          #f0f2f8;
    --card-radius: 14px;
}

* { box-sizing: border-box; }

body {
    background: var(--bg);
    font-family: 'Segoe UI', Arial, sans-serif;
    margin: 0;
    padding: 0;
    color: #2c2c3e;
}

/* ── Sidebar ───────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-w);
    height: 100vh;
    background: linear-gradient(180deg, #0e051e 0%, #2d1a6e 100%);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 300;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    transition: transform .3s ease;
}

.sidebar-brand {
    padding: 1.3rem 1.4rem;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.brand-icon { font-size: 1.6rem; }

.brand-text {
    color: var(--gold);
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: .3px;
}

.sidebar .nav-link {
    color: rgba(255,255,255,.65);
    padding: .62rem 1.2rem;
    border-radius: 10px;
    margin: 2px 10px;
    font-size: .875rem;
    font-weight: 500;
    transition: background .2s, color .2s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    color: #fff;
    background: rgba(255,255,255,.14);
}

.sidebar .nav-link.active {
    background: rgba(108,63,197,.5);
    border-left: 3px solid var(--gold);
}

.sidebar .nav-link i { width: 18px; font-size: 1rem; }

.sidebar-footer {
    padding: 1rem 1rem 1.3rem;
    margin-top: auto;
    border-top: 1px solid rgba(255,255,255,.08);
}

/* ── Wrapper & Topbar ──────────────────────────────────────── */
.wrapper {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    height: var(--topbar-h);
    background: #fff;
    border-bottom: 1px solid #e4e8f0;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.topbar-balance {
    background: #f5f3ff;
    border: 1px solid #e0d5fb;
    border-radius: 20px;
    padding: 4px 14px;
    font-size: .85rem;
    font-weight: 600;
    color: var(--primary);
}

.topbar-user {
    font-weight: 600;
    font-size: .9rem;
    color: #444;
}

.flash-wrap { padding: 0 1.5rem; }

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

/* ── Cards ─────────────────────────────────────────────────── */
.card {
    border: none !important;
    border-radius: var(--card-radius) !important;
    box-shadow: 0 2px 18px rgba(0,0,0,.07) !important;
}

.card-header {
    border-radius: var(--card-radius) var(--card-radius) 0 0 !important;
    font-weight: 700;
}

/* ── Stat cards ────────────────────────────────────────────── */
.stat-card {
    border-radius: var(--card-radius);
    padding: 1.4rem 1.5rem;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    right: -20px;
    bottom: -20px;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: rgba(255,255,255,.08);
}

.stat-card .s-label {
    font-size: .78rem;
    opacity: .85;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: .4rem;
}

.stat-card .s-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
}

.stat-card .s-icon {
    font-size: 1.6rem;
    opacity: .25;
    position: absolute;
    right: 16px;
    top: 16px;
}

/* ── Package cards ──────────────────────────────────────────── */
.pkg-card {
    border-radius: var(--card-radius);
    background: #fff;
    border: none;
    box-shadow: 0 2px 18px rgba(0,0,0,.07);
    text-align: center;
    padding: 1.6rem 1.2rem 1.4rem;
    transition: transform .2s, box-shadow .2s;
    position: relative;
    overflow: hidden;
}

.pkg-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0,0,0,.13);
}

.pkg-card .pkg-icon {
    width: 58px;
    height: 58px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    margin: 0 auto 1rem;
}

.pkg-card .pkg-price {
    font-size: 2rem;
    font-weight: 800;
}

.pkg-card .pkg-roi {
    font-size: .85rem;
    font-weight: 600;
    margin-bottom: .5rem;
}

/* ── Badges ────────────────────────────────────────────────── */
.badge-pending  { background: #fff3cd !important; color: #856404 !important; }
.badge-approved { background: #d1e7dd !important; color: #0a3622 !important; }
.badge-rejected { background: #f8d7da !important; color: #842029 !important; }
.badge-paid     { background: #d1e7dd !important; color: #0a3622 !important; }
.badge-system   { background: #cff4fc !important; color: #055160 !important; }

/* ── Tree ──────────────────────────────────────────────────── */
.tree ul { list-style: none; padding-left: 22px; margin: 0; }
.tree > ul { padding-left: 0; }
.tree li { position: relative; padding: 5px 0; }

.tree li::before {
    content: '';
    position: absolute;
    top: 0;
    left: -14px;
    border-left: 2px solid #c4b5f5;
    border-bottom: 2px solid #c4b5f5;
    width: 14px;
    height: 20px;
}

.tree > li::before { display: none; }

.tree-node {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1px solid #e8e0fb;
    border-radius: 8px;
    padding: 6px 14px;
    font-size: .84rem;
    cursor: default;
    white-space: nowrap;
}

.lvl {
    font-size: .66rem;
    padding: 2px 8px;
    border-radius: 20px;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
}

.dot-green {
    width: 9px; height: 9px; border-radius: 50%;
    background: var(--green); flex-shrink: 0;
    box-shadow: 0 0 0 2px rgba(45,200,151,.25);
}

.dot-red {
    width: 9px; height: 9px; border-radius: 50%;
    background: #e74c7c; flex-shrink: 0;
}

/* ── Tables ────────────────────────────────────────────────── */
.table thead th {
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: #888;
    border-bottom-width: 1px;
}

.table td { vertical-align: middle; font-size: .9rem; }

/* ── Forms ─────────────────────────────────────────────────── */
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 .22rem rgba(108,63,197,.2);
}

.form-label { font-weight: 600; font-size: .85rem; }

/* ── Buttons ───────────────────────────────────────────────── */
.btn-primary { background: var(--primary) !important; border-color: var(--primary) !important; }
.btn-primary:hover { background: var(--primary-dark) !important; border-color: var(--primary-dark) !important; }

/* ── Wallet copy box ───────────────────────────────────────── */
.wallet-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8f5ff;
    border: 1px solid #e0d5f5;
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 10px;
}

.wallet-box code {
    flex: 1;
    font-size: .82rem;
    word-break: break-all;
    color: var(--primary-dark);
}

/* ── Page title ─────────────────────────────────────────────── */
.page-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: #1a1a2e;
    margin-bottom: 1.4rem;
}

/* ── Admin pending alerts ───────────────────────────────────── */
.pending-alert {
    border-radius: var(--card-radius);
    padding: 1.2rem 1.4rem;
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: inherit;
    transition: transform .2s;
}

.pending-alert:hover { transform: translateY(-2px); }

.pending-icon {
    width: 50px; height: 50px;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; flex-shrink: 0;
}

/* ── Mobile ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 30px rgba(0,0,0,.35);
    }
    .wrapper {
        margin-left: 0;
    }
    .stat-card .s-value { font-size: 1.5rem; }
}

/* ── Overlay for mobile sidebar ────────────────────────────── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 299;
}

.sidebar-overlay.show { display: block; }

/* ── Notifications ─────────────────────────────────────────── */
.notif-unread {
    background: #f8f5ff !important;
    border-left: 3px solid var(--purple) !important;
}
.notif-item:hover { background: #f5f3ff !important; }
