* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    font-family: Arial, sans-serif;
    
}


.app-shell {
    min-height: 100vh;
    display: flex;
    background: #FFF3C4;
}

/* SIDEBAR */

.sidebar {
    width: 250px;
    min-width: 250px;
    height: 100vh;
    background: #4A2C1A;
    color: #B77A00;
    border-right: 1px solid #e5e7eb;
    padding: 24px 16px;
    box-sizing: border-box;
    position: fixed;
    left: 0;
    top: 0;
    overflow-y:auto;
    overflow-x: hidden;
    scrollbar-width: thin;
}

.sidebar-logo {
    font-size: 21px;
    font-weight: 700;
    padding: 10px 12px 30px;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.side-item {
    width: 100%;
    border: 0;
    background: transparent;
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 13px 14px;
    border-radius: 10px;
    font-size: 14px;
    cursor: pointer;
    text-align: left;
}

.side-item:hover {
    background: #f3f4f6;
}

.side-item.active {
    background: #eef7f1;
    font-weight: 600;
}

.side-icon {
    width: 22px;
    text-align: center;
    font-size: 18px;
}

/* MAIN AREA */

.app-main {
    width: calc(100% - 250px);
    margin-left: 250px;
    min-height: 100vh;
}

.screen {
    width: 100%;
    max-width: none;
    margin: 0 auto;
    padding-bottom: 40px;
}

/* TOP BAR */

.topbar {
    height: 72px;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;

    display: flex;
    align-items: center;

    padding: 0 32px;

    position: sticky;
    top: 0;
    z-index: 20;
}

.topbar h1 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: #B77A00;
}

.icon-btn {
    border: 0;
    background: transparent;
    font-size: 20px;
    cursor: pointer;
}

.topbar .icon-btn:first-child {
    display: none;
}

.topbar .icon-btn:last-child {
    margin-left: auto;
}

/* PAGE CONTENT */

.page-pad {
    padding: 28px 32px;
    width: 100%;
    margin: 0 auto;
}

/* DASHBOARD CARDS */

.grid-2 {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.card {
    background: #FFFFFF;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 20px;
}

.metric-label {
    font-size: 13px;
    color: #6b7280;
}

.metric-value {
    font-size: 25px;
    font-weight: 700;
    margin-top: 10px;
}

.metric-change {
    font-size: 12px;
    margin-top: 7px;
}

/* SECTION HEADINGS */

.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 28px 0 12px;
    font-size: 15px;
    font-weight: 600;
}

/* PRODUCTS */

.product-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid #f0f0f0;
}

.product-row:last-child {
    border-bottom: 0;
}

.thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 9px;
    background: #f1f3f5;
}

.prod-main {
    flex: 1;
}

.prod-name {
    font-size: 14px;
    font-weight: 600;
}

.prod-sub {
    margin-top: 4px;
    font-size: 12px;
    color: #6b7280;
}

.prod-price {
    font-weight: 600;
}

/* CHART */

.chart {
    height: 260px;
    display: flex;
    align-items: flex-end;
    gap: 14px;
    padding-top: 20px;
}

.bar {
    flex: 1;
    min-width: 20px;
    border-radius: 6px 6px 0 0;
    background: #D99A00;
    position: relative;
}

.bar small {
    position: absolute;
    bottom: -22px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
}

/* HIDE MOBILE NAV ON DESKTOP */

.bottom-nav {
    display: none;
}

/* .products-page {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;

}

.product-list {
    width: 100%;
} */
 /* =========================
   FIRST LAUNCH SETUP
========================= */

.setup-page {
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;

    background:
        radial-gradient(
            circle at top left,
            rgba(245, 196, 75, 0.18),
            transparent 35%
        ),
        #f8f3e9;
}

.setup-card {
    width: 100%;
    max-width: 480px;

    background: #ffffff;

    border: 1px solid #eadfce;
    border-radius: 22px;

    padding: 42px;

    box-shadow:
        0 20px 50px rgba(76, 54, 35, 0.10);
}

.setup-logo {
    width: 58px;
    height: 58px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #d6a72c;
    color: #ffffff;

    border-radius: 16px;

    font-size: 18px;
    font-weight: 800;

    margin-bottom: 28px;
}

