/* ============================================================
   style.css — AfterSchola v1.7 (Logo Text Fix + Anti-Zoom PDF)
   ============================================================ */

:root {
  --navy:   #1A3260;
  --navy2:  #223f78;
  --gold:   #C9A84C;
  --gold2:  #dfc06a;
  --cream:  #F0EAD6;
  --cream2: #faf7f0;
  --white:  #fff;
  --red:    #e05252;
  --green:  #3cba78;
  --gray:   #6b7280;
  --bg:     #f7f5f0;
  --sh:     0 6px 28px rgba(26,50,96,.13);
  --sh2:    0 2px 10px rgba(26,50,96,.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Nunito', sans-serif;
  background: var(--bg);
  color: var(--navy);
  min-height: 100vh;
  overflow-x: hidden;
  /* FIX: cegah zoom body secara keseluruhan */
  touch-action: pan-x pan-y;
}

/* ── Screens ─────────────────────────────────────────────── */
.screen { display: none; min-height: 100vh; flex-direction: column; }
.screen.active { display: flex; }

/* ── Top bar ─────────────────────────────────────────────── */
.topbar {
  background: var(--navy);
  height: 56px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 2px 16px rgba(0,0,0,.18);
  gap: 8px;
  min-width: 0;
}
.t-logo { font-family: 'Baloo 2', cursive; font-size: 20px; font-weight: 900; color: var(--white); white-space: nowrap; flex-shrink: 0; }
.t-logo span { color: var(--gold); }
.t-right { display: flex; align-items: center; gap: 6px; min-width: 0; flex-shrink: 1; overflow: hidden; }
.t-name  { font-size: 12px; font-weight: 700; color: var(--cream); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100px; flex-shrink: 1; }
.t-badge {
  background: rgba(201,168,76,.2);
  color: var(--gold);
  border: 1px solid rgba(201,168,76,.4);
  border-radius: 20px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
  flex-shrink: 0;
}
.t-av {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; color: var(--navy); font-size: 15px;
  border: 2px solid rgba(255,255,255,.25);
  flex-shrink: 0;
}
.btn-out {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  color: var(--cream);
  padding: 6px 10px;
  border-radius: 9px;
  font-family: 'Nunito', sans-serif;
  font-size: 11px; font-weight: 700;
  cursor: pointer; transition: .2s;
  white-space: nowrap;
  flex-shrink: 0;
}
.btn-out:hover { background: rgba(224,82,82,.35); }

/* ── Logo img ────────────────────────────────────────────── */
.as-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
  gap: 0;
  max-width: 60%;
  min-width: 0;
}
.as-logo-icon {
  height: 36px;
  width: auto;
  object-fit: contain;
  vertical-align: middle;
  filter: drop-shadow(-0.8px 0 0 white) drop-shadow(0.8px 0 0 white)
          drop-shadow(0 -0.8px 0 white) drop-shadow(0 0.8px 0 white);
  flex-shrink: 0;
  min-width: 0;
}
.as-logo-text {
  height: 20px;
  width: auto;
  object-fit: contain;
  vertical-align: middle;
  filter: drop-shadow(-0.8px 0 0 white) drop-shadow(0.8px 0 0 white)
          drop-shadow(0 -0.8px 0 white) drop-shadow(0 0.8px 0 white);
  margin-left: 10px;
  flex-shrink: 0;
  /* FIX: pastikan teks logo selalu tampil, tidak pernah display:none */
  display: inline-block !important;
}
.land-top .as-logo-icon { height: 44px; }
.land-top .as-logo-text { height: 24px; }
.land-top-fallback {
  font-family: 'Baloo 2', cursive;
  font-size: 24px;
  font-weight: 900;
  color: var(--white);
  letter-spacing: -0.5px;
}
.land-top-fallback span { color: var(--gold); }
.logo-fb-txt {
  font-family: 'Baloo 2', cursive !important;
  font-size: 18px !important;
  font-weight: 900 !important;
  color: #fff !important;
  white-space: nowrap;
}
.as-logo-admin {
  font-size: 12px; font-weight: 900; color: #C9A84C;
  border: 1.5px solid rgba(201,168,76,.4);
  border-radius: 6px; padding: 2px 7px;
  margin-left: 8px; align-self: center;
  white-space: nowrap; flex-shrink: 0;
}

/* ── Alert ───────────────────────────────────────────────── */
.alert {
  position: fixed; top: 66px; right: 16px;
  background: var(--white);
  border-radius: 14px;
  padding: 12px 16px;
  box-shadow: var(--sh);
  border-left: 4px solid var(--gold);
  font-weight: 700; font-size: 13px;
  max-width: 320px;
  width: calc(100% - 32px);
  z-index: 9999;
  display: none;
  animation: slideIn .3s ease;
}
.alert.err { border-color: var(--red); }
.alert.ok  { border-color: var(--green); }
@keyframes slideIn { from { opacity:0; transform:translateX(60px) } to { opacity:1; transform:translateX(0) } }

/* ── Main content ────────────────────────────────────────── */
.main { flex: 1; padding: 20px 16px; max-width: 1060px; margin: 0 auto; width: 100%; }

