/* ==========================================================================
   Go-Lupus: Sistem Pengurusan Pelupusan Aset Alih POLIMAS
   Tema Rasmi: Hitam & Merah (Cerahan Bersih / Light Modern Slate)
   ========================================================================== */

:root {
  /* Canvas Cerah / Clean Light Surfaces */
  --bg-body: #f8fafc;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #fbfcfe;
  --bg-subtle: #f1f5f9;
  --bg-input: #ffffff;
  
  /* Obsidian & Charcoal Black Accents */
  --black-header: #0f172a;
  --black-sidebar: #0b0f19;
  --black-surface: #1e293b;
  --black-text: #0f172a;

  /* Crimson Flame Red Accents */
  --red-primary: #dc2626;
  --red-hover: #b91c1c;
  --red-light: rgba(220, 38, 38, 0.08);
  --red-border: rgba(220, 38, 38, 0.25);
  --red-glow: rgba(220, 38, 38, 0.2);

  /* Functional Status Accents */
  --wa-green: #22c55e;
  --wa-green-hover: #16a34a;
  --wa-glow: rgba(34, 197, 94, 0.25);
  --status-amber: #f59e0b;
  --status-red: #ef4444;
  --status-blue: #2563eb;
  --status-green: #10b981;

  /* Typography Colors (Dark on Light) */
  --text-pure: #0f172a;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-dim: #94a3b8;
  --line: #e2e8f0;
  --line-light: #f1f5f9;
  --line-dark: #cbd5e1;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px -1px rgba(0, 0, 0, 0.08), 0 2px 6px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.1), 0 4px 10px -2px rgba(0, 0, 0, 0.04);
  --shadow-red: 0 4px 14px rgba(220, 38, 38, 0.28);

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg-body);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  letter-spacing: -0.011em;
  overflow-x: hidden;
  max-width: 100vw;
}

body, button, input, select, textarea {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg-body);
  overflow-x: hidden;
  max-width: 100vw;
}

a {
  color: var(--red-primary);
  text-decoration: none;
  transition: all 0.15s ease;
}

a:hover {
  color: var(--red-hover);
  text-decoration: underline;
}

/* ==========================================================================
   Topbar (Header Bersih Berprestij dengan Aksen Merah POLIMAS)
   ========================================================================== */

.topbar {
  height: 72px;
  background: #ffffff;
  border-top: 3.5px solid var(--red-primary);
  border-bottom: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Sidebar Toggle Button */
.sidebar-toggle-btn {
  background: #f8fafc;
  color: #334155;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.sidebar-toggle-btn:hover {
  background: #fee2e2;
  color: var(--red-primary);
  border-color: #fca5a5;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: #0f172a;
}

.brand:hover {
  text-decoration: none;
}

/* Logo POLIMAS duduk semulajadi secara telus tanpa kotak putih */
.brand-logos {
  display: flex;
  align-items: center;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.header-logo.logo-polimas {
  height: 42px;
  max-width: 150px;
  display: block;
}

.brand-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-left: 1.5px solid #e2e8f0;
  padding-left: 14px;
}

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

.brand-name {
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.brand-badge {
  font-size: 10px;
  font-weight: 800;
  background: var(--red-primary);
  color: #ffffff;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.brand-sub {
  font-size: 11px;
  color: #64748b;
  font-weight: 600;
  margin-top: 1px;
}

/* Header Live Date & Time Widget */
.header-datetime-widget {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 5px 14px 5px 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-full);
  margin-left: auto;
  margin-right: 16px;
  transition: all 0.2s ease;
  user-select: none;
}

.header-datetime-widget:hover {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
}

.datetime-icon-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--red-primary);
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.datetime-text-group {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.datetime-time-val {
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.datetime-date-val {
  font-size: 11.5px;
  font-weight: 600;
  color: #64748b;
}

/* User Area */
.user-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  padding: 5px 14px 5px 6px;
  border-radius: var(--radius-full);
  text-decoration: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
}

.user-pill:hover {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--red-primary);
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 6px rgba(220, 38, 38, 0.3);
}

.user-meta {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.user-name {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
}

.user-role {
  margin-top: 2px;
}

.role-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  border-radius: 4px;
  padding: 1px 7px;
  line-height: 1.35;
}

.role-superadmin {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}

.role-admin {
  color: #b91c1c;
  background: #fee2e2;
  border: 1px solid #fca5a5;
}

.role-staff,
.role-user {
  color: #b91c1c;
  background: #fee2e2;
  border: 1px solid #fca5a5;
}

.user-pill-arrow {
  color: #ef4444;
  margin-left: 2px;
  transition: transform 0.2s ease;
}

.user-pill:hover .user-pill-arrow {
  transform: scale(1.15);
}

.btn-logout {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  background: #f8fafc;
  color: #dc2626;
  border: 1px solid #fca5a5;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-logout:hover {
  background: #dc2626;
  color: #ffffff;
  border-color: #dc2626;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.25);
}

/* ==========================================================================
   Sidebar & Collapsible Logic (Flexbox Bulletproof Layout)
   ========================================================================== */

/* Mobile Backdrop Overlay - Hidden on desktop by default */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 99;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.app-shell {
  display: flex !important;
  flex-direction: row !important;
  align-items: stretch !important;
  width: 100% !important;
  min-height: calc(100vh - 80px);
  position: relative;
  background: var(--bg-body);
}

.sidebar {
  width: 260px !important;
  min-width: 260px !important;
  max-width: 260px !important;
  flex: 0 0 260px !important;
  min-height: calc(100vh - 80px);
  background: #0b0f19;
  color: #ffffff;
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  transition: width 0.25s ease, margin 0.25s ease, transform 0.25s ease, opacity 0.2s ease, padding 0.2s ease;
  overflow-y: auto;
  z-index: 10;
}

/* Desktop Collapsed State */
body.sidebar-collapsed .sidebar {
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  flex: 0 0 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border-right: none !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.sidebar-mobile-header {
  display: none;
}

.sidebar-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-label {
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  padding: 4px 10px;
  margin: 0;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: #94a3b8;
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
  transition: all 0.15s ease;
  border: 1px solid transparent;
  position: relative;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  text-decoration: none;
}

.nav-link.active {
  background: rgba(220, 38, 38, 0.14);
  color: #ffffff;
  border-color: rgba(220, 38, 38, 0.28);
  font-weight: 700;
}

.nav-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--red-primary);
}

.nav-icon {
  flex-shrink: 0;
  stroke: #94a3b8;
  transition: stroke 0.15s ease;
}

.nav-link:hover .nav-icon {
  stroke: #ffffff;
}

.nav-link.active .nav-icon {
  stroke: #ef4444;
}

.sidebar-footer {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sidebar-compliance-badge {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.compliance-badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.compliance-tag {
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #fca5a5;
  background: rgba(220, 38, 38, 0.2);
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid rgba(220, 38, 38, 0.3);
  white-space: nowrap;
}

.compliance-code {
  font-size: 11.5px;
  font-weight: 800;
  color: #ffffff;
  white-space: nowrap;
}

.compliance-sub {
  display: block;
  font-size: 10.5px;
  color: #94a3b8;
  line-height: 1.35;
}

.sidebar-inst-meta {
  font-size: 10.5px;
  color: #64748b;
  text-align: center;
  line-height: 1.35;
}

/* Mobile Sidebar Drawer */
@media (max-width: 991px) {
  .app-shell {
    display: block !important;
  }

  .sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    height: 100vh !important;
    width: 280px !important;
    min-width: 280px !important;
    max-width: 85vw !important;
    z-index: 100 !important;
    transform: translateX(-100%) !important;
    box-shadow: none !important;
  }

  body.mobile-sidebar-open .sidebar {
    transform: translateX(0) !important;
    box-shadow: 12px 0 35px rgba(0, 0, 0, 0.5) !important;
  }

  .sidebar-mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 14px;
    margin-bottom: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .sidebar-mobile-title {
    font-size: 13.5px;
    font-weight: 800;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }

  .sidebar-close-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
  }

  body.mobile-sidebar-open .sidebar-backdrop {
    display: block !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  .content {
    padding: 20px 16px 50px !important;
  }
}

/* ==========================================================================
   Content & Layout Containers (Cerah Bersih)
   ========================================================================== */

.main-column {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 80px);
  background: var(--bg-body);
}

.public-column {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg-body);
}

.content {
  flex: 1 0 auto;
  min-width: 0;
  width: auto;
  padding: 28px 36px 32px;
  background: var(--bg-body);
  display: flex;
  flex-direction: column;
}

.public-main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 36px 24px 40px;
  width: 100%;
  flex: 1 0 auto;
}

.page-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--red-primary);
  font-weight: 800;
  font-size: 11.5px;
}

.page-head h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
  color: var(--black-text);
  letter-spacing: -0.025em;
}

/* ==========================================================================
   Cards & UI Surfaces (Putih Bersih & Sempadan Lembut)
   ========================================================================== */

.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  transition: all 0.2s ease;
  margin-bottom: 24px;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.card:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-md);
}

