/* ==========================================================
   eCert POLIMAS - SISTEM PENGURUSAN & PENJANAAN SIJIL DIGITAL
   TEMA: EXECUTIVE WHITE & SIGNATURE GOLD (GRED SISTEM KERAJAAN)
   Rujukan Reka Bentuk: Sistem Rasmi POLIMAS (ULPL)
   Dibangunkan & Direka oleh: M.S.K
   ========================================================== */

:root {
  --primary-navy: #0f172a;
  --royal-blue: #1e3a8a;
  --royal-blue-bright: #2563eb;
  --royal-blue-light: #eff6ff;
  --royal-blue-border: #bfdbfe;
  
  --gold-bright: #fbbf24;
  --gold-amber: #f59e0b;
  --gold-dark: #d97706;
  --gold-light: #fffbeb;
  --gold-border: #fde68a;

  --bg-page: #e8f2fc;
  --bg-card: #ffffff;
  --border-color: #cbd5e1;
  --border-subtle: #e2e8f0;
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-soft: #94a3b8;

  --topbar-height: 52px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --container-max: 1600px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ==================== GLOBAL MODERN CUSTOM SCROLLBAR ==================== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}
* {
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

button, input, select, textarea,
.top-institutional-header, .topbar-nav-row, .top-nav-bar, .top-nav-menu, .top-nav-link, .nav-drop-item, .nav-mobile-brand, .inst-brand-link {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif !important;
}

/* Garisan Aksentuasi Emas Signature di atas skrin (Persis Rujukan ULPL) */
body::before {
  content: '';
  display: block;
  height: 3.5px;
  background: linear-gradient(90deg, #d97706 0%, #fbbf24 50%, #f59e0b 100%);
  width: 100%;
  position: sticky;
  top: 0;
  z-index: 60;
}

/* ==================== TIER 1: INSTITUTIONAL HEADER (eTrack POLIMAS FORMAT) ==================== */
.top-institutional-header {
  background: #ffffff;
  border-bottom: 1px solid var(--border-subtle, #e2e8f0);
  padding: 10px 0;
  width: 100%;
}

.institutional-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  box-sizing: border-box;
}

.inst-brand-left {
  display: flex;
  align-items: center;
  min-width: 0;
}

.inst-brand-link {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.inst-logo-img {
  height: 40px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
}

.inst-divider {
  width: 1.5px;
  height: 32px;
  background: #cbd5e1;
  flex-shrink: 0;
}

/* Logo Rasmi eCert (Persis Gambar Rujukan: e Kuning Emas + Cert Tebal) */
.brand-ecert-block {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-shrink: 0;
  user-select: none;
}

.brand-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--primary-navy, #0f172a);
  letter-spacing: -0.6px;
  line-height: 1;
}

.brand-title-gold,
.brand-title span {
  color: #f59e0b; /* Kuning emas persis rujukan pengguna */
}

.brand-sub {
  font-size: 13.5px;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.3px;
}

.inst-text-block {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.inst-title {
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.2px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inst-subtitle {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  line-height: 1.25;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inst-brand-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-shrink: 0;
  margin-left: auto;
  margin-right: 0 !important;
  padding-right: 0 !important;
}

/* Format Jam & Tarikh Masa Nyata (Format Tanpa Kotak & Sejajar Tepi Kanan) */
.institutional-clock-pill {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  height: auto;
  padding: 0;
  margin: 0;
  margin-right: 0 !important;
  padding-right: 0 !important;
  border-radius: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  font-size: 12.5px;
  line-height: 1;
  white-space: nowrap;
  user-select: none;
  text-align: right;
}

.inst-clock-icon {
  color: #d97706; /* Emas signature mengikut aksentuasi tema sistem */
  flex-shrink: 0;
}

#headerLiveClockCombined {
  letter-spacing: 0.2px;
  font-variant-numeric: tabular-nums;
  color: #1e3a8a; /* Biru korporat rasmi POLIMAS */
  font-weight: 600;
}

#headerLiveClockCombined .clock-date {
  color: #475569; /* Slate profesional untuk tarikh */
  font-weight: 600;
}

#headerLiveClockCombined .clock-sep {
  color: #94a3b8; /* Pembahagi lembut sistem */
  font-weight: 400;
  margin: 0 2px;
}

#headerLiveClockCombined .clock-time {
  color: #1e3a8a; /* Biru korporat pekat untuk masa */
  font-weight: 700;
}

/* ==================== TIER 2: TOPBAR NAVIGATION ROW (TABS & USER PROFILE) ==================== */
.topbar-nav-row {
  height: var(--topbar-height, 52px);
  background: #ffffff;
  border-bottom: 1px solid var(--border-color, #cbd5e1);
  position: sticky;
  top: 3.5px;
  z-index: 50;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  width: 100%;
}

.nav-row-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  box-sizing: border-box;
}

.nav-row-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.mobile-nav-toggle-btn {
  display: none;
  background: transparent;
  border: 1px solid var(--border-color, #cbd5e1);
  border-radius: var(--radius-sm, 8px);
  padding: 6px;
  cursor: pointer;
  color: var(--text-main, #0f172a);
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.mobile-nav-toggle-btn:hover {
  background: #f1f5f9;
}

.nav-mobile-brand {
  display: none !important;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.nav-mobile-logo-img {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  flex-shrink: 0;
}

.nav-mobile-brand .brand-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--primary-navy, #0f172a);
  letter-spacing: -0.3px;
  line-height: 1;
}

.nav-mobile-brand .brand-sub {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted, #64748b);
}

/* Navigasi Utama Tab Format eTrack */
.top-nav-bar {
  display: flex;
  align-items: center;
}

.top-nav-menu {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: nowrap;
}

.top-nav-item {
  position: relative;
  flex-shrink: 0;
}

.top-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 13px;
  height: 36px;
  border-radius: 6px;
  color: #475569;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.15s ease;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
}

.top-nav-link:hover {
  color: #0f172a;
  background: #f1f5f9;
  border-color: #e2e8f0;
}

/* Tab Aktif (Tema Royal Navy Kontras Rasmi POLIMAS) */
.top-nav-item.active .top-nav-link {
  color: #ffffff;
  background: #1e3a8a;
  border-color: #1e3a8a;
  box-shadow: 0 1px 3px rgba(30, 58, 138, 0.18);
  font-weight: 700;
}

.top-nav-item.active .top-nav-link .nav-svg-icon {
  stroke: #ffffff;
}

/* Nav Item Ikon Sahaja (Cth: Buku Manual Pengguna) */
.top-nav-icon-link {
  padding: 0 10px !important;
  min-width: 36px;
  justify-content: center !important;
}

.top-nav-icon-link .nav-svg-icon {
  width: 17px !important;
  height: 17px !important;
}

.nav-link-mobile-label {
  display: none;
}

.nav-svg-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.nav-has-dropdown {
  position: relative;
}

.nav-dropdown-trigger {
  background: transparent;
  cursor: pointer;
  font-family: inherit;
}

.nav-dropdown-chevron {
  transition: transform 0.2s ease;
  margin-left: 2px;
}

.top-nav-item.active .nav-dropdown-chevron {
  stroke: #ffffff;
}

.nav-has-dropdown.show-dropdown .nav-dropdown-chevron {
  transform: rotate(180deg);
}

/* Dropdown Menu (Kemas & Responsif) */
.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 250px;
  background: #ffffff;
  border: 1px solid var(--border-color, #cbd5e1);
  border-radius: var(--radius-md, 12px);
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.14);
  padding: 8px;
  z-index: 1000;
  margin-top: 4px;
  animation: dropdownFadeIn 0.15s ease;
}

.nav-has-dropdown.show-dropdown .nav-dropdown-menu {
  display: block;
}

.nav-drop-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm, 8px);
  text-decoration: none;
  color: var(--text-main, #0f172a);
  transition: all 0.15s ease;
}

.nav-drop-item:hover {
  background: #f1f5f9;
}

.nav-drop-item.active {
  background: #eff6ff;
}

.nav-drop-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}

.nav-drop-content {
  display: flex;
  flex-direction: column;
}

.nav-drop-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
}

.nav-drop-sub {
  font-size: 11px;
  color: #64748b;
  margin-top: 2px;
}

.nav-drop-divider {
  height: 1px;
  background: #e2e8f0;
  margin: 6px 4px;
}

/* Nav Row Right */
.nav-row-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
  white-space: nowrap;
  margin-left: auto;
  margin-right: 0 !important;
  padding-right: 0 !important;
}

/* Kaunter Had Masa Sesi Inaktiviti (Format Tanpa Kotak / Bersih) */
.header-session-timer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: auto;
  box-sizing: border-box;
  padding: 4px 6px;
  border: none;
  border-radius: 0;
  background: transparent;
  color: #64748b;
  font-size: 12px;
  line-height: 1;
  flex-shrink: 0;
  user-select: none;
  cursor: pointer;
  transition: opacity 0.15s ease;
  box-shadow: none;
}

.header-session-timer:hover {
  background: transparent;
  border: none;
  box-shadow: none;
  opacity: 0.75;
}

.header-session-timer .session-timer-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  flex-shrink: 0;
}

.header-session-timer .session-timer-label {
  color: #64748b;
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.1px;
}

.header-session-timer .session-timer-digits {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 700;
  font-size: 12.5px;
  color: #0f172a;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.header-session-timer.warning {
  border: none;
  background: transparent;
}

.header-session-timer.warning .session-timer-icon,
.header-session-timer.warning .session-timer-label,
.header-session-timer.warning .session-timer-digits {
  color: #b45309;
}

.header-session-timer.critical {
  border: none;
  background: transparent;
  animation: pulseSessionAlert 1.2s infinite alternate ease-in-out;
}

.header-session-timer.critical .session-timer-icon,
.header-session-timer.critical .session-timer-label,
.header-session-timer.critical .session-timer-digits {
  color: #dc2626;
}

@keyframes pulseSessionAlert {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0.5;
  }
}

/* User Profile Pill Rasmi (Format eTrack: Avatar Bulat, Nama, Role Pill Ungu & Chevron) */
.user-dropdown-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin: 0;
  margin-right: 0 !important;
}

.etrack-user-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  box-sizing: border-box;
  padding: 0 10px 0 4px;
  border: 1px solid var(--border-color, #cbd5e1);
  border-radius: 9999px;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  flex-shrink: 0;
  line-height: 1;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
  margin: 0;
  margin-right: 0 !important;
}

