:root{
    --primary: #DC2626;
    --primary-dark: #B91C1C;
    --primary-soft: #EF4444;
    --primary-light: #FEE2E2;

    --bg: #FFF7F7;
    --card: #FFFFFF;
    --text: #1F2937;
    --muted: #6B7280;
    --line: #F1CACA;

    --success-bg: #DCFCE7;
    --success-text: #166534;

    --warning-bg: #FEF3C7;
    --warning-text: #92400E;

    --danger-bg: #FEE2E2;
    --danger-text: #991B1B;

    --info-bg: #FEE2E2;
    --info-text: #B91C1C;

    --shadow: 0 6px 18px rgba(220, 38, 38, 0.08);
    --radius: 16px;
}

*{
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

html, body{
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
}

a{
    text-decoration: none;
    color: inherit;
}

img{
    max-width: 100%;
    display: block;
}

/* TOPBAR */
.topbar{
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: white;
    padding: 18px 16px 22px;
    border-bottom-left-radius: 22px;
    border-bottom-right-radius: 22px;
    box-shadow: var(--shadow);
}

.topbar h1,
.topbar .brand{
    margin: 0;
    font-size: 22px;
    font-weight: bold;
}

.topbar p,
.topbar .subtitle{
    margin: 6px 0 0;
    font-size: 13px;
    opacity: 0.96;
    line-height: 1.5;
}

/* CONTAINER */
.container{
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px;
    padding-bottom: 95px;
}

/* CARD */
.card{
    background: var(--card);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
    border: 1px solid #F8D4D4;
    margin-bottom: 16px;
}

.section{
    margin-bottom: 24px;
}

.section-head{
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.section-title{
    font-size: 18px;
    font-weight: bold;
    margin: 0 0 12px;
}

.section-link{
    font-size: 13px;
    font-weight: bold;
    color: var(--primary);
}

/* INPUT */
input[type="text"],
input[type="number"],
input[type="password"],
input[type="email"],
select,
textarea{
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #E7B8B8;
    border-radius: 12px;
    font-size: 14px;
    outline: none;
    background: #fff;
    color: var(--text);
}

input:focus,
select:focus,
textarea:focus{
    border-color: var(--primary-soft);
    box-shadow: 0 0 0 3px rgba(220,38,38,0.12);
}

textarea{
    min-height: 100px;
    resize: vertical;
}

label{
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: bold;
    color: #374151;
}

/* BUTTON */
.btn{
    border: none;
    text-decoration: none;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    display: inline-block;
    text-align: center;
    transition: 0.2s ease;
}

.btn-primary{
    background: var(--primary);
    color: white;
}

.btn-primary:hover{
    background: var(--primary-dark);
}

.btn-secondary{
    background: #64748B;
    color: white;
}

.btn-danger{
    background: #DC2626;
    color: white;
}

.btn-success{
    background: #15803D;
    color: white;
}

.btn-warning{
    background: #D97706;
    color: white;
}

.btn-dark{
    background: #334155;
    color: white;
}

/* SMALL TOP BUTTON */
.top-links,
.top-actions{
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.top-link,
.btn-top{
    background: rgba(255,255,255,0.14);
    color: white;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: bold;
    border: 1px solid rgba(255,255,255,0.18);
    text-align: center;
}

.btn-top{
    flex: 1;
}

/* BADGE */
.badge{
    display: inline-block;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: bold;
    margin-top: 4px;
    margin-right: 6px;
}

.badge-success{
    background: var(--success-bg);
    color: var(--success-text);
}

.badge-warning{
    background: var(--warning-bg);
    color: var(--warning-text);
}

.badge-danger{
    background: var(--danger-bg);
    color: var(--danger-text);
}

.badge-info{
    background: var(--info-bg);
    color: var(--info-text);
}

.badge-dark{
    background: #E5E7EB;
    color: #374151;
}

.badge-open{
    background: #FEE2E2;
    color: var(--primary-dark);
}

.badge-close{
    background: #FECACA;
    color: #991B1B;
}

/* ALERT */
.alert{
    padding: 12px 15px;
    border-radius: 12px;
    margin-bottom: 16px;
    font-size: 14px;
}

.alert-success{
    background: var(--success-bg);
    color: var(--success-text);
}

.alert-danger{
    background: var(--danger-bg);
    color: var(--danger-text);
}

.alert-warning{
    background: var(--warning-bg);
    color: var(--warning-text);
}

/* GRID */
.product-grid{
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.category-grid{
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.warung-list{
    display: grid;
    gap: 12px;
}

.stats-grid{
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

/* PRODUCT CARD */
.product-card{
    background: var(--card);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid #F8D4D4;
}

.product-img{
    width: 100%;
    height: 140px;
    object-fit: cover;
    background: #eee;
}

.product-body{
    padding: 12px;
}

.product-category{
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 4px;
}

.product-name{
    font-size: 14px;
    font-weight: bold;
    line-height: 1.4;
    margin-bottom: 6px;
    min-height: 38px;
}

.product-store{
    font-size: 12px;
    color: #4B5563;
    margin-bottom: 8px;
}

.product-price{
    font-size: 16px;
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 10px;
}

.product-old-price{
    font-size: 12px;
    color: #94A3B8;
    text-decoration: line-through;
    margin-bottom: 4px;
}

.product-stock{
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 10px;
}

.btn-buy{
    display: inline-block;
    width: 100%;
    text-align: center;
    background: var(--primary);
    color: white;
    padding: 10px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: bold;
}

/* CATEGORY CARD */
.category-card{
    background: var(--card);
    border-radius: 16px;
    padding: 14px 10px;
    text-align: center;
    box-shadow: var(--shadow);
    border: 1px solid #F8D4D4;
    font-size: 13px;
    min-height: 92px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.category-icon{
    font-size: 22px;
    margin-bottom: 8px;
}

/* WARUNG CARD */
.warung-card{
    background: var(--card);
    border-radius: 16px;
    padding: 14px;
    box-shadow: var(--shadow);
    border: 1px solid #F8D4D4;
}

.warung-name{
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 6px;
}

.warung-meta,
.meta,
.small-text{
    font-size: 13px;
    color: var(--muted);
    line-height: 1.6;
}

/* TABLE WRAP */
.table-wrap{
    overflow-x: auto;
    margin-top: 12px;
}

table{
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
}

table th,
table td{
    padding: 12px 10px;
    text-align: left;
    border-bottom: 1px solid #E5E7EB;
    font-size: 14px;
    vertical-align: top;
}

table th{
    background: #FEF2F2;
    color: #4B5563;
}

/* STAT BOX */
.stat-box{
    background: white;
    border-radius: 16px;
    padding: 16px;
    box-shadow: var(--shadow);
    border: 1px solid #F8D4D4;
}

.stat-box .label{
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 6px;
}

.stat-box .value{
    font-size: 20px;
    font-weight: bold;
    color: var(--primary-dark);
}

/* EMPTY BOX */
.empty-box{
    background: white;
    border-radius: 18px;
    padding: 28px;
    text-align: center;
    color: var(--muted);
    box-shadow: var(--shadow);
    border: 1px solid #F8D4D4;
}

/* BOTTOM NAV */
.bottom-nav{
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid var(--line);
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    padding: 10px 0;
    z-index: 999;
    box-shadow: 0 -4px 16px rgba(0,0,0,0.04);
}

.bottom-nav a{
    text-align: center;
    font-size: 12px;
    color: #6B7280;
}

.bottom-nav .active{
    color: var(--primary);
    font-weight: bold;
}

.nav-icon{
    display: block;
    font-size: 18px;
    margin-bottom: 4px;
}

/* RESPONSIVE */
@media (min-width: 640px){
    .product-grid{
        grid-template-columns: repeat(3, 1fr);
    }

    .category-grid{
        grid-template-columns: repeat(4, 1fr);
    }

    .warung-list{
        grid-template-columns: repeat(2, 1fr);
    }

    .stats-grid{
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 992px){
    .topbar{
        padding: 26px 24px 28px;
    }

    .container{
        padding: 24px;
        padding-bottom: 100px;
    }

    .product-grid{
        grid-template-columns: repeat(4, 1fr);
    }

    .category-grid{
        grid-template-columns: repeat(6, 1fr);
    }
}