:root {
    --nu-green: #046A38;
    --nu-dark: #024725;
    --nu-gold: #D4AF37;
    --bg-light: #F4F6F8;
    --surface: #FFFFFF;
    --text-main: #1E293B;
    --text-muted: #64748B;
    --border: #E2E8F0;
    --radius: 14px;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-main);
    line-height: 1.5;
}

/* Layout Utama Desktop */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: var(--nu-green);
    color: #fff;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(255,255,255,0.15);
    margin-bottom: 20px;
}

.brand-badge {
    width: 44px;
    height: 44px;
    background: var(--nu-gold);
    color: var(--nu-dark);
    font-weight: 800;
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-size: 1.1rem;
}

.brand h2 { font-size: 1rem; letter-spacing: 0.5px; }
.brand span { font-size: 0.75rem; opacity: 0.85; }

.nav-menu { display: flex; flex-direction: column; gap: 8px; }
.nav-item {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    padding: 12px 16px;
    border-radius: 10px;
    font-weight: 500;
    transition: 0.2s;
}
.nav-item:hover, .nav-item.active {
    background: rgba(255,255,255,0.18);
    color: #fff;
    font-weight: 600;
}

.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 28px;
}

.container { max-width: 1100px; margin: 0 auto; }

/* Mobile Header & Bottom Nav (Default tersembunyi di PC) */
.mobile-header, .bottom-nav { display: none; }

/* Komponen UI */
.page-header { margin-bottom: 24px; }
.page-header h2 { font-size: 1.4rem; color: var(--nu-dark); }
.page-header p { color: var(--text-muted); font-size: 0.9rem; }
.flex-between { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }

.card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.grid-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.stat-card { display: flex; flex-direction: column; gap: 6px; }
.stat-label { font-size: 0.85rem; color: var(--text-muted); }
.stat-value { font-size: 2rem; font-weight: 800; }
.text-green { color: var(--nu-green); }

.highlight-card {
    background: linear-gradient(135deg, var(--nu-green), var(--nu-dark));
    color: #fff;
}
.highlight-card .stat-label { color: rgba(255,255,255,0.85); }
.stat-status {
    display: inline-block;
    width: fit-content;
    background: var(--nu-gold);
    color: var(--nu-dark);
    font-size: 0.7rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 6px;
}

.komisi-list { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.komisi-item {
    display: flex;
    justify-content: space-between;
    padding: 12px;
    background: var(--bg-light);
    border-radius: 10px;
}

/* Form & Buttons */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 14px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 0.85rem; font-weight: 600; }
.form-group input, .form-group select {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 0.95rem;
}
.form-actions { grid-column: 1 / -1; }