.etrack-user-pill-btn:hover,
.user-dropdown-wrapper.active .etrack-user-pill-btn {
  background: #f8fafc;
  border-color: #94a3b8;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.etrack-avatar-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1e3a8a 0%, #0f172a 100%);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  position: relative;
  flex-shrink: 0;
}

.etrack-online-dot {
  position: absolute;
  bottom: -0.5px;
  right: -0.5px;
  width: 7.5px;
  height: 7.5px;
  border-radius: 50%;
  background: #10b981;
  border: 1.5px solid #ffffff;
  display: block;
}

.etrack-user-name {
  font-size: 12.5px;
  font-weight: 700;
  color: #0f172a;
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.etrack-role-pill {
  background: #f3e8ff;
  color: #7e22ce;
  border: 1px solid #e9d5ff;
  font-size: 11px;
  font-weight: 700;
  padding: 2.5px 8px;
  border-radius: 9999px;
  letter-spacing: 0.1px;
  line-height: 1;
}

.dropdown-arrow-icon {
  color: #94a3b8;
  transition: transform 0.2s;
  flex-shrink: 0;
}

.user-dropdown-wrapper.active .dropdown-arrow-icon {
  transform: rotate(180deg);
}

.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 280px;
  max-width: 340px;
  width: max-content;
  background: #ffffff;
  border: 1px solid var(--border-color, #cbd5e1);
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
  padding: 8px;
  display: none;
  z-index: 120;
  animation: dropdownFadeIn 0.15s ease;
}

.user-dropdown-wrapper.active .user-dropdown-menu {
  display: block;
}

@keyframes dropdownFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.user-dropdown-header {
  padding: 10px 14px;
  background: #f8fafc;
  border-radius: 8px;
  margin-bottom: 6px;
  word-break: break-word;
  white-space: normal;
}

.user-dropdown-header-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.user-full-name {
  display: block;
  font-size: 13.5px;
  color: #0f172a;
  font-weight: 700;
  line-height: 1.3;
  word-break: break-word;
}

.user-email-text {
  display: block;
  font-size: 11.5px;
  color: #64748b;
  margin-top: 2px;
  word-break: break-all;
}

.user-dept-text {
  font-size: 11px;
  color: #64748b;
  font-weight: 600;
  margin-top: 5px;
  line-height: 1.35;
  word-break: break-word;
}

.user-role-badge-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  margin-top: 8px;
}

.badge-pill-navy {
  font-size: 10px;
  font-weight: 700;
  background: #f8fafc;
  color: #475569;
  border: 1px solid #cbd5e1;
  padding: 2px 8px;
  border-radius: 4px;
  display: inline-block;
}

.badge-pill-gold {
  font-size: 10px;
  font-weight: 600;
  background: #fef3c7;
  color: #92400e;
  padding: 3px 8px;
  border-radius: 4px;
  display: inline-block;
  white-space: normal;
  line-height: 1.35;
  max-width: 100%;
  word-break: break-word;
  border: 1px solid #fde68a;
}

.user-dropdown-divider {
  height: 1px;
  background: #e2e8f0;
  margin: 6px 0;
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 6px;
  color: #334155;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.15s;
}

.user-dropdown-item:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.user-dropdown-item.item-logout {
  color: #dc2626;
}

.user-dropdown-item.item-logout:hover {
  background: #fef2f2;
  color: #b91c1c;
}

.avatar-badge {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1e3a8a 0%, #0f172a 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11.5px;
  font-weight: 800;
  border: 1.5px solid #fbbf24;
  flex-shrink: 0;
}

/* ==================== RESPONSIVE HEADER & MOBILE NAVIGATION ==================== */
@keyframes mobileMenuSlideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 991px) {
  .top-institutional-header {
    display: none !important;
  }

  .mobile-nav-toggle-btn {
    display: flex !important;
  }

  .nav-mobile-brand {
    display: flex !important;
  }

  .top-nav-bar {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border-bottom: 2px solid #fbbf24;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.14);
    padding: 12px 16px 16px 16px;
    display: none;
    margin: 0;
    z-index: 99;
    max-height: calc(100vh - 65px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .top-nav-bar.show-mobile {
    display: block !important;
    animation: mobileMenuSlideDown 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .top-nav-menu {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    width: 100%;
  }

  .top-nav-item {
    width: 100%;
  }

  .top-nav-link {
    display: flex;
    align-items: center;
    width: 100%;
    height: 42px;
    padding: 0 14px;
    font-size: 13.5px;
    border-radius: 8px;
  }

  .top-nav-icon-link {
    justify-content: flex-start !important;
    gap: 8px !important;
  }

  .nav-link-mobile-label {
    display: inline !important;
  }

  .nav-has-dropdown .nav-dropdown-trigger > span {
    flex: 1;
    text-align: left;
    margin-left: 7px;
  }

  .nav-dropdown-menu {
    position: static !important;
    min-width: 100% !important;
    box-shadow: none !important;
    border: 1px solid #e2e8f0 !important;
    background: #f8fafc !important;
    border-radius: 8px !important;
    margin: 6px 0 !important;
    padding: 6px !important;
    display: none;
    animation: none !important;
  }

  .nav-has-dropdown.show-dropdown .nav-dropdown-menu {
    display: block !important;
  }

  .nav-drop-item {
    padding: 9px 12px;
    border-radius: 6px;
    gap: 10px;
  }

  .nav-drop-title {
    font-size: 13px;
    font-weight: 700;
  }

  .nav-drop-sub {
    font-size: 11px;
    line-height: 1.3;
  }

  .etrack-user-pill-btn {
    height: 34px !important;
  }
}

@media (max-width: 768px) {
  .institutional-container,
  .nav-row-container,
  .footer-container {
    padding: 0 16px !important;
  }

  .main-content {
    padding: 18px 16px 36px 16px !important;
  }

  .inst-subtitle {
    display: none !important;
  }
}

@media (max-width: 520px) {
  .institutional-container,
  .nav-row-container,
  .footer-container {
    padding: 0 12px !important;
  }

  .main-content {
    padding: 14px 12px 32px 12px !important;
  }

  .inst-divider {
    display: none !important;
  }

  .inst-title {
    font-size: 11px !important;
  }

  .etrack-role-pill {
    display: none !important;
  }

  .nav-row-right {
    gap: 5px !important;
  }

  /* Kaunter Masa Sesi Padat & Tanpa Kotak untuk Skrin Telefon */
  .header-session-timer {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    height: auto !important;
    padding: 0 4px !important;
    border-radius: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    cursor: pointer !important;
  }

  .header-session-timer .session-timer-icon {
    color: #64748b !important;
    display: inline-flex !important;
  }

  .header-session-timer .session-timer-icon svg {
    width: 12px !important;
    height: 12px !important;
  }

  .header-session-timer .session-timer-label {
    display: none !important;
  }

  .header-session-timer .session-timer-digits {
    font-size: 11px !important;
    font-weight: 700 !important;
    color: #0f172a !important;
  }

  .header-session-timer.warning {
    background: transparent !important;
    border: none !important;
  }

  .header-session-timer.warning .session-timer-icon,
  .header-session-timer.warning .session-timer-digits {
    color: #b45309 !important;
  }

  .header-session-timer.critical {
    background: transparent !important;
    border: none !important;
  }

  .header-session-timer.critical .session-timer-icon,
  .header-session-timer.critical .session-timer-digits {
    color: #dc2626 !important;
  }

  .nav-mobile-brand {
    gap: 5px !important;
  }

  .nav-mobile-logo-img {
    width: 24px !important;
    height: 24px !important;
  }

  .nav-mobile-brand .brand-title {
    font-size: 15px !important;
  }

  .brand-badge-red {
    font-size: 8.5px !important;
    padding: 2px 4px !important;
  }

  .etrack-user-pill-btn {
    height: 28px !important;
    padding: 0 6px 0 3px !important;
    gap: 4px !important;
  }

  .etrack-avatar-circle {
    width: 22px !important;
    height: 22px !important;
    font-size: 10px !important;
  }

  .etrack-user-name {
    max-width: 58px !important;
    font-size: 11px !important;
  }

  .dropdown-arrow-icon {
    width: 10px !important;
    height: 10px !important;
  }

  .user-dropdown-menu {
    min-width: 240px !important;
    max-width: calc(100vw - 20px) !important;
    right: 0 !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15) !important;
  }

  .inst-text-block {
    display: none !important;
  }
}

@media (max-width: 380px) {
  .nav-mobile-brand .brand-title {
    font-size: 13.5px !important;
  }
  .brand-badge-red {
    display: none !important;
  }
  .etrack-user-name {
    max-width: 44px !important;
  }
}

/* ==================== MODAL PERINGATAN HAD MASA SESI (POP-OUT) ==================== */
.session-timeout-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: modalFadeIn 0.2s ease-out;
}

.session-timeout-dialog {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.05);
  max-width: 440px;
  width: 100%;
  padding: 30px 28px 26px;
  text-align: center;
  box-sizing: border-box;
  animation: modalSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.session-timeout-icon-pulse {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #fef3c7;
  border: 2px solid #fde68a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  animation: pulseIconAlert 1.5s infinite alternate ease-in-out;
}

@keyframes pulseIconAlert {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.3); }
  100% { transform: scale(1.06); box-shadow: 0 0 16px 2px rgba(245, 158, 11, 0.4); }
}

.session-timeout-title {
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 10px;
  letter-spacing: -0.3px;
}

.session-timeout-msg {
  font-size: 13.5px;
  color: #334155;
  line-height: 1.5;
  margin-bottom: 8px;
}

.session-timeout-highlight {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 15px;
  color: #d97706;
  font-weight: 800;
  background: #fffbeb;
  border: 1px solid #fde68a;
  padding: 2px 6px;
  border-radius: 4px;
}

.session-timeout-sub {
  font-size: 12.5px;
  color: #64748b;
  margin-bottom: 22px;
  line-height: 1.45;
}

.session-timeout-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-extend-session {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 42px;
  background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  border: 1px solid #1e40af;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 2px 6px rgba(29, 78, 216, 0.3);
}

