/* reset ajalah*/
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: #f4f6f9;
    color: #222;
    display: flex;
    min-height: 100vh;
}

/* bagian sidebar */
.sidebar {
    width: 240px;
    background: #111827;
    color: #fff;
    padding: 24px 16px;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    transition: transform .3s ease;
}

.sidebar .brand {
    font-size: 20px;
    font-weight: bold;
    letter-spacing: 1px;
    text-align: center;
    padding-bottom: 20px;
    border-bottom: 1px solid #1f2937;
    margin-bottom: 20px;
}

.sidebar ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sidebar ul li a {
    display: block;
    color: #cbd5e1;
    text-decoration: none;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 15px;
    transition: .2s;
}

.sidebar ul li a:hover,
.sidebar ul li a:focus-visible {
    background: #1f2937;
    color: #fff;
    outline: none;
}

.sidebar ul li a.active {
    background: #2563eb;
    color: #fff;
}

/* konten utama yang paling utama*/
.main {
    margin-left: 240px;
    flex: 1;
    padding: 24px 32px;
    width: calc(100% - 240px);
}

/* topbar aja */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 12px;
}

.topbar h1 {
    font-size: 24px;
    color: #111827;
}

.topbar .user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar .user img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

/* kartu statistik apanih */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
    transition: .2s;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, .1);
}

.card .label {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.card .value {
    font-size: 28px;
    font-weight: bold;
    color: #111827;
}

.card .trend {
    font-size: 13px;
    margin-top: 8px;
    color: #16a34a;
}

.card .trend.down {
    color: #dc2626;
}

/* panel grafik + aktivitas */
.panels {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 28px;
}

.panel {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
}

.panel h2 {
    font-size: 17px;
    margin-bottom: 16px;
    color: #111827;
}

/* grafik batang (manual) */
.chart {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    height: 200px;
    padding-top: 10px;
}

.chart .bar {
    flex: 1;
    background: linear-gradient(180deg, #3b82f6, #2563eb);
    border-radius: 6px 6px 0 0;
    position: relative;
    transition: height .4s ease;
}

.chart .bar span {
    position: absolute;
    bottom: -22px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    color: #6b7280;
}

/* daftar aktivitas */
.activity li {
    list-style: none;
    display: flex;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
    color: #374151;
}

.activity li:last-child {
    border-bottom: none;
}

.activity .dot {
    width: 8px;
    height: 8px;
    background: #2563eb;
    border-radius: 50%;
    margin-top: 7px;
    flex-shrink: 0;
}

/* tabel */
.table-wrap {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
    overflow-x: auto;
}

.table-wrap h2 {
    font-size: 17px;
    margin-bottom: 16px;
    color: #111827;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

thead {
    background: #f9fafb;
    text-align: left;
}

th,
td {
    padding: 12px 14px;
    border-bottom: 1px solid #f1f5f9;
}

tbody tr:hover {
    background: #f9fafb;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.badge.success {
    background: #dcfce7;
    color: #166534;
}

.badge.pending {
    background: #fef9c3;
    color: #854d0e;
}

.badge.failed {
    background: #fee2e2;
    color: #991b1b;
}

/* tombol menu (muncul di mobile) */
.menu-toggle {
    display: none;
    background: #111827;
    color: #fff;
    border: none;
    font-size: 20px;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
}

/* responsive */
@media (max-width: 900px) {
    .panels {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main {
        margin-left: 0;
        width: 100%;
        padding: 20px;
    }

    .menu-toggle {
        display: block;
    }
}