.setup-card h1 {
    margin: 0;

    color: #4a3425;

    font-size: 30px;
    line-height: 1.2;
    font-weight: 750;
}

.setup-subtitle {
    margin: 12px 0 30px;

    color: #806f63;

    font-size: 14px;
    line-height: 1.6;
}

.setup-card .input-group {
    margin-bottom: 22px;
}

.setup-card label {
    display: block;

    margin-bottom: 8px;

    color: #4a3425;

    font-size: 13px;
    font-weight: 600;
}

.setup-card .input {
    width: 100%;

    height: 50px;

    border: 1px solid #dcd0c0;
    border-radius: 11px;

    padding: 0 15px;

    background: #fffdf9;

    color: #3f3026;

    font-size: 14px;

    outline: none;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.setup-card .input:focus {
    border-color: #d6a72c;

    box-shadow:
        0 0 0 3px rgba(214, 167, 44, 0.15);
}

.setup-card .input::placeholder {
    color: #aaa09a;
}

.setup-button {
    width: 100%;
    height: 50px;

    border: none;
    border-radius: 11px;

    background: #8b5e34;
    color: #ffffff;

    font-size: 14px;
    font-weight: 700;

    cursor: pointer;

    transition:
        transform 0.15s ease,
        background 0.2s ease;
}

.setup-button:hover {
    background: #744c2a;
}

.setup-button:active {
    transform: scale(0.98);
}


/* =========================
   MOBILE
========================= */

@media (max-width: 600px) {

    .setup-page {
        padding: 20px 16px;
    }

    .setup-card {
        padding: 30px 22px;

        border-radius: 18px;
    }

    .setup-logo {
        width: 52px;
        height: 52px;

        border-radius: 14px;

        margin-bottom: 22px;
    }

    .setup-card h1 {
        font-size: 25px;
    }

    .setup-subtitle {
        font-size: 13px;
        margin-bottom: 25px;
    }

}
/* =================================
   MOBILE RESPONSIVE LAYOUT
================================= */

@media (max-width: 768px) {

    /* APP */

    .app-shell {
        display: block;
        min-height: 100vh;
    }

    /* SIDEBAR */

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;

        width: 230px;
        min-width: 230px;
        height: 100vh;
        min-height: 100vh;

        padding: 18px 12px;

        z-index: 100;

        transform: translateX(0);
    }

    /* MAIN */

    .app-main {
        width: 100%;
        margin-left: 0;

        min-height: 100vh;
    }

    .screen {
        width: 100%;
        max-width: none;
    }

    /* TOPBAR */

    .topbar {
        height: 62px;

        padding: 0 18px;
    }

    .topbar h1 {
        font-size: 19px;
    }

    .topbar .icon-btn:first-child {
        display: block;
        margin-right: 10px;
    }

    /* CONTENT */

    .page-pad {
        padding: 20px 16px 80px;
        width: 100%;
    }

    /* DASHBOARD METRICS */

    .grid-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .card {
        border-radius: 12px;
        padding: 16px;
    }

    .metric-value {
        font-size: 21px;
    }

    .metric-label {
        font-size: 12px;
    }

    .metric-change {
        font-size: 11px;
    }

    /* PRODUCT ROWS */

    .product-row {
        gap: 10px;
        padding: 12px 0;
    }

    .thumb {
        width: 44px;
        height: 44px;
        flex-shrink: 0;
    }

    .prod-name {
        font-size: 13px;
    }

    .prod-sub {
        font-size: 11px;
    }

    .prod-price {
        font-size: 13px;
        white-space: nowrap;
    }

    /* CHART */

    .chart {
        height: 210px;
        gap: 8px;
    }

    /* SECTION HEADINGS */

    .section-title {
        font-size: 14px;
        margin-top: 22px;
    }

    /* TABLE / WIDE CONTENT */

    .table-container {
        width: 100%;
        overflow-x: auto;
    }

}

/* =================================
   MOBILE SIDEBAR
================================= */

.mobile-menu-btn {
    display: none;
}

.sidebar-overlay {
    display: none;
}

