/* ========= Tema PMB — Pesantren Baitul Muqoddas ========= */
:root {
    --tosca: #009e69;
    --tosca-dark: #007a52;
    --tosca-light: #c4ebde;
    --tosca-bg: #eefaf6;
    --blue: #364fa3;
    --blue-dark: #283c80;
    --ink: #1f2937;
    --muted: #6b7280;
    --border: #e6e9ee;
    --danger: #dc2626;
    --danger-bg: #fef2f2;
    --success: #009e69;
    --success-bg: #eefaf6;
    --warning: #d97706;
    --warning-bg: #fffbeb;
    --radius: 14px;
    --radius-sm: 9px;
    --card-pad: 26px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
    --shadow-md: 0 4px 10px rgba(16, 24, 40, .06), 0 2px 4px rgba(16, 24, 40, .05);
    --shadow-lg: 0 12px 28px rgba(16, 24, 40, .10), 0 4px 10px rgba(16, 24, 40, .06);
}

* { box-sizing: border-box; }

html { font-size: 13px; }

body {
    margin: 0;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: #fbfcfd;
    color: var(--ink);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-weight: 800; letter-spacing: -.01em; line-height: 1.25; }

a { color: var(--blue); text-decoration: none; transition: color .15s; }
a:hover { color: var(--blue-dark); text-decoration: underline; }

.container { max-width: 860px; margin: 0 auto; padding: 0 20px; }
.container-wide { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* ---- Topbar ---- */
.topbar {
    background: #fff;
    color: var(--ink);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 4px 16px rgba(16, 24, 40, .04);
}
.topbar .container-wide,
.topbar .container { display: flex; align-items: center; justify-content: space-between; position: relative; }
.topbar .brand { display: flex; align-items: center; gap: 12px; color: var(--ink); }
.topbar .brand:hover { text-decoration: none; opacity: .85; }
.topbar .brand img { height: 46px; width: 46px; border-radius: 50%; background: #fff; object-fit: cover; }
.topbar nav { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; row-gap: 6px; }
.topbar nav a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    position: relative;
    color: var(--ink);
    padding-bottom: 16px;
    font-size: .92rem;
    font-weight: 600;
}
.topbar nav a svg { width: 19px; height: 19px; flex-shrink: 0; }
.topbar nav a:hover { color: var(--tosca-dark); text-decoration: none; }
.topbar nav a.active { color: var(--tosca); }
.topbar nav a.active::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: -1px;
    height: 3px;
    border-radius: 2px 2px 0 0;
    background: var(--tosca);
}

.nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--ink);
    cursor: pointer;
    padding: 0;
}
.nav-toggle svg { width: 22px; height: 22px; }
.nav-toggle .icon-close { display: none; }
.nav-toggle.open .icon-menu { display: none; }
.nav-toggle.open .icon-close { display: block; }
.nav-toggle:hover { border-color: var(--tosca-light); color: var(--tosca-dark); }

/* ---- Cards / sections ---- */
.card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: var(--card-pad);
    margin-bottom: 20px;
    transition: box-shadow .18s, transform .18s;
}
.card h2, .card h3 { margin-top: 0; }

.section-banner {
    background: linear-gradient(100deg, var(--tosca) 0%, var(--blue) 130%);
    color: #fff;
    padding: 14px var(--card-pad);
    border-radius: var(--radius) var(--radius) 0 0;
    margin: calc(var(--card-pad) * -1) calc(var(--card-pad) * -1) 22px calc(var(--card-pad) * -1);
    font-weight: 700;
    font-size: 1.02rem;
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 11px 22px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: var(--tosca);
    color: #fff;
    font-size: .95rem;
    font-family: inherit;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0,0,0,.06);
    transition: background .15s, transform .12s, box-shadow .15s;
}
.btn:hover { background: var(--tosca-dark); text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0); }
.btn-outline { background: #fff; color: var(--tosca-dark); border-color: var(--border); box-shadow: none; }
.btn-outline:hover { background: var(--tosca-bg); border-color: var(--tosca-light); }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #b91c1c; }
.btn-sm { padding: 7px 14px; font-size: .85rem; }
.btn-secondary { background: var(--blue); }
.btn-secondary:hover { background: var(--blue-dark); }

/* ---- Forms ---- */
label { display: block; font-weight: 700; margin-bottom: 6px; font-size: .9rem; color: var(--ink); }
.help-text { color: var(--muted); font-size: .85rem; margin: 4px 0 8px; }
input[type=text], input[type=password], input[type=date], input[type=number],
input[type=tel], input[type=email], textarea, select {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: .95rem;
    font-family: inherit;
    background: #fbfcfd;
    color: var(--ink);
    transition: border-color .15s, box-shadow .15s, background .15s;
}
input[type=file] {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px dashed var(--border);
    border-radius: var(--radius-sm);
    background: #fbfcfd;
    font-size: .9rem;
    font-family: inherit;
}
.photo-preview {
    display: none;
    margin-top: 10px;
    max-width: 220px;
    max-height: 220px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
    object-fit: cover;
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--tosca);
    background: #fff;
    box-shadow: 0 0 0 4px var(--tosca-light);
}
textarea { resize: vertical; min-height: 90px; }
.field { margin-bottom: 20px; }

