* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: #f3f5f4; color: #1f2d2a; }
body.tengah { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
h1 { margin: 0 0 4px; font-size: 24px; color: #14664f; }
h2 { margin: 0 0 16px; }
.sub { color: #5d6b67; margin: 0 0 16px; }
.kartu { background: #fff; border-radius: 12px; padding: 20px; box-shadow: 0 1px 4px rgba(0,0,0,.08); margin-bottom: 16px; }
.kartu.kecil { width: 100%; max-width: 380px; }
label { display: block; margin: 12px 0 4px; font-size: 14px; font-weight: 600; }
input[type=text], input[type=password] { width: 100%; padding: 10px 12px; border: 1px solid #c5cfcc; border-radius: 8px; font-size: 16px; }
input:focus { outline: 2px solid #14664f55; border-color: #14664f; }
button { width: 100%; margin-top: 18px; padding: 11px; border: 0; border-radius: 8px; background: #14664f; color: #fff; font-size: 16px; cursor: pointer; }
button:hover { background: #0f5340; }
.pesan { padding: 10px 12px; border-radius: 8px; margin-bottom: 8px; font-size: 14px; }
.pesan.salah { background: #fde8e8; color: #9b1c1c; }
.pesan.benar { background: #def7ec; color: #03543f; }
.atas { background: #14664f; color: #fff; padding: 12px 20px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.atas a { color: #fff; }
.isi { max-width: 900px; margin: 0 auto; padding: 20px 16px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 16px; }
.grid .kartu { margin: 0; }
.angka { text-align: center; }
.angka b { display: block; font-size: 32px; color: #14664f; }
.angka span { color: #5d6b67; }
code { background: #eef2f1; padding: 1px 5px; border-radius: 4px; }

/* ---- Tambahan Tahap 3 ---- */
.atas nav { display: flex; gap: 4px; flex-wrap: wrap; }
.atas nav a { text-decoration: none; padding: 6px 12px; border-radius: 6px; }
.atas nav a:hover { background: #ffffff22; }
.atas nav a.aktif { background: #ffffff33; font-weight: 600; }
h3 { margin: 0 0 12px; }
.gulir { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #e3e9e7; vertical-align: middle; }
th { background: #f3f5f4; font-weight: 600; }
.redup { color: #8a9692; }
.hijau { color: #14664f; }
.baris { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.baris > div { flex: 1 1 180px; }
.baris button { margin-top: 0; }
.sebaris { display: inline-flex; gap: 6px; align-items: center; margin: 2px 0; flex-wrap: wrap; }
select, input[type=date] { width: 100%; padding: 10px 12px; border: 1px solid #c5cfcc; border-radius: 8px; font-size: 16px; background: #fff; }
.sebaris select, .sebaris input[type=text], .sebaris input[type=password], .sebaris input[type=date] { width: auto; padding: 6px 8px; font-size: 14px; }
.sebaris .pendek { width: 130px; }
button.kecil { width: auto; margin: 0; padding: 6px 10px; font-size: 13px; }
button.abu { background: #6b7a76; }
button.abu:hover { background: #55625f; }
button.merah { background: #b42318; }
button.merah:hover { background: #8f1c13; }

/* ---- Tambahan Tahap 4 ---- */
.pesan.info { background: #e1effe; color: #1e429f; }
.pesan ul.daftar { margin: 6px 0 0; padding-left: 20px; }
.catatan { font-size: 13px; color: #5d6b67; margin: 12px 0 0; line-height: 1.6; }
input[type=file] { width: 100%; padding: 8px; border: 1px dashed #9db3ad; border-radius: 8px; background: #fafcfb; font-size: 14px; }
td input[type=text] { padding: 6px 8px; font-size: 14px; }
td input.pendek { width: 130px; }
td input.lebar { min-width: 220px; }
td select.ciut { width: auto; padding: 6px 8px; font-size: 14px; }
tr.nonaktif td { background: #f7f7f7; color: #8a9692; }
td .sebaris { margin-left: 2px; }

/* ---- Tambahan Tahap 5 ---- */
table.input th, table.input td { padding: 6px 5px; }
table.input input.nilai { width: 56px; text-align: center; }
table.input input.hal { width: 84px; }
table.input input.ket { width: 140px; }
table.input select { width: 62px; padding: 6px 4px; font-size: 14px; }
table.input th.nm, table.input td.nm { min-width: 190px; position: sticky; left: 0; background: #fff; z-index: 1; }
table.input th.nm { background: #f3f5f4; }
.terakhir { display: block; font-size: 12px; color: #8a9692; margin-top: 2px; }
.bar-simpan { position: sticky; bottom: 0; background: #fff; padding: 10px 0 2px; border-top: 1px solid #e3e9e7; margin-top: 8px; }
.bar-simpan button { width: auto; margin: 0; padding: 10px 28px; }

/* ---- Tambahan Tahap 6 ---- */
.tab { display: inline-block; padding: 8px 16px; border-radius: 8px; background: #e6ece9; color: #1f2d2a; text-decoration: none; margin-right: 6px; font-size: 14px; }
.tab.aktif { background: #14664f; color: #fff; font-weight: 600; }
.navsiswa { display: flex; justify-content: space-between; gap: 8px; margin: 4px 0 12px; flex-wrap: wrap; }
a.tombol-kecil { display: inline-block; padding: 6px 12px; border-radius: 8px; background: #6b7a76; color: #fff; text-decoration: none; font-size: 13px; }
a.tombol-kecil:hover { background: #55625f; }
tr.terisi td { background: #f1f8f5; }
table.input tr.terisi td.nm { background: #f1f8f5; }

/* Perbaikan tombol simpan agar tidak tertutup kolom nama */
.bar-simpan { z-index: 5; }

/* ---- Tambahan Tahap 7: pilihan banyak guru ---- */
details.pilih { position: relative; min-width: 200px; }
details.pilih summary { cursor: pointer; padding: 8px 12px; border: 1px solid #c5cfcc; border-radius: 8px; background: #fff; font-size: 14px; }
details.pilih .isi-pilih { max-height: 220px; overflow: auto; border: 1px solid #c5cfcc; border-radius: 8px; padding: 8px 10px; margin-top: 4px; background: #fff; min-width: 260px; }
details.pilih label { display: flex; gap: 8px; align-items: center; font-weight: 400; margin: 6px 0; font-size: 14px; }
details.pilih input[type=checkbox] { width: auto; margin: 0; }

/* ---- Tambahan Tahap 8a: nilai rapor ---- */
tr.belum td { background: #fff8e1; }
span.belum { background: #fff8e1; padding: 1px 6px; border-radius: 4px; }
input.terkunci { background: #eef2f1; color: #55625f; }
select.kosong { border-color: #e0a800; }
button.auto { width: auto; margin: 0; padding: 10px 20px; }
details.pilih textarea { width: 280px; max-width: 70vw; padding: 8px; border: 1px solid #c5cfcc; border-radius: 8px; font: inherit; font-size: 13px; margin-top: 4px; }

/* Perbaikan Tahap 8a: pilihan penanda tangan cukup lebar */
table.input select.ttd { width: 180px; }
