:root {
  --ink: #1E1530;
  --ink-2: #3D3550;
  --muted: #5E5670;
  --purple: #4A2477;
  --purple-dk: #2E1650;
  --purple-hv: #3B2063;
  --gold: #C99A2E;
  --bg: #F6F4F9;
  --surface: #FFFFFF;
  --th: #FAF9FC;
  --line: #E4DFEC;
  --line-2: #F0ECF5;
  --field: #CFC7DB;
  --soft: #EAE6F5;
  --ok-bg: #E3F2EA; --ok-fg: #1C5E3A;
  --warn-bg: #FFF1DB; --warn-fg: #8A5300;
  --err-bg: #FCE8E6; --err-fg: #A1260F;
  --gray-bg: #EEEEF0; --gray-fg: #45434F;
  --info-bg: #EAF1FB; --info-fg: #1F4E8C;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif; color: var(--ink); background: var(--bg); font-size: 14px; line-height: 1.5; }
a { color: var(--purple); }
a:hover { color: var(--purple-dk); }
code, .mono, .code { font-family: ui-monospace, 'SFMono-Regular', Consolas, monospace; font-size: 13px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Kerangka ---------- */
.app { display: flex; flex-wrap: wrap; min-height: 100vh; }
.sidebar { flex: 1 1 240px; background: var(--purple-dk); color: #fff; padding: 28px 16px; display: flex; flex-direction: column; gap: 28px; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px; color: #fff; text-decoration: none; }
.brand:hover { color: #fff; }
.logo { flex: none; width: 40px; height: 40px; border-radius: 10px; background: #fff; color: var(--purple-dk); box-shadow: 0 0 0 2px rgba(201,154,46,.55); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; }
.logo-lg { width: 52px; height: 52px; border-radius: 12px; font-size: 17px; }
.logo img { width: 76%; height: 76%; object-fit: contain; display: block; }
.brand-name { display: block; font-weight: 700; font-size: 14px; line-height: 1.25; }
.brand-sub { display: block; font-size: 12px; color: #CFC3E3; }
.nav { display: flex; flex-direction: column; gap: 4px; margin: 0; }
.nav-label { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #B9AAD3; padding: 16px 12px 4px; }
.nav a, .nav button { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 8px; color: #E4DCF0; text-decoration: none; font: inherit; font-size: 14px; font-weight: 500; background: none; border: 0; cursor: pointer; width: 100%; text-align: left; }
.nav a:hover, .nav button:hover { background: var(--purple-hv); color: #fff; }
.nav a[aria-current="page"] { background: var(--purple); color: #fff; font-weight: 600; }
.nav-bottom { margin-top: auto; border-top: 1px solid #4A3468; padding-top: 16px; }
.content { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 32px; background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-title { display: flex; flex-direction: column; gap: 2px; }
.crumb { font-size: 12px; color: var(--muted); font-weight: 500; }
.page-title { font-size: 20px; font-weight: 700; color: var(--purple-dk); }
.me { display: flex; align-items: center; gap: 10px; }
.me-text { display: flex; flex-direction: column; }
.me-name { font-weight: 600; font-size: 14px; }
.me-sub { font-size: 12px; color: var(--muted); }
.avatar { flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--soft); color: var(--purple); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; }
.avatar-sm { width: 32px; height: 32px; font-size: 12px; }
.avatar-lg { width: 72px; height: 72px; font-size: 24px; font-weight: 800; }
.main { padding: 32px; display: flex; flex-direction: column; gap: 24px; width: 100%; max-width: 1200px; }
.main > *, .stack > * { min-width: 0; }

@media (max-width: 820px) {
  .sidebar { flex-basis: 100%; padding: 16px; gap: 12px; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav a, .nav button { width: auto; }
  .nav-label { width: 100%; padding-top: 8px; }
  .nav-bottom { margin-top: 0; padding-top: 8px; }
  .topbar { padding: 14px 16px; }
  .main { padding: 20px 16px; }
}

/* ---------- Tipografi & utiliti ---------- */
.h1 { margin: 0; font-size: 26px; line-height: 1.25; font-weight: 800; color: var(--purple-dk); }
.h2 { margin: 0; font-size: 17px; font-weight: 700; color: var(--purple-dk); }
.lead { margin: 0; font-size: 15px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.pre { margin: 0; white-space: pre-wrap; }
.stack { display: flex; flex-direction: column; gap: 20px; }
.stack-sm { display: flex; flex-direction: column; gap: 6px; }
.stack-xs { display: flex; flex-direction: column; gap: 3px; }
.row-sm { display: flex; gap: 8px; }
.row-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.actions form { margin: 0; }
.actions-end { justify-content: flex-end; }
.link-strong { font-weight: 600; text-decoration: none; }

/* ---------- Butang ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 10px; border: 1px solid var(--field); background: var(--surface); color: var(--purple-dk); font: inherit; font-size: 14px; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--purple); color: var(--purple-dk); background: var(--th); }
.btn-primary { background: var(--purple); border-color: var(--purple); color: #fff; }
.btn-primary:hover { background: var(--purple-dk); border-color: var(--purple-dk); color: #fff; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--purple); }
.btn-ghost:hover { background: var(--soft); border-color: transparent; }
.btn-danger { color: var(--err-fg); border-color: #E7B9B1; }
.btn-danger:hover { background: var(--err-bg); border-color: var(--err-fg); color: var(--err-fg); }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn-lg { min-height: 52px; border-radius: 12px; font-size: 15px; font-weight: 700; }
.btn-block { width: 100%; }

/* ---------- Kad ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 24px; }
.card-flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.split { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.split-main { flex: 2 1 520px; min-width: 0; }
.split-side { flex: 1 1 280px; min-width: 0; }
.empty { padding: 32px 20px; text-align: center; color: var(--muted); }

/* ---------- Statistik ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px; display: flex; flex-direction: column; gap: 8px; }
.card .stat { background: var(--th); }
.stat-label { font-size: 13px; color: var(--muted); font-weight: 600; }
.stat-num { font-size: 36px; font-weight: 800; line-height: 1; color: var(--purple-dk); }
.stat-sub { font-size: 12px; color: var(--muted); }
.c-warn { color: var(--warn-fg); }
.c-purple { color: var(--purple); }
.c-ink { color: var(--ink); }

/* ---------- Jadual ---------- */
.table-wrap { overflow-x: auto; position: relative; }
.table { width: 100%; border-collapse: collapse; min-width: 560px; }
.table th { text-align: left; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); background: var(--th); padding: 12px 16px; white-space: nowrap; }
.table td { padding: 14px 16px; border-top: 1px solid var(--line-2); vertical-align: middle; font-size: 14px; }
.table th:first-child, .table td:first-child { padding-left: 20px; }
.table tbody tr:hover { background: #FCFBFE; }
.cell-title { display: block; font-weight: 600; color: var(--ink); text-decoration: none; }
a.cell-title:hover { color: var(--purple); text-decoration: underline; }
.cell-sub { display: block; font-size: 12px; color: var(--muted); }
.table-foot { padding: 14px 20px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.person { display: flex; align-items: center; gap: 10px; }

/* ---------- Lencana ---------- */
.badge { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.b-aktif { background: var(--ok-bg); color: var(--ok-fg); }
.b-akan-tamat { background: var(--warn-bg); color: var(--warn-fg); }
.b-menunggu { background: var(--soft); color: var(--purple); }
.b-ditolak { background: var(--err-bg); color: var(--err-fg); }
.b-tamat, .b-draf { background: var(--gray-bg); color: var(--gray-fg); }
.b-belum { background: var(--info-bg); color: var(--info-fg); }

/* ---------- Perlu perhatian ---------- */
.todo { display: flex; gap: 12px; padding: 16px 20px; border-top: 1px solid var(--line-2); }
.card-head + .todo { border-top: 0; }
.todo-icon { flex: none; width: 36px; height: 36px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; }
.t-warn { background: var(--warn-bg); color: var(--warn-fg); }
.t-info { background: var(--soft); color: var(--purple); }
.t-err { background: var(--err-bg); color: var(--err-fg); }
.t-muted { background: var(--gray-bg); color: var(--gray-fg); }

/* ---------- Borang ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; padding: 16px 20px; }
.filters .field { flex: 1 1 180px; }
.filters .grow-2 { flex: 2 1 260px; }
.filters .grow-0 { flex: 0 1 160px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.req { color: var(--err-fg); }
input[type="text"], input[type="email"], input[type="search"], input[type="tel"], input[type="date"], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--field); border-radius: 8px; font: inherit; font-size: 14px; color: var(--ink); background: #fff;
}
textarea { resize: vertical; min-height: 88px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--purple); box-shadow: 0 0 0 3px rgba(74, 36, 119, .18); }
[aria-invalid="true"] { border-color: var(--err-fg); }
.field-error { font-size: 12px; color: var(--err-fg); font-weight: 500; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 14px; }
.check input { width: 18px; height: 18px; accent-color: var(--purple); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; }
.dropzone { border: 2px dashed var(--field); border-radius: 12px; padding: 24px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; background: var(--th); color: var(--purple); }
.dropzone .muted, .dropzone .strong { color: inherit; }
.dropzone .strong { color: var(--ink); }
.dropzone .muted { color: var(--muted); }
.dropzone input { font: inherit; font-size: 13px; color: var(--ink); max-width: 100%; }
.step { display: flex; gap: 12px; }
.step-num { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--soft); color: var(--purple); display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; }
.step-num.on { background: var(--purple); color: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--field); background: #fff; color: var(--purple-dk); font-size: 14px; font-weight: 600; text-decoration: none; }
.chip:hover { border-color: var(--purple); }
.chip[aria-current="true"] { background: var(--purple-dk); border-color: var(--purple-dk); color: #fff; }

/* ---------- Senarai maklumat ---------- */
.dl { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px 32px; }
.dl-1 { grid-template-columns: 1fr; gap: 14px; }
.dl-item { display: flex; flex-direction: column; gap: 4px; }
.dl dt, .dt { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.dl dd { margin: 0; font-size: 15px; font-weight: 500; overflow-wrap: anywhere; }
.dl dd a { display: inline-flex; align-items: center; gap: 6px; }
.profile-head { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; }
.profile-name { font-size: 22px; font-weight: 800; color: var(--purple-dk); }

/* ---------- Makluman ---------- */
.alert { padding: 14px 16px; border-radius: 10px; font-size: 14px; border: 1px solid transparent; }
.alert-ok { background: var(--ok-bg); color: var(--ok-fg); border-color: #BFE0CD; }
.alert-warn { background: var(--warn-bg); color: var(--warn-fg); border-color: #F2D3A2; }
.alert-err { background: var(--err-bg); color: var(--err-fg); border-color: #F0C2BA; }
.alert-info { background: var(--info-bg); color: var(--info-fg); border-color: #C9DAF1; }
.err-list { margin: 0; padding-left: 20px; color: var(--err-fg); font-size: 13px; }
.code { margin: 0; padding: 14px 16px; background: var(--th); border: 1px solid var(--line); border-radius: 8px; overflow-x: auto; }

/* ---------- Pengesahan ---------- */
.review { gap: 14px; }
.review-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; }
.review-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; border-top: 1px solid var(--line-2); padding-top: 14px; }
.review-actions form { margin: 0; }
.review-actions .grow { flex: 1 1 320px; }

/* ---------- Log masuk ---------- */
.login-body { background: var(--purple-dk); }
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 48px 16px; }
.login-card { width: 100%; max-width: 440px; background: #fff; border-radius: 20px; padding: 40px 36px; display: flex; flex-direction: column; gap: 24px; }
.login-brand { display: flex; align-items: center; gap: 14px; font-size: 13px; font-weight: 500; }
.login-title { margin: 0; font-size: 28px; line-height: 1.2; font-weight: 800; color: var(--purple-dk); }
.note { display: flex; gap: 10px; align-items: flex-start; background: var(--bg); border-radius: 10px; padding: 14px; color: var(--purple); }
.note p { margin: 0; font-size: 13px; line-height: 1.55; color: var(--ink-2); }
.note svg { flex: none; margin-top: 2px; }
.dev-login { display: flex; flex-direction: column; gap: 6px; padding-top: 16px; border-top: 1px dashed var(--field); }
.dev-login label { font-size: 12px; font-weight: 600; color: var(--warn-fg); }

/* ---------- Cetak ---------- */
.print-body { background: #fff; }
.print { max-width: 1000px; margin: 0 auto; padding: 32px 24px; }
.print-bar { display: flex; justify-content: flex-end; margin-bottom: 24px; }
.print-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; border-bottom: 3px solid var(--purple-dk); padding-bottom: 12px; margin-bottom: 20px; }
.print-head h1 { margin: 0; font-size: 22px; color: var(--purple-dk); }
.print-head p { margin: 0; color: var(--muted); }
.print-info { width: 100%; border-collapse: collapse; margin-bottom: 20px; font-size: 13px; }
.print-info th { text-align: left; color: var(--muted); font-weight: 600; padding: 4px 12px 4px 0; width: 110px; }
.print-info td { padding: 4px 16px 4px 0; }
.print-table { min-width: 0; border: 1px solid var(--line); }
.print-table td, .print-table th { padding: 8px 10px; font-size: 12px; }
.print-note { font-size: 12px; color: var(--muted); }
@media print {
  .no-print { display: none !important; }
  .print { padding: 0; }
  @page { size: A4 landscape; margin: 14mm; }
}

/* ---------- Ketua PTJ ---------- */
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--purple); }
.nav-count { flex: none; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--gold); color: var(--purple-dk); font-size: 12px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; }
.table th.num, .table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(48px, 1fr) 24px; align-items: center; gap: 12px; font-size: 13px; }
.bar-name { color: var(--ink); text-decoration: none; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-name:hover { color: var(--purple); text-decoration: underline; }
.bar-track { height: 10px; border-radius: 999px; background: var(--line-2); overflow: hidden; }
.bar-fill { display: block; height: 100%; min-width: 0; border-radius: 999px; background: var(--purple); }
.bar-val { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.summary-row { display: flex; flex-wrap: wrap; gap: 8px; }
.summary-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.summary-pill strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.row-top { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.pick { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--purple); flex: none; }
.ptj-switch { display: flex; align-items: center; gap: 8px; }
.ptj-switch label { font-size: 13px; font-weight: 600; color: var(--muted); }
.ptj-switch select { min-height: 36px; padding: 6px 10px; width: auto; max-width: 260px; }

/* ---------- Penetapan Ketua PTJ ---------- */
.head-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.head-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.head-card.is-empty { border-style: dashed; border-color: #E9C98F; background: #FFFBF3; }
.head-ptj { font-size: 13px; font-weight: 700; color: var(--purple-dk); display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.head-kod { font-size: 11px; font-weight: 700; letter-spacing: .04em; padding: 2px 6px; border-radius: 4px; background: var(--soft); color: var(--purple); }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.row-actions form { margin: 0; }
.link-badge { text-decoration: none; }
.link-badge:hover { text-decoration: underline; color: var(--warn-fg); }
.narrow { max-width: 720px; }
.table .col-wide { min-width: 200px; }
.head-next { font-size: 12px; color: var(--info-fg); background: var(--info-bg); border-radius: 8px; padding: 6px 10px; }
.row-actions { flex-wrap: nowrap; }

/* ---------- Bukan jawatankuasa (tugas hakiki / pentadbir akademik) ---------- */
.b-tidak-dikira { background: #F3E8D7; color: #6B4A12; text-decoration: line-through; text-decoration-thickness: 1px; }
.notice { background: #FFF8EC; border: 1px solid #F2D3A2; border-radius: 14px; padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; color: var(--ink); }
.notice-head { display: flex; align-items: center; gap: 10px; color: var(--warn-fg); }
.notice-head .h2 { color: var(--warn-fg); }
.notice p { margin: 0; }
.notice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px 24px; }
.notice-label { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--warn-fg); }
.notice ul { margin: 6px 0 0; padding-left: 18px; font-size: 14px; display: grid; gap: 2px; }
.notice-row { display: flex; gap: 10px; align-items: flex-start; }
.notice-row svg { flex: none; margin-top: 2px; }
.hakiki { border: 1px solid #F2D3A2; background: #FFF8EC; border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.hakiki.is-error { border-color: var(--err-fg); background: var(--err-bg); }
.hakiki-text { margin: 0; font-size: 13px; color: #6B4A12; }
.hakiki.is-error .hakiki-text { color: var(--err-fg); }
.hakiki .check { min-height: 0; font-size: 13px; align-items: flex-start; }
.hakiki .check input { margin-top: 2px; flex: none; }
.btn-warn { color: #6B4A12; border-color: #E9C98F; background: #FFF8EC; }
.btn-warn:hover { background: #FBEBD0; border-color: #C99A2E; color: #6B4A12; }

/* ---------- Kumpulan lantikan (Aktif / Akan Bermula / Tamat) ---------- */
.card-head .count { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 22px; padding: 0 8px; margin-left: 6px; border-radius: 999px; background: var(--soft); color: var(--purple); font-size: 12px; font-weight: 700; vertical-align: middle; font-variant-numeric: tabular-nums; }
.group-aktif { border-left: 4px solid #2E8B57; }
.group-akan { border-left: 4px solid var(--info-fg); }
.group-tamat { opacity: .92; }
.group-tidak { border-left: 4px solid #C9A86A; opacity: .9; }
.group-tidak .count { background: #F3E8D7; color: #6B4A12; }
.group-tamat { border-left: 4px solid #A9A4B5; }
.group-tamat .count { background: var(--gray-bg); color: var(--gray-fg); }

/* ---------- Versi & hak cipta ---------- */
.nav-bottom { display: flex; flex-direction: column; gap: 8px; }
.versi { display: block; padding: 4px 12px; font-size: 12px; font-weight: 600; color: #B9AAD3; text-decoration: none; font-variant-numeric: tabular-nums; }
.versi span { font-weight: 400; }
.versi:hover { color: #FFFFFF; text-decoration: underline; }
.site-footer { margin-top: auto; padding: 18px 32px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 24px; font-size: 12px; color: var(--muted); background: var(--surface); }
.site-footer.on-dark { margin-top: 24px; padding: 0; border: 0; background: none; color: #CFC3E3; justify-content: center; text-align: center; flex-direction: column; align-items: center; max-width: 440px; }
.login-wrap { flex-direction: column; }
.login-versi { font-size: 11px; color: #9C8CB8; margin-top: 6px; }
.release { display: flex; flex-direction: column; gap: 6px; padding-bottom: 16px; border-bottom: 1px solid var(--line-2); }
.release:last-child { border-bottom: 0; padding-bottom: 0; }
.release-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.release-ver { font-weight: 800; color: var(--purple-dk); font-variant-numeric: tabular-nums; }
.release ul { margin: 0; padding-left: 20px; font-size: 14px; display: grid; gap: 3px; }
@media (max-width: 820px) { .site-footer { padding: 14px 16px; } .nav-bottom { flex-direction: row; flex-wrap: wrap; align-items: center; } }

/* ---------- Dashboard PTJ: tiada / kurang lantikan ---------- */
.people { list-style: none; margin: 0; padding: 0; max-height: 420px; overflow-y: auto; }
.people li + li { border-top: 1px solid var(--line-2); }
.people .person { padding: 12px 20px; text-decoration: none; color: inherit; }
.people .person:hover { background: var(--th); }
.kurang-head { flex-wrap: wrap; align-items: flex-start; }
.kurang-head .chips { justify-content: flex-end; }
.meter { display: grid; grid-template-columns: minmax(80px, 160px) 24px; align-items: center; gap: 10px; }
.bar-fill.is-zero { min-width: 0; }

/* ---------- Surat lantikan (v1.7.0) ---------- */
.templat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.templat-kad { display: flex; flex-direction: column; gap: 8px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); background: var(--th); min-width: 0; }
.templat-kad:hover { border-color: var(--purple); background: #fff; color: var(--ink); }
.templat-perkara { overflow-wrap: anywhere; }
.pilihan-kad { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.pilihan { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--field); border-radius: 12px; cursor: pointer; min-width: 0; }
.pilihan > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pilihan input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--purple); flex: none; }
.pilihan:has(input:checked) { border-color: var(--purple); background: var(--soft); }
.ulang { display: flex; flex-direction: column; gap: 12px; }
.ulang-baris { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin: 0; min-width: 0; }
.sesi-baris .actions { margin-top: 8px; }
.penerima-baris { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.penerima-baris .field { flex: 1 1 200px; min-width: 0; }
.penerima-baris .grow-2 { flex: 2 1 280px; }
.penerima-baris .grow-0 { flex: 0 1 150px; }
.penerima-baris select { width: 100%; }
.w-label { flex: 0 0 38%; min-width: 0; }
.row-sm > input { min-width: 0; flex: 1 1 auto; }
.pemegang { border: 1px dashed var(--field); border-radius: 10px; padding: 10px 14px; background: var(--th); }
.pemegang summary { cursor: pointer; font-weight: 600; color: var(--purple-dk); }
.pemegang .dl { margin-top: 10px; }
.teks-surat { font-family: Arial, 'Liberation Sans', sans-serif; font-size: 14px; line-height: 1.55; }
.simpan-templat { border-top: 1px solid var(--line); padding-top: 14px; }
.pratonton-imej { display: flex; flex-direction: column; gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: repeating-conic-gradient(#f3f1f6 0% 25%, #fff 0% 50%) 50% / 16px 16px; }
.pratonton-imej img { max-width: 100%; max-height: 120px; object-fit: contain; align-self: flex-start; }
.tt-pratonton img { max-height: 140px; }
.narrow-field { max-width: 420px; }
.pra-kandungan { font-family: Arial, 'Liberation Sans', sans-serif; font-size: 14px; }
.pra-kandungan .pr { margin: 0 0 10px; text-align: justify; }
.pra-kandungan .pr-no { display: flex; }
.pra-kandungan .pr-no .no { flex: none; width: 36px; }
.pra-kandungan .pr-inden, .pra-kandungan .sesi-senarai { margin-left: 36px; }
.pra-kandungan .sesi-senarai { display: grid; gap: 8px; margin-bottom: 10px; }
.pra-kandungan .sesi td { padding: 0 6px 0 0; vertical-align: top; }
.tl { display: grid; gap: 3px; min-width: 190px; }
.tl-baris { display: grid; grid-template-columns: 86px 1fr; gap: 6px; align-items: baseline; white-space: nowrap; }
.tl-label { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.tl-nilai { font-size: 13px; color: var(--ink); font-variant-numeric: tabular-nums; }
.tl-baris:first-child .tl-nilai { font-weight: 600; }
/* Pilih templat */
.templat-kepala { display: flex; align-items: center; gap: 14px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.templat-ikon { flex: none; width: 44px; height: 44px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: var(--soft); color: var(--purple); }
.templat-ikon.k-penghargaan { background: #FBF1DA; color: #8A5300; }
.templat-ikon.k-lantikan { background: var(--info-bg); color: var(--info-fg); }
.templat-bil { flex: none; font-size: 12px; font-weight: 700; color: var(--muted); background: var(--th); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; }
.templat-senarai { list-style: none; margin: 0; padding: 0; }
.templat-senarai li + li { border-top: 1px solid var(--line-2); }
.templat-baris { display: flex; align-items: center; gap: 16px; padding: 14px 20px; text-decoration: none; color: var(--ink); }
.templat-baris:hover { background: var(--th); color: var(--ink); }
.templat-baris:hover .templat-guna { background: var(--purple-dk); }
.templat-teks { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1 1 auto; }
.templat-perkara { font-size: 13px; color: var(--muted); line-height: 1.6; }
.cip { display: inline-block; padding: 0 7px; margin: 0 1px; border-radius: 6px; background: var(--soft); color: var(--purple); font-size: 12px; font-weight: 600; line-height: 1.6; white-space: nowrap; }
.templat-guna { flex: none; gap: 6px; pointer-events: none; }
@media (max-width: 640px) { .templat-baris { flex-direction: column; align-items: stretch; } .templat-guna { justify-content: center; } .templat-bil { display: none; } }
.templat-dipilih { position: relative; display: flex; align-items: center; gap: 14px; border-left: 4px solid var(--purple); }
.templat-dipilih .info-isi { top: calc(100% - 14px); left: 80px; width: min(380px, calc(100% - 100px)); }
.templat-dipilih-tajuk { font-size: 17px; font-weight: 700; color: var(--purple-dk); }
@media (max-width: 640px) { .templat-dipilih { flex-wrap: wrap; } .templat-dipilih .btn { width: 100%; } }
/* Pop-up contoh surat */
.templat-tajuk { align-items: center; gap: 6px; }
.templat-kepala { position: relative; }
.info-pop { display: inline-flex; }
.info-btn { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: help; }
.info-btn:hover, .info-btn:focus-visible, .info-pop:focus-within .info-btn { color: var(--purple); background: var(--soft); }
.info-isi { display: none; position: absolute; z-index: 20; top: calc(100% - 10px); left: 78px; width: min(380px, calc(100% - 98px)); padding: 14px 16px; border-radius: 12px; background: var(--purple-dk); color: #fff; font-size: 13px; line-height: 1.5; box-shadow: 0 12px 28px rgba(30,21,48,.25); }
.info-pop:hover .info-isi, .info-pop:focus-within .info-isi { display: block; }
.info-tajuk { display: block; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--gold); margin-bottom: 6px; }
.info-isi ul { margin: 0; padding-left: 18px; display: grid; gap: 3px; }
.templat-kump { overflow: visible; }
@media (max-width: 640px) { .info-isi, .templat-dipilih .info-isi { left: 12px; right: 12px; width: auto; } }
.check-top { align-items: flex-start; }
.check-top input { margin-top: 3px; flex: none; }
.emel-pilihan { padding-left: 28px; }
.senarai-langkah { margin: 10px 0 0; padding-left: 20px; display: grid; gap: 6px; }
.senarai-langkah code { word-break: break-all; }
.tajuk-seksyen { align-items: center; flex-wrap: wrap; gap: 10px; }
.tag-pilihan, .tag-wajib { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.tag-pilihan { background: var(--gray-bg); color: var(--gray-fg); }
.tag-wajib { background: var(--soft); color: var(--purple); }
.strong-muted { margin: 0; color: var(--ink-2); }
.lampiran-semasa { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--th); }
.lampiran-semasa .check { min-height: 0; }
.alert.notice-row { display: flex; gap: 10px; align-items: flex-start; }
.senarai-jadual { list-style: none; margin: 0; padding: 0; }
.senarai-jadual li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 20px; border-top: 1px solid var(--line-2); font-size: 13px; }
.senarai-jadual code { overflow-wrap: anywhere; }

/* Penerima luar sistem */
.luar-seksyen { margin-top: 8px; padding-top: 16px; border-top: 1px dashed var(--line); }
.h3 { font-size: 15px; font-weight: 700; margin: 0; }
.luar-baris { display: flex; flex-direction: column; gap: 12px; background: var(--th); }
.luar-baris[data-jenis="luar"] { border-left: 4px solid var(--purple); }
.luar-baris[data-jenis="staf"] { border-left: 4px solid #2E7D5B; }
.luar-kepala { display: flex; gap: 12px; align-items: flex-end; justify-content: space-between; }
.luar-kepala .luar-jenis { flex: 0 1 300px; min-width: 0; }
.luar-baris .row-sm > input { flex: 1 1 auto; min-width: 0; }
.luar-baris .cari-staf { flex: none; }
.luar-status.t-err { background: none; color: var(--err-fg); }
.luar-status.t-ok { color: var(--ok-fg); }
.badge.b-luar { background: #EDE7F6; color: #4A2C82; }
.badge.b-staf { background: #E3F2EA; color: #1F5C40; }
.emel-st { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; }
.emel-st.ok { color: var(--ok-fg); }
.emel-st.gagal { color: var(--err-fg); }
.inline-form { display: inline; }
.btn-link { background: none; border: 0; padding: 0; color: var(--purple-dk); text-decoration: underline; cursor: pointer; font: inherit; font-size: 12px; }

/* Panduan pengguna */
.pd [hidden], .pd-kosong[hidden] { display: none !important; }
.pd-isi { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; }
.pd-isi ul { list-style: none; margin: 4px 0 10px; padding: 0 0 0 10px; border-left: 2px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.pd-isi a { font-size: 14px; text-decoration: none; }
.pd-isi a:hover { text-decoration: underline; }
.pd-tapis { margin-bottom: 16px; }
.pd-tapis .chip { cursor: pointer; font: inherit; font-size: 14px; font-weight: 600; }
.pd-tajuk-bab { font-size: 22px; }
.pd-topik { scroll-margin-top: 16px; }
.pd-topik p { margin: 0; }
.pd-langkah, .pd-senarai { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.pd-langkah li::marker { font-weight: 700; color: var(--purple-dk); }
.pd-jadual th { width: 32%; text-align: left; font-weight: 600; white-space: normal; }
.pd-nota { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: 10px; background: var(--soft); color: var(--purple-dk); font-size: 14px; }
.pd-nota > svg { flex: none; margin-top: 2px; }
.pd-gambar { margin: 4px 0 0; }
.pd-gambar img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 2px 8px rgba(30, 21, 48, .06); }
.pd-gambar figcaption { font-size: 12px; color: var(--muted, #6B6480); margin-top: 6px; }
@media (max-width: 820px) { .pd-isi { display: none; } }
@media print {
  .pd-isi, .pd-tapis { display: none !important; }
  body:has(.pd) .sidebar, body:has(.pd) .topbar, body:has(.pd) .site-footer { display: none !important; }
  .pd-topik { box-shadow: none; }
  .pd-topik h3, .pd-gambar { break-inside: avoid; break-after: avoid-page; }
  .pd-gambar img { max-height: 110mm; width: auto; max-width: 100%; }
}

/* Laporan KPP */
.lkpp { --sr-1: #7445B0; --sr-2: #C47F0E; --sr-3: #1A9E78; display: flex; flex-direction: column; gap: 20px; }
.lkpp-carta { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 20px; }
.carta { width: 100%; height: auto; display: block; overflow: visible; }
.carta .c-grid { stroke: var(--line-2); stroke-width: 1; }
.carta .c-dasar { stroke: var(--line); }
.carta .c-tik { font-size: 11px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.carta .c-nilai { font-size: 11px; font-weight: 700; fill: var(--ink); font-variant-numeric: tabular-nums; }
.carta .c-tajuk { font-size: 11px; fill: var(--muted); font-weight: 600; }
.carta .c-hit { fill: transparent; }
.carta .c-bar:hover .c-hit { fill: var(--line-2); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.legend strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.lkpp-jadual .meter { grid-template-columns: minmax(80px, 180px) 28px; }
.lkpp-nota { margin: 0; }
@media print {
  body:has(.lkpp) .sidebar, body:has(.lkpp) .topbar, body:has(.lkpp) .site-footer { display: none !important; }
  .lkpp .stats { grid-template-columns: repeat(4, 1fr); }
  .lkpp .stat { padding: 12px; }
  .lkpp .stat-num { font-size: 26px; }
  .lkpp-carta { grid-template-columns: 1fr 1fr; }
  .lkpp-carta .card, .lkpp .stats { break-inside: avoid; }
  .lkpp .bar-fill { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .carta path, .carta rect { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}
.lkpp-head { flex-wrap: wrap; gap: 12px; }
.lkpp-saiz { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); font-weight: 600; }
.lkpp-saiz select { width: auto; min-width: 72px; }
.lkpp-saiz[hidden], .lkpp-halaman[hidden] { display: none; }
.lkpp-halaman { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 14px 20px; border-top: 1px solid var(--line-2); }
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.pager .btn { min-width: 36px; justify-content: center; }
.pager .btn:disabled { opacity: .45; cursor: default; }
.pager-titik { padding: 0 4px; color: var(--muted); }
.lkpp-sorok { display: none; }
@media print { .lkpp-sorok { display: table-row !important; } }
abbr.kod-ptj { text-decoration: none; font-weight: 600; cursor: help; }
.tl-akhir { display: inline-flex; flex-direction: column; gap: 2px; }
.butang-surat { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.emel-pilihan .eyebrow { margin-top: 8px; }
.emel-pilihan .eyebrow:first-child { margin-top: 0; }

/* Menu mudah alih: tersembunyi sehingga butang Menu ditekan */
.sidebar-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.menu-isi { display: flex; flex-direction: column; gap: 28px; flex: 1; }
.menu-butang { display: none; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 10px; border: 1px solid #5A4378; background: var(--purple-hv); color: #fff; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; flex: none; }
.menu-butang:hover { background: var(--purple); }
.menu-ikon { display: inline-flex; flex-direction: column; justify-content: center; gap: 4px; width: 18px; }
.menu-ikon i { display: block; height: 2px; border-radius: 2px; background: currentColor; transition: transform .2s, opacity .2s; }
.sidebar.terbuka .menu-ikon i:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.sidebar.terbuka .menu-ikon i:nth-child(2) { opacity: 0; }
.sidebar.terbuka .menu-ikon i:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.menu-butang .nav-count { margin-left: 2px; }
@media (max-width: 820px) {
  .sidebar { position: sticky; top: 0; z-index: 40; padding: 10px 16px; box-shadow: 0 2px 10px rgba(30, 21, 48, .18); }
  .sidebar .brand { padding: 0; min-width: 0; }
  .sidebar .brand-sub { display: none; }
  .menu-butang { display: inline-flex; }
  .menu-isi { gap: 12px; }
  .js .sidebar:not(.terbuka) .menu-isi { display: none; }
  .js .sidebar.terbuka .menu-isi { max-height: calc(100vh - 72px); max-height: calc(100dvh - 72px); overflow-y: auto; padding-bottom: 8px; }
  .nav { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 8px; }
  .nav a, .nav button { width: 100%; }
  .nav-label { grid-column: 1 / -1; }
  .nav-bottom .nav { display: flex; }
}
@media (prefers-reduced-motion: reduce) { .menu-ikon i { transition: none; } }