/* ---- Nominal (Rp) input ---- */
.input-prefix { display: flex; align-items: stretch; }
.input-prefix span {
    display: flex; align-items: center;
    padding: 0 14px;
    background: var(--tosca-bg);
    border: 1.5px solid var(--border);
    color: var(--tosca-dark);
    font-weight: 700;
    font-size: .95rem;
    white-space: nowrap;
}
.input-prefix span:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); border-right: none; }
.input-prefix span:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; border-left: none; }
.input-prefix input { border-radius: 0; text-align: right; }
.input-prefix:focus-within span { border-color: var(--tosca); }
.input-prefix:focus-within input { border-color: var(--tosca); }

/* ---- Wilayah (Provinsi/Kota/Kecamatan) ---- */
.wilayah-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 10px; }
.wilayah-field select:disabled { background: #f3f4f6; color: var(--muted); cursor: not-allowed; }
.wilayah-field textarea { min-height: 70px; }

/* ---- Rich text editor (deskripsi/persyaratan section) ---- */
.richtext-toolbar { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.richtext-toolbar button {
    padding: 6px 11px;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    background: #fff;
    color: var(--ink);
    font-size: .82rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
}
.richtext-toolbar button:hover { background: var(--tosca-bg); border-color: var(--tosca-light); color: var(--tosca-dark); }
.richtext-editable {
    min-height: 110px;
    padding: 11px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fbfcfd;
    font-size: .95rem;
    line-height: 1.5;
}
.richtext-editable:focus {
    outline: none;
    border-color: var(--tosca);
    background: #fff;
    box-shadow: 0 0 0 4px var(--tosca-light);
}
.richtext-editable ul, .richtext-editable ol { margin: 6px 0; padding-left: 22px; }
.section-desc ul, .section-desc ol { margin: 6px 0; padding-left: 22px; }
.field.field-invalid input, .field.field-invalid select, .field.field-invalid textarea {
    border-color: var(--danger);
    box-shadow: 0 0 0 4px var(--danger-bg);
}
.field .required { color: var(--danger); }
.radio-group, .checkbox-group { display: flex; flex-direction: column; gap: 2px; }
.radio-group label, .checkbox-group label {
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    margin-bottom: 8px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.radio-group label:hover, .checkbox-group label:hover { border-color: var(--tosca-light); background: var(--tosca-bg); }
.radio-group input, .checkbox-group input { width: auto; accent-color: var(--tosca); }

.bank-badge { border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 11px; letter-spacing: .2px; flex: none; line-height: 1; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); }
.bank-badge-round { border-radius: 50%; }
.bank-badge-wrap { display: inline-flex; flex: none; position: relative; }

/* ---- Alerts / flash ---- */
.alert { padding: 13px 18px; border-radius: var(--radius-sm); margin-bottom: 18px; font-size: .92rem; font-weight: 500; }
.alert-success { background: var(--success-bg); color: var(--success); border: 1px solid #bbf0d8; }
.alert-danger { background: var(--danger-bg); color: var(--danger); border: 1px solid #fecaca; }
.alert-warning { background: var(--warning-bg); color: var(--warning); border: 1px solid #fde68a; }
.alert-info { background: var(--tosca-bg); color: var(--tosca-dark); border: 1px solid var(--tosca-light); }

/* ---- Badges ---- */
.badge { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: .76rem; font-weight: 700; letter-spacing: .2px; }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-muted { background: #f3f4f6; color: var(--muted); }
.badge-tosca { background: var(--tosca-light); color: var(--tosca-dark); }
.badge-blue { background: #dde3f5; color: var(--blue); }

/* ---- Tables ---- */
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-scroll table { white-space: nowrap; }
th, td { text-align: left; padding: 12px; border-bottom: 1px solid var(--border); }
th { background: var(--tosca-bg); color: var(--tosca-dark); font-weight: 700; white-space: nowrap; }
th:first-child { border-top-left-radius: var(--radius-sm); }
th:last-child { border-top-right-radius: var(--radius-sm); }
tr:hover td { background: #fafbfc; }
tr.row-link { cursor: pointer; }
tr.row-link:hover td { background: var(--tosca-bg); }

.registrant-name-cell { display: inline-flex; align-items: center; gap: 9px; }
.registrant-thumb {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    border-radius: 6px;
    object-fit: cover;
    border: 1px solid var(--border);
    background: #f8f9fa;
}
.registrant-thumb-empty { color: var(--muted); }
.registrant-thumb-empty svg { width: 15px; height: 15px; }

/* ---- Hero (landing) ---- */
.hero {
    text-align: center;
    padding: 40px 30px;
    border-radius: 20px;
    margin-bottom: 26px;
    background: linear-gradient(120deg, var(--tosca-bg) 0%, #eef1fb 100%);
    border: 1px solid var(--tosca-light);
}
.hero h1 { color: var(--tosca-dark); margin: 10px 0 8px; font-size: 1.9rem; }
.hero p { max-width: 520px; margin: 0 auto; }

.jenjang-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.jenjang-card { position: relative; overflow: hidden; }
.jenjang-badge { display: inline-block; margin-bottom: 16px; font-size: 1rem; padding: 6px 16px; }
.jenjang-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); border-color: var(--tosca-light); }

/* ---- Kelulusan (pengumuman publik) — gaya surat/dokumen resmi ---- */
.kelulusan-search-card { text-align: center; }
.kelulusan-doc { border-top: 4px solid var(--tosca-dark); }

.kelulusan-doc-title {
    text-align: center;
    text-transform: uppercase;
    font-weight: 800;
    font-size: .98rem;
    letter-spacing: .4px;
    color: var(--tosca-dark);
    margin: 0 0 22px;
}

.kelulusan-applicant { display: flex; gap: 22px; align-items: flex-start; margin-bottom: 18px; }
.kelulusan-photo-box {
    width: 130px;
    aspect-ratio: 3 / 4;
    flex-shrink: 0;
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    background: #f8f9fa;
}
.kelulusan-photo-box img { width: 100%; height: 100%; object-fit: cover; display: block; }
.kelulusan-photo-placeholder {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem; font-weight: 800;
    color: var(--tosca-dark);
    background: var(--tosca-bg);
}

.kelulusan-dl { flex: 1; min-width: 0; margin: 0; }
.kelulusan-dl > div { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.kelulusan-dl > div:last-child { border-bottom: none; }
.kelulusan-dl dt { flex: 0 0 150px; color: var(--muted); font-size: .85rem; font-weight: 600; }
.kelulusan-dl dd { margin: 0; font-weight: 700; color: var(--ink); }

.kelulusan-status-tag {
    display: inline-block;
    border-radius: 4px;
    padding: 3px 12px;
    font-weight: 800;
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .4px;
    border: 1.5px solid transparent;
}
.kelulusan-status-lulus { background: var(--success-bg); color: var(--success); border-color: var(--success); }
.kelulusan-status-gagal { background: var(--danger-bg); color: var(--danger); border-color: var(--danger); }

.kelulusan-message { font-size: .96rem; line-height: 1.6; margin: 0 0 20px; }

.kelulusan-highlight {
    display: flex; align-items: center; gap: 14px;
    background: var(--tosca-bg);
    border: 1px solid var(--tosca-light);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    margin-bottom: 22px;
}
.kelulusan-highlight svg { width: 26px; height: 26px; color: var(--tosca-dark); flex-shrink: 0; }
.kelulusan-highlight-label { font-size: .8rem; color: var(--muted); font-weight: 600; }
.kelulusan-highlight-value { font-size: 1.05rem; font-weight: 800; color: var(--ink); }

.kelulusan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }

.kelulusan-checklist { list-style: none; padding: 0; margin: 0; }
.kelulusan-checklist li {
    position: relative;
    padding: 8px 0 8px 28px;
    border-bottom: 1px solid var(--border);
    font-size: .9rem;
}
.kelulusan-checklist li:last-child { border-bottom: none; }
.kelulusan-checklist li::before {
    content: '\2713';
    position: absolute; left: 0; top: 8px;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: var(--success-bg);
    color: var(--success);
    font-size: .64rem; font-weight: 800;
    display: flex; align-items: center; justify-content: center;
}

.kelulusan-steps { list-style: none; padding: 0; margin: 0; counter-reset: kstep; }
.kelulusan-steps li {
    position: relative;
    padding: 8px 0 8px 32px;
    border-bottom: 1px solid var(--border);
    font-size: .9rem;
    counter-increment: kstep;
}
.kelulusan-steps li:last-child { border-bottom: none; }
.kelulusan-steps li::before {
    content: counter(kstep);
    position: absolute; left: 0; top: 7px;
    width: 20px; height: 20px;
    border-radius: 50%;
    background: var(--tosca);
    color: #fff;
    font-size: .7rem; font-weight: 800;
    display: flex; align-items: center; justify-content: center;
}

@media (max-width: 560px) {
    .kelulusan-applicant { flex-direction: column; align-items: center; text-align: left; }
    .kelulusan-photo-box { width: 110px; }
}

/* ---- Admin layout ---- */
.admin-shell { display: flex; height: 100vh; overflow: hidden; }
.admin-sidebar {
    width: 240px;
    height: 100vh;
    background: #fff;
    border-right: 1px solid var(--border);
    padding: 20px 0;
    flex-shrink: 0;
    overflow-x: hidden;
    overflow-y: auto;
    white-space: nowrap;
    transition: width .18s ease;
}
body.sidebar-collapsed .admin-sidebar { width: 60px; }

.sidebar-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 14px 18px; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
body.sidebar-collapsed .sidebar-top { justify-content: center; padding: 0 0 18px; }

.admin-sidebar .brand { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--tosca-dark); min-width: 0; }
.admin-sidebar .brand img { height: 34px; width: 34px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
body.sidebar-collapsed .admin-sidebar .brand { display: none; }

.sidebar-toggle-btn {
    flex-shrink: 0;
    width: 26px; height: 26px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--muted);
    cursor: pointer;
    padding: 0;
}
.sidebar-toggle-btn:hover { color: var(--tosca-dark); border-color: var(--tosca-light); }
.sidebar-toggle-btn svg { width: 14px; height: 14px; }
body.sidebar-collapsed .sidebar-toggle-btn svg { transform: rotate(180deg); }

.mobile-nav-btn {
    display: none;
    flex-shrink: 0;
    width: 32px; height: 32px;
    align-items: center; justify-content: center;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--tosca-dark);
    cursor: pointer;
    padding: 0;
}
.mobile-nav-btn svg { width: 18px; height: 18px; }

.admin-sidebar a {
    display: block;
    padding: 10px 20px;
    margin: 2px 10px;
    border-radius: var(--radius-sm);
    color: var(--ink);
    font-size: .92rem;
    font-weight: 600;
}
body.sidebar-collapsed .admin-sidebar a { display: none; }
.admin-sidebar a:hover { background: var(--tosca-bg); text-decoration: none; }
.admin-sidebar a.active { background: var(--tosca); color: #fff; }
.admin-main { flex: 1; height: 100vh; overflow-y: auto; padding: 30px 34px; background: #fbfcfd; }
.admin-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; }
.admin-topbar h1 { font-size: 1.4rem; margin: 0; }

/* ---- Registrant detail page ---- */
.detail-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; align-items: start; }
.detail-col { min-width: 0; }

/* ---- Camera capture (foto 3x4) ---- */
.camera-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 500;
    background: #101215;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    gap: 6px;
}
.camera-modal.open { display: flex; }
.camera-stage {
    position: relative;
    width: min(88vw, 340px);
    aspect-ratio: 3 / 4;
    overflow: hidden;
    border-radius: 16px;
    background: #000;
    box-shadow: 0 0 0 1px rgba(255,255,255,.08);
}
.camera-stage video { width: 100%; height: 100%; object-fit: cover; display: block; }
.camera-frame { position: absolute; inset: 0; pointer-events: none; }
.camera-guide-oval {
    position: absolute;
    top: 14%; left: 21%;
    width: 58%; height: 42%;
    border: 2px dashed rgba(255,255,255,.85);
    border-radius: 50%;
}
.camera-guide-shoulder {
    position: absolute;
    left: 8%; right: 8%; top: 78%;
    height: 0;
    border-top: 2px dashed rgba(255,255,255,.5);
    border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}
.camera-guide-line { position: absolute; background: rgba(255,255,255,.35); }
.camera-guide-line-h { left: 0; right: 0; top: 50%; height: 1px; }
.camera-guide-line-v { top: 0; bottom: 0; left: 50%; width: 1px; }
.camera-hint { color: rgba(255,255,255,.75); font-size: .85rem; text-align: center; margin: 10px 0 0; }
.camera-controls { display: flex; align-items: center; justify-content: center; gap: 20px; padding: 18px 0 6px; }
.camera-btn {
    border-radius: 999px;
    padding: 10px 20px;
    font-weight: 700;
    font-size: .88rem;
    cursor: pointer;
    border: 1.5px solid rgba(255,255,255,.55);
    background: transparent;
    color: #fff;
}
.camera-btn-primary { background: var(--tosca); border-color: var(--tosca); }
.camera-btn-shutter {
    width: 62px; height: 62px;
    border-radius: 50%;
    background: #fff;
    border: 4px solid rgba(255,255,255,.35);
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}

/* ---- Stat tiles ---- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-tile { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.stat-tile .value { font-size: 1.8rem; font-weight: 800; color: var(--blue); }
.stat-tile .label { color: var(--muted); font-size: .85rem; margin-top: 4px; font-weight: 600; }

/* ---- Filter / analytics grids ---- */
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.filter-bar input[type=text], .filter-bar input[type=date], .filter-bar select {
    width: auto;
    padding: 10px 14px;
    border-radius: 10px;
    background: #fbfcfd;
}
.filter-bar input[type=text] { min-width: 200px; flex: 1 1 200px; }
.filter-bar select { min-width: 130px; }
.filter-bar input[type=date] { min-width: 0; }
.filter-bar-label { color: var(--muted); font-size: .9rem; font-weight: 600; }
.filter-bar-sep { color: var(--muted); }
.mobile-filter-btn { display: none; }
.mobile-search-row { display: none; }
.filter-modal-head { display: none; }
.filter-backdrop { display: none; }
.filter-close-btn {
    background: none; border: none; cursor: pointer;
    font-size: 1.4rem; line-height: 1; color: var(--muted); padding: 0 4px;
}
.analytics-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.analytics-wide { grid-column: 1 / -1; }

/* ---- Misc ---- */
.text-muted { color: var(--muted); }
.text-center { text-align: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.mt-0 { margin-top: 0; }

/* ---- Stepper (progress-steps) ---- */
.progress-steps {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    margin: 6px 0 30px;
    counter-reset: step;
}
.progress-steps::before {
    content: '';
    position: absolute;
    left: 16px; right: 16px; top: 16px;
    height: 2px;
    background: var(--border);
    z-index: 0;
}
.progress-steps span {
    counter-increment: step;
    position: relative;
    z-index: 1;
    flex: 0 0 auto;
    width: 32px; height: 32px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--border);
    color: var(--muted);
    display: flex; align-items: center; justify-content: center;
    font-size: .82rem; font-weight: 800;
    transition: background .2s, border-color .2s, color .2s;
}
.progress-steps span::before { content: counter(step); }
.progress-steps span.done { background: var(--tosca); border-color: var(--tosca); color: #fff; }

footer.site-footer { text-align: center; color: var(--muted); font-size: .85rem; padding: 34px 0 24px; }

/* ================= Responsive ================= */

/* Tablet & below */
@media (max-width: 860px) {
    .analytics-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
    :root { --card-pad: 18px; }

    .admin-shell { flex-direction: column; height: auto; overflow: visible; }
    .admin-sidebar { width: 100%; height: auto; border-right: none; border-bottom: 1px solid var(--border); padding: 14px 0; }
    body.sidebar-collapsed .admin-sidebar { width: 100%; }
    .admin-main { height: auto; overflow-y: visible; padding: 18px; }
    .admin-topbar { flex-wrap: wrap; gap: 10px; align-items: flex-start; }

    /* Admin sidebar becomes a hamburger-toggled dropdown menu */
    .sidebar-toggle-btn { display: none; }
    .mobile-nav-btn { display: flex; }
    .sidebar-nav { display: none; flex-direction: column; padding-top: 10px; }
    body.admin-mobile-nav-open .sidebar-nav { display: flex; }
    body.sidebar-collapsed .admin-sidebar a { display: block; }

    /* Registrant filters collapse behind a button and open as a modal popup; search stays outside it */
    .mobile-search-row { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
    .mobile-search-row input[type=text] { flex: 1 1 auto; margin: 0; }
    .mobile-filter-btn { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; white-space: nowrap; }
    .filter-card {
        position: fixed;
        left: 16px; right: 16px; top: 50%;
        transform: translateY(-50%) scale(.96);
        max-height: 80vh;
        overflow-y: auto;
        z-index: 210;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity .18s ease, transform .18s ease;
        box-shadow: var(--shadow-lg);
    }
    body.mobile-filter-open .filter-card {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translateY(-50%) scale(1);
    }
    .filter-modal-head {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 14px;
        padding-bottom: 10px;
        border-bottom: 1px solid var(--border);
        font-size: 1rem;
    }
    .filter-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, .45);
        z-index: 200;
        opacity: 0;
        visibility: hidden;
        transition: opacity .18s ease;
    }
    body.mobile-filter-open .filter-backdrop { opacity: 1; visibility: visible; }
    body.mobile-filter-open { overflow: hidden; }

    /* Registrant detail: single column, answer rows stack label above value */
    .detail-grid { grid-template-columns: 1fr; }
    .answer-table, .answer-table tbody { display: block; width: 100%; }
    .answer-table tr { display: block; padding: 10px 0; border-bottom: 1px solid var(--border); }
    .answer-table tr:last-child { border-bottom: none; }
    .answer-table th, .answer-table td {
        display: block;
        width: 100% !important;
        white-space: normal;
        border-bottom: none;
        padding: 2px 0;
    }
    .answer-table th {
        background: none;
        color: var(--muted);
        font-size: .82rem;
        font-weight: 700;
    }

    .hero { padding: 28px 18px; }
    .hero h1 { font-size: 1.5rem; }

    .container, .container-wide { padding: 0 16px; }

    /* Topbar: logo + hamburger only, nav becomes a dropdown */
    .nav-toggle { display: flex; }
    .topbar .container-wide { flex-wrap: wrap; }
    .topbar nav {
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        width: 100%;
        margin-top: 14px;
        padding-top: 14px;
        border-top: 1px solid var(--border);
    }
    .topbar nav.open { display: flex; }
    .topbar nav a {
        padding: 12px 14px;
        border-radius: var(--radius-sm);
    }
    .topbar nav a.active { background: var(--tosca-bg); }
    .topbar nav a.active::after { content: none; }
}

/* Phones */
@media (max-width: 560px) {
    body { font-size: .95rem; }

    .topbar { padding: 12px 0; }
    .topbar .brand img { height: 40px; width: 40px; }

    main.container { padding-top: 20px !important; }

    .hero { padding: 24px 16px; border-radius: 16px; }
    .hero h1 { font-size: 1.3rem; }
    .hero p { font-size: .9rem; }

    .jenjang-grid { grid-template-columns: 1fr; }
    .wilayah-grid { grid-template-columns: 1fr; }

    .card { padding: var(--card-pad); }
    .section-banner { font-size: .95rem; padding: 12px var(--card-pad); }

    .flex-between { flex-wrap: wrap; gap: 10px; }
    .flex-between .btn { flex: 1 1 auto; justify-content: center; min-width: 130px; }

    .progress-steps span { width: 26px; height: 26px; font-size: .74rem; }
    .progress-steps::before { left: 13px; right: 13px; top: 13px; }

    .filter-bar input[type=text], .filter-bar select, .filter-bar input[type=date], .filter-bar button, .filter-bar a { width: 100%; }

    /* Registrants list: table rows become readable cards instead of a cramped scrolling table */
    .table-cards thead { display: none; }
    .table-cards, .table-cards tbody, .table-cards tr, .table-cards td { display: block; width: 100%; }
    .table-cards { border: none; }
    .table-cards tr {
        border: 1px solid var(--border);
        border-radius: var(--radius-sm);
        margin-bottom: 12px;
        padding: 4px 14px;
        background: #fff;
    }
    .table-cards tr:hover td { background: none; }
    .table-cards td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 10px;
        padding: 8px 0;
        border-bottom: 1px dashed var(--border);
        text-align: right;
    }
    .table-cards td:last-child { border-bottom: none; }
    .table-cards td::before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--muted);
        font-size: .82rem;
        text-align: left;
    }
    .table-cards td[data-label="Nama"] {
        font-size: 1.05rem;
        font-weight: 800;
        color: var(--ink);
    }
    .table-cards td[data-label="Nama"]::before { content: none; }
    .table-cards td[data-label="Penghasilan Ayah"],
    .table-cards td[data-label="Penghasilan Ibu"] { display: none; }

    .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .stat-tile { padding: 14px; }
    .stat-tile .value { font-size: 1.4rem; }

    .admin-sidebar .brand { padding: 0 16px 14px; }
    .admin-sidebar a { font-size: .88rem; }
}