.card-title {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 20px;
}

.card-title h2, .card-title h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: var(--black-text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-icon {
  stroke: var(--red-primary);
}

.muted {
  color: var(--text-muted);
}

.muted-italic {
  color: var(--text-dim);
  font-style: italic;
  font-size: 13px;
}

.small {
  font-size: 12.5px;
}

.strong {
  font-weight: 700;
}

/* ==========================================================================
   Alerts & Notifications
   ========================================================================== */

.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  margin-bottom: 20px;
  border: 1px solid;
  font-size: 13.5px;
  line-height: 1.45;
}

.alert-icon {
  flex-shrink: 0;
  margin-top: 1px;
}

.alert-content {
  flex: 1;
}

.alert-dismiss-btn {
  background: transparent;
  border: none;
  color: currentColor;
  opacity: 0.6;
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  flex-shrink: 0;
  margin-top: -1px;
  margin-left: 8px;
  transition: opacity 0.15s ease;
}

.alert-dismiss-btn:hover {
  opacity: 1;
}

.alert-error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.alert-success {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
}

.alert-info {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #1e293b;
}

.alert-warning {
  background: #fffbeb;
  border-color: #fef3c7;
  color: #92400e;
}

/* ==========================================================================
   Buttons (Merah & Hitam Berkontras Tinggi)
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  transition: all 0.18s ease;
  line-height: 1.2;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

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

/* Primary: Gaya Seragam (Lalai Putih Neutral, Hover Merah Polimas Berprestij) */
.btn-primary {
  background: #ffffff;
  color: #0f172a;
  border: 1.5px solid #cbd5e1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  font-weight: 700;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary svg {
  stroke: var(--red-primary);
  transition: stroke 0.15s ease;
}

.btn-primary:hover {
  background: var(--red-primary);
  border-color: var(--red-primary);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.35);
  transform: translateY(-2px);
}

.btn-primary:hover svg {
  stroke: #ffffff;
}

/* Secondary: Gaya Seragam (Lalai Putih Neutral, Hover Obsidian Black / Slate) */
.btn-secondary {
  background: #ffffff;
  color: #334155;
  border: 1.5px solid #cbd5e1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  font-weight: 700;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-secondary svg {
  stroke: #475569;
  transition: stroke 0.15s ease;
}

.btn-secondary:hover {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.25);
  transform: translateY(-2px);
}

.btn-secondary:hover svg {
  stroke: #ffffff;
}

/* Light / Outline */
.btn-light {
  background: #ffffff;
  color: #334155;
  border: 1.5px solid #cbd5e1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  font-weight: 600;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-light svg {
  stroke: #475569;
  transition: stroke 0.15s ease;
}

.btn-light:hover {
  background: #475569;
  border-color: #475569;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(71, 85, 105, 0.25);
  transform: translateY(-2px);
}

.btn-light:hover svg {
  stroke: #ffffff;
}

.btn-sm {
  padding: 7px 12px;
  font-size: 12.5px;
}

/* Penyelarasan Penuh Warna Teks & Pautan Butang (Anti-Tindih Merah) */
a.btn {
  text-decoration: none !important;
}

a.btn-primary, button.btn-primary {
  color: #0f172a !important;
}

a.btn-primary:hover, button.btn-primary:hover {
  color: #ffffff !important;
}

a.btn-secondary, button.btn-secondary {
  color: #334155 !important;
}

a.btn-secondary:hover, button.btn-secondary:hover {
  color: #ffffff !important;
}

a.btn-light, button.btn-light {
  color: #334155 !important;
}

a.btn-light:hover, button.btn-light:hover {
  color: #ffffff !important;
}

/* Butang Kejayaan (Success - Hijau Zamrud dengan Teks Putih Kontras) */
.btn-success,
a.btn-success,
button.btn-success {
  background: #16a34a !important;
  color: #ffffff !important;
  border: 1.5px solid #15803d !important;
  box-shadow: 0 1px 3px rgba(22, 163, 74, 0.2);
  font-weight: 700;
}

.btn-success svg,
a.btn-success svg,
button.btn-success svg {
  stroke: #ffffff !important;
}

.btn-success:hover,
a.btn-success:hover,
button.btn-success:hover {
  background: #15803d !important;
  border-color: #166534 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.35);
  transform: translateY(-2px);
}

/* Butang Amaran/Bahaya (Danger - Merah Crimson dengan Teks Putih) */
.btn-danger,
a.btn-danger,
button.btn-danger {
  background: #dc2626 !important;
  color: #ffffff !important;
  border: 1.5px solid #b91c1c !important;
  box-shadow: 0 1px 3px rgba(220, 38, 38, 0.2);
  font-weight: 700;
}

.btn-danger svg,
a.btn-danger svg,
button.btn-danger svg {
  stroke: #ffffff !important;
}

.btn-danger:hover,
a.btn-danger:hover,
button.btn-danger:hover {
  background: #b91c1c !important;
  border-color: #991b1b !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.35);
  transform: translateY(-2px);
}

.btn-danger-outline {
  background: #ffffff;
  color: #dc2626 !important;
  border: 1px solid #fca5a5;
}

.btn-danger-outline:hover {
  background: #dc2626 !important;
  color: #fff !important;
  border-color: #dc2626 !important;
}

/* Butang Paginasi Bersih & Seragam (Identiti POLIMAS Red, Bebas Butang Hitam) */
.page-link-btn {
  min-width: 32px;
  height: 30px;
  padding: 0 8px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 6px;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  color: #334155 !important;
  text-decoration: none !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.page-link-btn:hover {
  border-color: #dc2626 !important;
  color: #dc2626 !important;
  background: #fff5f5;
  transform: translateY(-1px);
}

.page-link-btn.active {
  background: #dc2626 !important;
  border-color: #dc2626 !important;
  color: #ffffff !important;
  font-weight: 800;
  box-shadow: 0 2px 6px rgba(220, 38, 38, 0.3) !important;
  cursor: default;
  pointer-events: none;
  transform: none;
}

.page-link-btn.disabled,
.page-link-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #94a3b8 !important;
  box-shadow: none;
  transform: none;
}

/* WhatsApp Button (Gaya Seragam: Lalai Putih Neutral, Hover Hijau) */
.btn-whatsapp {
  background: #ffffff;
  color: #334155;
  border: 1.5px solid #cbd5e1;
  font-size: 12.5px;
  font-weight: 600;
  height: 34px;
  padding: 0 12px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-whatsapp svg {
  color: #16a34a;
  transition: color 0.15s ease;
}

.btn-whatsapp:hover {
  background: #16a34a;
  color: #ffffff;
  border-color: #16a34a;
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.35);
  text-decoration: none;
  transform: translateY(-2px);
}

.btn-whatsapp:hover svg {
  color: #ffffff;
}

.btn-whatsapp-full {
  width: 100%;
  justify-content: center;
  height: 38px;
  padding: 0 14px;
}

.btn-whatsapp-disabled {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: #f1f5f9;
  color: #94a3b8;
  border: 1px solid var(--line);
  opacity: 0.6;
  cursor: not-allowed;
}

/* ==========================================================================
   Stat Cards (Papan Pemuka / Ringkasan Aksen Merah-Hitam)
   ========================================================================== */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.stat::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3.5px;
}

.stat:nth-child(1)::before {
  background: #3b82f6; /* Blue: Jumlah Keseluruhan */
}

.stat:nth-child(2)::before {
  background: #f59e0b; /* Amber: Menunggu Semakan */
}

.stat:nth-child(3)::before {
  background: #6366f1; /* Indigo: Dalam Semakan */
}

.stat:nth-child(4)::before {
  background: #10b981; /* Emerald: Selesai Dimuktamadkan */
}

