/* ==========================================================================
   NADI — Sistem Reka Bentuk "Luxury"
   Satu fail CSS pusat. Ubah warna / saiz / jarak melalui pemboleh ubah :root.
   CSS biasa sahaja — tiada build step.
   ========================================================================== */

:root {
  /* ---- Warna jenama: Tema "Luxury" (hitam, putih, kelabu gelap, biru, merah) ----
     Nama pemboleh ubah --purple-* / --gold-* dikekalkan supaya semua gaya sedia ada
     terus berfungsi: --purple-* = hitam/kelabu, --gold-* = biru (butang & aksen). */
  --purple:        #18181B;   /* hitam utama: header, sidebar */
  --purple-dark:   #09090B;   /* hitam pekat */
  --purple-soft:   #F4F4F5;   /* latar kad / hover */
  --purple-line:   #E4E4E7;   /* garisan halus */
  --purple-mid:    #3F3F46;   /* kelabu gelap */
  --gold:          #2563EB;   /* biru: butang utama, menu aktif */
  --gold-dark:     #1D4ED8;
  --gold-soft:     #BFD3FE;   /* biru cair (teks/ikon atas latar hitam) */
  --red:           #DC2626;   /* merah: aksen & sorotan */
  --red-dark:      #B91C1C;
  --bg:            #F7F7F8;   /* latar halaman */
  --surface:       #FFFFFF;
  --text:          #111113;   /* teks utama */
  --text-muted:    #52525B;   /* >= 4.5:1 atas --bg & putih */
  --on-purple:     #FFFFFF;
  --on-gold:       #FFFFFF;   /* teks atas biru (kontras ~5:1) */
  /* Butang utama: biru gelap + emas */
  --btn-navy:      #0F1B2D;
  --btn-navy-top:  #1C2B42;
  --btn-gold:      #E8B648;
  --btn-gold-dark: #A9781C;
  --btn-text:      #F3E9CC;   /* krim, kontras ~13:1 atas biru gelap */

  /* ---- Warna status ---- */
  --success: #166534;  --success-bg: #E7F6EC;  --success-line: #B7E0C4;
  --danger:  #B91C1C;  --danger-bg:  #FDECEC;  --danger-line:  #F5BDBD;
  --warning: #854D0E;  --warning-bg: #FEF6DA;  --warning-line: #F3D98E;
  --info:    #1D4ED8;  --info-bg:    #EAF1FE;  --info-line:    #C3D5FC;
  --orange:  #9A3412;  --orange-bg:  #FFEDD5;

  /* ---- Tipografi (Plus Jakarta Sans) ----
     Hanya 5 saiz digunakan di seluruh sistem supaya seragam. */
  --font-body:    'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --font-heading: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-mono:    'Geist Mono', ui-monospace, monospace;
  --fs-sm:   10pt;     /* teks kecil: label, lencana, kalendar, nota */
  --fs-xs:   var(--fs-sm);
  --fs-base: 11pt;     /* teks biasa */
  --fs-h3:   12.5pt;   /* tajuk kecil */
  --fs-h2:   14pt;     /* tajuk kad / halaman */
  --fs-h1:   18pt;     /* tajuk besar & angka statistik */
  --lh:      1.55;

  /* ---- Jarak & dimensi ---- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 28px;
  --space-7: 36px;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-pill: 999px;
  --tap: 44px;               /* saiz sentuhan minimum di mobile */
  --sidebar-w: 260px;
  --topbar-h: 56px;          /* header dipadatkan ~56px */

  /* ---- Bayang & peralihan ---- */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .05), 0 1px 3px rgba(0, 0, 0, .06);
  --shadow:    0 3px 10px rgba(0, 0, 0, .06), 0 1px 2px rgba(0, 0, 0, .04);
  --shadow-lg: 0 16px 36px rgba(0, 0, 0, .16);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --t: .2s var(--ease);
  --focus: 0 0 0 3px rgba(37, 99, 235, .45);
}

/* ==========================================================================
   Asas & Tipografi (letter-spacing & word-spacing normal)
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: var(--fs-base);
  line-height: var(--lh);
  color: var(--text);
  background: var(--bg);
  letter-spacing: normal;
  word-spacing: normal;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select, textarea {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
}
h1, h2, h3, h4 {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-weight: 600;
  line-height: 1.3;
  color: var(--purple-dark);
  letter-spacing: normal;
  word-spacing: normal;
}
h1 { font-size: var(--fs-h1); margin: 0 0 var(--space-2); }
h2 { font-size: var(--fs-h2); margin: 0 0 var(--space-2); }
h3 { font-size: var(--fs-h3); margin: var(--space-3) 0 var(--space-2); }
p { margin: 0 0 var(--space-2); letter-spacing: normal; word-spacing: normal; }
a { color: var(--purple); text-decoration-color: rgba(24, 24, 27, .35); text-underline-offset: 2px; transition: color var(--t); }
a:hover { color: var(--purple-dark); text-decoration-color: var(--gold); }
small { color: var(--text-muted); font-size: var(--fs-sm); }
code { background: var(--purple-soft); color: var(--purple-dark); padding: 1px 6px; border-radius: 6px; font-size: .92em; }
img { max-width: 100%; }
hr { border: 0; border-top: 1px solid var(--purple-line); margin: var(--space-4) 0; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
.muted { color: var(--text-muted); }
.hide-sm { display: none; }
@media (min-width: 768px) { .hide-sm { display: initial; } .show-sm-only { display: none; } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.icon { width: 18px; height: 18px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 15px; height: 15px; }

/* ==========================================================================
   Rangka Aplikasi: Sidebar + Topbar + Kandungan
   ========================================================================== */
.app-main {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin var(--t);
}

/* ---- Sidebar ---- */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 60;
  width: var(--sidebar-w);
  max-width: 86vw;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--purple) 0%, #27272A 55%, var(--purple-dark) 100%);
  color: rgba(255, 255, 255, .86);
  transform: translateX(-100%);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
  overscroll-behavior: contain;
}
.sidebar::after {
  content: "";
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 2px;
  /* Garisan emas penuh di tepi kanan sidebar (sepadan dengan butang) */
  background: linear-gradient(180deg, var(--btn-gold), #FFE08A 50%, var(--btn-gold));
  box-shadow: 0 0 8px rgba(232, 182, 72, .45);
  pointer-events: none;
}
body.menu-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
body.menu-open { overflow: hidden; }

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: var(--topbar-h);
  height: var(--topbar-h);
  padding: 0 var(--space-4);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  color: #fff;
  text-decoration: none;
  flex-shrink: 0;
}
.sidebar-brand:hover { color: #fff; }
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #60A5FA, var(--gold) 55%, var(--gold-dark));
  color: var(--purple-dark);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--fs-h3);
  box-shadow: 0 3px 10px rgba(0, 0, 0, .25), inset 0 1px 0 rgba(255, 255, 255, .45);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-text strong { font-family: var(--font-heading); font-weight: 600; font-size: var(--fs-base); letter-spacing: normal; }
.brand-text span { font-size: var(--fs-xs); color: var(--gold-soft); opacity: .9; }

.sidebar-close {
  position: absolute;
  top: 8px; right: 8px;
  min-height: 0; padding: 0; box-shadow: none;
  width: 38px; height: 38px;
  border-radius: 8px;
  display: inline-grid;
  place-items: center;
  background: transparent;
  border: 0;
  color: #fff;
  cursor: pointer;
}
.sidebar-close:hover { background: rgba(255, 255, 255, .1); }

/* Sidebar Navigasi Dalaman (Scrollbar Halimunan) */
.sidebar-nav {
  flex: 1 1 auto;
  overflow-y: auto;
  scrollbar-width: none;       /* Firefox */
  -ms-overflow-style: none;    /* IE/Edge */
  padding-top: 4px;
  padding-bottom: 12px;
}
.sidebar-nav::-webkit-scrollbar {
  display: none;               /* Chrome, Safari, Edge */
}
.sidebar-nav > ul,
.sidebar-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* ---- Kumpulan Kategori Accordion (Padat) ---- */
.nav-group {
  margin: 0;
  padding: 0;
  border: 0;
}

/* Tajuk Kategori Accordion */
.nav-group-toggle {
  display: flex;
  align-items: center;
  gap: 10px;                   /* Jarak ikon ke teks menu 10px */
  width: 100%;
  min-height: 36px !important;
  height: 36px;                /* Tinggi tepat 36px */
  padding: 0 16px !important;  /* Tiada ruang menegak tambahan */
  margin: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: var(--fs-sm);     /* Tajuk kategori 9pt huruf besar */
  letter-spacing: normal;
  word-spacing: normal;
  text-transform: uppercase;
  color: var(--gold-soft);
  text-align: left;
  border-radius: 0;
  box-shadow: none;
  line-height: 1;
  transition: color var(--t), background var(--t);
}
.nav-group-toggle:hover {
  color: #fff;
  background: rgba(255, 255, 255, .06);
  transform: none;
  box-shadow: none;
}
.nav-group-toggle .icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: .95;
}
.nav-group-toggle span {
  flex: 1;
  min-width: 0;
  letter-spacing: normal;
}
.nav-group-toggle .chev {
  margin-left: auto;
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  transition: transform .25s cubic-bezier(.2, .7, .2, 1);
  transform: rotate(0deg);     /* Terbuka: anak panah ke bawah */
}
.nav-group.is-collapsed .chev {
  transform: rotate(-90deg);   /* Tertutup: anak panah ke kanan */
}

/* Animasi Accordion Halus (CSS Grid 1fr -> 0fr) */
.nav-group-list {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows .25s cubic-bezier(.2, .7, .2, 1);
}
.nav-group.is-collapsed .nav-group-list {
  grid-template-rows: 0fr;
}
.nav-group-list > ul {
  overflow: hidden;
  min-height: 0;
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.nav-group.is-collapsed .nav-group-list > ul {
  padding: 0;
  margin: 0;
}
.nav-group-list li {
  margin: 0;
  padding: 0;
}

/* Item Menu Pautan */
.nav-link, .sidebar .linkbtn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;                   /* Jarak ikon ke teks menu 10px */
  min-height: 34px !important;
  height: 34px;                /* Tinggi item 34px */
  margin: 0;
  padding: 0 16px;             /* Padding mendatar 16px */
  border-radius: 0;
  border: 0;
  width: 100%;
  background: transparent;
  color: rgba(255, 255, 255, .86);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: var(--fs-base);   /* Saiz teks menu 10pt */
  letter-spacing: normal;
  word-spacing: normal;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  box-shadow: none;
  line-height: 1;
  transition: background var(--t), color var(--t), transform var(--t);
}
/* Inden pautan anak dalam kumpulan supaya ikon anak sejajar di bawah teks tajuk */
.nav-group-list .nav-link,
.nav-group-list .sidebar .linkbtn {
  padding-left: 40px;
}
.nav-link .icon, .sidebar .linkbtn .icon {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  color: rgba(255, 255, 255, .65);
  transition: color var(--t);
}
.nav-link:hover, .sidebar .linkbtn:hover {
  background: rgba(255, 255, 255, .08);
  color: #fff;
  transform: translateX(2px);
  box-shadow: none;
  text-decoration: none;
}
.nav-link:hover .icon, .sidebar .linkbtn:hover .icon { color: var(--gold-soft); }
.nav-link.active {
  background: linear-gradient(90deg, rgba(37, 99, 235, .28), rgba(37, 99, 235, .08));
  color: #fff;
  font-weight: 600;
}
.nav-link.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px; bottom: 4px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--gold);
  box-shadow: 0 0 10px rgba(37, 99, 235, .75);
}
.nav-link.active .icon { color: var(--gold); }
.nav-label {
  flex: 1;
  min-width: 0;
  letter-spacing: normal;
  word-spacing: normal;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar .count, .count {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  display: inline-grid;
  place-items: center;
  border-radius: var(--radius-pill);
  background: var(--gold);
  color: var(--on-gold);
  font-size: var(--fs-xs);
  font-weight: 700;
}

.sidebar-backdrop {
  position: fixed; inset: 0; z-index: 55;
  background: rgba(0, 0, 0, .5);
  backdrop-filter: blur(2px);
  opacity: 0; visibility: hidden;
  transition: opacity var(--t), visibility var(--t);
}
body.menu-open .sidebar-backdrop { opacity: 1; visibility: visible; }

/* ---- Topbar ---- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 0;
  min-height: 0;
  height: auto;
  padding: 0;
  background: var(--purple);
  color: var(--on-purple);
  border-bottom: 2.5px solid var(--red);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
  flex-shrink: 0;
}
.menu-toggle {
  width: 38px; height: 38px; flex-shrink: 0;
  display: inline-grid; place-items: center;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 8px; color: #fff; cursor: pointer;
  box-shadow: none; padding: 0;
  transition: background var(--t);
}
.menu-toggle:hover { background: rgba(255, 255, 255, .16); transform: none; box-shadow: none; }
.topbar .brand { color: #fff; font-family: var(--font-heading); font-weight: 600; text-decoration: none; }
.topbar .spacer { flex: 1; }
.user-avatar {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--gold); color: var(--purple-dark);
  font: 700 var(--fs-xs) / 1 var(--font-heading);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .35);
}
.role-badge {
  align-self: flex-start; margin-top: 1px; padding: 0 6px;
  border-radius: var(--radius-pill);
  background: var(--gold-soft); color: var(--purple-dark);
  font-size: var(--fs-sm); font-weight: 700; letter-spacing: normal;
}

/* Info pengguna log masuk (dalam sidebar, bawah tajuk NADI) */
.sidebar-user {
  margin: 10px 10px 8px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .08);
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
}
.su-main {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}
.su-main:hover {
  text-decoration: none;
  color: inherit;
}
.su-main .user-avatar,
.su-main .user-avatar-img {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  font-size: var(--fs-base);
  box-shadow: 0 0 0 2px var(--gold-soft), 0 2px 6px rgba(0, 0, 0, .25);
  flex-shrink: 0;
}
.su-main .user-avatar-img {
  object-fit: cover;
  background: var(--purple-soft);
}
.sidebar-user-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  line-height: 1.25;
}
.sidebar-user-meta .who {
  font-weight: 700;
  font-size: 13px;
  line-height: 1.25;
  letter-spacing: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: #fff;
}
.sidebar-user-meta .role-badge {
  align-self: flex-start;
  margin-top: 1px;
}
.su-acts {
  display: block;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, .08);
}
.su-acts form.inline {
  display: block;
  width: 100%;
  margin: 0;
}
.su-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 30px;
  min-height: 30px !important;
  width: 100%;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 8px;
  background: rgba(255, 255, 255, .06);
  color: rgba(255, 255, 255, .9);
  border: 1px solid rgba(255, 255, 255, .1);
  box-shadow: none;
  cursor: pointer;
  transition: background var(--t), color var(--t), border-color var(--t);
  font-family: var(--font-body);
}
.su-btn .icon {
  width: 14px;
  height: 14px;
  opacity: .9;
}
.su-btn:hover {
  background: rgba(255, 255, 255, .12);
  color: #fff;
  transform: none;
  box-shadow: none;
}
.su-logout:hover {
  background: #B42318;
  border-color: #B42318;
  color: #fff;
  transform: none;
  box-shadow: none;
}

