*{
    box-sizing:border-box;
}

body{
    margin:0;
    font-family:Segoe UI, Arial, sans-serif;
    background:#0b0b0b;
    color:#fff;
    overflow-x:hidden;
}

.wrapper{
    display:flex;
    min-height:100vh;
}

/* SIDEBAR */
.sidebar{
    width:220px;
    background:#111;
    padding:20px;
    height:100vh;
    position:sticky;
    top:0;
    overflow-y:auto;
    flex-shrink:0;
}

.brand{
    font-size:20px;
    margin-bottom:20px;
}

.brand span{
    color:#00c853;
}

.sidebar a{
    display:block;
    padding:10px;
    color:#bbb;
    text-decoration:none;
    border-radius:6px;
    margin-top:5px;
}

.sidebar a:hover,
.sidebar a.active{
    background:#00c853;
    color:#fff;
}

/* CONTENT */
.content{
    flex:1;
    min-width:0;
    padding:20px;
}

/* CARDS */
.cards{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
    gap:16px;
}

.card{
    background:#1a1a1a;
    padding:18px;
    border-radius:12px;
    position:relative;
    overflow:hidden;
}

/* CHART */
.chart-box{
    margin-top:20px;
    background:#121212;
    padding:12px;
    border-radius:14px;
    border:1px solid #1f1f1f;
    height:260px;
    overflow:hidden;
}

.chart-box canvas{
    width:100% !important;
    height:100% !important;
}

/* TABLE FIX */
.table{
    width:100%;
    border-collapse:collapse;
}

.table thead th{
    text-align:left !important;
    padding:14px 12px;
    color:#aaa;
    font-weight:500;
}

.table td{
    padding:14px 12px;
    border-bottom:1px solid #333;
}

.table td:nth-child(2){
    text-align:center;
}

.table td:nth-child(3){
    text-align:center;
}

.table td:nth-child(4){
    text-align:right;
}

.table th:nth-child(2),
.table th:nth-child(3){
    text-align:center !important;
}

.table th:nth-child(4){
    text-align:right !important;
}

/* TABLE WRAP FOR MOBILE */
.table-wrap{
    width:100%;
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
}

/* BUTTONS */
.btn{
    background:#00c853;
    color:#fff;
    padding:6px 10px;
    border:none;
    border-radius:6px;
    cursor:pointer;
}

.btn-small{
    padding:5px 8px;
    font-size:12px;
    margin-right:5px;
}

.btn-edit{
    background:#2196f3;
}

.btn-delete{
    background:#e53935;
}

/* FORM */
.form-grid{
    display:flex;
    gap:10px;
    margin-bottom:20px;
    align-items:center;
    flex-wrap:wrap;
}

.form-grid input{
    flex:1;
    min-width:150px;
}

.form-grid .btn{
    white-space:nowrap;
}

input, select, textarea{
    max-width:100%;
}

/* MODAL */
.modal{
    display:none;
    position:fixed;
    top:0;
    left:0;
    width:100%;
    height:100%;
    background:rgba(0,0,0,0.7);
    justify-content:center;
    align-items:center;
    z-index:9999;
    padding:16px;
}

.modal.open{
    display:flex;
}

.modal-box{
    width:100%;
    max-width:700px;
    background:#1a1a1a;
    padding:20px;
    border-radius:12px;
    margin:auto;
}

/* TABLE DEFAULTS */
table{
    width:100%;
    border-collapse:collapse;
    margin-top:20px;
}

th, td{
    padding:12px;
    border-bottom:1px solid #333;
}

/* MOBILE */
@media (max-width: 992px){
    .sidebar{
        width:200px;
    }

    .cards{
        grid-template-columns:repeat(auto-fit,minmax(180px,1fr));
    }

    .chart-box{
        height:230px;
    }
}

@media (max-width: 768px){
    .wrapper{
        flex-direction:column;
    }

    .sidebar{
        width:100%;
        height:auto;
        position:relative;
        padding:14px;
    }

    .content{
        padding:14px;
    }

    .cards{
        grid-template-columns:repeat(2,1fr);
        gap:12px;
    }

    .card{
        padding:14px;
    }

    .chart-box{
        height:210px;
        padding:10px;
    }

    .modal-box{
        max-width:100%;
    }
}

@media (max-width: 520px){
    .cards{
        grid-template-columns:1fr;
    }

    .chart-box{
        height:190px;
    }

    .form-grid{
        flex-direction:column;
        align-items:stretch;
    }

    .form-grid input,
    .form-grid .btn{
        width:100%;
        min-width:0;
    }

    .table thead th,
    .table td{
        padding:10px 8px;
        font-size:13px;
    }
}