.stat:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.stat span {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.stat strong {
  font-size: 32px;
  font-weight: 800;
  color: var(--black-text);
  line-height: 1.1;
  letter-spacing: -0.03em;
  transition: color 0.15s ease, transform 0.15s ease;
}

.stat small {
  font-size: 11.5px;
  color: var(--text-muted);
}

/* Stat Cards yang Boleh Diklik dengan Warna Semantik */
a.stat.stat-clickable {
  text-decoration: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  color: inherit;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

a.stat.stat-clickable:hover {
  border-color: #cbd5e1;
  box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  transform: translateY(-3px);
}

a.stat.stat-clickable:hover strong {
  transform: scale(1.05);
  transform-origin: left center;
}

.stat-arrow-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px dashed #e2e8f0;
  transition: all 0.18s ease;
}

a.stat.stat-clickable:hover .stat-arrow-indicator {
  transform: translateX(3px);
}

/* Warna Khusus Mengikut Kategori Kad */
a.stat.stat-clickable:nth-child(1):hover strong { color: #2563eb; }
a.stat.stat-clickable:nth-child(1):hover .stat-arrow-indicator { color: #2563eb; }

a.stat.stat-clickable:nth-child(2):hover strong { color: #d97706; }
a.stat.stat-clickable:nth-child(2):hover .stat-arrow-indicator { color: #d97706; }

a.stat.stat-clickable:nth-child(3):hover strong { color: #4f46e5; }
a.stat.stat-clickable:nth-child(3):hover .stat-arrow-indicator { color: #4f46e5; }

a.stat.stat-clickable:nth-child(4):hover strong { color: #059669; }
a.stat.stat-clickable:nth-child(4):hover .stat-arrow-indicator { color: #059669; }

/* ==========================================================================
   Data Tables (Cerah, Garisan Bersih & Jelas)
   ========================================================================== */

.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: #ffffff;
}

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

.data-table thead tr {
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
}

.data-table th {
  padding: 13px 16px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  white-space: nowrap;
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--text-main);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: all 0.15s ease;
}

.data-table tbody tr:hover {
  background: #f1f5f9;
  box-shadow: inset 3.5px 0 0 0 #0f172a;
}

.num-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-full);
  background: #f1f5f9;
  color: #475569;
  font-size: 11px;
  font-weight: 700;
}

/* ==========================================================================
   Badges (Pill & Status)
   ========================================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.badge-outline {
  border: 1px solid var(--line-dark);
  color: var(--text-muted);
  background: transparent;
}

.badge-neutral {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #e2e8f0;
}

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

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

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

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

/* ==========================================================================
   Forms, Inputs & Filter Bars
   ========================================================================== */

.form-group {
  margin-bottom: 16px;
}

.form-label, label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-control {
  width: 100%;
  background: #ffffff;
  border: 1px solid var(--line-dark);
  color: var(--black-text);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-family: inherit;
  transition: all 0.18s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--red-primary);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

.form-control option {
  background: #ffffff;
  color: var(--black-text);
}

/* Readonly & Disabled Shaded Fields (Kemasan Kelabu Jelas) */
.form-control:disabled,
.form-control[readonly],
.readonly-control,
input:disabled,
input[readonly],
select:disabled,
textarea:disabled,
textarea[readonly] {
  background-color: #f1f5f9 !important;
  color: #1e293b !important;
  border-color: #cbd5e1 !important;
  cursor: not-allowed;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03) !important;
  font-weight: 500;
  user-select: none;
}

.form-control:disabled:focus,
.form-control[readonly]:focus,
input:disabled:focus,
input[readonly]:focus {
  border-color: #cbd5e1 !important;
  box-shadow: none !important;
  outline: none !important;
}

.field-badge-readonly {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #e2e8f0;
  color: #475569;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  vertical-align: middle;
}

.filter-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 20px;
  align-items: flex-end;
}

.filter-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ==========================================================================
   Direktori Pengguna & PIC WhatsApp (Gambar 1 Styling)
   ========================================================================== */

.directory-header-wrap {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 24px;
}

.directory-heading-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.directory-icon-box {
  width: 44px;
  height: 44px;
  background: #0f172a;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  color: #ffffff;
  flex-shrink: 0;
}

.directory-title {
  margin: 0;
  font-size: 26px;
  font-weight: 800;
  color: var(--black-text);
  letter-spacing: -0.02em;
}

.directory-subtitle {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}

.directory-actions-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Butang Eksport Excel & CSV (Lalai Putih Neutral, Hover Hijau) */
.btn-export-csv,
.btn-export-excel {
  background: #ffffff;
  color: #334155;
  border: 1.5px solid #cbd5e1;
  padding: 8px 14px;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-export-csv svg,
.btn-export-excel svg {
  stroke: #16a34a;
  transition: stroke 0.15s ease;
}

.btn-export-csv:hover,
.btn-export-excel:hover {
  background: #16a34a !important;
  color: #ffffff !important;
  border-color: #16a34a !important;
  box-shadow: 0 4px 14px rgba(22, 163, 74, 0.35) !important;
  transform: translateY(-2px);
  text-decoration: none;
}

.btn-export-csv:hover svg,
.btn-export-excel:hover svg {
  stroke: #ffffff !important;
}

.view-toggle-group {
  display: flex;
  background: #f1f5f9;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 2px;
}

.btn-toggle {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn-toggle.active {
  background: #ffffff;
  color: var(--black-text);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.badge-total-users {
  background: #ffffff;
  border: 1px solid var(--line-dark);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.badge-total-users strong {
  color: var(--black-text);
  font-size: 14px;
}

/* Directory Filter Card */
.directory-filter-card {
  padding: 18px 20px;
  margin-bottom: 24px;
  background: #ffffff;
}

.directory-filter-grid {
  display: grid;
  grid-template-columns: 2fr 1.3fr 1.2fr auto;
  gap: 16px;
  align-items: flex-end;
}

@media (max-width: 900px) {
  .directory-filter-grid {
    grid-template-columns: 1fr;
  }
}

.filter-field {
  display: flex;
  flex-direction: column;
}

.filter-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.search-inner-icon {
  position: absolute;
  left: 12px;
  stroke: #94a3b8;
  pointer-events: none;
}

.filter-input {
  padding-left: 36px;
}

.filter-actions-col {
  display: flex;
  align-items: flex-end;
}

.filter-reset-btn {
  height: 42px;
  width: 42px;
  padding: 0;
  display: grid;
  place-items: center;
}

/* Directory Table & Cells */
.user-cell-flex {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar-box {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
}

.avatar-admin {
  background: #0f172a;
  color: #ffffff;
}

.avatar-user {
  background: #e2e8f0;
  color: #1e293b;
}

.avatar-box-lg {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 16px;
  font-weight: 800;
}

.user-cell-details {
  display: flex;
  flex-direction: column;
}

.user-fullname {
  font-size: 13.5px;
  color: var(--black-text);
  line-height: 1.25;
}

.user-subpos {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

.role-pill-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 6px;
}

.pill-admin {
  background: #0f172a;
  color: #ffffff;
}

.pill-user {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #e2e8f0;
}

.dept-text {
  font-size: 13px;
  color: var(--text-main);
}

.email-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.email-link:hover {
  color: var(--red-primary);
  text-decoration: underline;
}

.phone-display {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--black-text);
}

.phone-display strong {
  font-size: 13px;
  letter-spacing: 0.02em;
}

.action-btn-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

/* Butang Tindakan Ikon Standard (Gaya Kemas Gambar 1 dengan Highlight Jelas) */
.btn-icon-action {
  width: 34px;
  height: 34px;
  border-radius: 7px;
  background: #ffffff;
  color: #334155;
  border: 1.5px solid #cbd5e1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.btn-icon-action svg {
  stroke: #475569;
  transition: stroke 0.15s ease;
}

.btn-icon-action:hover {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.25);
}

.btn-icon-action:hover svg {
  stroke: #ffffff;
}

/* Highlight Biru Khas untuk Edit */
.btn-icon-action.btn-action-edit:hover,
.btn-action-edit:hover {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.35);
}

.btn-icon-action.btn-action-edit:hover svg,
.btn-action-edit:hover svg {
  stroke: #ffffff;
}

/* Highlight Merah Khas untuk Padam */
.btn-icon-action.btn-action-delete:hover:not(:disabled),
.btn-action-delete:hover:not(:disabled) {
  background: #e11d48;
  color: #ffffff;
  border-color: #e11d48;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(225, 29, 72, 0.35);
}

.btn-icon-action.btn-action-delete:hover:not(:disabled) svg,
.btn-action-delete:hover:not(:disabled) svg {
  stroke: #ffffff;
}

/* Highlight Hijau Khas untuk Muat Turun */
.btn-icon-action.btn-action-download:hover {
  background: #16a34a;
  color: #ffffff;
  border-color: #16a34a;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.35);
}

.btn-icon-action.btn-action-download:hover svg {
  stroke: #ffffff;
}

/* Highlight Hijau Khas untuk WhatsApp (Gaya Square Icon) */
.btn-icon-action.btn-action-whatsapp {
  color: #16a34a;
}

.btn-icon-action.btn-action-whatsapp svg {
  fill: #16a34a;
  stroke: none;
  transition: fill 0.15s ease;
}

.btn-icon-action.btn-action-whatsapp:hover {
  background: #16a34a;
  color: #ffffff;
  border-color: #16a34a;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.35);
}

.btn-icon-action.btn-action-whatsapp:hover svg {
  fill: #ffffff;
}

/* Highlight Hijau Khas untuk Sahkan Akaun */
.btn-icon-action.btn-action-approve {
  color: #16a34a;
}

.btn-icon-action.btn-action-approve svg {
  stroke: #16a34a;
}

.btn-icon-action.btn-action-approve:hover {
  background: #16a34a;
  color: #ffffff;
  border-color: #16a34a;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.35);
}

.btn-icon-action.btn-action-approve:hover svg {
  stroke: #ffffff;
}

/* Highlight Merah Khas untuk Tolak Akaun */
.btn-icon-action.btn-action-reject {
  color: #e11d48;
}

.btn-icon-action.btn-action-reject svg {
  stroke: #e11d48;
}

.btn-icon-action.btn-action-reject:hover {
  background: #e11d48;
  color: #ffffff;
  border-color: #e11d48;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(225, 29, 72, 0.35);
}

.btn-icon-action.btn-action-reject:hover svg {
  stroke: #ffffff;
}

/* Highlight Indigo Khas untuk Lihat Maklumat */
.btn-icon-action.btn-action-view:hover {
  background: #4f46e5;
  color: #ffffff;
  border-color: #4f46e5;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
}

.btn-icon-action.btn-action-view:hover svg {
  stroke: #ffffff;
}

.btn-action-delete {
  width: 34px;
  height: 34px;
  border-radius: 7px;
  background: #ffffff;
  color: #e11d48;
  border: 1.5px solid #cbd5e1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.btn-action-delete svg {
  stroke: #475569;
}

/* Directory Cards Grid */
.directory-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.user-profile-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.user-profile-card:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-user-info {
  display: flex;
  flex-direction: column;
}

.card-user-name {
  margin: 0 0 2px;
  font-size: 16px;
  font-weight: 800;
  color: var(--black-text);
}

.card-user-pos {
  margin: 0 0 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.card-user-dept {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-contact-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.card-contact-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-muted);
}

/* ==========================================================================
   Modals & Popups
   ========================================================================== */

.modal-backdrop-custom {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-box {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  max-width: 520px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}

.modal-header h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  color: var(--black-text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}

.modal-close-btn:hover {
  color: var(--red-primary);
}

.modal-body {
  padding: 22px 24px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  background: #f8fafc;
  border-top: 1px solid var(--line);
}

.user-detail-sheet {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sheet-row {
  display: flex;
  justify-content: space-between;
  font-size: 13.5px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.sheet-row span {
  color: var(--text-muted);
}

.sheet-row strong {
  color: var(--black-text);
}

/* ==========================================================================
   FOOTER RASMI (REKA BENTUK PERSIS GAMBAR PENGGUNA)
   ========================================================================== */

.app-footer-bar {
  margin-top: auto;
  border-top: 1px solid #e2e8f0;
  background: #ffffff;
  padding: 14px 28px;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.03);
  position: relative;
  z-index: 10;
}

.footer-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 24px;
  max-width: 1400px;
  margin: 0 auto;
}

.footer-left {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.footer-brand-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.footer-dot-accent {
  width: 9px;
  height: 9px;
  border-radius: var(--radius-full);
  background: #2563eb;
  display: inline-block;
  flex-shrink: 0;
  box-shadow: 0 0 8px rgba(37, 99, 235, 0.6);
}

.footer-sys-name {
  color: #0f172a;
  font-weight: 800;
  letter-spacing: -0.01em;
  font-size: 13.5px;
}

.footer-sep {
  color: #cbd5e1;
}

.footer-sys-sub {
  color: #64748b;
  font-size: 12.5px;
}

.footer-copyright-line {
  font-size: 11.5px;
  color: #94a3b8;
  padding-left: 17px;
}

.footer-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  text-align: right;
}

@media (max-width: 850px) {
  .footer-right {
    align-items: flex-start;
    text-align: left;
  }
}

.footer-credit-line {
  font-size: 12.5px;
  color: #64748b;
}

.credit-msk {
  color: #1e3a8a !important; /* Navy Blue */
  font-weight: 800;
  letter-spacing: 0.06em;
  background: rgba(30, 58, 138, 0.08);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid rgba(30, 58, 138, 0.2);
}

.footer-analytics-line {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #64748b;
  flex-wrap: wrap;
}

.footer-analytics-clickable {
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.7);
  border: 1px solid rgba(226, 232, 240, 0.8);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.footer-analytics-clickable:hover {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.analytics-chart-icon {
  font-size: 13px;
}

.analytics-label {
  font-weight: 700;
  color: #334155;
}

.analytics-item strong {
  color: #0f172a;
  font-weight: 800;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
}

.analytics-bar-divider {
  color: #cbd5e1;
  margin: 0 4px;
}

.analytics-online-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: #10b981;
  display: inline-block;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.8);
}

.analytics-online-text {
  color: #059669;
  font-weight: 700;
}

.analytics-online-text strong {
  color: #047857;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
}

.analytics-staff-text {
  color: #475569;
}

.analytics-staff-text strong {
  color: #1d4ed8;
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.22);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
}

.analytics-admin-text {
  color: #475569;
}

.analytics-admin-text strong {
  color: #0f172a;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
}

/* Split Layout (Kalis Limpahan Lebar pada Skrin Mudah Alih) */
.split {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 24px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.split > * {
  min-width: 0 !important;
  max-width: 100% !important;
}

@media (max-width: 991px) {
  .split {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 16px;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }
}

/* ==========================================================================
   Halaman Log Masuk & Daftar (Latar Belakang Faded polimas.jpg)
   ========================================================================== */

body.login-page-active {
  background: 
    linear-gradient(135deg, rgba(15, 23, 42, 0.82) 0%, rgba(20, 20, 32, 0.90) 100%),
    url('../images/polimas.jpg') center 82% / cover no-repeat fixed !important;
  min-height: 100vh;
  margin: 0;
  padding: 24px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Sembunyikan topbar, page-head dan footer global pada halaman login */
body.login-page-active .topbar,
body.login-page-active .page-head,
body.login-page-active .app-footer-bar {
  display: none !important;
}

body.login-page-active .public-main {
  width: 100%;
  max-width: 1080px;
  margin: auto;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ==========================================================================
   Split-Card Login Portal Layout (Match Gamba 2 Enterprise)
   ========================================================================== */

.login-split-container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-split-card {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  border-radius: 24px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 30px 70px -10px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.15);
  width: 100%;
  min-height: 630px;
}

/* LEFT PANEL: Hero Maroon/Crimson (Institutional Brand) */
.login-hero-panel {
  background: 
    linear-gradient(145deg, rgba(76, 5, 25, 0.94) 0%, rgba(136, 19, 55, 0.92) 50%, rgba(159, 18, 57, 0.94) 100%),
    url('../images/polimas.jpg') center 80% / cover no-repeat;
  color: #ffffff;
  padding: 44px 38px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
}

.hero-top-row {
  margin-bottom: 24px;
}

.hero-brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-full);
  padding: 6px 14px 6px 8px;
}

.hero-badge-img {
  height: 24px;
  width: auto;
  background: #ffffff;
  padding: 2px 6px;
  border-radius: 4px;
}

.hero-badge-title {
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #ffffff;
}

.hero-body {
  margin: auto 0;
}

.hero-tag-pill {
  display: inline-block;
  background: #e11d48;
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  margin-bottom: 16px;
  text-transform: uppercase;
  box-shadow: 0 4px 12px rgba(225, 29, 72, 0.35);
}

.hero-title {
  font-size: 27px;
  font-weight: 800;
  line-height: 1.25;
  margin: 0 0 14px;
  color: #ffffff;
  letter-spacing: -0.02em;
}

.hero-desc {
  font-size: 13.5px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.88);
  margin: 0 0 24px;
}

.hero-feature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.hero-feature-pill {
  display: flex;
  align-items: center;
  gap: 9px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(8px);
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
  transition: all 0.2s ease;
  cursor: help;
}

.hero-feature-pill:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.45);
  transform: translateY(-1px);
}

.feature-pill-icon {
  stroke: #ffffff;
  flex-shrink: 0;
}

.hero-footer-row {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 11.5px;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.75);
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  margin-top: 24px;
}

