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

:root {
  /* ---- Warna jenama ---- */
  --purple:        #4B2A7B;   /* ungu utama: header, sidebar */
  --purple-dark:   #2E1A4F;   /* ungu gelap */
  --purple-soft:   #F3EEFA;   /* latar kad / hover */
  --purple-line:   #E4DAF2;   /* garisan halus */
  --purple-mid:    #6B4A9E;
  --gold:          #C9A227;   /* butang utama, ikon aktif, aksen */
  --gold-dark:     #A9861A;
  --gold-soft:     #F5E7B8;
  --bg:            #FAF8FC;   /* latar halaman */
  --surface:       #FFFFFF;
  --text:          #1F1A2B;   /* teks utama */
  --text-muted:    #625A70;   /* >= 4.5:1 atas --bg & putih */
  --on-purple:     #FFFFFF;
  --on-gold:       #1F1A2B;   /* teks atas emas (kontras ~7:1) */

  /* ---- Warna status ---- */
  --success: #1E6B3A;  --success-bg: #E4F4EA;  --success-line: #B5DFC3;
  --danger:  #A61B1B;  --danger-bg:  #FCE8E8;  --danger-line:  #F3B9B9;
  --warning: #7A5600;  --warning-bg: #FFF4D6;  --warning-line: #F1D68A;
  --info:    #4B2A7B;  --info-bg:    #EFE7FA;  --info-line:    #D5C4EE;
  --orange:  #8A4300;  --orange-bg:  #FFEBD6;

  /* ---- Tipografi (Geist & Geist Mono) ---- */
  --font-body:    'Geist', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --font-heading: 'Geist', system-ui, sans-serif;
  --font-mono:    'Geist Mono', monospace, sans-serif;
  --fs-base: 10pt;
  --fs-sm:   9pt;
  --fs-xs:   8pt;
  --fs-h1:   16pt;
  --fs-h2:   13pt;
  --fs-h3:   11pt;
  --lh:      1.5;

  /* ---- 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(46, 26, 79, .05), 0 1px 3px rgba(46, 26, 79, .06);
  --shadow:    0 3px 10px rgba(46, 26, 79, .06), 0 1px 2px rgba(46, 26, 79, .04);
  --shadow-lg: 0 16px 36px rgba(46, 26, 79, .16);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --t: .2s var(--ease);
  --focus: 0 0 0 3px rgba(201, 162, 39, .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: 'Geist', 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: 'Geist', system-ui, sans-serif;
}
h1, h2, h3, h4 {
  font-family: 'Geist', 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(75, 42, 123, .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%, #3B2063 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: 1px;
  background: linear-gradient(180deg, rgba(201, 162, 39, .7), rgba(201, 162, 39, 0) 70%);
}
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, #E2C55A, var(--gold) 55%, var(--gold-dark));
  color: var(--purple-dark);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 12pt;
  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: 11pt; 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: 8px 0 16px;
}
.sidebar-nav::-webkit-scrollbar {
  display: none;               /* Chrome, Safari, Edge */
}
.sidebar-nav ul { list-style: none; margin: 0; padding: 0; }

/* ---- Kumpulan Kategori Accordion ---- */
.nav-group {
  margin-top: 0;
  margin-bottom: 8px;          /* Jarak antara kategori 8px */
}

/* Tajuk Kategori Accordion */
.nav-group-toggle {
  display: flex;
  align-items: center;
  gap: 10px;                   /* Jarak ikon ke teks menu 10px */
  width: 100%;
  min-height: 38px;
  height: 38px;                /* Tinggi item ~38px */
  padding: 8px 16px;           /* Padding item 8px 16px */
  background: transparent;
  border: 0;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 9pt;              /* Tajuk kategori 9pt huruf besar */
  letter-spacing: normal;      /* Letter-spacing normal */
  word-spacing: normal;        /* Word-spacing normal */
  text-transform: uppercase;
  color: var(--gold-soft);
  text-align: left;
  border-radius: 8px;
  box-shadow: none;
  margin: 0;
  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: 2px 0 0;
  display: flex;
  flex-direction: column;
  gap: 2px;                    /* Gap antara item 2px */
}

