/* ==========================================================
   Pendataan GTK Honor
   Palet: biru laut (utama), emas (penanda), latar putih kehijauan
   Font : Plus Jakarta Sans (cadangan: font sistem)
   ========================================================== */

:root {
  --ink: #10262F;
  --muted: #54686E;
  --sea: #0D5566;
  --sea-deep: #093D4A;
  --sea-tint: #E3F0F1;
  --gold: #E2A72E;
  --gold-tint: #FBF0D6;
  --gold-ink: #6B4A00;
  --paper: #F1F4F3;
  --card: #FFFFFF;
  --line: #CFDAD9;
  --danger: #B3261E;
  --danger-tint: #FCEBEA;
  --ok: #1B7A4B;
  --ok-tint: #E2F3EA;
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
}
h1, h2, h3 { line-height: 1.25; margin: 0; }
p { margin: 0; }
a { color: var(--sea); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.hp { position: absolute; left: -9999px; top: -9999px; height: 0; overflow: hidden; }

/* ---------- Tombol ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px;
  font: inherit; font-weight: 700; text-decoration: none;
  color: #fff; background: var(--sea);
  border: 1.5px solid var(--sea); border-radius: 10px;
  cursor: pointer;
  transition: background-color .15s;
}
.btn:hover { background: var(--sea-deep); border-color: var(--sea-deep); }
.btn[disabled] { opacity: .65; cursor: progress; }
.btn.ghost { background: transparent; color: var(--sea); }
.btn.ghost:hover { background: var(--sea-tint); }
.btn.danger { background: #fff; color: var(--danger); border-color: var(--danger); }
.btn.danger:hover { background: var(--danger-tint); }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #2A1D00; }
.btn.gold:hover { background: #cf951f; border-color: #cf951f; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: .875rem; border-radius: 8px; }
.btn.block { width: 100%; }

/* ---------- Halaman formulir ---------- */
.shell { min-height: 100vh; display: grid; grid-template-columns: 1fr; }

.intro {
  background: var(--sea-deep);
  color: #fff;
  padding: 32px 22px 28px;
}
.intro .org { font-size: .9rem; color: #B8D3D8; margin-bottom: 14px; }
.intro h1 { font-size: 1.65rem; font-weight: 800; letter-spacing: -.01em; }
.intro .lead { margin-top: 14px; color: #DCEBEE; max-width: 44ch; }

.prep { margin-top: 26px; }
.prep h2 { font-size: 1rem; font-weight: 800; margin-bottom: 8px; }
.prep ul { margin: 0; padding-left: 1.2em; color: #DCEBEE; }
.prep li { margin-bottom: 6px; }

.lock {
  margin-top: 26px;
  padding: 14px 16px;
  background: var(--gold-tint);
  color: var(--gold-ink);
  border-left: 6px solid var(--gold);
  border-radius: 4px 10px 10px 4px;
}
.lock strong { display: block; font-size: 1.05rem; color: #3E2A00; margin-bottom: 2px; }
.lock p { font-size: .925rem; }

.formcol { padding: 26px 18px 40px; }
.formbox { width: 100%; max-width: 680px; margin: 0 auto; }

fieldset { border: 0; padding: 0; margin: 0 0 30px; min-width: 0; }
legend { font-size: 1.15rem; font-weight: 800; padding: 0; margin-bottom: 16px; color: var(--sea-deep); }

.field { margin-bottom: 20px; }
.field > label, .label { display: block; font-weight: 700; font-size: .95rem; margin-bottom: 6px; }
.opt { font-weight: 500; color: var(--muted); }

.input {
  display: block; width: 100%; min-height: 48px;
  padding: 10px 14px;
  font: inherit; color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--line); border-radius: 10px;
}
select.input { padding-right: 8px; }
.input:focus { outline: 3px solid rgba(226, 167, 46, .6); outline-offset: 0; border-color: var(--sea); }
.input[aria-invalid="true"] { border-color: var(--danger); background: var(--danger-tint); }

.hint { font-size: .85rem; color: var(--muted); margin-top: 6px; display: flex; justify-content: space-between; gap: 12px; }
.err { font-size: .875rem; color: var(--danger); font-weight: 600; margin-top: 6px; }
.err:empty { display: none; }

.row2 { display: grid; grid-template-columns: 1fr; gap: 0 16px; }

.chips { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.chip { position: relative; display: block; }
.chip input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.chip span {
  display: flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 12px;
  font-weight: 700; background: #fff;
  border: 1.5px solid var(--line); border-radius: 10px;
}
.chip input:checked + span { background: var(--sea); border-color: var(--sea); color: #fff; }
.chip input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: 2px; }
.chips.invalid .chip span { border-color: var(--danger); }

.drop {
  position: relative; display: block;
  padding: 18px;
  background: #fff;
  border: 2px dashed #9DB3B5; border-radius: 12px;
  cursor: pointer;
}
.drop:hover, .drop:focus-within { border-color: var(--sea); background: var(--sea-tint); }
.drop.invalid { border-color: var(--danger); background: var(--danger-tint); }
.drop .pick { display: block; font-weight: 700; color: var(--sea); }
.drop .fname { display: block; margin-top: 4px; font-size: .9rem; color: var(--muted); word-break: break-all; }
.drop.has-file .fname { color: var(--ink); font-weight: 600; }

.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 22px; font-weight: 600; }
.alert.error { background: var(--danger-tint); color: var(--danger); border: 1px solid #efb8b4; }
.alert.ok { background: var(--ok-tint); color: var(--ok); border: 1px solid #b7dfc8; }
.alert.warn { background: var(--gold-tint); color: var(--gold-ink); border: 1px solid #ecd28f; }

.actions { margin-top: 8px; }
.small-note { margin-top: 12px; font-size: .85rem; color: var(--muted); }

/* ---------- Kartu sukses ---------- */
.done { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 28px 22px; }
.done .tick {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--ok); color: #fff;
  display: grid; place-items: center; margin-bottom: 16px;
}
.done h2 { font-size: 1.5rem; margin-bottom: 8px; }
.done dl { margin: 18px 0 0; display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; }
.done dt { color: var(--muted); }
.done dd { margin: 0; font-weight: 700; word-break: break-word; }
.done .lock { margin-top: 22px; }

/* ---------- Dialog konfirmasi ---------- */
dialog.dlg {
  width: min(560px, calc(100% - 24px));
  padding: 24px 22px;
  border: 0; border-radius: 16px;
  color: var(--ink);
  box-shadow: 0 20px 60px rgba(9, 61, 74, .35);
}
dialog.dlg::backdrop { background: rgba(9, 61, 74, .6); }
.dlg h2 { font-size: 1.3rem; margin-bottom: 6px; }
.dlg .sub { color: var(--muted); margin-bottom: 16px; }
.dlg dl { margin: 0 0 20px; display: grid; grid-template-columns: 1fr; gap: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.dlg dt { font-size: .8rem; color: var(--muted); padding: 10px 14px 0; background: #fff; }
.dlg dd { margin: 0; padding: 0 14px 10px; font-weight: 700; word-break: break-word; border-bottom: 1px solid var(--line); background: #fff; }
.dlg dd:last-of-type { border-bottom: 0; }
.dlg .btns { display: flex; flex-direction: column-reverse; gap: 10px; }

.foot { text-align: center; font-size: .8rem; color: var(--muted); padding: 22px 16px; }

@media (min-width: 560px) {
  .row2 { grid-template-columns: 1fr 1fr; }
  .dlg .btns { flex-direction: row; justify-content: flex-end; }
}

@media (min-width: 940px) {
  .shell { grid-template-columns: minmax(340px, 420px) 1fr; }
  .intro { position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 56px 40px; }
  .intro h1 { font-size: 2rem; }
  .formcol { padding: 56px 48px 56px; }
}

/* ==========================================================
   Halaman admin
   ========================================================== */
.adm-bar {
  background: var(--sea-deep); color: #fff;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px;
  padding: 12px 20px;
}
.adm-bar .brand { font-weight: 800; }
.adm-bar nav { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.adm-bar nav a, .adm-bar nav button {
  font: inherit; font-weight: 600; font-size: .925rem;
  color: #DCEBEE; background: transparent; border: 0;
  padding: 8px 12px; border-radius: 8px; text-decoration: none; cursor: pointer;
}
.adm-bar nav a:hover, .adm-bar nav button:hover, .adm-bar nav a[aria-current] { background: rgba(255, 255, 255, .14); color: #fff; }
.adm-bar form { margin: 0; }

.adm-wrap { max-width: 1280px; margin: 0 auto; padding: 24px 16px 48px; }
.adm-wrap h1 { font-size: 1.5rem; margin-bottom: 4px; }
.adm-sub { color: var(--muted); margin-bottom: 20px; }

.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 22px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.stat .n { font-size: 1.9rem; font-weight: 800; color: var(--sea-deep); line-height: 1.1; }
.stat .t { font-size: .875rem; color: var(--muted); }

.toolbar {
  display: grid; grid-template-columns: 1fr; gap: 10px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 14px; margin-bottom: 16px;
}
.toolbar .input { min-height: 44px; }
.toolbar .btns { display: flex; flex-wrap: wrap; gap: 8px; }

.tablewrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
table.data { width: 100%; min-width: 1040px; border-collapse: collapse; font-size: .9rem; }
table.data th {
  text-align: left; white-space: nowrap;
  background: var(--sea-tint); color: var(--sea-deep);
  padding: 10px 12px; font-weight: 800; border-bottom: 1px solid var(--line);
}
table.data td { padding: 10px 12px; border-bottom: 1px solid #E6ECEB; vertical-align: top; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: #F7FAF9; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.mono { font-variant-numeric: tabular-nums; white-space: nowrap; }
td.empty { text-align: center; padding: 34px 12px; color: var(--muted); }
.muted { color: var(--muted); }

.badge { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: .8rem; font-weight: 700; }
.badge.guru { background: var(--sea-tint); color: var(--sea-deep); }
.badge.tendik { background: var(--gold-tint); color: var(--gold-ink); }

.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; }
.pager .links { display: flex; gap: 6px; }
.pager a, .pager span.cur {
  min-width: 38px; text-align: center; padding: 7px 10px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; text-decoration: none; font-weight: 600;
}
.pager span.cur { background: var(--sea); color: #fff; border-color: var(--sea); }

details.rekap { background: #fff; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 16px; }
details.rekap summary { cursor: pointer; padding: 14px 16px; font-weight: 700; }
details.rekap .tablewrap { border: 0; border-top: 1px solid var(--line); border-radius: 0 0 12px 12px; }
details.rekap table.data { min-width: 560px; }

.login {
  min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background: var(--sea-deep);
}
.login .card { width: 100%; max-width: 400px; background: #fff; border-radius: 16px; padding: 28px 24px; }
.login h1 { font-size: 1.4rem; margin-bottom: 4px; }
.login .sub { color: var(--muted); margin-bottom: 20px; }

.panel { max-width: 460px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 22px; }

@media (min-width: 720px) {
  .stats { grid-template-columns: repeat(4, 1fr); }
  .toolbar { grid-template-columns: 2fr 1fr 2fr auto; align-items: center; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
