/* =========================================================
   Portal Pengumuman Penerimaan Anggota
   Remaja Masjid Al-Kautsar — SMP Negeri 1 Taman

   Palet warna diambil langsung dari logo organisasi:
   biru tua sebagai warna utama, hijau lime & hijau daun
   sebagai aksen, putih untuk kontras kaligrafi.
   ========================================================= */

:root {
  --navy-950: #0a1f52;
  --blue-900: #0f2e70;
  --blue-800: #153e98;   /* warna utama, sama seperti latar logo */
  --blue-700: #2050b8;
  --blue-600: #3865c9;
  --blue-100: #e8edfb;
  --blue-050: #f4f7fd;

  --lime-400: #9be05a;   /* aksen "Remaja Masjid" */
  --lime-300: #c3ef99;

  --red-600: #c0392b;    /* status tidak lulus */
  --red-100: #fbe4e1;

  --green-600: #0fae5c;  /* aksen "SMP NEGERI I TAMAN" */
  --green-700: #0c8f4b;
  --green-100: #e2f7ea;

  --cream-50: #faf8f2;   /* nuansa kertas SK / sertifikat */
  --gold-line: #d8cfa8;  /* garis tipis dekoratif, netral & tidak kontras keras */

  --ink-900: #10182b;
  --ink-700: #3c4658;
  --ink-500: #6b7488;

  --font-display: "Fraunces", "Georgia", serif;
  --font-body: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  --radius-lg: 18px;
  --radius-md: 12px;
  --shadow-card: 0 20px 45px -18px rgba(10, 31, 82, 0.45);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--ink-900);
  background: radial-gradient(ellipse at top, var(--blue-700) 0%, var(--blue-900) 55%, var(--navy-950) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

::selection { background: var(--lime-300); color: var(--navy-950); }

:focus-visible {
  outline: 3px solid var(--lime-400);
  outline-offset: 2px;
}

/* ---------- Layout shell ---------- */

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 20px 64px;
}

.topbar {
  width: 100%;
  max-width: 720px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: #fff;
  margin-bottom: 28px;
}

.topbar__crest { flex-shrink: 0; }

.topbar__title {
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: 0.04em;
  line-height: 1.35;
}
.topbar__title strong { display: block; font-size: 17px; font-weight: 600; }
.topbar__title span { color: var(--lime-300); font-size: 12.5px; }

/* ---------- Card / dokumen resmi ---------- */

.doc-card {
  width: 100%;
  max-width: 640px;
  background: var(--cream-50);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 40px 40px 36px;
  position: relative;
  border: 1px solid rgba(255,255,255,0.35);
}

.doc-card::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid var(--gold-line);
  border-radius: calc(var(--radius-lg) - 6px);
  pointer-events: none;
}

.doc-card__eyebrow {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--green-700);
  text-align: center;
  margin-bottom: 6px;
}

.doc-card__title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  text-align: center;
  color: var(--blue-900);
  margin: 0 0 4px;
}

.doc-card__subtitle {
  text-align: center;
  color: var(--ink-500);
  font-size: 13.5px;
  margin-bottom: 28px;
}

.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-line), transparent);
  margin: 24px 0;
}

/* ---------- Form ---------- */