@media (max-width: 768px) {

    /* Fixed menu button */

    .mobile-menu-btn {
        display: flex;

        position: fixed;
        top: 12px;
        left: 14px;

        width: 42px;
        height: 42px;

        align-items: center;
        justify-content: center;

        border: 1px solid #eadfce;
        border-radius: 10px;

        background: #ffffff;
        color: #4a3425;

        font-size: 22px;

        cursor: pointer;

        z-index: 1001;

        box-shadow:
            0 4px 15px rgba(0, 0, 0, 0.08);
    }

    /* Sidebar */

    .sidebar {
        width: 260px;
        min-width: 260px;

        height: 100vh;
        min-height: 100vh;

        position: fixed;

        left: 0;
        top: 0;

        z-index: 1000;

        transform: translateX(-100%);

        transition:
            transform 0.25s ease;

        box-shadow:
            8px 0 30px rgba(0, 0, 0, 0.12);
    }

    /* Open sidebar */

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    /* Dark area behind sidebar */

    .sidebar-overlay {
        display: block;

        position: fixed;

        inset: 0;

        background: rgba(0, 0, 0, 0.35);

        opacity: 0;
        visibility: hidden;

        transition:
            opacity 0.25s ease,
            visibility 0.25s ease;

        z-index: 999;
    }

    .sidebar-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    /* Main stays full width */

    .app-main {
        width: 100%;
        margin-left: 0;
    }

    /* Give topbar room for hamburger */

    .topbar {
        padding-left: 70px;
    }

    .topbar .icon-btn:first-child {
        display: none;
    }

}

/* ================================
   ADD PRODUCT FORM
================================ */

.product-form-card {
    max-width: 850px;
    margin: 0 auto;
    padding: 30px;
}

.form-heading {
    margin-bottom: 28px;
}

.form-heading h2 {
    margin: 0;
    color: #4a3425;
    font-size: 21px;
    font-weight: 700;
}

.form-heading p {
    margin: 7px 0 0;
    color: #806f63;
    font-size: 13px;
}

.product-form-card .input-group {
    margin-bottom: 20px;
}

.product-form-card label {
    display: block;
    margin-bottom: 8px;

    color: #4a3425;

    font-size: 13px;
    font-weight: 600;
}

.product-form-card .input {
    width: 100%;
    height: 48px;

    padding: 0 14px;

    border: 1px solid #ded3c5;
    border-radius: 10px;

    background: #fffdf9;
    color: #3f3026;

    font-size: 14px;

    outline: none;

    transition:
        border-color .2s ease,
        box-shadow .2s ease;
}

.product-form-card .input:focus {
    border-color: #d6a72c;

    box-shadow:
        0 0 0 3px rgba(214, 167, 44, .13);
}

.product-form-card .input::placeholder {
    color: #aaa09a;
}

.form-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 16px;
}

.field-help {
    margin-top: 7px;

    color: #8b817a;

    font-size: 11px;
}


/* BARCODE SECTION */

.barcode-form-section {
    margin-top: 28px;

    padding: 20px;

    border: 1px solid #eadfce;
    border-radius: 14px;

    background: #fbf7ef;
}

.barcode-form-heading {
    display: flex;

    align-items: flex-start;
    justify-content: space-between;

    gap: 15px;

    margin-bottom: 16px;
}

.barcode-form-heading h3 {
    margin: 0;

    color: #4a3425;

    font-size: 15px;
}

.barcode-form-heading p {
    margin: 5px 0 0;

    color: #806f63;

    font-size: 12px;
}

.optional-badge {
    padding: 5px 9px;

    border-radius: 20px;

    background: #f1e3bd;
    color: #74551e;

    font-size: 10px;
    font-weight: 700;
}

.barcode-input-row {
    display: flex;

    gap: 10px;
}

.barcode-input-row .input {
    flex: 1;
}

.barcode-input-row .secondary {
    flex-shrink: 0;
    min-width: 105px;
}

.barcode-box {
    margin-top: 16px;

    padding: 20px;

    background: #ffffff;

    border: 1px solid #eadfce;
    border-radius: 10px;

    text-align: center;

    overflow-x: auto;
}

.save-product-btn {
    width: 100%;

    margin-top: 26px;

    height: 50px;
}