:root {
  --apm-orange: #f26522;
  --apm-orange-dark: #d44e0e;
  --apm-blue: #0b2545;
  --bg-surface: #f4f6fa;
  --card-bg: #ffffff;
  --text-dark: #0f172a;
  --text-muted: #64748b;
  --border-subtle: #e2e8f0;
  
  --header-height: 64px;
  --bottom-bar-height: 68px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Plus Jakarta Sans', sans-serif;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  position: fixed;
  background-color: #0b1329;
}

.mobile-container {
  width: 100%;
  max-width: 430px;
  height: 100%;
  margin: 0 auto;
  background-color: var(--bg-surface);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

@media (min-width: 450px) {
  html, body {
    position: static;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  .mobile-container {
    height: 880px;
    border-radius: 28px;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.4);
    border: 6px solid #1e293b;
  }
}

.view-screen {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.hidden { display: none !important; }

/* --- LOG MASUK --- */
#login-view {
  justify-content: center;
  padding: 1.5rem;
  overflow-y: auto;
}

.auth-box {
  background-color: var(--card-bg);
  padding: 2rem 1.5rem;
  border-radius: 20px;
  border: 1px solid var(--border-subtle);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.brand-section { text-align: center; margin-bottom: 1.5rem; }
.logo-img { width: 80px; height: auto; display: block; margin: 0 auto 1rem; }
.brand-section h1 { font-size: 1.6rem; font-weight: 700; color: var(--apm-blue); }
.brand-section p { font-size: 0.85rem; color: var(--text-muted); }

.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--text-dark); margin-bottom: 0.4rem; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1.5px solid var(--border-subtle);
  border-radius: 10px;
  font-size: 1rem;
  background-color: #ffffff;
  color: var(--text-dark);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--apm-orange);
  box-shadow: 0 0 0 3px rgba(242, 101, 34, 0.15);
}

.form-options { display: flex; align-items: center; margin-bottom: 1.2rem; }
.remember-label { display: flex; align-items: center; gap: 0.5rem; font-size: 0.82rem; color: var(--text-muted); cursor: pointer; }
.remember-label input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--apm-orange); }