.btn-extend-session:hover {
  background: linear-gradient(180deg, #1d4ed8 0%, #1e40af 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(29, 78, 216, 0.4);
}

.btn-logout-now {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 38px;
  background: #f8fafc;
  color: #64748b;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s ease;
}

.btn-logout-now:hover {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fca5a5;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ==================== BUTTONS (EXECUTIVE GRADE & HARMONIZED SHADED) ==================== */
.btn-add-quick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  border: 1px solid #1e40af;
  font-size: 13px;
  font-weight: 700;
  height: 38px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 6px rgba(29, 78, 216, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  cursor: pointer;
  box-sizing: border-box;
  white-space: nowrap;
}

.btn-add-quick:hover {
  background: linear-gradient(180deg, #1d4ed8 0%, #1e40af 100%);
  border-color: #1e3a8a;
  color: #ffffff;
  transform: translateY(-1.5px);
  box-shadow: 0 4px 12px rgba(29, 78, 216, 0.35);
}

.btn-add-quick:active {
  transform: translateY(0);
}

.btn-table-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  white-space: nowrap;
  line-height: 1;
  box-sizing: border-box;
}

.btn-table-action:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #0f172a;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
}

.btn-table-action:active {
  transform: translateY(0);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.btn-table-action.active {
  background: #1e3a8a !important;
  color: #ffffff !important;
  border-color: #172554 !important;
  box-shadow: 0 2px 5px rgba(30, 58, 138, 0.25) !important;
}

/* Butang Padam / Tong Sampah Seragam Merah */
.btn-table-action.btn-action-delete,
.btn-delete-red {
  background: #ffffff !important;
  color: #dc2626 !important;
  border-color: #fca5a5 !important;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.btn-table-action.btn-action-delete svg,
.btn-delete-red svg {
  stroke: #dc2626 !important;
  transition: stroke 0.18s ease !important;
}

.btn-table-action.btn-action-delete:hover,
.btn-delete-red:hover {
  background: #dc2626 !important;
  border-color: #b91c1c !important;
  color: #ffffff !important;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(220, 38, 38, 0.28) !important;
}

.btn-table-action.btn-action-delete:hover svg,
.btn-delete-red:hover svg {
  stroke: #ffffff !important;
}

.btn-text-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  background: transparent;
  border: 1px solid transparent;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1;
}

.btn-text-action:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #0f172a;
}

.btn-text-action.btn-delete-red {
  color: #dc2626 !important;
  border-color: #fca5a5 !important;
  background: #fef2f2 !important;
}

.btn-text-action.btn-delete-red svg {
  stroke: #dc2626 !important;
  transition: stroke 0.15s ease;
}

.btn-text-action.btn-delete-red:hover {
  background: #dc2626 !important;
  color: #ffffff !important;
  border-color: #b91c1c !important;
}

.btn-text-action.btn-delete-red:hover svg {
  stroke: #ffffff !important;
}

/* Butang PowerPoint (.pptx) - Tema Merah Bata / PowerPoint & Hover Merah */
.btn-top-pptx,
.btn-table-action.btn-action-pptx {
  background: #ffffff !important;
  color: #c43e1c !important;
  border: 1.5px solid #ea580c !important;
  box-shadow: 0 1px 2px rgba(196, 62, 28, 0.08) !important;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.btn-top-pptx svg,
.btn-table-action.btn-action-pptx svg {
  stroke: #c43e1c !important;
  transition: stroke 0.18s ease !important;
}

.btn-top-pptx:hover,
.btn-table-action.btn-action-pptx:hover {
  background: #c43e1c !important;
  border-color: #9a3412 !important;
  color: #ffffff !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(196, 62, 28, 0.28) !important;
}

.btn-top-pptx:hover svg,
.btn-table-action.btn-action-pptx:hover svg {
  stroke: #ffffff !important;
}

/* Butang Tindakan Pengepala (Seragam, Royal Blue & Gold) */
.btn-top-action {
  height: 38px;
  padding: 0 14px;
  font-size: 12.5px;
  font-weight: 700;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  box-sizing: border-box;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  cursor: pointer;
}

.btn-top-royal {
  background: #ffffff !important;
  color: #1e3a8a !important;
  border: 1.5px solid #1e3a8a !important;
  box-shadow: 0 1px 2px rgba(30, 58, 138, 0.06) !important;
}

.btn-top-royal svg {
  stroke: #1e3a8a !important;
  transition: stroke 0.18s ease;
}

.btn-top-royal:hover {
  background: #1e3a8a !important;
  border-color: #172554 !important;
  color: #ffffff !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(30, 58, 138, 0.25) !important;
}

.btn-top-royal:hover svg {
  stroke: #ffffff !important;
}

.btn-top-outline {
  background: #ffffff !important;
  color: #1e293b !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03) !important;
}

.btn-top-outline svg {
  stroke: #475569;
  transition: stroke 0.18s ease;
}

.btn-top-outline:hover {
  background: #f8fafc !important;
  border-color: #1e3a8a !important;
  color: #1e3a8a !important;
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.06) !important;
}

.btn-top-outline:hover svg {
  stroke: #1e3a8a !important;
}

/* ==========================================================================
   SISTEM BUTANG TINDAKAN JADUAL TUNGGAL (UNIFIED TABLE ACTION ICONS)
   Neutral secara lalai, warna bertema (Royal Blue, Gold, Red) hanya pada HOVER
   ========================================================================== */
.btn-tb-icon {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  padding: 0 !important;
  border-radius: 6px !important;
  border: 1px solid #cbd5e1 !important;
  background: #ffffff !important;
  color: #475569 !important;
  text-decoration: none !important;
  cursor: pointer !important;
  transition: all 0.16s ease !important;
  box-sizing: border-box !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03) !important;
  overflow: hidden !important;
}

.btn-tb-icon svg {
  stroke: #475569 !important;
  transition: stroke 0.16s ease !important;
}

.btn-tb-icon:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1) !important;
}

/* Hover: Royal Blue (Urus / Lihat / Cetak) */
.btn-tb-icon.btn-manage:hover,
.btn-tb-icon.btn-print:hover,
.btn-tb-icon.btn-view:hover {
  background: #1e3a8a !important;
  border-color: #172554 !important;
  color: #ffffff !important;
}
.btn-tb-icon.btn-manage:hover svg,
.btn-tb-icon.btn-print:hover svg,
.btn-tb-icon.btn-view:hover svg {
  stroke: #ffffff !important;
}

/* Butang Tindakan Khas Kelulusan / Penolakan */
.btn-tb-icon.btn-approve {
  border-color: #86efac !important;
  color: #16a34a !important;
  background: #f0fdf4 !important;
}
.btn-tb-icon.btn-approve svg {
  stroke: #16a34a !important;
}

.btn-tb-icon.btn-reject {
  border-color: #fca5a5 !important;
  color: #dc2626 !important;
  background: #fef2f2 !important;
}
.btn-tb-icon.btn-reject svg {
  stroke: #dc2626 !important;
}

/* Hover: Merah Padam / Sekat / Tolak / Nyahaktif */
.btn-tb-icon.btn-delete:hover,
.btn-tb-icon.btn-block:hover,
.btn-tb-icon.btn-reject:hover,
.btn-tb-icon.btn-deactivate:hover {
  background: #dc2626 !important;
  border-color: #b91c1c !important;
  color: #ffffff !important;
}
.btn-tb-icon.btn-delete:hover svg,
.btn-tb-icon.btn-block:hover svg,
.btn-tb-icon.btn-reject:hover svg,
.btn-tb-icon.btn-deactivate:hover svg {
  stroke: #ffffff !important;
}

/* Hover: Hijau Emerald (ISO / Lulus) */
.btn-tb-icon.btn-iso:hover,
.btn-tb-icon.btn-approve:hover {
  background: #059669 !important;
  border-color: #047857 !important;
  color: #ffffff !important;
}
.btn-tb-icon.btn-iso:hover svg,
.btn-tb-icon.btn-approve:hover svg {
  stroke: #ffffff !important;
}

/* Hover: Emas / Amber (Pilih Aktif / Edit / Salin) */
.btn-tb-icon.btn-gold:hover,
.btn-tb-icon.btn-active:hover,
.btn-tb-icon.btn-edit:hover,
.btn-tb-icon.btn-copy:hover {
  background: #d97706 !important;
  border-color: #b45309 !important;
  color: #ffffff !important;
}
.btn-tb-icon.btn-gold:hover svg,
.btn-tb-icon.btn-active:hover svg,
.btn-tb-icon.btn-edit:hover svg,
.btn-tb-icon.btn-copy:hover svg {
  stroke: #ffffff !important;
}

/* Hover: Hijau WhatsApp */
.btn-tb-icon.btn-whatsapp svg {
  stroke: none !important;
  fill: currentColor !important;
  transition: fill 0.16s ease !important;
}

.btn-tb-icon.btn-whatsapp:hover {
  background: #16a34a !important;
  border-color: #15803d !important;
  color: #ffffff !important;
}
.btn-tb-icon.btn-whatsapp:hover svg {
  stroke: none !important;
  fill: #ffffff !important;
}

/* Hover: Biru Emel */
.btn-tb-icon.btn-email:hover {
  background: #0284c7 !important;
  border-color: #0369a1 !important;
  color: #ffffff !important;
}
.btn-tb-icon.btn-email:hover svg {
  stroke: #ffffff !important;
}

/* Butang Tugasan ULPL (Harmonized 32x32) */
.btn-tb-icon.btn-ulpl-active {
  background: #fef3c7 !important;
  border: 1px solid #f59e0b !important;
  color: #92400e !important;
}
.btn-tb-icon.btn-ulpl-active svg {
  stroke: #b45309 !important;
}
.btn-tb-icon.btn-ulpl-active:hover {
  background: #fee2e2 !important;
  border-color: #ef4444 !important;
  color: #b91c1c !important;
}
.btn-tb-icon.btn-ulpl-active:hover svg {
  stroke: #b91c1c !important;
}

.btn-tb-icon.btn-ulpl-assign {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #64748b !important;
}
.btn-tb-icon.btn-ulpl-assign svg {
  stroke: #64748b !important;
}
.btn-tb-icon.btn-ulpl-assign:hover {
  background: #d97706 !important;
  border-color: #b45309 !important;
  color: #ffffff !important;
}
.btn-tb-icon.btn-ulpl-assign:hover svg {
  stroke: #ffffff !important;
}