.field {
  margin-bottom: 18px;
}
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--blue-900);
  margin-bottom: 6px;
}
.field input {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1.5px solid #d9dceb;
  background: #fff;
  font-family: var(--font-body);
  font-size: 14.5px;
  color: var(--ink-900);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input:focus {
  border-color: var(--blue-700);
  box-shadow: 0 0 0 4px var(--blue-100);
  outline: none;
}
.field small { display: block; margin-top: 5px; color: var(--ink-500); font-size: 12px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 18px;
  border-radius: var(--radius-md);
  border: none;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14.5px;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.btn--primary {
  background: var(--blue-800);
  color: #fff;
  box-shadow: 0 10px 24px -10px rgba(21, 62, 152, 0.6);
}
.btn--primary:hover:not(:disabled) { background: var(--blue-700); }

.btn--success {
  background: var(--green-600);
  color: #fff;
  box-shadow: 0 10px 24px -10px rgba(15, 174, 92, 0.55);
}
.btn--success:hover:not(:disabled) { background: var(--green-700); }

.btn--ghost {
  background: transparent;
  color: var(--blue-800);
  border: 1.5px solid var(--blue-800);
}
.btn--ghost:hover:not(:disabled) { background: var(--blue-100); }

.btn--danger {
  background: var(--red-600);
  color: #fff;
  box-shadow: 0 10px 24px -10px rgba(192, 57, 43, 0.55);
}
.btn--danger:hover:not(:disabled) { background: #a53226; }

.btn--white {
  background: #ffffff;
  color: var(--blue-900);
  box-shadow: 0 10px 24px -10px rgba(0, 0, 0, 0.3);
}
.btn--white:hover:not(:disabled) { background: #eef0f6; }

.btn--danger-outline {
  background: transparent;
  color: #b3453a;
  border: 1.5px solid #e2b3ab;
}
.btn--danger-outline:hover:not(:disabled) { background: #fbeeec; }

.error-banner {
  background: #fdeceb;
  border: 1px solid #f2b8b0;
  color: #9a3226;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  margin-bottom: 18px;
  display: none;
}
.error-banner.show { display: block; }

.hint-footer {
  text-align: center;
  color: var(--ink-500);
  font-size: 12px;
  margin-top: 24px;
}
.hint-footer a { color: var(--blue-700); text-decoration: underline; }

/* ---------- Seal / stempel ---------- */

.seal-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
}
.seal {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px double currentColor;
  position: relative;
}
.seal--accepted { color: var(--green-600); background: var(--green-100); }
.seal--rejected { color: var(--red-600); background: var(--red-100); }

/* ---------- Status hasil ---------- */

.result-heading {
  text-align: center;
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 600;
  margin: 4px 0 6px;
}
.result-heading--accepted { color: var(--green-700); }
.result-heading--rejected { color: var(--red-600); }

.result-sub {
  text-align: center;
  color: var(--ink-700);
  font-size: 14.5px;
  line-height: 1.6;
  margin-bottom: 22px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  margin-bottom: 6px;
}
.data-table td {
  padding: 9px 4px;
  border-bottom: 1px dashed #e1dcc9;
}
.data-table td:first-child { color: var(--ink-500); width: 42%; }
.data-table td:last-child { font-weight: 700; color: var(--ink-900); text-align: right; font-family: var(--font-mono); font-size: 12.5px; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.status-pill--waiting { background: #fdf3d6; color: #8a6d1a; }
.status-pill--confirmed { background: var(--green-100); color: var(--green-700); }
.status-pill--rejected { background: var(--blue-100); color: var(--blue-800); }

.callout {
  background: var(--blue-050);
  border: 1px solid var(--blue-100);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  font-size: 13.5px;
  color: var(--ink-700);
  line-height: 1.6;
  margin: 18px 0;
}
.callout strong { color: var(--blue-900); }

.callout--steps ol { margin: 8px 0 0; padding-left: 18px; }
.callout--steps li { margin-bottom: 6px; }

.motivation {
  background: #ffffff;
  border: 1px solid #e4e0d0;
  border-radius: var(--radius-md);
  padding: 16px 18px;
  font-size: 13.5px;
  color: var(--ink-700);
  line-height: 1.6;
  margin: 18px 0;
  font-style: italic;
}

.wa-btn {
  background: #1fae5c;
}

.btn-row { display: flex; gap: 10px; margin-top: 10px; }
.btn-row .btn { flex: 1; }

.print-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.print-row .btn { width: auto; padding: 11px 20px; }

/* ---------- Modal preview cetak ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 31, 82, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.modal-overlay.show { display: flex; }

.modal-box {
  background: #fff;
  border-radius: 12px;
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.5);
}
.modal-box__header {
  padding: 16px 22px;
  border-bottom: 1px solid #e2e2e2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-display);
  font-size: 16px;
  color: var(--blue-900);
  flex-shrink: 0;
}
.modal-close-btn {
  background: none;
  border: none;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: var(--ink-500);
  padding: 0 4px;
}
.modal-close-btn:hover { color: var(--ink-900); }

.modal-box__body {
  padding: 20px 22px;
  overflow: auto;
  flex: 1;
  background: #ececec;
}

.modal-box__footer {
  padding: 14px 22px;
  border-top: 1px solid #e2e2e2;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
  flex-wrap: wrap;
}
.modal-box__footer .btn { width: auto; padding: 11px 20px; }

/* ---------- Dokumen cetak formal (hitam-putih, gaya Excel) ---------- */

.doc-print {
  background: #ffffff;
  padding: 28px 30px;
  font-family: Arial, Helvetica, sans-serif;
  color: #000000;
  max-width: 780px;
  margin: 0 auto;
}
.doc-print__header { text-align: center; margin-bottom: 4px; }
.doc-print__org {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
  color: #000;
}
.doc-print__title { font-size: 17px; font-weight: 700; margin: 5px 0 2px; color: #000; }
.doc-print__sub { font-size: 11.5px; color: #333; }

.doc-print__meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #000;
  border-top: 1px solid #000;
  border-bottom: 1px solid #000;
  padding: 6px 2px;
  margin: 14px 0 12px;
}

table.doc-print__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
  color: #000;
}
table.doc-print__table th,
table.doc-print__table td {
  border: 1px solid #000;
  padding: 6px 8px;
  text-align: left;
}
table.doc-print__table th {
  font-weight: 700;
  background: #ffffff;
}

.doc-print__sign {
  margin-top: 50px;
  display: flex;
  justify-content: flex-end;
  font-size: 11.5px;
  text-align: center;
  color: #000;
}
.doc-print__sign .line {
  margin-top: 55px;
  border-top: 1px solid #000;
  padding-top: 4px;
  min-width: 210px;
}

/* ---------- Admin ---------- */

.admin-shell {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
  margin-bottom: 22px;
  gap: 16px;
  flex-wrap: wrap;
}
.admin-header__title { font-family: var(--font-display); font-size: 20px; }
.admin-header__title span { display: block; font-size: 12.5px; color: var(--lime-300); font-family: var(--font-body); margin-top: 3px; }

.admin-header__right { display: flex; align-items: center; gap: 12px; font-size: 13px; }

.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--cream-50);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  box-shadow: var(--shadow-card);
}
.stat-card .num { font-family: var(--font-display); font-size: 26px; font-weight: 700; color: var(--blue-900); }
.stat-card .label { font-size: 12px; color: var(--ink-500); margin-top: 2px; }

.panel {
  background: var(--cream-50);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 22px 22px 8px;
  overflow-x: auto;
}

.panel__toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.panel__toolbar input[type="search"] {
  flex: 1;
  min-width: 180px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1.5px solid #d9dceb;
  font-family: var(--font-body);
  font-size: 13.5px;
}
.chip-filter {
  display: flex;
  gap: 6px;
}
.chip {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--blue-100);
  background: #fff;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--blue-800);
  cursor: pointer;
}
.chip.active { background: var(--blue-800); color: #fff; border-color: var(--blue-800); }

table.roster {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 760px;
}
table.roster thead th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-500);
  padding: 10px 10px;
  border-bottom: 2px solid var(--blue-100);
}
table.roster tbody td {
  padding: 12px 10px;
  border-bottom: 1px solid #eee6d0;
  vertical-align: middle;
}
table.roster tbody tr:hover { background: #fffdf6; }
.mono { font-family: var(--font-mono); font-size: 12px; color: var(--ink-700); }

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
}
.badge--accepted { background: var(--green-100); color: var(--green-700); }
.badge--rejected { background: var(--red-100); color: var(--red-600); }
.badge--confirmed { background: var(--blue-100); color: var(--blue-800); }
.badge--waiting { background: #fdf3d6; color: #8a6d1a; }

.row-actions { display: flex; gap: 8px; }
.row-actions .btn { width: auto; padding: 7px 12px; font-size: 12.5px; }

.empty-state {
  text-align: center;
  padding: 40px 10px;
  color: var(--ink-500);
  font-size: 13.5px;
}

.loading-state {
  text-align: center;
  padding: 40px 10px;
  color: var(--ink-500);
  font-size: 13.5px;
}

/* ---------- Responsive ---------- */

@media (max-width: 560px) {
  .doc-card { padding: 30px 22px 26px; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .admin-header { flex-direction: column; align-items: flex-start; }
}