/* ── Landing ─────────────────────────────────────────────── */
#sc-land { background: var(--white); }
.land-top {
  background: var(--navy); height: 56px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 16px;
  flex-shrink: 0;
}
.land-hero {
  flex: 1;
  padding: 48px 20px 48px;
  text-align: center;
  position: relative; overflow: hidden;
  background: linear-gradient(160deg, var(--cream2) 0%, var(--white) 55%, #e6eeff 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.land-hero::before {
  content: '';
  position: absolute;
  width: 280px; height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201,168,76,.13), transparent 70%);
  top: -80px; right: -80px;
  pointer-events: none;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(201,168,76,.14);
  border: 1.5px solid rgba(201,168,76,.35);
  border-radius: 20px;
  padding: 5px 16px;
  font-size: 11px; font-weight: 800; color: var(--navy);
  margin-bottom: 16px;
}
.hero-ilu {
  font-size: 64px; margin-bottom: 12px; display: block;
  animation: bob 3s ease-in-out infinite;
}
@keyframes bob { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-12px)} }
.hero-h { font-family: 'Baloo 2', cursive; font-size: 36px; font-weight: 900; color: var(--navy); line-height: 1.15; margin-bottom: 8px; }
.hero-h span { color: var(--gold); }
.hero-p { color: var(--gray); font-size: 14px; font-weight: 600; max-width: 380px; margin: 0 auto 28px; }
.lvl-lbl { font-family: 'Baloo 2', cursive; font-size: 18px; font-weight: 800; color: var(--navy); margin-bottom: 14px; }
.levels { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.lvl-card {
  background: var(--white);
  border: 2.5px solid #e5e5e5;
  border-radius: 18px;
  padding: 20px 24px;
  cursor: pointer;
  transition: all .28s cubic-bezier(.34,1.56,.64,1);
  text-align: center; min-width: 110px;
  box-shadow: var(--sh2);
}
.lvl-card:hover, .lvl-card.sel {
  border-color: var(--gold);
  box-shadow: 0 10px 32px rgba(201,168,76,.24);
  transform: translateY(-6px) scale(1.05);
}
.lvl-ic  { font-size: 38px; margin-bottom: 6px; }
.lvl-n   { font-family: 'Baloo 2', cursive; font-size: 22px; font-weight: 900; color: var(--navy); }
.lvl-d   { font-size: 10px; color: var(--gray); font-weight: 600; margin-top: 3px; }

/* ── Page header ─────────────────────────────────────────── */
.ph {
  background: var(--white);
  border-bottom: 2px solid var(--cream);
  padding: 14px 16px;
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap;
}
.back-btn {
  background: var(--cream2); border: 2px solid #ddd; color: var(--navy);
  border-radius: 12px; padding: 7px 14px;
  font-family: 'Nunito', sans-serif; font-size: 13px; font-weight: 800;
  cursor: pointer; transition: .2s; flex-shrink: 0;
  position: relative;
  z-index: 1;
  -webkit-tap-highlight-color: rgba(201,168,76,.2);
  touch-action: manipulation;
}
.back-btn:hover { background: var(--gold); border-color: var(--gold); color: var(--white); }
.ph-ti { font-family: 'Baloo 2', cursive; font-size: 20px; font-weight: 900; color: var(--navy); }
.ph-ti span { color: var(--gold); }

/* ── Search bar ──────────────────────────────────────────── */
.search-bar {
  display: flex; align-items: center; gap: 10px;
  background: var(--white);
  border-radius: 14px; padding: 12px 16px;
  border: 2px solid #e8e8e8; margin-bottom: 18px;
  box-shadow: var(--sh2);
}
.search-bar input {
  border: none; outline: none; flex: 1;
  font-family: 'Nunito', sans-serif; font-size: 14px; font-weight: 600;
  color: var(--navy); background: transparent;
}

/* ── School grid ─────────────────────────────────────────── */
.sch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px,1fr)); gap: 12px; }
.sch-card {
  background: var(--white);
  border-radius: 16px; padding: 12px 14px;
  border: 2.5px solid transparent;
  cursor: pointer; box-shadow: var(--sh2);
  transition: all .25s cubic-bezier(.34,1.56,.64,1);
  display: flex; align-items: center; gap: 10px;
  min-width: 0;
  width: 100%;
  overflow: hidden;
}
.sch-card:hover, .sch-card.sel {
  border-color: var(--gold);
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(201,168,76,.22);
}
.sch-ico {
  width: 46px; height: 46px; border-radius: 12px;
  background: linear-gradient(135deg, var(--navy), var(--navy2));
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.sch-card.sel .sch-ico { background: linear-gradient(135deg, var(--gold), var(--gold2)); }
.sch-info { flex: 1; min-width: 0; overflow: hidden; }
.sch-info h4 {
  font-size: 13px; font-weight: 800; color: var(--navy); margin-bottom: 2px;
  white-space: normal;
  word-break: break-word;
  line-height: 1.3;
}
.sch-info p  { font-size: 11px; color: var(--gray); font-weight: 600; }
.sch-code {
  background: var(--navy); color: var(--cream);
  padding: 3px 7px; border-radius: 7px;
  font-size: 10px; font-weight: 800;
  font-family: monospace; letter-spacing: 1px;
  flex-shrink: 0;
  white-space: nowrap;
}
.sch-card.sel .sch-code { background: var(--gold); color: var(--navy); }

.next-btn {
  display: block; width: 100%; padding: 14px; margin-top: 18px;
  background: linear-gradient(135deg, var(--navy), var(--navy2));
  color: var(--white); border: none; border-radius: 14px;
  font-family: 'Nunito', sans-serif; font-size: 15px; font-weight: 900;
  cursor: pointer; transition: .2s;
  box-shadow: 0 4px 16px rgba(26,50,96,.28);
  touch-action: manipulation;
}
.next-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 26px rgba(26,50,96,.38); }