/* Butang Tugasan PLSJ (Harmonized 32x32) */
.btn-tb-icon.btn-plsj-active {
  background: #eff6ff !important;
  border: 1px solid #3b82f6 !important;
  color: #1d4ed8 !important;
}
.btn-tb-icon.btn-plsj-active svg {
  stroke: #1d4ed8 !important;
}
.btn-tb-icon.btn-plsj-active:hover {
  background: #fee2e2 !important;
  border-color: #ef4444 !important;
  color: #b91c1c !important;
}
.btn-tb-icon.btn-plsj-active:hover svg {
  stroke: #b91c1c !important;
}

.btn-tb-icon.btn-plsj-assign {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #64748b !important;
}
.btn-tb-icon.btn-plsj-assign svg {
  stroke: #64748b !important;
}
.btn-tb-icon.btn-plsj-assign:hover {
  background: #2563eb !important;
  border-color: #1d4ed8 !important;
  color: #ffffff !important;
}
.btn-tb-icon.btn-plsj-assign:hover svg {
  stroke: #ffffff !important;
}

/* Butang Reset Kata Laluan (Harmonized 32x32) */
.btn-tb-icon.btn-reset-pwd {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
}
.btn-tb-icon.btn-reset-pwd svg {
  stroke: #475569 !important;
}
.btn-tb-icon.btn-reset-pwd:hover {
  background: #d97706 !important;
  border-color: #b45309 !important;
  color: #ffffff !important;
}
.btn-tb-icon.btn-reset-pwd:hover svg {
  stroke: #ffffff !important;
}

/* User Action Dropdown Styles */
.user-action-dropdown-wrapper {
  position: relative;
  display: inline-block;
}
.btn-action-dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  font-size: 11.5px;
  font-weight: 700;
  color: #1e3a8a;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.btn-action-dropdown-toggle:hover {
  background: #1e3a8a;
  color: #ffffff;
  border-color: #1e3a8a;
}
.btn-action-dropdown-toggle:hover svg {
  stroke: #ffffff;
}
.user-action-dropdown-menu {
  display: none;
  position: fixed;
  width: 225px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.2), 0 8px 10px -6px rgba(15, 23, 42, 0.1);
  padding: 6px 0;
  z-index: 99999;
  text-align: left;
}
.user-action-dropdown-menu.show {
  display: block;
  animation: fadeInDropdown 0.12s ease-out;
}
.user-action-dropdown-menu .dropdown-header-label {
  padding: 5px 14px 6px 14px;
  font-size: 10.5px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-action-dropdown-menu .dropdown-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  box-sizing: border-box;
  text-align: left;
  transition: background 0.12s ease, color 0.12s ease;
}
.user-action-dropdown-menu .dropdown-item:hover {
  background: #f1f5f9;
  color: #0f172a;
}
.user-action-dropdown-menu .dropdown-item svg {
  flex-shrink: 0;
}
.user-action-dropdown-menu .dropdown-divider {
  height: 1px;
  background: #e2e8f0;
  margin: 4px 0;
}
.user-action-dropdown-menu .dropdown-item.text-success {
  color: #15803d;
}
.user-action-dropdown-menu .dropdown-item.text-success:hover {
  background: #f0fdf4;
}
.user-action-dropdown-menu .dropdown-item.text-warning {
  color: #b45309;
}
.user-action-dropdown-menu .dropdown-item.text-warning:hover {
  background: #fefce8;
}
.user-action-dropdown-menu .dropdown-item.text-primary {
  color: #1d4ed8;
}
.user-action-dropdown-menu .dropdown-item.text-primary:hover {
  background: #eff6ff;
}
.user-action-dropdown-menu .dropdown-item.text-amber {
  color: #b45309;
}
.user-action-dropdown-menu .dropdown-item.text-amber:hover {
  background: #fef3c7;
}
.user-action-dropdown-menu .dropdown-item.text-danger,
.user-action-dropdown-menu .dropdown-item-danger {
  color: #dc2626;
}
.user-action-dropdown-menu .dropdown-item.text-danger:hover,
.user-action-dropdown-menu .dropdown-item-danger:hover {
  background: #fef2f2;
  color: #b91c1c;
}

/* Password Toggle Wrapper & Eye Button */
.password-toggle-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}
.password-toggle-wrapper .form-control {
  padding-right: 42px !important;
}
.password-toggle-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: 6px;
  transition: color 0.15s, background-color 0.15s;
  z-index: 2;
}
.password-toggle-btn:hover {
  color: #1e3a8a;
  background-color: #f1f5f9;
}

.badge-count-royal {
  background: #eff6ff;
  color: #1e3a8a;
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 800;
  border: 1px solid #bfdbfe;
}

.badge-count-gold {
  background: #fef3c7;
  color: #92400e;
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 800;
  border: 1px solid #fde68a;
}

/* Shaded Button Variants: Neutral by default, vibrant on hover */
.btn-sample-view, .btn-shaded-blue {
  background: #ffffff !important;
  color: #1e3a8a !important;
  border: 1px solid #cbd5e1 !important;
  font-weight: 700 !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03) !important;
}

.btn-sample-view svg, .btn-shaded-blue svg {
  stroke: #1e3a8a;
  transition: stroke 0.18s ease;
}

.btn-sample-view:hover, .btn-shaded-blue:hover {
  background: #1e3a8a !important;
  border-color: #172554 !important;
  color: #ffffff !important;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(30, 58, 138, 0.25) !important;
}

.btn-sample-view:hover svg, .btn-shaded-blue:hover svg {
  stroke: #ffffff !important;
}

.btn-print-all, .btn-shaded-danger {
  background: #ffffff !important;
  color: #dc2626 !important;
  border: 1px solid #fca5a5 !important;
  font-weight: 700 !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03) !important;
}

.btn-print-all svg, .btn-shaded-danger svg {
  stroke: #dc2626;
  transition: stroke 0.18s ease;
}

.btn-print-all:hover, .btn-shaded-danger:hover {
  background: #dc2626 !important;
  border-color: #b91c1c !important;
  color: #ffffff !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(220, 38, 38, 0.3) !important;
}

.btn-print-all:hover svg, .btn-shaded-danger:hover svg {
  stroke: #ffffff !important;
}

.btn-shaded-success {
  background: #ffffff !important;
  color: #15803d !important;
  border: 1px solid #cbd5e1 !important;
  font-weight: 700 !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03) !important;
}

.btn-shaded-success svg {
  stroke: #16a34a;
  transition: stroke 0.18s ease;
}

.btn-shaded-success:hover {
  background: #16a34a !important;
  border-color: #15803d !important;
  color: #ffffff !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(22, 163, 74, 0.3) !important;
}

.btn-shaded-success:hover svg {
  stroke: #ffffff !important;
}

.btn-shaded-amber {
  background: #ffffff !important;
  color: #b45309 !important;
  border: 1px solid #cbd5e1 !important;
  font-weight: 700 !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03) !important;
}

.btn-shaded-amber svg {
  stroke: #d97706;
  transition: stroke 0.18s ease;
}

.btn-shaded-amber:hover {
  background: #d97706 !important;
  border-color: #b45309 !important;
  color: #ffffff !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(245, 158, 11, 0.3) !important;
}

.btn-shaded-amber:hover svg {
  stroke: #ffffff !important;
}

/* WhatsApp & ZIP Action Buttons: Neutral by default, vibrant on hover */
.btn-action-whatsapp {
  background: #ffffff !important;
  color: #1e293b !important;
  border: 1px solid #cbd5e1 !important;
}

.btn-action-whatsapp svg {
  stroke: none !important;
  fill: #16a34a !important;
  transition: fill 0.18s ease;
}

.btn-action-whatsapp:hover {
  background: #16a34a !important;
  border-color: #15803d !important;
  color: #ffffff !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3) !important;
}

.btn-action-whatsapp:hover svg {
  stroke: none !important;
  fill: #ffffff !important;
}

.btn-action-zip {
  background: #ffffff !important;
  color: #1e293b !important;
  border: 1px solid #cbd5e1 !important;
}

.btn-action-zip svg {
  stroke: #d97706;
  transition: stroke 0.18s ease;
}

.btn-action-zip:hover {
  background: #d97706 !important;
  border-color: #b45309 !important;
  color: #ffffff !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.3) !important;
}

.btn-action-zip:hover svg {
  stroke: #ffffff !important;
}

