/* =========================================================
   RESET
   ========================================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', 'Segoe UI', sans-serif;
}

/* =========================================================
   COLOR
   ========================================================= */
:root {
    --primary: #c8102e;
    --primary-soft: rgba(200,16,46,0.08);
    --bg: #f7f7f8;
    --white: #ffffff;
    --text: #1f2937;
    --text-soft: #6b7280;
    --border: #ececec;
}

/* =========================================================
   BASE
   ========================================================= */
body {
    background: var(--bg);
}

/* LOGIN ONLY */
body.login-page {
    background: linear-gradient(135deg, #c8102e, #ff4d6d);
}

/* =========================================================
   SIDEBAR (DESKTOP)
   ========================================================= */
.sidebar {
    width: 230px;
    height: 100vh;
    position: fixed;
    background: var(--white);
    border-right: 1px solid var(--border);
    padding: 20px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 25px;
}

.brand img {
    width: 40px;
}

/* =========================================================
   MENU
   ========================================================= */
.menu-title {
    font-size: 11px;
    color: var(--text-soft);
    margin: 15px 0 8px;
}

.sidebar a {
    display: block;
    padding: 10px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-soft);
    font-size: 14px;
}

.sidebar a.active {
    background: var(--primary-soft);
    color: var(--primary);
}

/* =========================================================
   MAIN
   ========================================================= */
.main {
    margin-left: 230px;
    padding: 30px;
    position: relative;
    z-index: 1;
}

/* =========================================================
   TOPBAR
   ========================================================= */
.topbar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 25px;
}

.page-title {
    font-size: 22px;
}

/* =========================================================
   GRID
   ========================================================= */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
}

/* =========================================================
   CARD
   ========================================================= */
.card {
    background: var(--white);
    padding: 18px;
    border-radius: 12px;
    border: 1px solid var(--border);
}

/* =========================================================
   TEXT
   ========================================================= */
h1 { font-size: 24px; }
h2 { font-size: 18px; }
h3 { font-size: 14px; color: var(--text-soft); }
p { font-size: 13px; color: var(--text-soft); }

/* =========================================================
   FORM
   ========================================================= */
input {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

/* =========================================================
   BUTTON
   ========================================================= */
button {
    padding: 10px;
    border-radius: 10px;
    border: none;
    background: var(--primary);
    color: white;
}

/* =========================================================
   IMAGE
   ========================================================= */
.barang-card img {
    width: 100%;
    border-radius: 10px;
}

/* =========================================================
   FLEX
   ========================================================= */
.flex {
    display: flex;
    gap: 10px;
}

.section {
    margin-bottom: 20px;
}

.page {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* =========================================================
   BOTTOM NAV (DEFAULT HIDDEN)
   ========================================================= */
.bottom-nav {
    display: none;
}

/* =========================================================
   📱 MOBILE
   ========================================================= */
@media (max-width: 768px) {

    .sidebar {
        display: none;
    }

    .main {
        margin-left: 0;
        padding: 16px;
        padding-bottom: 120px;
    }

    .grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .card {
        padding: 14px;
        border-radius: 16px;
    }

    .barang-card img {
        height: 140px;
        object-fit: cover;
        border-radius: 12px;
    }

    button {
        padding: 14px;
        font-size: 14px;
        border-radius: 12px;
    }

    /* =========================================================
       🔥 FIX FINAL BOTTOM NAV (SCROLL)
       ========================================================= */
    .bottom-nav {
        display: flex;
        position: fixed;
        bottom: 10px;
        left: 10px;
        right: 10px;
        height: 75px;

        background: #fff;
        border-radius: 20px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.1);

        align-items: center;

        overflow-x: auto;      /* 🔥 KUNCI */
        white-space: nowrap;

        z-index: 9999;
    }

    .bottom-nav a {
        flex: 0 0 auto;        /* 🔥 penting */
        width: 65px;
        text-align: center;
        color: #999;
        transition: 0.2s;
    }

    .bottom-nav i {
        width: 26px;
        height: 26px;
    }

    .bottom-nav a.active {
        color: var(--primary);
        transform: scale(1.2);
    }

    .bottom-nav a:active {
        transform: scale(0.9);
    }

    .mobile-logo {
        display: flex;
        justify-content: center;
        margin-bottom: 10px;
    }

    .login-card {
        max-width: 380px;
        margin: auto;
    }
}

/* =========================================================
   LOGIN PAGE
   ========================================================= */
body.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.login-wrapper {
    width: 100%;
    max-width: 380px;
    padding: 20px;
}

.login-card {
    background: white;
    padding: 24px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    text-align: center;
}

.login-logo {
    width: 70px;
    margin-bottom: 12px;
}

/* =========================================================
   🔥 FIX CONTENT
   ========================================================= */
.content {
    padding-bottom: 100px;
}