/* eHadir — UI baseline moden (19 Nov 2026).
   Susun atur asal AppSheet dikekalkan sebagai draf; gaya dimodenkan: permukaan cerah, kad bulat, aksen jenama
   merah jambu eHadir, sasaran sentuh besar, sidebar tetap di skrin lebar. Nama kelas tidak berubah (app.js). */
:root {
  /* jenama */
  --pri: #db2777;
  --pri-dark: #be185d;
  --pri-soft: #fdf2f8;
  --pri-tint: #fce7f3;
  /* neutral (slate) */
  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-2: #cbd5e1;
  --bg: #f6f7fb;
  --card: #ffffff;
  /* status */
  --ok: #059669;
  --ok-soft: #ecfdf5;
  --warn: #d97706;
  --warn-soft: #fffbeb;
  --bad: #dc2626;
  --bad-soft: #fef2f2;
  --info: #2563eb;
  --info-soft: #eff6ff;
  --violet: #7c3aed;
  --violet-soft: #f5f3ff;
  /* bentuk */
  --r-sm: 8px;
  --r: 14px;
  --r-lg: 20px;
  --sh-1: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .06);
  --sh-2: 0 4px 12px rgba(15, 23, 42, .08), 0 1px 3px rgba(15, 23, 42, .06);
  --sh-3: 0 18px 40px rgba(15, 23, 42, .18);
  --ring: 0 0 0 3px rgba(219, 39, 119, .22);
  --appbar: 60px;
  --nav: 68px;
  --side: 272px;
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: calc(var(--appbar) + 12px); }
body { margin: 0; min-height: 100vh; padding-bottom: calc(var(--nav) + 16px + env(safe-area-inset-bottom)); background: var(--bg); }
body.logged-out { padding-bottom: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--r-sm); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.pad { padding: 16px; }
.warn { color: var(--bad); }
p.warn { margin: 10px 16px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--bad-soft); font-size: 14px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
code { background: #f1f5f9; padding: 1px 5px; border-radius: 4px; font-size: .92em; }
::selection { background: var(--pri-tint); }

/* ---------- app bar ---------- */
.appbar {
  position: sticky; top: 0; z-index: 30; height: var(--appbar);
  display: flex; align-items: center; gap: 8px; padding: 0 8px 0 10px;
  background: rgba(255, 255, 255, .86); color: var(--text);
  -webkit-backdrop-filter: saturate(180%) blur(14px); backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.ab-logo { width: 32px; height: 32px; border-radius: 10px; flex: none; box-shadow: var(--sh-1); }
.ab-title { font-size: 18px; font-weight: 700; letter-spacing: -.01em; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ab-right { display: flex; align-items: center; gap: 2px; }
.ab-icon {
  width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center;
  background: none; border: 0; border-radius: 12px; color: var(--text-2); cursor: pointer; text-decoration: none;
  transition: background .15s, color .15s;
}
.ab-icon:hover { background: #f1f5f9; color: var(--pri); }
.ab-icon[hidden] { display: none; }
.ab-icon.spin svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* menu terapung lama (tidak digunakan oleh laci, dikekalkan) */
.menu-sheet { position: fixed; top: calc(var(--appbar) + 4px); right: 8px; z-index: 35; min-width: 250px; background: #fff; border-radius: var(--r); box-shadow: var(--sh-3); padding: 6px; }
.menu-sheet[hidden] { display: none; }
.menu-sheet a, .menu-sheet button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 12px; border: 0; background: none; border-radius: 10px; text-decoration: none; text-align: left; cursor: pointer; color: var(--text); }
.menu-sheet a:hover, .menu-sheet button:hover { background: #f1f5f9; }
.menu-user { padding: 10px 12px 12px; border-bottom: 1px solid var(--line); margin-bottom: 4px; display: flex; flex-direction: column; }
.menu-user span { color: var(--muted); font-size: 13px; }

/* ---------- status (masa kemas kini / menyimpan / ralat) ---------- */
.status { position: sticky; top: var(--appbar); z-index: 25; display: flex; justify-content: center; align-items: center; gap: 8px; pointer-events: none; padding-bottom: 2px; }
.status:empty { display: none; }
.status > span, .status > button { pointer-events: auto; }
.status > span {
  margin-top: 8px; padding: 6px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  background: #fff; box-shadow: var(--sh-2); border: 1px solid var(--line); white-space: nowrap; max-width: calc(100vw - 32px); overflow: hidden; text-overflow: ellipsis;
}
.status .ok { color: var(--muted); font-weight: 500; box-shadow: none; background: rgba(255, 255, 255, .9); }
.status .wait { color: #92400e; background: var(--warn-soft); border-color: #fde68a; }
.status .bad { color: #991b1b; background: var(--bad-soft); border-color: #fecaca; white-space: normal; }
.status button { margin-top: 8px; }

/* ---------- kandungan ---------- */
main { max-width: 820px; margin: 0 auto; padding: 4px 0 28px; }
.banner {
  display: table; margin: 14px auto 2px; padding: 4px 12px; border-radius: 999px;
  background: var(--violet-soft); color: var(--violet); font-size: 12px; font-weight: 600; text-align: center;
}
.alert { display: flex; align-items: center; gap: 10px; margin: 12px 16px 0; padding: 12px 14px; border-radius: var(--r); background: var(--warn-soft); color: #92400e; font-weight: 600; text-decoration: none; border: 1px solid #fde68a; }
.empty { color: var(--muted); padding: 22px 18px; margin: 0 16px; background: #fff; border-radius: var(--r); border: 1px dashed var(--line-2); text-align: center; font-size: 14px; }
.hint { color: var(--muted); font-size: 13px; padding: 2px 2px; margin: 8px 0; line-height: 1.5; }
.count { color: var(--muted); font-size: 13px; padding: 0 20px; margin: 10px 0 6px; font-weight: 500; }

/* kumpulan senarai (contoh hari "Thursday") */
.group-h {
  padding: 18px 20px 8px; font-size: 12px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .06em; background: transparent;
}
.group-h.row { display: flex; align-items: center; flex-wrap: nowrap; text-transform: none; letter-spacing: 0; font-size: 15px; color: var(--text); }
.group-h.row .grow { flex: 1; }
.group-h.row .btn { font-size: 13px; min-height: 34px; padding: 4px 12px; gap: 4px; }
.deck {
  margin: 0 16px; background: #fff; border-radius: var(--r); box-shadow: var(--sh-1);
  border: 1px solid var(--line); overflow: hidden;
}
.row-item {
  display: flex; align-items: flex-start; gap: 14px; padding: 14px 16px;
  text-decoration: none; background: #fff; position: relative; transition: background .12s;
}
.row-item + .row-item { border-top: 1px solid #eef2f7; }
a.row-item:hover { background: #fafbff; }
a.row-item::after {
  content: ""; position: absolute; right: 16px; top: 50%; width: 8px; height: 8px; margin-top: -4px;
  border-right: 2px solid var(--line-2); border-top: 2px solid var(--line-2); transform: rotate(45deg);
}
a.row-item { padding-right: 36px; }
.row-item .grow { flex: 1; min-width: 0; }
.t1 { font-size: 15.5px; font-weight: 650; line-height: 1.3; display: flex; align-items: center; gap: 6px; color: var(--text); }
.t2 { font-size: 13.5px; color: var(--muted); margin-top: 3px; }
.t3 { font-size: 12.5px; color: var(--muted); margin-top: 6px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.row-item.warn .t1 { color: var(--pri); }
.warn-ic { color: var(--warn); display: inline-flex; }
.avatar {
  width: 46px; height: 46px; flex: none; border-radius: 14px; display: flex; align-items: center; justify-content: center;
  background: var(--pri-soft); color: var(--pri); font-weight: 700; font-size: 16px;
}
.avatar.kelas { background: var(--violet-soft); color: var(--violet); }
.avatar.kelas.berjalan { background: var(--ok-soft); color: var(--ok); }
.avatar.kelas.konflik, .avatar.warn { background: var(--warn-soft); color: var(--warn); }
.avatar.lulus { background: var(--info-soft); color: var(--info); }

/* tindakan sebaris pada baris */
.inline-acts { display: flex; justify-content: flex-end; align-items: center; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.ia {
  width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; flex: none;
  border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--text-2); cursor: pointer; text-decoration: none;
  transition: background .12s, color .12s, border-color .12s, transform .08s;
}
.ia:hover { background: #f8fafc; color: var(--pri); border-color: var(--line-2); }
.ia:active { transform: scale(.95); }
.ia:disabled { opacity: .35; cursor: default; background: #fff; color: var(--text-2); }
.ia.attend:not(:disabled) { background: var(--pri); border-color: var(--pri); color: #fff; box-shadow: 0 4px 10px rgba(219, 39, 119, .28); }
.ia.attend:not(:disabled):hover { background: var(--pri-dark); }
.ia.attend.done { background: var(--ok-soft); border-color: #a7f3d0; color: var(--ok); opacity: 1; box-shadow: none; }
.hadir-ok { color: var(--ok); font-weight: 700; }

.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 650; background: #f1f5f9; color: var(--text-2); line-height: 1.6; }
.pill.berjalan { background: var(--ok-soft); color: var(--ok); }
.pill.selesai { background: #f1f5f9; color: var(--muted); }
.pill.konflik, .pill.hold { background: var(--warn-soft); color: #b45309; }
.pill.sementara { background: var(--info-soft); color: var(--info); }
.pill.lulus { background: var(--violet-soft); color: var(--violet); }

/* ---------- Details: butang tindakan utama ---------- */
.acts { display: flex; flex-wrap: wrap; gap: 10px; padding: 16px 16px 4px; background: transparent; }
.act {
  flex: 0 1 auto; min-width: 92px; display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r); cursor: pointer; padding: 12px 10px 10px;
  box-shadow: var(--sh-1); transition: transform .08s, box-shadow .15s, border-color .15s;
}
.act:hover { box-shadow: var(--sh-2); border-color: #fbcfe8; }
.act:active { transform: scale(.98); }
.act-ic { width: 42px; height: 42px; border-radius: 12px; background: var(--pri-soft); color: var(--pri); display: flex; align-items: center; justify-content: center; }
.act:disabled { opacity: .5; cursor: default; box-shadow: none; }
.act[data-why] .act-ic { background: #f1f5f9; color: #94a3b8; }
.act-lb { font-size: 11.5px; font-weight: 650; line-height: 1.25; text-align: center; color: var(--text-2); }
.acts > a.btn { box-shadow: var(--sh-1); }

.detail-h { margin: 12px 16px 0; background: #fff; padding: 16px 18px; display: flex; align-items: center; gap: 12px; border-radius: var(--r) var(--r) 0 0; border: 1px solid var(--line); border-bottom: 0; }
.detail-h.big { padding-top: 18px; }
.h-course { font-size: 20px; font-weight: 750; letter-spacing: -.01em; }
.h-name { font-size: 26px; font-weight: 750; color: var(--pri); line-height: 1.2; letter-spacing: -.01em; }
.detail-h.big .h-course { font-size: 18px; color: var(--text-2); margin-top: 4px; }
.h-sub { font-size: 13.5px; color: var(--muted); margin-top: 4px; }
.warn-big { color: var(--warn); display: inline-flex; }

.fld-sel { margin: 0 16px; background: #fff; padding: 4px 18px 18px; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--r) var(--r); box-shadow: var(--sh-1); }
.fld-sel label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .05em; }
.fld-sel select { width: 100%; height: 48px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 12px; background: #fff; font-size: 16px; font-weight: 500; }
.fld-sel select:disabled { background: #f8fafc; color: var(--muted); }
.fld-sel + .deck, .fld-sel + .info, .fld-sel + .ann-list, .fld-sel + .empty { margin-top: 14px; }

.info { margin: 12px 16px; padding: 12px 14px; border-radius: var(--r); background: #f1f5f9; color: var(--text-2); font-size: 14px; border: 1px solid var(--line); }
.info.ok { background: var(--ok-soft); color: #065f46; border-color: #a7f3d0; }
.info.bad { background: var(--warn-soft); color: #92400e; border-color: #fde68a; }
.info p { margin: 4px 0; }

.fields { margin: 12px 16px 0; background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh-1); padding: 4px 0; }
.fld { padding: 10px 18px; }
.fld + .fld { border-top: 1px solid #f1f5f9; }
.fld-l { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.fld-v { font-size: 16px; margin-top: 3px; word-break: break-word; color: var(--text); }

/* ---------- borang ---------- */
.form-view {
  margin: 14px 16px 0; background: #fff; padding: 8px 18px 18px; border-radius: var(--r-lg);
  border: 1px solid var(--line); box-shadow: var(--sh-1); margin-bottom: calc(96px + env(safe-area-inset-bottom));
}
.form-view .fld { padding-left: 0; padding-right: 0; }
.form-note { color: var(--muted); font-size: 14px; margin: 12px 0 4px; }
.ff { display: block; padding: 10px 0; border: 0; margin: 0; min-width: 0; }
fieldset.ff { padding: 10px 0; }
.ff-l { display: block; font-size: 13.5px; font-weight: 600; color: var(--text-2); margin-bottom: 7px; padding: 0; }
.req { color: var(--pri); margin-left: 3px; }
.ff input, .ff select, .ff textarea {
  width: 100%; min-height: 48px; padding: 11px 14px; border: 1px solid var(--line-2); border-radius: 12px; background: #fff; font-size: 16px;
  transition: border-color .15s, box-shadow .15s; appearance: none; -webkit-appearance: none;
}
.ff select, .fld-sel select, .searchbar select {
  appearance: none; -webkit-appearance: none; padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='%2364748b'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.ff textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.ff input[type="checkbox"], .ff input[type="radio"] { width: 18px; min-height: 18px; height: 18px; padding: 0; accent-color: var(--pri); appearance: auto; -webkit-appearance: auto; vertical-align: -3px; }
.ff input:focus, .ff select:focus, .ff textarea:focus, .fld-sel select:focus { outline: none; border-color: var(--pri); box-shadow: var(--ring); }
.ff input:disabled, .ff select:disabled, .ff textarea:disabled { background: #f8fafc; color: var(--muted); }
.ff input::placeholder, .ff textarea::placeholder { color: #94a3b8; }
.seg { display: flex; gap: 4px; padding: 4px; background: #f1f5f9; border-radius: 12px; }
.seg button { flex: 1; height: 42px; border: 0; border-radius: 9px; background: transparent; cursor: pointer; font-size: 15px; font-weight: 600; color: var(--muted); transition: background .15s, color .15s; }
.seg button.on { background: #fff; color: var(--pri); box-shadow: var(--sh-1); }
.stepper { display: flex; gap: 6px; }
.stepper input { flex: 1; }
.stepper button { width: 48px; border: 1px solid var(--line-2); border-radius: 12px; background: #fff; cursor: pointer; color: var(--text-2); display: flex; align-items: center; justify-content: center; }
.stepper button:hover { border-color: var(--pri); color: var(--pri); }
.chk { display: flex; align-items: center; gap: 10px; padding: 9px 12px; margin: 4px 0; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-size: 14.5px; }
.chk:has(input:checked) { border-color: #f9a8d4; background: var(--pri-soft); }
.chk input { accent-color: var(--pri); width: 18px; height: 18px; }
.form-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 28; display: flex; gap: 10px; justify-content: flex-end;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .92); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-top: 1px solid var(--line);
}
.fb { flex: 1; max-width: 220px; height: 50px; border: 1px solid var(--line-2); border-radius: 14px; background: #fff; font-size: 16px; font-weight: 600; cursor: pointer; color: var(--text-2); transition: background .15s, transform .08s; }
.fb:hover { background: #f8fafc; }
.fb:active { transform: scale(.98); }
.fb.save { background: var(--pri); border-color: var(--pri); color: #fff; box-shadow: 0 6px 16px rgba(219, 39, 119, .3); }
.fb.save:hover { background: var(--pri-dark); }
.fb:disabled { opacity: .45; cursor: default; box-shadow: none; }
body:has(.form-bar) .bottomnav { display: none; }

/* ---------- Pelajar: carian + FAB ---------- */
.searchbar {
  display: flex; align-items: center; gap: 8px; margin: 14px 16px 6px; padding: 0 6px 0 14px; background: #fff;
  border-radius: 14px; border: 1px solid var(--line); box-shadow: var(--sh-1); color: var(--muted); transition: box-shadow .15s, border-color .15s;
}
.searchbar:focus-within { border-color: var(--pri); box-shadow: var(--ring); }
.searchbar input { flex: 1; min-width: 0; height: 48px; border: 0; outline: none; font-size: 16px; background: none; color: var(--text); box-shadow: none; }
.searchbar input:focus-visible { box-shadow: none; }
.searchbar select { height: 36px; border: 1px solid var(--line); border-radius: 10px; background-color: #f8fafc; color: var(--text); padding-left: 10px; font-size: 14px; font-weight: 500; }
.fab {
  position: fixed; right: 20px; bottom: calc(var(--nav) + 28px + env(safe-area-inset-bottom)); z-index: 24;
  width: 58px; height: 58px; border-radius: 18px; background: var(--pri); color: #fff;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 24px rgba(219, 39, 119, .4);
  transition: transform .1s, background .15s;
}
.fab:hover { background: var(--pri-dark); }
.fab:active { transform: scale(.94); }

/* ---------- Dashboard ---------- */
.dash { margin-top: 6px; }
.dash-h { margin: 0; padding: 16px 20px 8px; font-size: 15px; color: var(--text); }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 0 16px; }
.tile { background: #fff; border-radius: var(--r); padding: 14px 10px; text-align: center; text-decoration: none; box-shadow: var(--sh-1); border: 1px solid var(--line); }
.tile b { display: block; font-size: 26px; color: var(--pri); letter-spacing: -.02em; }
.tile span { font-size: 12px; color: var(--muted); }
@media (max-width: 480px) { .tiles { grid-template-columns: repeat(2, 1fr); } }
.dash-card { margin: 14px 16px 0; background: #fff; border-radius: var(--r); border: 1px solid var(--line); box-shadow: var(--sh-1); overflow: hidden; }
.dash-card-h { display: flex; align-items: center; gap: 6px; padding: 14px 16px; font-size: 15.5px; font-weight: 700; border-bottom: 1px solid #f1f5f9; }
.dash-card-h .grow { flex: 1; }
.dash-card .deck { margin: 0; border: 0; border-radius: 0; box-shadow: none; }
.dash-card .fields { margin: 0; border: 0; box-shadow: none; border-radius: 0; }
.dash-card .empty { margin: 12px; padding: 18px; border: 0; background: #f8fafc; }
.ab-mini { border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 13px; color: var(--text-2); padding: 4px 10px; border-radius: 9px; min-width: 34px; height: 32px; }
.ab-mini:hover { color: var(--pri); border-color: var(--line-2); }
.belum-hadir { color: var(--pri); }
.t1.belum-hadir svg, .h-name .belum-hadir svg { color: var(--warn); vertical-align: -3px; }

/* ---------- navigasi bawah (dok terapung) ---------- */
.bottomnav {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 26; display: flex; gap: 4px;
  width: min(calc(100vw - 24px), 440px); height: var(--nav); padding: 6px;
  background: rgba(255, 255, 255, .92); -webkit-backdrop-filter: saturate(180%) blur(14px); backdrop-filter: saturate(180%) blur(14px);
  border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--sh-3);
}
.bottomnav[hidden] { display: none; }
.bottomnav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-radius: 16px;
  color: var(--muted); text-decoration: none; font-size: 11.5px; font-weight: 600; transition: background .15s, color .15s;
}
.bottomnav a:hover { color: var(--text); }
.bottomnav a.on { color: var(--pri); background: var(--pri-soft); }

/* ---------- dialog sahkan ---------- */
.modal { position: fixed; inset: 0; z-index: 60; background: rgba(15, 23, 42, .45); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade .15s ease-out; }
.modal[hidden] { display: none; }
.modal-card { width: 100%; max-width: 380px; background: #fff; border-radius: var(--r-lg); padding: 22px 22px 16px; box-shadow: var(--sh-3); max-height: 85vh; overflow: auto; animation: pop .18s ease-out; }
.modal-card h2 { margin: 0 0 10px; font-size: 18px; font-weight: 700; }
.modal-card h2:empty { display: none; }
#modalBody { font-size: 15.5px; line-height: 1.55; color: var(--text-2); }
#modalBody p { margin: 0 0 10px; }
#modalBody ul { margin: 0 0 10px; padding-left: 4px; list-style: none; }
#modalBody li::before { content: "• "; color: var(--pri); }
.modal-sub { font-weight: 700; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }
.dlg-btn { border: 1px solid var(--line-2); background: #fff; color: var(--text-2); border-radius: 12px; font-size: 14px; font-weight: 650; padding: 11px 16px; cursor: pointer; min-width: 84px; text-align: center; }
.dlg-btn:hover { background: #f8fafc; }
#modalOk { background: var(--pri); border-color: var(--pri); color: #fff; box-shadow: 0 6px 14px rgba(219, 39, 119, .28); }
#modalOk:hover { background: var(--pri-dark); }
#modalOk.danger { background: var(--bad); border-color: var(--bad); box-shadow: 0 6px 14px rgba(220, 38, 38, .28); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }

/* ---------- butang umum & log masuk ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 8px 16px;
  border: 1px solid var(--line-2); border-radius: 12px; background: #fff; cursor: pointer; text-decoration: none;
  font-size: 14px; font-weight: 650; color: var(--text-2); transition: background .15s, border-color .15s, transform .08s;
}
.btn:hover { background: #f8fafc; border-color: #94a3b8; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--pri); border-color: var(--pri); color: #fff; box-shadow: 0 4px 12px rgba(219, 39, 119, .25); }
.btn.primary:hover { background: var(--pri-dark); border-color: var(--pri-dark); }
.btn.danger { background: #fff; border-color: #fecaca; color: var(--bad); }
.btn.danger:hover { background: var(--bad-soft); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
body.logged-out { background: radial-gradient(1200px 600px at 10% -10%, #fce7f3 0%, transparent 60%), radial-gradient(900px 500px at 110% 10%, #ede9fe 0%, transparent 55%), var(--bg); }
body.logged-out .appbar { display: none; }
.login {
  max-width: 400px; margin: 7vh 16px 40px; padding: 34px 26px 28px; background: rgba(255, 255, 255, .95);
  border-radius: 24px; box-shadow: var(--sh-3); text-align: center; border: 1px solid var(--line);
}
@media (min-width: 432px) { .login { margin-left: auto; margin-right: auto; } }
.login img { border-radius: 20px; box-shadow: var(--sh-2); }
.login h1 { color: var(--text); margin: 16px 0 6px; font-size: 26px; letter-spacing: -.02em; }
.login > p { margin: 0 0 20px; font-size: 14.5px; }
.login form { flex-direction: column; align-items: stretch !important; gap: 10px; }
.login input { min-height: 48px; padding: 10px 14px; border: 1px solid var(--line-2); border-radius: 12px; font-size: 16px; width: 100%; }
.login input:focus { outline: none; border-color: var(--pri); box-shadow: var(--ring); }
.login .btn { min-height: 48px; font-size: 15px; }

/* SaaS: menu pusat, kad maklumat */
.menu-sec { padding: 14px 14px 6px; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.card { margin: 12px 16px 0; background: #fff; border-radius: var(--r); border: 1px solid var(--line); box-shadow: var(--sh-1); }
.card.pad { padding: 8px 0; }
.row.gap { gap: 12px; flex-wrap: nowrap; }
.row.gap > .ff { flex: 1; min-width: 0; }
.info input[readonly] { width: 100%; font-size: 13px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.info a { color: inherit; font-weight: 700; }

/* ---------- laci menu (sidebar tetap di skrin lebar) ---------- */
.drawer-bg { position: fixed; inset: 0; background: rgba(15, 23, 42, .4); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); z-index: 40; animation: fade .15s; }
.drawer-bg[hidden], .drawer[hidden] { display: none; }
.drawer {
  position: fixed; top: 0; left: 0; bottom: 0; width: min(86vw, var(--side)); z-index: 41; background: #fff;
  display: flex; flex-direction: column; box-shadow: var(--sh-3); animation: slide .2s ease-out;
}
@keyframes slide { from { transform: translateX(-24px); opacity: 0; } }
.drawer-h { display: flex; align-items: center; gap: 12px; padding: 18px 16px 16px; border-bottom: 1px solid var(--line); }
.drawer-h img { border-radius: 12px; flex: none; box-shadow: var(--sh-1); }
.drawer-h div { display: flex; flex-direction: column; min-width: 0; }
.drawer-h b { font-size: 16px; font-weight: 750; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drawer-h span { font-size: 12.5px; color: var(--muted); }
.drawer-list { flex: 1; overflow-y: auto; padding: 8px; }
.drawer-list a, .drawer-list button {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; margin: 1px 0; border: 0; background: none; border-radius: 10px;
  text-decoration: none; text-align: left; cursor: pointer; color: var(--text-2); font: inherit; font-size: 14.5px; font-weight: 550;
  transition: background .12s, color .12s;
}
.drawer-list a:hover, .drawer-list button:hover { background: #f1f5f9; color: var(--text); }
.drawer-list a.on { background: var(--pri-soft); color: var(--pri); }
.drawer-list a.on svg { color: var(--pri); }
.drawer-main { display: none; }
.drawer-list svg { color: #94a3b8; flex: none; width: 20px; height: 20px; }
.drawer-out { margin: 8px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--bad); font: inherit; font-size: 14px; font-weight: 650; padding: 11px; text-align: center; cursor: pointer; }
.drawer-out:hover { background: var(--bad-soft); border-color: #fecaca; }

/* ---------- Details pelajar ---------- */
.acts.acts-4 { flex-wrap: nowrap; gap: 8px; }
.acts.acts-4 .act { flex: 1 1 0; min-width: 0; padding: 12px 6px 10px; }
.acts.acts-4 .act-ic { background: var(--pri-soft); color: var(--pri); }
.acts.acts-4 .act[data-why] .act-ic { background: #f1f5f9; color: #94a3b8; }
.fld-v.h-name { color: var(--pri); font-weight: 750; font-size: 20px; }
.fld-v.report { line-height: 1.7; }
.count-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 20px; padding: 0 7px; margin-left: 6px; border-radius: 999px; background: #f1f5f9; color: var(--text-2); font-size: 11.5px; font-weight: 700; }

/* ---------- jadual ---------- */
.table-wrap, .tbl-wrap { margin: 0 16px; background: #fff; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh-1); }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-weight: 650; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 11px 14px; background: #f8fafc; border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; }
.tbl td { padding: 12px 14px; border-bottom: 1px solid #f1f5f9; white-space: nowrap; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: #fafbff; }

/* ---------- F5 Gaji ---------- */
.gaji-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 10px 16px 4px; }
.gaji-kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 14px 10px; text-align: center; box-shadow: var(--sh-1); }
.gaji-kpi:first-child { background: linear-gradient(135deg, var(--pri), #9d174d); border-color: transparent; color: #fff; }
.gaji-kpi:first-child .dc-l { color: rgba(255, 255, 255, .8); }
.gaji-kpi .dc-l { font-size: 11.5px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.gaji-kpi .dc-v { font-size: 18px; font-weight: 750; margin-top: 4px; letter-spacing: -.01em; }
.slip { margin: 12px 16px 0; background: #fff; padding: 16px 0 8px; border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh-1); }
.slip .t1 { font-size: 13px; letter-spacing: .06em; color: var(--pri); margin: 0 18px 6px; }
.dash > .inline-acts, section > .inline-acts { padding: 4px 16px; justify-content: flex-start; }
main > p > .btn { margin: 14px 16px; }

/* ---------- Pengumuman ---------- */
.ann-list { display: flex; flex-direction: column; gap: 10px; padding: 4px 16px; }
.fld-sel + .ann-list { padding-top: 0; }
.ann {
  display: block; background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px 12px 18px;
  color: inherit; text-decoration: none; box-shadow: var(--sh-1); position: relative; overflow: hidden;
}
.ann::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: #94a3b8; }
a.ann:hover { box-shadow: var(--sh-2); }
.ann-penting::before { background: var(--warn); }
.ann-segera::before { background: var(--bad); }
.ann-h { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ann-h b { font-size: 15px; }
.ann-pri { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: #f1f5f9; padding: 2px 8px; border-radius: 999px; }
.ann-penting .ann-pri { color: #b45309; background: var(--warn-soft); }
.ann-segera .ann-pri { color: var(--bad); background: var(--bad-soft); }
.ann-m { white-space: pre-wrap; margin: 6px 0 2px; color: var(--text-2); font-size: 14.5px; }

/* ---------- skrin lebar: sidebar tetap ---------- */
@media (min-width: 1024px) {
  body:not(.logged-out) .drawer, body:not(.logged-out) .drawer[hidden] { display: flex !important; box-shadow: none; border-right: 1px solid var(--line); animation: none; width: var(--side); z-index: 31; }
  body:not(.logged-out) .drawer-bg { display: none !important; }
  body:not(.logged-out) #menuBtn { display: none; }
  body:not(.logged-out) .appbar, body:not(.logged-out) main, body:not(.logged-out) .status { margin-left: var(--side); }
  body:not(.logged-out) main { max-width: 900px; margin-left: calc(var(--side) + max(24px, (100vw - var(--side) - 900px) / 2)); padding-top: 8px; }
  body:not(.logged-out) .appbar { padding-left: 20px; }
  body:not(.logged-out) .ab-logo { display: none; }
  body:not(.logged-out) .bottomnav { display: none; }
  body:not(.logged-out) { padding-bottom: 32px; }
  .drawer-main { display: block; }
  .fab { bottom: 32px; }
  .form-bar { left: var(--side); }
  body.logged-out .form-bar { left: 0; }
  .fab { right: max(28px, (100vw - var(--side) - 900px) / 2 - 40px); }
  .form-view { margin-bottom: 110px; }
}

@media print {
  .appbar, .bottomnav, .inline-acts, .drawer, .drawer-bg, .status, .fab, .banner { display: none !important; }
  body { background: #fff; padding: 0; }
  main { margin: 0 !important; max-width: none; }
  .deck, .card, .slip, .dash-card, .tbl-wrap, .table-wrap, .fields { box-shadow: none; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- Gambar (Headshot / Image) ---------- */
.avatar.photo { padding: 0; overflow: hidden; background: #f1f5f9; }
.avatar.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-h { display: flex; align-items: center; gap: 14px; padding: 8px 18px 10px; }
.profile-h .grow { flex: 1; min-width: 0; }
.profile-h .fld-v.h-name { margin-top: 2px; }
.profile-photo { width: 72px; height: 72px; flex: none; border-radius: 20px; object-fit: cover; box-shadow: var(--sh-1); }
.profile-photo.none { display: flex; align-items: center; justify-content: center; background: var(--pri-soft); color: var(--pri); }
.course-img { width: 56px; height: 56px; flex: none; border-radius: 14px; object-fit: cover; }
.detail-h .grow { flex: 1; min-width: 0; }
.photo-field { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.photo-prev { width: 88px; height: 88px; border-radius: 22px; background: var(--pri-soft); color: var(--pri); display: flex; align-items: center; justify-content: center; overflow: hidden; flex: none; border: 1px solid var(--line); }
.photo-prev img { width: 100%; height: 100%; object-fit: cover; }
.photo-prev.loading { opacity: .5; }
.photo-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.photo-acts label.btn { cursor: pointer; }

.role-sel { height: 38px; padding: 0 34px 0 12px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='%2364748b'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E") no-repeat right 8px center; appearance: none; -webkit-appearance: none; font-size: 14px; font-weight: 600; }

/* ---------- Sidebar berkategori ---------- */
.drawer-main { padding-bottom: 6px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.nav-grp { margin: 2px 0; }
.nav-grp > summary {
  list-style: none; display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; cursor: pointer; user-select: none;
  font-size: 11.5px; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; color: var(--muted);
}
.nav-grp > summary::-webkit-details-marker { display: none; }
.nav-grp > summary:hover { background: #f8fafc; color: var(--text-2); }
.nav-grp > summary svg { width: 16px; height: 16px; color: #94a3b8; }
.nav-grp > summary span:first-of-type { flex: 1; }
.nav-grp .chev { width: 8px; height: 8px; border-right: 2px solid #94a3b8; border-bottom: 2px solid #94a3b8; transform: rotate(-45deg); transition: transform .15s; margin-right: 4px; }
.nav-grp[open] .chev { transform: rotate(45deg); }
.nav-items { padding: 0 0 4px 8px; }
.nav-items a, .nav-items button { font-size: 14.5px; }
.nav-super > summary { color: var(--violet); }
.nav-super > summary svg { color: var(--violet); }
.nav-super .nav-items a.on { background: var(--violet-soft); color: var(--violet); }
.nav-super .nav-items a.on svg { color: var(--violet); }

/* ---------- Super Admin ---------- */
.super-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 18px 16px 4px; }
.sh-l { font-size: 12px; font-weight: 700; color: var(--violet); text-transform: uppercase; letter-spacing: .08em; }
.sh-t { font-size: 22px; font-weight: 750; letter-spacing: -.01em; }
.kpi-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 12px 16px 2px; }
.kpi-grid.three { grid-template-columns: repeat(3, 1fr); }
@media (min-width: 720px) { .kpi-grid { grid-template-columns: repeat(4, 1fr); } .kpi-grid.three { grid-template-columns: repeat(3, 1fr); } }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 14px; box-shadow: var(--sh-1); min-width: 0; }
.kpi-l { font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.kpi-v { font-size: 21px; font-weight: 780; margin-top: 4px; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-s { font-size: 12px; color: var(--muted); margin-top: 3px; }
.kpi.hero { background: linear-gradient(135deg, #6d28d9, #9d174d); color: #fff; border-color: transparent; }
.kpi.hero .kpi-l, .kpi.hero .kpi-s { color: rgba(255, 255, 255, .8); }
.kpi.neg .kpi-v, .neg { color: var(--bad); }
.pos { color: var(--ok); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; padding: 6px 16px 10px; }
.chip { border: 1px solid var(--line-2); background: #fff; border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; color: var(--text-2); cursor: pointer; }
.chip.on { background: var(--text); border-color: var(--text); color: #fff; }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; padding: 14px 16px 2px; }
.filter-row label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 650; color: var(--muted); }
.filter-row input { height: 40px; border: 1px solid var(--line-2); border-radius: 10px; padding: 0 10px; background: #fff; }
.table-wrap.flush { margin: 0; border: 0; border-radius: 0; box-shadow: none; }
.tbl th.num, .tbl td.num { text-align: right; font-variant-numeric: tabular-nums; }
.dlg-input { width: 100%; height: 44px; border: 1px solid var(--line-2); border-radius: 10px; padding: 0 12px; font-size: 16px; margin-top: 4px; }
/* carta bar satu siri: bar nipis, hujung bulat 4px berlabuh pada garis asas, jurang 2px, tooltip hover/fokus */
.chart-wrap { position: relative; padding: 14px 16px 10px; }
.bars { display: grid; grid-template-columns: repeat(12, 1fr); gap: 2px; align-items: end; height: 170px; border-bottom: 1px solid var(--line); }
.bar-col { display: flex; flex-direction: column; align-items: center; height: 100%; cursor: default; outline: none; }
.bar-track { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; padding: 0 18%; }
.bar { width: 100%; max-width: 26px; background: var(--violet); border-radius: 4px 4px 0 0; min-height: 0; transition: opacity .12s; }
.bar-col:hover .bar, .bar-col:focus .bar { opacity: .75; }
.bar-x { font-size: 10.5px; color: var(--muted); padding-top: 6px; height: 22px; white-space: nowrap; }
.bars + .bar-tip { position: absolute; top: 4px; width: 150px; padding: 6px 10px; border-radius: 8px; background: var(--text); color: #fff; font-size: 12px; font-weight: 600; text-align: center; pointer-events: none; box-shadow: var(--sh-2); }
@media (max-width: 719px) {
  .kpi-grid.three { grid-template-columns: 1fr 1fr; }
  .kpi-grid.three .kpi.hero { grid-column: 1 / -1; }
}

/* ---------- Hubungi ibu bapa (Call / WhatsApp) ---------- */
.row-item.has-contact { align-items: center; padding-right: 12px; }
.row-main { display: flex; align-items: flex-start; gap: 14px; flex: 1; min-width: 0; text-decoration: none; color: inherit; }
.row-item.has-contact:hover { background: #fafbff; }
.contact-btns { display: flex; gap: 6px; flex: none; }
.cbtn { width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; border: 1px solid var(--line); background: #fff; transition: background .12s, transform .08s; }
.cbtn:active { transform: scale(.95); }
.cbtn.call { color: var(--info); }
.cbtn.call:hover { background: var(--info-soft); }
.cbtn.wa { color: #15803d; }
.cbtn.wa:hover { background: #f0fdf4; }
.contact-btns.big .cbtn { width: auto; height: 42px; padding: 0 14px; font-size: 14px; font-weight: 650; }
.contact-btns.big .cbtn.call { background: var(--info-soft); border-color: #bfdbfe; }
.contact-btns.big .cbtn.wa { background: #f0fdf4; border-color: #bbf7d0; }
.contact-fld { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.contact-fld .grow { flex: 1; min-width: 140px; }
.t3 svg { vertical-align: -2px; }

.photo-wrap { position: relative; flex: none; }
.photo-cam { position: absolute; right: -6px; bottom: -6px; width: 32px; height: 32px; border-radius: 50%; background: var(--pri); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 0 0 3px #fff, var(--sh-2); }
.photo-cam:hover { background: var(--pri-dark); }

/* ---------- Zon bahaya: Padam (salah daftar) ---------- */
.danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 22px 16px 8px; padding: 14px 16px; border: 1px dashed #fecaca; border-radius: var(--r); background: #fffafa; }
.danger-zone.in-form { margin: 14px 0 4px; }

/* ---------- Dashboard berbilang cawangan ---------- */
.scope-bar { position: sticky; top: calc(var(--appbar) + 34px); z-index: 20; display: flex; gap: 6px; overflow-x: auto; padding: 10px 16px; margin: 4px 0 0;
  background: linear-gradient(var(--bg) 85%, transparent); scrollbar-width: none; }
.scope-bar::-webkit-scrollbar { display: none; }
.scope { flex: none; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); background: #fff; border-radius: 999px; padding: 7px 14px; font-size: 13.5px; font-weight: 650; color: var(--text-2); cursor: pointer; white-space: nowrap; }
.scope span { font-size: 11.5px; font-weight: 750; padding: 1px 7px; border-radius: 999px; background: #f1f5f9; color: var(--text-2); }
.scope.on { background: var(--text); border-color: var(--text); color: #fff; }
.scope.on span { background: rgba(255, 255, 255, .2); color: #fff; }
.dash-kpi .kpi.hero { background: linear-gradient(135deg, var(--pri), #9d174d); }
.meter { height: 6px; border-radius: 999px; background: rgba(255, 255, 255, .25); margin-top: 8px; overflow: hidden; }
.meter span { display: block; height: 100%; border-radius: 999px; background: #fff; }
.meter.sm { height: 4px; background: #eef2f7; margin-top: 6px; max-width: 160px; }
.meter.sm span { background: var(--ok); }
.branch-tbl td:first-child { min-width: 130px; }
.tbl tr.total td { font-weight: 750; background: #f8fafc; border-top: 1px solid var(--line); }
.dash-tabs { display: flex; gap: 4px; overflow-x: auto; padding: 8px; border-bottom: 1px solid #f1f5f9; scrollbar-width: none; }
.dash-tabs::-webkit-scrollbar { display: none; }
.dtab { flex: none; display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; border-radius: 10px; padding: 9px 12px; font-size: 13.5px; font-weight: 650; color: var(--muted); cursor: pointer; white-space: nowrap; }
.dtab:hover { background: #f8fafc; color: var(--text); }
.dtab.on { background: var(--pri-soft); color: var(--pri); }
.dtab.on .count-badge { background: #fff; color: var(--pri); }
.dash-pane .empty { margin: 12px; border: 0; background: #f8fafc; }
.deck.flush { margin: 0; border: 0; border-radius: 0; box-shadow: none; }
.show-more { display: block; width: calc(100% - 24px); margin: 10px 12px 12px; padding: 10px; border: 1px dashed var(--line-2); border-radius: 10px; background: #fff; color: var(--pri); font-weight: 650; cursor: pointer; }
.ann-list.pad-y { padding: 12px; }
@media (min-width: 1024px) { .scope-bar { top: calc(var(--appbar) + 34px); } }
@media (max-width: 600px) {
  .branch-tbl th:nth-child(4), .branch-tbl td:nth-child(4), .branch-tbl th:nth-child(5), .branch-tbl td:nth-child(5) { display: none; }
  .branch-tbl th, .branch-tbl td { padding-left: 10px; padding-right: 10px; }
  .branch-tbl td:first-child { min-width: 110px; }
}

/* Tab butiran: grid tetap di telefon (tiada swipe, tab terpilih sentiasa kelihatan). */
@media (max-width: 719px) {
  .dash-tabs { display: grid; grid-template-columns: 1fr 1fr; overflow: visible; }
  .dtab { justify-content: space-between; white-space: normal; text-align: left; min-height: 42px; }
}
.tbl .link { color: var(--pri); }
.tbl tr.click:focus-visible td { background: var(--pri-soft); outline: none; }
.chev-cell { width: 24px; color: var(--line-2); font-size: 20px; text-align: right; }

/* Nama pelajar dalam kelas / transfer boleh ditekan */
.roster-av { text-decoration: none; flex: none; }
a.name-link, a.tr-link { text-decoration: none; color: inherit; display: block; border-radius: 8px; }
a.name-link { display: inline-flex; align-items: center; gap: 6px; padding: 2px 0; }
a.name-link:hover, a.tr-link:hover .t1 { color: var(--pri); }
.name-chev { color: var(--line-2); font-weight: 400; font-size: 18px; margin-left: 4px; line-height: 1; }
.t1 .link, .t2 .link { color: var(--pri); }

/* ---------- Cuti ---------- */
.pill.cuti { background: var(--bad-soft); color: var(--bad); }
.h-cuti { margin-top: 6px; font-size: 13px; font-weight: 650; color: var(--bad); }
select.pick { margin-top: 8px; min-height: 150px; padding: 6px; background-image: none; }
select.pick option { padding: 8px 10px; border-radius: 8px; }

/* ---------- Kapasiti & waiting list ---------- */
.h-cap { margin-top: 6px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.h-cap.full { color: var(--warn); }
.h-cap a { color: var(--pri); }
.link-btn { border: 0; background: none; padding: 0; color: var(--pri); font: inherit; font-weight: 650; cursor: pointer; text-decoration: underline; }
.cbtn.enrol { color: var(--pri); }
.cbtn.enrol:hover { background: var(--pri-soft); }
.kpi.pos-kpi .kpi-v { color: var(--ok); }
.avatar b { font-size: 18px; }

.row-item.wl { flex-wrap: wrap; align-items: flex-start; }
.row-item.wl .contact-btns { width: 100%; justify-content: flex-end; margin-top: -4px; }

/* ---------- Link borang daftar & permohonan ---------- */
.page-seg { margin: 12px 16px 4px; }
.pad-x { padding: 0 18px; }
.share-card { margin: 12px 16px; padding: 14px 16px 12px; }
.share-h { font-weight: 700; font-size: 15px; margin-bottom: 2px; }
.copy-row { display: flex; gap: 8px; }
.copy-row input { flex: 1; min-width: 0; font-size: 13.5px; color: var(--text-2); }
.share-card textarea { font-size: 14px; min-height: 150px; }
.share-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px; }
.share-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 46px; border-radius: 12px; border: 1px solid var(--line-2); background: #fff; color: var(--text); font: inherit; font-weight: 650; font-size: 14.5px; cursor: pointer; text-decoration: none; }
.share-btn.wa { background: #16a34a; border-color: #16a34a; color: #fff; grid-column: 1 / -1; height: 50px; font-size: 15.5px; }
.ghost-btn { display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 14px; border-radius: 11px; border: 1px solid var(--line-2); background: #fff; color: var(--text); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; }
.ghost-btn.danger { color: var(--bad); }
.pri-btn { display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 16px; border: 0; border-radius: 11px; background: var(--pri); color: #fff; font: inherit; font-weight: 650; cursor: pointer; white-space: nowrap; }
.link-actions { display: flex; gap: 8px; justify-content: flex-end; margin: -4px 16px 16px; }
.branch-empty { display: flex; align-items: center; gap: 12px; margin: 12px 16px; padding: 14px 16px; }
.tpl-card { margin: 16px; padding: 4px 16px 14px; }
.tpl-card summary { cursor: pointer; font-weight: 650; padding: 12px 0; }
.tpl-card code { background: #f1f5f9; padding: 1px 5px; border-radius: 5px; font-size: 12.5px; }
.tpl-card .pri-btn { margin-top: 6px; }

/* ---------- Print Sijil ---------- */
.sj-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0 2px; }
.sj-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 8px 12px 90px; }
@media (min-width: 900px) { .sj-layout { grid-template-columns: minmax(0, 620px) 340px; align-items: start; } .sj-wrap { position: sticky; top: 70px; } }
.sj-wrap { background: #e7e8ec; padding: 10px; border-radius: 16px; }
.sj-stage { position: relative; width: 100%; background: #fff; overflow: hidden; box-shadow: 0 2px 10px rgba(0, 0, 0, .12); }
.sj-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; }
.sj-text { position: absolute; transform: translate(-50%, -50%); text-align: center; white-space: nowrap; line-height: 1; font-family: Arial, Helvetica, sans-serif; z-index: 2; }
.sj-sig { position: absolute; transform: translateX(-50%); object-fit: contain; z-index: 2; pointer-events: none; }
.sj-panel .card { margin-bottom: 12px; }
.sj-panel .card.pad { padding: 14px 16px; }
.sj-main { margin: 0 0 8px; }
.sj-full { width: 100%; justify-content: center; margin-bottom: 6px; }
.sj-frow { border-top: 1px solid var(--line); padding: 8px 0 2px; }
.sj-fname { font-weight: 650; font-size: 13.5px; margin-bottom: 4px; }
.sj-fgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.sj-num .ff-l { font-size: 11.5px; }
.sj-num input { padding: 0 6px; height: 40px; }
.sj-thumb { width: 44px; height: 60px; border-radius: 6px; overflow: hidden; background: #f1f5f9; display: grid; place-items: center; flex: none; }
.sj-thumb img { width: 100%; height: 100%; object-fit: cover; }
.group-h.flush { padding-left: 0; padding-right: 0; }
.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; padding: 6px 0; }
#sijilPrint { display: none; }
@media print {
  body.print-sijil > *:not(#sijilPrint) { display: none !important; }
  body.print-sijil { margin: 0 !important; padding: 0 !important; background: #fff !important; }
  body.print-sijil #sijilPrint { display: block !important; position: relative; overflow: hidden; }
  .sj-ptext { position: absolute; transform: translate(-50%, -50%); text-align: center; white-space: nowrap; line-height: 1; font-family: Arial, Helvetica, sans-serif; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .sj-psig { position: absolute; transform: translateX(-50%); object-fit: contain; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.seg a { flex: 1; display: grid; place-items: center; height: 42px; border-radius: 9px; font-size: 15px; font-weight: 600; color: var(--muted); text-decoration: none; }
.seg a.on { background: #fff; color: var(--pri); box-shadow: var(--sh-1); }

/* ---------- Editor template sijil (seret terus atas sijil) ---------- */
.sjx { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 6px 12px 100px; }
.sjx-top { position: sticky; top: 56px; z-index: 5; background: var(--bg); padding-bottom: 6px; }
.sjx-stagebox { display: flex; justify-content: center; background: #e7e8ec; border-radius: 14px; padding: 8px; }
.sjx-stage { position: relative; background: #fff; overflow: hidden; box-shadow: 0 2px 10px rgba(0, 0, 0, .14); touch-action: none; user-select: none; -webkit-user-select: none; }
.sjx-stage .sj-bg, .sjx-stage .sj-sig { pointer-events: none; }
.sjx-box { position: absolute; border: 1.5px dashed rgba(219, 39, 119, .55); border-radius: 3px; cursor: move; z-index: 4; }
.sjx-box:hover { border-color: var(--pri); background: rgba(219, 39, 119, .05); }
.sjx-box.on { border: 2px solid var(--pri); background: rgba(219, 39, 119, .08); }
.sjx-box.sig { border-color: rgba(37, 99, 235, .6); }
.sjx-box.sig.on { border-color: #2563eb; background: rgba(37, 99, 235, .07); }
.sjx-tag { position: absolute; left: -1px; top: -15px; font: 600 9.5px/14px system-ui, sans-serif; padding: 0 5px; border-radius: 4px 4px 0 0; background: rgba(219, 39, 119, .75); color: #fff; white-space: nowrap; pointer-events: none; opacity: 0; }
.sjx-box:hover .sjx-tag, .sjx-box.on .sjx-tag { opacity: 1; }
.sjx-box.sig .sjx-tag { background: rgba(37, 99, 235, .8); }
.sjx-ph { position: absolute; inset: 0; display: grid; place-items: center; font: 600 9px system-ui; color: #2563eb; text-align: center; pointer-events: none; }
.sjx-h { position: absolute; width: 14px; height: 14px; background: #fff; border: 2px solid var(--pri); border-radius: 50%; display: none; touch-action: none; }
.sjx-box.on .sjx-h { display: block; }
.sjx-h.l { left: -8px; top: 50%; margin-top: -7px; cursor: ew-resize; }
.sjx-h.r { right: -8px; top: 50%; margin-top: -7px; cursor: ew-resize; }
.sjx-h.br { right: -8px; bottom: -8px; cursor: nwse-resize; border-color: #2563eb; }
@media (pointer: coarse) { .sjx-h { width: 22px; height: 22px; } .sjx-h.l, .sjx-h.r { margin-top: -11px; } .sjx-h.l { left: -12px; } .sjx-h.r { right: -12px; } .sjx-h.br { right: -12px; bottom: -12px; } }
.sjx-guide { position: absolute; left: 50%; top: 0; bottom: 0; width: 0; border-left: 1.5px dashed #ec4899; z-index: 3; pointer-events: none; }
.sjx-tools { margin-top: 8px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 8px 10px; box-shadow: var(--sh-1); }
.sjx-hint { font-size: 13px; color: var(--text-2); line-height: 1.45; margin-bottom: 6px; }
.sjx-sel { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; font-size: 14px; }
.sjx-sel .muted { flex: 1; }
.sjx-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sjx-pad { display: inline-flex; gap: 3px; }
.sjx-b { min-width: 40px; height: 38px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; font: inherit; font-weight: 650; font-size: 14px; cursor: pointer; color: var(--text); }
.sjx-b:active { background: var(--pri-soft, #fdf2f8); }
.sjx-b:disabled { opacity: .4; }
.sjx-chip { height: 32px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line-2); background: #f8fafc; font: inherit; font-size: 12.5px; cursor: pointer; }
.sjx-x { border: 0; background: var(--pri); color: #fff; border-radius: 9px; height: 32px; padding: 0 12px; font: inherit; font-weight: 650; cursor: pointer; }
.row.wrap { flex-wrap: wrap; }
@media (min-width: 900px) {
  .sjx { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
  .sjx-top { top: 70px; }
}

.cal-pad { display: grid; grid-template-columns: 44px 1fr 44px; gap: 4px; max-width: 220px; margin: 8px auto; align-items: center; }
.cal-pad .sjx-b { width: 44px; }
.cal-val { text-align: center; font-weight: 650; font-size: 13px; color: var(--text-2); }

/* ---------- Pilih: tambah cawangan vs pusat berasingan ---------- */
.pick-2 { display: grid; gap: 12px; padding: 12px 16px; }
@media (min-width: 760px) { .pick-2 { grid-template-columns: 1fr 1fr; } }
.pick-card { display: flex; gap: 12px; text-align: left; padding: 16px; border-radius: 16px; border: 2px solid var(--pri); background: #fff; color: var(--text); text-decoration: none; font: inherit; cursor: pointer; box-shadow: var(--sh-1); }
.pick-card.alt { border-color: var(--line-2); }
.pick-card p { margin: 6px 0 8px; color: var(--text-2); font-size: 14px; line-height: 1.45; }
.pick-ic { font-size: 30px; line-height: 1; }
.pick-go { font-weight: 700; color: var(--pri); font-size: 14px; }
.pick-card.alt .pick-go { color: var(--text-2); }
.sep-ok { align-items: flex-start; background: #fff7ed; border: 1px solid #fed7aa; border-radius: 12px; padding: 10px 12px; line-height: 1.45; }
.sep-ok input { margin-top: 3px; }

/* ---------- Halaman sijil padat (pratonton + panel bertab, satu skrin) ---------- */
.sjk { display: flex; flex-direction: column; gap: 8px; padding: 6px 10px 0; overflow: hidden; }
.sjk-stagebox { flex: 0 0 auto; display: flex; align-items: center; justify-content: center; background: #e7e8ec; border-radius: 14px; padding: 8px; min-height: 0; }
.sjk-stage { position: relative; background: #fff; overflow: hidden; box-shadow: 0 2px 10px rgba(0, 0, 0, .14); touch-action: none; user-select: none; -webkit-user-select: none; }
.sjk-stage .sj-bg, .sjk-stage .sj-sig { pointer-events: none; }
.sjk-panel { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--sh-1); overflow: hidden; }
.sjk-tabs { display: flex; gap: 2px; padding: 4px; background: #f1f5f9; border-bottom: 1px solid var(--line); flex: none; overflow-x: auto; }
.sjk-tabs button { flex: 1; white-space: nowrap; height: 36px; padding: 0 8px; border: 0; border-radius: 9px; background: transparent; font: inherit; font-size: 13.5px; font-weight: 650; color: var(--muted); cursor: pointer; }
.sjk-tabs button.on { background: #fff; color: var(--pri); box-shadow: var(--sh-1); }
.sjk-body { flex: 1 1 auto; overflow-y: auto; padding: 10px 12px 14px; -webkit-overflow-scrolling: touch; }
.sjk-body .ff { margin-bottom: 8px; }
.sjk-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 15px; }
.sjk-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 8px; margin: 10px 0 4px; }
.pri-btn.big, .ghost-btn.big { height: 50px; justify-content: center; font-size: 15.5px; }
.up-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 6px; }
.up-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 46px; padding: 0 16px; border-radius: 12px; background: var(--pri); color: #fff; font-weight: 700; font-size: 14.5px; cursor: pointer; border: 0; font-family: inherit; }
.up-btn.off { background: #cbd5e1; cursor: not-allowed; }
.up-btn.wide { width: 100%; margin-bottom: 8px; }
.sjx-nobg { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: #94a3b8; font: 600 12px/1.5 system-ui, sans-serif; background: repeating-linear-gradient(45deg, #f8fafc 0 10px, #f1f5f9 10px 20px); pointer-events: none; }
.sjx-grid { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; }
.sjx-pad3 { display: grid; grid-template-columns: repeat(3, 40px); grid-template-rows: repeat(3, 36px); gap: 3px; }
.sjx-pad3 .sjx-b { min-width: 0; width: 40px; height: 36px; padding: 0; }
.sjx-col { display: flex; flex-direction: column; gap: 8px; }
.sjx-size { display: flex; align-items: center; gap: 8px; }
.sjx-size span { font-size: 12.5px; color: var(--muted); flex: 1; text-align: center; }
.sjx-size .sjx-b { min-width: 48px; font-size: 16px; }
@media (min-width: 900px) {
  .sjk { flex-direction: row; padding: 10px 16px 0; }
  .sjk-stagebox { flex: 1 1 auto; }
  .sjk-panel { flex: 0 0 380px; }
}

/* ---------- Tetapan gaji fleksibel ---------- */
.pay-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 4px 16px 6px; }
@media (min-width: 900px) { .pay-tiles { grid-template-columns: repeat(4, 1fr); } }
.pay-tile { display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: 14px; border: 1px solid var(--line-2); background: #fff; color: var(--text); text-decoration: none; box-shadow: var(--sh-1); }
.pay-tile:hover { border-color: var(--pri); }
.pt-ic { font-size: 24px; }
.pt-n { margin-top: auto; font-weight: 700; color: var(--pri); font-size: 13px; }
.pay-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.pay-seg button { min-height: 46px; border: 1.5px solid var(--line-2); border-radius: 12px; background: #fff; font: inherit; font-weight: 650; font-size: 14px; cursor: pointer; color: var(--text-2); }
.pay-seg button.on { border-color: var(--pri); background: var(--pri-soft, #fdf2f8); color: var(--pri); }
.rm-in { display: flex; align-items: center; gap: 8px; }
.rm-in input { flex: 1; }
.rm-in span { font-weight: 650; color: var(--muted); white-space: nowrap; }
.pay-eg { background: #f8fafc; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: 13.5px; line-height: 1.5; margin-top: 6px; }
.row-item.dim { opacity: .55; }
.adj-form { display: grid; grid-template-columns: 110px 100px 1fr auto; gap: 8px; padding: 8px 16px; }
.adj-form select, .adj-form input { height: 42px; border: 1px solid var(--line-2); border-radius: 10px; padding: 0 10px; font: inherit; }
@media (max-width: 600px) { .adj-form { grid-template-columns: 1fr 1fr; } .adj-form input#adjNote { grid-column: 1 / -1; } .adj-form button { grid-column: 1 / -1; } }

/* ---------- Alat smart crop sijil ---------- */
body.crop-open { overflow: hidden; }
.crop-ov { position: fixed; inset: 0; z-index: 200; background: #0f172a; display: flex; flex-direction: column; color: #fff; }
.crop-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; background: #111827; }
.crop-bar b { font-size: 15px; }
.crop-bar .ghost-btn { background: transparent; color: #fff; border-color: #475569; }
.crop-area { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; touch-action: none; user-select: none; overflow: hidden; }
#cropCv { display: block; }
#cropSvg { position: absolute; left: 0; top: 0; pointer-events: none; }
.crop-pin { position: absolute; width: 28px; height: 28px; margin: -14px 0 0 -14px; border-radius: 50%; background: rgba(236, 72, 153, .25); border: 3px solid #ec4899; box-shadow: 0 0 0 2px #fff; cursor: grab; touch-action: none; }
.crop-pin::after { content: ''; position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; margin: -2px; border-radius: 50%; background: #fff; }
.crop-loupe { position: absolute; width: 120px; height: 120px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 4px 16px rgba(0, 0, 0, .5); pointer-events: none; }
.crop-tools { background: #fff; color: var(--text); padding: 10px 12px calc(12px + env(safe-area-inset-bottom)); }
.crop-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; font-size: 14px; }
.crop-row select, .crop-row input { height: 38px; border: 1px solid var(--line-2); border-radius: 9px; padding: 0 8px; font: inherit; }

/* ---------- Pad tandatangan ---------- */
.sig-area { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 16px; }
.sig-paper { position: relative; width: min(100%, 900px); aspect-ratio: 8 / 3; max-height: 100%; background: #fff; border-radius: 14px; box-shadow: 0 4px 20px rgba(0, 0, 0, .35); overflow: hidden; }
#sigCv { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; z-index: 2; }
.sig-line { position: absolute; left: 8%; right: 8%; bottom: 24%; border-bottom: 1.5px dashed #cbd5e1; z-index: 1; }
.sig-hint { position: absolute; left: 0; right: 0; bottom: 27%; text-align: center; color: #94a3b8; font-size: 15px; z-index: 1; pointer-events: none; }
.sig-col { width: 34px; height: 34px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--line-2); cursor: pointer; }
.sig-col.on { box-shadow: 0 0 0 3px var(--pri); }
.sjx-b.on { border-color: var(--pri); color: var(--pri); background: var(--pri-soft, #fdf2f8); }
.ghost-btn.wide-g { width: 100%; justify-content: center; margin-bottom: 8px; height: 46px; }

/* ---------- Student Summary ---------- */
.ss-top { display: flex; gap: 8px; flex-wrap: wrap; padding: 8px 16px 0; align-items: center; }
.ss-top select { height: 42px; border: 1px solid var(--line-2); border-radius: 10px; padding: 0 10px; font: inherit; flex: 1; min-width: 160px; }
.ss-chart { padding: 4px 16px 4px; }
.ss-row { display: grid; grid-template-columns: 74px 1fr 84px; gap: 8px; align-items: center; margin: 6px 0; font-size: 13.5px; }
.ss-bars { display: flex; flex-direction: column; gap: 3px; }
.ss-bar { display: block; height: 9px; border-radius: 5px; }
.ss-bar.l, .ss-dot.l { background: #3b82f6; }
.ss-bar.p, .ss-dot.p { background: #ec4899; }
.ss-n { text-align: right; color: var(--muted); font-size: 12.5px; }
.ss-legend { display: flex; align-items: center; gap: 6px; padding: 0 16px 8px; font-size: 12.5px; color: var(--muted); }
.ss-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-left: 6px; }
.ss-tbl td:not(:first-child), .ss-tbl th:not(:first-child) { text-align: right; }
.ss-total td { font-weight: 700; background: #f8fafc; }

/* ---------- Yuran ---------- */
.yr-bal { margin-top: 4px; font-weight: 750; font-size: 16px; color: var(--ok); }
.yr-bal.due { color: var(--bad); }
.yr-pick { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.yr-inv { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; font-size: 14px; }
.yr-inv input { width: 18px; height: 18px; accent-color: var(--pri); }
.yr-tbl input.yr-in { width: 90px; height: 38px; border: 1px solid var(--line-2); border-radius: 9px; padding: 0 8px; font: inherit; }
.receipt { margin: 12px 16px; background: #fff; border: 1px dashed var(--line-2); border-radius: 14px; padding: 18px; max-width: 460px; position: relative; }
.receipt.void { opacity: .7; }
.rc-h { text-align: center; font-size: 16px; }
.rc-t { text-align: center; letter-spacing: .14em; font-weight: 800; font-size: 13px; color: var(--muted); margin: 8px 0 12px; }
.rc-row { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; font-size: 14px; }
.rc-items { border-top: 1px dashed var(--line); border-bottom: 1px dashed var(--line); margin: 8px 0; padding: 6px 0; }
.rc-total { font-size: 17px; }
.rc-void { margin-top: 10px; text-align: center; font-weight: 800; color: var(--bad); border: 2px solid var(--bad); border-radius: 8px; padding: 6px; }
@media print { body:not(.print-sijil) .ab, body:not(.print-sijil) .share-btns, body:not(.print-sijil) #tabs, body:not(.print-sijil) .drawer, body:not(.print-sijil) .banner { display: none !important; } }

/* ---------- Kewangan ---------- */
.fin-bar { display: flex; gap: 8px; padding: 10px 16px 0; }
.fin-bar input, .fin-bar select { height: 40px; border: 1px solid var(--line-2); border-radius: 10px; padding: 0 10px; font: inherit; background: #fff; }
.fin-legend { display: flex; gap: 14px; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.fin-legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.sw.a, .fin-bars i.a { background: #2a78d6; }
.sw.b, .fin-bars i.b { background: #e0892b; }
.fin-chart { display: flex; gap: 6px; height: 150px; align-items: stretch; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.fin-col { flex: 1; display: flex; flex-direction: column; cursor: default; }
.fin-col.cur .fin-lb { font-weight: 800; color: var(--ink); }
.fin-bars { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 2px; }
.fin-bars i { width: 38%; max-width: 18px; border-radius: 4px 4px 0 0; min-height: 1px; }
.fin-lb { text-align: center; font-size: 12px; color: var(--muted); padding: 4px 0; }
.fin-tbl td, .fin-tbl th { white-space: nowrap; }
.fin-tbl b.neg { color: var(--bad); } .fin-tbl b.pos { color: var(--ok); }
.fin-profit { display: flex; flex-direction: column; align-items: flex-end; font-size: 15px; }
.fin-profit b.neg { color: var(--bad); } .fin-profit b.pos { color: var(--ok); }
