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

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

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

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

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

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

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

/* ==================== TOPBAR & TOP NAVIGATION ==================== */
.topbar {
  height: var(--topbar-height);
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 3.5px;
  z-index: 50;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.topbar-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 20px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

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

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

.brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.brand-logo-img {
  height: 38px;
  width: auto;
  object-fit: contain;
}

.brand-text-block {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.brand-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary-navy);
  letter-spacing: -0.4px;
  line-height: 1;
}

.brand-title span {
  color: var(--gold-amber);
}

.brand-sub {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.3px;
}

/* Navigasi Utama di Header */
.top-nav-bar {
  display: flex;
  align-items: center;
  margin-left: 20px;
  margin-right: auto;
}

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

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

.top-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 13px;
  height: 38px;
  border-radius: var(--radius-sm);
  color: #475569;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

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

.top-nav-item.active .top-nav-link {
  color: var(--royal-blue);
  background: var(--royal-blue-light);
  border-color: var(--royal-blue-border);
  box-shadow: 0 1px 3px rgba(30, 58, 138, 0.08);
  font-weight: 700;
}

.top-nav-item.active .top-nav-link .nav-svg-icon {
  stroke: var(--royal-blue-bright);
}

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

/* Nav Dropdown Menu (Kemas & Responsif) */
.nav-has-dropdown {
  position: relative;
}

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

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

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

.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 250px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.12);
  padding: 8px;
  z-index: 100;
  animation: dropdownFadeIn 0.15s ease;
}

.nav-has-dropdown:hover .nav-dropdown-menu,
.nav-has-dropdown:focus-within .nav-dropdown-menu,
.nav-has-dropdown.show-dropdown .nav-dropdown-menu {
  display: block;
}

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

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

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

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

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

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

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

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

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
  white-space: nowrap;
}

/* Header Live Clock (Teks Bersih Bebas Kotak & Garisan) */
.header-live-clock {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
  font-size: 12.5px;
  white-space: nowrap;
}

.clock-date {
  font-weight: 600;
  color: #334155;
  letter-spacing: 0.2px;
}

.clock-sep {
  color: #94a3b8;
  font-weight: 700;
  font-size: 11px;
}

.clock-time {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 700;
  color: #1d4ed8;
  letter-spacing: 0.3px;
}

/* User Profile Pill & Dropdown */
.user-dropdown-wrapper {
  position: relative;
}

.user-dropdown-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 12px 4px 5px;
  border: 1px solid var(--border-color);
  border-radius: 40px;
  background: #ffffff;
  color: var(--primary-navy);
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

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

.user-meta-pill {
  display: flex;
  flex-direction: column;
  text-align: left;
  line-height: 1.15;
}