.btn-shaded-dark {
  background: linear-gradient(180deg, #334155 0%, #1e293b 100%) !important;
  color: #ffffff !important;
  border: 1px solid #0f172a !important;
  font-weight: 600 !important;
  box-shadow: 0 2px 5px rgba(15, 23, 42, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.15) !important;
}

.btn-shaded-dark:hover {
  background: linear-gradient(180deg, #475569 0%, #334155 100%) !important;
  border-color: #fbbf24 !important;
  color: #fbbf24 !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.3) !important;
}

/* Fine-Tuning Controls & Clean Flat Text Action Buttons */
.btn-tune {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #334155;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 5px;
  cursor: pointer;
  line-height: 1;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-tune:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #0f172a;
}

.btn-text-action {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0 !important;
  border-radius: 4px;
  transition: background 0.15s ease, transform 0.15s ease;
  font-size: 13px;
  line-height: 1;
}

.btn-text-action:hover {
  background: rgba(0, 0, 0, 0.06) !important;
  transform: scale(1.08);
}

/* ==================== PENYELARASAN IKON SVG SEMUA BUTANG ==================== */
.btn-top-action svg,
.btn-add-quick svg,
.btn-excel-green svg {
  width: 15px !important;
  height: 15px !important;
  flex-shrink: 0 !important;
  display: inline-block !important;
  vertical-align: middle !important;
}

.btn-table-action svg {
  width: 14px !important;
  height: 14px !important;
  flex-shrink: 0 !important;
  display: inline-block !important;
  vertical-align: middle !important;
}

.btn-text-action svg {
  width: 14px !important;
  height: 14px !important;
  flex-shrink: 0 !important;
  display: inline-block !important;
  vertical-align: middle !important;
}

/* ==================== RESPONSIF PENUH PADA PAPARAN MUDAH ALIH (MOBILE) ==================== */
@media (max-width: 768px) {
  /* 1. Butang Seragam & Ikon Mobile */
  .btn-top-action,
  .btn-excel-green,
  .btn-add-quick {
    height: 35px !important;
    padding: 0 10px !important;
    font-size: 12px !important;
    gap: 5px !important;
  }
  .btn-top-action svg,
  .btn-excel-green svg,
  .btn-add-quick svg {
    width: 14px !important;
    height: 14px !important;
  }
  .btn-table-action {
    height: 30px !important;
    padding: 0 8px !important;
    font-size: 11.5px !important;
    gap: 4px !important;
  }
  .btn-table-action svg {
    width: 13px !important;
    height: 13px !important;
  }
  .header-actions-cluster {
    display: flex !important;
    flex-wrap: wrap !important;
    width: 100% !important;
    gap: 8px !important;
  }
  .header-actions-cluster > * {
    flex: 1 1 auto !important;
    text-align: center !important;
    justify-content: center !important;
  }

  /* 2. Pengepala Halaman (Stacking Bersih di Mobile) */
  .page-header-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }
  .card-header-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }

  /* 3. Elak iOS Safari Auto-Zoom pada Borang Input */
  .form-control, 
  .form-select, 
  select.form-control,
  input[type="text"].form-control,
  input[type="password"].form-control,
  input[type="email"].form-control {
    font-size: 16px !important;
  }

  /* 4. Jadual Data Responsif (Skrol Licin & Seret Tepi Jelas pada Skrin Telefon) */
  .table-responsive {
    -webkit-overflow-scrolling: touch !important;
    overflow-x: auto !important;
    width: 100% !important;
    scrollbar-width: thin !important;
    scrollbar-color: #64748b #e2e8f0 !important;
  }
  .table-responsive::-webkit-scrollbar {
    height: 7px !important;
    display: block !important;
  }
  .table-responsive::-webkit-scrollbar-track {
    background: #e2e8f0 !important;
    border-radius: 4px !important;
  }
  .table-responsive::-webkit-scrollbar-thumb {
    background: #64748b !important;
    border-radius: 4px !important;
  }
  .data-table,
  .participants-fit-table,
  .audit-clean-table {
    min-width: 820px !important;
    table-layout: auto !important;
  }
  .users-data-table {
    min-width: 1040px !important;
  }
  .data-table td,
  .data-table th,
  .audit-clean-table td,
  .audit-clean-table th {
    word-break: normal !important;
  }
  .mobile-table-hint,
  .mobile-table-swipe-hint {
    display: flex !important;
  }

  /* 5. Kad KPI 1-Kolum Kemas pada Skrin Kecil */
  .kpi-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
  .kpi-card {
    padding: 12px 15px !important;
  }
  .kpi-val {
    font-size: 24px !important;
  }

  /* 6. Kotak Modal & Dialog pada Telefon Bimbit */
  .visitor-modal-backdrop {
    padding: 8px !important;
  }
  .visitor-modal-dialog {
    max-height: 94vh !important;
    width: 100% !important;
    border-radius: 8px !important;
  }
  .visitor-modal-header {
    padding: 12px 14px !important;
  }
  .visitor-modal-toolbar {
    padding: 8px 12px !important;
    flex-direction: column !important;
    gap: 8px !important;
    align-items: stretch !important;
  }
  .visitor-modal-tabs {
    flex-direction: column !important;
    width: 100% !important;
  }
  .visitor-tab-btn {
    width: 100% !important;
    text-align: center !important;
  }
  .visitor-modal-footer {
    padding: 10px 14px !important;
    flex-direction: column-reverse !important;
    gap: 8px !important;
  }
  .visitor-modal-footer > * {
    width: 100% !important;
    text-align: center !important;
    justify-content: center !important;
  }

  /* 7. Footer Responsif di Telefon (Kemas, Tidak Bertindih, Selesa & Teratur) */
  .app-footer-bar {
    padding: 16px 14px !important;
    font-size: 11px !important;
  }
  .footer-container {
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    gap: 10px !important;
    padding: 0 8px !important;
  }
  .footer-left {
    width: 100% !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 6px !important;
    margin: 0 !important;
  }
  .footer-brand-line {
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 5px !important;
    line-height: 1.4 !important;
  }
  .footer-sep-desktop {
    display: none !important;
  }
  .footer-manual-link {
    margin: 0 !important;
    background: #eff6ff !important;
    border: 1px solid #bfdbfe !important;
    color: #1d4ed8 !important;
    padding: 3px 7px !important;
    border-radius: 6px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  .footer-right {
    width: 100% !important;
    margin: 0 !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 8px !important;
  }
  .footer-analytics-clickable {
    flex-direction: column !important;
    align-items: center !important;
    gap: 5px !important;
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    padding: 8px 14px !important;
    width: 100% !important;
    max-width: 340px !important;
    box-sizing: border-box !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
    font-size: 11px !important;
    line-height: 1.4 !important;
  }
  .footer-stat-group {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-wrap: wrap !important;
    gap: 4px !important;
    width: 100% !important;
  }
  .footer-credit-line {
    font-size: 11px !important;
    color: #64748b !important;
    margin: 0 !important;
  }
  .floating-scroll-actions {
    bottom: 18px !important;
    right: 14px !important;
  }
  .btn-scroll-action {
    width: 38px !important;
    height: 38px !important;
  }
}

/* ==================== APP LAYOUT (BERUANG KIRI KANAN) ==================== */
.app-layout {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: calc(100vh - var(--topbar-height) - 45px);
}

.main-content {
  flex: 1;
  padding: 24px 24px;
  max-width: var(--container-max);
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

/* ==================== GREETING CARD (PERSIS RUJUKAN) ==================== */
.greeting-hero-card {
  background: #ffffff;
  border: 1px solid rgba(203, 213, 225, 0.75);
  border-left: 4px solid var(--gold-amber);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 6px 16px -4px rgba(15, 23, 42, 0.03);
  flex-wrap: wrap;
  gap: 12px;
}

.greeting-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.greeting-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.greeting-time-text {
  font-size: 16px;
  font-weight: 800;
  color: var(--primary-navy);
}

.greeting-dept-pill {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.greeting-meta-sub {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ==================== DASHBOARD & HEADERS ==================== */
.page-header-row {
  background: #ffffff;
  border: 1px solid rgba(203, 213, 225, 0.75);
  border-left: 4.5px solid #1d4ed8;
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  flex-wrap: wrap;
  gap: 14px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 6px 16px -4px rgba(15, 23, 42, 0.03);
}

.page-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary-navy);
  letter-spacing: -0.4px;
}

.page-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* 4 KAD KPI BERGARIS ATAS (PERSIS RUJUKAN SISTEM 2 / GO-LUPUS) */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.kpi-card {
  background: #ffffff;
  border: 1px solid rgba(203, 213, 225, 0.75);
  border-radius: 14px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03), 0 4px 14px -2px rgba(15, 23, 42, 0.04);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.22s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  box-sizing: border-box;
}

.kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px -4px rgba(15, 23, 42, 0.09), 0 4px 10px -2px rgba(15, 23, 42, 0.04);
  border-color: #94a3b8;
}

.kpi-card:hover .kpi-val {
  color: #1e3a8a;
}