/* RIGHT PANEL: Modern Clean Form (Match Gamba 2) */
.login-form-panel {
  background: #ffffff;
  padding: 40px 38px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.portal-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.portal-logos {
  display: flex;
  align-items: center;
  background: #f8fafc;
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.portal-logo-polimas {
  height: 32px;
  width: auto;
}

.portal-header-meta {
  text-align: right;
  display: flex;
  flex-direction: column;
}

.portal-meta-title {
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
}

.portal-meta-sub {
  font-size: 11px;
  color: #64748b;
  font-weight: 600;
}

.login-welcome-title {
  font-size: 24px;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 4px;
  letter-spacing: -0.02em;
}

.login-welcome-sub {
  font-size: 13px;
  color: #64748b;
  margin: 0 0 18px;
}

.form-group-wrap {
  margin-bottom: 14px;
}

.input-lbl {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 6px;
}

.input-with-icon-modern {
  position: relative;
  display: flex;
  align-items: center;
}

.field-icon-modern {
  position: absolute;
  left: 14px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  pointer-events: none;
}

.modern-input {
  width: 100%;
  height: 44px;
  padding: 0 14px 0 42px;
  border-radius: 10px;
  border: 1.5px solid #e2e8f0;
  background: #f8fafc;
  font-size: 13.5px;
  font-family: inherit;
  color: #0f172a;
  transition: all 0.2s ease;
  outline: none;
}

.modern-input:focus {
  background: #ffffff;
  border-color: #991b1b;
  box-shadow: 0 0 0 3.5px rgba(153, 27, 27, 0.12);
}

.pwd-toggle-btn {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  display: flex;
  align-items: center;
  padding: 4px;
}

.pwd-toggle-btn:hover {
  color: #991b1b;
}

.btn-login-modern {
  width: 100%;
  height: 46px;
  background: linear-gradient(135deg, #991b1b 0%, #b91c1c 100%);
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(153, 27, 27, 0.35);
  transition: all 0.2s ease;
  margin-top: 16px;
}

.btn-login-modern:hover {
  background: linear-gradient(135deg, #7f1d1d 0%, #991b1b 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(153, 27, 27, 0.45);
}

.register-prompt-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 12px;
  font-size: 12.5px;
  color: #64748b;
}

.register-link-modern {
  color: #991b1b;
  font-weight: 700;
  text-decoration: none;
}

.register-link-modern:hover {
  text-decoration: underline;
}

/* Quick Demo Accounts */
.quick-accounts-section {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #f1f5f9;
}

.quick-accounts-label {
  font-size: 10.5px;
  font-weight: 800;
  color: #64748b;
  letter-spacing: 0.05em;
  display: block;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.quick-accounts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.quick-acc-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 9px 10px;
  cursor: pointer;
  transition: all 0.18s ease;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.quick-acc-card:hover {
  transform: translateY(-2px);
  background: #ffffff;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.card-superadmin:hover {
  border-color: #dc2626;
  background: #fef2f2;
}

.card-admin:hover {
  border-color: #2563eb;
  background: #eff6ff;
}

.card-user:hover {
  border-color: #10b981;
  background: #ecfdf5;
}

.quick-acc-top {
  display: flex;
  align-items: center;
  gap: 6px;
}

.quick-acc-name {
  font-size: 12px;
  font-weight: 700;
  color: #1e293b;
  white-space: nowrap;
}

.quick-acc-role {
  font-size: 10.5px;
  font-weight: 800;
  font-family: monospace;
  text-transform: lowercase;
}

.role-red { color: #dc2626; }
.role-blue { color: #2563eb; }
.role-green { color: #059669; }

.portal-footer-note {
  margin-top: 16px;
  text-align: center;
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.5;
}

/* ==========================================================================
   Tooltip & Hover Hint System
   ========================================================================== */

[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: #0f172a;
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.15);
  z-index: 1000;
}

[data-tooltip]::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  border: 5px solid transparent;
  border-top-color: #0f172a;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
}

[data-tooltip]:hover::after,
[data-tooltip]:hover::before {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 991px) {
  .login-split-card {
    grid-template-columns: 1fr;
  }
  .login-hero-panel {
    padding: 30px 24px;
  }
  .login-form-panel {
    padding: 30px 24px;
  }
  .quick-accounts-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   User Directory Tabs & Pending Badges
   ========================================================================== */
.user-directory-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 2px;
}

.tab-pill-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  font-size: 13.5px;
  font-weight: 700;
  color: #64748b;
  text-decoration: none;
  border-radius: 8px 8px 0 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s ease;
}

.tab-pill-link:hover {
  color: #0f172a;
  background: #f8fafc;
  text-decoration: none;
}

.tab-pill-link.active {
  color: var(--red-primary);
  border-bottom-color: var(--red-primary);
  background: #ffffff;
}

.tab-pill-count {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 12px;
  background: #e2e8f0;
  color: #475569;
}

.tab-pill-link.active .tab-pill-count {
  background: #fee2e2;
  color: var(--red-primary);
}

.tab-pill-count-danger {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 12px;
  background: #ef4444;
  color: #ffffff;
  animation: pulse-badge 1.8s infinite ease-in-out;
}

@keyframes pulse-badge {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.1); opacity: 0.85; }
}

.sidebar-badge-count {
  margin-left: auto;
  background: #ef4444;
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(239, 68, 68, 0.4);
}

/* ==========================================================================
   Footer Analytics Online Users Popover
   ========================================================================== */
.analytics-online-btn {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font-family: inherit;
  font-size: 11px;
  color: #475569;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: rgba(16, 185, 129, 0.5);
  transition: color 0.15s ease;
}

.analytics-online-btn:hover {
  color: #0f172a;
  text-decoration-color: #10b981;
}

.online-users-popover {
  position: absolute;
  bottom: calc(100% + 10px);
  right: 0;
  width: 280px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  box-shadow: 0 12px 28px -4px rgba(0, 0, 0, 0.2), 0 4px 10px -2px rgba(0, 0, 0, 0.1);
  z-index: 1050;
  text-align: left;
  overflow: hidden;
  font-size: 12px;
}

.popover-header {
  background: #0f172a;
  color: #ffffff;
  padding: 10px 14px;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--red-primary);
}

.popover-badge {
  background: #10b981;
  color: #ffffff;
  font-size: 10px;
  padding: 1px 7px;
  border-radius: 10px;
  font-weight: 800;
}

.popover-body {
  max-height: 220px;
  overflow-y: auto;
  padding: 8px 10px;
  background: #f8fafc;
}

.popover-user-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.popover-user-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 6px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.popover-user-item:hover {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
}

.online-dot-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 2.5px rgba(16, 185, 129, 0.25);
  flex-shrink: 0;
}

