/* =====================================================
   GreenCampus Management System
   Smart Energy Monitoring
   Institut Bisnis & Informatika Kesatuan
===================================================== */

:root{
    --sidebar-bg:#014d40;
    --sidebar-bg2:#00695c;
    --primary:#16a34a;
    --success:#22c55e;
    --warning:#f59e0b;
    --danger:#ef4444;
    --info:#3b82f6;
    --purple:#8b5cf6;
    --light:#f5f7fb;
    --border:#e5e7eb;
    --text:#1f2937;
    --muted:#6b7280;
    --white:#ffffff;
}

*{
    margin:0;
    padding:0;
    box-sizing:border-box;
}

body{
    background:var(--light);
    font-family:'Segoe UI',Tahoma,sans-serif;
    color:var(--text);
}

/* ====================================
   SIDEBAR
==================================== */

.sidebar{
    width:240px;
    height:100vh;
    position:fixed;
    top:0;
    left:0;
    background:linear-gradient(180deg,var(--sidebar-bg),var(--sidebar-bg2));
    overflow-y:auto;
    z-index:1000;
}

.sidebar::-webkit-scrollbar{
    width:6px;
}

.sidebar::-webkit-scrollbar-thumb{
    background:rgba(255,255,255,.2);
}

.logo{
    padding:20px;
    color:white;
    border-bottom:1px solid rgba(255,255,255,.1);
}

.logo h4{
    font-weight:700;
    margin-bottom:0;
}

.logo small{
    opacity:.8;
}

.sidebar-title{
    color:#cbd5e1;
    font-size:12px;
    font-weight:600;
    padding:15px 20px 8px;
    text-transform:uppercase;
}

.sidebar .nav-link{
    color:white;
    padding:12px 20px;
    display:flex;
    align-items:center;
    gap:10px;
    transition:.3s;
}

.sidebar .nav-link:hover{
    background:rgba(255,255,255,.1);
}

.sidebar .nav-link.active{
    background:#0ea54b;
    border-radius:10px;
    margin:0 10px;
}

.sidebar .nav-link i{
    width:20px;
}

/* ====================================
   CONTENT
==================================== */

.content{
    margin-left:240px;
    min-height:100vh;
}

.main-content{
    padding:20px;
}

/* ====================================
   NAVBAR
==================================== */

.topbar{
    background:white;
    height:70px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:0 25px;
    border-bottom:1px solid var(--border);
}

.topbar-left{
    display:flex;
    align-items:center;
    gap:15px;
}

.topbar-right{
    display:flex;
    align-items:center;
    gap:20px;
}

.topbar-title{
    font-size:22px;
    font-weight:600;
}

.user-info{
    text-align:right;
}

.user-name{
    font-weight:600;
}

.user-role{
    font-size:12px;
    color:var(--muted);
}

/* ====================================
   KPI CARD
==================================== */

.kpi-card{
    background:white;
    border:none;
    border-radius:15px;
    box-shadow:0 2px 10px rgba(0,0,0,.05);
    height:100%;
}

.kpi-card .card-body{
    display:flex;
    align-items:center;
    gap:15px;
    padding:20px;
}

.kpi-icon{
    width:65px;
    height:65px;
    border-radius:50%;
    display:flex;
    align-items:center;
    justify-content:center;
    color:white;
    font-size:28px;
}

.bg-green{
    background:#22c55e;
}

.bg-blue{
    background:#3b82f6;
}

.bg-orange{
    background:#f59e0b;
}

.bg-purple{
    background:#8b5cf6;
}

.bg-red{
    background:#ef4444;
}

.kpi-title{
    font-size:14px;
    color:var(--muted);
}

.kpi-value{
    font-size:34px;
    font-weight:700;
    line-height:1.1;
}

.kpi-subtitle{
    font-size:13px;
    color:#16a34a;
}

/* ====================================
   CARD
==================================== */

.dashboard-card{
    background:white;
    border:none;
    border-radius:15px;
    box-shadow:0 2px 10px rgba(0,0,0,.05);
}

.dashboard-card .card-header{
    background:white;
    border-bottom:1px solid var(--border);
    padding:15px 20px;
    font-weight:600;
}

.dashboard-card .card-body{
    padding:20px;
}

/* ====================================
   TABLE
==================================== */

.table{
    margin-bottom:0;
}

.table th{
    background:#f8fafc;
    font-size:13px;
    font-weight:600;
}

.table td{
    vertical-align:middle;
}

/* ====================================
   STATUS BADGE
==================================== */

.badge-efisien{
    background:#dcfce7;
    color:#166534;
    padding:6px 10px;
    border-radius:8px;
}

.badge-normal{
    background:#fef3c7;
    color:#92400e;
    padding:6px 10px;
    border-radius:8px;
}

.badge-boros{
    background:#fee2e2;
    color:#991b1b;
    padding:6px 10px;
    border-radius:8px;
}

.badge-online{
    background:#16a34a;
    color:white;
    border-radius:20px;
    padding:5px 12px;
}

.badge-offline{
    background:#ef4444;
    color:white;
    border-radius:20px;
    padding:5px 12px;
}

/* ====================================
   ALERT CENTER
==================================== */

.alert-item{
    border-radius:10px;
    padding:12px 15px;
    margin-bottom:10px;
    display:flex;
    justify-content:space-between;
    align-items:center;
}

.alert-danger-custom{
    background:#fef2f2;
    border:1px solid #fecaca;
}

.alert-warning-custom{
    background:#fffbeb;
    border:1px solid #fde68a;
}

.alert-success-custom{
    background:#f0fdf4;
    border:1px solid #bbf7d0;
}

/* ====================================
   PROGRESS GEDUNG
==================================== */

.building-item{
    margin-bottom:18px;
}

.building-name{
    font-size:14px;
    margin-bottom:6px;
}

.progress{
    height:12px;
    border-radius:20px;
}

.progress-bar{
    border-radius:20px;
}

/* ====================================
   GREENMETRIC SCORE
==================================== */

.greenmetric-score{
    background:linear-gradient(180deg,#16a34a,#15803d);
    color:white;
    border-radius:15px;
    padding:25px;
    text-align:center;
}

.greenmetric-score h1{
    font-size:60px;
    font-weight:700;
    margin-bottom:0;
}

.greenmetric-score h5{
    margin-top:10px;
}

/* ====================================
   FOOTER
==================================== */

.footer{
    text-align:center;
    padding:20px;
    color:var(--muted);
    font-size:14px;
}

/* ====================================
   CHART
==================================== */

canvas{
    max-width:100%;
}

/* ====================================
   RESPONSIVE
==================================== */

@media(max-width:992px){

    .sidebar{
        width:80px;
    }

    .logo h4,
    .logo small,
    .sidebar-title,
    .sidebar .nav-link span{
        display:none;
    }

    .content{
        margin-left:80px;
    }

}

@media(max-width:768px){

    .sidebar{
        display:none;
    }

    .content{
        margin-left:0;
    }

    .topbar{
        flex-direction:column;
        height:auto;
        padding:15px;
    }

    .topbar-right{
        margin-top:10px;
    }

    .kpi-value{
        font-size:24px;
    }

}