/* ==========================================
   RESET & GLOBAL
========================================== */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Inter, Arial, sans-serif;
    background: #f5f6f8;
    color: #242424;
}

a {
    color: #7b3f17;
}

h1 {
    margin-bottom: 5px;
}

h2 {
    margin-top: 0;
}

.muted {
    color: #777;
}


/* ==========================================
   TOPBAR / NAVIGATION
========================================== */

.topbar {
    background: #21140e;
    color: #fff;
    padding: 14px 4%;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    position: sticky;
    top: 0;
    z-index: 5;
}

.brand {
    color: #fff;
    text-decoration: none;
    font-weight: 800;
    font-size: 21px;
}

.topbar nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.topbar nav a {
    color: #fff;
    text-decoration: none;
}

.user {
    background: #3b271d;
    padding: 7px 10px;
    border-radius: 20px;
    font-size: 13px;
}


/* ==========================================
   MAIN CONTAINER
========================================== */

.container {
    max-width: 1250px;
    margin: 30px auto;
    padding: 0 20px;
}


/* ==========================================
   DASHBOARD CARDS
========================================== */

.cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin: 25px 0;
}

.stat {
    background: #fff;
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 5px 20px #0000000b;
}

.stat span {
    display: block;
    color: #777;
    margin-bottom: 12px;
}

.stat b {
    font-size: 24px;
}


/* ==========================================
   PANEL
========================================== */

.panel {
    background: #fff;
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 20px;

    box-shadow: 0 5px 20px #0000000b;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}


/* ==========================================
   TABLE
========================================== */

.table-wrap {
    overflow: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    text-align: left;
    padding: 12px;
    border-bottom: 1px solid #eee;
    white-space: nowrap;
}

th {
    background: #fafafa;
}


/* ==========================================
   BUTTON
========================================== */

.btn {
    display: inline-block;

    background: #7b3f17;
    color: #fff;

    border: 0;
    border-radius: 9px;

    padding: 11px 16px;

    text-decoration: none;
    cursor: pointer;
}

.btn.small {
    padding: 8px 12px;
}

.btn.full {
    width: 100%;
    margin-top: 15px;
}


/* ==========================================
   ALERT
========================================== */

.alert {
    padding: 12px;
    border-radius: 8px;
    margin: 10px 0;
}

.danger {
    background: #fee2e2;
    color: #991b1b;
}

.success {
    background: #dcfce7;
    color: #166534;
}


/* ==========================================
   FORM
========================================== */

label {
    display: block;

    font-size: 14px;
    font-weight: 600;

    margin: 12px 0 6px;
}

input,
select {
    width: 100%;

    padding: 11px;

    border: 1px solid #ddd;
    border-radius: 8px;

    background: #fff;
}


/* ==========================================
   TWO COLUMN LAYOUT
========================================== */

.two-col {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 20px;
}


/* ==========================================
   PRODUCT IMAGE
========================================== */

.thumb {
    width: 50px;
    height: 50px;

    object-fit: cover;

    border-radius: 8px;
}


/* ==========================================
   CASHIER LAYOUT
========================================== */

.cashier-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 20px;
}


/* ==========================================
   PRODUCT GRID
========================================== */

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

.product-card {
    background: #fff;

    border-radius: 14px;
    overflow: hidden;

    box-shadow: 0 5px 20px #0000000b;
}

.product-img {
    height: 170px;

    background: #eee;

    display: flex;
    align-items: center;
    justify-content: center;
}

.product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-body {
    padding: 14px;
}

.product-body h3 {
    margin: 0 0 8px;
}

.product-body .add {
    width: 100%;
    margin-top: 12px;
}


/* ==========================================
   CART / KERANJANG
========================================== */

.cart {
    position: sticky;
    top: 85px;
    height: max-content;
}

.cart-item {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 8px;

    padding: 12px 0;

    border-bottom: 1px solid #eee;
}

.qty {
    display: flex;
    align-items: center;
    gap: 8px;
}

.qty button {
    width: 28px;
    height: 28px;

    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
}

.cart-total {
    display: flex;
    align-items: center;
    justify-content: space-between;

    font-size: 20px;

    margin: 20px 0;
    padding-top: 15px;

    border-top: 2px solid #eee;
}


/* ==========================================
   FILTER
========================================== */

.filter form {
    display: flex;
    align-items: flex-end;
    gap: 10px;
}

.filter label {
    flex: 1;
    margin: 0;
}


/* ==========================================
   LOGIN PAGE
========================================== */

.login-page {
    min-height: 100vh;

    display: grid;
    place-items: center;

    background:
        linear-gradient(
            135deg,
            #24150d,
            #7b3f17
        );
}

.login-card {
    width: min(420px, 92%);

    background: #fff;

    border-radius: 18px;

    padding: 32px;

    box-shadow: 0 20px 50px #0005;
}

.login-card h1 {
    text-align: center;
}

.logo {
    text-align: center;
    font-size: 50px;
}

.login-links {
    text-align: center;
    margin-top: 20px;
}


/* ==========================================
   CENTER PAGE
========================================== */

.center {
    min-height: 100vh;

    display: grid;
    place-items: center;
}

.center .login-card {
    text-align: center;
}


/* ==========================================
   FOOTER
========================================== */

footer {
    text-align: center;
    padding: 30px;
    color: #888;
}


/* ==========================================
   RESPONSIVE - TABLET
========================================== */

@media (max-width: 900px) {

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

    .cashier-layout,
    .two-col {
        grid-template-columns: 1fr;
    }

    .cart {
        position: static;
    }

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

    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }
}


/* ==========================================
   RESPONSIVE - MOBILE
========================================== */

@media (max-width: 560px) {

    .cards,
    .product-grid {
        grid-template-columns: 1fr;
    }

    .container {
        margin-top: 20px;
    }

    .filter form {
        display: block;
    }

    .topbar nav {
        gap: 10px;
    }
}