* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    background: #f1f5f9;
    color: #0f172a;
}
a { text-decoration: none; }

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    background: linear-gradient(135deg, #0f172a, #1d4ed8, #2563eb);
}
.login-card {
    width: 100%;
    max-width: 460px;
    background: #ffffff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0,0,0,.25);
}
.login-head {
    padding: 28px 30px;
    background: linear-gradient(135deg, #1d4ed8, #2563eb);
    color: #fff;
}
.login-head h1 { margin: 0; font-size: 30px; }
.login-head p { margin: 8px 0 0; opacity: .95; font-size: 14px; }
.login-body { padding: 28px 30px 30px; }
.form-group { margin-bottom: 18px; }
.form-label { display:block; margin-bottom:8px; font-weight:600; font-size:14px; }
.form-control {
    width: 100%;
    height: 46px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 0 14px;
    outline: none;
    font-size: 15px;
    background: #fff;
}
.form-control:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37,99,235,.12);
}
.captcha-wrap { display:flex; gap:10px; align-items:center; margin-bottom:10px; }
.captcha-text {
    min-width: 120px;
    height: 46px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1d4ed8;
    border-radius: 12px;
    display:flex;
    align-items:center;
    justify-content:center;
    font-weight:700;
    font-size:18px;
    padding:0 14px;
}
.btn-refresh {
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 12px;
    background: #e2e8f0;
    cursor: pointer;
}
.btn-refresh:hover { background:#cbd5e1; }
.btn-primary, .btn-danger, .btn-success {
    display:inline-flex;
    align-items:center;
    justify-content:center;
    border:0;
    cursor:pointer;
    font-weight:700;
}
.btn-primary {
    height:46px; border-radius:12px; background:linear-gradient(135deg,#1d4ed8,#2563eb); color:#fff; padding:0 18px;
}
.btn-danger {
    height:36px; border-radius:10px; background:#dc2626; color:#fff; padding:0 14px;
}
.btn-success {
    height:46px; border-radius:12px; background:#16a34a; color:#fff; padding:0 18px;
}
.btn-block { width:100%; }
.alert {
    padding:12px 14px;
    border-radius:12px;
    margin-bottom:16px;
    font-size:14px;
}
.alert-danger { background:#fef2f2; color:#b91c1c; border:1px solid #fecaca; }
.alert-success { background:#f0fdf4; color:#166534; border:1px solid #bbf7d0; }
.dashboard { display:flex; min-height:100vh; }
.sidebar {
    width:250px;
    background:#0f172a;
    color:#fff;
    padding:24px 18px;
}
.sidebar h2 { margin-top:0; font-size:22px; }
.sidebar a {
    display:block;
    color:#cbd5e1;
    padding:12px 14px;
    border-radius:12px;
    margin-bottom:8px;
}
.sidebar a:hover, .sidebar a.active {
    background:rgba(255,255,255,.08);
    color:#fff;
}
.main { flex:1; padding:24px; }
.topbar {
    background:#fff;
    padding:18px 22px;
    border-radius:16px;
    box-shadow:0 10px 30px rgba(15,23,42,.06);
    margin-bottom:20px;
}
.cards {
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:16px;
    margin-bottom:20px;
}
.card, .table-wrap {
    background:#fff;
    border-radius:16px;
    padding:20px;
    box-shadow:0 10px 30px rgba(15,23,42,.06);
}
.card h3, .card h4 { margin-top:0; }
.metric { font-size:30px; font-weight:700; margin-top:10px; color:#1d4ed8; }
.table-head {
    display:flex;
    justify-content:space-between;
    gap:12px;
    align-items:center;
    margin-bottom:16px;
}
.table {
    width:100%;
    border-collapse:collapse;
}
.table th, .table td {
    padding:12px;
    border-bottom:1px solid #e2e8f0;
    text-align:left;
    font-size:14px;
    vertical-align:top;
}
.badge {
    display:inline-block;
    padding:6px 10px;
    border-radius:999px;
    font-size:12px;
    font-weight:700;
}
.badge-admin { background:#dbeafe; color:#1d4ed8; }
.badge-dosen { background:#fef3c7; color:#b45309; }
.badge-mahasiswa { background:#dcfce7; color:#15803d; }
.badge-aman { background:#dcfce7; color:#15803d; }
.badge-tidak-aman { background:#fee2e2; color:#b91c1c; }
.toolbar {
    display:flex;
    gap:10px;
    flex-wrap:wrap;
    align-items:center;
}
.pagination { margin-top:18px; }
.pagination a {
    display:inline-block;
    min-width:38px;
    padding:10px 12px;
    background:#fff;
    color:#0f172a;
    border-radius:10px;
    margin-right:6px;
    box-shadow:0 6px 18px rgba(15,23,42,.05);
}
.pagination a.active {
    background:#1d4ed8;
    color:#fff;
}
.grid-2 {
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:16px;
}
textarea.form-control {
    height:auto;
    min-height:120px;
    padding:12px 14px;
}
@media (max-width: 1024px) {
    .cards { grid-template-columns:repeat(2,1fr); }
    .grid-2 { grid-template-columns:1fr; }
}
@media (max-width: 768px) {
    .dashboard { display:block; }
    .sidebar { width:100%; }
    .cards { grid-template-columns:1fr; }
}
#adminChart {
    width: 100% !important;
    min-height: 320px;
}

#checkinMap {
    width: 100%;
    min-height: 600px;
}

.toolbar .form-control {
    min-width: 160px;
}
.five-cards {
    grid-template-columns: repeat(5, 1fr);
}

@media (max-width: 1200px) {
    .five-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .five-cards {
        grid-template-columns: 1fr;
    }
}

.small-muted {
    margin-top: 6px;
    font-size: 12px;
    color: #64748b;
}

.photo-preview-wrap {
    padding: 12px;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    background: #f8fafc;
}

.foto-preview {
    display: none;
    max-width: 100%;
    max-height: 320px;
    border-radius: 12px;
}

.sidebar-user-box {
    text-align: center;
    margin-bottom: 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255,255,255,.12);
}

.sidebar-user-photo {
    width: 86px;
    height: 86px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255,255,255,.25);
    background: #fff;
}

.placeholder-photo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #334155;
    color: #fff;
}

.sidebar-user-name {
    margin-top: 10px;
    font-weight: 700;
    color: #fff;
}

.sidebar-user-role {
    margin-top: 4px;
    font-size: 12px;
    color: #cbd5e1;
}

.profile-box {
    margin-bottom: 20px;
}

.profile-photo-wrap {
    text-align: center;
}

.profile-photo {
    width: 150px;
    height: 150px;
    border-radius: 16px;
    object-fit: cover;
    border: 1px solid #cbd5e1;
}
.signature-wrap {
    margin-top: 8px;
}

.signature-pad {
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    display: block;
    margin-bottom: 8px;
}