.btn {
    padding: 12px 18px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    font-size: 0.9rem;
}
.btn-primary { background: var(--nu-green); color: #fff; }
.btn-primary:active { transform: scale(0.98); }
.btn-outline {
    background: transparent;
    border: 1px solid var(--nu-green);
    color: var(--nu-green);
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

/* Peserta Cards */
.peserta-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.id-header { display: flex; justify-content: space-between; margin-bottom: 10px; }
.kode-badge { background: #E6F4EA; color: var(--nu-green); font-weight: 700; padding: 3px 8px; border-radius: 6px; font-size: 0.8rem; }
.komisi-tag { background: #FEF3C7; color: #92400E; font-size: 0.75rem; font-weight: 600; padding: 3px 8px; border-radius: 6px; }
.utusan-text { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 14px; }
.id-footer { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--border); padding-top: 10px; font-size: 0.85rem; }

/* Materi */
.materi-list { display: flex; flex-direction: column; gap: 12px; }
.materi-card { display: flex; justify-content: space-between; align-items: center; gap: 12px; }

/* Table */
.table-responsive { overflow-x: auto; margin-top: 12px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.data-table th, .data-table td { padding: 12px; text-align: left; border-bottom: 1px solid var(--border); }

/* Modal & Alerts */
.hidden { display: none !important; }
.mt-15 { margin-top: 15px; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.w-100 { width: 100%; }

.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-weight: 500; }
.alert-success { background: #DCFCE7; color: #166534; }
.alert-danger { background: #FEE2E2; color: #991B1B; }
.scan-result { margin-top: 14px; padding: 12px; border-radius: 10px; font-weight: 600; }

.modal {
    position: fixed; inset: 0; background: rgba(0,0,0,0.6);
    display: grid; place-items: center; padding: 20px; z-index: 999;
}
.modal-content { background: #fff; padding: 24px; border-radius: 16px; max-width: 360px; width: 100%; text-align: center; }
.eid-box { border: 2px dashed var(--nu-green); padding: 20px; border-radius: 12px; }
.qr-placeholder {
    margin: 16px auto; padding: 24px; background: var(--bg-light);
    font-size: 1.5rem; font-weight: 800; letter-spacing: 2px; border-radius: 10px;
}

/* =========================================================
   RESPONSIVE MOBILE (TAMPILAN SEPERTI APLIKASI NATIVE)
   ========================================================= */
@media (max-width: 768px) {
    .sidebar, .page-header h2 { display: none; }
    .main-content { margin-left: 0; padding: 0 0 85px 0; }
    .container { padding: 16px; }

    /* Sticky Native App Header */
    .mobile-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        background: var(--nu-green);
        color: #fff;
        padding: 16px 20px;
        position: sticky;
        top: 0;
        z-index: 100;
        box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    }
    .mobile-header h1 { font-size: 1.1rem; font-weight: 700; }
    .badge-live { background: #EF4444; font-size: 0.65rem; padding: 3px 8px; border-radius: 20px; font-weight: 800; }

    /* Grid menyesuaikan layar HP */
    .grid-stats, .form-grid { grid-template-columns: 1fr; }

    /* Bottom Navigation Bar ala Android/iOS */
    .bottom-nav {
        display: flex;
        justify-content: space-around;
        align-items: center;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 68px;
        background: #ffffff;
        border-top: 1px solid var(--border);
        box-shadow: 0 -2px 10px rgba(0,0,0,0.06);
        z-index: 100;
    }
    .bottom-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-decoration: none;
        color: var(--text-muted);
        font-size: 0.72rem;
        font-weight: 600;
        gap: 4px;
        flex: 1;
        padding: 8px 0;
    }
    .bottom-item .icon { font-size: 1.25rem; }
    .bottom-item.active { color: var(--nu-green); }
}

/* Tambahan Layout 2 Kolom & Elemen Baru */
.grid-2-col { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.h-fit { height: fit-content; }
.stack-form { display: flex; flex-direction: column; gap: 14px; }
.stack-form textarea { padding: 12px; border: 1px solid var(--border); border-radius: 10px; font-family: inherit; }
.mt-5 { margin-top: 5px; }
.mb-15 { margin-bottom: 15px; }
.text-muted { color: var(--text-muted); font-size: 0.9rem; }
.text-gold { color: var(--nu-gold) !important; }
.nav-divider { font-size: 0.7rem; opacity: 0.6; padding: 14px 16px 4px; letter-spacing: 1px; }
.btn-dark { background: var(--text-main); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.badge-gold { background: var(--nu-gold); color: var(--nu-dark); padding: 4px 10px; border-radius: 20px; font-size: 0.72rem; font-weight: 800; text-decoration: none; }
.select-inline { padding: 10px 14px; border-radius: 10px; border: 1px solid var(--border); font-weight: 600; }

/* Info Box & Video Embed */
.info-box { background: var(--bg-light); padding: 14px; border-radius: 10px; font-size: 0.9rem; }
.video-wrapper { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; border-radius: 12px; background: #000; }
.video-wrapper iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }

/* Profil & E-ID Card Print */
.peserta-profile { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.avatar-thumb { width: 54px; height: 54px; border-radius: 50%; object-fit: cover; border: 2px solid var(--nu-green); }
.status-pill { font-size: 0.72rem; font-weight: 700; padding: 3px 8px; border-radius: 20px; }
.pill-green { background: #DCFCE7; color: #166534; }
.pill-warn { background: #FEF3C7; color: #92400E; }
.link-mandat { font-size: 0.82rem; color: var(--nu-green); font-weight: 600; }

.eid-card-print { border: 2px solid var(--nu-green); border-radius: 14px; overflow: hidden; padding-bottom: 16px; background: #fff; }
.eid-banner { background: var(--nu-green); color: #fff; padding: 14px; display: flex; flex-direction: column; }
.eid-avatar { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; margin: 14px auto 8px; border: 3px solid var(--nu-gold); display: block; }
.eid-sub { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 8px; }
.qr-box { display: flex; justify-content: center; margin: 14px auto 8px; }
.qr-code-label { letter-spacing: 2px; font-size: 1rem; color: var(--nu-dark); }
.modal-actions { display: flex; gap: 10px; margin-top: 16px; }
.modal-actions .btn { flex: 1; }

/* Kamera Scanner & Usulan */
.camera-box { width: 100%; border-radius: 12px; overflow: hidden; }
.usulan-box { background: var(--bg-light); padding: 14px; border-radius: 10px; border-left: 4px solid var(--nu-green); }

@media (max-width: 768px) {
    .grid-2-col { grid-template-columns: 1fr; }
}

@media print {
    body * { visibility: hidden; }
    #areaCetakId, #areaCetakId * { visibility: visible; }
    #areaCetakId { position: fixed; left: 0; top: 0; width: 100%; box-shadow: none; }
    .no-print { display: none !important; }
}
/* =========================================================
   PORTAL REGISTRASI & MODAL LOGIN ADMIN (HALAMAN PEMBUKA)
   ========================================================= */
.portal-body { background-color: #F4F7F6; min-height: 100vh; display: flex; flex-direction: column; }
.portal-navbar { background-color: #034B27; color: #fff; padding: 14px 24px; box-shadow: 0 2px 6px rgba(0,0,0,0.1); }
.portal-nav-container { max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; }
.portal-brand { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 1.05rem; letter-spacing: 0.4px; }
.portal-nav-actions { display: flex; align-items: center; gap: 18px; }
.nav-link-top { color: #fff; text-decoration: none; font-size: 0.92rem; font-weight: 500; }
.btn-login-top {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.65);
    color: #fff;
    padding: 7px 14px;
    border-radius: 6px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}
.btn-login-top:hover { background: rgba(255,255,255,0.15); }

.portal-main { flex: 1; display: flex; justify-content: center; align-items: flex-start; padding: 32px 16px; }
.portal-card {
    background: #fff;
    width: 100%;
    max-width: 680px;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
    overflow: hidden;
    border: 1px solid #E2E8F0;
}
.portal-card-header { background: #034B27; color: #fff; padding: 14px 20px; font-weight: 700; font-size: 0.98rem; }
.portal-card-body { padding: 24px; }

.portal-tabs { display: flex; gap: 8px; margin-bottom: 20px; border-bottom: 1px solid var(--border); padding-bottom: 12px; }
.tab-btn {
    flex: 1; padding: 10px; border: 1px solid var(--border); background: var(--bg-light);
    border-radius: 8px; font-weight: 600; cursor: pointer; color: var(--text-muted);
}
.tab-btn.active { background: #E6F4EA; color: #034B27; border-color: #034B27; }

.btn-portal-submit {
    background: #034B27; color: #fff; border: none; padding: 14px;
    border-radius: 8px; font-weight: 700; font-size: 0.95rem; cursor: pointer; margin-top: 6px;
}
.btn-portal-submit:hover { background: #02381D; }

/* Modal Popup Login Admin */
.login-modal-box {
    background: #fff;
    width: 100%;
    max-width: 420px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    animation: fadeInScale 0.2s ease-out;
}
.login-modal-header {
    background: #0B874B;
    color: #fff;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    font-size: 1.05rem;
}
.btn-close-x { background: transparent; border: none; color: #fff; font-size: 1.2rem; cursor: pointer; }
.login-modal-body { padding: 26px 24px; text-align: center; }
.login-logo-badge {
    width: 68px; height: 52px; background: #046A38; color: #fff;
    font-weight: 900; font-size: 1.3rem; display: grid; place-items: center;
    margin: 0 auto 14px; border-radius: 6px;
}
.login-subtitle { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 20px; }
.text-left { text-align: left; }
.btn-login-submit {
    background: #0B874B; color: #fff; border: none; padding: 13px;
    border-radius: 8px; font-weight: 700; font-size: 0.95rem; cursor: pointer; margin-top: 6px;
}
.btn-login-submit:hover { background: #086C3B; }

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

@media (max-width: 600px) {
    .portal-brand span { font-size: 0.88rem; }
    .nav-link-top { display: none; }
}