/* ==================================================
   MOBILE FIRST PREMIUM DASHBOARD
   TARGET: 90% MOBILE USER
   ================================================== */

:root{
    --bg:#f4f6fb;
    --card:#ffffff;
    --primary:#2563eb;
    --secondary:#0ea5e9;
    --success:#16a34a;
    --danger:#dc2626;
    --warning:#f59e0b;
    --text:#0f172a;
    --muted:#6b7280;
    --border:#e5e7eb;
    --radius:14px;
}

*{
    margin:0;
    padding:0;
    box-sizing:border-box;
}

body{
    font-family:'Inter',system-ui,-apple-system,sans-serif;
    background:var(--bg);
    color:var(--text);
    font-size:14px;
}

/* ==================================================
   LAYOUT MOBILE
   ================================================== */
.dashboard{
    display:flex;
    flex-direction:column;
    min-height:100vh;
}

.main{
    padding:16px;
    width:100%;
}

/* ===================== SIDEBAR GLOBAL ===================== */
.sidebar{
    background: linear-gradient(180deg,#0f172a,#020617);
    color:#fff;
    position:fixed;
    left:0;
    top:0;
    bottom:0;
    width:260px;
    padding:20px;
    z-index:100;
}

.sidebar-header{
    margin-bottom:25px;
}

.user-box{
    display:flex;
    align-items:center;
    gap:12px;
    padding:12px;
    background:rgba(255,255,255,.06);
    border-radius:14px;
}

.avatar{
    width:42px;
    height:42px;
    border-radius:50%;
    background:#2563eb;
    display:flex;
    align-items:center;
    justify-content:center;
}

.user-info h4{
    font-size:14px;
}
.user-info span{
    font-size:12px;
    opacity:.7;
}

.sidebar-menu{
    display:flex;
    flex-direction:column;
    gap:6px;
}

.sidebar-menu a{
    display:flex;
    align-items:center;
    gap:12px;
    padding:12px 14px;
    border-radius:10px;
    color:#e5e7eb;
    text-decoration:none;
    transition:.25s;
}

.sidebar-menu a i{
    width:18px;
    height:18px;
}

.sidebar-menu a.active{
    background:#2563eb;
    color:#fff;
}

.sidebar-menu a.logout{
    margin-top:10px;
    background:rgba(239,68,68,.15);
    color:#fecaca;
}

/* ===================== MAIN CONTENT ===================== */
.main{
    margin-left:260px;
    padding:24px;
}

/* ========================================================= */
/* ===================== MOBILE MODE ======================= */
/* ========================================================= */
@media (max-width:768px){

    /* SIDEBAR JADI BOTTOM BAR */
    .sidebar{
        top:auto;
        bottom:0;
        left:0;
        right:0;
        height:70px;
        width:100%;
        padding:0;
        border-top:1px solid rgba(255,255,255,.1);
    }

    /* HEADER DISEMBUNYIKAN */
    .sidebar-header{
        display:none;
    }

    .sidebar-menu{
        flex-direction:row;
        justify-content:space-around;
        align-items:center;
        height:100%;
    }

    .sidebar-menu a{
        flex-direction:column;
        gap:4px;
        padding:8px;
        font-size:11px;
    }

    .sidebar-menu a span{
        font-size:11px;
    }

    .sidebar-menu a i{
        width:20px;
        height:20px;
    }

    .sidebar-menu a.logout{
        display:none;
    }

    .main{
        margin-left:0;
        padding-bottom:90px; /* ruang untuk bottom bar */
    }
}


/* ==================================================
   TOPBAR
   ================================================== */
.topbar{
    background:#fff;
    padding:14px 16px;
    border-radius:var(--radius);
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:18px;
    box-shadow:0 8px 20px rgba(0,0,0,.05);
}

.topbar h1{
    font-size:16px;
    font-weight:700;
}

.topbar .avatar{
    width:36px;
    height:36px;
    font-size:14px;
}

/* ==================================================
   CARDS (MOBILE STACK)
   ================================================== */
.cards{
    display:grid;
    grid-template-columns:1fr;
    gap:14px;
    margin-bottom:22px;
}

.card{
    background:linear-gradient(135deg,#ffffff,#f8fafc);
    border-radius:16px;
    padding:16px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    box-shadow:0 8px 20px rgba(0,0,0,.06);
}

.card h3{
    font-size:12px;
    color:var(--muted);
}

.card p{
    font-size:18px;
    font-weight:700;
}

.card-img img{
    width:64px;
}

/* ==================================================
   TABLE → MOBILE CARD VIEW
   ================================================== */
.table-wrap,
.table-wrapper{
    background:transparent;
    padding:0;
    box-shadow:none;
}

table,
.table{
    display:block;
    width:100%;
}

table thead,
.table thead{
    display:none;
}

table tr,
.table tr{
    display:block;
    background:#fff;
    border-radius:14px;
    padding:14px;
    margin-bottom:14px;
    box-shadow:0 8px 20px rgba(0,0,0,.06);
}

table td,
.table td{
    display:flex;
    justify-content:space-between;
    padding:6px 0;
    border:none;
    font-size:13px;
}

table td::before,
.table td::before{
    content:attr(data-label);
    font-weight:600;
    color:var(--muted);
}

/* ==================================================
   BADGE
   ================================================== */
.badge{
    padding:5px 10px;
    border-radius:999px;
    font-size:11px;
    font-weight:600;
}

.badge-success{background:#dcfce7;color:#166534}
.badge-pending{background:#fef9c3;color:#854d0e}
.badge-failed{background:#fee2e2;color:#991b1b}

/* ==================================================
   FORM
   ================================================== */
.form-card{
    background:#fff;
    padding:18px;
    border-radius:16px;
    box-shadow:0 10px 25px rgba(0,0,0,.06);
}

.form-group label{
    font-size:12px;
}

.form-group input,
.form-group select{
    padding:12px;
    font-size:14px;
    border-radius:10px;
}

.btn{
    width:100%;
    padding:14px;
    border-radius:12px;
    font-weight:700;
}

.btn.primary{background:#2563eb;color:#fff}

/* ==================================================
   PAKET INVESTASI (MOBILE)
   ================================================== */
.paket-grid{
    display:grid;
    grid-template-columns:1fr;
    gap:16px;
}

.paket-card{
    border-radius:16px;
}

.paket-image img{
    max-width:100px;
}

.btn-invest{
    padding:14px;
    border-radius:12px;
    font-size:14px;
}

/* ==================================================
   EMPTY STATE
   ================================================== */
.empty{
    padding:40px 20px;
    font-size:13px;
    text-align:center;
}

/* ==================================================
   DESKTOP ENHANCEMENT
   ================================================== */
@media(min-width:768px){
    .dashboard{
        flex-direction:row;
    }

    .sidebar{
        position:fixed;
        top:0;
        bottom:0;
        left:0;
        width:260px;
        height:100vh;
        flex-direction:column;
        justify-content:flex-start;
        padding:20px;
    }

    .sidebar-menu{
        flex-direction:column;
    }

    .sidebar-menu a{
        flex-direction:row;
        justify-content:flex-start;
        font-size:14px;
        padding:12px 14px;
    }

    .main{
        margin-left:260px;
        padding:28px;
    }

    .cards{
        grid-template-columns:repeat(auto-fit,minmax(260px,1fr));
    }

    table,
    .table{
        display:table;
    }

    table thead,
    .table thead{
        display:table-header-group;
    }

    table tr,
    .table tr{
        display:table-row;
        background:transparent;
        box-shadow:none;
        border-radius:0;
    }

    table td::before,
    .table td::before{
        display:none;
    }
}