.popover-user-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.popover-user-name {
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
}

.popover-user-sub {
  font-size: 10.5px;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.popover-empty {
  padding: 16px;
  text-align: center;
  color: #94a3b8;
  font-size: 11.5px;
}

/* ==========================================================================
   Floating Quick Action Buttons (Home & Scroll Up)
   ========================================================================== */
.floating-quick-actions {
  position: fixed;
  bottom: 84px; /* Duduk kemas di atas bar footer (ketinggian footer ~60px), tidak ganggu teks footer */
  right: 22px;
  z-index: 990;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.fab-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2), 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  text-decoration: none;
  border: none;
  outline: none;
}

.fab-home {
  background: #0f172a;
  color: #ffffff;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
}

.fab-home:hover {
  background: var(--red-primary);
  color: #ffffff;
  transform: translateY(-3px) scale(1.08);
  box-shadow: 0 8px 22px rgba(220, 38, 38, 0.4);
}

.fab-scroll-up {
  background: #ffffff;
  color: #0f172a;
  border: 1.5px solid #cbd5e1;
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px) scale(0.9);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.fab-scroll-up.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.fab-scroll-up:hover {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
  transform: translateY(-3px) scale(1.08);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.4);
}

/* Tooltip on hover */
.fab-tooltip {
  position: absolute;
  right: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%) translateX(6px);
  background: #0f172a;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.fab-btn:hover .fab-tooltip {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}


/* =========================================================
   Go-Lupus UI Refinement Pack - 05/09/2026
   UI only: no business logic changes
   ========================================================= */

/* Dashboard / status cards: stronger highlight and selected state */
.dashboard-stat {
    position: relative;
    isolation: isolate;
    border: 1px solid #dbe4ef !important;
    box-shadow: 0 4px 14px rgba(15, 23, 42, .06) !important;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease !important;
}
.dashboard-stat:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(15, 23, 42, .11) !important;
}
.dashboard-stat.is-active {
    background: #f8fbff;
    border-color: #9ec5fe !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, .10), 0 8px 20px rgba(15, 23, 42, .08) !important;
}
.dashboard-stat.is-active::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, .08);
}