/* ==========================================================================
   Kelegaan Kandungan (15% Desktop, 5% Tablet, 16px Mobile)
   ========================================================================== */
.content {
  box-sizing: border-box;
  width: 100%;
  padding: 12px 16px 20px;   /* Mobile (<768px): 16px */
  letter-spacing: normal;
  word-spacing: normal;
}
.container {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
}

@media (min-width: 768px) {
  .content {
    padding-left: 5%;        /* Tablet: 5% kiri & kanan */
    padding-right: 5%;
    padding-top: 12px;
    padding-bottom: 16px;
  }
}

@media (min-width: 1200px) {
  .content {
    padding-left: 15%;       /* Desktop: 15% kiri & kanan */
    padding-right: 15%;
    padding-top: 12px;
    padding-bottom: 16px;
  }
}

/* Header Tajuk Halaman (Breadcrumb + Tajuk) */
.page-head-bar {
  flex: 0 0 auto;
  position: relative;
  z-index: 30;                 /* di bawah modal & dropdown, di atas kad */
  background: var(--bg);       /* warna latar kandungan tepat (#F7F7F8) */
  border-bottom: 1px solid var(--purple-line);
  transition: box-shadow .15s;
}
.page-head-bar.is-stuck {
  box-shadow: 0 4px 10px -6px rgba(0, 0, 0, .18);
}
@media (max-width: 991px) {
  .page-head-bar {
    position: sticky;
    top: var(--topbar-h, 44px);
    margin: 0;
  }
}

.page-head-inner {
  box-sizing: border-box;
  width: 100%;
  padding: 8px 16px 8px;     /* Mobile: 16px */
}
@media (min-width: 768px) {
  .page-head-inner {
    padding-left: 5%;        /* Tablet: 5% */
    padding-right: 5%;
  }
}
@media (min-width: 1200px) {
  .page-head-inner {
    padding-left: 15%;       /* Desktop: 15% */
    padding-right: 15%;
  }
}

.page-head {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 8px; margin: 0;
}
.page-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.page-head-actions .btn {
  margin: 0;
  white-space: nowrap;
}
@media (max-width: 599px) {
  .page-head-actions {
    width: 100%;
    margin-top: 4px;
  }
}
.page-head h1 {
  margin: 0; position: relative; padding-bottom: 4px; font-size: var(--fs-h2);
  letter-spacing: normal; word-spacing: normal;
}
.page-head h1::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 36px; height: 2.5px; border-radius: 2px;
  background: var(--gold);
}
.page-head-bar .breadcrumb {
  font-size: 11px;
  margin-bottom: 2px;
}
.breadcrumb {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
  margin: 0 0 2px; font-size: var(--fs-sm); color: var(--text-muted);
  list-style: none; padding: 0; letter-spacing: normal;
}
.breadcrumb li + li::before { content: "/"; margin-right: 4px; color: var(--purple-line); }
.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--purple); }

.footer {
  padding: 6px 20px; text-align: center;
  color: var(--text-muted); font-size: var(--fs-sm);
  border-top: 1px solid var(--purple-line); background: var(--surface);
  letter-spacing: normal; flex-shrink: 0;
}
.footer b { color: var(--purple); }

/* ==========================================================================
   Layout Desktop Satu Halaman Tanpa Scroll (>= 992px)
   ========================================================================== */
@media (min-width: 992px) {
  html, body {
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;        /* Body & halaman tidak boleh scroll */
  }
  .sidebar {
    transform: none;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: var(--sidebar-w);
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    z-index: 60;
  }
  .sidebar-close, .menu-toggle, .sidebar-backdrop { display: none; }
  .app-main {
    margin-left: var(--sidebar-w);
    height: 100vh;
    max-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;        /* Halaman tetap tanpa scroll */
  }
  .content {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;        /* Scroll dalaman jika kandungan panjang */
    overflow-x: hidden;
    scrollbar-width: none;   /* Tanpa scrollbar kelihatan */
    -ms-overflow-style: none;
  }
  .content::-webkit-scrollbar {
    display: none;
  }

  /* Padatkan komponen untuk muat dalam skrin (1366x768 & 1920x1080) */
  .card {
    padding: 12px 16px;
    margin-bottom: 10px;
    border-radius: 10px;
  }
  .card h2 {
    font-size: var(--fs-base);
    margin-bottom: 6px;
  }
  .card h3 {
    font-size: var(--fs-base);
    margin: 8px 0 4px;
  }
  .grid {
    gap: 8px;
    margin-bottom: 10px;
  }
  .grid-2 {
    gap: 10px;
    margin-bottom: 10px;
  }
  .stat {
    padding: 6px 12px;
    border-radius: 10px;
  }
  .stat .num {
    font-size: var(--fs-h2);
    line-height: 1.1;
  }
  .stat .lbl {
    font-size: var(--fs-sm);
    margin-top: 1px;
  }
  .filters {
    padding: 6px 10px;
    gap: 6px;
    margin-bottom: 8px;
    border-radius: 10px;
  }
  .filters input, .filters select, .filters button, .filters .btn {
    min-height: 34px;
    height: 34px;
    padding: 4px 10px;
    font-size: var(--fs-sm);
  }
  th, td {
    padding: 5px 10px;
    font-size: var(--fs-sm);
  }
  th {
    font-size: var(--fs-sm);
  }

  /* Jadual/senarai panjang: scroll dalaman dalam kad sahaja */
  .table-wrap {
    max-height: calc(100vh - 215px);
    overflow-y: auto;
    overflow-x: auto;
    margin-bottom: 6px;
    border-radius: 8px;
  }
  .card .table-wrap {
    max-height: 240px;
  }
  .table-wrap::-webkit-scrollbar {
    width: 5px;
    height: 5px;
  }
  .table-wrap::-webkit-scrollbar-thumb {
    background: #D4D4D8;
    border-radius: 4px;
  }

  /* Kalendar bulanan: Ketinggian fleksibel 6 baris muat 100% skrin */
  .calendar {
    height: calc(100vh - 200px);
    max-height: calc(100vh - 200px);
    display: flex;
    flex-direction: column;
    padding: 8px 12px;
    margin-bottom: 0;
    overflow: hidden;
  }
  .cal-head {
    flex-shrink: 0;
    margin-bottom: 4px;
    gap: 6px;
  }
  .cal-head strong {
    font-size: var(--fs-base);
  }
  .cal-head button {
    min-height: 30px;
    height: 30px;
    padding: 2px 8px;
    font-size: var(--fs-sm);
  }
  .cal-grid {
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--purple-line);
    border-radius: var(--radius-sm);
    overflow: hidden;
  }
  .cal-grid thead {
    flex-shrink: 0;
    display: block;
    width: 100%;
  }
  .cal-grid thead tr {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    width: 100%;
  }
  .cal-grid thead th {
    padding: 3px 4px;
    font-size: var(--fs-sm);
    text-align: center;
    border-right: 1px solid var(--purple-line);
  }
  .cal-grid thead th:last-child {
    border-right: 0;
  }
  .cal-grid tbody {
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    width: 100%;
    display: grid;
    grid-template-rows: repeat(6, 1fr); /* Ketinggian fleksibel supaya seluruh bulan muat */
  }
  .cal-grid tbody tr {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    min-height: 0;
    height: 100%;
    border-bottom: 1px solid var(--purple-line);
  }
  .cal-grid tbody tr:last-child {
    border-bottom: 0;
  }
  .cal-grid td {
    min-width: 0;
    min-height: 0;
    height: 100%;
    padding: 2px 4px;
    font-size: var(--fs-sm);
    border-right: 1px solid var(--purple-line);
    overflow: hidden;
  }
  .cal-grid td:last-child {
    border-right: 0;
  }
  .cal-day {
    font-size: var(--fs-sm);
    margin-bottom: 1px;
    line-height: 1;
  }
  .cal-ev {
    font-size: var(--fs-sm);
    padding: 1px 3px;
    margin-bottom: 1px;
    line-height: 1.15;
    max-height: 16px;
  }
  .legend {
    margin-bottom: 4px;
    gap: 4px 10px;
    font-size: var(--fs-sm);
  }
}

/* ==========================================================================
   Komponen Tambahan
   ========================================================================== */

/* ---- Kalendar: bar navigasi bulan & petunjuk warna bilik ---- */
.cal-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.cal-head strong { margin: 0 10px; }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 20px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }

/* ---- Legend Padat Satu Baris (e-Bilik & Takwim) ---- */
.legend-compact {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
  white-space: nowrap;
  font-size: 11px;
  padding: 6px 8px;
  margin: 8px 0 12px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.legend-compact::-webkit-scrollbar {
  height: 4px;
}
.legend-compact::-webkit-scrollbar-thumb {
  background: var(--purple-line);
  border-radius: 4px;
}
.legend-compact span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #F4F4F5;
  color: var(--text-dark, #18181B);
  flex: none;
  cursor: pointer;
  user-select: none;
  transition: all var(--t, .15s ease);
}
.legend-compact span:hover {
  background: #E4E4E7;
}
.legend-compact span.is-active {
  outline: 2px solid var(--purple);
  outline-offset: -1px;
  background: #fff;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
}
.legend-compact span.legend-static {
  cursor: default;
}
.legend-compact span.legend-static:hover {
  background: #F4F4F5;
}
.legend-compact i {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  display: inline-block;
  flex-shrink: 0;
}

/* ---- Kalendar Padat (.calendar[data-compact]) ---- */
.calendar[data-compact] .cal-grid {
  height: auto;
  min-height: 0;
}
.calendar[data-compact] .cal-grid tbody {
  height: auto;
  min-height: 0;
  grid-template-rows: auto;
}
.calendar[data-compact] .cal-grid tbody tr {
  height: auto;
  min-height: 80px;
}
.calendar[data-compact] .cal-grid td {
  height: auto;
  min-height: 80px;
  vertical-align: top;
  padding: 4px;
}
.calendar[data-compact] .cal-day {
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  margin-bottom: 3px;
}
.calendar[data-compact] .cal-day a {
  text-decoration: none;
  color: inherit;
}
.calendar[data-compact] .cal-ev {
  display: block;
  font-size: 10.5px;
  line-height: 1.35;
  padding: 1px 6px;
  margin: 2px 0;
  border-radius: 4px;
  border-left: 0 !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
  font-weight: 500;
}
.calendar[data-compact] .cal-ev:hover {
  filter: brightness(.92);
}
.calendar[data-compact] .cal-more {
  display: block;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.3;
  padding: 1px 6px;
  margin: 2px 0;
  border-radius: 4px;
  color: var(--purple-dark);
  background: var(--purple-soft);
  text-decoration: none;
  cursor: pointer;
  text-align: center;
  transition: background var(--t, .15s ease);
}
.calendar[data-compact] .cal-more:hover {
  background: #E8E5F5;
}

/* ---- e-Bilik: butang slide Papar Kalendar / Papar Senarai ---- */
.view-wrap { position: relative; }
.view-toggle { position: relative; display: inline-flex; margin-bottom: var(--space-2); padding: 3px; background: var(--purple-soft); border: 1px solid var(--purple-line); border-radius: 999px; }
.view-toggle::before { content: ""; position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px); background: var(--purple); border-radius: 999px; box-shadow: var(--shadow-sm); transition: transform .25s var(--ease); }
.view-toggle.is-right::before { transform: translateX(100%); }
.view-toggle a { position: relative; z-index: 1; flex: 1 1 0; min-width: 120px; padding: 7px 16px; text-align: center; font-size: var(--fs-sm); font-weight: 600; color: var(--purple); text-decoration: none; border-radius: 999px; white-space: nowrap; transition: color .2s var(--ease); }
.view-toggle a.on { color: #fff; }
@media (min-width: 768px) {
  .view-toggle { position: absolute; top: 0; right: 0; margin: 0; z-index: 2; }
  .view-count { min-height: 40px; display: flex; align-items: center; }
}

/* ---- e-Bilik: kotak tarikh boleh diklik & pop-up tempahan ---- */
.cal-grid td.cal-click { cursor: pointer; transition: background .15s var(--ease); }
.cal-grid td.cal-click:hover { background: var(--purple-soft); }
.modal-tempah .modal-box { max-width: 720px; max-height: 90vh; overflow-y: auto; }
.hari-list {
  margin: 8px 0 14px;
  padding: 10px;
  background: #FAFAFA;
  border: 1px solid var(--purple-line, #E4E4E7);
  border-radius: 10px;
}
.hari-head {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text, #111113);
}
.hari-head .badge {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--purple-line, #E4E4E7);
  color: var(--text, #111113);
  font-weight: 700;
}
.hari-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 240px;
  overflow-y: auto;
}
.hari-item {
  position: static;
  border-left: 5px solid var(--c, #2563EB);
  background: color-mix(in srgb, var(--c, #2563EB) 12%, #fff);
  border-radius: 6px;
  padding: 6px 10px;
  line-height: 1.35;
}
.hi-row1 {
  display: flex;
  gap: 8px;
  align-items: baseline;
  font-size: 12px;
}
.hi-masa {
  font-weight: 700;
  white-space: nowrap;
  color: var(--c, #2563EB);
  filter: brightness(.75);
  font-size: 11px;
}
.hi-tajuk {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  color: var(--text, #111113);
}
.hi-row2 {
  font-size: 11px;
  color: #52525B;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 4px;
}
.hari-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px dashed var(--purple-line, #E4E4E7);
  font-size: 11px;
  color: #52525B;
}
.hari-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.hari-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.cal-list .dot { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 3px; vertical-align: -1px; }

/* ---- Kad ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--purple-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
  min-width: 0;
}
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card h2 { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2); }
.card h2::before { content: ""; width: 4px; height: 1.05em; border-radius: 4px; background: var(--red); flex-shrink: 0; }
.card-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.card-head-row h2 {
  margin: 0;
}
.card-head-link {
  font-size: var(--fs-sm);
  color: var(--gold, #2563EB);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.card-head-link:hover {
  text-decoration: underline;
  color: var(--gold-dark, #1D4ED8);
}
@media (max-width: 599px) { .card { padding: var(--space-3); } }

/* ---- Grid ---- */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: var(--space-3); margin-bottom: var(--space-4); }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: var(--space-4); margin-bottom: var(--space-4); }
.grid-2 > .card { margin-bottom: 0; }
@media (min-width: 992px) { .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---- Kad statistik ---- */
.stat {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--purple-line); border-radius: var(--radius);
  padding: 10px 14px 10px 16px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
}
.stat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: linear-gradient(180deg, var(--red), var(--purple)); }
.stat::after { content: ""; position: absolute; right: -28px; top: -28px; width: 80px; height: 80px; border-radius: 50%; background: radial-gradient(circle, var(--purple-soft) 0%, rgba(244, 244, 245, 0) 70%); }
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: #D4D4D8; }
.stat .num { position: relative; z-index: 1; font-family: var(--font-heading); font-weight: 600; font-size: var(--fs-h1); line-height: 1.15; color: var(--purple-dark); word-break: break-word; }
.stat .num a { color: var(--purple); text-decoration: none; }
.stat .num a:hover { color: var(--gold-dark); }
.stat .lbl { position: relative; z-index: 1; margin-top: 2px; color: var(--text-muted); font-size: var(--fs-sm); font-weight: 500; }

/* ---- Seksyen Dashboard & Kad Makluman Am ---- */
.dash-sec {
  margin: 14px 0;
}
.dash-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--purple-dark);
  margin: 0 0 8px;
  padding-left: 8px;
  border-left: 4px solid var(--red);
  text-transform: uppercase;
}

/* ==========================================================================
   Dashboard: 3 Kotak Bersebelahan & Sejajar (.dash-table)
   ========================================================================== */
.dash-card {
  margin-bottom: 0 !important;
  display: flex;
  flex-direction: column;
}
.dash-card h2 {
  margin-top: 0 !important;
  margin-bottom: 10px !important;
  flex-shrink: 0 !important;
}
.dash-table-wrap {
  width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  background: #fff;
}
.dash-table-wrap::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
.dash-table-wrap::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 4px;
}
.dash-table-wrap-right {
  max-height: 260px;
}

/* Jadual Dashboard Padat */
.dash-table {
  width: 100% !important;
  min-width: 0 !important;
  table-layout: fixed !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  background: #fff;
  font-size: 12px !important;
  line-height: 1.35 !important;
  border: 0 !important;
  margin: 0 !important;
}
.dash-table th,
.dash-table td {
  padding: 7px 10px !important;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid #E2E8F0 !important;
  white-space: normal;
  overflow-wrap: break-word !important;
  word-break: normal !important;
  hyphens: none !important;
  font-size: 12px !important;
  line-height: 1.35 !important;
}
.dash-table th {
  background: #E2E8F0 !important;
  color: #1F2937 !important;
  font-weight: 700 !important;
  font-size: 12px !important;
  border-bottom: 1px solid #CBD5E1 !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 2 !important;
  letter-spacing: normal !important;
}
.dash-table tr:hover > td {
  background: #F8FAFC !important;
}
.dash-table tr:last-child > td {
  border-bottom: 0 !important;
}
.dash-time {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

/* Lebar lajur tetap & nowrap untuk elak perkataan terpecah */
.tbl-dash-gerak th:nth-child(1), .tbl-dash-gerak td:nth-child(1) { width: 29% !important; }
.tbl-dash-gerak th:nth-child(2), .tbl-dash-gerak td:nth-child(2) { width: 17% !important; }
.tbl-dash-gerak th:nth-child(3), .tbl-dash-gerak td:nth-child(3) {
  width: 16% !important;
  white-space: nowrap !important;
}
.tbl-dash-gerak th:nth-child(4), .tbl-dash-gerak td:nth-child(4) { width: 38% !important; }

.tbl-dash-takwim th:nth-child(1), .tbl-dash-takwim td:nth-child(1) { width: 55% !important; }
.tbl-dash-takwim th:nth-child(2), .tbl-dash-takwim td:nth-child(2) { width: 22% !important; }
.tbl-dash-takwim th:nth-child(3), .tbl-dash-takwim td:nth-child(3) {
  width: 23% !important;
  white-space: nowrap !important;
}

.tbl-dash-tempahan th:nth-child(1), .tbl-dash-tempahan td:nth-child(1) { width: 24% !important; }
.tbl-dash-tempahan th:nth-child(2), .tbl-dash-tempahan td:nth-child(2) { width: 20% !important; }
.tbl-dash-tempahan th:nth-child(3), .tbl-dash-tempahan td:nth-child(3) { width: 32% !important; }
.tbl-dash-tempahan th:nth-child(4), .tbl-dash-tempahan td:nth-child(4) { width: 24% !important; }



/* Senarai Pergerakan (satu baris) */
.gerak-row {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  background: #fff;
  border: 1px solid var(--border, #E4E4E7);
  border-radius: 12px;
  overflow: hidden;
}
.gerak-row .gi {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-right: 1px solid var(--border, #E4E4E7);
  text-decoration: none;
  color: inherit;
  transition: background var(--t);
  min-width: 0;
}
.gerak-row .gi:last-child {
  border-right: 0;
}
.gerak-row .gi:hover {
  background: #FAFAFA;
}
.gerak-row .gi:first-child {
  background: var(--purple-soft);
  color: var(--purple-dark);
}
.gerak-row .gi:first-child:hover {
  background: #E8E5F5;
}
.gerak-row .gi .icon,
.gerak-row .gi svg {
  width: 18px;
  height: 18px;
  color: var(--purple);
  flex: none;
}
.gerak-row .gi:first-child .icon,
.gerak-row .gi:first-child svg {
  color: var(--purple-dark);
}
.gerak-row .gi .n {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.1;
  color: inherit;
}
.gerak-row .gi .l {
  font-size: 11px;
  line-height: 1.2;
  color: var(--text-muted, #52525B);
}
.gerak-row .gi:first-child .l {
  color: var(--purple-dark);
  font-weight: 600;
}
.gerak-row .gi.zero .n {
  opacity: .45;
}
@media (max-width: 1100px) {
  .gerak-row {
    grid-template-columns: repeat(4, 1fr);
  }
  .gerak-row .gi {
    border-bottom: 1px solid var(--border, #E4E4E7);
  }
}
@media (max-width: 600px) {
  .gerak-row {
    grid-template-columns: repeat(2, 1fr);
  }
  .gerak-row .gi {
    border-bottom: 1px solid var(--border, #E4E4E7);
  }
}

/* Makluman Am (Kad Padat) */
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  align-items: stretch;
}
@media (max-width: 600px) {
  .stat-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.stat.stat-compact {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  min-height: 0;
  height: 100%;
}
.stat-compact .stat-ico {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--purple-soft);
  color: var(--purple);
  position: relative;
  z-index: 1;
}
.stat-compact .stat-ico .icon,
.stat-compact .stat-ico svg {
  width: 18px;
  height: 18px;
}
.stat-compact .stat-body {
  min-width: 0;
  position: relative;
  z-index: 1;
}
.stat-compact .num {
  font-size: 18px;
  line-height: 1.1;
}
.stat-compact .lbl {
  font-size: 11.5px;
  line-height: 1.25;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}
.stat-compact .sub {
  font-size: 10px;
  color: var(--text-muted, #71717A);
  white-space: nowrap;
}
.stat-compact::after {
  display: none;
}

/* ---- Jadual ---- */
.table-wrap {
  width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch;
  border: 1px solid var(--purple-line); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-3);
}
.table-wrap > table { border: 0; }
.card .table-wrap { box-shadow: none; }
table { border-collapse: separate; border-spacing: 0; width: 100%; background: var(--surface); font-size: var(--fs-base); }
th, td { padding: 8px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--purple-line); }
th {
  background: var(--purple-soft); color: var(--purple-dark);
  font-family: var(--font-body); font-weight: 700; font-size: var(--fs-sm);
  letter-spacing: normal; white-space: nowrap;
}
tr:last-child > td { border-bottom: 0; }
tbody tr, table tr { transition: background var(--t); }
tr:hover > td { background: #FBF9FE; }
tr.late > td { background: var(--danger-bg); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap table { min-width: 520px; }
td .btn, td button { margin: 2px 0; }

/* ---- Jadual Surat Padat & Butang Ikon Tindakan ---- */
.clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
  word-break: break-word;
}
.surat-tbl th,
.surat-tbl td {
  padding: 8px 10px;
  vertical-align: middle;
}
.surat-tbl th {
  font-size: 11px;
}
.surat-tbl td {
  font-size: 12px;
}
.surat-tbl .st-id {
  width: 40px;
  color: var(--text-muted);
  text-align: center;
}
.surat-tbl .st-tajuk {
  min-width: 260px;
}
.surat-tbl .st-rujukan {
  min-width: 120px;
  max-width: 180px;
  font-family: var(--font-mono);
  font-size: 11px;
}
.surat-tbl .st-tarikh {
  white-space: nowrap;
  font-size: 11px;
}
.surat-tbl .st-status {
  white-space: nowrap;
}
.surat-tbl .st-pemuat {
  white-space: nowrap;
  line-height: 1.25;
}
.surat-tbl .st-pemuat .st-nama {
  display: block;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}
.surat-tbl .st-pemuat small {
  display: block;
  color: var(--text-muted);
  font-size: 10px;
  margin-top: 1px;
}
.surat-tbl .st-col-acts {
  width: 1%;
  white-space: nowrap;
}
.st-acts {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  align-items: center;
}
.btn-ico {
  width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border-radius: 6px;
  border: 1px solid var(--purple-line, #E4E4E7);
  background: var(--surface, #FFFFFF);
  color: var(--text, #111113);
  cursor: pointer;
  box-shadow: none;
  transition: all .15s var(--ease);
  text-decoration: none;
  flex-shrink: 0;
}
.btn-ico:hover {
  transform: none;
  box-shadow: none;
}
.btn-ico.btn-light {
  background: #FFFFFF;
  border-color: #D4D4D8;
  color: #27272A;
}
.btn-ico.btn-light:hover {
  background: #F4F4F5;
  border-color: #A1A1AA;
  color: #09090B;
}
.btn-ico.btn-minit {
  background: var(--purple-mid, #27272A);
  border-color: var(--purple-mid, #27272A);
  color: #FFFFFF;
}
.btn-ico.btn-minit:hover {
  background: #09090B;
  border-color: #09090B;
  color: #FFFFFF;
}
.btn-ico.btn-danger {
  background: var(--danger-bg, #FDECEC);
  border-color: var(--danger-line, #F5BDBD);
  color: var(--danger, #B91C1C);
}
.btn-ico.btn-danger:hover {
  background: var(--danger, #B91C1C);
  border-color: var(--danger, #B91C1C);
  color: #FFFFFF;
}
.btn-ico .icon {
  width: 15px;
  height: 15px;
}

/* ---- Jadual Sticky Header (.tbl-sticky) ---- */
@media (min-width: 768px) {
  .tbl-sticky thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: #F4F4F6 !important;
    box-shadow: inset 0 -1px 0 var(--purple-line);
  }
}

/* ---- Jadual Pengguna Padat (.tbl-pengguna) ---- */
.table-wrap table.tbl-pengguna {
  table-layout: fixed;
  width: 100%;
  min-width: 0;
}
.tbl-pengguna th,
.tbl-pengguna td {
  padding: 6px 8px;
  font-size: 13px;
  line-height: 1.3;
  vertical-align: middle;
}
.tbl-pengguna th {
  white-space: nowrap;
  font-weight: 700;
  color: var(--purple-dark);
}
.tbl-pengguna .u-name-clamp {
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}
.tbl-pengguna .u-email-clamp {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-muted);
  font-size: 11.5px;
  line-height: 1.2;
  margin-top: 2px;
}
.tbl-pengguna .u-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}
.tbl-pengguna .u-login {
  font-size: 12px;
  line-height: 1.2;
}
.tbl-pengguna .u-login small {
  font-size: 11px;
}
.tbl-pengguna .tac {
  text-align: center;
}
.tbl-pengguna .badge {
  white-space: nowrap;
  font-size: 11px;
  padding: 2px 7px;
}
.tbl-pengguna tr.row-inactive td {
  background: #FBFBFC;
  color: #71717A;
}
.tbl-pengguna tr.row-inactive:hover td {
  background: #F4F4F6;
}
.btn-ico.btn-ico-warn {
  background: #FFFBEB;
  border-color: #FDE68A;
  color: #D97706;
}
.btn-ico.btn-ico-warn:hover {
  background: #D97706;
  border-color: #D97706;
  color: #FFFFFF;
}
.btn-ico.btn-ico-success {
  background: #ECFDF5;
  border-color: #A7F3D0;
  color: #059669;
}
.btn-ico.btn-ico-success:hover {
  background: #059669;
  border-color: #059669;
  color: #FFFFFF;
}
.txt-success {
  color: #10B981;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.icon-sm {
  width: 14px;
  height: 14px;
}

@media (max-width: 767px) {
  .table-wrap table.tbl-pengguna {
    min-width: 900px;
  }
}

/* ---- Borang ---- */
form.inline { display: inline; margin: 0; }
.form label { display: block; margin: var(--space-3) 0 4px; font-weight: 600; font-size: var(--fs-sm); color: var(--purple-dark); }
.form > label:first-of-type { margin-top: 0; }
.form .row { display: flex; flex-wrap: wrap; gap: 0 var(--space-3); }
.form .row > div { flex: 1 1 100%; min-width: 0; }
@media (min-width: 640px) { .form .row > div { flex: 1 1 180px; } }
.form p:last-child { margin-bottom: 0; }

input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time],
input[type=datetime-local], input[type=url], input[type=search], input[type=tel], input[type=month], input[type=file], select, textarea {
  width: 100%; min-height: 38px;
  padding: 8px 12px;
  border: 1.5px solid #D9CFE8; border-radius: 8px;
  background: var(--surface); color: var(--text);
  font: inherit; line-height: 1.4;
  letter-spacing: normal;
  transition: border-color var(--t), box-shadow var(--t), background var(--t);
}
input::placeholder, textarea::placeholder { color: #8A8296; }
input:hover, select:hover, textarea:hover { border-color: #BFAEDB; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--purple); box-shadow: 0 0 0 3px rgba(24, 24, 27, .15); }
input[type=file] { padding: 6px; cursor: pointer; }
input[type=file]::file-selector-button {
  margin-right: 10px; padding: 6px 12px; border: 0; border-radius: 6px;
  background: var(--purple-soft); color: var(--purple); font: 600 var(--fs-sm) var(--font-body); cursor: pointer;
}
select {
  appearance: none; -webkit-appearance: none; padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%234B2A7B' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
select[multiple] { min-height: 150px; padding-right: 10px; background-image: none; }
textarea { min-height: 90px; resize: vertical; }
input[type=checkbox], input[type=radio] { width: 17px; height: 17px; accent-color: var(--purple); vertical-align: middle; cursor: pointer; }
input:disabled, select:disabled, textarea:disabled { background: #F4F1F8; color: var(--text-muted); cursor: not-allowed; }
fieldset { border: 1px solid var(--purple-line); border-radius: var(--radius); padding: var(--space-3); margin: 0 0 var(--space-3); }
legend { padding: 0 8px; font-weight: 700; color: var(--purple); }

/* ---- Bar penapis ---- */
.filters {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-2);
  margin-bottom: var(--space-3); padding: var(--space-3);
  background: var(--surface); border: 1px solid var(--purple-line); border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.filters > * { flex: 1 1 100%; }
.filters > a { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; font-weight: 600; font-size: var(--fs-sm); }
.filters label { font-weight: 600; font-size: var(--fs-sm); color: var(--purple-dark); }
@media (min-width: 640px) {
  .filters > * { flex: 0 1 auto; }
  .filters input, .filters select { width: auto; min-width: 150px; }
  .filters input[type=search], .filters input[type=text] { min-width: 200px; }
}

/* ---- Maklumat Sekolah: Grid Penapis & Multi-Select (.filters-grid) ---- */
.filters.filters-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  align-items: center;
}
.filters.filters-grid > * {
  width: 100%;
  min-width: 0;
  margin: 0;
  flex: none;
}
.ms { position: relative; }
.ms-btn, .fg-cari, .fg-acts > * {
  height: 38px;
  min-height: 38px;
  box-sizing: border-box;
  font-size: 13px;
}
.ms-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 28px 6px 10px;
  border: 1px solid var(--purple-line, #e2e2e8);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  list-style: none;
  white-space: nowrap;
  overflow: hidden;
  user-select: none;
}
.ms-btn::-webkit-details-marker { display: none; }
.ms-btn::after {
  content: "▾";
  position: absolute;
  right: 10px;
  color: var(--text-muted);
  font-size: 12px;
  pointer-events: none;
}
.ms-lbl { font-weight: 600; color: var(--text-muted); flex-shrink: 0; }
.ms-val { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms.aktif .ms-btn {
  border-color: var(--primary, var(--purple));
  background: color-mix(in srgb, var(--primary, var(--purple)) 8%, #fff);
}
.ms-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 220px;
  width: max-content;
  max-width: min(340px, 92vw);
  max-height: 280px;
  background: #fff;
  border: 1px solid var(--purple-line, #e2e2e8);
  border-radius: 8px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, .18);
  z-index: 60;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-sizing: border-box;
}
.ms-cari {
  width: 100%;
  height: 30px;
  min-height: 30px;
  padding: 4px 8px;
  font-size: 12px;
  border: 1px solid var(--purple-line, #e2e2e8);
  border-radius: 6px;
  box-sizing: border-box;
}
.ms-tools {
  display: flex;
  gap: 6px;
  justify-content: space-between;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--purple-line, #e2e2e8);
}
.ms-tools button {
  background: none;
  border: 0;
  box-shadow: none;
  color: var(--purple);
  font-size: 11px;
  cursor: pointer;
  padding: 2px 4px;
  font-weight: 600;
  min-height: 0;
}
.ms-tools button:hover {
  text-decoration: underline;
  background: none;
  box-shadow: none;
  transform: none;
}
.ms-opts {
  overflow-y: auto;
  max-height: 180px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ms-opt {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  font-size: 12px;
  border-radius: 4px;
  cursor: pointer;
  user-select: none;
}
.ms-opt:hover {
  background: var(--purple-soft, #f4f4f6);
}
.ms-opt input[type="checkbox"] {
  margin: 0;
  cursor: pointer;
  width: 15px;
  height: 15px;
  min-width: 15px;
}
.fg-acts {
  display: flex;
  gap: 8px;
  align-items: center;
}
.fg-acts button {
  flex: 1 1 auto;
  height: 38px;
  min-height: 38px;
}
.fg-acts a {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  padding: 0 4px;
}
.fg-acts a:hover {
  color: var(--purple);
  text-decoration: underline;
}
.fg-cari {
  grid-column: auto / -1;
  padding: 6px 12px;
  border: 1px solid var(--purple-line, #e2e2e8);
  border-radius: 8px;
  background: #fff;
  width: 100%;
}
.btn-excel {
  background: #1D6F42 !important;
  border-color: #1D6F42 !important;
  color: #fff !important;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-excel:hover {
  background: #155734 !important;
  border-color: #155734 !important;
  color: #fff !important;
}
.btn-pdf {
  background: #B42318 !important;
  border-color: #B42318 !important;
  color: #fff !important;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-pdf:hover {
  background: #912018 !important;
  border-color: #912018 !important;
  color: #fff !important;
}

/* ==========================================================================
   e-Gerak: Baris Penapis Sebaris (.egerak-filters)
   ========================================================================== */
.egerak-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.egerak-filters .egerak-input-month {
  width: 165px;
  min-width: 150px;
  flex: 0 0 auto;
  height: 38px;
}
.egerak-filters .egerak-select {
  flex: 1 1 140px;
  min-width: 135px;
  max-width: 210px;
  height: 38px;
}
.egerak-filters .gerak-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.egerak-filters .gerak-actions > * {
  flex: 0 0 auto;
  white-space: nowrap;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  padding: 0 14px;
  font-size: var(--fs-sm);
  font-weight: 600;
}
@media (min-width: 1200px) {
  .egerak-filters {
    flex-wrap: nowrap;
  }
}
@media (max-width: 899px) {
  .egerak-filters .gerak-actions {
    width: 100%;
    margin-top: 4px;
    flex-wrap: wrap;
  }
  .egerak-filters .gerak-actions > * {
    flex: 1 1 auto;
  }
}

@media (min-width: 1600px) {
  .filters.filters-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}
@media (min-width: 768px) and (max-width: 1199px) {
  .filters.filters-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 767px) {
  .filters.filters-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .fg-cari {
    grid-column: 1 / -1;
    order: 10;
  }
  .fg-acts {
    grid-column: 1 / -1;
    order: 11;
  }
  .ms-panel {
    max-width: calc(100vw - 32px);
  }
}

/* ---- Butang ---- */
button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 38px; padding: 8px 18px;
  /* Butang "Luxury": isi biru gelap, teks krim, garisan emas nipis (1px) dengan cahaya lembut */
  border: 1px solid transparent; border-radius: 10px;
  background:
    linear-gradient(180deg, var(--btn-navy-top), var(--btn-navy)) padding-box,
    linear-gradient(90deg, var(--btn-gold-dark), var(--btn-gold) 50%, var(--btn-gold-dark)) border-box;
  color: var(--btn-text);
  font: 600 var(--fs-sm) / 1.2 var(--font-body);
  letter-spacing: .02em;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .18), 0 0 8px rgba(232, 182, 72, .18), inset 0 1px 0 rgba(255, 255, 255, .06);
  transition: background var(--t), border-color var(--t), color var(--t), box-shadow var(--t), transform var(--t);
}
button:hover, .btn:hover {
  background:
    linear-gradient(180deg, #2A3A55, var(--btn-navy-top)) padding-box,
    linear-gradient(90deg, var(--btn-gold), #FFE08A 50%, var(--btn-gold)) border-box;
  color: #FFF6DC; transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .22), 0 0 12px rgba(232, 182, 72, .35);
}
button:active, .btn:active { transform: translateY(0); box-shadow: var(--shadow-sm); }
button:disabled, .btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-light, button.btn-light { background: var(--surface); color: var(--purple); border-color: #D4D4D8; box-shadow: none; }
.btn-light:hover, button.btn-light:hover { background: var(--purple-soft); border-color: var(--purple); color: var(--purple-dark); box-shadow: 0 3px 8px rgba(24, 24, 27, .12); }
.btn-danger, button.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; box-shadow: none; }
.btn-danger:hover, button.btn-danger:hover { background: #991B1B; border-color: #991B1B; color: #fff; box-shadow: 0 4px 10px rgba(166, 27, 27, .25); }
.btn-purple { background: var(--purple); border-color: var(--purple); color: #fff; }
.btn-purple:hover { background: var(--purple-dark); border-color: var(--purple-dark); color: #fff; }
.btn-sm, button.btn-sm { min-height: 32px; height: 32px; padding: 4px 10px; font-size: var(--fs-xs); border-radius: 6px; }
@media (pointer: coarse) {
  button, .btn { min-height: var(--tap); }
  .nav-group-toggle { min-height: 36px !important; }
  .nav-link, .sidebar .linkbtn { min-height: 34px !important; }
  .su-btn { min-height: 30px !important; }
}
.actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: var(--space-3) 0; }
.linkbtn { background: none; border: 0; box-shadow: none; padding: 0; min-height: 0; width: auto; color: var(--purple); font: inherit; cursor: pointer; text-align: left; }
.linkbtn:hover { background: none; transform: none; box-shadow: none; text-decoration: underline; }
.menu-toggle, .sidebar-close, .nav-group-toggle, .sidebar .linkbtn, .modal-close { box-shadow: none; letter-spacing: normal; }
.menu-toggle:hover, .sidebar-close:hover, .nav-group-toggle:hover, .modal-close:hover { transform: none; box-shadow: none; }
.nav-group-toggle, .sidebar .linkbtn { justify-content: flex-start; white-space: normal; }
.sidebar .linkbtn:hover { box-shadow: none; text-decoration: none; }

/* ---- Amaran ---- */
.alert {
  position: relative;
  display: block; padding: 8px 12px 8px 16px;
  margin-bottom: var(--space-3);
  border: 1px solid; border-radius: var(--radius-sm);
  font-weight: 500; font-size: var(--fs-sm); overflow: hidden;
}
.alert::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: currentColor; }
.alert ul { margin: var(--space-1) 0 0; padding-left: 20px; }
.alert-success { background: var(--success-bg); border-color: var(--success-line); color: var(--success); }
.alert-error   { background: var(--danger-bg);  border-color: var(--danger-line);  color: var(--danger); }
.alert-warning { background: var(--warning-bg); border-color: var(--warning-line); color: var(--warning); }
.alert-info    { background: var(--info-bg);    border-color: var(--info-line);    color: var(--info); }
.alert a { color: inherit; font-weight: 700; }

/* ---- Lencana status ---- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: var(--radius-pill);
  background: #ECE8F1; color: #3E3650;
  font-size: var(--fs-xs); font-weight: 700; line-height: 1.4; letter-spacing: normal;
  white-space: nowrap; vertical-align: middle;
}
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .75; }
.badge[style]::before { display: none; }
.b-baru, .b-belum_baca, .b-belum, .b-draf, .b-belum_direkod, .b-pending { background: var(--warning-bg); color: var(--warning); }
.b-diminit, .b-dibaca, .b-dalam_proses, .b-aktif { background: var(--info-bg); color: var(--info); }
.b-selesai, .b-hadir, .b-approved, .b-active, .b-disahkan { background: var(--success-bg); color: var(--success); }
.b-tidak_hadir, .b-cancelled, .b-rejected, .b-inactive { background: var(--danger-bg); color: var(--danger); }
.b-bersebab { background: var(--orange-bg); color: var(--orange); }
.badge[style*="background"] { text-shadow: 0 1px 1px rgba(0, 0, 0, .35); }

/* ---- Penomboran ---- */
.pager { display: flex; flex-wrap: wrap; gap: 4px; margin: var(--space-3) 0; }
.pager a, .pager b {
  display: inline-grid; place-items: center; min-width: 34px; min-height: 34px; padding: 0 10px;
  border: 1px solid var(--purple-line); border-radius: 8px; background: var(--surface);
  text-decoration: none; font-weight: 600; font-size: var(--fs-sm); transition: background var(--t), border-color var(--t);
}
.pager a:hover { background: var(--purple-soft); border-color: var(--purple); }
.pager b { background: var(--purple); border-color: var(--purple); color: #fff; }

/* ---- Carta bar & kemajuan ---- */
.bars { margin: var(--space-2) 0; }
.bar-row { display: flex; align-items: center; gap: var(--space-2); margin: 6px 0; }
.bar-label { width: 180px; flex-shrink: 0; font-size: var(--fs-sm); font-weight: 500; }
.bar-track { flex: 1; height: 10px; background: var(--purple-soft); border-radius: var(--radius-pill); overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: var(--radius-pill); background: linear-gradient(90deg, var(--purple), var(--purple-mid)); transition: width .6s var(--ease); }
.bar-val { width: 68px; text-align: right; font-size: var(--fs-sm); font-weight: 700; color: var(--purple-dark); font-variant-numeric: tabular-nums; }
.progress { display: inline-block; width: 100px; height: 8px; background: var(--purple-soft); border-radius: var(--radius-pill); overflow: hidden; vertical-align: middle; margin-right: 4px; }
.progress-fill { display: block; height: 100%; border-radius: var(--radius-pill); }
.progress-fill.ok  { background: linear-gradient(90deg, #2A8A4D, var(--success)); }
.progress-fill.mid { background: linear-gradient(90deg, #60A5FA, var(--gold)); }
.progress-fill.low { background: linear-gradient(90deg, #D04545, var(--danger)); }
@media (max-width: 599px) { .bar-label { width: 90px; } .bar-val { width: 50px; } }

/* ---- Modal ---- */
.modal { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; padding: var(--space-3); background: rgba(0, 0, 0, .55); backdrop-filter: blur(3px); animation: fade .18s var(--ease); }
.modal[hidden] { display: none; }
.modal-box { position: relative; width: 100%; max-width: 580px; max-height: 90vh; overflow: auto; padding: 24px 20px 20px; background: var(--surface); border-radius: 14px; border-top: 4px solid var(--red); box-shadow: var(--shadow-lg); animation: pop .22s var(--ease); }
.modal-close { position: absolute; top: 6px; right: 6px; width: 36px; height: 36px; min-height: 0; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--text-muted); font-size: var(--fs-h2); box-shadow: none; }
.modal-close:hover { background: var(--purple-soft); color: var(--purple); transform: none; box-shadow: none; }
.modal-slip .modal-box { max-width: 940px; height: 92vh; max-height: 92vh; padding: 0; overflow: hidden; border-top: 0; background: var(--bg); }
.modal-slip .modal-close { display: none; }
.modal-slip .modal-body { height: 100%; }
.modal-frame { display: block; width: 100%; height: 100%; border: 0; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---- Maklumat / profil ---- */
.avatar { width: 84px; height: 84px; object-fit: cover; border-radius: 50%; border: 3px solid var(--gold-soft); box-shadow: var(--shadow); background: var(--purple-soft); }
dl.info { display: grid; grid-template-columns: 1fr; gap: 2px var(--space-3); margin: 0 0 var(--space-3); }
dl.info dt { font-weight: 700; font-size: var(--fs-sm); color: var(--text-muted); margin-top: var(--space-2); }
dl.info dd { margin: 0; padding-bottom: var(--space-2); border-bottom: 1px dashed var(--purple-line); }
@media (min-width: 640px) {
  dl.info { grid-template-columns: 180px 1fr; }
  dl.info dt { margin-top: 0; padding: 6px 0; border-bottom: 1px dashed var(--purple-line); }
  dl.info dd { padding: 6px 0; }
}

.grid > .stat .num a[target] { font-size: var(--fs-h3); }
.row-item { padding: var(--space-2); margin-bottom: var(--space-2); border: 1px dashed #D4D4D8; border-radius: var(--radius-sm); background: #FDFCFF; }

/* ==========================================================================
   Halaman Log Masuk (Berjenama NADI)
   ========================================================================== */
.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(420px, .85fr);
  background: #F6F8F9;
  color: #1F2937;
}

/* ---------- KIRI: gambar + jenama ---------- */
.login-hero {
  position: relative;
  overflow: hidden;
  background: url('../img/login/bg_login.jpg') center/cover no-repeat;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 40px 56px;
  color: #1F2937;
}
.login-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, rgba(255, 255, 255, .88) 0%, rgba(255, 255, 255, .62) 45%, rgba(255, 255, 255, .15) 100%);
  pointer-events: none;
}
.login-hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 6px;
  background: linear-gradient(90deg, #07838A, #0BA5AD);
  pointer-events: none;
}
.login-hero > * {
  position: relative;
  z-index: 1;
}
.login-ppdpg {
  height: 76px;
  width: auto;
  align-self: flex-start;
  display: block;
}
.login-hero-body {
  max-width: 520px;
}
.login-nadi-word {
  width: min(360px, 80%);
  height: auto;
  display: block;
}
.login-akronim {
  margin: 14px 0 18px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: #07838A;
}
.login-akronim::before {
  content: "";
  display: inline-block;
  width: 28px;
  height: 2px;
  background: #07838A;
  vertical-align: middle;
  margin-right: 10px;
}
.login-hero-body h2 {
  margin: 0;
  font-size: 30px;
  line-height: 1.25;
  font-weight: 800;
  color: #1F2937;
}
.login-hero-body h2 span {
  color: #07838A;
}
.login-pejabat {
  font-size: 13px;
  font-weight: 600;
  color: #4B5563;
}
.login-pejabat small {
  display: block;
  font-weight: 500;
  color: #6B7280;
  margin-top: 2px;
}

/* ---------- KANAN: borang ---------- */
.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background: #F6F8F9;
}
.login-box {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 18px;
  box-shadow: 0 20px 50px -24px rgba(7, 131, 138, .35);
  padding: 36px 34px 26px;
  animation: pop .35s var(--ease);
}
.login-logo-circle {
  display: block;
  width: 84px;
  height: 84px;
  margin: 0 auto 14px;
}
.login-box h1 {
  margin: 0;
  text-align: center;
  font-size: 22px;
  font-weight: 800;
  color: #1F2937;
}
.login-box .sub {
  margin: 6px 0 24px;
  text-align: center;
  font-size: 13px;
  color: #6B7280;
}
.login-box label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  margin: 0 0 6px;
  color: #1F2937;
}
.login-box .input-icon {
  position: relative;
  margin-bottom: 16px;
}
.login-box .input-icon > .icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  color: #9CA3AF;
  pointer-events: none;
}
.login-box .input-icon > input {
  width: 100%;
  height: 46px;
  border: 1px solid #D1D5DB;
  border-radius: 11px;
  padding: 0 44px 0 40px;
  font: inherit;
  font-size: 14px;
  background: #fff;
  outline: none;
  transition: border .15s, box-shadow .15s;
}
.login-box .input-icon > input:focus {
  border-color: #07838A;
  box-shadow: 0 0 0 4px #E6F4F4;
}
.login-box .input-icon > .pw-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: none;
  padding: 6px;
  cursor: pointer;
  color: #9CA3AF;
  border-radius: 6px;
  box-shadow: none;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
}
.login-box .input-icon > .pw-toggle:hover {
  color: #07838A;
  background: #E6F4F4;
  transform: translateY(-50%);
  box-shadow: none;
}
.login-box .input-icon > .pw-toggle svg {
  width: 18px;
  height: 18px;
}
.btn-login {
  width: 100%;
  height: 48px;
  border: 0;
  border-radius: 11px;
  background: #07838A;
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 18px -8px rgba(7, 131, 138, .7);
  transition: background .15s, transform .1s, box-shadow .15s;
  margin-top: 4px;
}
.btn-login:hover {
  background: #05666C;
  color: #fff;
}
.btn-login:active {
  transform: translateY(1px);
}
.login-foot {
  margin-top: 22px;
  text-align: center;
  font-size: 12px;
  color: #9CA3AF;
}

/* ---------- Telefon (< 900px) ---------- */
@media (max-width: 900px) {
  .login-page {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
  .login-hero {
    padding: 18px 20px 22px;
    min-height: 0;
  }
  .login-hero::before {
    background: rgba(255, 255, 255, .78);
  }
  .login-ppdpg {
    display: none;
  }
  .login-hero-body {
    text-align: center;
    margin: 14px auto 0;
  }
  .login-nadi-word {
    width: 180px;
    margin: 0 auto;
  }
  .login-akronim {
    font-size: 10px;
    margin: 8px 0 0;
    letter-spacing: .22em;
  }
  .login-akronim::before {
    display: none;
  }
  .login-hero-body h2,
  .login-pejabat {
    display: none;
  }
  .login-panel {
    padding: 20px 16px 28px;
    align-items: flex-start;
  }
  .login-box {
    padding: 26px 20px 20px;
  }
}

/* ==========================================================================
   Banner Rasmi PPD + Jam Digital (dalam bar atas, semua halaman)
   ========================================================================== */
.app-header-banner {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  height: auto;
  display: flex;
  align-items: center;
}
.app-header-media {
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  box-shadow: none;
}
.app-header-img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 2500 / 84;
  object-fit: contain;
}
.app-header-clockbox {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.92);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid rgba(24, 24, 27, 0.16);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .1);
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  pointer-events: none;
  z-index: 2;
  line-height: 1.2;
}
.ah-date {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: #18181B;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  white-space: nowrap;
}
.ah-clock {
  font-family: 'Geist Mono', monospace, sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--purple-dark);
  letter-spacing: 0.5px;
  white-space: nowrap;
}

/* Skrin besar: banner muat penuh lebar tanpa terpotong (object-fit: contain, aspect-ratio) */
@media (min-width: 769px) {
  .topbar {
    padding: 0;
    min-height: 0;
    height: auto;
  }
  .app-header-media {
    width: 100%;
    height: auto;
    border-radius: 0;
    box-shadow: none;
  }
  .app-header-img {
    width: 100%;
    height: auto;
    aspect-ratio: 2500 / 84;
    object-fit: contain;
  }
  .app-header-clockbox {
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
  }
}

/* Skrin kecil: banner mengecil mengikut lebar, jam padat */
@media (max-width: 768px) {
  .topbar {
    padding: 0 8px;
    gap: 8px;
    min-height: 44px;
    height: auto;
  }
  .app-header-banner {
    display: flex;
    align-items: center;
  }
  .app-header-media {
    width: 100%;
    border-radius: 4px;
    box-shadow: none;
  }
  .app-header-img {
    width: 100%;
    height: auto;
    max-height: 40px;
    aspect-ratio: 2500 / 84;
    object-fit: contain;
  }
  .app-header-clockbox {
    left: 4px;
    padding: 1px 4px;
    gap: 3px;
    background: rgba(255, 255, 255, 0.9);
  }
  .ah-date { display: none; }
  .ah-clock { font-size: 10px; }
}

/* Banner Bergerak (Carousel) */
.dash-carousel {
  position: relative;
  width: 100%;
  /* Tinggi ikut nisbah gambar: gambar dipapar penuh, tidak dipotong atas/bawah */
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 10px;
  background: #000;   /* ruang kosong atas/bawah gambar berwarna hitam */
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.14);
  border: 1px solid rgba(37, 99, 235, 0.28);
  user-select: none;
}
.dash-carousel-track {
  display: flex;
  align-items: center;
  width: 100%;
  transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}
.dash-carousel-slide {
  flex: 0 0 100%;
  width: 100%;
  position: relative;
}
.dash-carousel-link {
  display: block;
  width: 100%;
  position: relative;
  text-decoration: none;
  cursor: pointer;
}
.dash-carousel-img {
  width: 100%;
  height: auto;
  display: block;
}
.dash-carousel-control {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(9, 9, 11, 0.72);
  color: #BFD3FE;
  border: 1px solid rgba(37, 99, 235, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  transition: all 0.2s ease;
  backdrop-filter: blur(4px);
  padding: 0;
}
.dash-carousel-control:hover {
  background: #18181B;
  color: #93C5FD;
  border-color: #93C5FD;
  transform: translateY(-50%) scale(1.08);
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.5);
}
.dash-carousel-control.prev { left: 10px; }
.dash-carousel-control.next { right: 10px; }
.dash-carousel-indicators {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 7px;
  z-index: 5;
  padding: 3px 8px;
  border-radius: 12px;
  background: rgba(20, 10, 35, 0.5);
  backdrop-filter: blur(4px);
}
.dash-carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: all 0.25s ease;
}
.dash-carousel-dot:hover {
  background: #BFD3FE;
}
.dash-carousel-dot.is-active {
  width: 22px;
  border-radius: 5px;
  background: #C9A227;
  box-shadow: 0 0 6px rgba(37, 99, 235, 0.85);
}

/* Responsif: Carousel Mobile */
@media (max-width: 768px) {
  .dash-carousel {
    border-radius: 8px;
    margin-bottom: 8px;
  }
  .dash-carousel-control {
    width: 28px;
    height: 28px;
  }
  .dash-carousel-control.prev { left: 6px; }
  .dash-carousel-control.next { right: 6px; }
}

/* ==========================================================================
   Halaman Cetakan
   ========================================================================== */
.print-page { background: #EEEAF3; padding: var(--space-3); margin: 0; }
.print-sheet { max-width: 900px; margin: 0 auto; padding: 32px 40px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); }
.print-page h1 { text-align: center; }
.print-page table { border: 1px solid #D4D4D8; border-radius: 0; margin-bottom: var(--space-2); }
.print-page th, .print-page td { border: 1px solid #D4D4D8; padding: 6px 10px; }
.print-page tr:hover > td { background: inherit; }
.toolbar {
  position: sticky; top: var(--space-2); z-index: 5;
  display: flex; flex-wrap: wrap; gap: var(--space-2); justify-content: center;
  max-width: 900px; margin: 0 auto var(--space-3); padding: var(--space-2);
  background: var(--purple); border-radius: var(--radius); box-shadow: var(--shadow);
}
.toolbar .btn-light { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .4); }
.toolbar .btn-light:hover { background: rgba(255, 255, 255, .12); color: #fff; border-color: #fff; }
.print-head { text-align: center; margin-bottom: var(--space-4); padding-bottom: var(--space-2); border-bottom: 2px solid var(--gold); }
.print-head h1, .print-head h2 { margin: 3px 0; }
@media (max-width: 640px) { .print-sheet { padding: var(--space-3); } }

/* ==========================================================================
   @media print
   ========================================================================== */
@media print {
  @page { size: A4; margin: 12mm 10mm; }
  html, body { background: #fff !important; color: #000 !important; font-size: 10pt; height: auto !important; overflow: visible !important; }
  .no-print, .topbar, .sidebar, .sidebar-backdrop, .footer, .actions, .filters, .pager, .toolbar, .menu-toggle, .modal, button { display: none !important; }
  .app-main { margin: 0 !important; height: auto !important; overflow: visible !important; }
  .content { padding: 0 !important; height: auto !important; overflow: visible !important; }
  .container { max-width: none; padding: 0; }
  .page-head-bar { position: static !important; top: auto !important; background: transparent !important; box-shadow: none !important; border: 0 !important; margin: 0 0 10pt 0 !important; padding: 0 !important; }
  .page-head-inner { padding: 0 !important; }
  .page-head h1::after, .card h2::before, .stat::before, .stat::after, .alert::before { display: none; }
  .print-page { padding: 0; background: #fff; }
  .print-sheet { max-width: none; padding: 0; box-shadow: none; border-radius: 0; }
  .card, .stat, .table-wrap, .calendar { border: 0 !important; box-shadow: none !important; padding: 0 !important; border-radius: 0 !important; background: #fff !important; overflow: visible !important; }
  .card { margin-bottom: 10pt; }
  .grid, .grid-2 { gap: 6pt; }
  h1, h2, h3 { color: #000 !important; page-break-after: avoid; break-after: avoid; }
  a { color: #000 !important; text-decoration: none; }
  table { border-collapse: collapse !important; min-width: 0 !important; width: 100% !important; }
  th, td { border: 1px solid #555 !important; padding: 4pt 6pt !important; background: #fff !important; color: #000 !important; }
  th { background: #EEE !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  thead { display: table-header-group; }
  tr, img { page-break-inside: avoid; break-inside: avoid; }
  .badge { background: none !important; color: #000 !important; border: 1px solid #777; padding: 0 4pt; text-shadow: none; }
  .badge::before { display: none; }
  .progress, .bar-track { border: 1px solid #777; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .progress-fill, .bar-fill, .legend i, .cal-ev { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .print-head { border-bottom: 1.5pt solid #000; }
  .muted, small { color: #333 !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ==========================================================================
   Halaman Aplikasi: kad dengan bingkai gambar 2:1
   ========================================================================== */
.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--space-4); }
.app-card {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--purple-line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); color: var(--text); text-decoration: none;
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
}
.app-card:hover { transform: translateY(-2px); box-shadow: var(--shadow), 0 0 0 1px var(--btn-gold); border-color: var(--btn-gold); color: var(--text); }
.app-frame {
  position: relative; aspect-ratio: 2 / 1; overflow: hidden;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--btn-navy-top), var(--btn-navy));
  border-bottom: 1px solid var(--btn-gold-dark);
}
.app-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.app-frame-text {
  padding: 0 var(--space-4); text-align: center;
  font: 700 var(--fs-h1) / 1.15 var(--font-heading); color: var(--btn-text);
  text-shadow: 0 0 12px rgba(232, 182, 72, .35);
  overflow-wrap: anywhere;
}
.app-body { display: flex; flex-direction: column; gap: 2px; padding: var(--space-3) var(--space-4); }
.app-body strong { font-size: var(--fs-base); }
.app-body span { font-size: var(--fs-sm); color: var(--text-muted); }
.app-thumb {
  width: 100px; aspect-ratio: 2 / 1; overflow: hidden; border-radius: 6px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--btn-navy-top), var(--btn-navy)); border: 1px solid var(--btn-gold-dark);
}
.app-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.app-thumb span { padding: 0 4px; font-size: var(--fs-sm); font-weight: 700; color: var(--btn-text); text-align: center; line-height: 1.1; overflow-wrap: anywhere; }
.stack { display: flex; flex-direction: column; gap: var(--space-4); }

/* ==========================================================================
   Modul Minit Saya (minit/senarai.php)
   ========================================================================== */

/* ---- Cip Penapis Status Minit ---- */
.minit-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.minit-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--surface, #FFF);
  border: 1px solid var(--purple-line, #E4E4E7);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text, #3F3F46);
  text-decoration: none;
  line-height: 1.2;
  transition: all .15s ease;
}
.minit-chip:hover {
  border-color: #A1A1AA;
  background: #F8F8F9;
  text-decoration: none;
  color: var(--text, #18181B);
}
.minit-chip.is-active {
  background: #F4F4F6;
  border-color: var(--purple-dark, #18181B);
  color: var(--purple-dark, #18181B);
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
}
.minit-chip .chip-count {
  display: inline-block;
  padding: 1px 7px;
  background: #F4F4F5;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  color: #52525B;
}
.minit-chip.is-active .chip-count {
  background: #E4E4E7;
  color: #18181B;
}
.minit-chip .chip-dot {
  font-size: 10px;
  line-height: 1;
}
.minit-chip .dot-belum_baca { color: #E06D10; }
.minit-chip .dot-dibaca { color: #0284C7; }
.minit-chip .dot-selesai { color: #16A34A; }

/* ---- Jadual Minit Padat (.tbl-minit) ---- */
.table-wrap table.tbl-minit {
  font-size: 13px;
  line-height: 1.35;
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}
.tbl-minit th,
.tbl-minit td {
  padding: 6px 10px;
  vertical-align: middle;
}
.tbl-minit th {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .02em;
  color: var(--text-muted);
}
.tbl-minit .col-bil {
  width: 48px;
  text-align: center;
  white-space: nowrap;
}
.tbl-minit .bil-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.tbl-minit .unread-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #0284C7;
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.25);
  flex-shrink: 0;
}
.tbl-minit tr.row-unread {
  background-color: #F8FAFC;
}
.tbl-minit tr.row-unread .minit-surat-tajuk b {
  font-weight: 700;
  color: #0F172A;
}
.tbl-minit tr:hover {
  background-color: #F8F9FA;
}
.tbl-minit tr.row-unread:hover {
  background-color: #F1F5F9;
}
.tbl-minit .minit-surat-tajuk {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 13px;
  color: var(--text, #111113);
}
.tbl-minit .minit-subline {
  display: block;
  font-size: 11.5px;
  color: var(--text-muted, #71717A);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 450px;
}
.tbl-minit .col-pembuat {
  width: 140px;
  max-width: 160px;
  font-size: 12.5px;
}
.tbl-minit .col-tarikh {
  width: 90px;
  font-size: 12px;
  white-space: nowrap;
  line-height: 1.25;
}
.tbl-minit .col-tarikh small {
  font-size: 11px;
}
.tbl-minit .col-status {
  width: 105px;
  white-space: nowrap;
  text-align: center;
}
.tbl-minit .col-status .badge {
  font-size: 11px;
  padding: 2px 7px;
}
.tbl-minit .col-tindakan {
  width: 165px;
  text-align: right;
  white-space: nowrap;
}
.tbl-minit .btn-minit-tindakan {
  font-size: 12px;
  padding: 4px 10px;
  font-weight: 600;
  white-space: nowrap;
  min-height: 28px;
  height: 28px;
}

/* Butang Utama Gelap (.btn-dark) */
.btn-dark, button.btn-dark {
  background: var(--purple, #2A1B4E);
  border-color: var(--purple, #2A1B4E);
  color: #fff;
  box-shadow: none;
}
.btn-dark:hover, button.btn-dark:hover {
  background: var(--purple-dark, #1E1238);
  border-color: var(--purple-dark, #1E1238);
  color: #fff;
}

/* ---- Kemajuan Minit Bar (Kad Minit Yang Saya Buat) ---- */
.kemajuan-box {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 110px;
}
.kemajuan-bar-track {
  width: 100%;
  height: 6px;
  background: #E4E4E7;
  border-radius: 999px;
  overflow: hidden;
}
.kemajuan-bar-fill {
  height: 100%;
  background: var(--success, #16A34A);
  border-radius: 999px;
  transition: width .2s ease;
}
.kemajuan-text {
  font-size: 11px;
  color: var(--text-muted, #71717A);
  white-space: nowrap;
}

/* ---- Pop-up Tindakan Minit (.modal-minit) ---- */
.modal-minit .modal-box {
  max-width: 720px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px 22px 20px;
}
.modal-minit-head {
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--purple-line, #E4E4E7);
}
.modal-minit-head h3 {
  margin: 0;
  font-size: 16.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.minit-popup-info {
  background: #F8F9FA;
  border: 1px solid #EAECF0;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: 13px;
  line-height: 1.5;
  color: #344054;
}
.minit-popup-info div {
  margin-bottom: 4px;
}
.minit-popup-info div:last-child {
  margin-bottom: 0;
}
.minit-popup-kandungan {
  margin-bottom: 14px;
}
.minit-section-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: #475467;
  letter-spacing: .02em;
  margin-bottom: 6px;
}
.minit-teks-arahan {
  font-size: 13.5px;
  line-height: 1.6;
  color: #1D2939;
  padding: 10px 12px;
  background: #FFF;
  border: 1px solid #EAECF0;
  border-radius: 8px;
  white-space: pre-wrap;
  word-break: break-word;
}
.minit-popup-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px dashed #EAECF0;
}
.minit-popup-form label {
  font-size: 13px;
  font-weight: 700;
  display: block;
  margin-bottom: 6px;
}
.minit-popup-form textarea {
  width: 100%;
  box-sizing: border-box;
  font-size: 13.5px;
  line-height: 1.45;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #D0D5DD;
  resize: vertical;
}
.minit-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  align-items: center;
}
.minit-selesai-box {
  background: #F9FAFB;
  border: 1px solid #EAECF0;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 13px;
  margin-bottom: 8px;
}
.minit-selesai-box p {
  margin: 0 0 6px;
}
.minit-selesai-box p:last-child {
  margin-bottom: 0;
}

/* ---- Penerima Minit Ini (Pop-up Kecil Bahagian C) ---- */
.minit-popup-penerima-lain {
  margin-bottom: 14px;
}
.minit-penerima-mini-wrap {
  border: 1px solid #EAECF0;
  border-radius: 8px;
  overflow: hidden;
}
.tbl-penerima-mini {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  line-height: 1.35;
}
.tbl-penerima-mini th,
.tbl-penerima-mini td {
  padding: 5px 8px;
  border-bottom: 1px solid #F1F5F9;
  vertical-align: middle;
}
.tbl-penerima-mini th {
  background: #F8FAFC;
  font-size: 11px;
  font-weight: 700;
  color: #475467;
  text-transform: uppercase;
}
.tbl-penerima-mini tr:last-child td {
  border-bottom: 0;
}
.tbl-penerima-mini tr.row-me {
  background: #F0FDF4;
}
.badge-me {
  font-size: 10px;
  font-weight: 700;
  color: #15803D;
  background: #DCFCE7;
  padding: 1px 5px;
  border-radius: 4px;
  margin-left: 4px;
}

/* ==========================================================================
   Panel Dua Ruang Minit Surat (Modal XL & Halaman Penuh)
   ========================================================================== */

/* ---- Modal Saiz XL (.modal-xl) ---- */
.modal-xl .modal-box {
  width: min(1400px, 96vw);
  max-width: min(1400px, 96vw);
  height: 92vh;
  max-height: 92vh;
  padding: 0;
  overflow: hidden;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
}
.modal-xl .modal-close {
  display: none !important;
}
.modal-xl .modal-body {
  height: 100%;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.mp-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  background: var(--surface, #FFF);
}
.mp-shell-page {
  border: 1px solid var(--purple-line, #E4E4E7);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}
.mp-head {
  height: 52px;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: #FFF;
  border-bottom: 1px solid var(--purple-line, #E4E4E7);
  gap: 12px;
}
.mp-head-title {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  font-size: 14.5px;
}
.mp-head-title .clamp-1 {
  font-weight: 700;
  color: var(--text, #111113);
}
.mp-head-close {
  background: transparent;
  border: 0;
  font-size: 26px;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  margin-left: auto;
}
.mp-head-close:hover {
  background: #F4F4F6;
  color: #000;
}

/* Grid Dua Ruang */
.mp-grid {
  display: grid;
  grid-template-columns: minmax(380px, 42%) 1fr;
  height: calc(92vh - 52px);
  overflow: hidden;
}
.mp-grid-full {
  height: calc(100vh - var(--topbar-h, 60px) - var(--page-head-h, 50px) - 60px);
  min-height: 600px;
}

/* Ruang Kiri */
.mp-kiri {
  overflow-y: auto;
  padding: 14px 16px;
  border-right: 1px solid var(--purple-line, #E4E4E7);
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #FAFAFC;
  font-size: 13px;
}
.mp-card {
  background: #FFF;
  border: 1px solid var(--purple-line, #E4E4E7);
  border-radius: 10px;
  padding: 10px 12px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .03);
}

/* Butiran Surat */
.mp-butiran {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mp-surat-tajuk-box .mp-tajuk-text {
  font-size: 14px;
  color: var(--text, #111113);
  line-height: 1.35;
}
.mp-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
  font-size: 12px;
  background: #F8F9FA;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid #EAECF0;
}
.mp-info-cell {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.mp-info-lbl {
  color: var(--text-muted, #64748B);
  font-size: 11px;
}
.mp-info-val {
  font-weight: 600;
  color: var(--text, #1E293B);
}
.mp-butiran-acts {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* Tindakan Saya */
.mp-tindakan-box {
  background: #F8FAFC;
  border-color: #CBD5E1;
  border-left: 4px solid var(--info, #0284C7);
}
.mp-tindakan-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  gap: 8px;
}
.mp-tindakan-title b {
  font-size: 13px;
  color: #0F172A;
}
.mp-section-sub {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748B;
  letter-spacing: .02em;
}
.mp-teks-arahan {
  font-size: 12.5px;
  line-height: 1.5;
  color: #1E293B;
  background: #FFF;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid #E2E8F0;
  margin: 3px 0 8px;
}
.mp-tindakan-form textarea {
  width: 100%;
  box-sizing: border-box;
  font-size: 12.5px;
  line-height: 1.4;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid #CBD5E1;
  resize: vertical;
}
.mp-tindakan-btns {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}
.mp-selesai-text {
  font-size: 12px;
  color: #334155;
  background: #FFF;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid #E2E8F0;
}

/* Sejarah Minit */
.mp-sejarah .mp-section-label,
.mp-borang .mp-section-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .02em;
  color: #475467;
  margin-bottom: 6px;
}
.mp-minits-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.mp-minit-item {
  border: 1px solid #EAECF0;
  border-radius: 8px;
  overflow: hidden;
  background: #FFF;
}
.mp-minit-summary {
  padding: 7px 10px;
  cursor: pointer;
  background: #F8FAFC;
  font-size: 12.5px;
  display: flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}
.mp-minit-summary:hover {
  background: #F1F5F9;
}
.mp-minit-sum-title {
  font-weight: 700;
  color: #0F172A;
}
.mp-minit-sum-meta {
  color: #64748B;
  font-size: 11.5px;
}
.mp-minit-body {
  padding: 8px 10px;
  border-top: 1px solid #EAECF0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.mp-minit-kandungan {
  font-size: 12px;
  line-height: 1.45;
  color: #334155;
  cursor: pointer;
}
.tbl-minit-recipients {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
}
.tbl-minit-recipients th,
.tbl-minit-recipients td {
  padding: 4px 6px;
  border-bottom: 1px solid #F1F5F9;
  vertical-align: middle;
}
.tbl-minit-recipients th {
  background: #F8FAFC;
  font-size: 10.5px;
  font-weight: 700;
  color: #64748B;
  text-transform: uppercase;
}
.mp-minit-foot {
  display: flex;
  justify-content: flex-end;
  padding-top: 4px;
}

/* Borang Minit Baharu */
.mp-borang {
  border: 1px solid var(--purple-line, #E4E4E7);
  border-radius: 10px;
  padding: 10px 12px;
  background: #FFF;
}
.mp-form-new {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mp-field label {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 3px;
  display: block;
  color: #334155;
}
.mp-field input[type="text"],
.mp-field textarea {
  width: 100%;
  box-sizing: border-box;
  font-size: 12.5px;
  line-height: 1.4;
  padding: 6px 8px;
  border: 1px solid #D0D5DD;
  border-radius: 6px;
}
.mp-form-submit {
  display: flex;
  justify-content: flex-end;
  margin-top: 2px;
}
.mp-form-submit button {
  font-size: 12.5px;
  padding: 5px 14px;
}

/* Pemilih Penerima Carian (.pick) */
.pick {
  position: relative;
  font-size: 12.5px;
}
.pick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 5px 8px;
  background: var(--surface, #FFF);
  border: 1px solid #D0D5DD;
  border-radius: 8px;
  min-height: 38px;
  align-items: center;
  cursor: text;
}
.pick-chips:focus-within {
  border-color: var(--purple, #2A1B4E);
  box-shadow: 0 0 0 3px rgba(42, 27, 78, 0.1);
}
.pick-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #EEF2F6;
  border: 1px solid #CFD8DC;
  border-radius: 14px;
  padding: 2px 7px 2px 9px;
  font-size: 11.5px;
  font-weight: 500;
  color: #1E293B;
  line-height: 1.3;
}
.pick-chip-remove {
  background: none;
  border: 0;
  padding: 0 2px;
  cursor: pointer;
  color: #64748B;
  font-size: 14px;
  line-height: 1;
}
.pick-chip-remove:hover {
  color: #DC2626;
}
.pick-input {
  flex: 1;
  min-width: 140px;
  border: 0 !important;
  outline: none !important;
  box-shadow: none !important;
  padding: 4px 6px;
  font-size: 12px;
  background: transparent;
}
.pick-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 60;
  background: #FFF;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  box-shadow: var(--shadow-lg, 0 10px 15px -3px rgba(0, 0, 0, 0.1));
  max-height: 220px;
  overflow-y: auto;
  margin: 4px 0 0;
  padding: 4px 0;
  list-style: none;
}
.pick-item {
  padding: 6px 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 1px;
  border-bottom: 1px solid #F1F5F9;
}
.pick-item:last-child {
  border-bottom: 0;
}
.pick-item:hover,
.pick-item.is-selected {
  background: #F1F5F9;
}
.pick-item-name {
  font-weight: 600;
  font-size: 12px;
  color: #0F172A;
  display: flex;
  align-items: center;
  gap: 6px;
}
.pick-item-meta {
  font-size: 11px;
  color: #64748B;
}
.pick-item-all {
  background: #FAF5FF;
  border-bottom: 1px solid #E9D5FF;
  padding: 7px 10px;
  color: var(--purple, #2A1B4E);
}
.pick-item-all:hover,
.pick-item-all.is-selected {
  background: #F3E8FF;
}
.badge-diminit {
  font-size: 10px;
  font-weight: 500;
  padding: 1px 5px;
  border-radius: 4px;
  background: #FEF3C7;
  color: #92400E;
}
.pick-count {
  font-size: 11px;
  margin-top: 3px;
}

/* Ruang Kanan (Paparan PDF) */
.mp-kanan {
  background: #525659;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}
.mp-pdf-bar,
.pdf-bar {
  height: 38px;
  min-height: 38px;
  background: #323639;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  color: #F1F1F1;
  font-size: 12px;
}
.mp-pdf-name,
.pdf-nama {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 58%;
  font-weight: 500;
}
.mp-pdf-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}
.mp-pdf-actions .btn {
  font-size: 11px;
  padding: 2px 8px;
  min-height: 24px;
  height: 24px;
  background: #474B4E;
  color: #FFF;
  border-color: #5F6368;
}
.mp-pdf-actions .btn:hover:not(.btn-disabled):not([aria-disabled="true"]) {
  background: #5F6368;
  color: #FFF;
}
.btn-disabled,
.btn[aria-disabled="true"],
a.btn-disabled,
a[aria-disabled="true"] {
  opacity: 0.45 !important;
  pointer-events: none !important;
  cursor: not-allowed !important;
  filter: grayscale(1);
}
.mp-pdf-body {
  flex: 1;
  height: calc(100% - 38px);
  position: relative;
}
.mp-pdf-body iframe,
.pdf-view {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
.mp-pdf-empty,
.pdf-empty-box {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 24px 16px;
  box-sizing: border-box;
  overflow-y: auto;
}
.pdf-empty-card {
  max-width: 380px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}
.pdf-empty-icon {
  color: #FBBF24;
}
.pdf-empty-msg {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.45;
  color: #F3F4F6;
}
.pdf-empty-debug {
  margin: 0;
  font-size: 11px;
  word-break: break-all;
  color: #9CA3AF;
}
.pdf-upload-card {
  margin-top: 10px;
  padding: 12px 14px;
  background: #2D3134;
  border: 1px solid #4B5563;
  border-radius: 6px;
  width: 100%;
  text-align: left;
  box-sizing: border-box;
}
.pdf-upload-title {
  font-size: 12px;
  color: #E5E7EB;
  margin-bottom: 8px;
}
.pdf-upload-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pdf-upload-input-wrap input[type="file"] {
  font-size: 11.5px;
  color: #D1D5DB;
  width: 100%;
}
.mp-img-body {
  overflow: auto;
  padding: 16px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  box-sizing: border-box;
}
.pdf-img-preview {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* Responsif Telefon & Tablet Kecil (< 900px) */
@media (max-width: 899px) {
  .modal-xl .modal-box {
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }
  .mp-grid {
    grid-template-columns: 1fr;
    height: calc(100vh - 52px);
  }
  .mp-kanan {
    display: none;
  }
  .mp-kiri {
    border-right: 0;
    height: 100%;
  }
  .mp-mobile-pdf-btn {
    display: inline-flex !important;
  }
}
@media (min-width: 900px) {
  .mp-mobile-pdf-btn {
    display: none !important;
  }
}

/* ==========================================================================
   Mod Halaman Luas (.page-wide) — Melegakan jadual lebar pada desktop
   ========================================================================== */
@media (min-width: 992px) {
  body.page-wide .content,
  body.page-wide .page-head-inner {
    padding-left: 24px !important;
    padding-right: 24px !important;
  }
}

/* ==========================================================================
   Komponen Avatar Edit & Crop
   ========================================================================== */
.avatar-edit {
  position: relative;
  border-radius: 50%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  display: inline-block;
  line-height: 0;
  box-shadow: none;
  min-height: 0 !important;
}
.avatar-edit:hover,
.avatar-edit:focus {
  transform: none;
  box-shadow: none;
  background: transparent;
}
.avatar-edit .user-avatar,
.avatar-edit .user-avatar-img {
  border-radius: 50%;
  display: block;
  object-fit: cover;
  transition: filter var(--t);
}
.avatar-edit:hover .user-avatar-img,
.avatar-edit:hover .user-avatar {
  filter: brightness(0.85);
}
.avatar-cam {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #1F2937;
  color: #fff;
  display: grid;
  place-items: center;
  border: 2px solid #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .25);
  transition: transform var(--t), background var(--t);
}
.avatar-cam .icon {
  width: 14px;
  height: 14px;
}
.avatar-edit:hover .avatar-cam {
  transform: scale(1.08);
  background: #111827;
}

/* Ikon kamera mini untuk jadual (avatar 30px) */
.avatar-mini {
  width: 30px;
  height: 30px;
  min-width: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.avatar-cam-mini {
  width: 14px;
  height: 14px;
  right: -2px;
  bottom: -2px;
  border-width: 1.5px;
}
.avatar-cam-mini .icon {
  width: 8px;
  height: 8px;
}

/* Modal Cropper */
.crop-modal-wrap {
  width: 100%;
  max-width: 620px;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-sizing: border-box;
}
.crop-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid #E5E7EB;
  background: #F9FAFB;
}
.crop-modal-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #111827;
}
.crop-modal-head .modal-close-btn {
  background: none;
  border: 0;
  font-size: 20px;
  cursor: pointer;
  color: #6B7280;
  min-height: 0 !important;
  padding: 4px;
  line-height: 1;
}
.crop-modal-body {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 16px;
  padding: 16px;
  box-sizing: border-box;
}
@media (max-width: 640px) {
  .crop-modal-body {
    grid-template-columns: 1fr;
  }
}
.crop-stage {
  max-height: 340px;
  background: #111827;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.crop-stage img {
  max-width: 100%;
  display: block;
}
.crop-preview-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}
.crop-preview-label {
  font-size: 12px;
  font-weight: 600;
  color: #4B5563;
}
.crop-preview-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--gold);
  background: #F3F4F6;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .15);
}
.crop-preview-hint {
  font-size: 11px;
  color: #6B7280;
  line-height: 1.35;
}
.crop-modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid #E5E7EB;
  background: #F9FAFB;
  flex-wrap: wrap;
  gap: 8px;
}
.crop-tools, .crop-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* ==========================================================================
   Profil Saya (profil.php) — Padat 1 Halaman (3 Lajur)
   ========================================================================== */
.profile-grid-3 {
  display: grid;
  grid-template-columns: 300px 1fr 340px;
  gap: 14px;
  align-items: stretch;
}
@media (max-width: 1199px) and (min-width: 768px) {
  .profile-grid-3 {
    grid-template-columns: 300px 1fr;
  }
  .profile-grid-3 .card-pwd {
    grid-column: 1 / -1;
  }
}
@media (max-width: 767px) {
  .profile-grid-3 {
    grid-template-columns: 1fr;
  }
}
.profile-card {
  padding: 14px;
  margin: 0;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-sizing: border-box;
}
.profile-card h2 {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 10px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.profile-identity {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.profile-avatar-wrap {
  position: relative;
  margin-bottom: 4px;
}
.profile-avatar-hint {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 6px;
}
.profile-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
  margin-bottom: 2px;
}
.profile-jawatan {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}
.profile-info-grid {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  text-align: left;
  font-size: 11.5px;
}
.profile-info-item {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.profile-info-lbl {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.profile-info-val {
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 11.5px;
}
.profile-admin-note {
  font-size: 10px;
  color: var(--muted);
  margin-top: 10px;
  line-height: 1.35;
  text-align: center;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
}
.profile-avatar-actions {
  margin-top: 6px;
}
.profile-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.profile-form .form-group {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.profile-form label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}
.profile-form input {
  height: 36px;
  min-height: 36px;
  padding: 6px 10px;
  font-size: 13px;
}
.profile-form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.profile-form .form-actions {
  margin-top: auto;
  padding-top: 10px;
}

/* ==========================================================================
   Admin > Pengguna & Pengguna Borang
   ========================================================================== */
.u-name-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.u-name-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  line-height: 1.25;
}
.u-name-clamp {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px;
}
.u-email-clamp {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--muted);
  font-size: 11px;
}
.user-avatar-edit-box {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 14px;
  background: var(--purple-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 16px;
}
.ua-box-left {
  flex-shrink: 0;
}
.ua-box-right {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ua-title {
  font-size: 13px;
  color: var(--text);
}
.ua-desc {
  font-size: 12px;
  line-height: 1.35;
}
.btn-del-avatar {
  margin-top: 4px;
  align-self: flex-start;
}

/* ==========================================================================
   Dashboard Split Layout & e-Gerak Full Height (#dashGerak)
   ========================================================================== */
.dash-split {
  margin-bottom: var(--space-4);
}
.dash-right {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  min-height: 0;
}
#dashGerak .card-title {
  margin: 0 0 10px 0;
  font-size: var(--fs-base, 14px);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: var(--space-2, 8px);
  flex-shrink: 0;
}
#dashGerak .card-title::before {
  content: "";
  width: 4px;
  height: 1.05em;
  border-radius: 4px;
  background: var(--red, #E11D48);
  flex-shrink: 0;
}
@media (min-width: 1100px) {
  .dash-split {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: var(--space-4);
    align-items: stretch;
  }
  .dash-left {
    position: relative;
    min-height: 0;
    height: 100%;
  }
  #dashGerak {
    position: absolute;
    inset: 0;
    margin: 0 !important;
    display: flex;
    flex-direction: column;
    min-height: 0;
    box-sizing: border-box;
  }
}
#dashGerak .dash-gerak-scroll {
  flex: 1 1 auto;
  min-height: 0;
  height: auto !important;
  max-height: none !important;
  overflow-y: auto;
  overflow-x: hidden;
  border: 1px solid #E5E7EB;
  border-radius: 10px;
  background: #fff;
}
#dashGerak .dash-gerak-scroll::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
#dashGerak .dash-gerak-scroll::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 4px;
}
#dashGerak .dash-gerak-scroll table {
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}
#dashGerak thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #E2E8F0;
}
#dashGerak tbody tr:last-child td {
  border-bottom: 1px solid #EEF2F7;
}
@media (max-width: 1099.98px) {
  .dash-split {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }
  .dash-left {
    position: static;
    height: auto;
  }
  #dashGerak {
    position: static;
    height: auto;
    display: flex;
    flex-direction: column;
  }
  #dashGerak .dash-gerak-scroll {
    max-height: 420px !important;
  }
}