/* ── Login ───────────────────────────────────────────────── */
#sc-login, #sc-admin-login { background: var(--bg); }
.lw { max-width: 480px; margin: 0 auto; padding: 24px 16px; }
.lcard { background: var(--white); border-radius: 24px; padding: 28px 24px; box-shadow: var(--sh); }
.lc-top  { text-align: center; margin-bottom: 18px; }
.lc-em   { font-size: 48px; margin-bottom: 8px; }
.lc-ti   { font-family: 'Baloo 2', cursive; font-size: 22px; font-weight: 900; color: var(--navy); }
.lc-su   { font-size: 13px; color: var(--gray); margin-top: 4px; font-weight: 600; }
.sch-pill {
  display: flex; align-items: center; gap: 8px;
  background: var(--cream2); border: 1.5px solid var(--cream);
  border-radius: 13px; padding: 10px 14px;
  font-size: 13px; font-weight: 700; color: var(--navy); margin-bottom: 18px;
}
.role-tgl { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 18px; }
.role-btn {
  padding: 12px 8px; border-radius: 13px; border: 2.5px solid #e8e8e8;
  background: #fafafa; cursor: pointer; text-align: center;
  font-family: 'Nunito', sans-serif; font-size: 13px; font-weight: 800; color: var(--gray);
  transition: .2s;
  touch-action: manipulation;
}
.role-btn .rbi { font-size: 26px; display: block; margin-bottom: 5px; }
.role-btn.on   { background: var(--navy); color: var(--white); border-color: var(--navy); }
.fl { margin-bottom: 14px; }
.fl label { font-size: 11px; font-weight: 900; color: var(--navy); display: block; margin-bottom: 6px; text-transform: uppercase; letter-spacing: .3px; }
.fi {
  width: 100%; padding: 12px 14px;
  border: 2.5px solid #e8e8e8; border-radius: 12px;
  font-family: 'Nunito', sans-serif; font-size: 14px; font-weight: 600; color: var(--navy);
  background: #fafafa; outline: none; transition: .2s; appearance: none;
}
.fi:focus { border-color: var(--gold); background: var(--white); box-shadow: 0 0 0 3px rgba(201,168,76,.14); }
.sw { position: relative; }
.sw::after { content: '▾'; position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--navy); font-size: 16px; pointer-events: none; }
.go-btn {
  width: 100%; padding: 14px; margin-top: 6px;
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  color: var(--navy); border: none; border-radius: 13px;
  font-family: 'Nunito', sans-serif; font-size: 15px; font-weight: 900;
  cursor: pointer; transition: .2s;
  box-shadow: 0 4px 14px rgba(201,168,76,.35);
  touch-action: manipulation;
}
.go-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(201,168,76,.45); }

/* ── Welcome banner ──────────────────────────────────────── */
.wban {
  background: linear-gradient(135deg, var(--navy), var(--navy2));
  border-radius: 20px; padding: 20px 22px;
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; overflow: hidden; position: relative; gap: 10px;
}
.wban::after {
  content: ''; position: absolute; right: -50px; top: -50px;
  width: 160px; height: 160px; border-radius: 50%;
  background: rgba(201,168,76,.1);
  pointer-events: none;
}
.wt h2 { font-family: 'Baloo 2', cursive; font-size: 20px; font-weight: 900; color: var(--white); }
.wt h2 em { color: var(--gold); font-style: normal; }
.wt p  { color: var(--cream); font-size: 12px; margin-top: 3px; opacity: .85; }
.wtrn {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(201,168,76,.18); border: 1px solid rgba(201,168,76,.35);
  border-radius: 9px; padding: 4px 10px;
  color: var(--gold); font-size: 11px; font-weight: 800; margin-top: 8px;
}
.wem { font-size: 48px; flex-shrink: 0; position: relative; z-index: 2; }

/* ── Section title ───────────────────────────────────────── */
.sec-ti { font-family: 'Baloo 2', cursive; font-size: 17px; font-weight: 900; color: var(--navy); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }

/* ── Subject/module grid ─────────────────────────────────── */
.sg {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.sc {
  background: var(--white); border-radius: 18px; padding: 20px 18px;
  border: 2.5px solid transparent;
  cursor: pointer; box-shadow: var(--sh2);
  transition: all .25s cubic-bezier(.34,1.56,.64,1);
  position: relative; overflow: hidden;
  min-height: 160px;
  display: flex; flex-direction: column;
  touch-action: manipulation;
}
.sc:hover:not(.locked) { border-color: var(--gold); transform: translateY(-5px); box-shadow: var(--sh); }
.sc.locked { opacity: .62; cursor: default; }
.si { font-size: 44px; margin-bottom: 10px; }
.sn { font-family: 'Baloo 2', cursive; font-size: 18px; font-weight: 800; color: var(--navy); }
.sd { font-size: 12px; color: var(--gray); margin-top: 4px; line-height: 1.4; flex: 1; }
.stag { display: inline-flex; align-items: center; gap: 4px; padding: 4px 12px; border-radius: 20px; font-size: 11px; font-weight: 800; margin-top: 10px; align-self: flex-start; }
.tok  { background: rgba(60,186,120,.12); color: var(--green); }
.tlk  { background: rgba(224,82,82,.1);   color: var(--red); }
.lock-ov { position: absolute; top: 10px; right: 10px; background: rgba(224,82,82,.1); border-radius: 8px; padding: 3px 7px; font-size: 13px; }
.lmsg { font-size: 11px; color: var(--red); margin-top: 6px; line-height: 1.4; }

/* ── Semester tabs ───────────────────────────────────────── */
.sem-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.sem-btn {
  padding: 9px 20px; border-radius: 11px; border: 2.5px solid #e8e8e8;
  background: var(--white); cursor: pointer;
  font-family: 'Nunito', sans-serif; font-size: 13px; font-weight: 800; color: var(--gray);
  transition: .2s; flex: 1; text-align: center;
  touch-action: manipulation;
}
.sem-btn.on { background: var(--navy); color: var(--white); border-color: var(--navy); }

/* ── Module list ─────────────────────────────────────────── */
.ml { display: flex; flex-direction: column; gap: 10px; }
.mi {
  background: var(--white); border-radius: 14px; padding: 14px 16px;
  display: flex; align-items: flex-start; gap: 12px;
  border: 2.5px solid transparent; box-shadow: var(--sh2); transition: .2s;
  flex-wrap: wrap;
}
.mi.clickable { cursor: pointer; }
.mi.clickable:hover { border-color: var(--gold); transform: translateX(4px); }
.mi.closed { opacity: .55; cursor: default; }
.mn {
  width: 42px; height: 42px; border-radius: 11px;
  background: linear-gradient(135deg, var(--navy), var(--navy2));
  display: flex; align-items: center; justify-content: center;
  color: var(--white); font-weight: 900; font-size: 14px; flex-shrink: 0;
}
.mi-info { flex: 1; min-width: 0; }
.mi-info h4 { font-size: 14px; font-weight: 800; color: var(--navy); word-break: break-word; }
.mi-info p  { font-size: 11px; color: var(--gray); margin-top: 2px; }
.mi-r { margin-left: auto; display: flex; gap: 6px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.btn-read {
  background: var(--navy); color: var(--white); border: none;
  padding: 8px 14px; border-radius: 9px;
  font-family: 'Nunito', sans-serif; font-size: 12px; font-weight: 800;
  cursor: pointer; transition: .2s; white-space: nowrap;
  min-height: 36px;
  position: relative;
  z-index: 1;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(26,50,96,.2);
}
.btn-read:hover { background: var(--navy2); }
.btog {
  padding: 7px 12px; border-radius: 9px; font-family: 'Nunito', sans-serif; font-size: 12px; font-weight: 800; border: 2px solid; cursor: pointer; transition: .2s; white-space: nowrap;
  min-height: 36px;
  position: relative;
  z-index: 1;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.t-open  { background: rgba(60,186,120,.1);  color: var(--green); border-color: var(--green); }
.t-close { background: rgba(224,82,82,.1);   color: var(--red);   border-color: var(--red); }
.btn-del {
  background: rgba(224,82,82,.1); color: var(--red);
  border: 2px solid var(--red); padding: 7px 12px; border-radius: 9px;
  font-family: 'Nunito', sans-serif; font-size: 12px; font-weight: 800;
  cursor: pointer; transition: .2s; white-space: nowrap;
  min-height: 36px;
  position: relative;
  z-index: 1;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(224,82,82,.15);
}
.btn-del:hover { background: var(--red); color: var(--white); }

/* ── PDF viewer ──────────────────────────────────────────── */
.pdf-shell  { background: var(--white); border-radius: 18px; overflow: hidden; box-shadow: var(--sh); }
.pdf-bar    { background: var(--navy); padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pdf-bar-ti { color: var(--white); font-weight: 800; font-size: 13px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pdf-prot   { color: var(--gold); font-size: 11px; font-weight: 700; white-space: nowrap; flex-shrink: 0; }
.pdf-wrap   { position: relative; user-select: none; -webkit-user-select: none; }

/* FIX UTAMA: PDF viewer tidak bisa di-zoom/pinch */
#s-pv {
  position: relative;
  background: #525659;
  user-select: none;
  -webkit-user-select: none;
  /* Hanya izinkan scroll vertikal, blokir pinch zoom */
  touch-action: pan-y !important;
  overflow: hidden;
}

.pdf-frame  { width: 100%; height: 70vh; min-height: 320px; max-height: 700px; border: none; display: block; }
.pdf-empty  { background: #eceae5; height: 280px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--gray); }
.pdf-empty span { font-size: 50px; }
.pdf-empty p { font-weight: 700; font-size: 14px; }
.pdf-note   { background: rgba(26,50,96,.04); border-top: 1.5px solid rgba(201,168,76,.2); padding: 8px 16px; font-size: 12px; color: var(--navy); font-weight: 700; }

/* ── PDF Nav bar ─────────────────────────────────────────── */
#pdf-nav-bar {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; padding: 10px 16px;
  background: #323639;
}
#pdf-nav-bar button {
  background: rgba(255,255,255,.2); color: #fff; border: none;
  border-radius: 8px; padding: 7px 16px; cursor: pointer; font-weight: 700;
  font-family: 'Nunito', sans-serif; font-size: 13px;
  min-height: 40px;
  touch-action: manipulation;
}
#pdf-info {
  color: #ccc; font-size: 13px; font-weight: 600;
  min-width: 90px; text-align: center;
}

/* ── Upload area ─────────────────────────────────────────── */
.upload-area {
  border: 2.5px dashed var(--gold); border-radius: 14px; padding: 28px 16px;
  text-align: center; cursor: pointer; transition: .2s;
  background: rgba(201,168,76,.04); position: relative;
}
.upload-area:hover, .upload-area.drag { background: rgba(201,168,76,.1); border-style: solid; }
.upload-area input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.ua-ic { font-size: 38px; margin-bottom: 8px; }
.ua-ti { font-size: 14px; font-weight: 800; color: var(--navy); }
.ua-su { font-size: 12px; color: var(--gray); margin-top: 4px; }
.pdf-fname { background: rgba(26,50,96,.08); border-radius: 9px; padding: 7px 12px; font-size: 13px; font-weight: 700; color: var(--navy); margin-top: 10px; display: flex; align-items: center; gap: 6px; word-break: break-all; }

/* TABLE */
.tbl {
  background: var(--white);
  border-radius: 16px;
  box-shadow: var(--sh2);
  overflow: hidden;
}
.tbl-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.th {
  background: var(--navy);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  left: 0;
  width: 100%;
  z-index: 3;
}
.th h3 { color: var(--white); font-size: 14px; font-weight: 800; }
.btn-add {
  background: var(--gold); color: var(--navy); border: none;
  padding: 7px 16px; border-radius: 9px;
  font-family: 'Nunito', sans-serif; font-size: 13px; font-weight: 900;
  cursor: pointer; transition: .2s; white-space: nowrap;
  min-height: 36px;
  position: relative;
  z-index: 1;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(201,168,76,.2);
}
.btn-add:hover { background: var(--gold2); transform: translateY(-1px); }
table  { width: 100%; border-collapse: collapse; min-width: 400px; }
th     { padding: 10px 14px; text-align: left; font-size: 10px; font-weight: 900; color: var(--gray); text-transform: uppercase; letter-spacing: .5px; border-bottom: 1px solid #f0f0f0; white-space: nowrap; }
td     { padding: 12px 14px; font-size: 13px; color: var(--navy); border-bottom: 1px solid #f9f9f9; font-weight: 600; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(201,168,76,.04); }
.cpill { background: var(--navy); color: var(--cream); padding: 3px 9px; border-radius: 7px; font-size: 11px; font-weight: 700; font-family: monospace; letter-spacing: 1px; }
.acts  { display: flex; gap: 5px; flex-wrap: nowrap; align-items: center; }

.be, .bd {
  padding: 6px 12px;
  border-radius: 7px;
  cursor: pointer;
  font-family: 'Nunito', sans-serif;
  font-size: 11px;
  font-weight: 800;
  border: none;
  transition: .2s;
  white-space: nowrap;
  min-height: 36px;
  min-width: 52px;
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(26,50,96,.15);
  user-select: none;
  -webkit-user-select: none;
}
.be { background: rgba(26,50,96,.09); color: var(--navy); }
.be:hover { background: var(--navy); color: var(--white); }
.bd { background: rgba(224,82,82,.1); color: var(--red); -webkit-tap-highlight-color: rgba(224,82,82,.15); }
.bd:hover { background: var(--red); color: var(--white); }

/* ── Stats ───────────────────────────────────────────────── */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px,1fr)); gap: 10px; margin-bottom: 18px; }
.stat  { background: var(--white); border-radius: 14px; padding: 16px; text-align: center; box-shadow: var(--sh2); }
.si2   { font-size: 26px; margin-bottom: 5px; }
.stat .sn { font-family: 'Baloo 2', cursive; font-size: 28px; font-weight: 900; color: var(--navy); }
.sl    { font-size: 11px; color: var(--gray); font-weight: 700; }

/* ── Admin / nav tabs ────────────────────────────────────── */
.atabs, .snav { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.atab, .snb {
  padding: 8px 14px; border-radius: 10px; border: 2px solid #e8e8e8;
  background: var(--white); cursor: pointer;
  font-family: 'Nunito', sans-serif; font-size: 12px; font-weight: 800; color: var(--gray);
  transition: .2s; white-space: nowrap;
  touch-action: manipulation;
}
.atab.on, .snb.on { background: var(--navy); color: var(--white); border-color: var(--navy); }

/* ── Misc layout helpers ─────────────────────────────────── */
.mh { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.mh-ti { font-family: 'Baloo 2', cursive; font-size: 16px; font-weight: 900; color: var(--navy); margin: 0; }
.chk-list { display: flex; flex-direction: column; gap: 7px; margin-top: 4px; }
.chk-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 11px;
  background: #fafafa; border: 2px solid #f0f0f0;
  cursor: pointer; font-size: 13px; font-weight: 700; color: var(--navy);
  transition: .15s;
  touch-action: manipulation;
}
.chk-item:hover { border-color: var(--gold); background: rgba(201,168,76,.06); }
.chk-item input[type=checkbox],
.chk-item input[type=radio] { width: 17px; height: 17px; accent-color: var(--navy); cursor: pointer; flex-shrink: 0; }

/* ── Modal ───────────────────────────────────────────────── */
.mov {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.42); backdrop-filter: blur(4px);
  display: none; align-items: flex-start; justify-content: center;
  z-index: 1000; padding: 16px;
  overflow-y: auto;
}
.mbox {
  background: var(--white); border-radius: 22px; padding: 24px 20px;
  width: 100%; max-width: 500px;
  box-shadow: 0 24px 64px rgba(0,0,0,.28);
  animation: popUp .3s cubic-bezier(.34,1.56,.64,1);
  max-height: calc(90vh - env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  margin: auto;
  position: relative;
  z-index: 1001;
}
@keyframes popUp { from{transform:translateY(40px);opacity:0} to{transform:translateY(0);opacity:1} }
.mbox h3 { font-family: 'Baloo 2', cursive; font-size: 19px; font-weight: 900; color: var(--navy); margin-bottom: 16px; }
.fg { margin-bottom: 13px; }
.fg label { font-size: 11px; font-weight: 900; color: var(--navy); display: block; margin-bottom: 6px; text-transform: uppercase; letter-spacing: .3px; }
.macts { display: flex; gap: 8px; margin-top: 16px; }
.btn-cancel {
  flex: 1; padding: 11px; border-radius: 11px; border: 2px solid #e8e8e8;
  background: none; font-family: 'Nunito', sans-serif; font-size: 14px; font-weight: 800; color: var(--gray);
  cursor: pointer;
  min-height: 44px;
  touch-action: manipulation;
}
.btn-save {
  flex: 2; padding: 11px; border-radius: 11px;
  background: var(--navy); color: var(--white); border: none;
  font-family: 'Nunito', sans-serif; font-size: 14px; font-weight: 900;
  cursor: pointer; transition: .2s;
  min-height: 44px;
  touch-action: manipulation;
}
.btn-save:hover { background: var(--navy2); }

/* ── Spinner ─────────────────────────────────────────────── */
.spinner {
  display: inline-block; width: 16px; height: 16px;
  border: 3px solid rgba(255,255,255,.3); border-top-color: #fff;
  border-radius: 50%; animation: spin .7s linear infinite;
  vertical-align: middle; margin-right: 6px;
}
@keyframes spin { to{transform:rotate(360deg)} }

/* ── Meeting cards ───────────────────────────────────────── */
.meet-card {
  background: var(--white);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 2.5px solid transparent;
  box-shadow: var(--sh2);
  cursor: pointer;
  transition: all .25s cubic-bezier(.34,1.56,.64,1);
  margin-bottom: 8px;
  touch-action: manipulation;
  position: relative;
  z-index: 0;
}
.meet-card:hover {
  border-color: var(--gold);
  transform: translateX(5px);
  box-shadow: 0 8px 24px rgba(201,168,76,.2);
}
.meet-card.meet-closed { opacity: .55; cursor: default; }
.meet-num {
  width: 48px; height: 48px;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--navy), var(--navy2));
  display: flex; align-items: center; justify-content: center;
  color: var(--white); font-weight: 900; font-size: 13px;
  flex-shrink: 0;
}
.meet-info { flex: 1; min-width: 0; }
.meet-info h4 { font-size: 14px; font-weight: 800; color: var(--navy); }
.meet-info p  { font-size: 12px; color: var(--gray); margin-top: 2px; font-weight: 600; }
.meet-arr { font-size: 18px; color: var(--gold); font-weight: 900; flex-shrink: 0; }

