:root {
    --biru: #2196f3;
    --biru-tua: #1769aa;
    --biru-gelap-bg: #1b2430;
    --hijau: #28a745;
    --merah: #dc3545;
    --abu: #f4f6f9;
}

* { box-sizing: border-box; }

body {
    background-color: var(--abu);
    font-family: 'Segoe UI', Arial, sans-serif;
    margin: 0;
}

/* ============ LOGIN / REGISTER ============ */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--biru) 0%, var(--biru-tua) 100%);
    padding: 20px;
}

.auth-card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0,0,0,.25);
    width: 100%;
    max-width: 400px;
    overflow: hidden;
}

.auth-card .auth-head {
    background: var(--biru);
    color: #fff;
    text-align: center;
    padding: 26px 20px 18px;
}

.auth-card .auth-head h3 { margin: 6px 0 0; font-weight: 600; }
.auth-card .auth-body { padding: 26px; }

.role-tabs {
    display: flex;
    background: #eef3fa;
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 20px;
}
.role-tabs label {
    flex: 1;
    text-align: center;
    padding: 8px 0;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    color: #5a6b80;
    transition: .2s;
}
.role-tabs input { display: none; }
.role-tabs input:checked + label {
    background: var(--biru);
    color: #fff;
}

/* ============ TOPBAR (umum) ============ */
.topbar {
    background: var(--biru);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
}
.topbar .brand { display: flex; align-items: center; gap: 12px; }
.topbar .brand .logo-circle {
    width: 36px; height: 36px; border-radius: 50%;
    background: #fff; color: var(--biru); display: flex;
    align-items: center; justify-content: center; font-weight: 700;
}
.topbar h1 { font-size: 18px; margin: 0; letter-spacing: .5px; }

.topbar .user-menu { position: relative; }
.topbar .user-menu > a {
    color: #fff; text-decoration: none; display: flex; align-items: center; gap: 8px;
}
.user-dropdown {
    position: absolute; right: 0; top: 42px;
    background: #fff; color: #222; border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.2); min-width: 200px; z-index: 50;
    display: none; overflow: hidden;
}
.user-menu:hover .user-dropdown,
.user-menu:focus-within .user-dropdown { display: block; }
.user-dropdown a {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 18px; color: #333; text-decoration: none; font-size: 14px;
}
.user-dropdown a:hover { background: #f1f5fb; }
.user-dropdown a.danger { color: var(--merah); }

/* ============ LAYOUT SISWA (sidebar kiri) ============ */
.app-layout { display: flex; min-height: 100vh; }

.sidebar {
    width: 250px;
    background: #fff;
    border-right: 1px solid #e6e9ee;
    padding: 24px 0;
    flex-shrink: 0;
}
.sidebar .profile-box {
    text-align: center;
    padding: 0 16px 22px;
    border-bottom: 1px solid #eef1f5;
    margin-bottom: 12px;
}
.sidebar .profile-box img {
    width: 78px; height: 78px; border-radius: 50%;
    object-fit: cover; border: 3px solid var(--biru);
}
.sidebar .profile-box h4 { margin: 10px 0 2px; font-size: 15px; }
.sidebar .profile-box small { color: #8a93a3; }

.sidebar nav a {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 22px; color: #4b5a6b; text-decoration: none;
    font-size: 14.5px; font-weight: 500; border-left: 3px solid transparent;
}
.sidebar nav a:hover { background: #f3f7fd; color: var(--biru); }
.sidebar nav a.active {
    background: #eaf3ff; color: var(--biru); border-left-color: var(--biru); font-weight: 700;
}

.main-content { flex: 1; padding: 26px 30px; }
.page-head {
    background: var(--biru);
    color: #fff;
    padding: 18px 26px;
    border-radius: 10px;
    margin-bottom: 22px;
}
.page-head h2 { margin: 0; font-size: 20px; }
.page-head p { margin: 2px 0 0; opacity: .9; font-size: 13.5px; }

/* ============ CARD UMUM ============ */
.box {
    background: #fff;
    border-radius: 10px;
    padding: 22px;
    box-shadow: 0 2px 10px rgba(0,0,0,.05);
    margin-bottom: 22px;
}

.summary-cards { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.summary-cards .card-mini {
    flex: 1; min-width: 170px; background: #fff; border-radius: 10px;
    padding: 18px 20px; box-shadow: 0 2px 10px rgba(0,0,0,.05);
    border-left: 4px solid var(--biru);
}
.card-mini.lunas { border-left-color: var(--hijau); }
.card-mini.belum { border-left-color: var(--merah); }
.card-mini .label { font-size: 13px; color: #8a93a3; }
.card-mini .value { font-size: 22px; font-weight: 700; margin-top: 4px; }

/* ============ TABEL ============ */
table.data-table { width: 100%; border-collapse: collapse; background: #fff; }
table.data-table th {
    background: #f7f9fc; color: var(--biru-tua); text-transform: uppercase;
    font-size: 12px; padding: 12px; text-align: left; border-bottom: 2px solid #eef1f5;
}
table.data-table td { padding: 12px; border-bottom: 1px solid #eef1f5; font-size: 14px; }
table.data-table tr:hover td { background: #fafcff; }

.badge-status {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px; border-radius: 20px; font-size: 12.5px; font-weight: 700;
}
.badge-lunas { background: #e6f7ec; color: var(--hijau); }
.badge-belum { background: #fdeaec; color: var(--merah); }

.btn { display: inline-block; padding: 9px 18px; border-radius: 6px; border: none; font-weight: 600; cursor: pointer; text-decoration: none; font-size: 14px; }
.btn-primary { background: var(--biru); color: #fff; }
.btn-primary:hover { background: var(--biru-tua); }
.btn-success { background: var(--hijau); color: #fff; }
.btn-danger { background: var(--merah); color: #fff; }
.btn-secondary { background: #6c757d; color: #fff; }
.btn-sm { padding: 5px 12px; font-size: 12.5px; }

.form-control, select.form-control {
    width: 100%; padding: 10px 12px; border: 1px solid #dce2ea; border-radius: 6px; font-size: 14px;
}
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 13.5px; color: #445163; }

.toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }

.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; }
.alert-success { background: #e6f7ec; color: #1e7e34; }
.alert-danger { background: #fdeaec; color: #a71d2a; }

/* ============ ADMIN NAVBAR (atas) ============ */
.admin-nav {
    background: var(--biru-gelap-bg);
    padding: 0 24px;
    display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
}
.admin-nav a {
    color: #cfd8e3; text-decoration: none; padding: 16px 18px;
    font-size: 14px; font-weight: 500; display: inline-block;
}
.admin-nav a:hover, .admin-nav a.active { color: #fff; background: rgba(255,255,255,.08); }

@media (max-width: 860px) {
    .sidebar { display: none; }
}