.user-name-short {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--primary-navy);
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-dept-tag {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

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

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

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

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

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

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

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

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

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

.badge-pill-navy {
  font-size: 10px;
  font-weight: 700;
  background: #0f172a;
  color: #ffffff;
  padding: 2px 8px;
  border-radius: 4px;
  display: inline-block;
}

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

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

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

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

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

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

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

/* Responsive Mobile Navigation */
@media (max-width: 991px) {
  .mobile-nav-toggle-btn {
    display: flex;
  }
  
  .top-nav-bar {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border-bottom: 2px solid #fbbf24;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    padding: 14px 20px;
    display: none;
    margin: 0;
    z-index: 99;
  }
  
  .top-nav-bar.show-mobile {
    display: block;
  }
  
  .top-nav-menu {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  
  .top-nav-link {
    padding: 10px 14px;
    width: 100%;
  }

  .header-live-clock {
    display: none;
  }

  .user-meta-pill {
    display: none;
  }
}

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

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

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

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

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

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

.btn-table-action.active {
  background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  border-color: #1e40af;
  box-shadow: 0 2px 5px rgba(29, 78, 216, 0.25);
}

/* Shaded Button Variants */
.btn-sample-view, .btn-shaded-blue {
  background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%) !important;
  color: #1e40af !important;
  border: 1px solid #bfdbfe !important;
  font-weight: 700 !important;
  box-shadow: 0 1px 3px rgba(30, 64, 175, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.6) !important;
}

.btn-sample-view:hover, .btn-shaded-blue:hover {
  background: linear-gradient(180deg, #dbeafe 0%, #bfdbfe 100%) !important;
  border-color: #93c5fd !important;
  color: #1e3a8a !important;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(30, 64, 175, 0.2) !important;
}

.btn-print-all, .btn-shaded-danger {
  background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%) !important;
  color: #ffffff !important;
  border: 1px solid #b91c1c !important;
  font-weight: 700 !important;
  box-shadow: 0 2px 5px rgba(220, 38, 38, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
}

.btn-print-all:hover, .btn-shaded-danger:hover {
  background: linear-gradient(180deg, #dc2626 0%, #b91c1c 100%) !important;
  border-color: #991b1b !important;
  color: #ffffff !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(220, 38, 38, 0.35) !important;
}

.btn-shaded-success {
  background: linear-gradient(180deg, #16a34a 0%, #15803d 100%) !important;
  color: #ffffff !important;
  border: 1px solid #166534 !important;
  font-weight: 700 !important;
  box-shadow: 0 2px 5px rgba(22, 163, 74, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
}

.btn-shaded-success:hover {
  background: linear-gradient(180deg, #15803d 0%, #166534 100%) !important;
  border-color: #14532d !important;
  color: #ffffff !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(22, 163, 74, 0.35) !important;
}

.btn-shaded-amber {
  background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%) !important;
  color: #ffffff !important;
  border: 1px solid #b45309 !important;
  font-weight: 700 !important;
  box-shadow: 0 2px 5px rgba(245, 158, 11, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
}

.btn-shaded-amber:hover {
  background: linear-gradient(180deg, #d97706 0%, #b45309 100%) !important;
  border-color: #92400e !important;
  color: #ffffff !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(245, 158, 11, 0.35) !important;
}

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

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

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

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

.btn-text-action {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 6px !important;
  border-radius: 4px;
  transition: background 0.15s ease, opacity 0.15s ease;
}

.btn-text-action:hover {
  background: rgba(0, 0, 0, 0.05) !important;
  opacity: 0.85;
}

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

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

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

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

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

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

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

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

/* ==================== DASHBOARD & CARDS ==================== */
.page-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

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

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

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

.kpi-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
  border-color: #cbd5e1;
}

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

/* Top Accent Strips */
.kpi-card-blue   { border-top: 3.5px solid #2563eb; }
.kpi-card-amber  { border-top: 3.5px solid #f59e0b; }
.kpi-card-green  { border-top: 3.5px solid #10b981; }
.kpi-card-indigo { border-top: 3.5px solid #6366f1; }

.kpi-info-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.kpi-val {
  font-size: 28px;
  font-weight: 800;
  color: var(--primary-navy);
  margin-top: 4px;
  line-height: 1;
}

.kpi-subtext {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

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

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

/* ==================== CARD SECTIONS ==================== */
.card-section {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  margin-bottom: 22px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

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

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

/* ==================== TABLES ==================== */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: #ffffff;
}

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

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

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

.data-table tr:hover td {
  background: #f8fafc;
}

.table-link-title {
  color: var(--primary-navy);
  text-decoration: none;
  font-weight: 700;
  transition: color 0.15s;
}

.table-link-title:hover {
  color: var(--royal-blue);
}

/* Jadual Peserta Padat & Fit Skrin (Tanpa Skrol Kiri-Kanan) */
.participants-fit-table th {
  padding: 9px 10px;
  font-size: 11px;
}

.participants-fit-table td {
  padding: 8px 10px;
  font-size: 12.5px;
}

.participants-fit-table .btn-text-action {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.participants-fit-table .btn-text-action:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  transform: scale(1.15);
}

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

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

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

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

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

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

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

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

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

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

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

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

.form-control, .form-select, select.form-control {
  width: 100%;
  padding: 9px 13px;
  font-size: 13px;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--text-main);
  outline: none;
  transition: all 0.2s;
}

.form-control:focus, .form-select:focus {
  border-color: var(--gold-amber);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

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

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

.form-control-compact:focus {
  border-color: var(--gold-amber);
}

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

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

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

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

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

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

.footer-sep {
  color: #cbd5e1;
}

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

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

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

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

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

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

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

.stat-sep {
  color: #cbd5e1;
}

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

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

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

.visitor-modal-dialog {
  background: #ffffff;
  border-radius: var(--radius-md);
  width: 100%;
  max-width: 850px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
}

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

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

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

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

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

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

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

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

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

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

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

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

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

/* ==================== BUTANG HIJAU EXCEL / CSV ==================== */
.btn-excel-green {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
  background: linear-gradient(180deg, #16a34a 0%, #107c41 100%);
  color: #ffffff !important;
  border: 1px solid #0e6b37;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 6px rgba(16, 124, 65, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-excel-green:hover {
  background: linear-gradient(180deg, #15803d 0%, #14532d 100%);
  border-color: #166534;
  color: #ffffff !important;
  transform: translateY(-1.5px);
  box-shadow: 0 4px 12px rgba(16, 124, 65, 0.35);
}

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


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

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

.profile-card-left {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px 20px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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