/* ── PDF.js canvas viewer ─────────────────────────────────── */
#pdf-canvas, #pdf-canvas-t {
  display: block;
  width: 100%;
  background: #525659;
  user-select: none;
  -webkit-user-select: none;
  /* FIX: canvas juga tidak boleh di-pinch zoom */
  touch-action: pan-y !important;
}

/* ── Mapel cards ─────────────────────────────────────────── */
.mapel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.mapel-card {
  background: var(--white);
  border-radius: 20px;
  padding: 22px;
  border: 2.5px solid transparent;
  box-shadow: var(--sh2);
  transition: all .25s cubic-bezier(.34,1.56,.64,1);
  position: relative;
}
.mapel-card:hover { border-color: var(--gold); transform: translateY(-4px); box-shadow: var(--sh); }
.mapel-card-icon  { font-size: 42px; display: block; margin-bottom: 10px; line-height: 1; }
.mapel-card-name  { font-family: 'Baloo 2', cursive; font-size: 19px; font-weight: 900; color: var(--navy); margin-bottom: 4px; }
.mapel-card-desc  { font-size: 12px; color: var(--gray); margin-bottom: 12px; line-height: 1.4; min-height: 30px; }
.mapel-card-stats { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
.mapel-stat-pill  { background: rgba(26,50,96,.08); color: var(--navy); border-radius: 8px; padding: 3px 10px; font-size: 11px; font-weight: 700; }
.mapel-card-acts  { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }

/* ── Guru mapel card ─────────────────────────────────────── */
.guru-mapel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}
.guru-mapel-card {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; border-radius: 14px;
  background: #fafafa; border: 2.5px solid #f0f0f0;
  cursor: pointer; transition: .15s;
  touch-action: manipulation;
}
.guru-mapel-card:hover { border-color: var(--gold); background: rgba(201,168,76,.06); }
.guru-mapel-card.active { border-color: var(--navy); background: rgba(26,50,96,.06); }
.guru-mapel-icon { font-size: 30px; flex-shrink: 0; }
.guru-mapel-info { flex: 1; min-width: 0; }
.guru-mapel-info strong { font-size: 14px; font-weight: 800; color: var(--navy); display: block; }
.guru-mapel-info span   { font-size: 11px; color: var(--gray); font-weight: 600; }
.guru-mapel-check {
  width: 26px; height: 26px;
  border-radius: 7px; border: 2.5px solid #ddd;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 900;
  flex-shrink: 0; transition: .15s;
  color: transparent;
}
.guru-mapel-card.active .guru-mapel-check { background: var(--navy); border-color: var(--navy); color: #fff; }

/* ══════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .sg { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
  .stats { grid-template-columns: repeat(3, 1fr); }
  .mapel-grid { grid-template-columns: repeat(2, 1fr); }
  .guru-mapel-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .topbar { height: 52px; padding: 0 12px; gap: 6px; }
  .t-name { max-width: 80px; font-size: 11px; }
  .t-badge { padding: 2px 6px; font-size: 9px; }
  .t-av { width: 30px; height: 30px; font-size: 12px; }
  .btn-out { padding: 5px 9px; font-size: 10px; }

  .as-logo { max-width: none; gap: 0; }
  .as-logo-icon { height: 26px !important; }
  /* FIX: logo text tetap tampil di HP kecil, hanya dikecilkan */
  .as-logo-text { height: 14px !important; margin-left: 6px; display: inline-block !important; }
  .as-logo-admin { font-size: 10px; padding: 1px 5px; margin-left: 5px; }

  .main { padding: 14px 12px; }

  .land-hero { padding: 32px 16px 32px; justify-content: flex-start; padding-top: 40px; }
  .hero-h { font-size: 26px; }
  .hero-ilu { font-size: 50px; }
  .hero-p { font-size: 13px; margin-bottom: 20px; }
  .levels { gap: 8px; }
  .lvl-card { min-width: 88px; padding: 14px 16px; border-radius: 14px; }
  .lvl-ic { font-size: 28px; }
  .lvl-n { font-size: 17px; }

  .sch-grid { grid-template-columns: 1fr; gap: 8px; }
  .sch-card { padding: 11px 12px; gap: 10px; border-radius: 14px; max-width: 100%; }
  .sch-ico  { width: 42px; height: 42px; font-size: 20px; border-radius: 11px; }
  .sch-info h4 { font-size: 12px; }
  .sch-code { font-size: 9px; padding: 3px 6px; letter-spacing: 0; }

  .wban { padding: 16px 14px; gap: 8px; }
  .wem { font-size: 38px; }
  .wt h2 { font-size: 17px; }
  .wt p { font-size: 11px; }

  .sg { grid-template-columns: 1fr 1fr; gap: 10px; }
  .sc { padding: 14px 12px; border-radius: 14px; min-height: 130px; }
  .si { font-size: 34px; margin-bottom: 8px; }
  .sn { font-size: 14px; }
  .sd { font-size: 10px; }
  .stag { padding: 3px 8px; font-size: 10px; margin-top: 6px; }

  .stats { grid-template-columns: repeat(3, 1fr); gap: 7px; }
  .stat { padding: 10px 6px; border-radius: 12px; }
  .si2 { font-size: 18px; margin-bottom: 3px; }
  .stat .sn { font-size: 20px; }
  .sl { font-size: 9px; }

  .atabs { gap: 4px; }
  .atab { padding: 6px 9px; font-size: 10px; }
  .snav { gap: 5px; }
  .snb { padding: 7px 10px; font-size: 11px; }
  .sem-btn { padding: 8px 10px; font-size: 11px; }

  .mi { padding: 12px 12px; gap: 10px; }
  .mn { width: 38px; height: 38px; font-size: 12px; border-radius: 10px; }
  .mi-info h4 { font-size: 13px; }
  .mi-info p { font-size: 11px; }
  .mi-r {
    width: 100%;
    justify-content: flex-start;
    margin-left: 0;
    padding-top: 8px;
    border-top: 1px solid #f0f0f0;
    gap: 6px;
  }
  .btn-read, .btog, .btn-del {
    padding: 8px 12px;
    font-size: 11px;
    border-radius: 8px;
    min-height: 38px;
    min-width: 52px;
  }

  .be, .bd {
    padding: 8px 12px !important;
    font-size: 12px !important;
    min-height: 40px !important;
    min-width: 56px !important;
    border-radius: 8px !important;
  }

  .meet-card { padding: 12px 14px; gap: 10px; }
  .meet-num { width: 42px; height: 42px; font-size: 12px; border-radius: 11px; }
  .meet-info h4 { font-size: 13px; }
  .meet-info p { font-size: 11px; }
  .meet-card:hover { transform: none; box-shadow: 0 4px 16px rgba(201,168,76,.2); }

  .pdf-frame { height: 58vh; min-height: 240px; }
  .pdf-bar { padding: 10px 12px; }
  .pdf-bar-ti { font-size: 11px; }

  #pdf-nav-bar { padding: 8px 10px !important; gap: 6px !important; }
  #pdf-nav-bar button { padding: 8px 14px !important; font-size: 12px !important; border-radius: 8px !important; }
  #pdf-info { font-size: 11px; min-width: 70px; }

  .mov { padding: 0; align-items: flex-end; }
  .mbox {
    padding: 20px 16px;
    border-radius: 22px 22px 0 0;
    max-height: 85vh;
    margin: 0;
    width: 100%;
  }
  .mbox h3 { font-size: 17px; }

  .mapel-grid { grid-template-columns: 1fr; gap: 10px; }
  .guru-mapel-grid { grid-template-columns: 1fr; }

  .ph { padding: 10px 12px; gap: 8px; }
  .ph-ti { font-size: 16px; }
  .back-btn { padding: 6px 12px; font-size: 12px; }
  .lcard { padding: 20px 16px; border-radius: 20px; }
  .lc-em { font-size: 40px; }
  .lc-ti { font-size: 19px; }
  .wban { flex-direction: column; text-align: center; }
  .wtrn { justify-content: center; }

  .alert {
    top: 60px; left: 10px; right: 10px;
    max-width: 100%; font-size: 12px; padding: 10px 14px;
  }

  .mh { gap: 8px; }
  .mh-ti { font-size: 14px; }
  .sec-ti { font-size: 15px; }
  .btn-add { padding: 6px 12px; font-size: 12px; }
  .mh .btn-add { margin-left: 0 !important; width: 100%; margin-top: 4px; }

  table { min-width: 0 !important; }
  td, th { padding: 8px 10px; }
  td b { word-break: break-word; }
  .acts { gap: 4px; }
}

