:root{
    --sidebar-width:260px;
}

body{
    font-family:'Anuphan',sans-serif;
    background:#f5f7fb;
    color:#1e293b;
    overflow:hidden;
}

/* Sidebar */
.sidebar{
    position:fixed;
    left:0;
    top:0;
    width:var(--sidebar-width);
    height:100vh;
    background:#ffffff;
    color:#fff;
    z-index:1000;
}

.sidebar .nav-link{
    color: #133c77;
    border-radius:10px;
    margin-bottom:5px;
    padding:10px 15px;
}

.sidebar .nav-link:hover{
    background:linear-gradient(90deg,#4224cd,#2c1a85);
    color:#fff;

}

/* Main */
.main{
    margin-left:var(--sidebar-width);
}

/* Navbar */
.topbar{
    height:70px;
    background:#ffffff;
    box-shadow:0 2px 15px rgba(0,0,0,.08);
}

/* KPI */
.card-kpi{
    border:none;
    border-radius:15px;
    box-shadow:0 2px 10px rgba(0,0,0,.08);
}

/* Map */
#map{
    height:calc(100vh - 230px);
    width:100%;
    border-radius:15px;
}

/* Tooltip */
.leaflet-tooltip{
    background:#fff;
    border:1px solid #ddd;
    color:#333;
}

.card-kpi{
    border-radius:20px;
    transition:.25s;
}
.card-kpi:hover{
    transform:translateY(-4px);
    box-shadow:0 10px 25px rgba(0,0,0,.12);
}
#map{
    border-radius:20px;
    overflow:hidden;
}




.leaflet-container{
    background:#ffffff;
}