/* User directory action buttons: compact highlighted tiles instead of plain boxes */
.directory-action-cluster {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}
.directory-action-btn {
    width: 38px !important;
    height: 38px !important;
    border-radius: 10px !important;
    border: 1px solid #d8e2ee !important;
    background: #fff !important;
    box-shadow: 0 2px 6px rgba(15, 23, 42, .05) !important;
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, background .16s ease !important;
}
.directory-action-btn:hover:not(:disabled):not(.is-disabled) {
    transform: translateY(-2px);
    border-color: #93b4dd !important;
    background: #f4f8ff !important;
    box-shadow: 0 7px 16px rgba(15, 23, 42, .10) !important;
}
.directory-action-btn.btn-action-edit:hover { color: #2563eb !important; background: #eff6ff !important; border-color: #93c5fd !important; }
.directory-action-btn.btn-action-delete:hover { color: #dc2626 !important; background: #fef2f2 !important; border-color: #fecaca !important; }
.directory-action-btn.btn-action-whatsapp:hover { color: #16a34a !important; background: #f0fdf4 !important; border-color: #bbf7d0 !important; }
.directory-action-btn.is-disabled { background: #f8fafc !important; box-shadow: none !important; }

/* Admin review: cleaner top summary/header */
.review-topbar {
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}
.review-topbar-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.review-summary-card {
    padding: 0 !important;
    margin-bottom: 22px !important;
    overflow: hidden;
    border: 1px solid #dbe4ef !important;
    box-shadow: 0 4px 16px rgba(15, 23, 42, .05) !important;
}
.review-summary-wrap {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 0;
    flex-wrap: wrap;
}
.review-summary-grid {
    flex: 1 1 760px;
    display: grid;
    grid-template-columns: repeat(5, minmax(130px, 1fr));
}
.review-summary-item {
    padding: 18px 20px;
    border-right: 1px solid #edf2f7;
    min-width: 0;
}
.review-summary-item .muted.small {
    display: block;
    margin-bottom: 5px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .055em;
    text-transform: uppercase;
}
.review-summary-item strong { display: block; color: #0f172a; line-height: 1.35; }
.review-summary-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 14px 18px;
    background: #f8fafc;
    border-left: 1px solid #edf2f7;
    flex-wrap: wrap;
}
.badge-link { text-decoration: none !important; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease; }
.badge-link:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(15,23,42,.10); }
.review-count-link {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: #f1f5f9;
    border: 1px solid #dbe4ef;
    color: #0f172a;
    font-weight: 800;
    text-decoration: none;
}
.review-count-link:hover { background: #eaf2ff; border-color: #bfdbfe; color: #1d4ed8; }
.review-section-title { margin-bottom: 8px; }
#asset-review-table { scroll-margin-top: 96px; }

/* New application page */
.create-page-nav { max-width: 780px; margin: 0 auto 16px; }
.create-application-card {
    max-width: 780px;
    margin: 0 auto;
    padding: 0 !important;
    overflow: hidden;
    border-radius: 16px !important;
    border: 1px solid #dbe4ef !important;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .07) !important;
    background: #fff;
}
.create-application-header {
    margin: 0 !important;
    padding: 24px 28px 20px !important;
    border-bottom: 1px solid #edf2f7 !important;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}
.create-application-heading { display: flex; align-items: center; gap: 14px; }
.create-application-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: #fff1f2;
    border: 1px solid #fecdd3;
    color: #dc2626;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.create-application-card > form { padding: 26px 28px 30px; }
.create-application-card .form-group { padding: 0; }
.create-application-card .form-control {
    border-color: #cad6e4;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .02);
}
.create-application-card .readonly-control { background: #f4f7fb !important; }
.create-application-card .actions {
    padding-top: 18px;
    border-top: 1px solid #edf2f7;
}

/* Admin applications listing/filter */
.admin-applications-card {
    border: 1px solid #dbe4ef !important;
    box-shadow: 0 5px 18px rgba(15, 23, 42, .055) !important;
    overflow: hidden;
}
.admin-applications-header {
    padding-bottom: 18px;
    margin-bottom: 0 !important;
    border-bottom: 1px solid #edf2f7;
}
.polished-filter {
    margin: 20px 0 18px !important;
    padding: 18px !important;
    border: 1px solid #dbe4ef !important;
    background: #f8fafc !important;
    border-radius: 12px !important;
    display: grid !important;
    grid-template-columns: minmax(220px, 1.15fr) repeat(4, minmax(170px, 1fr)) auto;
    gap: 14px !important;
    align-items: end !important;
}
.polished-filter .form-group { margin: 0 !important; min-width: 0; }
.polished-filter label {
    display: block;
    margin-bottom: 7px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .045em;
    text-transform: uppercase;
    color: #475569;
}
.polished-filter .form-control {
    width: 100%;
    height: 42px;
    border-radius: 9px;
    border-color: #cbd5e1;
    background: #fff;
}
.polished-filter .filter-actions { display: flex; align-items: flex-end; }
.polished-filter .filter-actions .btn { height: 42px; white-space: nowrap; }
.admin-applications-card .table-wrap {
    border: 1px solid #e2e8f0;
    border-radius: 11px;
    overflow: auto;
}
.admin-applications-card .data-table thead th { background: #f8fafc; }
.admin-applications-card .data-table tbody tr { transition: background .14s ease; }
.admin-applications-card .data-table tbody tr:hover { background: #fbfdff; }
.table-action-btn {
    min-width: 112px;
    justify-content: center;
    border-radius: 9px !important;
    box-shadow: 0 2px 6px rgba(37, 99, 235, .12);
}
.table-action-btn:hover { transform: translateY(-1px); box-shadow: 0 7px 14px rgba(37, 99, 235, .18); }

/* Admin Review Action Buttons Bar */
.admin-review-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 24px;
    align-items: center;
}
.admin-review-actions .btn {
    min-height: 42px;
    padding: 0 18px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    font-weight: 700;
}
.admin-review-actions .btn-print-kewpa {
    margin-left: auto;
}

@media (max-width: 1180px) {
    .polished-filter { grid-template-columns: repeat(3, minmax(180px, 1fr)); }
    .review-summary-grid { grid-template-columns: repeat(3, minmax(150px, 1fr)); }
    .header-datetime-widget .datetime-date-val { display: none !important; }
    .header-datetime-widget { padding: 4px 10px 4px 6px !important; margin-right: 10px !important; }
}

@media (max-width: 768px) {
    /* 1. App Shell & Main Layout Overflow Protection */
    .app-shell, .main-column, .content, .public-column, .public-main {
        max-width: 100% !important;
        width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }
    .content {
        padding: 14px 12px 36px !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }

    /* 2. Topbar Mobile (Clean, Overflow-Free & Compact) */
    .header-datetime-widget {
        display: none !important; /* Kekalkan header mobile bersih & ringkas tanpa serabut */
    }
    .topbar {
        height: 60px !important;
        padding: 0 12px !important;
    }
    .brand-wrap {
        gap: 8px !important;
        min-width: 0 !important;
        flex: 1 1 auto !important;
    }
    .brand {
        gap: 8px !important;
        min-width: 0 !important;
    }
    .header-logo.logo-polimas {
        height: 30px !important;
        max-width: 85px !important;
    }
    .brand-info {
        padding-left: 8px !important;
        min-width: 0 !important;
    }
    .brand-name {
        font-size: 16px !important;
    }
    .brand-badge {
        font-size: 9px !important;
        padding: 1px 5px !important;
    }
    .brand-sub {
        display: none !important;
    }
    .sidebar-toggle-btn {
        width: 36px !important;
        height: 36px !important;
        flex-shrink: 0 !important;
    }
    .user-area {
        gap: 8px !important;
        flex-shrink: 0 !important;
    }
    .user-pill {
        padding: 0 !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
    }
    .user-pill .user-meta,
    .user-pill svg {
        display: none !important;
    }
    .user-avatar {
        width: 34px !important;
        height: 34px !important;
        font-size: 13px !important;
    }
    .btn-logout {
        padding: 0 !important;
        width: 36px !important;
        height: 36px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        border-radius: 8px !important;
    }
    .btn-logout span {
        display: none !important;
    }
    .btn-logout svg {
        width: 17px !important;
        height: 17px !important;
        margin: 0 !important;
    }

    /* 3. Page Header & Eyebrow */
    .page-head {
        margin-bottom: 16px !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 4px !important;
    }
    .page-head h1 {
        font-size: 18px !important;
        line-height: 1.35 !important;
        word-break: break-word !important;
        hyphens: auto;
    }
    .page-head .eyebrow {
        font-size: 10.5px !important;
        margin-bottom: 2px !important;
        letter-spacing: 0.05em !important;
    }

    /* 4. Cards & Section Padding */
    .card {
        padding: 16px 14px !important;
        margin-bottom: 16px !important;
        border-radius: 10px !important;
        min-width: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    .card-title {
        margin-bottom: 14px !important;
    }
    .card-title h2, .card-title h3 {
        font-size: 15px !important;
    }

    /* 4b. Stat Grid Mobile (2x2 Grid Padat & Kemas) */
    .stats {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
        margin-bottom: 16px !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }
    .stat {
        padding: 12px 10px !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }
    .stat span {
        font-size: 11px !important;
    }
    .stat strong {
        font-size: 20px !important;
    }
    .stat small, .stat-arrow-indicator {
        display: none !important;
    }

    /* 4c. Butang Aliran Kerja Kad Tepi (Full-width Center Touch) */
    aside.card .btn {
        width: 100% !important;
        justify-content: center !important;
        text-align: center !important;
        box-sizing: border-box !important;
        min-height: 44px !important;
        font-size: 13px !important;
    }

    /* 5. Topbar Action Buttons (Senarai Permohonan / Papan Pemuka) */
    .review-topbar,
    .application-view-topbar {
        margin-bottom: 14px !important;
        gap: 10px !important;
    }
    .review-topbar-actions {
        display: flex !important;
        gap: 8px !important;
        width: 100% !important;
    }
    .review-topbar-actions .btn {
        flex: 1 1 auto !important;
        justify-content: center !important;
        font-size: 12px !important;
        padding: 8px 10px !important;
        text-align: center !important;
    }

    /* 6. Form & Review Action Buttons (Full-width touch blocks) */
    .admin-review-actions,
    .section-actions {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        gap: 10px !important;
        margin-top: 18px !important;
    }
    .admin-review-actions .btn,
    .admin-review-actions form,
    .section-actions .btn,
    .section-actions form {
        width: 100% !important;
    }
    .admin-review-actions .btn,
    .section-actions .btn {
        min-height: 46px !important;
        height: auto !important;
        padding: 11px 16px !important;
        justify-content: center !important;
        font-size: 13.5px !important;
        font-weight: 700 !important;
        text-align: center !important;
        margin-left: 0 !important;
    }

    /* 7. Tables & Horizontal Scrolling */
    .table-wrap {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        max-width: 100% !important;
        width: 100% !important;
        min-width: 0 !important;
        border-radius: 8px !important;
        box-sizing: border-box !important;
        display: block !important;
    }
    /* Elak jadual dihimpit hancur pada telefon: beri min-width agar scroll berfungsi kemas */
    .table-wrap > .data-table {
        min-width: 760px !important;
    }
    /* Jadual aset & staging banyak lajur (12-14 lajur): beri ruang secukupnya untuk skrol sentuh telefon */
    .table-wrap > .asset-table,
    .table-wrap > #stagingAssetsTable,
    .table-wrap > #assetDataTable {
        min-width: 1200px !important;
    }
    .data-table th, .data-table td {
        padding: 8px 10px !important;
        white-space: nowrap;
    }
    /* Pastikan lajur teks panjang (Keterangan, Justifikasi, Catatan) membalut teks dengan kemas dan tidak bertindih */
    .data-table td.wrap-cell,
    .data-table th.wrap-cell,
    .data-table td.col-desc,
    .data-table td.col-justifikasi,
    .data-table td.col-name,
    .data-table td.col-dept,
    .asset-table td.wrap-cell,
    .asset-table th.wrap-cell,
    .asset-table td.col-desc,
    .asset-table td.col-justifikasi {
        white-space: normal !important;
        word-break: break-word !important;
        overflow-wrap: break-word !important;
    }
    /* Di telefon pintar, lepaskan sticky columns supaya tidak menutup separuh skrin */
    .asset-table th.sticky-col-1,
    .asset-table td.sticky-col-1,
    .asset-table th.sticky-col-2,
    .asset-table td.sticky-col-2 {
        position: static !important;
        box-shadow: none !important;
    }
    .data-table td {
        font-size: 12px !important;
    }
    .data-table th {
        font-size: 10.5px !important;
    }
    .mobile-swipe-tip {
        display: flex !important;
        align-items: center;
        gap: 6px;
        background: #eff6ff;
        border: 1px solid #bfdbfe;
        border-radius: 6px;
        padding: 6px 10px;
        font-size: 11px;
        color: #1e40af;
        margin-bottom: 10px;
    }

    /* 8. Existing Card / Filter Rules */
    .polished-filter { grid-template-columns: 1fr !important; }
    .review-summary-grid { grid-template-columns: 1fr 1fr !important; }
    .review-summary-actions { width: 100% !important; border-left: 0 !important; border-top: 1px solid #edf2f7 !important; }
    .create-application-card > form { padding: 22px 18px 24px !important; }
    .create-application-header { padding: 20px 18px 17px !important; }

    /* 9. Footer Mobile Layout */
    .app-footer-bar {
        padding: 16px 14px !important;
    }
    .footer-container {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        gap: 12px !important;
    }
    .footer-left,
    .footer-right {
        align-items: center !important;
        text-align: center !important;
        width: 100% !important;
    }
    .footer-brand-line {
        justify-content: center !important;
        flex-wrap: wrap !important;
        gap: 4px 8px !important;
    }
    .footer-copyright-line {
        padding-left: 0 !important;
        text-align: center !important;
        font-size: 11px !important;
    }
    .footer-credit-line {
        text-align: center !important;
        font-size: 11.5px !important;
    }
    .footer-analytics-line {
        justify-content: center !important;
        text-align: center !important;
        gap: 6px 8px !important;
    }
}

@media (max-width: 520px) {
    .brand-name { font-size: 15px !important; }
    .header-logo.logo-polimas { height: 26px !important; max-width: 75px !important; }

    .review-summary-grid { grid-template-columns: 1fr !important; }
    .review-summary-item { border-right: 0 !important; border-bottom: 1px solid #edf2f7 !important; }
    .directory-action-cluster { gap: 5px !important; }
    .directory-action-btn { width: 36px !important; height: 36px !important; }

    /* Footer Clean Modern Badges on Small Mobile */
    .footer-brand-line .footer-sep {
        display: none !important;
    }
    .footer-sys-sub {
        display: block !important;
        width: 100% !important;
        font-size: 11.5px !important;
    }
    .footer-analytics-line {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 6px !important;
        font-size: 11px !important;
    }
    .footer-analytics-line .analytics-dot,
    .footer-analytics-line .analytics-bar-divider {
        display: none !important;
    }
    .footer-analytics-line .analytics-item,
    .footer-analytics-line .analytics-online-wrapper,
    .footer-analytics-line .analytics-staff-text,
    .footer-analytics-line .analytics-admin-text {
        display: inline-flex !important;
        align-items: center !important;
        background: #f8fafc !important;
        border: 1px solid #e2e8f0 !important;
        padding: 3px 8px !important;
        border-radius: 6px !important;
    }
    .floating-quick-actions {
        bottom: 18px !important;
        right: 12px !important;
    }
    .fab-btn {
        width: 36px !important;
        height: 36px !important;
    }
}

/* ==========================================================================
   Visitor Analytics & Online Users Modal Dialog (Gempak & Interaktif)
   Padanan Tepat Gambaran Rujukan (media_1788606733614.png)
   ========================================================================== */

body.visitor-modal-open {
    overflow: hidden !important;
}

.visitor-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 16px;
    animation: visitorModalFadeIn 0.22s ease-out;
}

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

@keyframes visitorModalSlideUp {
    from {
        opacity: 0;
        transform: translateY(14px) scale(0.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.visitor-modal-dialog {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 25px 60px -15px rgba(15, 23, 42, 0.35), 0 0 0 1px rgba(15, 23, 42, 0.06);
    width: 100%;
    max-width: 1060px;
    max-height: calc(100vh - 48px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: visitorModalSlideUp 0.26s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Header Modal */
.visitor-modal-header {
    padding: 24px 28px 20px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid #f1f5f9;
    background: #ffffff;
}

.visitor-modal-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.visitor-modal-header-icon {
    font-size: 22px;
    line-height: 1;
}

.visitor-modal-title {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
    color: #1e293b;
    letter-spacing: -0.02em;
}

.visitor-modal-subtitle {
    margin: 0;
    font-size: 13px;
    color: #64748b;
    line-height: 1.45;
}

.visitor-modal-subtitle code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12px;
    background: #f1f5f9;
    padding: 1px 6px;
    border-radius: 4px;
    color: #475569;
}

.visitor-modal-close-btn {
    background: #f1f5f9;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    line-height: 1;
    color: #64748b;
    cursor: pointer;
    transition: all 0.18s ease;
    flex-shrink: 0;
}

.visitor-modal-close-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
    transform: scale(1.06);
}

/* Toolbar & Tabs */
.visitor-modal-toolbar {
    padding: 14px 28px;
    background: #f8fafc;
    border-bottom: 1px solid #edf2f7;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.visitor-modal-tabs {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.visitor-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 700;
    color: #475569;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.visitor-tab-btn:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.visitor-tab-btn.active {
    background: #0284c7;
    border-color: #0284c7;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.28);
}

.visitor-tab-btn.active strong,
.visitor-tab-btn.active span {
    color: #ffffff;
}

.visitor-tab-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #10b981;
    display: inline-block;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85);
}

.visitor-tab-btn.active .visitor-tab-dot {
    background: #34d399;
}

.visitor-tab-icon {
    font-size: 14px;
}

/* Refresh Button */
.visitor-refresh-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
    cursor: pointer;
    transition: all 0.18s ease;
}

.visitor-refresh-btn:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05);
}

.visitor-refresh-btn.refreshing .refresh-spinner-svg {
    animation: visitorSpin 0.75s linear infinite;
}

@keyframes visitorSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Modal Body */
.visitor-modal-body {
    flex: 1 1 auto;
    overflow-y: auto;
    background: #ffffff;
    padding: 0;
}

.visitor-tab-panel {
    display: none;
}

.visitor-tab-panel.active {
    display: block;
}

.visitor-table-wrapper {
    overflow-x: auto;
    width: 100%;
}

/* Analytics Table */
.visitor-analytics-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
}

.visitor-analytics-table th {
    background: #f8fafc;
    color: #475569;
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 14px 20px;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}

.visitor-analytics-table td {
    padding: 14px 20px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
    color: #334155;
}

.visitor-analytics-table tbody tr {
    transition: background-color 0.15s ease;
}

.visitor-analytics-table tbody tr:hover {
    background-color: #f8fafc;
}

/* Status Online Pill with Pulse */
.visitor-status-online {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: #059669;
    font-size: 13px;
}

.visitor-status-dot {
    position: relative;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #10b981;
    display: inline-block;
}

.visitor-status-dot::after {
    content: "";
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.4);
    animation: visitorPulse 1.8s infinite;
}

@keyframes visitorPulse {
    0% { transform: scale(1); opacity: 0.9; }
    50% { transform: scale(1.65); opacity: 0; }
    100% { transform: scale(1); opacity: 0; }
}

/* User Info Cell */
.visitor-user-cell {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.visitor-user-fullname {
    font-size: 13.5px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.35;
}

.visitor-user-id {
    font-size: 11.5px;
    color: #64748b;
    font-family: inherit;
}

.visitor-guest-name {
    font-size: 13px;
    font-weight: 700;
    color: #64748b;
}

/* Role Badge */
.visitor-role-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    border: 1px solid;
    white-space: nowrap;
}

.visitor-role-icon {
    font-size: 12px;
    line-height: 1;
}

/* Dept & Page Pills */
.visitor-dept-highlight {
    font-weight: 800;
    color: #0284c7;
    font-size: 13px;
}

.visitor-dept-text {
    font-weight: 600;
    color: #475569;
    font-size: 12.5px;
}

.visitor-page-pill {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 6px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    font-size: 11.5px;
    font-weight: 700;
    color: #475569;
    white-space: nowrap;
}

/* Time & Device */
.visitor-time-text {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    white-space: nowrap;
}

.visitor-device-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.visitor-ip-badge {
    font-family: ui-monospace, monospace;
    font-size: 11.5px;
    font-weight: 700;
    color: #334155;
}

.visitor-device-sub {
    font-size: 11px;
    color: #94a3b8;
}

/* Empty State */
.visitor-empty-state {
    padding: 45px 20px;
    text-align: center;
}

.visitor-empty-icon {
    font-size: 38px;
    margin-bottom: 12px;
}

.visitor-empty-state h4 {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: 800;
    color: #1e293b;
}

.visitor-empty-state p {
    margin: 0;
    font-size: 13px;
    color: #64748b;
}

/* Footer Modal */
.visitor-modal-footer {
    padding: 16px 28px;
    background: #ffffff;
    border-top: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.visitor-footer-meta {
    font-size: 12.5px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 6px;
}

.visitor-footer-bolt {
    color: #f59e0b;
    font-size: 14px;
}

.visitor-footer-meta code {
    font-family: ui-monospace, monospace;
    font-size: 11.5px;
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    color: #334155;
}

.visitor-modal-btn-close {
    padding: 8px 20px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    font-size: 13.5px;
    font-weight: 700;
    color: #1e293b;
    cursor: pointer;
    transition: all 0.18s ease;
}

.visitor-modal-btn-close:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

/* Responsive Modal for Tablets & Mobiles */
@media (max-width: 768px) {
    .visitor-modal-dialog {
        max-height: 94vh;
        border-radius: 16px;
    }
    .visitor-modal-header {
        padding: 18px 20px 16px;
    }
    .visitor-modal-title {
        font-size: 17px;
    }
    .visitor-modal-toolbar {
        padding: 12px 20px;
    }
    .visitor-modal-footer {
        padding: 14px 20px;
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    .visitor-footer-meta {
        justify-content: center;
    }
}

/* =========================================================
   SESSION IDLE TIMEOUT — subtle, polished, no layout shift
   ========================================================= */
.session-timeout-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.28);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .2s ease, visibility .2s ease;
}

.session-timeout-overlay.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.session-timeout-card {
  width: min(440px, 100%);
  display: flex;
  gap: 16px;
  padding: 22px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
  transform: translateY(8px) scale(.985);
  transition: transform .2s ease;
}

.session-timeout-overlay.visible .session-timeout-card {
  transform: translateY(0) scale(1);
}

.session-timeout-icon {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  color: var(--red-primary);
  background: #fff1f2;
  border: 1px solid #ffe4e6;
}

.session-timeout-copy { min-width: 0; }
.session-timeout-kicker {
  display: block;
  margin-bottom: 3px;
  color: var(--red-primary);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .12em;
}
.session-timeout-copy h3 {
  margin: 0 0 5px;
  color: #0f172a;
  font-size: 18px;
  line-height: 1.25;
}
.session-timeout-copy p {
  margin: 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.55;
}
.session-timeout-countdown {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  margin: 12px 0 10px;
  color: #0f172a;
}
.session-timeout-countdown span {
  font-size: 32px;
  line-height: 1;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.04em;
}
.session-timeout-countdown small {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}
.session-timeout-note {
  font-size: 11.5px !important;
  color: #94a3b8 !important;
}

@media (max-width: 575.98px) {
  .session-timeout-card { padding: 18px; gap: 12px; border-radius: 16px; }
  .session-timeout-icon { width: 42px; height: 42px; flex-basis: 42px; border-radius: 12px; }
}

/* =========================================================
   PAPAN PEMUKA EKSEKUTIF & CARTA JKPAK (ADMIN DASHBOARD)
   ========================================================= */
.executive-analytics-section {
    margin-top: 24px;
    margin-bottom: 24px;
    padding: 22px 24px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.03);
}

.executive-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f1f5f9;
}

.executive-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 10.5px;
    font-weight: 800;
    color: #1d4ed8;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    padding: 3px 9px;
    border-radius: 6px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.executive-title-group h2 {
    margin: 0 0 4px 0;
    font-size: 19px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.01em;
}

.executive-filter-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.filter-item label {
    font-size: 11.5px;
    font-weight: 700;
    color: #64748b;
    margin: 0;
}

.filter-item select {
    padding: 6px 12px;
    font-size: 12.5px;
    font-weight: 600;
    color: #1e293b;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.filter-item select:focus {
    border-color: #3b82f6;
    background: #ffffff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* 4 Riben KPI Eksekutif */
.executive-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 22px;
}

.kpi-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.05);
}

