/* =================================
   WARNA WEBSITE
================================= */

:root{
    --navy:#071a3d;
    --navy-hover:#0f2a5f;

    --white:#ffffff;
    --bg:#f4f6f9;

    --text:#1f2937;
    --border:#dbe3ea;

    --blue:#2563eb;
    --green:#16a34a;
    --orange:#ea580c;
    --purple:#9333ea;
}

/* =================================
   RESET
================================= */

*{
    margin:0;
    padding:0;
    box-sizing:border-box;
    font-family:'Segoe UI',sans-serif;
}

body{
    background:var(--bg);
    color:var(--text);
}

/* =================================
   NAVBAR
================================= */

.top-navbar{
    height:70px;
    background:var(--navy);

    display:flex;
    justify-content:space-between;
    align-items:center;

    padding:0 20px;

    color:white;

    position:fixed;
    top:0;
    width:100%;

    z-index:1000;
}

.nav-left,
.nav-right{
    display:flex;
    align-items:center;
    gap:15px;
}

.btn-toggle{
    border:none;
    background:none;
    color:white;
    font-size:22px;
    cursor:pointer;
}

.logo-circle{
    font-size:24px;
    color:#38bdf8;
}

.header-titles h1{
    font-size:16px;
}

.header-titles p{
    font-size:11px;
    color:#94a3b8;
}

/* =================================
   STATUS
================================= */

.badge{
    padding:6px 15px;
    border-radius:20px;
    font-size:11px;
    font-weight:600;
}

.connecting{
    background:#fff7ed;
    color:#ea580c;
}

.online{
    background:#dcfce7;
    color:#16a34a;
}

.offline{
    background:#fee2e2;
    color:#dc2626;
}

/* =================================
   JAM
================================= */

.clock-display{
    text-align:right;
}

#clock-time{
    font-size:20px;
    font-weight:bold;
}

.clock-wib{
    font-size:10px;
    color:#94a3b8;
}

/* =================================
   LAYOUT
================================= */

.layout-body{
    display:flex;
    margin-top:70px;
}

/* =================================
   SIDEBAR
================================= */

.sidebar{
    width:250px;
    height:calc(100vh - 70px);

    background:var(--navy);

    position:fixed;
    left:0;

    display:flex;
    flex-direction:column;
    justify-content:space-between;

    overflow:hidden;

    transition:0.3s;
}

.sidebar.collapsed{
    width:0;
}

.sidebar.collapsed .sidebar-nav,
.sidebar.collapsed .sidebar-footer{
    display:none;
}

.sidebar-nav{
    padding:15px;
}

.nav-item{
    width:100%;

    background:none;
    border:none;

    color:#e5e7eb;

    padding:12px;

    margin-bottom:10px;

    border-radius:8px;

    text-align:left;

    cursor:pointer;
}

.nav-item:hover{
    background:var(--navy-hover);
}

.nav-item.active{
    background:#1d4ed8;
    color:white;
}

.sidebar-footer{
    text-align:center;
    color:#94a3b8;
    font-size:11px;
    padding:15px;
}

/* =================================
   MAIN CONTENT
================================= */

.main-content{
    margin-left:250px;
    width:calc(100% - 250px);

    padding:20px;

    transition:0.3s;
}

.main-content.expanded{
    margin-left:0;
    width:100%;
}

/* =================================
   HEADER DASHBOARD
================================= */

.content-header{
    display:flex;
    justify-content:space-between;
    align-items:center;

    margin-bottom:20px;
}

.last-update-box{
    background:white;

    border:1px solid var(--border);

    padding:10px 15px;

    border-radius:8px;
}

.live-dot{
    color:var(--blue);
    font-size:12px;
}

/* =================================
   BUTTON
================================= */

.btn{
    padding:8px 14px;

    border-radius:6px;

    cursor:pointer;

    border:none;
}

.btn-primary{
    background:var(--blue);
    color:white;
}

.btn-success{
    background:var(--green);
    color:white;
}

.btn-outline{
    background:white;
    border:1px solid var(--border);
}

/* =================================
   CARD SENSOR
================================= */

.stat-cards{
    display:grid;

    grid-template-columns:
    repeat(4,1fr);

    gap:20px;

    margin-bottom:20px;
}

.card{
    background:white;

    border:1px solid var(--border);

    border-radius:10px;

    padding:20px;

    text-align:center;
}

.card label{
    display:block;
    margin-bottom:10px;
}

.card h3{
    font-size:32px;
}

.unit{
    font-size:12px;
    color:#6b7280;
}

.card-footer{
    margin-top:10px;
    font-size:11px;
    color:#94a3b8;
}

.val-tinggi{color:var(--blue);}
.val-kecepatan{color:var(--green);}
.val-debit{color:var(--orange);}
.val-volume{color:var(--purple);}

/* =================================
   GRAFIK
================================= */

.charts-section{
    display:grid;

    grid-template-columns:
    repeat(4,1fr);

    gap:15px;

    margin-bottom:20px;
}

.chart-card{
    background:white;

    border:1px solid var(--border);

    border-radius:10px;

    padding:15px;
}

.chart-card h4{
    margin-bottom:10px;
}

.canvas-container{
    height:150px;
}

/* =================================
   FILTER
================================= */

.filter-card{
    background:white;

    border:1px solid var(--border);

    border-radius:10px;

    padding:20px;

    margin-bottom:20px;
}

.filter-body{
    display:flex;
    flex-wrap:wrap;
    gap:15px;
}

.input-group label{
    display:block;
    margin-bottom:5px;
    font-size:12px;
}

.input-group input{
    padding:8px;

    border:1px solid var(--border);

    border-radius:6px;
}

.btn-group{
    display:flex;
    gap:10px;
    align-items:end;
}

/* =================================
   TABLE
================================= */

.table-section{
    background:white;

    border:1px solid var(--border);

    border-radius:10px;

    overflow:hidden;
}

.section-header{
    padding:15px;

    border-bottom:1px solid var(--border);

    background:#f8fafc;
}

.table-container{
    overflow-x:auto;
}

table{
    width:100%;
    border-collapse:collapse;
}

th{
    background:#f8fafc;

    padding:12px;

    border-bottom:2px solid var(--border);

    text-align:center;
}

td{
    padding:10px;

    border-bottom:1px solid var(--border);

    text-align:center;
}

tr:hover{
    background:#f9fafb;
}

/* =================================
   UTILITAS
================================= */

.mt-4{
    margin-top:20px;
}

.text-center{
    text-align:center;
}

.py-4{
    padding:16px 0;
}

/* =================================
   RESPONSIVE
================================= */

@media(max-width:1200px){

    .stat-cards{
        grid-template-columns:repeat(2,1fr);
    }

    .charts-section{
        grid-template-columns:repeat(2,1fr);
    }
}

@media(max-width:768px){

    .sidebar{
        width:0;
    }

    .main-content{
        margin-left:0;
        width:100%;
    }

    .stat-cards,
    .charts-section{
        grid-template-columns:1fr;
    }

    .clock-display{
        display:none;
    }
}