.btn-login { width: 100%; padding: 0.95rem; background-color: var(--apm-orange); color: #fff; border: none; border-radius: 10px; font-size: 1rem; font-weight: 700; cursor: pointer; }
.auth-divider { display: flex; align-items: center; margin: 1.2rem 0; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; border-bottom: 1px solid var(--border-subtle); }
.auth-divider span { padding: 0 0.75rem; font-size: 0.7rem; font-weight: 700; color: #94a3b8; }
.btn-biometric { width: 100%; padding: 0.85rem; background-color: #fff; color: var(--apm-blue); border: 1.5px solid var(--border-subtle); border-radius: 10px; font-size: 0.95rem; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 0.6rem; }
.btn-biometric i { font-size: 1.3rem; color: var(--apm-orange); }
.msg-box { margin-top: 1rem; padding: 0.75rem; border-radius: 8px; font-size: 0.85rem; text-align: center; }
.auth-footer { text-align: center; margin-top: 1.5rem; border-top: 1px solid var(--border-subtle); padding-top: 1rem; }
.auth-footer p { font-size: 0.75rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; }

/* --- PALANG ATAS (HEADER) --- */
.app-header {
  height: var(--header-height);
  flex-shrink: 0;
  background-color: var(--apm-blue);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.1rem;
  z-index: 30;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.header-left { display: flex; align-items: center; gap: 0.7rem; }
.header-logo { width: 36px; height: auto; }
.app-title { 
  font-size: 1.25rem; 
  font-weight: 700; 
  display: flex; 
  align-items: flex-end; 
  gap: 0.35rem; 
  line-height: 1; 
}
.badge-spp { 
  font-size: 0.72rem; 
  font-weight: 700; 
  color: var(--apm-orange); 
  background: transparent; 
  padding: 0; 
  line-height: 1.1;
  margin-bottom: 1px;
}

.header-actions { display: flex; gap: 0.5rem; }
.btn-icon {
  background: rgba(255, 255, 255, 0.12);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
}
.notification-dot {
  position: absolute;
  top: 8px;
  right: 9px;
  width: 8px;
  height: 8px;
  background-color: #ef4444;
  border-radius: 50%;
  border: 1.5px solid var(--apm-blue);
}

.notification-wrapper { position: relative; }
.notif-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: -45px;
  width: 310px;
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid var(--border-subtle);
  box-shadow: 0 12px 30px rgba(11, 37, 69, 0.22);
  z-index: 100;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.notif-header { display: flex; justify-content: space-between; align-items: center; padding: 0.85rem 1rem; border-bottom: 1px solid #f1f5f9; }
.notif-header h6 { font-size: 0.9rem; font-weight: 700; color: var(--text-dark); }
.btn-read-all { background: none; border: none; font-size: 0.72rem; color: var(--apm-orange); font-weight: 600; cursor: pointer; }
.notif-list { max-height: 300px; overflow-y: auto; }
.notif-item { display: flex; gap: 0.75rem; padding: 0.8rem 1rem; border-bottom: 1px solid #f8fafc; cursor: pointer; }
.notif-item.unread { background-color: #fff9f5; }
.notif-icon { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.notif-icon.orange { background-color: #fff2ea; color: var(--apm-orange); }
.notif-body { flex: 1; }
.notif-title { font-size: 0.8rem; font-weight: 700; color: var(--text-dark); margin-bottom: 2px; }
.notif-desc { font-size: 0.72rem; color: #64748b; line-height: 1.35; margin-bottom: 4px; }
.notif-time { font-size: 0.65rem; color: #94a3b8; }

/* --- KANDUNGAN TENGAH --- */
.app-content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 1rem 0.9rem;
}

/* KAD PERAKUAN ANGGOTA */
.id-card {
  background: #ffffff;
  border-radius: 18px;
  padding: 1.2rem;
  border: 1px solid var(--border-subtle);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
  margin-bottom: 0.9rem;
}
.id-card-top { display: flex; align-items: center; gap: 1rem; padding-bottom: 1rem; border-bottom: 1px solid #f1f5f9; }
.avatar-box {
  width: 68px;
  height: 80px;
  border-radius: 12px;
  overflow: hidden;
  background-color: #f1f5f9;
  border: 2px solid var(--apm-orange);
  flex-shrink: 0;
}
.avatar-box img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.id-card-info { display: flex; flex-direction: column; }
.id-card-info h3 { font-size: 0.95rem; font-weight: 700; color: var(--text-dark); line-height: 1.25; margin-bottom: 3px; }
.pangkat-badge { font-size: 0.72rem; font-weight: 700; color: var(--apm-orange); margin-bottom: 2px; }
.id-tag { font-size: 0.78rem; color: var(--text-muted); font-weight: 600; }
.id-card-dates { padding-top: 0.9rem; display: flex; flex-direction: column; gap: 0.6rem; }
.date-row { display: flex; justify-content: space-between; align-items: center; }
.date-label { font-size: 0.78rem; color: #475569; display: flex; align-items: center; gap: 0.5rem; font-weight: 500; }
.date-label i { font-size: 0.9rem; color: #94a3b8; }

.date-badge {
  min-width: 98px;
  padding: 4px 8px;
  font-size: 0.75rem;
  font-weight: 700;
  text-align: center;
  border-radius: 6px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.badge-neutral { background-color: #f1f5f9; color: #334155; border: 1px solid #e2e8f0; }
.badge-active { background-color: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.badge-warning { background-color: #ffedd5; color: #c2410c; border: 1px solid #fed7aa; }
.badge-expired { background-color: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }

/* MODAL INSAN GRID */
.indicator-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-bottom: 0.9rem; }
.indicator-card { width: 100%; text-align: left; font: inherit; color: inherit; background: #ffffff; border-radius: 14px; padding: 0.9rem 1rem; border: 1px solid var(--border-subtle); display: flex; align-items: center; gap: 0.8rem; }
.ind-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; }
.ind-icon.orange { background-color: #fff2ea; color: var(--apm-orange); }
.ind-icon.blue { background-color: #e0f2fe; color: #0284c7; }
.ind-details { display: flex; flex-direction: column; }
.ind-val { font-size: 1.15rem; font-weight: 700; color: var(--text-dark); line-height: 1.1; }
.ind-lbl { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }

/* POSTER SLIDER */
.poster-slider-container { position: relative; margin-bottom: 0.9rem; }
.poster-slider { display: flex; gap: 0.75rem; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; scroll-behavior: smooth; }
.poster-slider::-webkit-scrollbar { display: none; }
.poster-slide { flex: 0 0 100%; scroll-snap-align: start; border-radius: 16px; padding: 1.2rem; color: #ffffff; }
.poster-slide.bg-green { background: linear-gradient(135deg, #059669, #10b981); }
.poster-slide.bg-orange { background: linear-gradient(135deg, #d97706, #f59e0b); }
.poster-tag { display: inline-block; font-size: 0.65rem; font-weight: 700; background: rgba(0, 0, 0, 0.25); padding: 2px 8px; border-radius: 4px; margin-bottom: 0.5rem; }
.poster-slide h5 { font-size: 0.95rem; font-weight: 700; margin-bottom: 0.35rem; }
.poster-slide p { font-size: 0.78rem; line-height: 1.35; opacity: 0.95; }
.slider-dots { display: flex; justify-content: center; gap: 6px; margin-top: 0.5rem; }
.slider-dots .dot { width: 7px; height: 7px; background-color: #cbd5e1; border-radius: 50%; transition: all 0.3s ease; }
.slider-dots .dot.active { width: 18px; border-radius: 10px; background-color: var(--apm-orange); }

/* BAR TINDAKAN UTAMA */
.action-bar { width: 100%; text-align: left; font: inherit; color: inherit; background: #ffffff; border-radius: 14px; padding: 0.85rem 1rem; border: 1px solid var(--border-subtle); display: flex; align-items: center; gap: 0.85rem; margin-bottom: 0.65rem; cursor: pointer; }
.bar-icon { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; flex-shrink: 0; }
.bar-icon.orange { background-color: #fff2ea; color: var(--apm-orange); }
.bar-icon.blue { background-color: #e0f2fe; color: #0284c7; }
.bar-icon.purple { background-color: #f3e8ff; color: #9333ea; }
.bar-content { flex: 1; }
.bar-content { display: flex; flex-direction: column; min-width: 0; }
.bar-content h6, .bar-title { font-size: 0.82rem; font-weight: 700; color: var(--text-dark); margin-bottom: 2px; }
.bar-content p, .bar-desc { font-size: 0.72rem; color: var(--text-muted); }
.bar-status { display: flex; align-items: center; gap: 0.4rem; font-size: 0.7rem; font-weight: 700; flex-shrink: 0; }
.bar-status.pending { color: #d97706; }
.bar-status.in-progress { color: #0284c7; }
.bar-status.action-required { color: #16a34a; }

/* =========================================
   GAYA KHUSUS MODUL KEHADIRAN (CHECK-IN/OUT)
   ========================================= */

/* 1. Jam 24 Jam */
.clock-card {
  background: #ffffff;
  border-radius: 18px;
  padding: 1.4rem 1rem;
  text-align: center;
  border: 1px solid var(--border-subtle);
  margin-bottom: 0.9rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
}

.clock-display {
  font-size: 2.8rem;
  font-weight: 800;
  color: #0c1e5b;
  letter-spacing: 1px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  margin-bottom: 0.6rem;
}

.clock-date-pill {
  display: inline-block;
  background-color: #f1f5f9;
  color: #475569;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 14px;
  border-radius: 20px;
}

/* 2. Kad Sasaran Geofence APM */
.target-location-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 1rem;
  border: 1.5px solid #dbeafe;
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  margin-bottom: 0.9rem;
}

.target-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background-color: #eff6ff;
  color: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.target-info { flex: 1; }
.target-status-line { display: flex; align-items: center; gap: 0.4rem; margin-bottom: 2px; }
.pulse-dot {
  width: 7px;
  height: 7px;
  background-color: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
}
.pulse-dot.warning { background-color: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.25); }

.target-title { font-size: 0.68rem; font-weight: 700; color: #2563eb; letter-spacing: 0.5px; }
.target-name { font-size: 0.85rem; font-weight: 700; color: var(--text-dark); margin-bottom: 2px; }
.target-coords { font-size: 0.7rem; color: #94a3b8; font-variant-numeric: tabular-nums; margin-bottom: 4px; }

.target-distance-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: #0369a1;
  background: #f0f9ff;
  padding: 2px 8px;
  border-radius: 6px;
}
.target-distance-tag.in-zone { color: #15803d; background: #dcfce7; }
.target-distance-tag.out-zone { color: #b45309; background: #fef3c7; }

/* 3. Butang Tindakan Duty IN / OUT */
.duty-action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
  margin-bottom: 0.9rem;
}

.btn-duty {
  padding: 1.15rem 0.5rem;
  border: none;
  border-radius: 16px;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
  transition: transform 0.15s ease, opacity 0.2s ease;
}
.btn-duty:active { transform: scale(0.97); }

.btn-duty.in {
  background: linear-gradient(135deg, #10b981, #059669);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.35);
}
.btn-duty.out {
  background: linear-gradient(135deg, #f43f5e, #e11d48);
  box-shadow: 0 6px 18px rgba(244, 63, 94, 0.35);
}

.btn-duty i { font-size: 1.6rem; }
.btn-duty span { font-size: 0.95rem; font-weight: 800; letter-spacing: 0.8px; }

/* 4. Rekod Semasa (0/4 Sesi) */
.session-card {
  background: #ffffff;
  border-radius: 18px;
  padding: 1.1rem;
  border: 1px solid var(--border-subtle);
  margin-bottom: 0.85rem;
}

.session-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
}

.session-header-left { display: flex; align-items: center; gap: 0.45rem; }
.dot-status { width: 8px; height: 8px; border-radius: 50%; }
.dot-status.green { background-color: #10b981; }

.session-header-left h5 { font-size: 0.88rem; font-weight: 700; color: var(--text-dark); }
.session-counter-pill { font-size: 0.72rem; font-weight: 700; color: #475569; background-color: #f1f5f9; padding: 2px 8px; border-radius: 20px; }

.empty-session-state {
  text-align: center;
  padding: 1.2rem 0;
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* Item Rekod Sesi */
.session-item {
  border-radius: 12px;
  padding: 0.85rem;
  margin-bottom: 0.65rem;
  border: 1px solid var(--border-subtle);
  background-color: #fafbfc;
}
.session-item:last-child { margin-bottom: 0; }

.session-top-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
}
.session-tag-category {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--apm-blue);
}

/* SKEMA WARNA STATUS KELULUSAN (KUNING / HIJAU / MERAH) */
.status-pill-approval {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
/* Kuning: Dalam Proses (Disemak / Disokong) */
.status-pill-approval.pending {
  background-color: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}
/* Hijau: Diluluskan */
.status-pill-approval.approved {
  background-color: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}
/* Merah: Tidak Lulus (Beserta Catatan Pegawai) */
.status-pill-approval.rejected {
  background-color: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.session-mid-line {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 0.76rem;
  color: #334155;
  margin-bottom: 0.3rem;
  font-variant-numeric: tabular-nums;
}
.session-mid-line i { color: #94a3b8; font-size: 0.8rem; }
.session-badge-duration {
  margin-left: auto;
  font-weight: 700;
  color: var(--apm-orange);
  background: #fff7ed;
  padding: 1px 6px;
  border-radius: 4px;
}

.session-note-line {
  font-size: 0.7rem;
  color: #64748b;
  line-height: 1.3;
}
.session-officer-remark {
  margin-top: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  color: #b91c1c;
  background: #fff1f2;
  padding: 3px 6px;
  border-radius: 4px;
  border-left: 2px solid #e11d48;
}

/* 5. Accordion Sejarah Kehadiran */
.history-accordion-card {
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  margin-bottom: 0.85rem;
}

.history-accordion-toggle {
  width: 100%;
  background: none;
  border: none;
  font: inherit;
  color: inherit;
  text-align: left;
  padding: 0.95rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}
.toggle-left { display: flex; align-items: center; gap: 0.65rem; }
.history-icon-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e0f2fe;
  color: #0284c7;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}
.history-title { font-size: 0.85rem; font-weight: 700; color: var(--text-dark); }
.history-count-pill { font-size: 0.7rem; color: #64748b; background: #f1f5f9; padding: 2px 7px; border-radius: 12px; }
.accordion-arrow { font-size: 0.8rem; color: #94a3b8; transition: transform 0.25s ease; }
.accordion-arrow.rotated { transform: rotate(180deg); }

.history-content {
  padding: 0.5rem 1rem 1rem;
  border-top: 1px solid #f1f5f9;
}
.empty-history-text { font-size: 0.78rem; color: var(--text-muted); text-align: center; padding: 0.6rem 0; }

/* =========================================
   TETINGKAP TINDAHAN (MODAL DIALOG)
   ========================================= */
.app-modal-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(11, 19, 41, 0.75);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.2rem;
  animation: modalFadeIn 0.2s ease;
}

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

.app-modal-card {
  width: 100%;
  max-width: 375px;
  background: #ffffff;
  border-radius: 20px;
  padding: 1.25rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
}

.modal-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.modal-header-icon-title { display: flex; align-items: center; gap: 0.65rem; }
.modal-icon-square {
  width: 34px; height: 34px; border-radius: 10px;
  background-color: #e0f2fe; color: #0284c7;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
}
.modal-icon-square.orange { background-color: #fff2ea; color: var(--apm-orange); }

.modal-card-header h4 { font-size: 0.95rem; font-weight: 700; color: var(--text-dark); }
.modal-btn-close {
  background: none; border: none; font-size: 1.6rem; line-height: 1;
  color: #64748b; cursor: pointer; padding: 0;
  width: 44px; height: 44px; margin: -8px -10px -8px 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

.modal-time-banner {
  background-color: #f8fafc;
  border-radius: 12px;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--border-subtle);
  margin-bottom: 1rem;
}
.mt-left { display: flex; flex-direction: column; }
.mt-label { font-size: 0.65rem; color: var(--text-muted); font-weight: 600; }
.mt-clock { font-size: 1.2rem; font-weight: 800; color: var(--apm-blue); font-variant-numeric: tabular-nums; }
.mt-badge {
  font-size: 0.7rem; font-weight: 700;
  padding: 3px 8px; border-radius: 6px;
  background-color: #dcfce7; color: #15803d;
}

.modal-field { margin-bottom: 0.85rem; }
.modal-field label { font-size: 0.78rem; font-weight: 700; margin-bottom: 0.35rem; }
.modal-field input, .modal-field select, .modal-field textarea {
  font-size: 1rem; padding: 0.65rem 0.8rem; border-radius: 8px;
}

.btn-action-primary {
  width: 100%;
  padding: 0.85rem;
  border-radius: 10px;
  border: none;
  background-color: var(--apm-blue);
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  margin-top: 0.5rem;
}

/* MODAL KAMERA SWAFOTO */
.camera-card { padding: 1.1rem; }
.camera-stream-wrapper {
  position: relative;
  width: 100%;
  height: 270px;
  background-color: #000000;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

#camera-video, #photo-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* Cermin pada video langsung sahaja. Gambar yang diambil sudah dicerminkan semasa disimpan. */
#camera-video { transform: scaleX(-1); }

.camera-face-guide {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.guide-oval {
  width: 150px;
  height: 190px;
  border: 2px dashed rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  box-shadow: 0 0 0 1000px rgba(0, 0, 0, 0.3);
}
.camera-face-guide p {
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 600;
  margin-top: 8px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.camera-actions-bar {
  display: flex;
  justify-content: center;
  align-items: center;
}

.btn-cam-capture {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: 4px solid var(--apm-orange);
  background: transparent;
  padding: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.shutter-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: var(--apm-orange);
  transition: transform 0.1s ease;
}
.btn-cam-capture:active .shutter-inner { transform: scale(0.9); }

.camera-confirm-buttons {
  display: flex;
  gap: 0.6rem;
  width: 100%;
}
.btn-retake {
  flex: 1;
  padding: 0.75rem;
  background-color: #f1f5f9;
  color: #334155;
  border: none;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}
.btn-confirm-duty {
  flex: 1.4;
  padding: 0.75rem;
  background-color: #10b981;
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.bottom-spacer { height: 25px; }

/* PALANG BAWAH (5 TAB) */
.app-bottom-nav {
  height: var(--bottom-bar-height);
  flex-shrink: 0;
  background-color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-around;
  border-top: 1px solid var(--border-subtle);
  z-index: 30;
  padding: 0 0.5rem;
}
.nav-btn {
  background: none; border: none; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px; flex: 1;
  color: #94a3b8; cursor: pointer;
}
.nav-btn i { font-size: 1.15rem; }
.nav-btn span { font-size: 0.65rem; font-weight: 600; }
.nav-btn.active { color: var(--apm-orange); }

.nav-center-slot { flex: 1; display: flex; justify-content: center; position: relative; }
.nav-btn-center {
  position: absolute; top: -24px; width: 56px; height: 56px;
  background: linear-gradient(135deg, var(--apm-orange), #ff7f39);
  color: #ffffff; border: 4px solid var(--bg-surface); border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: 0 6px 16px rgba(242, 101, 34, 0.4);
}
.nav-btn-center i { font-size: 1.3rem; }
.nav-btn-center span { font-size: 0.55rem; font-weight: 700; }
/* =========================================
   GAYA KHUSUS MODAL TETAPAN (SETTINGS)
   ========================================= */
.settings-card {
  max-width: 380px;
  padding: 1.25rem;
}

.settings-user-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem;
  background-color: #f8fafc;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  margin-bottom: 1rem;
}

.settings-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--apm-orange);
  flex-shrink: 0;
}

.settings-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.settings-user-details h5 {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.2;
}

.settings-user-details span {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--apm-orange);
}

.settings-user-details small {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.settings-group-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.5rem;
  border-bottom: 1px solid #f1f5f9;
}

.settings-item:last-child {
  border-bottom: none;
}

.settings-item-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.item-ico {
  font-size: 1.15rem;
  width: 24px;
  text-align: center;
}
.item-ico.orange { color: var(--apm-orange); }
.item-ico.blue { color: #0284c7; }
.item-ico.green { color: #16a34a; }

.settings-item-info h6 {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-dark);
}

.settings-item-info p {
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* Suis Togol (Toggle Switch) */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #cbd5e1;
  border-radius: 34px;
  transition: 0.25s;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: 0.25s;
}

.toggle-switch input:checked + .toggle-slider {
  background-color: var(--apm-orange);
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(18px);
}

.badge-status-on {
  font-size: 0.68rem;
  font-weight: 700;
  background-color: #dcfce7;
  color: #15803d;
  padding: 2px 7px;
  border-radius: 6px;
}

.settings-app-info {
  text-align: center;
  font-size: 0.65rem;
  color: #94a3b8;
  font-weight: 600;
  margin-bottom: 0.85rem;
}

.btn-logout {
  width: 100%;
  padding: 0.85rem;
  background-color: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: background-color 0.2s ease;
}

.btn-logout:active {
  background-color: #fecaca;
}
/* =========================================
   GAYA KHUSUS MODUL TUNTUTAN (P.A. 6 & KEWANGAN)
   ========================================= */

/* 1. Kad Rumusan Elaun Bulanan */
.claim-summary-card {
  background: linear-gradient(135deg, #0b2545 0%, #133a6b 100%);
  border-radius: 20px;
  padding: 1.25rem;
  color: #ffffff;
  margin-bottom: 1rem;
  box-shadow: 0 8px 24px rgba(11, 37, 69, 0.25);
}

.claim-summary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.claim-period-tag {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.15);
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 0.5px;
}

.claim-rate-badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: #ffedd5;
  background-color: var(--apm-orange);
  padding: 3px 9px;
  border-radius: 8px;
}

.claim-total-box {
  text-align: center;
  padding: 0.5rem 0 1.2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.claim-total-label {
  font-size: 0.72rem;
  color: #93c5fd;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 600;
}

.claim-amount-display {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  margin: 4px 0;
}

.claim-amount-display .currency {
  font-size: 1.2rem;
  font-weight: 700;
  color: #fdba74;
}

.claim-amount-display .amount {
  font-size: 2.5rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.claim-footnote {
  font-size: 0.62rem;
  color: #cbd5e1;
  opacity: 0.85;
}

/* Penjejak Aliran Tuntutan */
.claim-progress-track {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
}

.step-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.step-node .circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}

.step-node span {
  font-size: 0.62rem;
  font-weight: 600;
  color: #94a3b8;
}

.step-node.active .circle {
  background: var(--apm-orange);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(242, 101, 34, 0.5);
}

.step-node.active span {
  color: #ffffff;
}

.step-line {
  flex: 1;
  height: 2px;
  background: rgba(255, 255, 255, 0.15);
  margin: 0 4px 14px;
}

.step-line.active {
  background: var(--apm-orange);
}

/* 2. Grid Pecahan 3 Kategori P.A. 6 */
.pa6-category-section {
  margin-bottom: 1rem;
}

.section-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.65rem;
  padding: 0 2px;
}

.section-title-row h6 {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-dark);
}

.total-hours-pill {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--apm-blue);
  background-color: #e0f2fe;
  padding: 2px 8px;
  border-radius: 12px;
}

.pa6-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
}

.pa6-card {
  background: #ffffff;
  border-radius: 14px;
  padding: 0.75rem 0.6rem;
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
}

.pa6-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
}

.pa6-card.op .pa6-icon { background: #fee2e2; color: #dc2626; }
.pa6-card.adm .pa6-icon { background: #eff6ff; color: #2563eb; }
.pa6-card.trg .pa6-icon { background: #f3e8ff; color: #9333ea; }

.pa6-details {
  display: flex;
  flex-direction: column;
}

.pa6-cat-title {
  font-size: 0.68rem;
  font-weight: 700;
  color: #64748b;
  margin-bottom: 2px;
}

.pa6-cat-hours {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-dark);
  line-height: 1.1;
}

.pa6-cat-rate {
  font-size: 0.65rem;
  font-weight: 600;
  color: #94a3b8;
  margin-top: 2px;
}

/* 3. Senarai Semak Dokumen (BKEW/EA/S503) */
.checklist-card {
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid var(--border-subtle);
  padding: 1rem;
  margin-bottom: 1rem;
}

.checklist-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #f1f5f9;
}

.chk-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--apm-blue);
}

.chk-left h6 {
  font-size: 0.85rem;
  font-weight: 700;
}

.chk-status-pill {
  font-size: 0.68rem;
  font-weight: 700;
  background-color: #dcfce7;
  color: #15803d;
  padding: 2px 7px;
  border-radius: 6px;
}

.checklist-body {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.checklist-row {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.5rem 0.2rem;
  border-bottom: 1px solid #f8fafc;
}

.checklist-row:last-child {
  border-bottom: none;
}

.chk-box-icon {
  font-size: 1rem;
  color: #10b981;
  margin-top: 1px;
}

.checklist-row.warning .chk-box-icon {
  color: #f59e0b;
}

.chk-text {
  flex: 1;
}

.chk-item-title {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-dark);
}

.chk-text p {
  font-size: 0.68rem;
  color: var(--text-muted);
  line-height: 1.25;
}

.chk-tag {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.chk-tag.ready { background: #dcfce7; color: #15803d; }
.chk-tag.info { background: #e0f2fe; color: #0369a1; }

/* 4. Butang Tindakan */
.claim-actions-stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
  position: relative;
  z-index: 10;
}

.btn-claim-primary {
  width: 100%;
  padding: 0.95rem;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, var(--apm-orange), #ff7f39);
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(242, 101, 34, 0.35);
}

.btn-claim-secondary {
  width: 100%;
  padding: 0.85rem;
  border-radius: 12px;
  border: 1.5px solid var(--border-subtle);
  background: #ffffff;
  color: var(--apm-blue);
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
}
.btn-claim-submit {
  width: 100%;
  padding: 0.95rem;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

.btn-claim-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ==========================================================
   TAMBAHAN VERSI 1.3.0
   Kerangka tab, Modal Insan, Profil, penjejak P.A. 6, borang,
   mesej ringkas (toast) dan kebolehcapaian.
   ========================================================== */

:root {
  --apm-gold: #fbbf24;
  --apm-gold-soft: #fde68a;
  --ok-bg: #dcfce7;
  --ok-text: #15803d;
  --warn-bg: #fef3c7;
  --warn-text: #b45309;
  --bad-bg: #fee2e2;
  --bad-text: #b91c1c;
  --info-bg: #e0f2fe;
  --info-text: #0369a1;
  --focus-ring: #1d4ed8;
}

/* --- Kebolehcapaian asas --- */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.app-header :focus-visible,
.claim-summary-card :focus-visible,
.kad-flip:focus-visible { outline-color: var(--apm-gold); }
button { touch-action: manipulation; }
.btn-icon::before, .claim-month-btn::before {
  content: ""; position: absolute; top: -4px; right: -4px; bottom: -4px; left: -4px;
}

/* --- Kerangka tab: satu header dan satu nav untuk semua skrin --- */
.tab-stack { flex: 1; min-height: 0; display: flex; position: relative; }
.tab-view { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }

.notif-icon.blue { background-color: var(--info-bg); color: #0284c7; }
.notif-icon.green { background-color: var(--ok-bg); color: var(--ok-text); }
.notif-icon.purple { background-color: #f3e8ff; color: #9333ea; }
.notif-item { width: 100%; background: none; border: none; border-bottom: 1px solid #f8fafc; text-align: left; font: inherit; color: inherit; }
.notif-empty { padding: 1.2rem 1rem; text-align: center; font-size: 0.78rem; color: var(--text-muted); }
.modal-icon-square.blue { background-color: var(--info-bg); color: #0284c7; }
.ind-icon { flex-shrink: 0; }
.ind-icon.purple { background-color: #f3e8ff; color: #9333ea; }
.ind-icon.green { background-color: var(--ok-bg); color: var(--ok-text); }
button.indicator-card { cursor: pointer; }

/* --- Tajuk halaman dan notis --- */
.page-heading { margin: 0.1rem 0.15rem 0.85rem; }
.page-heading h2 { font-size: 1.15rem; font-weight: 800; color: var(--apm-blue); line-height: 1.2; }
.page-heading p { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }

.inline-notice {
  display: flex; gap: 0.6rem; align-items: flex-start;
  background: var(--warn-bg); color: var(--warn-text);
  border: 1px solid #fde68a; border-radius: 12px;
  padding: 0.7rem 0.85rem; margin-bottom: 0.85rem;
  font-size: 0.78rem; font-weight: 600; line-height: 1.4;
}
.inline-notice.info { background: var(--info-bg); color: var(--info-text); border-color: #bae6fd; }
.inline-notice button {
  margin-left: auto; flex-shrink: 0; background: #ffffff; border: 1px solid currentColor; color: inherit;
  font: inherit; font-weight: 700; border-radius: 8px; padding: 0.45rem 0.7rem; min-height: 36px; cursor: pointer;
}

.section-gap { margin-top: 1.1rem; }
.stack-list { display: flex; flex-direction: column; gap: 0.65rem; }
.empty-card {
  background: #ffffff; border: 1px dashed #cbd5e1; border-radius: 14px;
  padding: 1.1rem 1rem; text-align: center; font-size: 0.8rem; color: var(--text-muted); line-height: 1.45;
}
.empty-card i { display: block; font-size: 1.3rem; color: #94a3b8; margin-bottom: 0.45rem; }
.empty-card strong { display: block; color: var(--text-dark); font-size: 0.88rem; margin-bottom: 2px; }

/* --- Tab bersegmen (Modal Insan) --- */
.seg-tabs {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px;
  background: #e6ebf2; border-radius: 14px; padding: 4px; margin-bottom: 1rem;
}
.seg-tab {
  min-height: 44px; border: none; border-radius: 10px; background: transparent;
  font: inherit; font-size: 0.78rem; font-weight: 700; color: #475569; cursor: pointer; padding: 0 0.4rem;
}
.seg-tab.active { background: #ffffff; color: var(--apm-blue); box-shadow: 0 1px 4px rgba(11, 37, 69, 0.14); }

/* --- Cip status (ikon + teks, bukan warna sahaja) --- */
.cip {
  display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0;
  font-size: 0.68rem; font-weight: 700; padding: 3px 8px; border-radius: 6px; white-space: nowrap;
  background: #f1f5f9; color: #334155; border: 1px solid #e2e8f0;
}
.cip.ok { background: var(--ok-bg); color: var(--ok-text); border-color: #bbf7d0; }
.cip.warn { background: var(--warn-bg); color: var(--warn-text); border-color: #fde68a; }
.cip.bad { background: var(--bad-bg); color: var(--bad-text); border-color: #fecaca; }
.cip.info { background: var(--info-bg); color: var(--info-text); border-color: #bae6fd; }

/* --- Kad kursus dan permohonan --- */
.kursus-card {
  background: #ffffff; border-radius: 14px; border: 1px solid var(--border-subtle); padding: 0.95rem 1rem;
}
.kursus-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.6rem; margin-bottom: 0.45rem; }
.kursus-top h6 { font-size: 0.9rem; font-weight: 700; color: var(--text-dark); line-height: 1.3; }
.kursus-meta { list-style: none; display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 0.6rem; }
.kursus-meta li { display: flex; gap: 0.5rem; align-items: flex-start; font-size: 0.76rem; color: #475569; line-height: 1.35; }
.kursus-meta i { width: 14px; text-align: center; color: #94a3b8; margin-top: 2px; flex-shrink: 0; }
.kursus-desc { font-size: 0.76rem; color: var(--text-muted); line-height: 1.4; margin-bottom: 0.65rem; }
.kursus-card .btn-action-primary { margin-top: 0.2rem; min-height: 46px; }
.kursus-card .btn-action-primary:disabled, .btn-action-primary:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-teks {
  background: none; border: none; font: inherit; font-size: 0.78rem; font-weight: 700; color: var(--bad-text);
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer; min-height: 44px; padding: 0 0.3rem;
}
.kursus-aksi { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; }

/* Penjejak proses permohonan (Dihantar > Disemak > Keputusan) */
.proses-track { list-style: none; display: flex; align-items: flex-start; margin-top: 0.7rem; }
.proses-step { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; position: relative; text-align: center; }
.proses-step::before {
  content: ""; position: absolute; top: 11px; left: -50%; width: 100%; height: 2px; background: #e2e8f0;
}
.proses-step:first-child::before { display: none; }
.proses-dot {
  position: relative; z-index: 1; width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 0.65rem;
  background: #ffffff; border: 2px solid #cbd5e1; color: #94a3b8;
}
.proses-label { font-size: 0.66rem; font-weight: 600; color: #64748b; line-height: 1.2; }
.proses-step.siap::before { background: #16a34a; }
.proses-step.siap .proses-dot { background: #16a34a; border-color: #16a34a; color: #ffffff; }
.proses-step.siap .proses-label { color: var(--text-dark); font-weight: 700; }
.proses-step.gagal::before { background: #dc2626; }
.proses-step.gagal .proses-dot { background: #dc2626; border-color: #dc2626; color: #ffffff; }
.proses-step.gagal .proses-label { color: var(--bad-text); font-weight: 700; }
.catatan-kecil { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.5rem; line-height: 1.35; }

/* Baris rekod ringkas (rekod latihan, laporan mengajar, log bulanan) */
.rekod-baris {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 0.6rem;
  padding: 0.7rem 0; border-bottom: 1px solid #f1f5f9;
}
.rekod-baris:last-child { border-bottom: none; }
.rekod-utama { min-width: 0; }
.rekod-tajuk { display: block; font-size: 0.82rem; font-weight: 700; color: var(--text-dark); line-height: 1.3; }
.rekod-sub { display: block; font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; line-height: 1.35; }
.rekod-hujung { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.rekod-angka { font-size: 0.82rem; font-weight: 800; color: var(--apm-blue); font-variant-numeric: tabular-nums; }
.laporan-card { background: #ffffff; border-radius: 14px; border: 1px solid var(--border-subtle); padding: 0.2rem 1rem; }

/* --- Kuiz Uji Minda --- */
.kuiz-modul {
  width: 100%; display: flex; align-items: center; gap: 0.8rem; text-align: left; font: inherit; color: inherit;
  background: #ffffff; border: 1px solid var(--border-subtle); border-radius: 14px; padding: 0.85rem 1rem;
  min-height: 60px; cursor: pointer;
}
.kuiz-modul:disabled { cursor: default; opacity: 0.75; }
.kuiz-modul-ico {
  width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  background: #f3e8ff; color: #9333ea; font-size: 1.05rem;
}
.kuiz-modul-teks { flex: 1; min-width: 0; }
.kuiz-modul-teks strong { display: block; font-size: 0.86rem; color: var(--text-dark); line-height: 1.3; }
.kuiz-modul-teks span { display: block; font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }
.kuiz-card { background: #ffffff; border: 1px solid var(--border-subtle); border-radius: 16px; padding: 1rem; }
.kuiz-kepala { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; margin-bottom: 0.7rem; }
.kuiz-kepala span { font-size: 0.72rem; font-weight: 700; color: var(--text-muted); }
.kuiz-bar { height: 6px; border-radius: 6px; background: #e2e8f0; overflow: hidden; margin-bottom: 0.9rem; }
.kuiz-bar span { display: block; height: 100%; background: var(--apm-orange); border-radius: 6px; }
.kuiz-soalan { font-size: 0.95rem; font-weight: 700; color: var(--text-dark); line-height: 1.4; margin-bottom: 0.8rem; }
.kuiz-pilihan-senarai { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 0.8rem; }
.kuiz-pilihan {
  width: 100%; display: flex; align-items: center; gap: 0.7rem; text-align: left; font: inherit; color: var(--text-dark);
  background: #ffffff; border: 1.5px solid var(--border-subtle); border-radius: 12px; padding: 0.7rem 0.8rem;
  min-height: 48px; font-size: 0.84rem; font-weight: 600; line-height: 1.35; cursor: pointer;
}
.kuiz-huruf {
  width: 26px; height: 26px; border-radius: 8px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  background: #f1f5f9; color: #334155; font-size: 0.75rem; font-weight: 800;
}
.kuiz-pilihan:disabled { cursor: default; }
.kuiz-pilihan.betul { border-color: #16a34a; background: #f0fdf4; }
.kuiz-pilihan.betul .kuiz-huruf { background: #16a34a; color: #ffffff; }
.kuiz-pilihan.salah { border-color: #dc2626; background: #fef2f2; }
.kuiz-pilihan.salah .kuiz-huruf { background: #dc2626; color: #ffffff; }
.kuiz-tanda { margin-left: auto; font-size: 0.72rem; font-weight: 800; flex-shrink: 0; display: inline-flex; gap: 4px; align-items: center; }
.kuiz-pilihan.betul .kuiz-tanda { color: var(--ok-text); }
.kuiz-pilihan.salah .kuiz-tanda { color: var(--bad-text); }
.kuiz-maklum { font-size: 0.8rem; font-weight: 700; margin-bottom: 0.7rem; min-height: 1.2em; }
.kuiz-maklum.betul { color: var(--ok-text); }
.kuiz-maklum.salah { color: var(--bad-text); }
.kuiz-skor { text-align: center; padding: 0.6rem 0 0.2rem; }
.kuiz-skor-angka { font-size: 2.4rem; font-weight: 800; color: var(--apm-blue); line-height: 1; font-variant-numeric: tabular-nums; }
.kuiz-skor p { font-size: 0.82rem; color: var(--text-muted); margin: 0.4rem 0 1rem; line-height: 1.4; }
.kuiz-butang { display: flex; gap: 0.6rem; }
.kuiz-butang .btn-retake, .kuiz-butang .btn-action-primary { min-height: 46px; margin-top: 0; }

/* --- Kod QR borang kepuasan pelanggan --- */
.qr-card {
  background: #ffffff; border: 1px solid var(--border-subtle); border-radius: 16px; padding: 1rem;
  display: flex; align-items: center; gap: 0.9rem;
}
.qr-card-text { flex: 1; min-width: 0; }
.qr-card-text h6 { font-size: 0.88rem; font-weight: 700; color: var(--text-dark); margin-bottom: 0.25rem; }
.qr-card-text p { font-size: 0.74rem; color: var(--text-muted); line-height: 1.4; }
.qr-link {
  display: inline-flex; align-items: center; min-height: 44px; font-size: 0.8rem; font-weight: 700;
  color: var(--info-text); text-underline-offset: 3px;
}
.qr-note { margin-top: 0.3rem; font-weight: 600; }
.qr-note:empty { display: none; }
.qr-box {
  width: 124px; height: 124px; flex-shrink: 0; border: 1px solid var(--border-subtle); border-radius: 12px;
  background: #ffffff; padding: 8px; display: flex; align-items: center; justify-content: center; color: #cbd5e1; font-size: 2rem;
}
.qr-box svg, .qr-box img { width: 100%; height: 100%; display: block; }

/* --- Tuntutan: pilih bulan, penjejak, nota --- */
.claim-summary-header { flex-wrap: wrap; gap: 0.5rem; }
.claim-period-nav { display: flex; align-items: center; gap: 0.35rem; }
.claim-month-btn {
  position: relative; width: 34px; height: 34px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(255, 255, 255, 0.15); color: #ffffff; font-size: 0.75rem;
  display: flex; align-items: center; justify-content: center;
}
.claim-month-btn:disabled { opacity: 0.35; cursor: not-allowed; }

.pa6-tracker {
  list-style: none; display: flex; align-items: flex-start; justify-content: space-between;
  margin-top: 16px;
}
.pa6-step { display: flex; flex-direction: column; align-items: center; flex: 1; opacity: 0.55; transition: opacity 0.3s ease; }
.pa6-step.active { opacity: 1; }
.pa6-circle {
  width: 34px; height: 34px; border-radius: 50%; background: rgba(255, 255, 255, 0.12);
  border: 1.5px solid rgba(255, 255, 255, 0.3); display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: #ffffff; margin-bottom: 6px;
}
.pa6-step.active .pa6-circle { background: #f97316; border-color: #fdba74; box-shadow: 0 0 12px rgba(249, 115, 22, 0.55); }
.pa6-label { font-size: 10.5px; font-weight: 600; color: #f8fafc; text-align: center; line-height: 1.2; }
.pa6-step.active .pa6-label { font-weight: 800; }
.pa6-connector { flex: 0.6; height: 2px; background: rgba(255, 255, 255, 0.2); margin-top: 16px; }
.pa6-connector.active { background: #f97316; }
.claim-status-note { margin-top: 12px; text-align: center; color: #e2e8f0; font-size: 0.72rem; line-height: 1.4; }
.claim-footnote { color: #dbe4f0; opacity: 1; }

.claim-unsent-note { font-size: 0.76rem; font-weight: 600; color: #475569; text-align: center; line-height: 1.4; }
.claim-unsent-note:empty { display: none; }

.checklist-row.warning .chk-box-icon { color: #d97706; }
.chk-tag { flex-shrink: 0; }
.chk-tag.warn { background: var(--warn-bg); color: var(--warn-text); }
.chk-link { background: none; border: none; font: inherit; font-weight: 700; color: var(--info-text); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; padding: 0; }

/* --- Profil: tajuk, lencana SAH --- */
.profil-card-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.75rem; margin: 0.1rem 0.15rem 0.75rem; }
.profil-card-heading h2 { font-size: 1.05rem; font-weight: 800; color: var(--text-dark); line-height: 1.2; }
.profil-card-heading p { font-size: 0.76rem; color: var(--text-muted); margin-top: 2px; }
.sah-pill {
  display: inline-flex; align-items: center; gap: 0.4rem; flex-shrink: 0;
  background: var(--ok-bg); color: var(--ok-text); border: 1px solid #bbf7d0;
  font-size: 0.74rem; font-weight: 800; letter-spacing: 0.4px; padding: 5px 12px; border-radius: 20px;
}
.sah-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.sah-pill.amaran { background: var(--warn-bg); color: var(--warn-text); border-color: #fde68a; }
.sah-pill.tamat { background: var(--bad-bg); color: var(--bad-text); border-color: #fecaca; }
.sah-pill.neutral { background: #f1f5f9; color: #334155; border-color: #e2e8f0; }

/* --- Profil: kad anggota digital (pusing depan / belakang) --- */
.kad-flip {
  display: block; width: 100%; border: none; padding: 0; background: none; cursor: pointer;
  font: inherit; color: #ffffff; text-align: left; border-radius: 20px; margin-bottom: 1rem;
  perspective: 1200px;
}
.kad-inner { display: grid; transform-style: preserve-3d; transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1); }
.kad-flip[aria-pressed="true"] .kad-inner { transform: rotateY(180deg); }
.kad-face {
  grid-area: 1 / 1; position: relative; overflow: hidden; display: flex; flex-direction: column;
  min-height: 236px; padding: 0.95rem 1.05rem 0.85rem; border-radius: 20px;
  background: linear-gradient(135deg, #0b2545 0%, #143b78 55%, #0b2545 100%);
  border: 1px solid rgba(255, 255, 255, 0.16); box-shadow: 0 10px 26px rgba(11, 37, 69, 0.32);
  -webkit-backface-visibility: hidden; backface-visibility: hidden;
}
.kad-belakang { transform: rotateY(180deg); }
.kad-depan::after {
  content: ""; position: absolute; right: -18px; bottom: 26px; width: 150px; height: 150px;
  background: url("../img/logo-apm.png") center / contain no-repeat; opacity: 0.07; pointer-events: none;
}
.kad-kepala { display: flex; align-items: center; gap: 0.6rem; padding-bottom: 0.7rem; border-bottom: 1px solid rgba(255, 255, 255, 0.18); }
.kad-kepala.ringkas { justify-content: center; }
.kad-jata, .kad-logo { width: 40px; height: 40px; object-fit: contain; flex-shrink: 0; }
.kad-kepala-teks { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; text-align: center; }
.kad-org { font-size: 0.66rem; font-weight: 800; letter-spacing: 0.5px; line-height: 1.25; }
.kad-jabatan { font-size: 0.6rem; font-weight: 500; color: #dbe4f0; line-height: 1.3; }
.kad-tajuk { font-size: 0.82rem; font-weight: 800; letter-spacing: 1.6px; color: var(--apm-gold); margin-top: 3px; line-height: 1.2; }
.kad-badan { position: relative; z-index: 1; display: flex; gap: 0.85rem; align-items: flex-start; padding: 0.8rem 0; flex: 1; }
.kad-foto-box {
  width: 82px; height: 102px; flex-shrink: 0; border-radius: 10px; overflow: hidden;
  border: 2px solid var(--apm-gold); background: #1e3a66;
}
.kad-foto-box img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; }
.kad-butiran, .kad-grid-belakang { flex: 1; min-width: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem 0.75rem; }
.kad-grid-belakang { position: relative; z-index: 1; padding: 0.8rem 0; align-content: start; }
.kad-medan { display: flex; flex-direction: column; min-width: 0; }
.kad-medan.lebar { grid-column: 1 / -1; }
.kad-label { font-size: 0.62rem; font-weight: 600; color: var(--apm-gold-soft); line-height: 1.3; }
.kad-nilai { font-size: 0.8rem; font-weight: 700; color: #ffffff; line-height: 1.25; overflow-wrap: anywhere; text-transform: uppercase; }
.kad-nilai.nama { font-size: 0.9rem; font-weight: 800; }
.kad-nilai.emas { color: var(--apm-gold); }
.kad-kaki {
  position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: center; gap: 0.6rem;
  padding-top: 0.6rem; border-top: 1px solid rgba(255, 255, 255, 0.18); font-size: 0.66rem; margin-top: auto;
}
.kad-siri { color: #dbe4f0; font-weight: 600; letter-spacing: 0.4px; }
.kad-siri strong { color: #ffffff; font-weight: 800; }
.kad-pusing { color: var(--apm-gold); font-weight: 700; display: inline-flex; align-items: center; gap: 0.35rem; white-space: nowrap; }

/* --- Profil: senarai kemas kini --- */
.profil-menu-card { background: #ffffff; border-radius: 18px; border: 1px solid var(--border-subtle); overflow: hidden; }
.profil-menu-head { padding: 1rem 1.1rem 0.9rem; }
.profil-menu-head h3 { font-size: 1.02rem; font-weight: 800; color: var(--apm-blue); }
.profil-menu-head p { font-size: 0.78rem; color: var(--text-muted); margin-top: 3px; line-height: 1.4; }
.profil-menu-row {
  width: 100%; display: flex; align-items: center; gap: 0.85rem; min-height: 58px; padding: 0.6rem 1.1rem;
  background: none; border: none; border-top: 1px solid #f1f5f9; font: inherit; color: inherit; text-align: left; cursor: pointer;
}
.profil-menu-row:active { background: #f8fafc; }
.profil-menu-ico { width: 22px; text-align: center; font-size: 1.05rem; color: var(--apm-orange); flex-shrink: 0; }
.profil-menu-label { flex: 1; min-width: 0; font-size: 0.9rem; font-weight: 700; color: var(--text-dark); }
.profil-menu-status:empty { display: none; }
.profil-menu-chev { font-size: 0.8rem; color: #94a3b8; flex-shrink: 0; }

/* --- Modal tinggi, borang, pengesahan --- */
.modal-tinggi { max-height: 100%; display: flex; flex-direction: column; }
.modal-tinggi .modal-card-header { flex-shrink: 0; }
.modal-scroll { overflow-y: auto; min-height: 0; -webkit-overflow-scrolling: touch; padding: 2px; margin: -2px; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; }
.wajib { color: var(--bad-text); }
.form-bantuan { display: block; font-size: 0.72rem; color: var(--text-muted); margin-top: 0.3rem; line-height: 1.35; }
.form-medan-ralat { display: block; font-size: 0.74rem; font-weight: 700; color: var(--bad-text); margin-top: 0.3rem; }
.form-medan-ralat:empty { display: none; }
.form-group input[aria-invalid="true"], .form-group select[aria-invalid="true"], .form-group textarea[aria-invalid="true"] { border-color: #dc2626; }
.form-group input[type="file"] { padding: 0.55rem; font-size: 0.85rem; }
.form-nota { font-size: 0.74rem; color: var(--text-muted); line-height: 1.45; margin: 0.2rem 0 0.8rem; }
.form-nota:empty { display: none; }
.form-ralat {
  background: var(--bad-bg); color: var(--bad-text); border: 1px solid #fecaca; border-radius: 10px;
  padding: 0.65rem 0.8rem; font-size: 0.8rem; font-weight: 700; margin-bottom: 0.7rem; line-height: 1.4;
}
.baca-sahaja { background: #f8fafc; border: 1px solid var(--border-subtle); border-radius: 12px; padding: 0.3rem 0.85rem; margin-bottom: 0.9rem; }
.baca-sahaja:empty { display: none; }
.baca-sahaja div { display: flex; justify-content: space-between; gap: 0.8rem; padding: 0.45rem 0; border-bottom: 1px solid #eef2f7; }
.baca-sahaja div:last-child { border-bottom: none; }
.baca-sahaja dt { font-size: 0.74rem; color: var(--text-muted); font-weight: 600; flex-shrink: 0; }
.baca-sahaja dd { font-size: 0.78rem; color: var(--text-dark); font-weight: 700; text-align: right; overflow-wrap: anywhere; }
.gambar-pratonton { display: block; width: 100%; max-height: 180px; object-fit: cover; border-radius: 10px; margin-top: 0.55rem; border: 1px solid var(--border-subtle); }
.btn-action-primary { min-height: 48px; }

.sahkan-tajuk { font-size: 1rem; font-weight: 800; color: var(--text-dark); margin-bottom: 0.4rem; }
.sahkan-mesej { font-size: 0.86rem; color: #475569; line-height: 1.5; margin-bottom: 1.1rem; white-space: pre-line; }
.sahkan-butang { display: flex; gap: 0.6rem; }
.sahkan-butang .btn-retake, .sahkan-butang .btn-action-primary { flex: 1; min-height: 48px; margin-top: 0; }
.sahkan-butang .btn-action-primary.bahaya { background-color: #b91c1c; }

/* --- Mesej ringkas (toast) --- */
.toast-kawasan {
  position: absolute; left: 12px; right: 12px; bottom: calc(var(--bottom-bar-height) + 34px); z-index: 300;
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.toast {
  display: flex; align-items: flex-start; gap: 0.6rem; background: #0f172a; color: #ffffff;
  border-radius: 12px; padding: 0.75rem 0.95rem; font-size: 0.82rem; font-weight: 600; line-height: 1.4;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28); animation: toastMasuk 0.22s ease-out;
}
.toast i { margin-top: 2px; flex-shrink: 0; }
.toast.berjaya i { color: #4ade80; }
.toast.ralat i { color: #fca5a5; }
.toast.maklum i { color: #7dd3fc; }
@keyframes toastMasuk { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.btn-claim-primary, .btn-claim-secondary, .btn-claim-submit { min-height: 48px; }
.btn-claim-submit:disabled, .btn-claim-secondary:disabled { opacity: 0.55; cursor: not-allowed; }
.nav-btn { min-height: 48px; }
.session-officer-remark, .session-note-line { overflow-wrap: anywhere; }

/* --- Gerakan dikurangkan --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .kad-inner { transform: none !important; }
  .kad-belakang { transform: none; visibility: hidden; }
  .kad-flip[aria-pressed="true"] .kad-belakang { visibility: visible; }
  .kad-flip[aria-pressed="true"] .kad-depan { visibility: hidden; }
}

.date-badge i { margin-right: 4px; font-size: 0.72rem; }

/* ==========================================================
   PEMBETULAN SELEPAS SEMAKAN (kontras, fokus, skrin kecil)
   ========================================================== */

/* Bingkai desktop tidak lagi terpotong pada tetingkap yang rendah */
@media (min-width: 450px) {
  .mobile-container { height: min(880px, calc(100dvh - 24px)); }
}
/* Skrin log masuk boleh ditatal pada telefon yang pendek */
#login-view { justify-content: flex-start; }
#login-view .auth-box { margin: auto 0; }
/* Grid dua dan tiga lajur tidak melimpah pada skrin 320px */
.indicator-grid, .form-row-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.pa6-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-row-2 input { min-width: 0; }
/* Dialog yang lebih tinggi daripada skrin boleh ditatal */
.app-modal-card { max-height: 100%; overflow-y: auto; }
.modal-tinggi { overflow: hidden; }
.kuiz-butang > * { flex: 1 1 0; min-width: 0; }

/* Kontras teks (WCAG AA 4.5:1) */
.claim-rate-badge { color: #7c2d12; background-color: #ffedd5; }
.btn-claim-submit { background: linear-gradient(135deg, #047857 0%, #065f46 100%); }
.btn-claim-primary { background: linear-gradient(135deg, #c2410c, #9a3412); }
.btn-login { background-color: #c2410c; }
.kuiz-pilihan.betul .kuiz-huruf { background: #15803d; }
.page-heading p, .profil-card-heading p { color: #475569; }
.pa6-step { opacity: 1; }
.pa6-step:not(.active) .pa6-circle { opacity: 0.55; }
.pa6-step:not(.active) .pa6-label { color: #cbd5e1; }
.proses-dot { color: #64748b; }
.nav-btn { color: #64748b; }
.nav-btn.active { color: #c2410c; }
.nav-btn.active span { font-weight: 800; }
.pangkat-badge, .btn-read-all, .settings-user-details span { color: #c2410c; }
.kad-label { font-size: 0.7rem; }
.kad-jabatan { font-size: 0.66rem; }
.cip { font-size: 0.72rem; }
.proses-label { font-size: 0.7rem; }

/* Penunjuk fokus papan kekunci */
.notif-dropdown :focus-visible { outline-color: var(--focus-ring); }
.kad-flip:focus-visible { outline-offset: -5px; }
.toggle-switch input:focus-visible + .toggle-slider { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.form-group input:focus-visible, .form-group select:focus-visible, .form-group textarea:focus-visible {
  outline: 3px solid var(--focus-ring); outline-offset: 1px;
}

/* Sasaran sentuh sekurang-kurangnya 44px */
.btn-read-all { min-height: 44px; padding: 0 0.5rem; }
.remember-label { min-height: 44px; }
.toggle-switch::after { content: ""; position: absolute; top: -11px; bottom: -11px; left: -2px; right: -2px; }
.claim-month-btn { width: 36px; height: 36px; }
.inline-notice button { min-height: 44px; }
.notif-dropdown { width: min(310px, calc(100vw - 24px)); }
.app-bottom-nav { height: calc(var(--bottom-bar-height) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); }

.shutter-inner { display: block; }
.badge-status-off { font-size: 0.68rem; font-weight: 700; background-color: #f1f5f9; color: #334155; padding: 2px 7px; border-radius: 6px; }
.kursus-card > .btn-teks { margin-top: 0.3rem; padding-left: 0; }
