body {
    margin: 0;
    padding: 0;
    background: #0b1220;
    color: #e5e7eb;
    font-family: "Segoe UI", Tahoma, sans-serif;
}

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 220px;
    height: 100vh;
    background: linear-gradient(180deg, #111827 0%, #0f172a 100%);
    border-right: 1px solid #1e293b;
    padding: 20px;
    z-index: 1000;

    /* เพิ่ม 4 บรรทัดนี้ */
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 40px;
}
/* =====================================
   Desktop Collapse Sidebar
===================================== */

.sidebar{
    transition: all .3s ease;
}

.topbar{
    transition: all .3s ease;
}

.content{
    transition: all .3s ease;
}

.sidebar.collapsed{
    left:-220px;
}

.topbar.full{
    margin-left:0;
}

.content.full{
    margin-left:0;
}

/* Desktop */

@media(min-width:769px){

    .menu-btn{
        display:block;
    }

}

/* Mobile */

@media(max-width:768px){

    .sidebar{
        left:-220px;
    }

    .sidebar.active{
        left:0;
    }

}

.sidebar .brand{
    text-align:center;
    padding:10px 0 20px;
    margin-bottom:20px;
    border-bottom:1px solid #1e293b;
}

.sidebar a {
    display: block;
    padding: 12px 14px;
    margin-bottom: 8px;
    color: #cbd5e1;
    text-decoration: none;
    border-radius: 10px;
    transition: 0.3s;
}

.sidebar a:hover {
    background: #1e293b;
    color: #38bdf8;
}

.topbar {
    margin-left: 250px;
    height: 70px;
    background: #0f172a;
    border-bottom: 1px solid #1e293b;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 25px;
}

.content {
    margin-left: 250px;
    padding: 30px;
}

.card-dark {
    background: #111827;
    border: 1px solid #1e293b;
    border-radius: 16px;
    color: white;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.login-wrap {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background:
        radial-gradient(circle at top right, rgba(56,189,248,0.15), transparent 30%),
        linear-gradient(135deg, #020617, #0f172a);
}

.login-card {
    width: 400px;
    background: rgba(17,24,39,0.95);
    border: 1px solid #1e293b;
    border-radius: 18px;
    padding: 35px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.login-title {
    text-align: center;
    font-size: 28px;
    font-weight: 700;
    color: #38bdf8;
    margin-bottom: 25px;
}

.btn-primary {
    background: #0284c7;
    border: none;
}

.btn-primary:hover {
    background: #0369a1;
}

.kpi-card {
    padding: 25px;
}

.kpi-card h5 {
    color: #94a3b8;
    margin-bottom: 10px;
}

.kpi-card h2 {
    font-size: 36px;
    font-weight: 700;
    color: #38bdf8;
}

/* =====================================
   STPTech Mobile First v1
===================================== */

@media (max-width:768px){

    .sidebar{
        left:-220px;
        transition:all .3s ease;
    }

    .topbar{
        margin-left:0;
    }

    .content{
        margin-left:0;
        padding:15px;
    }

    .login-card{
        width:95%;
    }

}
.menu-btn{
    background:none;
    border:none;
    color:white;
    font-size:24px;
    cursor:pointer;
}

@media (max-width:768px){

.sidebar.active{
    left:0;
}

}
@media (max-width:768px){

.sidebar.active{
left:0;
}

.menu-btn{
display:block;
}

}

#overlay{
    display:none;
}

@media(max-width:768px){

    #overlay{

        position:fixed;
        top:0;
        left:0;
        width:100%;
        height:100%;
        background:rgba(0,0,0,.45);

        z-index:999;

        display:none;
    }

    #overlay.active{

        display:block;

    }

    .sidebar{

        z-index:1000;

    }

}
@media (max-width:768px){

#overlay{
    position:fixed;
    top:0;
    left:0;
    width:100%;
    height:100%;
    background:rgba(0,0,0,.5);
    z-index:999;
}

#overlay.active{
    display:block;
}

}
/* STPTech Logo */


.brand-title{
    font-size:32px;
    font-weight:700;
    color:#38bdf8;
    line-height:1;
    margin-bottom:8px;
}

.brand-subtitle{
    font-size:12px;
    color:#cbd5e1;
    line-height:1.4;
}

/* Mobile */

@media(max-width:768px){

    .brand-title{

        font-size:34px;

    }

    .brand-subtitle{

        font-size:15px;

    }

}
.sidebar-divider{
    border:0;
    border-top:1px solid rgba(255,255,255,.15);
    margin:12px 15px;
}