/* Top Accent Strips (Format Sistem 2) */
.kpi-card-blue   { border-top: 4px solid #3b82f6 !important; }
.kpi-card-amber  { border-top: 4px solid #f59e0b !important; }
.kpi-card-indigo { border-top: 4px solid #6366f1 !important; }
.kpi-card-green  { border-top: 4px solid #10b981 !important; }

/* Status Pulse Badges */
@keyframes pulse-dot-anim {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 5px rgba(22, 163, 74, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}

.status-pulse-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  text-decoration: none;
  line-height: 1.35;
  transition: all 0.16s ease;
  flex-shrink: 0;
}

.status-pulse-pill.status-open {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.status-pulse-pill.status-open:hover {
  background: #dcfce7;
  border-color: #86efac;
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(22, 163, 74, 0.15);
}

.status-pulse-pill.status-closed {
  background: #f8fafc;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

.pulse-dot-green {
  width: 6.5px;
  height: 6.5px;
  background-color: #16a34a;
  border-radius: 50%;
  display: inline-block;
  animation: pulse-dot-anim 2s infinite cubic-bezier(0.4, 0, 0.6, 1);
}

.dot-closed {
  width: 6.5px;
  height: 6.5px;
  background-color: #94a3b8;
  border-radius: 50%;
  display: inline-block;
}

/* Unified Action Buttons Cluster */
.action-buttons-cluster {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 6px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.kpi-card-content {
  min-width: 0;
}

.kpi-info-label {
  font-size: 11px;
  font-weight: 800;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  line-height: 1.3;
}

.kpi-val {
  font-size: 32px;
  font-weight: 900;
  color: #0f172a;
  margin-top: 6px;
  line-height: 1;
}

.kpi-subtext {
  font-size: 11px;
  color: #64748b;
  margin-top: 6px;
}

.kpi-icon-box {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.icon-box-blue   { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.icon-box-amber  { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.icon-box-green  { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.icon-box-indigo { background: #eef2ff; color: #4338ca; border: 1px solid #c7d2fe; }

/* ==================== CARD SECTIONS ==================== */
.card-section {
  background: #ffffff;
  border: 1px solid rgba(203, 213, 225, 0.75);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  margin-bottom: 22px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 6px 16px -4px rgba(15, 23, 42, 0.03);
}
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.card-hover-accent {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-left: 4px solid transparent;
  border-radius: var(--radius-md);
  transition: border-color 0.2s ease, border-left-color 0.2s ease, box-shadow 0.2s ease;
}

.card-hover-accent:hover {
  border-color: #cbd5e1;
  border-left-color: #2563eb;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
}

.card-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: 12px;
}

.card-title {
  font-size: 15.5px;
  font-weight: 800;
  color: var(--primary-navy);
  letter-spacing: -0.2px;
}

/* ==================== TABLES ==================== */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid rgba(203, 213, 225, 0.8);
  border-radius: var(--radius-sm);
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.02);
  /* Scrollbar / Seret Tepi sentiasa wujud dan kemas */
  scrollbar-width: thin;
  scrollbar-color: #94a3b8 #f1f5f9;
}

/* Penatal mendatar (Scrollbar / Seret Tepi) untuk Chrome, Safari, Edge, Android Webview */
.table-responsive::-webkit-scrollbar {
  height: 8px;
  width: 8px;
}

.table-responsive::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 4px;
  border: 1.5px solid #f1f5f9;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

.table-responsive::-webkit-scrollbar-thumb:active {
  background: #1e3a8a;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}

.data-table th, table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap !important;
}

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
  background: #ffffff;
  vertical-align: middle;
  transition: background 0.12s ease;
}

.data-table tr:hover td,
.data-table tbody tr:hover td {
  background: #fef9c3;
}

.table-link-title {
  color: #0f172a;
  text-decoration: none;
  font-weight: 700;
  transition: color 0.16s ease;
  cursor: pointer;
}

.table-link-title:hover {
  color: #1d4ed8 !important;
}

/* PETUNJUK SKROL / SERET TEPI JADUAL MUDAH ALIH */
.mobile-table-hint,
.mobile-table-swipe-hint {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: #1e3a8a;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 7px 12px;
  border-radius: 6px;
  margin-bottom: 10px;
  user-select: none;
}


/* PENGESAHAN BADGE AJK & PESERTA (BERSIH & TANPA SHADED) */
.badge-count-click {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 26px;
  height: 26px;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.badge-count-click:hover {
  background: #f1f5f9 !important;
  transform: translateY(-1px);
}

.badge-ajk {
  background: transparent !important;
  color: #0f172a !important;
  border: none !important;
}

.badge-ahli {
  background: transparent !important;
  color: #0f172a !important;
  border: none !important;
}

.badge-pill {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  white-space: nowrap !important;
  vertical-align: middle !important;
  padding: 3px 8.5px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
  letter-spacing: 0.15px;
}

.badge-blue {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

.badge-green {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.badge-red {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.badge-amber {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

.badge-purple {
  background: #faf5ff;
  color: #6b21a8;
  border: 1px solid #e9d5ff;
}

.badge-slate {
  background: #f8fafc;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.btn-wa-icon {
  background: linear-gradient(180deg, #25d366 0%, #1eb954 100%) !important;
  color: #ffffff !important;
  border: 1px solid #16a34a !important;
  box-shadow: 0 2px 5px rgba(37, 211, 102, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.25) !important;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.btn-wa-icon:hover {
  background: linear-gradient(180deg, #1eb954 0%, #15803d 100%) !important;
  border-color: #14532d !important;
  color: #ffffff !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(37, 211, 102, 0.35) !important;
}

/* ==================== FORMS ==================== */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--primary-navy);
}

/* Asas Medan Input: Putih Bersih (#FFFFFF), Kemas & Bebas Shaded Semberono */
.form-control, 
.form-select, 
select.form-control,
input[type="text"].form-control,
input[type="email"].form-control,
input[type="password"].form-control,
input[type="tel"].form-control,
input[type="number"].form-control,
input[type="date"].form-control,
textarea.form-control {
  width: 100%;
  padding: 9px 13px;
  font-size: 13px;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  background-color: #ffffff;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

/* 1. Medan Ditaip Manual (Manual Text Inputs) */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
input[type="search"],
textarea {
  cursor: text;
}

/* 2. Medan Dropdown / Klik-Pilih (<select>): Ikon Chevron SVG Kemas & Pointer Affordance */
select,
.form-select,
select.form-control,
select.form-control-compact {
  cursor: pointer;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding-right: 36px !important;
  background-color: #ffffff !important;
  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='%23475569' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  background-size: 15px 15px;
}

select:hover,
.form-select:hover,
select.form-control:hover,
select.form-control-compact:hover {
  border-color: #94a3b8;
  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='%232563eb' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

/* 3. Medan Tarikh & Kalendar (<input type="date">): Ikon Kalendar Kemas & Pointer Affordance */
input[type="date"],
input[type="datetime-local"],
input[type="month"] {
  cursor: pointer;
  background-color: #ffffff;
}

input[type="date"]:hover,
input[type="datetime-local"]:hover,
input[type="month"]:hover {
  border-color: #94a3b8;
}

/* Penunjuk Kalendar WebKit (Chromium / Safari / Edge) */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator,
input[type="month"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.75;
  padding: 3px;
  border-radius: 4px;
  transition: opacity 0.15s ease, transform 0.15s ease;
  filter: invert(30%) sepia(20%) saturate(1200%) hue-rotate(185deg) brightness(95%);
}

input[type="date"]:hover::-webkit-calendar-picker-indicator,
input[type="datetime-local"]:hover::-webkit-calendar-picker-indicator,
input[type="month"]:hover::-webkit-calendar-picker-indicator {
  opacity: 1;
  transform: scale(1.08);
  filter: invert(35%) sepia(80%) saturate(2500%) hue-rotate(210deg) brightness(95%);
}

/* 4. Keadaan Fokus Global (Fokus Biru Rasmi yang Kemas) */
.form-control:focus, 
.form-select:focus,
select.form-control:focus,
input[type="date"]:focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 3.5px rgba(37, 99, 235, 0.14) !important;
}

.form-control::placeholder {
  color: #94a3b8;
}

.form-control-compact {
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--primary-navy);
  outline: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.form-control-compact:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

/* ==================== FOOTER (M.S.K BRANDING) ==================== */
.app-footer-bar {
  margin-top: auto;
  background: #ffffff;
  border-top: 1px solid var(--border-color);
  padding: 12px 0;
  font-size: 11.5px;
  color: var(--text-muted);
  width: 100%;
}

.footer-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
  box-sizing: border-box;
  flex-wrap: wrap;
  gap: 14px;
}

.footer-left {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.footer-brand-line {
  display: flex;
  align-items: center;
  gap: 6px;
}

.footer-dot-accent {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold-amber);
  display: inline-block;
}

.footer-sys-name {
  color: var(--primary-navy);
  font-weight: 700;
}

.footer-sep {
  color: #cbd5e1;
}

.footer-manual-link {
  color: var(--royal-blue);
  text-decoration: none;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  padding: 2px 5px;
  border-radius: 4px;
  transition: all 0.15s ease;
}
.footer-manual-link:hover {
  background: #eff6ff;
  color: #1d4ed8;
}

.footer-stat-group {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.footer-center {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.footer-credit-line {
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
}

.credit-msk {
  display: inline;
  padding: 0;
  border: none;
  background: transparent;
  color: #1d4ed8;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.footer-right {
  display: flex;
  align-items: center;
  margin-left: auto; /* Hujung sekali! */
  flex-shrink: 0;
  gap: 4px;
}

.footer-analytics-clickable {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  padding: 0;
  border-radius: 0;
  transition: opacity 0.15s;
  color: #475569;
}

.footer-analytics-clickable:hover {
  background: transparent;
  opacity: 0.8;
}

.footer-analytics-clickable strong {
  color: var(--primary-navy);
}

.stat-sep {
  color: #cbd5e1;
}

.analytics-online-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  display: inline-block;
  animation: pulseGreen 2s infinite;
}

@keyframes pulseGreen {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 5px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* ==================== VISITOR MODAL ==================== */
.visitor-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.visitor-modal-dialog {
  background: #ffffff;
  border-radius: var(--radius-md);
  width: 100%;
  max-width: 850px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 45px -10px rgba(15, 23, 42, 0.35);
  border: 1px solid var(--border-color);
  animation: modalPopIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPopIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(6px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.visitor-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
}

.visitor-modal-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.visitor-modal-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--primary-navy);
}

.visitor-modal-subtitle {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

.visitor-modal-close-btn {
  background: transparent;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #94a3b8;
  transition: color 0.15s;
}

.visitor-modal-close-btn:hover {
  color: #0f172a;
}

.visitor-modal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-color);
}

.visitor-modal-tabs {
  display: flex;
  gap: 8px;
}

.visitor-tab-btn {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--border-color);
  background: #ffffff;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s;
}

.visitor-tab-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.visitor-tab-btn.active {
  background: var(--royal-blue);
  color: #ffffff;
  border-color: var(--royal-blue);
}

.visitor-modal-body {
  padding: 16px 20px;
  overflow-y: auto;
  flex: 1;
  background: #ffffff;
  color: var(--text-main);
}

.visitor-modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
  color: var(--text-muted);
}

/* ==================== BUTANG EXCEL / CSV (NEUTRAL ASAL, HIJAU BILA HOVER) ==================== */
.btn-excel-green {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 14px;
  height: 38px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
  background: #ffffff !important;
  color: #1e293b !important;
  border: 1px solid #cbd5e1 !important;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  box-sizing: border-box;
  white-space: nowrap;
}

.btn-excel-green svg {
  width: 15px !important;
  height: 15px !important;
  flex-shrink: 0 !important;
  stroke: #16a34a;
  transition: stroke 0.18s ease;
}

.btn-excel-green:hover {
  background: #16a34a !important;
  border-color: #15803d !important;
  color: #ffffff !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3) !important;
}

.btn-excel-green:hover svg {
  stroke: #ffffff !important;
}

.btn-excel-green:active {
  transform: translateY(0);
}


/* ==================== SUSUN ATUR PROFIL EKSEKUTIF (2-KOLUM) ==================== */
.profile-grid-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 22px;
  align-items: stretch;
}

@media (max-width: 900px) {
  .profile-grid-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

.profile-card-left {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px 20px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  box-sizing: border-box;
}

.profile-card-right-col {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.profile-card-right-col .card-section {
  height: 100%;
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-sizing: border-box;
}

@media (max-width: 900px) {
  .profile-card-left,
  .profile-card-right-col,
  .profile-card-right-col .card-section {
    height: auto;
  }
}

.profile-avatar-large {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: #0f172a;
  border: 3px solid #fbbf24;
  color: #fbbf24;
  font-size: 26px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px auto;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
  overflow: hidden;
  position: relative;
}

.profile-avatar-large img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.avatar-camera-btn {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #1e3a8a;
  border: 2px solid #ffffff;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  transition: background 0.16s ease, transform 0.16s ease;
}

.avatar-camera-btn:hover {
  background: #2563eb;
  transform: scale(1.1);
}

.btn-avatar-action {
  height: 28px;
  padding: 0 12px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.btn-avatar-action:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1e3a8a;
}

.btn-avatar-danger {
  color: #dc2626 !important;
  border-color: #fecaca !important;
  background: #fff1f2 !important;
}

.btn-avatar-danger:hover {
  background: #fee2e2 !important;
  border-color: #f87171 !important;
}

.profile-stat-box {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-top: 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  text-align: left;
}

.profile-stat-item strong {
  display: block;
  font-size: 17px;
  color: var(--primary-navy);
}

.profile-stat-item span {
  font-size: 11px;
  color: var(--text-muted);
}

/* Input readonly bergaya eksekutif cerah & berikon kunci */
.form-control-readonly {
  background: #f8fafc !important;
  color: #475569 !important;
  border: 1px solid #cbd5e1 !important;
  cursor: not-allowed;
}

/* ==================== BUTANG TERAPUNG SKROL (NAIK ATAS & TURUN BAWAH) ==================== */
.floating-scroll-actions {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-scroll-action {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #0f172a;
  border: 1.5px solid #fbbf24;
  color: #fbbf24;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.25);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.btn-scroll-action:hover {
  background: #1e293b;
  color: #ffffff;
  border-color: #f59e0b;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.35);
}

.btn-scroll-action:active {
  transform: translateY(0);
}

.btn-scroll-action svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
}

.btn-scroll-action[data-tooltip]::before {
  content: attr(data-tooltip);
  position: absolute;
  right: calc(100% + 10px);
  background: #0f172a;
  color: #ffffff;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateX(4px);
  transition: all 0.15s ease;
  border: 1px solid rgba(251, 191, 36, 0.3);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.btn-scroll-action:hover[data-tooltip]::before {
  opacity: 1;
  transform: translateX(0);
}

/* ==================== GAYA CETAKAN LAPORAN RASMI (@MEDIA PRINT) ==================== */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  body::before {
    display: none !important;
  }
  .topbar, .app-footer-bar, .floating-scroll-actions, .mobile-nav-toggle-btn, 
  .year-filter-wrapper, .btn-add-quick, .btn-table-action, .btn-excel-green, .btn-top-action, .btn-tune,
  #userDropdownWrapper, .no-print, .visitor-modal-backdrop {
    display: none !important;
  }
  .app-layout {
    padding: 0 !important;
    max-width: 100% !important;
  }
  .card-section, .kpi-card {
    box-shadow: none !important;
    border: 1px solid #cbd5e1 !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }
  tr, td, th {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .print-only-header {
    display: block !important;
  }
}

@media screen {
  .print-only,
  .print-page-footer,
  .print-only-header {
    display: none !important;
  }
}

.print-only-header {
  margin-bottom: 20px;
  border-bottom: 2px solid #0f172a;
  padding-bottom: 12px;
}

/* ==================== ARKIB TEMPLAT SIJIL RASMI (PRESET PICKER) ==================== */
.template-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.template-preset-card {
  position: relative;
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
}

.template-preset-card:hover {
  border-color: #93c5fd;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(30, 58, 138, 0.08);
}

.template-preset-card.active {
  border-color: #1e3a8a;
  background: #f8faff;
  box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.15), 0 8px 20px rgba(30, 58, 138, 0.1);
}

.template-card-thumb-wrapper {
  position: relative;
  width: 100%;
  height: 135px;
  background: #f8fafc;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e2e8f0;
  margin-bottom: 10px;
}

.template-card-thumb-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.2s ease;
}

.template-preset-card:hover .template-card-thumb-wrapper img {
  transform: scale(1.03);
}

.template-badge-orientation {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(15, 23, 42, 0.78);
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.3px;
  backdrop-filter: blur(4px);
}

.template-card-check {
  position: absolute;
  top: -8px;
  left: -8px;
  width: 24px;
  height: 24px;
  background: #1e3a8a;
  color: #ffffff;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 900;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.template-preset-card.active .template-card-check {
  display: flex;
}

.template-card-title {
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 4px;
  line-height: 1.3;
}

.template-card-desc {
  font-size: 11.5px;
  color: #64748b;
  line-height: 1.4;
  margin-bottom: 10px;
  flex: 1;
}

.template-card-btn {
  font-size: 11.5px;
  font-weight: 700;
  text-align: center;
  padding: 6px 10px;
  border-radius: 6px;
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
  transition: all 0.15s ease;
}

.template-preset-card.active .template-card-btn {
  background: #1e3a8a;
  color: #ffffff;
  border-color: #1e3a8a;
}

/* ==================== PARTICIPANT TABLE TOOLBAR, FILTER BAR & PAGINATION ==================== */
.participant-table-tools-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}

.participant-table-title {
  margin: 0;
  font-size: 1.15rem;
  color: #0f172a;
  font-weight: 700;
}

.participant-search-add-group {
  display: flex;
  gap: 10px;
  align-items: center;
}

.participant-search-add-group #participantSearchInput {
  width: 230px;
  font-size: 12.5px;
  padding: 6px 12px;
  height: 35px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  box-sizing: border-box;
}

.participant-search-add-group .btn-add-participant-action {
  font-weight: 700;
  white-space: nowrap;
  height: 35px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-sizing: border-box;
}

.participant-filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding: 8px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.participant-filter-group {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.participant-filter-label {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.participant-filter-pills {
  display: flex;
  gap: 5px;
  align-items: center;
  flex-wrap: wrap;
}

.participant-filter-pills .btn-table-action {
  font-size: 11.5px;
  padding: 3px 10px;
  height: 28px;
}

.participant-filter-divider {
  color: #cbd5e1;
  margin: 0 4px;
}

.participant-pagination-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-top: 1px solid #e2e8f0;
  flex-wrap: wrap;
  gap: 10px;
  background: #f8fafc;
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
}

.participant-pagination-info {
  font-size: 12.5px;
  color: #64748b;
}

.participant-pagination-buttons {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
}

.participant-pagination-buttons .btn-page-btn {
  height: 30px;
  min-width: 32px;
  padding: 0 10px;
  font-size: 12px;
}

/* ==================== GLOBAL MOBILE RESPONSIVENESS & TOUCH OPTIMIZATIONS ==================== */
@media (max-width: 768px) {
  /* Prevent iOS Safari auto-zoom on form inputs (<16px triggers zoom) */
  .form-control, .form-select, select.form-control, 
  input[type="text"], input[type="email"], input[type="password"], input[type="date"], input[type="number"],
  .input-custom-field, .input-field-custom {
    font-size: 16px !important;
  }

  /* Prevent table squishing: Smooth touch horizontal scroll with minimum width */
  .table-responsive {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    width: 100% !important;
    margin-bottom: 12px;
  }

  .data-table, .participants-fit-table {
    min-width: 820px !important;
    table-layout: auto !important;
  }
  .users-data-table {
    min-width: 1040px !important;
  }
  .data-table td,
  .data-table th {
    word-break: normal !important;
  }

  /* Form Grids: Single column on small devices, remove forced column spans */
  .form-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .form-group[style*="grid-column"] {
    grid-column: span 1 !important;
  }

  /* Header & Action Clusters: Stacking nicely */
  .page-header-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }

  .header-actions-cluster {
    display: flex !important;
    flex-wrap: wrap !important;
    width: 100% !important;
    gap: 8px !important;
  }

  .header-actions-cluster > * {
    flex: 1 1 auto !important;
    justify-content: center !important;
  }

  .card-header-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }

  .card-header-bar > div:last-child {
    width: 100% !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }

  .card-header-bar input[type="text"] {
    max-width: 100% !important;
    width: 100% !important;
  }

  /* Sembunyikan Tier 1 di Mobile supaya tidak bertindan (Format Sistem 2) */
  .top-institutional-header {
    display: none !important;
  }

  /* KPI Grid: 2 Kolum Mobile Persis Sistem 2 / Go-Lupus */
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }

  .kpi-card {
    padding: 14px 12px 14px 12px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    min-height: 86px !important;
    box-sizing: border-box !important;
  }

  .kpi-card-content {
    width: 100% !important;
  }

  .kpi-card .kpi-info-label {
    font-size: 10px !important;
    font-weight: 800 !important;
    letter-spacing: 0.4px !important;
    color: #475569 !important;
    line-height: 1.3 !important;
    margin-bottom: 4px !important;
  }

  .kpi-val {
    font-size: 28px !important;
    font-weight: 900 !important;
    color: #0f172a !important;
    margin-top: 4px !important;
    line-height: 1 !important;
  }

  .kpi-icon-box {
    display: none !important;
  }

  .kpi-subtext {
    display: none !important;
  }

  /* Visitor / Report Modals: Full viewport width & Thumb-friendly */
  .visitor-modal-backdrop {
    padding: 8px !important;
  }

  .visitor-modal-dialog {
    width: 100% !important;
    max-height: 94vh !important;
    border-radius: 10px !important;
  }

  .visitor-modal-toolbar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }

  .visitor-modal-toolbar input {
    max-width: 100% !important;
    width: 100% !important;
  }

  .visitor-modal-footer {
    flex-direction: column-reverse !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  .visitor-modal-footer button, .visitor-modal-footer a {
    width: 100% !important;
    justify-content: center !important;
  }

  /* Public Search (semak.php) & Verify (verify.php) responsiveness */
  .public-portal-card {
    padding: 18px 16px !important;
    border-radius: 12px !important;
  }

  .verify-row-responsive {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 4px !important;
  }

  .verify-label-responsive {
    width: 100% !important;
  }

  /* Mobile table scrolling & touch safety */
  .table-responsive {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    max-width: 100% !important;
  }

  .btn-tb-icon {
    width: 30px !important;
    height: 30px !important;
  }

  /* ULPL Course & Template Mobile Optimizations */
  .app-layout {
    padding: 12px 10px 40px 10px !important;
  }

  .card-section {
    padding: 14px 14px !important;
    margin-bottom: 16px !important;
  }

  .page-title {
    font-size: 18px !important;
  }

  .course-actions-cluster {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }

  .course-actions-cluster .btn-hd-unified,
  .course-actions-cluster form,
  .course-actions-cluster form button {
    width: 100% !important;
    justify-content: center !important;
  }

  .course-actions-cluster form {
    display: block !important;
  }

  .course-share-row {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
    min-height: 0 !important;
    height: auto !important;
  }

  .course-share-row > div,
  .course-share-left {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    flex: none !important;
    min-height: 0 !important;
    height: auto !important;
  }

  .course-share-input-row {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    width: 100% !important;
  }

  #publicFormLinkInput {
    width: 100% !important;
    max-width: 100% !important;
    flex: 1 1 100% !important;
    box-sizing: border-box !important;
  }

  .course-share-input-row .btn-copy-share,
  .course-share-input-row .btn-open-share {
    flex: 1 1 calc(50% - 4px) !important;
    justify-content: center !important;
    text-align: center !important;
    box-sizing: border-box !important;
  }

  .course-share-qr-capsule {
    width: 100% !important;
    box-sizing: border-box !important;
    justify-content: space-between !important;
  }

  .course-share-qr-capsule > div:last-child {
    flex: 1 !important;
  }

  .course-share-qr-capsule button {
    width: 100% !important;
    justify-content: center !important;
  }

  .table-toolbar-flex {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  .table-toolbar-flex > div:last-child {
    width: 100% !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }

  .table-toolbar-flex input[type="text"] {
    width: 100% !important;
    max-width: 100% !important;
  }

  .table-toolbar-flex button {
    width: 100% !important;
  }

  #ulplSearchInput {
    width: 100% !important;
  }

  .year-filter-wrapper {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    flex-wrap: nowrap !important;
    padding-bottom: 8px !important;
  }

  .btn-year-pill {
    white-space: nowrap !important;
    flex-shrink: 0 !important;
  }

  /* Participant Table & Toolbar Mobile Responsiveness */
  .participant-table-tools-header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  .participant-table-tools-header .participant-table-title {
    width: 100% !important;
  }

  .participant-search-add-group {
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100% !important;
    gap: 8px !important;
  }

  .participant-search-add-group #participantSearchInput {
    width: 100% !important;
    max-width: 100% !important;
    height: 38px !important;
    box-sizing: border-box !important;
  }

  .participant-search-add-group .btn-add-participant-action {
    width: 100% !important;
    height: 38px !important;
    justify-content: center !important;
    font-size: 13px !important;
    box-sizing: border-box !important;
  }

  .participant-filter-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    padding: 10px !important;
  }

  .participant-filter-divider {
    display: none !important;
  }

  .participant-filter-group {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 6px !important;
    width: 100% !important;
  }

  .participant-filter-pills {
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    flex-wrap: nowrap !important;
    padding-bottom: 4px !important;
  }

  .participant-filter-pills .btn-table-action {
    white-space: nowrap !important;
    flex-shrink: 0 !important;
  }

  .participant-pagination-bar {
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    gap: 10px !important;
  }

  .participant-pagination-buttons {
    justify-content: center !important;
    width: 100% !important;
    flex-wrap: wrap !important;
  }
}

@media (max-width: 480px) {
  .course-actions-cluster {
    grid-template-columns: 1fr !important;
  }
}

/* Base definitions for ULPL Template Layout Grid */
.template-layout-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 24px;
  margin-bottom: 30px;
}

@media (max-width: 900px) {
  .template-layout-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
}

.kpi-grid-2col {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

@media (max-width: 600px) {
  .kpi-grid-2col {
    grid-template-columns: 1fr !important;
  }
}

/* ==================== ENHANCED MOBILE RESPONSIVENESS (TOOLBARS, BUTTONS & GRIDS) ==================== */
@media (max-width: 768px) {
  .table-toolbar-flex {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }

  .table-toolbar-flex > div:last-child {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
  }

  .table-toolbar-flex input[type="text"],
  .table-toolbar-flex select {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .create-actions-group {
    flex-direction: column-reverse !important;
    width: 100% !important;
    gap: 10px !important;
  }

  .create-actions-group > * {
    width: 100% !important;
    justify-content: center !important;
    text-align: center !important;
  }

  .template-picker-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Password visibility toggle button & wrapper */
.password-input-wrapper {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
}

.password-input-wrapper .form-control {
  padding-right: 42px !important;
}

.password-toggle-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: color 0.15s ease, background-color 0.15s ease;
  z-index: 2;
}

.password-toggle-btn:hover {
  color: #1e3a8a;
  background-color: #f1f5f9;
}

/* ==================== GLOBAL RESPONSIVE POLISH & ICON HARMONIZATION ==================== */
.badge-pill svg,
.btn-top-action svg,
.btn-table-action svg {
  vertical-align: middle;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .dashboard-module-switcher {
    width: 100% !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
  }

  .dashboard-module-switcher .module-switch-pill {
    flex: 1 1 calc(50% - 6px) !important;
    min-width: 130px !important;
    text-align: center !important;
    justify-content: center !important;
  }

  .card-header-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }

  .card-header-bar > div:last-child {
    width: 100% !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }

  .card-header-bar input[type="text"],
  .card-header-bar select {
    width: 100% !important;
    max-width: 100% !important;
  }

  .page-header-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }

  .header-actions-cluster {
    width: 100% !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }

  .header-actions-cluster .btn-top-action,
  .header-actions-cluster .btn-table-action {
    flex: 1 1 calc(50% - 6px) !important;
    justify-content: center !important;
    text-align: center !important;
  }
}

@media (max-width: 480px) {
  .dashboard-module-switcher .module-switch-pill {
    flex: 1 1 100% !important;
  }

  .header-actions-cluster .btn-top-action,
  .header-actions-cluster .btn-table-action {
    flex: 1 1 100% !important;
  }

  .visitor-modal-dialog {
    width: 95% !important;
    margin: 10px auto !important;
    padding: 0 !important;
  }
}

/* ==================== PENAMBAHBAIKAN RESPONSIF MUDAH ALIH (SEMUA HALAMAN) ==================== */
/* 1. Bar Paginasi Kemas (ULPL & Program) Pada Peranti Mudah Alih */
@media (max-width: 640px) {
  #participantsPaginationWrap,
  #paginationBar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }

  #participantsPaginationWrap > div:first-child,
  #paginationBar > div:first-child {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
    width: 100% !important;
  }

  #participantsPaginationNav,
  #paginationButtons {
    justify-content: center !important;
    width: 100% !important;
    margin-top: 4px !important;
  }

  #participantsPaginationNav button,
  #paginationButtons button {
    height: 32px !important;
    min-width: 32px !important;
    font-size: 12px !important;
    padding: 0 8px !important;
  }
}

/* 2. Pilihan Penapis & Carian Halaman ULPL & Program */
@media (max-width: 768px) {
  .ulpl-toolbar-actions {
    width: 100% !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }

  .ulpl-toolbar-actions > * {
    width: 100% !important;
  }

  .ulpl-toolbar-actions input,
  .ulpl-toolbar-actions select {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Susunan Abjad Kepala Jadual Tidak Terputus */
  #thSortParticipantName,
  #thSortProgParticipantName {
    white-space: nowrap !important;
  }

  /* Kad Pilihan Templat Modal */
  .tpl-card-choice {
    width: 100% !important;
    min-width: 0 !important;
  }

  /* Jadual Tidak Tersepit & Boleh Tatal Lancar */
  .table-responsive {
    border-radius: 8px !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
}

@media (max-width: 480px) {
  /* Pastikan dialog modal muat dengan selesa pada skrin telefon sempit */
  .visitor-modal-dialog {
    width: 96% !important;
    max-height: 92vh !important;
  }

  .tpl-card-choice {
    padding: 10px !important;
  }
}

/* ==========================================================
   PENAMBAHBAIKAN SUSUN ATUR MODAL KURSUS & RESPONSIF MUDAH ALIH
   ========================================================== */

/* Kelas Susun Atur Modal Kemaskini Maklumat Kursus */
.edit-modal-row-siri-title {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 10px;
  margin-bottom: 9px;
}

.edit-modal-row-dates {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1.35fr;
  gap: 10px;
  margin-bottom: 9px;
}

.edit-modal-row-loc-tpl,
.edit-modal-row-org-target {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 9px;
}

.edit-modal-row-3col {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 9px;
}

.edit-modal-card-signatory {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  padding: 8px 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.edit-modal-duration-box {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 34px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 2px 6px;
}

.modal-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.eval-modal-participant-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px 24px;
  font-size: 12px;
  color: #475569;
}

/* Penyesuaian Responsif Tablet & Telefon Pintar (<= 768px) */
@media (max-width: 768px) {
  /* Susun satu lajur untuk semua baris medan yang sempit */
  .edit-modal-row-siri-title,
  .edit-modal-row-loc-tpl,
  .edit-modal-row-org-target,
  .edit-modal-row-3col,
  .edit-modal-card-signatory,
  .modal-grid-2col,
  .eval-modal-participant-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  /* Baris Tarikh: Tarikh Mula & Akhir sebelah-menyebelah (2 lajur), Masa & Tempoh baris penuh */
  .edit-modal-row-dates {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }

  .edit-modal-row-dates > div:nth-child(3),
  .edit-modal-row-dates > div:nth-child(4) {
    grid-column: span 2 !important;
  }

  /* Kotak Durasi fleksibel pada skrin kecil */
  .edit-modal-duration-box {
    flex-wrap: wrap !important;
    height: auto !important;
    min-height: 38px !important;
    padding: 6px 8px !important;
    gap: 6px !important;
  }

  .edit-modal-duration-box select {
    min-width: 58px !important;
    height: 32px !important;
  }

  .edit-modal-duration-box input {
    height: 32px !important;
  }

  /* Pengepala Modal Pratonton Cetakan PS-10(1) & ISO PS-10(2) */
  .eval-modal-header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
    padding: 8px 12px !important;
  }

  .eval-modal-header-brand {
    width: 100% !important;
  }

  .eval-modal-header-controls {
    width: 100% !important;
    justify-content: space-between !important;
  }

  /* Pertahanan Global: Elakkan mana-mana grid modal lain daripada terhimpit */
  .visitor-modal-dialog [style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }
}

/* Penyesuaian Responsif Telefon Pintar Kompak (<= 480px) */
@media (max-width: 480px) {
  .visitor-modal-dialog {
    width: 95% !important;
    max-height: 94vh !important;
    border-radius: 10px !important;
  }

  .visitor-modal-dialog textarea,
  .visitor-modal-dialog input:not([type="checkbox"]):not([type="radio"]),
  .visitor-modal-dialog select {
    font-size: 14px !important;
    min-height: 36px !important;
  }

  /* Butang footer modal mudah ditekan dengan jari */
  .visitor-modal-footer {
    flex-direction: column-reverse !important;
    align-items: stretch !important;
    gap: 8px !important;
    padding: 10px 14px !important;
  }

  .visitor-modal-footer button,
  .visitor-modal-footer a {
    width: 100% !important;
    height: 38px !important;
    justify-content: center !important;
  }
}