.card-kpi{
    border:1px solid transparent !important;
    border-radius:16px !important;

    background:
        linear-gradient(#FFFFFF,#FFFFFF) padding-box,
        linear-gradient(
        90deg,
        #1ab7f1,
        #078fe9,
        #348be0,
        #133c77
        ) border-box !important;

    box-shadow:0 4px 12px rgba(37,99,235,.15);
}

.kpi-total{
    border:1px solid transparent !important;
    background:
        linear-gradient(45deg,#FFFFFF,#FFFFFF) padding-box,
        linear-gradient(
        90deg,
        #1ab7f1,
        #078fe9,
        #348be0,
        #133c77
        ) border-box !important;
}

.kpi-food{
    border:1px solid transparent !important;
    background:
        linear-gradient(45deg,#FFFFFF,#FFFFFF) padding-box,
        linear-gradient(
        90deg,
        #eb8911,
        #dc6e1c
        ) border-box !important;
}

.kpi-herb{
    border:1px solid transparent !important;
    background:
        linear-gradient(45deg,#FFFFFF,#FFFFFF) padding-box,
        linear-gradient(
        90deg,
        #6dc262,
        #3a7a4b
        ) border-box !important;
}

.kpi-travel{
    border:1px solid transparent !important;
    background:
        linear-gradient(45deg,#FFFFFF,#FFFFFF) padding-box,
        linear-gradient(
        90deg,
        #563edc,
        #3022a2
        ) border-box !important;
}

.sidebar .nav-link.active{
    background:linear-gradient(90deg,#4224cd,#2c1a85);
    color:#fff;
}

body.view-stores{
    overflow:auto;
}

body.view-stores .main{
    min-height:100vh;
}

#storeTableWrap{
    max-height:calc(100vh - 220px);
    overflow:auto;
}

#storeTable tbody tr{
    cursor:pointer;
}

#storeTable tbody tr:hover{
    background:#f1f5f9;
}

.type-checkbox-group{
    display:grid;
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap:8px;
    max-height:220px;
    overflow-y:auto;
    border:1px solid #e2e8f0;
    border-radius:10px;
    padding:12px;
    background:#f8fafc;
}

.type-checkbox-group .form-check{
    margin:0;
}

.icon-picker-grid{
    display:grid;
    grid-template-columns:repeat(auto-fill, minmax(96px, 1fr));
    gap:10px;
    max-height:240px;
    overflow-y:auto;
    border:1px solid #e2e8f0;
    border-radius:10px;
    padding:12px;
    background:#f8fafc;
}

.icon-picker-item{
    border:2px solid #e2e8f0;
    border-radius:12px;
    padding:10px 8px;
    text-align:center;
    cursor:pointer;
    background:#fff;
    transition:border-color .2s, background .2s;
}

.icon-picker-item:hover{
    border-color:#93c5fd;
}

.icon-picker-item.active{
    border-color:#348be0;
    background:#eff6ff;
}

.icon-picker-item img{
    width:52px;
    height:52px;
    object-fit:contain;
    display:block;
    margin:0 auto 6px;
}

.icon-picker-item small{
    display:block;
    font-size:.72rem;
    line-height:1.3;
    color:#475569;
}

.store-detail-header{
    border-radius:16px;
    background:#fff;
    box-shadow:0 2px 12px rgba(0,0,0,.08);
}

.store-detail-icon{
    width:72px;
    height:72px;
    object-fit:contain;
}

.menu-group-card{
    border:none;
    border-radius:16px;
    box-shadow:0 2px 10px rgba(0,0,0,.06);
    overflow:hidden;
}

.menu-group-card .card-header{
    background:linear-gradient(90deg,#133c77,#348be0);
    color:#fff;
    font-weight:600;
}

.menu-item-card{
    border:1px solid #e2e8f0;
    border-radius:12px;
    height:100%;
}

.menu-item-image{
    width:100%;
    height:140px;
    object-fit:cover;
    border-radius:10px;
    background:#f1f5f9;
}

.menu-item-placeholder{
    width:100%;
    height:140px;
    border-radius:10px;
    background:#f1f5f9;
    display:flex;
    align-items:center;
    justify-content:center;
    color:#94a3b8;
    font-size:2rem;
}

.menu-list{
    max-height:250px;
    overflow-y:auto;
    font-family: Anuphan;
}

.menu-item{
    display:flex;
    align-items:center;
    gap:10px;
    padding:6px;
    border:1px solid #e5e7eb;
    border-radius:10px;
    background:#fff;
}

.menu-thumb{
    width:48px;
    height:48px;
    object-fit:cover;
    border-radius:8px;
}

.menu-name{
    flex:1;
    font-size:12px;
}

.popupmap{
    font-family: Anuphan;
}

/* ===== Responsive ===== */
@media (max-width: 768px){
    :root{--sidebar-width:0px;}
    body{overflow:auto;}
    .sidebar{
        position:relative;
        width:100%;
        height:auto;
        min-height:auto;
        border-bottom:1px solid #ddd;
    }
    .main{margin-left:0;}
    .topbar{
        height:auto;
        min-height:70px;
        padding:10px 15px;
        flex-wrap:wrap;
        gap:10px;
    }
    #map{height:50vh !important;}
    .type-checkbox-group{grid-template-columns:1fr;}
    .icon-picker-grid{grid-template-columns:repeat(2,1fr);}
    #storeTableWrap{overflow-x:auto;}
    #storeTable{min-width:900px;}
}

#viewDashboard{
    height:calc(100vh - 110px);
}

#viewDashboard .col-lg-4{
    height:calc(100vh - 110px);
    overflow-y:auto;
    padding-right:5px;
}

#viewDashboard .col-lg-4::-webkit-scrollbar{
    width:8px;
}

#viewDashboard .col-lg-4::-webkit-scrollbar-track{
    background:#f1f5f9;
}

#viewDashboard .col-lg-4::-webkit-scrollbar-thumb{
    background:#3b82f6;
    border-radius:10px;
}

#map{
    height:calc(100vh - 160px);
}

.right-panel{
    height:calc(100vh - 140px);
    overflow-y:auto;
}