:root {
  --indigo: #4F46E5;
  --violet: #8B5CF6;
  --ink: #1F1B3A;
  --muted: #635F82;
  --line: rgba(79, 70, 229, .14);
  --glass: rgba(255, 255, 255, .62);
  --glass-strong: rgba(255, 255, 255, .82);
  --radius: 16px;
  --shadow: 0 18px 40px -22px rgba(31, 27, 58, .35);
  --gap: 20px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1100px 600px at 8% -5%, rgba(139, 92, 246, .30), transparent 60%),
    radial-gradient(900px 520px at 96% 4%, rgba(79, 70, 229, .26), transparent 58%),
    radial-gradient(800px 600px at 50% 108%, rgba(56, 189, 248, .18), transparent 60%),
    #F3F0FF;
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.bg-orb { position: fixed; border-radius: 50%; filter: blur(70px); opacity: .40; pointer-events: none; z-index: 0; }
.orb-1 { width: 320px; height: 320px; background: #8B5CF6; top: -90px; left: -60px; }
.orb-2 { width: 260px; height: 260px; background: #6366F1; top: 40%; right: -80px; }
.orb-3 { width: 300px; height: 300px; background: #38BDF8; bottom: -120px; left: 30%; }
.topbar, .container, .footer { position: relative; z-index: 1; }

/* ---------- Topbar ---------- */
.topbar {
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  background: rgba(255, 255, 255, .55);
  border-bottom: 1px solid rgba(255, 255, 255, .7);
}
.topbar-inner {
  max-width: 1180px; margin: 0 auto; padding: 14px 22px;
  display: flex; align-items: center; justify-content: space-between; gap: var(--gap); flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.brand-mark {
  width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--indigo), var(--violet));
  color: #fff; font-weight: 700; letter-spacing: .5px;
  box-shadow: 0 10px 22px -10px rgba(79, 70, 229, .8);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 15.5px; }
.brand-text small { color: var(--muted); font-size: 12.5px; }
.topbar-user { display: flex; align-items: center; gap: 12px; }
.user-chip {
  display: flex; flex-direction: column; text-align: right; line-height: 1.25;
  background: var(--glass); border: 1px solid rgba(255, 255, 255, .8);
  border-radius: 12px; padding: 6px 12px;
}
.user-chip strong { font-size: 13.5px; }
.user-chip small { color: var(--muted); font-size: 11.5px; }

.mainnav { border-top: 1px solid rgba(255, 255, 255, .7); }
.mainnav-inner {
  max-width: 1180px; margin: 0 auto; padding: 8px 22px;
  display: flex; gap: 8px; flex-wrap: wrap;
}
.mainnav a {
  text-decoration: none; color: var(--muted); font-weight: 600; font-size: 13.5px;
  padding: 8px 14px; border-radius: 11px; transition: .18s;
}
.mainnav a:hover { background: rgba(255, 255, 255, .75); color: var(--ink); }
.mainnav a.active { background: linear-gradient(135deg, var(--indigo), var(--violet)); color: #fff; box-shadow: 0 10px 20px -12px rgba(79, 70, 229, .9); }

/* ---------- Layout ---------- */
.container { max-width: 1180px; margin: 0 auto; padding: 30px 22px 60px; }
.page-head { margin-bottom: 26px; }
.page-head h1 { margin: 0 0 4px; font-size: 25px; letter-spacing: -.3px; }
.page-head .muted { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 12px; }
.mt-2 { margin-top: 22px; }
.mt-3 { margin-top: 34px; }
.mb-0 { margin-bottom: 0; }

/* ---------- Cards ---------- */
.card {
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, .75);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 24px;
}
.card + .card { margin-top: 22px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.card-head h2 { margin: 0; font-size: 17.5px; }
.card-head p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.card-head .aksi { display: flex; gap: 10px; flex-wrap: wrap; }

.grid { display: grid; gap: var(--gap); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: var(--gap); align-items: start; }
.split-3-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 420px); gap: var(--gap); align-items: start; }

.tile {
  background: var(--glass-strong);
  border: 1px solid rgba(255, 255, 255, .85);
  border-radius: 14px; padding: 18px 20px; box-shadow: var(--shadow);
}
.tile .tile-label { color: var(--muted); font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.tile .tile-value { font-size: 30px; font-weight: 700; line-height: 1.25; margin-top: 4px; }
.tile .tile-sub { color: var(--muted); font-size: 12.5px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 12px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); font: inherit; font-weight: 600; font-size: 14px;
  text-decoration: none; cursor: pointer; transition: .18s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 22px -14px rgba(31, 27, 58, .5); }
.btn-primary { background: linear-gradient(135deg, var(--indigo), var(--violet)); color: #fff; border-color: transparent; box-shadow: 0 12px 26px -14px rgba(79, 70, 229, .95); }
.btn-success { background: linear-gradient(135deg, #059669, #10B981); color: #fff; border-color: transparent; }
.btn-danger { background: linear-gradient(135deg, #DC2626, #F43F5E); color: #fff; border-color: transparent; }
.btn-ghost { background: rgba(255, 255, 255, .65); }
.btn-sm { padding: 7px 13px; font-size: 12.8px; border-radius: 10px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-hapus { background: none; border: none; color: #B91C1C; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; padding: 2px 0; text-decoration: underline; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border-radius: 14px; border: 1px solid rgba(255, 255, 255, .8); background: rgba(255, 255, 255, .6); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead th {
  text-align: left; padding: 12px 14px; font-size: 12px; text-transform: uppercase; letter-spacing: .5px;
  color: var(--muted); background: rgba(243, 240, 255, .85); border-bottom: 1px solid var(--line); white-space: nowrap;
}
tbody td { padding: 12px 14px; border-bottom: 1px solid rgba(79, 70, 229, .09); vertical-align: top; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(255, 255, 255, .65); }
td.num, th.num { text-align: right; white-space: nowrap; }
td.aksi-cell { white-space: nowrap; }

/* ---------- Badges ---------- */
.badge {
  display: inline-block; padding: 4px 11px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
  border: 1px solid transparent;
}
.b-abu { background: rgba(99, 95, 130, .14); color: #4B4769; }
.b-kuning { background: rgba(245, 158, 11, .18); color: #92400E; }
.b-merah { background: rgba(239, 68, 68, .16); color: #991B1B; }
.b-biru { background: rgba(37, 99, 235, .16); color: #1E40AF; }
.b-hijau { background: rgba(16, 185, 129, .18); color: #065F46; }
.b-ungu { background: rgba(139, 92, 246, .18); color: #5B21B6; }

/* ---------- Forms ---------- */
.field { margin-bottom: 18px; }
.field > label { display: block; font-weight: 600; font-size: 13.2px; margin-bottom: 6px; }
.field .hint { color: var(--muted); font-size: 12.3px; margin-top: 5px; }
input[type=text], input[type=password], input[type=number], input[type=email], input[type=url], input[type=date], input[type=time], select, textarea {
  width: 100%; padding: 10px 13px; border-radius: 12px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, .86); font: inherit; color: var(--ink); transition: .15s;
}
input[type=file] { width: 100%; padding: 9px 12px; border-radius: 12px; border: 1px dashed var(--line); background: rgba(255, 255, 255, .7); font: inherit; font-size: 13.5px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 4px rgba(139, 92, 246, .16); }
textarea { resize: vertical; min-height: 78px; }
.form-row { display: grid; gap: var(--gap); grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-row.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-row.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.checkline { display: flex; align-items: center; gap: 9px; font-size: 14px; }
.checkline input { width: auto; }
.inline-form { display: inline; }

/* Slot logo pada halaman Pengaturan */
.logo-slot {
  border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 255, 255, .62);
  padding: 14px 16px;
}
.logo-slot-judul { font-weight: 600; font-size: 13.2px; margin-bottom: 10px; }
.logo-slot-preview {
  display: grid; place-items: center; min-height: 132px; margin-bottom: 12px;
  border: 1px dashed var(--line); border-radius: 12px; background: #fff; padding: 10px;
}
.logo-slot-preview img { max-width: 120px; max-height: 120px; object-fit: contain; }

/* Pemilih ukuran kertas saat mencetak */
.pilih-kertas { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pilih-kertas .small { margin-left: 4px; }

/* ---------- Alerts ---------- */
.alert { padding: 12px 16px; border-radius: 13px; margin-bottom: 18px; font-size: 14px; border: 1px solid transparent; }
.alert-info { background: rgba(59, 130, 246, .13); border-color: rgba(59, 130, 246, .3); color: #1E3A8A; }
.alert-sukses { background: rgba(16, 185, 129, .15); border-color: rgba(16, 185, 129, .32); color: #065F46; }
.alert-galat { background: rgba(239, 68, 68, .14); border-color: rgba(239, 68, 68, .32); color: #991B1B; }
.alert-peringatan { background: rgba(245, 158, 11, .16); border-color: rgba(245, 158, 11, .34); color: #92400E; }

.empty { padding: 34px 18px; text-align: center; color: var(--muted); }

/* ---------- Kegiatan harian (tampilan aplikasi) ---------- */
.hari-blok { border: 1px solid rgba(255, 255, 255, .85); border-radius: 14px; background: var(--glass-strong); padding: 16px 18px; box-shadow: var(--shadow); }
.hari-blok + .hari-blok { margin-top: 16px; }
.hari-blok-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.hari-blok-head h3 { margin: 0; font-size: 15.5px; }
.hari-nomor-badge {
  display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 9px;
  background: linear-gradient(135deg, var(--indigo), var(--violet)); color: #fff; font-size: 12.5px; font-weight: 700;
}
.keg-baris { padding: 12px 0; border-top: 1px dashed rgba(79, 70, 229, .18); }
.keg-baris:first-of-type { border-top: none; }
.keg-kepala { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.keg-jam {
  flex: none; min-width: 52px; text-align: center; padding: 3px 8px; border-radius: 9px;
  background: rgba(139, 92, 246, .14); color: #5B21B6; font-weight: 700; font-size: 12.8px;
}
.keg-uraian { font-weight: 600; font-size: 14.4px; flex: 1; }
.keg-meta { margin-top: 8px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 18px; }
.keg-meta .lbl { color: var(--muted); font-size: 11.6px; text-transform: uppercase; letter-spacing: .4px; font-weight: 600; }
.keg-meta .isi { font-size: 13.4px; }
.keg-baris .aksi { margin-top: 10px; display: flex; gap: 14px; flex-wrap: wrap; }

.foto-grid { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.foto-item { position: relative; width: 104px; }
.foto-item img { width: 104px; height: 78px; object-fit: cover; border-radius: 10px; border: 1px solid rgba(79, 70, 229, .18); display: block; }
.foto-item .hapus { margin-top: 4px; text-align: center; }

.ringkas-hari { margin-top: 6px; }
.blok-note {
  border: 1px solid var(--line); background: rgba(255, 255, 255, .72);
  border-radius: 12px; padding: 12px 15px; font-size: 13.6px;
}
.blok-note .lbl { color: var(--muted); font-size: 11.6px; text-transform: uppercase; letter-spacing: .4px; font-weight: 600; margin-bottom: 4px; }.mini-kalender { display: flex; flex-wrap: wrap; gap: 6px; }
.mini-kalender .tgl {
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  font-size: 12.5px; font-weight: 600; background: rgba(255, 255, 255, .8);
  border: 1px solid var(--line); color: var(--muted);
}
.mini-kalender .tgl.ada { background: linear-gradient(135deg, var(--indigo), var(--violet)); color: #fff; border-color: transparent; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 30px 18px; }
.login-card { width: 100%; max-width: 430px; }
.login-card .brand-mark { width: 54px; height: 54px; border-radius: 16px; font-size: 18px; margin: 0 auto 14px; }
.login-card h1 { text-align: center; font-size: 21px; margin: 0 0 4px; }
.login-card .sub { text-align: center; color: var(--muted); margin: 0 0 24px; font-size: 13.5px; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid rgba(255, 255, 255, .75); background: rgba(255, 255, 255, .45); backdrop-filter: blur(14px); }
.footer-inner {
  max-width: 1180px; margin: 0 auto; padding: 18px 22px;
  display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  color: var(--muted); font-size: 12.8px;
}

/* ---------- Lembar laporan di layar ponsel ----------
   Struktur laporan dibuat untuk kertas A4 (kotak identitas 4 kolom, tanda tangan 2 kolom).
   Di layar sempit, kedua bagian itu disusun satu kolom supaya tidak melebar keluar layar.
   Aturan cetak tidak terpengaruh (blok @media print di bawah tetap 2 kolom). */
@media screen and (max-width: 760px) {
  .lkh-sheet { padding: 16px 14px; }
  .identitas-harian, .identitas-harian tbody, .identitas-harian tr, .identitas-harian td { display: block; width: auto; }
  .identitas-harian tr { padding: 3px 8px; }
  .identitas-harian tr + tr { border-top: 1px dotted #bbb; }
  .identitas-harian td.lbl { width: auto; font-size: 11px; padding-bottom: 0; }
  .identitas-harian td.val { width: auto; padding: 0 0 2px; font-size: 12px; }
  .ttd-harian { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .lkh-judul { font-size: 13.5px; }
  .lkh-periode { font-size: 11.5px; }
}

/* ---------- Responsif ---------- */
@media (max-width: 1000px) {
  .split-3-2 { grid-template-columns: minmax(0, 1fr); }
  .grid-3, .grid-4, .grid-5, .form-row, .form-row.two, .form-row.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 620px) {
  .grid-2, .grid-3, .grid-4, .grid-5, .form-row, .form-row.two, .form-row.four, .keg-meta { grid-template-columns: minmax(0, 1fr); }
  /* Ponsel: pastikan sasaran sentuh cukup besar (standar 44px) */
  /* Ponsel: seluruh sasaran sentuh minimal 44px (termasuk tombol kecil), sesuai
     kebiasaan aplikasi ini agar mudah ditekan dengan jempol di Android. */
  .btn { min-height: 44px; padding: 11px 18px; }
  .btn-sm { min-height: 44px; padding: 9px 14px; }
  .mainnav a { padding: 11px 14px; min-height: 44px; display: inline-flex; align-items: center; }
  .btn-hapus { padding: 8px 0; }
  input[type=text], input[type=password], input[type=number], input[type=email], input[type=url], input[type=date], select, textarea { min-height: 44px; }
  .container { padding: 22px 15px 50px; }
  .card { padding: 18px 16px; }
  .topbar-user { width: 100%; justify-content: space-between; }
}

/* =====================================================================
   Lembar Laporan Kinerja Harian (mengikuti format dokumen sekolah)
   ===================================================================== */
.lkh-sheet {
  background: #fff; color: #000;
  border: 1px solid rgba(79, 70, 229, .16); border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 22px 26px;
  max-width: 1000px; margin: 0 auto;
}

.kop-harian { display: flex; align-items: center; gap: 14px; }
.kop-harian img { width: 74px; height: 82px; object-fit: contain; flex: none; }
.kop-harian img.logo-kiri { order: 1; }
.kop-harian .kop-harian-teks { order: 2; }
.kop-harian img.logo-kanan { order: 3; }
.kop-logo-kosong { width: 74px; height: 82px; flex: none; }
.kop-harian-teks { flex: 1; text-align: center; line-height: 1.35; }
.kop-harian-teks .k1 { font-size: 13.5px; font-weight: 700; letter-spacing: .3px; }
.kop-harian-teks .k2 { font-size: 19.5px; font-weight: 700; letter-spacing: .4px; margin: 3px 0; }
.kop-harian-teks .k3 { font-size: 11.6px; }
.kop-harian + * { margin-top: 8px; }
.kop-harian { border-bottom: 2px solid #000; padding-bottom: 6px; }
.lkh-judul { text-align: center; font-size: 15.5px; font-weight: 700; letter-spacing: .3px; margin: 12px 0 0; text-decoration: underline; }
.lkh-periode { text-align: center; font-size: 12.4px; margin: 1px 0 6px; }
.lkh-kosong { border: 1px solid #000; padding: 14px; font-size: 12px; }

.identitas-harian { width: 100%; border-collapse: collapse; border: 1px solid #000; margin-bottom: 10px; }
.identitas-harian td { border: none; padding: 1px 6px; font-size: 11.6px; vertical-align: top; }
.identitas-harian td.lbl { width: 15%; font-weight: 700; white-space: nowrap; }
.identitas-harian td.val { width: 35%; padding-right: 14px; }

.tabel-harian { width: 100%; border-collapse: collapse; table-layout: fixed; }
/* Di layar: tabel lebar digulir di dalam wadahnya sendiri supaya halaman tidak melebar
   (penting untuk ponsel/Android). Saat dicetak, wadah dilepas agar tabel penuh halaman. */
.tabel-gulir { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tabel-gulir .tabel-harian { min-width: 720px; }
.tabel-harian th, .tabel-harian td {
  border: 1px solid #000; padding: 2px 4px; font-size: 8pt; line-height: 1.22;
  vertical-align: top; word-wrap: break-word; overflow-wrap: anywhere;
}
.tabel-harian thead th {
  background: #D9D9D9; color: #000; text-transform: none; letter-spacing: 0;
  font-size: 8.6pt; text-align: center; font-weight: 700; padding: 5px 4px; white-space: normal;
}
.tabel-harian td.j { text-align: justify; }
.tabel-harian .c-hari { width: 8.5%; text-align: center; }
.tabel-harian .c-jam { width: 4.6%; text-align: center; }
.tabel-harian .c-uraian { width: 13.5%; }
.tabel-harian .c-target { width: 18.5%; }
.tabel-harian .c-hasil { width: 18.5%; }
.tabel-harian .c-ketlibatan { width: 12.5%; }
.tabel-harian .c-catatan { width: 15.4%; }
.tabel-harian .c-dok { width: 8.5%; text-align: center; }
.hari-nomor { font-weight: 700; font-size: 9.6pt; }
.hari-tgl { font-size: 8.4pt; margin-top: 1px; }
.foto-dok { display: block; width: 100%; max-width: 100%; margin: 0 auto 3px; border: 1px solid #555; }

/* Tabel keterangan verifikasi per minggu (laporan bulanan tetap 1 lembar). */
.tabel-verif-minggu { table-layout: fixed; font-size: 11.6px; }
.tabel-verif-minggu th, .tabel-verif-minggu td { font-size: 11px; padding: 3px 6px; }
.tabel-verif-minggu td { word-wrap: break-word; overflow-wrap: anywhere; }
.tabel-gulir .tabel-verif-minggu { min-width: 640px; }

@media print {
  .ruang-stempel.ada-tanda { border-color: #2f4b9b; background: transparent; }
  .tabel-verif-minggu { font-size: 8.2pt; }
  .tabel-verif-minggu th, .tabel-verif-minggu td { font-size: 8pt; padding: 3px 4px; }
}

.ttd-harian { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; margin-top: 8px; text-align: center; }
.ttd-harian .ttd-kolom { font-size: 11.6px; line-height: 1.35; }
.ttd-harian .ttd-jab { font-weight: 700; }
/* Tinggi ruang tanda tangan: 3 cm (permintaan user terbaru).
   Kedua kolom memakai tinggi yang SAMA supaya nama Kepala Sekolah dan nama
   Guru/Tenaga Kependidikan tercetak lurus sebaris (lihat .ttd-ruang-baris). */
.ttd-harian .ruang { height: 3cm; display: flex; align-items: flex-end; justify-content: center; }

/* Ukuran gambar tanda tangan: lebar maksimal 5 cm, tinggi mengikuti gambar (maks 2,2 cm)
   sehingga selalu masuk pada ruang tanda tangan 3 cm. */
.ttd-harian .ttd-gambar,
.ttd-pengawas .ttd-gambar { max-width: 5cm; max-height: 2.2cm; object-fit: contain; }

/* Baris tempat tanda tangan: ruang stempel sekolah berada SEBARIS (menumpuk/berdekatan)
   dengan ruang tanda tangan, sehingga tinggi lembar laporan tidak bertambah. */
/* Baris ruang tanda tangan + stempel: tingginya 3 cm (sama untuk kedua kolom, jadi
   baris nama & NIP kedua kolom lurus). */
/* Aturan administrasi: stempel ditempatkan MENUMPUK tanda tangan (sepusat secara mendatar),
   sehingga tanda tangan tampak berada di dalam stempel seperti pada dokumen resmi.
   Nama & NIP dicetak tepat di bawah blok tanda tangan dengan jarak kecil. */
.ttd-ruang-baris { position: relative; display: flex; align-items: center; justify-content: center; height: 3cm; margin-bottom: 6px; }
.ttd-ruang-baris .ruang { height: 3cm; width: 100%; display: flex; align-items: center; justify-content: center;
  position: relative; z-index: 2; }   /* tanda tangan di atas stempel agar tetap terlihat */

/* Ruang stempel sekolah: 3 cm (mengikuti tinggi ruang tanda tangan supaya tidak meluber
   ke tulisan "Mengetahui,"/jabatan di atas maupun ke nama di bawah).
   - Bila gambar stempel sudah diunggah: gambar berwarna ditampilkan pada ukuran 3 cm.
   - Bila belum ada: penanda lingkaran putus-putus BERWARNA (biru tinta stempel) sebagai
     petunjuk tempat menempelkan stempel, atau ruang kosong bila mode "kosong". */
.ruang-stempel { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 3cm; height: 3cm; display: flex; align-items: center; justify-content: center; }
.ruang-stempel.ada-tanda {
  border-radius: 50%; border: 1.5px dashed #2f4b9b; background: rgba(47, 75, 155, .05);
}
.ruang-stempel .stempel-gambar { max-width: 3cm; max-height: 3cm; object-fit: contain; display: block; }
.ttd-harian .nama { font-weight: 700; text-decoration: underline; }
.ttd-harian .nip { font-size: 11.4px; }
.catatan-bawah { font-size: 10.4pt; margin: 8px 0 0; border-top: 1px solid #000; padding-top: 3px; }

/* Tanda tangan "Mengetahui" Pengawas Manajerial — baris terpisah di bawah blok tanda tangan
   Kepala Sekolah & Guru, dan berada di TENGAH halaman. Kemunculannya diatur pengaturan
   "Tampilkan tanda tangan pengawas" (selalu ada / hanya setelah diverifikasi). */
.ttd-pengawas { margin-top: 8px; text-align: center; }
.ttd-pengawas-kolom { font-size: 11.6px; line-height: 1.35; text-align: center; display: inline-block; min-width: 220px; }
.ttd-pengawas .ttd-jab { font-weight: 700; }
.ttd-pengawas .ruang { min-height: 2.4cm; display: flex; align-items: flex-end; justify-content: center; }
/* Gambar tanda tangan yang ditempel otomatis setelah verifikasi (maksimal 5 cm). */
.ttd-gambar { max-width: 5cm; max-height: 2.2cm; object-fit: contain; }
.ttd-pengawas .nama { font-weight: 700; text-decoration: underline; margin-top: 3px; }
.ttd-pengawas .nip { font-size: 11.4px; }

/* Di layar sempit, blok pengawas tetap di tengah. */
@media screen and (max-width: 760px) {
  .ttd-pengawas-kolom { min-width: 0; }
}

.no-print { }
.cetak-saja { display: none; }
.kop-cetak { display: none; }

/* Kop untuk cetakan rekap (tampil hanya saat dicetak) */
.kop { display: flex; align-items: center; gap: 18px; border-bottom: 3px double #111; padding-bottom: 12px; margin-bottom: 18px; }
.kop img { width: 78px; height: 78px; object-fit: contain; flex: none; }
.kop-teks { flex: 1; text-align: center; line-height: 1.4; }
.kop-teks .instansi { font-size: 12.6px; letter-spacing: .4px; text-transform: uppercase; }
.kop-teks .sekolah { font-size: 18px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; margin: 2px 0; }
.kop-teks .alamat { font-size: 11.6px; }

/* Catatan: ukuran kertas (@page) TIDAK diatur di sini, melainkan disisipkan per halaman
   lewat gaya_kertas() di lib/kertas.php, supaya pencetakan dapat memakai A4 atau F4. */
@media print {
  html, body { background: #fff !important; font-size: 10pt; }
  .bg-orb, .topbar, .footer, .no-print, .alert, .page-head { display: none !important; }
  .cetak-saja { display: block !important; }
  .kop-cetak { display: flex !important; }
  .container { max-width: none; padding: 0; margin: 0; }
  .card { background: none !important; border: none !important; box-shadow: none !important; padding: 0 !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
  .tile { box-shadow: none !important; background: #fff !important; border: 1px solid #999 !important; }
  .table-wrap { border: 1px solid #333 !important; background: #fff !important; overflow: visible; }
  thead th { background: #EFEFEF !important; color: #000 !important; }
  a { color: inherit; text-decoration: none; }
  .lkh-sheet { border: none !important; box-shadow: none !important; border-radius: 0; padding: 0; max-width: none; margin: 0; }
  .tabel-gulir { overflow: visible !important; }
  .tabel-gulir .tabel-harian { min-width: 0 !important; }
  .lkh-sheet + .lkh-sheet { page-break-before: always; }
  .tabel-harian tr, .tabel-harian thead { page-break-inside: avoid; }
  .ttd-harian, .catatan-bawah, .identitas-harian { page-break-inside: avoid; }
  .foto-dok { max-width: 100% !important; }
}

/* ==========================================================================
   PRESENSI & LOKASI (GPS)
   Ditambahkan pada aplikasi bertanda lokasi: presensi absen masuk/pulang,
   titik koordinat kegiatan, dan peta pantauan. Semua kelas di bawah ini tidak
   dipakai oleh lembar cetak kecuali .lokasi-cat (catatan lokasi pada tabel).
   ========================================================================== */
.brand-mark { font-size: 14px; }

.presensi-kotak { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.jam-besar { font-size: 30px; font-weight: 700; letter-spacing: -.5px; line-height: 1.1; }
.lokasi-kotak { border: 1px dashed rgba(0, 0, 0, .14); border-radius: 12px; padding: 12px 14px; background: #fff; }
.lokasi-baris { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.lokasi-baris .badge { margin: 0; }

.peta { width: 100%; height: 300px; border-radius: 14px; border: 1px solid rgba(0, 0, 0, .08); background: #e8edf5; }
.peta-besar { height: 440px; }
.peta-kecil { height: 200px; }
/* Peta pasif: hanya pratinjau, tidak menerima klik (dipakai di dalam formulir agar tidak
   menutupi tombol simpan / kolom isian di sekitarnya). */
.peta-pasif { pointer-events: none; }
.peta .leaflet-container { border-radius: 14px; }
.titik-peta { background: transparent; border: 0; }
.titik-jarum { display: block; width: 16px; height: 16px; border-radius: 50%; border: 3px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .35); }
.titik-jarum-sekolah { width: 18px; height: 18px; background: linear-gradient(135deg, var(--indigo), var(--violet)); }

.titik-warna { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 6px;
  vertical-align: middle; }
.w-sekolah { background: #059669; }
.w-luar { background: #D97706; }
.w-kosong { background: #9CA3AF; }
.legenda { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12.5px; color: var(--muted); }

.pantau-lengan { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; }
.daftar-pantau { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; max-height: 440px; overflow: auto; }
.daftar-pantau li { border: 1px solid rgba(0, 0, 0, .07); border-radius: 12px; padding: 10px 12px;
  background: rgba(255, 255, 255, .78); }
.daftar-pantau strong { display: block; font-size: 13.5px; }

/* Catatan lokasi pada tabel kegiatan (tampilan aplikasi & lembar cetak). */
.lokasi-cat { display: block; font-size: 7pt; color: #333; margin-top: 1px; }

@media (max-width: 1000px) {
  .pantau-lengan { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 620px) {
  .presensi-kotak { grid-template-columns: minmax(0, 1fr); }
}
@media screen and (max-width: 760px) {
  /* Peta di dalam lembar laporan tidak pernah dicetak; di ponsel cukup pendek. */
  .peta-kecil { height: 180px; }
}
@media print {
  .peta, .peta-besar, .peta-kecil, .legenda, .pantau-lengan { display: none !important; }
  .lokasi-cat { font-size: 6.4pt; }
}

/* ==========================================================================
   LAPORAN TUGAS TAMBAHAN
   Dipakai halaman tugas.php, verifikasi_tugas.php, tinjau_tugas.php,
   tugas_rekap.php, dan lembar cetak tugas_cetak.php.
   ========================================================================== */
.tabel-tugas-identitas { width: 100%; border-collapse: collapse; font-size: 12.6px; margin-bottom: 16px; }
.tabel-tugas-identitas td { border: 1px solid rgba(0, 0, 0, .12); padding: 6px 9px; vertical-align: top; }
.tabel-tugas-identitas td.lbl { width: 130px; background: rgba(79, 70, 229, .07); font-weight: 600; }

.tugas-isi { display: grid; gap: 12px; }
.tugas-bagian { border: 1px solid rgba(0, 0, 0, .09); border-radius: 12px; padding: 10px 14px; background: #fff; }
.tugas-label { font-size: 11.4px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; }
.tugas-nilai { font-size: 13.4px; margin-top: 5px; line-height: 1.5; }

.lampiran-daftar { display: grid; gap: 10px; margin-top: 8px; }
.lampiran-item { display: flex; gap: 12px; align-items: center; border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 10px; padding: 8px 10px; background: rgba(255, 255, 255, .75); }
.lampiran-gambar { width: 96px; height: 70px; object-fit: cover; border-radius: 8px; display: block; }
.lampiran-berkas { display: grid; place-items: center; width: 62px; height: 46px; border-radius: 8px;
  background: rgba(79, 70, 229, .12); color: var(--indigo); font-weight: 700; font-size: 11px; }
.lampiran-nama { font-size: 12.6px; word-break: break-all; }
.ringkas-verif-tugas { margin-top: 14px; border-top: 1px dashed rgba(0, 0, 0, .15); padding-top: 10px;
  font-size: 12.8px; display: grid; gap: 5px; }

/* Tabel isi laporan pada LEMBAR CETAK (bergaris seperti dokumen resmi). */
.tabel-tugas-cetak { width: 100%; border-collapse: collapse; table-layout: fixed; margin-top: 10px; }
.tabel-tugas-cetak th, .tabel-tugas-cetak td { border: 1px solid #000; padding: 4px 7px; font-size: 9.6pt;
  vertical-align: top; text-align: left; }
.tabel-tugas-cetak th { background: #EFEFEF; font-weight: 600; }
.tugas-identitas-cetak { font-size: 11.6px; }

@media (max-width: 620px) {
  .lampiran-item { align-items: flex-start; }
  .lampiran-gambar { width: 74px; height: 56px; }
}

@media print {
  .tabel-tugas-cetak { page-break-inside: auto; }
  .tabel-tugas-cetak tr { page-break-inside: avoid; }
  .tugas-isi { gap: 0; }
  .tugas-bagian { border: none; padding: 0; }
  .lampiran-daftar, .ringkas-verif-tugas { display: none !important; }
}

/* ==========================================================================
   INSTRUMEN PENILAIAN KINERJA ASN (untuk Dinas Pendidikan Provinsi)
   Lembar cetak mengikuti lampiran sekolah: 4 kolom, butir tidak berlaku abu-abu.
   ========================================================================== */
.ips-sheet { background: #fff; color: #000; padding: 14px 16px; border-radius: 12px;
  box-shadow: var(--shadow); border: 1px solid rgba(0, 0, 0, .08); }
.ips-kop { text-align: center; margin-bottom: 12px; }
.ips-kop-1 { font-weight: 700; font-size: 12.6px; letter-spacing: .2px; text-decoration: underline; }
/* Baris judul ke-3 juga bergaris bawah seperti pada lampiran sekolah; baris ke-2 tidak. */
.ips-kop-2 { font-weight: 700; font-size: 12.6px; }
.ips-kop-3 { font-weight: 700; font-size: 12.6px; margin-bottom: 4px; text-decoration: underline; }

.ips-identitas { border-collapse: collapse; margin-bottom: 10px; font-size: 11.6px; }
.ips-identitas td { padding: 1px 0; vertical-align: top; }
.ips-identitas td.lbl { width: 110px; }
.ips-identitas td.val { padding-left: 18px; }

.ips-tabel { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 9.4pt; }
.ips-tabel th, .ips-tabel td { border: 1px solid #000; padding: 3px 5px; vertical-align: top; }
.ips-tabel .c-no { width: 6%; text-align: center; }
.ips-tabel .c-komponen { width: 40%; text-align: left; }
.ips-tabel .c-capaian { width: 15%; text-align: center; }
.ips-tabel .c-deskripsi { width: 39%; text-align: left; }
.ips-tabel .ips-kepala th { background: #EFEFEF; font-weight: 700; text-align: center; vertical-align: middle; }
.ips-tabel .ips-nomor td { background: #EFEFEF; font-weight: 700; text-align: center; padding: 1px 5px; }
.ips-tabel .ips-kelompok td { background: #Fdf3c8; font-weight: 700; }
.ips-tabel .ips-kelompok .c-no { text-align: center; }
.ips-tabel .ips-butir td { font-weight: 400; }
/* Butir yang tidak berlaku bagi pegawai: latar abu-abu seperti pada contoh sekolah. */
.ips-tabel .ips-kosong td { background: #E3E3E3; }
.ips-tabel .ips-hasil td { background: #fff; font-weight: 700; }

.ips-catatan { font-size: 11px; color: #444; margin: 8px 0 0; }

/* Blok tanda tangan Pengawas Verifikator (bawaan) — rata kanan seperti contoh sekolah. */
.ips-ttd { margin-top: 18px; }
.ips-ttd-baris { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; text-align: center;
  font-size: 11.4px; margin-bottom: 14px; }
.ips-ttd-pengawas { text-align: center; font-size: 11.6px; line-height: 1.45; width: 100%; max-width: 340px;
  margin-left: auto; margin-right: 0; }
.ips-ttd-kolom { font-size: 11.4px; line-height: 1.45; }
.ips-ttd-jab { font-weight: 700; }
.ips-ttd-ruang { height: 2.4cm; display: flex; align-items: flex-end; justify-content: center; }
.ips-ttd-nama { font-weight: 700; text-decoration: underline; }
.ips-ttd-pangkat { font-size: 11.2px; }
.ips-ttd-nip { font-size: 11.2px; }

/* ---- Tampilan isian di aplikasi (guru & Kepala Sekolah) ---- */
.ips-grup { border: 1px solid rgba(0, 0, 0, .1); border-radius: 12px; padding: 10px 14px; margin-bottom: 14px;
  background: rgba(255, 255, 255, .72); }
.ips-grup-judul { font-weight: 700; display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 13.6px; }
.ips-grup-kode { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 8px;
  background: linear-gradient(135deg, var(--indigo), var(--violet)); color: #fff; font-size: 12px; flex: none; }
.ips-butir-baris { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 14px;
  border-top: 1px dotted rgba(0, 0, 0, .12); padding: 10px 0; }
.ips-butir-baris:first-of-type { border-top: none; }
.ips-butir-nama { font-size: 13px; }
.ips-butir-isian { display: grid; gap: 7px; }
.ips-butir-isian textarea { min-height: 58px; font-size: 13.4px; }
.ips-nilai-baris { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ips-skor { min-width: 200px; }
.ips-tidak-berlaku { background: rgba(0, 0, 0, .035); border-radius: 8px; padding-left: 8px; padding-right: 8px; }

@media (max-width: 900px) {
  .ips-butir-baris { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .ips-butir-baris.ips-tidak-berlaku { padding-left: 0; padding-right: 0; }
}
@media screen and (max-width: 760px) {
  .ips-sheet { padding: 12px 10px; }
  .ips-ttd-pengawas { margin-left: auto; margin-right: auto; }
  .ips-tabel { font-size: 8.6pt; }
}
@media print {
  .ips-sheet { padding: 0; border: none !important; box-shadow: none !important; border-radius: 0; }
  /* Setiap instrumen dimulai pada halaman baru (dipakai halaman cetak massal). */
  .pemisah-lembar { page-break-after: always; break-after: page; height: 0; }
  .ips-tabel { font-size: 8.4pt; }
  .ips-tabel th, .ips-tabel td { padding: 2px 4px; }
  .ips-tabel tr { page-break-inside: avoid; }
  .ips-tabel thead { display: table-header-group; }   /* kepala tabel terulang tiap halaman */
  .ips-kelompok td { background: #Fdf3c8 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .ips-tabel .ips-kosong td { background: #E3E3E3 !important; }
  .ips-tabel .ips-kepala th, .ips-tabel .ips-nomor td { background: #EFEFEF !important; }
  .ips-ttd { page-break-inside: avoid; }
  .ips-ttd-pengawas { margin-right: 0; }
}

/* ==========================================================================
   ABSENSI KEHADIRAN SISWA — kios (wajah + kartu QR) & halaman orang tua
   ========================================================================== */
.kios { display: grid; gap: 18px; }
.kios-kepala { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  background: linear-gradient(135deg, var(--indigo), var(--violet)); color: #fff;
  border-radius: 16px; padding: 14px 20px; }
.kios-sekolah { font-size: 13px; letter-spacing: .4px; text-transform: uppercase; opacity: .92; }
.kios-judul { font-size: 22px; font-weight: 700; letter-spacing: .3px; }
.kios-jenis { display: inline-block; margin-left: 8px; padding: 3px 10px; border-radius: 10px;
  background: rgba(255, 255, 255, .22); font-size: 13px; vertical-align: middle; }
.kios-jam { font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; }

.kios-panggung { position: relative; border-radius: 18px; overflow: hidden; background: #0f172a;
  aspect-ratio: 16 / 10; max-height: 62vh; }
.kios-video { width: 100%; height: 100%; object-fit: cover; display: block; }
.kios-kotak { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.kios-hasil { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%);
  min-width: min(560px, 92%); padding: 14px 20px; border-radius: 14px; text-align: center;
  background: rgba(15, 23, 42, .88); color: #fff; backdrop-filter: blur(6px); }
.kios-hasil-judul { font-size: 22px; font-weight: 700; line-height: 1.25; }
.kios-nama { font-size: 30px; }
.kios-hasil-baris { font-size: 16px; margin-top: 4px; }
.kios-hasil-petunjuk { font-size: 13px; margin-top: 6px; opacity: .88; }
.kios-siaga { background: rgba(15, 23, 42, .72); }
.kios-hijau { background: linear-gradient(135deg, rgba(5, 150, 105, .95), rgba(16, 185, 129, .95)); }
.kios-kuning { background: linear-gradient(135deg, rgba(180, 83, 9, .95), rgba(217, 119, 6, .95)); }
.kios-merah { background: linear-gradient(135deg, rgba(153, 27, 27, .95), rgba(220, 38, 38, .95)); }

.kios-bawah { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.kios-kartu input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.kios-statistik { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kios-statistik .tile { padding: 10px 12px; }
.kios-statistik .tile-value { font-size: 22px; }
.kios-tombol { display: flex; gap: 10px; flex-wrap: wrap; }
@media (max-width: 900px) {
  .kios-bawah { grid-template-columns: minmax(0, 1fr); }
  .kios-jam { font-size: 24px; }
  .kios-nama { font-size: 24px; }
}

/* Halaman orang tua/wali */
.wali-anak { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.wali-kartu { border: 1px solid rgba(0, 0, 0, .08); border-radius: 14px; padding: 14px 16px; background: #fff; }
.wali-nama { font-size: 16px; font-weight: 700; }
.wali-status-hari { display: flex; align-items: center; gap: 10px; margin: 8px 0; flex-wrap: wrap; }
.wali-status-besar { font-size: 20px; font-weight: 700; }
.kartu-qr { display: inline-block; padding: 12px; background: #fff; border: 1px solid #000; border-radius: 10px; }
.kartu-qr canvas, .kartu-qr img { display: block; }
.kartu-daftar { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); }
.kartu-siswa { border: 2px solid #111; border-radius: 12px; padding: 14px 16px; background: #fff;
  display: grid; gap: 10px; grid-template-columns: 150px minmax(0, 1fr); align-items: center; }
.kartu-siswa .kartu-info { line-height: 1.5; }
.kartu-siswa .kartu-sekolah { font-size: 11.5px; text-transform: uppercase; letter-spacing: .3px; }
.kartu-siswa .kartu-nama { font-size: 17px; font-weight: 700; }
.potret-wajah { width: 84px; height: 84px; object-fit: cover; border-radius: 12px; border: 1px solid rgba(0,0,0,.1); }
.pose-wajah { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.pose-kotak { border: 1px solid rgba(0, 0, 0, .1); border-radius: 14px; padding: 12px; background: #fff; text-align: center; }
.pose-kotak video, .pose-kotak canvas { width: 100%; border-radius: 10px; background: #0f172a; aspect-ratio: 4 / 3; object-fit: cover; }
.pose-kotak.selesai { border-color: #059669; box-shadow: 0 0 0 3px rgba(5, 150, 105, .12); }

@media print {
  .kios, .no-print { display: none !important; }
  .kartu-siswa { page-break-inside: avoid; border-color: #000; }
  .kartu-daftar { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
}
