/* ===== LATAR HALAMAN =====
   Aktif sekarang: tosca di atas -> putih di bawah.
   Untuk memakai versi tosca (tosca di atas -> putih di bawah), hapus tanda
   komentar pada baris "--tema-grad" tosca dan beri komentar pada baris abu-abu. */
:root {
  /* --tema-grad: linear-gradient(180deg, #2f2f2f 0%, #9a9a9a 42%, #eeeeee 78%, #ffffff 100%); */
  --tema-grad: linear-gradient(180deg, #0b8f8c 0%, #5fcfca 40%, #e6faf8 78%, #ffffff 100%);
  --navy: #111111;
  --blue: #1a1a1a;
  --sky: #d9d9d9;
  --gold: #111111;
  --bg: #ffffff;
  --ink: #111111;
  --muted: #2b2b2b;
}
html { background: #ffffff; }
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--tema-grad) no-repeat;
  background-color: #ffffff;
  color: var(--ink);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== HERO ===== */
.hero {
  position: relative;
  overflow: hidden;
  background: transparent;
  color: #ffffff;
  text-align: center;
  padding: clamp(36px, 7vw, 64px) 20px clamp(28px, 5vw, 48px);
}
.hero::before, .hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.hero::before {
  width: 520px; height: 520px;
  right: -160px; top: -200px;
  background: rgba(255,255,255,.07);
}
.hero::after {
  width: 340px; height: 340px;
  left: -120px; bottom: -140px;
  background: rgba(246,184,0,.16);
}
.hero > * { position: relative; z-index: 1; }

.logo-slot {
  height: clamp(120px, 26vw, 180px);
  margin: 0 auto 20px;
  display: flex;
  justify-content: center;
  align-items: center;
}
.logo-slot img {
  height: 100%;
  width: auto;
  display: block;
  filter: drop-shadow(0 8px 18px rgba(0,0,0,.35));
}
.logo-slot .ph {
  color: #111111;
  font-weight: 800;
  font-size: .8rem;
  text-align: center;
  line-height: 1.2;
  padding: 24px 18px;
  border: 2px dashed rgba(0,0,0,.45);
  border-radius: 14px;
}

h1 {
  font-weight: 800;
  font-size: clamp(2.2rem, 8vw, 4.2rem);
  letter-spacing: .01em;
  line-height: 1.05;
}
.sekolah {
  margin-top: 14px;
  display: inline-block;
  padding: 8px 22px;
  border-radius: 999px;
  background: #ffffff;
  color: #111111;
  box-shadow: 0 4px 16px rgba(0,0,0,.14);
  font-weight: 800;
  font-size: clamp(.85rem, 2.8vw, 1.1rem);
  letter-spacing: .04em;
}

.wave {
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  width: 100%; height: clamp(50px, 8vw, 90px);
  display: block;
  z-index: 1;
}

/* ===== MENU ===== */
main {
  flex: 1;
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: 0 20px 56px;
  position: relative;
  z-index: 2;
}
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: #fff;
  border-radius: 18px;
  padding: 34px 26px 28px;
  color: inherit;
  text-decoration: none;
  border-top: 6px solid var(--c, var(--sky));
  box-shadow: 0 0 0 1px rgba(0,0,0,.07), 0 12px 32px rgba(0,0,0,.12);
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.card:hover, .card:focus-visible {
  transform: translateY(-6px);
  box-shadow: 0 18px 40px rgba(0,0,0,.22);
  outline: none;
}
.card:focus-visible { box-shadow: 0 0 0 4px var(--gold), 0 18px 40px rgba(0,0,0,.22); }
.icon {
  width: 120px; height: 120px;
  margin-bottom: 18px;
  border-radius: 50%;
  box-shadow: 0 8px 20px rgba(0,0,0,.25);
  overflow: hidden;
}
.icon img { width: 100%; height: 100%; display: block; }
.card h2 { font-size: 1.2rem; letter-spacing: .02em; font-weight: 800; color: var(--navy); }
.card p { margin-top: 8px; color: var(--muted); font-size: .95rem; flex: 1; }
.btn {
  margin-top: 22px;
  padding: 10px 34px;
  border-radius: 999px;
  background: var(--c, var(--blue));
  color: var(--ct, #fff);
  font-weight: 700;
  font-size: .92rem;
  box-shadow: 0 4px 12px rgba(0,0,0,.2);
  transition: filter .2s, transform .2s;
}
.card:hover .btn, .card:focus-visible .btn { filter: brightness(.88); }

@media (max-width: 860px) { .grid { grid-template-columns: repeat(2, 1fr); } }

footer {
  background: transparent;
  border-top: 1px solid rgba(0,0,0,.12);
  color: #111111;
  text-align: center;
  padding: 22px 20px;
  font-size: .88rem;
}
footer strong { color: #111111; }

@media (prefers-reduced-motion: reduce) {
  .card, .btn { transition: none; }
  .card:hover, .card:focus-visible { transform: none; }
}

/* ===== TOMBOL PERBARUI ===== */
.hero .refresh {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #ffffff;
  color: #111111;
  box-shadow: 0 2px 10px rgba(0,0,0,.2);
  font: 700 .85rem "Plus Jakarta Sans", system-ui, sans-serif;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: background .2s;
}
.hero .refresh:hover { box-shadow: 0 3px 14px rgba(0,0,0,.32); }
.hero .refresh:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.hero .refresh:disabled { opacity: .75; cursor: wait; }
.refresh svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.refresh.loading svg { animation: putar .8s linear infinite; }
@keyframes putar { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .refresh.loading svg { animation: none; } }

/* ===== TAMPILAN HP: 2 menu per baris, ukuran ringkas ===== */
@media (max-width: 520px) {
  main { padding: 0 12px 40px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .card { padding: 18px 10px 16px; border-radius: 16px; border-top-width: 5px; }
  .icon { width: 84px; height: 84px; margin-bottom: 12px; }
  .card h2 { font-size: .95rem; letter-spacing: 0; }
  .card p { margin-top: 6px; font-size: .78rem; line-height: 1.4; }
  .btn { margin-top: 14px; padding: 8px 0; width: 100%; max-width: 120px; font-size: .85rem; }
  .hero .refresh { top: 12px; right: 12px; width: 38px; height: 38px; }
}

/* ===== TOMBOL ADMIN (kunci) ===== */
.hero .admin-btn {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #ffffff;
  color: #111111;
  box-shadow: 0 2px 10px rgba(0,0,0,.2);
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: background .2s;
}
.hero .admin-btn:hover { box-shadow: 0 3px 14px rgba(0,0,0,.32); }
.hero .admin-btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.admin-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 520px) { .hero .admin-btn { top: 12px; left: 12px; width: 38px; height: 38px; } }

.kosong { grid-column: 1 / -1; text-align: center; background: #fff; border-radius: 16px; padding: 36px 20px; color: var(--muted); box-shadow: 0 12px 32px rgba(0,0,0,.12); }

/* ===== JENDELA ADMIN ===== */
[hidden] { display: none !important; }
.overlay {
  position: fixed; inset: 0; z-index: 50;
  display: none; align-items: center; justify-content: center;
  padding: 16px;
  background: rgba(14,20,32,.62);
}
.overlay.open { display: flex; }
.modal {
  position: relative;
  width: 100%; max-width: 430px; max-height: 92vh; overflow-y: auto;
  background: #fff; color: var(--ink);
  border-radius: 20px; padding: 26px 22px 20px;
  box-shadow: 0 24px 60px rgba(0,0,0,.4);
}
.modal h3 { font-size: 1.25rem; font-weight: 800; color: var(--navy); padding-right: 28px; }
.m-close {
  position: absolute; top: 12px; right: 14px;
  width: 34px; height: 34px; border: 0; border-radius: 50%;
  background: transparent; color: var(--muted); font-size: 1.6rem; line-height: 1; cursor: pointer;
}
.m-close:hover { background: var(--bg); }
.m-sub { margin: 6px 0 14px; color: var(--muted); font-size: .9rem; }
.modal input[type="password"] {
  display: block; width: 100%; margin-bottom: 10px;
  padding: 11px 14px; border: 1.5px solid #d4d4d4; border-radius: 12px;
  font: 500 .95rem "Plus Jakarta Sans", system-ui, sans-serif; color: var(--ink);
}
.modal input[type="password"]:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0,0,0,.18); }
.m-msg { min-height: 1.3em; margin: 2px 0 10px; font-size: .86rem; font-weight: 600; }
.m-msg.ok { color: #0f7a2a; }
.m-msg.err { color: #c0281c; }
.m-note { margin: 12px 0 0; font-size: .78rem; color: var(--muted); }
.m-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 14px; }
.b {
  padding: 10px 20px; border: 1.5px solid #d4d4d4; border-radius: 999px;
  background: #fff; color: var(--ink);
  font: 700 .9rem "Plus Jakarta Sans", system-ui, sans-serif; cursor: pointer;
}
.b:hover { background: var(--bg); }
.b-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.b-primary:hover { background: var(--navy); }
.b:disabled { opacity: .6; cursor: wait; }

.m-list { list-style: none; margin: 0 0 6px; padding: 0; }
.m-list li { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid #ebebeb; }
.m-list img { width: 38px; height: 38px; border-radius: 50%; flex: none; }
.m-list .nm { flex: 1; font-weight: 700; font-size: .92rem; }
.sw { position: relative; width: 46px; height: 26px; flex: none; }
.sw input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.sw .sl { position: absolute; inset: 0; border-radius: 999px; background: #bdbdbd; transition: background .2s; }
.sw .sl::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s; }
.sw input:checked + .sl { background: #1f9d4a; }
.sw input:checked + .sl::after { transform: translateX(20px); }
.sw input:focus-visible + .sl { outline: 3px solid var(--gold); outline-offset: 2px; }

.m-box { margin-top: 12px; border: 1px solid #e6e6e6; border-radius: 14px; padding: 12px 14px; }
.m-box summary { font-weight: 800; font-size: .92rem; cursor: pointer; color: var(--navy); }
.m-box[open] summary { margin-bottom: 12px; }
@media (prefers-reduced-motion: reduce) { .sw .sl, .sw .sl::after { transition: none; } }

/* ===== URUTAN MENU (panah) ===== */
.m-list li { gap: 8px; }
.m-list .nm { font-size: .86rem; }
.mv { display: flex; gap: 4px; flex: none; }
.mv button {
  width: 30px; height: 30px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1.5px solid #d4d4d4; border-radius: 50%;
  background: #fff; color: var(--navy); cursor: pointer;
}
.mv button:hover:not(:disabled) { background: var(--bg); }
.mv button:disabled { opacity: .3; cursor: default; }
.mv button:focus-visible { outline: 3px solid var(--gold); outline-offset: 1px; }
.mv svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.b-small { padding: 7px 14px; font-size: .8rem; margin: 4px 0 8px; }

/* ===== TEMA PUTIH ===== */
.hero::before, .hero::after { display: none; }
.wave { display: none; }
.b-primary:hover { background: #000000; }