@media (max-width: 380px) {
  .t-name { display: none; }
  .t-badge { display: none; }
  /* FIX: as-logo-text TIDAK dihapus lagi di 380px, hanya diperkecil */
  .as-logo-icon { height: 22px !important; }
  .as-logo-text { height: 12px !important; margin-left: 5px; display: inline-block !important; }
  .sg { grid-template-columns: 1fr; }
  .levels { flex-direction: column; align-items: center; }
  .lvl-card { min-width: 200px; width: 100%; max-width: 280px; }
  .stats { grid-template-columns: repeat(3, 1fr); }
  .atabs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 5px;
  }
  .atabs .atab:nth-child(5) { grid-column: 1 / -1; }
  .atab { text-align: center; font-size: 9px; padding: 6px 6px; }
  .sem-tabs { gap: 6px; }
  .snav { display: grid; grid-template-columns: repeat(2, 1fr); gap: 5px; }
  .snb { text-align: center; font-size: 10px; padding: 7px 6px; }
  .snav .snb:nth-child(3) { grid-column: 1 / -1; }
  #pdf-nav-bar { flex-wrap: wrap; }
  #pdf-info { width: 100%; order: -1; text-align: center; }
  .mh-ti { font-size: 12px; }
  .meet-num { width: 36px; height: 36px; font-size: 11px; }
}

@media (max-height: 500px) and (max-width: 900px) {
  .pdf-frame { height: 80vw; min-height: 180px; }
  .mbox { max-height: 95vh; border-radius: 16px; }
  .mov { padding: 8px; align-items: center; }
  .land-hero { padding: 18px 16px 20px; }
  .hero-ilu { font-size: 40px; margin-bottom: 6px; }
  .hero-h { font-size: 22px; }
  .wban { padding: 12px 14px; }
}

@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .topbar { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  .main   { padding-bottom: max(20px, env(safe-area-inset-bottom)); }
  .mbox   { padding-bottom: max(20px, env(safe-area-inset-bottom)); }
}