/* Item Menu Pautan */
.nav-link, .sidebar .linkbtn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;                   /* Jarak ikon ke teks menu 10px */
  min-height: 38px;
  height: 38px;                /* Tinggi item ~38px */
  margin: 0 8px;
  padding: 8px 16px;           /* Padding item 8px 16px */
  border-radius: 8px;
  border: 0;
  width: calc(100% - 16px);
  background: transparent;
  color: rgba(255, 255, 255, .86);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 10pt;             /* Saiz teks menu 10pt */
  letter-spacing: normal;      /* Letter-spacing normal */
  word-spacing: normal;        /* Word-spacing normal */
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  box-shadow: none;
  transition: background var(--t), color var(--t), transform var(--t);
}
.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(201, 162, 39, .28), rgba(201, 162, 39, .08));
  color: #fff;
  font-weight: 600;
}
.nav-link.active::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 6px; bottom: 6px;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: var(--gold);
  box-shadow: 0 0 10px rgba(201, 162, 39, .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(31, 26, 43, .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: var(--space-3);
  min-height: var(--topbar-h);
  height: var(--topbar-h);
  padding: 0 20px;
  background: var(--purple);
  color: var(--on-purple);
  border-bottom: 2.5px solid var(--gold);
  box-shadow: 0 2px 8px rgba(46, 26, 79, .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-title { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.topbar-title .eyebrow { font-size: var(--fs-xs); letter-spacing: normal; text-transform: uppercase; color: var(--gold-soft); font-weight: 700; }
.topbar-title .app-full { font-size: var(--fs-sm); color: rgba(255, 255, 255, .84); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: normal; }
.topbar .brand { color: #fff; font-family: var(--font-heading); font-weight: 600; text-decoration: none; }
.topbar .spacer { flex: 1; }
.user-chip {
  display: flex; align-items: center; gap: 8px;
  min-height: 36px; height: 36px;
  padding: 2px 6px 2px 3px;
  border-radius: var(--radius-pill);
  color: #fff; text-decoration: none;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .14);
  transition: background var(--t);
}
.user-chip:hover { background: rgba(255, 255, 255, .15); color: #fff; }
.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);
}
.user-meta { display: none; flex-direction: column; line-height: 1.15; padding-right: 4px; min-width: 0; }
.user-meta .who { font-weight: 600; font-size: 8.5pt; max-width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: normal; }
.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: 7.5pt; font-weight: 700; letter-spacing: normal;
}
@media (min-width: 640px) { .user-meta { display: flex; } }

/* ==========================================================================
   Kelegaan Kandungan (15% Desktop, 5% Tablet, 16px Mobile)
   ========================================================================== */
.content {
  box-sizing: border-box;
  width: 100%;
  padding: 14px 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: 14px;
    padding-bottom: 16px;
  }
}

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

.page-head {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 8px; margin-bottom: 10px;
}
.page-head h1 {
  margin: 0; position: relative; padding-bottom: 4px; font-size: 14pt;
  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);
}
.breadcrumb {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
  margin: 0 0 2px; font-size: 8.5pt; 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: 8.5pt;
  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: 11pt;
    margin-bottom: 6px;
  }
  .card h3 {
    font-size: 10pt;
    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: 15pt;
    line-height: 1.1;
  }
  .stat .lbl {
    font-size: 8pt;
    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: 8.5pt;
  }
  th, td {
    padding: 5px 10px;
    font-size: 8.5pt;
  }
  th {
    font-size: 8pt;
  }

  /* 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: #D5C4EE;
    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: 11pt;
  }
  .cal-head button {
    min-height: 30px;
    height: 30px;
    padding: 2px 8px;
    font-size: 8pt;
  }
  .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: 8pt;
    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: 7.5pt;
    border-right: 1px solid var(--purple-line);
    overflow: hidden;
  }
  .cal-grid td:last-child {
    border-right: 0;
  }
  .cal-day {
    font-size: 7.5pt;
    margin-bottom: 1px;
    line-height: 1;
  }
  .cal-ev {
    font-size: 7pt;
    padding: 1px 3px;
    margin-bottom: 1px;
    line-height: 1.15;
    max-height: 16px;
  }
  .legend {
    margin-bottom: 4px;
    gap: 4px 10px;
    font-size: 8pt;
  }
}

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

/* ---- 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(--gold); flex-shrink: 0; }
@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(--gold), 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(243, 238, 250, 0) 70%); }
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: #D5C4EE; }
.stat .num { position: relative; z-index: 1; font-family: var(--font-heading); font-weight: 600; font-size: 18pt; 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; }

/* ---- 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; }

/* ---- 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(75, 42, 123, .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; }
}

/* ---- Butang ---- */
button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 38px; padding: 8px 16px;
  border: 1.5px solid var(--gold); border-radius: 8px;
  background: var(--gold); color: var(--on-gold);
  font: 600 var(--fs-sm) / 1.2 var(--font-body);
  letter-spacing: normal;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  box-shadow: 0 1px 2px rgba(46, 26, 79, .10), inset 0 1px 0 rgba(255, 255, 255, .3);
  transition: background var(--t), border-color var(--t), color var(--t), box-shadow var(--t), transform var(--t);
}
button:hover, .btn:hover { background: #D4AF3A; border-color: #D4AF3A; color: var(--on-gold); transform: translateY(-1px); box-shadow: 0 4px 10px rgba(201, 162, 39, .3); }
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: #CDBDE6; 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(75, 42, 123, .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: #8B1414; border-color: #8B1414; 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); }
}
.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, #E2C55A, 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(31, 26, 43, .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(--gold); 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: 20px; box-shadow: none; }
.modal-close:hover { background: var(--purple-soft); color: var(--purple); transform: none; box-shadow: none; }
@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: 12pt; }
.row-item { padding: var(--space-2); margin-bottom: var(--space-2); border: 1px dashed #D5C4EE; border-radius: var(--radius-sm); background: #FDFCFF; }

/* ==========================================================================
   Halaman Log Masuk
   ========================================================================== */
.login-page { min-height: 100vh; display: grid; grid-template-columns: 1fr; background: var(--bg); }
.login-hero {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: center; gap: var(--space-3);
  padding: var(--space-6) var(--space-4);
  color: #fff;
  background:
    radial-gradient(1200px 500px at -10% -20%, rgba(201, 162, 39, .28), transparent 60%),
    radial-gradient(700px 500px at 120% 120%, rgba(201, 162, 39, .18), transparent 60%),
    linear-gradient(140deg, var(--purple) 0%, #3A1F62 50%, var(--purple-dark) 100%);
}
.login-hero::before {
  content: ""; position: absolute; inset: 0; opacity: .14;
  background-image: radial-gradient(rgba(255, 255, 255, .9) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(180deg, #000 0%, transparent 80%);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 80%);
}
.login-hero::after {
  content: ""; position: absolute; right: -120px; bottom: -120px; width: 340px; height: 340px; border-radius: 50%;
  border: 2px solid rgba(201, 162, 39, .45); box-shadow: 0 0 0 30px rgba(201, 162, 39, .06), 0 0 0 70px rgba(201, 162, 39, .04);
}
.login-hero > * { position: relative; z-index: 1; }
.login-brand { display: flex; align-items: center; gap: var(--space-3); }
.login-brand .brand-mark { width: 48px; height: 48px; font-size: 15pt; border-radius: 12px; }
.login-brand strong { font-family: var(--font-heading); font-weight: 600; font-size: 15pt; display: block; line-height: 1.1; }
.login-brand span { font-size: var(--fs-sm); color: var(--gold-soft); }
.login-hero h1 { color: #fff; font-size: 17pt; margin: var(--space-2) 0 0; max-width: 500px; }
.login-hero h1 em { font-style: normal; color: var(--gold); }
.login-hero p { color: rgba(255, 255, 255, .84); max-width: 460px; margin: 0; }
.login-features { display: none; list-style: none; margin: var(--space-3) 0 0; padding: 0; gap: var(--space-2); }
.login-features li { display: flex; align-items: center; gap: var(--space-3); color: rgba(255, 255, 255, .9); font-weight: 500; font-size: 9.5pt; }
.login-features .ico { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; background: rgba(255, 255, 255, .1); border: 1px solid rgba(201, 162, 39, .45); color: var(--gold); }
.login-panel { display: flex; align-items: center; justify-content: center; padding: var(--space-5) var(--space-4); }
.login-box {
  width: 100%; max-width: 400px;
  background: var(--surface); border: 1px solid var(--purple-line); border-radius: 16px;
  padding: 32px 24px; box-shadow: var(--shadow-lg);
  animation: pop .35s var(--ease);
}
.login-box h2 { font-size: 15pt; margin-bottom: 3px; }
.login-box .sub { color: var(--text-muted); margin-bottom: var(--space-4); font-size: 9pt; }
.input-icon { position: relative; }
.input-icon > .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #8A7AA3; pointer-events: none; width: 17px; height: 17px; }
.input-icon > input { padding-left: 40px; }
.input-icon > .pw-toggle {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; min-height: 0; padding: 0; border: 0; border-radius: 6px;
  background: transparent; color: #8A7AA3; box-shadow: none;
}
.input-icon > .pw-toggle:hover { background: var(--purple-soft); color: var(--purple); transform: translateY(-50%); box-shadow: none; }
.input-icon > input[type=password], .input-icon > input.has-toggle { padding-right: 44px; }
.btn-block { width: 100%; margin-top: var(--space-4); min-height: 44px; font-size: 10pt; }
.login-foot { margin-top: var(--space-4); text-align: center; font-size: var(--fs-xs); color: var(--text-muted); }
@media (min-width: 992px) {
  .login-page { grid-template-columns: 1.1fr 1fr; }
  .login-hero { padding: var(--space-6) clamp(40px, 5vw, 80px); }
  .login-hero h1 { font-size: 22pt; }
  .login-features { display: grid; }
  .login-box { padding: 36px 32px; }
}

/* ==========================================================================
   Header Baharu: Imej Penuh & Tindanan Jam Digital (Semua Halaman)
   ========================================================================== */
.app-header-banner {
  position: relative;
  width: 100%;
  margin-bottom: 12px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(46, 26, 79, 0.08);
  border: 1px solid rgba(201, 162, 39, 0.28);
  background: #FFFFFF;
}
.app-header-media {
  position: relative;
  width: 100%;
  display: block;
  overflow: hidden;
  border-radius: 9px;
}
.app-header-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}
.app-header-clockbox {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  padding: 5px 12px;
  border-radius: 8px;
  border: 1px solid rgba(75, 42, 123, 0.16);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  z-index: 5;
  pointer-events: none;
}
.ah-date {
  font-family: 'Geist', system-ui, sans-serif;
  font-size: 7.5pt;
  font-weight: 700;
  color: #4B2A7B;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  line-height: 1.2;
  white-space: nowrap;
}
.ah-clock {
  font-family: 'Geist Mono', monospace, sans-serif;
  font-size: 15pt;
  font-weight: 700;
  color: #1F1A2B; /* tebal berwarna gelap */
  letter-spacing: 0.5px;
  line-height: 1.15;
  margin-top: 1px;
  white-space: nowrap;
}

/* Responsif: Di mobile (<768px), gambar kekal penuh lebar dan jam dipapar kemas di bawah gambar */
@media (max-width: 768px) {
  .app-header-banner {
    padding-bottom: 6px;
  }
  .app-header-clockbox {
    position: static;
    transform: none;
    margin: 6px auto 2px;
    width: fit-content;
    max-width: 95%;
    align-items: center;
    justify-content: center;
    flex-direction: row;
    gap: 12px;
    background: #FFFFFF;
    border: 1px solid rgba(75, 42, 123, 0.18);
    padding: 4px 12px;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(46, 26, 79, 0.06);
  }
  .ah-date {
    font-size: 7pt;
  }
  .ah-clock {
    font-size: 12pt;
    margin-top: 0;
  }
}

/* Banner Bergerak (Carousel) */
.dash-carousel {
  position: relative;
  width: 100%;
  height: 200px;
  max-height: 200px;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 10px;
  background: #1F1133;
  box-shadow: 0 4px 14px rgba(46, 26, 79, 0.14);
  border: 1px solid rgba(201, 162, 39, 0.28);
  user-select: none;
}
.dash-carousel-track {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}
.dash-carousel-slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  position: relative;
}
.dash-carousel-link {
  display: block;
  width: 100%;
  height: 100%;
  position: relative;
  text-decoration: none;
  cursor: pointer;
}
.dash-carousel-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.dash-carousel-control {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(30, 15, 55, 0.72);
  color: #F5E7B8;
  border: 1px solid rgba(201, 162, 39, 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: #4B2A7B;
  color: #FFD54F;
  border-color: #FFD54F;
  transform: translateY(-50%) scale(1.08);
  box-shadow: 0 0 10px rgba(201, 162, 39, 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: #F5E7B8;
}
.dash-carousel-dot.is-active {
  width: 22px;
  border-radius: 5px;
  background: #C9A227;
  box-shadow: 0 0 6px rgba(201, 162, 39, 0.85);
}

/* Responsif: Carousel Mobile */
@media (max-width: 768px) {
  .dash-carousel {
    height: 140px;
    max-height: 140px;
    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; }
}

.dash-welcome {
  margin: 0 0 8px 0;
  font-size: 9.5pt;
  color: var(--text);
}

/* ==========================================================================
   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 #CFC6DB; border-radius: 0; margin-bottom: var(--space-2); }
.print-page th, .print-page td { border: 1px solid #CFC6DB; 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 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; }
}