.kpi-card-blue {
    background: linear-gradient(135deg, #ffffff 0%, #eff6ff 100%);
    border-color: #dbeafe;
}

.kpi-card-emerald {
    background: linear-gradient(135deg, #ffffff 0%, #ecfdf5 100%);
    border-color: #d1fae5;
}

.kpi-card-purple {
    background: linear-gradient(135deg, #ffffff 0%, #faf5ff 100%);
    border-color: #ede9fe;
}

.kpi-card-amber {
    background: linear-gradient(135deg, #ffffff 0%, #fffbeb 100%);
    border-color: #fef3c7;
}

.kpi-icon {
    font-size: 26px;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.kpi-meta {
    min-width: 0;
    flex: 1;
}

.kpi-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kpi-value {
    display: block;
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.25;
}

.kpi-value small {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
}

.kpi-sub {
    display: block;
    font-size: 10.5px;
    color: #94a3b8;
    margin-top: 2px;
}

/* Kanvas 2 Carta Eksekutif */
.executive-charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.chart-box {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px 18px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    min-width: 0;
    overflow: hidden;
}

.chart-box-header {
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f8fafc;
}

.chart-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chart-title-icon {
    font-size: 20px;
}

.chart-title h4 {
    margin: 0 0 2px 0;
    font-size: 14.5px;
    font-weight: 700;
    color: #0f172a;
}

.chart-canvas-wrap {
    position: relative;
    height: 280px;
    width: 100%;
}

.executive-empty-state {
    padding: 38px 20px;
    text-align: center;
    background: #f8fafc;
    border: 1.5px dashed #cbd5e1;
    border-radius: 12px;
    margin-top: 6px;
}

.executive-empty-state .empty-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.executive-empty-state h4 {
    margin: 0 0 4px 0;
    font-size: 15px;
    font-weight: 700;
    color: #334155;
}

.executive-empty-state p {
    margin: 0;
    font-size: 12.5px;
    color: #64748b;
}

@media (max-width: 1100px) {
    .executive-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 900px) {
    .executive-charts-grid {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 14px !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }
    .executive-charts-grid > * {
        min-width: 0 !important;
        max-width: 100% !important;
    }
    .chart-canvas-wrap {
        height: 260px;
    }
}

@media (max-width: 600px) {
    .executive-analytics-section {
        padding: 14px 10px !important;
        min-width: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    .chart-box {
        padding: 12px 10px !important;
        min-width: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    .chart-canvas-wrap {
        height: 250px !important;
        min-width: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
    }
    .chart-title h4 {
        font-size: 13px !important;
    }
    .chart-title small {
        font-size: 10.5px !important;
    }
    .executive-kpi-grid {
        grid-template-columns: 1fr !important;
    }
    .executive-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .executive-filter-controls {
        width: 100%;
    }
    .filter-item {
        flex: 1 1 100%;
    }
    .filter-item select {
        width: 100%;
    }
}

/* ==========================================================================
   ANDROID & MOBILE HARDWARE ACCELERATION (ZERO DESIGN CHANGE)
   Memastikan scrolling 60 FPS lancar di telefon bimbit tanpa mengubah rupa bentuk atau fon
   ========================================================================== */
@media (max-width: 768px) {
    html, body {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-y: none;
    }
    
    .table-wrap,
    .table-responsive,
    .visitor-table-wrapper,
    .chart-canvas-wrap {
        -webkit-overflow-scrolling: touch;
        transform: translateZ(0);
    }

    .card,
    .chart-box,
    .kpi-card,
    .stat-card {
        transform: translateZ(0);
        backface-visibility: hidden;
    }
}

