:root {
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #14213d;
    background: #f4f7fb;
    line-height: 1.5;
}
* { box-sizing: border-box; }
body { margin: 0; background: linear-gradient(180deg, #edf3fb 0, #f8fafc 280px, #f4f7fb 100%); min-height: 100vh; }
a { color: inherit; }
.container { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 28px 0 24px; }
.container.narrow { width: min(900px, calc(100% - 32px)); }
.container.wide-review { width: min(1000px, calc(100% - 32px)); }
.topnav { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.brand { font-weight: 900; letter-spacing: .06em; text-decoration: none; color: #1e3c69; }
.navlinks { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: .92rem; }
.navlinks a { text-decoration: none; color: #385579; font-weight: 700; }
.navlinks a:hover { text-decoration: underline; }
.admin-user { padding: 6px 10px; border-radius: 999px; background: #e8eef7; color: #334d73; font-weight: 800; }
.hero {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 28px;
    align-items: center;
    padding: 32px;
    border-radius: 24px;
    color: white;
    background: linear-gradient(135deg, #172c55, #2d4775 68%, #c58c27 160%);
    box-shadow: 0 18px 55px rgba(26, 51, 94, .18);
}
.eyebrow { display: inline-block; font-size: .78rem; font-weight: 800; letter-spacing: .16em; color: #f6c35b; }
.eyebrow.dark { color: #9c6b12; }
h1 { margin: 6px 0 8px; font-size: clamp(1.8rem, 4vw, 3rem); line-height: 1.08; }
.hero p, .page-head p { margin: 0; max-width: 780px; color: #dbe7fb; }
.page-head { margin: 12px 0 22px; padding: 26px 28px; border: 1px solid #e2e9f3; border-radius: 20px; background: white; box-shadow: 0 10px 34px rgba(33, 56, 96, .06); }
.page-head h1 { color: #182d50; font-size: clamp(1.8rem, 4vw, 2.65rem); }
.page-head p { color: #667892; }
.stat { min-width: 145px; padding: 18px; border: 1px solid rgba(255,255,255,.2); border-radius: 18px; text-align: center; background: rgba(255,255,255,.08); }
.stat strong { display: block; font-size: 2rem; }
.stat span { font-size: .85rem; color: #dbe7fb; }
.alert, .search, .panel, .form-card, .auth-card { margin-top: 22px; background: white; border: 1px solid #e4eaf2; border-radius: 18px; box-shadow: 0 10px 34px rgba(33, 56, 96, .07); }
.alert { padding: 20px; display: grid; gap: 4px; border-color: #efc2c2; background: #fff8f8; color: #7e2020; }
.notice { margin-top: 16px; padding: 14px 16px; border-radius: 13px; border: 1px solid #d5e0ef; background: #f7fafe; color: #38516f; }
.notice.success { border-color: #b9dec9; background: #f3fbf6; color: #23623d; }
.notice.danger { border-color: #efc3c3; background: #fff6f6; color: #8a2a2a; }
.notice.info { border-color: #c8d8ec; background: #f5f9ff; color: #2f537f; }
.notice.compact { margin-top: 18px; }
.search { padding: 20px; }
.search label, .form-grid label, .decision-form label { display: block; margin-bottom: 8px; font-weight: 700; }
.search-row { display: flex; gap: 10px; }
input[type="search"], input[type="text"], input[type="password"], textarea {
    width: 100%;
    border: 1px solid #cfd9e8;
    border-radius: 12px;
    padding: 12px 14px;
    font: inherit;
    color: #162943;
    background: #fff;
    outline: none;
}
input[type="search"] { flex: 1; min-width: 0; }
textarea { resize: vertical; }
input:focus, textarea:focus { border-color: #284b82; box-shadow: 0 0 0 3px rgba(40,75,130,.12); }
button, .reset, .download, .secondary { border: 0; border-radius: 12px; padding: 11px 16px; font: inherit; font-weight: 800; text-decoration: none; cursor: pointer; }
button, .download { background: #203d6c; color: white; }
button:hover, .download:hover { background: #172f57; }
button:disabled { opacity: .48; cursor: not-allowed; }
.reset, .secondary { background: #edf2f8; color: #334c70; display: inline-block; }
.secondary:hover, .reset:hover { background: #e2e9f3; }
.panel { overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px; border-bottom: 1px solid #e8edf4; }
.panel-head h2 { margin: 0; font-size: 1.15rem; }
.panel-head span { color: #68788f; font-size: .9rem; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 920px; }
th, td { padding: 14px 16px; border-bottom: 1px solid #edf1f6; text-align: left; vertical-align: middle; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: #617089; background: #f8fafc; }
tbody tr:hover { background: #f7faff; }
.number { width: 64px; color: #7d8ca3; }
.name-link { color: #1f4178; font-weight: 800; text-decoration: none; }
.name-link:hover { text-decoration: underline; }
.download { display: inline-block; padding: 8px 12px; font-size: .84rem; }
.secondary { padding: 8px 12px; font-size: .84rem; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.empty { padding: 44px 20px; text-align: center; color: #6c7b91; }
.badge { display: inline-flex; align-items: center; width: fit-content; padding: 5px 9px; border-radius: 999px; font-size: .76rem; font-weight: 900; white-space: nowrap; }
.badge.active, .badge.approved { background: #e6f5ec; color: #21613b; }
.badge.pending { background: #fff2d8; color: #845a08; }
.badge.rejected { background: #fde8e8; color: #8c2929; }
.badge.superseded { background: #eceff3; color: #596574; }
.form-card { padding: 24px; }
.compare-grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; align-items: center; padding: 18px; border: 1px solid #e2e9f2; border-radius: 15px; background: #f9fbfe; }
.compare-grid > div:not(.flow-arrow) { display: grid; gap: 4px; }
.compare-grid strong { font-size: 1.05rem; color: #1d3a67; }
.compare-grid small { color: #6b7b91; }
.flow-arrow { color: #a2782b; font-size: 1.5rem; font-weight: 900; }
.field-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 900; color: #728198; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 22px; }
.form-grid.single { grid-template-columns: 1fr; }
.form-grid label { margin: 0; }
.form-grid .full { grid-column: 1 / -1; }
.hint { display: block; margin-top: 5px; color: #79879a; font-size: .8rem; font-weight: 500; }
.muted { color: #8591a1; font-weight: 500; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; align-items: center; }
.hp-field { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }
.status-card { margin-bottom: 22px; }
.status-head, .review-status { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 18px; }
.status-head > div { display: grid; gap: 3px; }
.status-head strong { font-size: 1.2rem; }
.detail-list { margin: 22px 0 0; display: grid; gap: 0; border: 1px solid #e6ebf2; border-radius: 14px; overflow: hidden; }
.detail-list > div { display: grid; grid-template-columns: 180px 1fr; gap: 18px; padding: 13px 15px; border-bottom: 1px solid #e8edf3; }
.detail-list > div:last-child { border-bottom: 0; }
.detail-list dt { font-weight: 800; color: #586b84; }
.detail-list dd { margin: 0; color: #20344f; }
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding-top: 24px; padding-bottom: 24px; }
.auth-card { width: min(480px, 100%); padding: 28px; margin: 0; }
.auth-card h1 { font-size: 2rem; color: #1a3155; }
.auth-card > p { color: #6c7a8d; }
.back-link { display: inline-block; margin-top: 18px; text-decoration: none; color: #536c8e; font-weight: 700; }
.inline-form { display: inline; margin: 0; }
.link-button { padding: 0; background: transparent; color: #385579; font-size: .92rem; }
.link-button:hover { background: transparent; text-decoration: underline; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 18px; }
.stats-grid a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px; background: white; border: 1px solid #e1e8f1; border-radius: 15px; text-decoration: none; box-shadow: 0 7px 20px rgba(33,56,96,.05); }
.stats-grid span { color: #64758d; font-weight: 700; }
.stats-grid strong { font-size: 1.6rem; color: #213e6b; }
.filter-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.filter-tabs a { padding: 8px 12px; border: 1px solid #dce4ef; border-radius: 999px; background: white; color: #536a89; text-decoration: none; font-weight: 800; font-size: .84rem; }
.filter-tabs a.current { background: #203d6c; border-color: #203d6c; color: white; }
.old-value { color: #8a6b6b; text-decoration: line-through; }
.change-arrow { margin: 0 8px; color: #8b7549; }
.review-compare { margin-top: 4px; }
.review-status { color: #758399; font-size: .9rem; }
.decision-form { margin-top: 22px; padding-top: 22px; border-top: 1px solid #e4eaf2; }
.decision-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 14px; }
.danger-button { background: #a83b3b; }
.danger-button:hover { background: #8e2f2f; }
footer { padding: 22px 4px 0; text-align: center; color: #75849a; font-size: .85rem; }
@media (max-width: 800px) {
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .detail-list > div { grid-template-columns: 1fr; gap: 4px; }
}
@media (max-width: 700px) {
    .container { width: min(100% - 20px, 1180px); padding-top: 16px; }
    .hero { grid-template-columns: 1fr; padding: 24px; }
    .stat { text-align: left; min-width: auto; }
    .search-row { flex-wrap: wrap; }
    input[type="search"] { flex-basis: 100%; }
    .topnav { align-items: flex-start; }
    .navlinks { justify-content: flex-end; }
    .form-grid { grid-template-columns: 1fr; }
    .form-grid .full { grid-column: auto; }
    .compare-grid { grid-template-columns: 1fr; }
    .flow-arrow { transform: rotate(90deg); justify-self: center; }
    .form-actions, .decision-actions { flex-direction: column-reverse; align-items: stretch; }
    .form-actions a, .form-actions button, .decision-actions button { text-align: center; width: 100%; }
    .stats-grid { grid-template-columns: 1fr; }
}
.preview-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }

/* V3: alur permohonan sertifikat dengan persetujuan admin */
.process-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 18px; }
.process-strip div { display: flex; align-items: center; gap: 10px; padding: 13px 15px; border: 1px solid #dfe7f1; border-radius: 14px; background: #fff; box-shadow: 0 7px 20px rgba(33,56,96,.04); }
.process-strip strong { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #203d6c; color: #fff; font-size: .82rem; flex: 0 0 auto; }
.process-strip span { font-size: .86rem; color: #526781; font-weight: 800; }
.certificate-summary { display: grid; gap: 3px; padding: 18px; border: 1px solid #dfe7f2; border-radius: 15px; background: #f8fbff; }
.certificate-summary strong { color: #1c3a68; font-size: 1.25rem; }
.certificate-summary > span:last-child { color: #667992; }
.certificate-summary.subdued { margin-top: 8px; }
.admin-certificate-summary { margin: 6px 0 20px; }
.status-contact-label { margin-top: 14px !important; }
.status-form-actions { margin-top: 14px; }
.approval-download { margin-top: 20px; padding: 18px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border: 1px solid #b7ddc6; border-radius: 15px; background: #f2fbf6; }
.approval-download > div { display: grid; gap: 4px; color: #24543a; }
.approval-download > div span { color: #52705f; font-size: .88rem; }
.badge.revoked { background: #eceff3; color: #566270; }
.dashboard-section-title { margin-top: 26px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.dashboard-section-title h2 { margin: 0; color: #1d365d; font-size: 1.15rem; }
.dashboard-section-title a { color: #37577f; font-weight: 800; text-decoration: none; font-size: .88rem; }
.dashboard-section-title a:hover { text-decoration: underline; }
.dashboard-panel { margin-top: 14px; }
.revision-summary { margin-top: 12px; }
.revoke-form { border-top-color: #efcdcd; }

@media (max-width: 800px) {
    .process-strip { grid-template-columns: 1fr 1fr; }
    .approval-download { align-items: stretch; flex-direction: column; }
    .approval-download .download { text-align: center; }
}
@media (max-width: 520px) {
    .process-strip { grid-template-columns: 1fr; }
}

/* V4: multi-role certificate management, CRUD admin, download audit */
select, input[type="date"], input[type="file"] {
    width: auto;
    min-width: 150px;
    border: 1px solid #cfd9e8;
    border-radius: 12px;
    padding: 11px 13px;
    font: inherit;
    color: #162943;
    background: #fff;
    outline: none;
}
.form-grid select, .form-grid input[type="file"] { width: 100%; }
select:focus, input[type="date"]:focus, input[type="file"]:focus { border-color: #284b82; box-shadow: 0 0 0 3px rgba(40,75,130,.12); }
.current-nav { color: #142f5c !important; text-decoration: underline !important; text-underline-offset: 5px; }
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.public-type-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 16px 0 0; }
.type-stat { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border: 1px solid #dde6f2; border-radius: 15px; background: white; text-decoration: none; box-shadow: 0 7px 20px rgba(33,56,96,.05); }
.type-stat strong { font-size: 1.45rem; color: #1d3a67; }
.type-stat span { font-size: .78rem; font-weight: 900; letter-spacing: .06em; }
.type-stat.type-panitia { border-left: 4px solid #27805b; }
.type-stat.type-pemateri { border-left: 4px solid #7646a5; }
.type-stat.type-peserta { border-left: 4px solid #295fb8; }
.badge.role { letter-spacing: .03em; }
.badge.role-peserta { background: #e7effd; color: #2459ad; }
.badge.role-panitia { background: #e5f5ec; color: #24704f; }
.badge.role-pemateri { background: #f0e8fa; color: #684093; }
.badge.mini { font-size: .68rem; margin-top: 5px; }
.info-badge { background: #e8eef8; color: #375a8a; }
.stats-grid.stats-five { grid-template-columns: repeat(5, 1fr); }
.dashboard-kpis { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 12px; margin-top: 18px; }
.dashboard-kpis a { display: grid; gap: 3px; min-width: 0; padding: 17px; border: 1px solid #e1e8f1; border-radius: 15px; background: #fff; text-decoration: none; box-shadow: 0 7px 20px rgba(33,56,96,.05); }
.dashboard-kpis span { color: #65778e; font-size: .82rem; font-weight: 800; }
.dashboard-kpis strong { color: #203d6c; font-size: 1.8rem; line-height: 1.1; }
.dashboard-kpis small { color: #8390a2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dashboard-two-col { display: grid; grid-template-columns: minmax(0,2fr) minmax(320px,1fr); gap: 16px; align-items: start; }
.dashboard-two-col.lower { margin-top: 0; }
.compact-panel table { min-width: 0; }
.type-recap { display: grid; gap: 0; }
.type-recap > div { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 12px; padding: 15px 18px; border-bottom: 1px solid #edf1f6; }
.type-recap > div:last-child { border-bottom: 0; }
.type-recap strong { font-size: 1.3rem; color: #223e69; }
.type-recap small { min-width: 52px; text-align: right; color: #7c899b; }
.quick-actions { display: flex; gap: 9px; padding: 16px 18px; border-top: 1px solid #edf1f6; }
.activity-list { display: grid; }
.activity-list > div { display: grid; grid-template-columns: auto 1fr; gap: 12px; padding: 14px 18px; border-bottom: 1px solid #edf1f6; align-items: start; }
.activity-list > div:last-child { border-bottom: 0; }
.activity-list p { margin: 0; color: #334963; }
.activity-list small { display: block; color: #8390a2; margin-top: 4px; }
.checkbox-line { display: flex !important; align-items: center; gap: 10px; }
.checkbox-line input[type="checkbox"] { width: 18px; height: 18px; flex: 0 0 auto; }
.danger-outline, .success-outline { padding: 8px 11px; background: #fff; border: 1px solid; font-size: .82rem; }
.danger-outline { color: #963b3b; border-color: #e6bcbc; }
.danger-outline:hover { background: #fff4f4; }
.success-outline { color: #23623d; border-color: #add8bd; }
.success-outline:hover { background: #f1faf4; }
.filters-many { flex-wrap: wrap; }
.filters-many input[type="search"] { min-width: 260px; }
.ua-cell { display: block; max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panel-head a { color: #365880; font-weight: 800; font-size: .86rem; text-decoration: none; }
.panel-head a:hover { text-decoration: underline; }
@media (max-width: 1100px) {
    .dashboard-kpis { grid-template-columns: repeat(3, 1fr); }
    .stats-grid.stats-five { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
    .dashboard-two-col { grid-template-columns: 1fr; }
    .public-type-stats { grid-template-columns: 1fr 1fr 1fr; }
}
@media (max-width: 700px) {
    select, input[type="date"] { width: 100%; }
    .public-type-stats { grid-template-columns: 1fr; }
    .dashboard-kpis, .stats-grid.stats-five { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
    .dashboard-kpis, .stats-grid.stats-five { grid-template-columns: 1fr; }
}

/* V5: mode download configurable + pengajuan sertifikat baru */
.mode-banner { margin-top: 18px; padding: 17px 19px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border: 1px solid #dbe4ef; border-radius: 16px; background: #fff; box-shadow: 0 7px 20px rgba(33,56,96,.05); }
.mode-banner > div { display: grid; gap: 3px; }
.mode-banner strong { color: #1d3a67; font-size: 1.02rem; }
.mode-banner small { color: #718198; }
.mode-banner.mode-direct { border-left: 5px solid #2b8a5e; background: #f7fcf9; }
.mode-banner.mode-approval { border-left: 5px solid #c18a27; background: #fffaf2; }
.admin-mode-banner { margin-bottom: 2px; }
.process-strip.process-three { grid-template-columns: repeat(3, 1fr); }
.dashboard-kpis { grid-template-columns: repeat(4, minmax(0,1fr)); }
.mode-kpi { font-size: 1.2rem !important; letter-spacing: .03em; }
.settings-form { display: grid; gap: 20px; }
.setting-fieldset { margin: 0; padding: 18px; border: 1px solid #dde5ef; border-radius: 16px; }
.setting-fieldset legend { padding: 0 8px; color: #1d3a67; font-weight: 900; }
.setting-option { display: grid; grid-template-columns: auto 1fr; align-items: start; gap: 13px; margin: 12px 0; padding: 16px; border: 1px solid #dce5f0; border-radius: 14px; background: #fafcff; cursor: pointer; }
.setting-option.selected-setting { border-color: #7f9fc8; background: #f2f7fd; box-shadow: 0 0 0 3px rgba(40,75,130,.07); }
.setting-option input { margin-top: 5px; width: 18px; height: 18px; }
.setting-option span { display: grid; gap: 5px; }
.setting-option strong { color: #213d69; }
.setting-option small { color: #6e7f95; line-height: 1.55; }
.compact-option { margin-bottom: 0; }
.settings-actions { padding-top: 4px; }
.form-section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 12px 0 4px; border-bottom: 1px solid #e4eaf2; color: #1d3a67; }
.form-section-title span { color: #7d899a; font-size: .82rem; font-weight: 500; }
.new-app-review-form { margin-top: 22px; padding-top: 22px; border-top: 1px solid #e4eaf2; }
.badge.info-badge { background: #e8eef8; color: #375a8a; }
@media (max-width: 800px) {
    .mode-banner { align-items: stretch; flex-direction: column; }
    .mode-banner .secondary { text-align: center; }
    .process-strip.process-three { grid-template-columns: 1fr; }
    .form-section-title { align-items: flex-start; flex-direction: column; }
}
/* Event and template management */
.template-previews{display:grid;grid-template-columns:1fr 1fr;gap:20px;margin-top:24px}.template-previews figure{margin:0}.template-previews img{width:100%;border:1px solid #d5ddea;border-radius:10px}.template-previews figcaption{padding:10px;color:#53627a}.form-card{margin-bottom:24px}.search-row{flex-wrap:wrap}.search-row select{max-width:420px}.review-note{color:#9b4d06;font-weight:600}@media(max-width:700px){.template-previews{grid-template-columns:1fr}}
