/* ===================== AyamKoe Ops - Design System ===================== */
/* Mobile-first, warm street-food palette, thumb-friendly touch targets */
/* Warna brand diambil LANGSUNG disampling dari file logo AyamKoe (public/logo/) - bukan perkiraan:
   merah #C7232A (26% piksel logo, dominan di outline wordmark & banner), merah gelap #A30814
   (shading jengger/pial), emas #FFAF02 (lingkaran matahari di belakang maskot). */
:root {
  --primary: #C7232A;       /* merah utama, brand */
  --primary-dark: #A30814;
  --primary-light: #F8DCDD;
  --primary-gradient: linear-gradient(135deg, #D9342E 0%, #A30814 100%);
  --brand-red: #C7232A;     /* diambil langsung dari logo AyamKoe (lihat views/partials/slip-gaji-body.ejs) */
  --brand-gold: #FFAF02;
  --brand-gradient: linear-gradient(120deg, var(--brand-red) 0%, var(--brand-gold) 100%);
  --accent: #FFAF02;        /* emas - lingkaran matahari di logo */
  --accent-dark: #CC8C00;
  --bg: #FDF6EE;             /* krem/off-white hangat - lebih lembut drpd putih polos */
  --card: #FFFFFF;
  --dark-card: #241512;      /* coklat gelap hangat utk card Ringkasan AI - kontras dgn bg krem (dulu navy, disamakan ke keluarga warna logo) */
  --dark-card-deep: #150B09;
  --border: #EDE2DC;
  --text: #3A2B27;           /* warm dark brown */
  --muted: #8A7A72;
  --success: #3F9D63;
  --success-light: #E4F5EA;
  --warning: #E8A33D;
  --warning-light: #FCF0DA;
  --danger: #E15252;
  --danger-light: #FBE7E5;
  --info: #4A90B8;
  --info-light: #E8F2F7;
  --radius: 14px;
  --radius-sm: 10px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  background-attachment: fixed;
  color: var(--text);
  margin: 0;
  font-size: 16px;
  line-height: 1.45;
  padding-bottom: var(--safe-bottom);
}

a { color: var(--primary-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

h1 { font-size: 1.4rem; margin: 0 0 12px; font-weight: 800; }
h2 { font-size: 1.1rem; margin: 0 0 10px; font-weight: 700; }
h3 { font-size: 1rem; margin: 0 0 8px; font-weight: 700; }

/* ===================== Layout ===================== */
.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 16px 16px 40px;
}
body.nav-open { overflow: hidden; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(58, 43, 39, 0.04);
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .grid-2 { grid-template-columns: 1fr; } }

/* ===================== App header (hamburger + brand + bell) ===================== */
.app-header {
  background: var(--brand-gradient);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(10px + var(--safe-top)) 14px 10px;
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: 0 2px 8px rgba(163,8,20,0.22);
}
.hamburger-btn {
  background: rgba(255,255,255,0.16);
  border: none;
  color: #fff;
  width: 44px; height: 44px;
  border-radius: 10px;
  font-size: 1.15rem;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.app-header .brand { font-weight: 800; font-size: 1.05rem; flex: 1; display: flex; }
.brand-logo-chip {
  display: inline-flex; align-items: center;
  background: rgba(255,255,255,0.94);
  padding: 5px 12px;
  border-radius: 999px;
}
.brand-logo { height: 24px; width: auto; max-width: 100%; display: block; object-fit: contain; }
.app-header .right { display: flex; align-items: center; gap: 10px; }
.bell { position: relative; color: #fff; font-size: 1.2rem; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; }
.badge {
  position: absolute; top: 2px; right: 2px;
  background: #fff; color: var(--danger); border-radius: 10px;
  padding: 0 5px; font-size: 0.65rem; font-weight: 800; min-width: 16px; text-align: center;
}

/* ===================== Nav drawer (hamburger menu) ===================== */
.nav-backdrop {
  position: fixed; inset: 0;
  background: rgba(58,43,39,0.45);
  z-index: 45;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.nav-backdrop.open { opacity: 1; pointer-events: auto; }

.nav-drawer {
  position: fixed;
  top: 0; bottom: 0; left: 0;
  width: min(84vw, 320px);
  background: var(--card);
  z-index: 50;
  transform: translateX(-100%);
  transition: transform 0.22s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden; /* jaga2 thd child yg kebesaran (mis. gambar tanpa constraint krn cache CSS
    lama belum ke-refresh di browser staff) - drawer TIDAK PERNAH bleed keluar batasnya sendiri. */
  box-shadow: 4px 0 20px rgba(0,0,0,0.15);
}
.nav-drawer.open { transform: translateX(0); }

.nav-drawer-head {
  background: var(--brand-gradient);
  color: #fff;
  padding: calc(20px + var(--safe-top)) 16px 18px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
}
.nav-drawer-top-row { display: flex; align-items: center; justify-content: space-between; }
.nav-drawer-brand { display: flex; align-items: center; gap: 9px; }
.nav-drawer-logo { height: 26px; width: auto; max-width: 100%; display: block; object-fit: contain; }
.nav-drawer-tagline { font-size: 0.7rem; opacity: 0.88; font-style: italic; letter-spacing: 0.01em; }
.user-chip-lg { display: flex; align-items: center; gap: 12px; }
.user-chip-lg .avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: rgba(255,255,255,0.22);
  display: flex; align-items: center; justify-content: center; font-size: 1.1rem;
}
.user-chip-lg .name { font-weight: 700; font-size: 0.95rem; }
.user-chip-lg .role { font-size: 0.78rem; opacity: 0.9; }
.drawer-close-btn {
  background: rgba(255,255,255,0.16); border: none; color: #fff;
  width: 40px; height: 40px; border-radius: 10px; font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  flex-shrink: 0;
}

.nav-drawer-body { flex: 1; overflow-y: auto; padding: 10px 10px 10px; }
.nav-group { margin-bottom: 6px; }
.nav-group-title {
  font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--muted); padding: 14px 12px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 12px;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-weight: 600;
  font-size: 0.96rem;
  min-height: 48px;
}
.nav-item:hover { background: var(--primary-light); text-decoration: none; }
.nav-item i { width: 22px; text-align: center; color: var(--muted); font-size: 1.05rem; }
.nav-item.active { background: var(--primary-light); color: var(--primary-dark); }
.nav-item.active i { color: var(--primary-dark); }

.nav-drawer-foot { border-top: 1px solid var(--border); padding: 10px; }
.logout-btn {
  width: 100%; background: none; border: none; cursor: pointer; text-align: left;
  color: var(--danger); font-family: inherit;
}
.logout-btn i { color: var(--danger); }
.logout-btn:hover { background: var(--danger-light); }

/* ===================== Buttons ===================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 13px 20px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 700;
  min-height: 48px;
  min-width: 48px;
  line-height: 1.2;
  transition: transform 0.06s ease, background 0.15s ease, opacity 0.15s ease;
}
.btn:hover { background: var(--primary-dark); text-decoration: none; }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-secondary { background: #E9DED7; color: var(--text); }
.btn-secondary:hover { background: #DED0C6; }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #C43F3F; }
.btn-ok { background: var(--success); }
.btn-ok:hover { background: #327F50; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-dark); }
.btn-sm { padding: 8px 14px; font-size: 0.85rem; min-height: 40px; }
.btn-block { display: flex; width: 100%; }
.btn-lg { padding: 16px 24px; font-size: 1.1rem; min-height: 56px; }

form.inline { display: inline; }

/* Sticky action bar - keeps the primary CTA thumb-reachable at the bottom of forms */
.sticky-action-bar {
  position: sticky;
  bottom: calc(var(--safe-bottom));
  background: linear-gradient(to top, #FFFFFF 70%, rgba(255,255,255,0)); /* fade ke putih solid, bukan var(--bg) - supaya tetap rapi di atas backdrop bergradasi merah-emas sekarang */
  padding: 14px 0 10px;
  margin-top: 10px;
  display: flex;
  gap: 10px;
}

/* ===================== Forms ===================== */
label { display: block; margin: 14px 0 6px; font-weight: 700; font-size: 0.88rem; color: var(--text); }
input[type=text], input[type=number], input[type=password], input[type=date], input[type=file], select, textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  background: var(--card);
  color: var(--text);
  min-height: 48px;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
}
textarea { min-height: 90px; }
input:disabled { background: #F5EFE9; color: var(--muted); }

/* ===================== Tables (responsive scroll) ===================== */
.table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; margin-top: 10px; min-width: 420px; }
th, td { text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--border); font-size: 0.88rem; }
th { background: var(--primary-light); color: var(--primary-dark); font-weight: 700; white-space: nowrap; }
tr:hover { background: #FFFBF7; }

/* Kolom pertama tetap terlihat saat tabel discroll horizontal (mis. Rekap Stok Harian - banyak
   kolom angka sempit + 1 kolom nama panjang) - dipasang lewat class tambahan pada .table-scroll,
   BUKAN semua tabel di app, supaya tabel lain yang sudah pas tidak ikut berubah tampilannya.
   PENTING: position:sticky pada <td>/<th> TIDAK bekerja dengan benar kalau tabel pakai
   border-collapse:collapse (gagal diam di Safari/iOS meski terlihat "berhasil" di Chrome) - wajib
   border-collapse:separate + border-spacing:0 di tabel yang stickyfirst-col ini. */
.table-scroll.sticky-first-col table {
  border-collapse: separate;
  border-spacing: 0;
}
.table-scroll.sticky-first-col table th:first-child,
.table-scroll.sticky-first-col table td:first-child {
  position: sticky;
  left: 0;
  z-index: 10;
  background: var(--card);
  box-shadow: 2px 0 6px -2px rgba(0, 0, 0, 0.22);
}
.table-scroll.sticky-first-col table thead th:first-child {
  z-index: 11;
  background: var(--primary-light);
}
.table-scroll.sticky-first-col table tr:hover td:first-child {
  background: #FFFBF7;
}

/* ===================== Badges/status ===================== */
.badge-status { display: inline-block; padding: 4px 12px; border-radius: 20px; font-size: 0.78rem; font-weight: 700; }
.badge-draft { background: #EFE7E1; color: var(--muted); }
.badge-dikirim { background: var(--warning-light); color: var(--warning); }
.badge-diterima { background: var(--success-light); color: var(--success); }
.badge-bermasalah { background: var(--danger-light); color: var(--danger); }
.badge-low { background: var(--danger-light); color: var(--danger); }
.badge-ok { background: var(--success-light); color: var(--success); }

/* ===================== Toasts (replaces alert()/flash-div) ===================== */
#toast-region {
  position: fixed;
  left: 0; right: 0;
  top: calc(12px + var(--safe-top));
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  padding: 0 14px;
}
.toast {
  pointer-events: auto;
  max-width: 480px;
  width: 100%;
  background: var(--text);
  color: #fff;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  transform: translateY(-12px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-info { background: var(--info); }
.toast .icon { font-size: 1.1rem; }

/* legacy inline flash (still used as fallback / non-JS) */
.flash { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 0.9rem; font-weight: 600; }
.flash-success { background: var(--success-light); color: var(--success); border: 1px solid #BFE3CA; }
.flash-error { background: var(--danger-light); color: var(--danger); border: 1px solid #F0C4BD; }
.flash-info { background: var(--info-light); color: var(--info); border: 1px solid #C8DEF0; }

/* ===================== Progress bar ===================== */
.progress-wrap { margin: 6px 0 4px; }
.progress-label { display: flex; justify-content: space-between; font-size: 0.85rem; font-weight: 700; margin-bottom: 6px; color: var(--text); }
.progress-track { background: var(--border); border-radius: 20px; height: 12px; overflow: hidden; }
.progress-fill { background: var(--success); height: 100%; border-radius: 20px; transition: width 0.3s ease; }
.progress-fill.zero { background: var(--border); }

/* ===================== Task/checklist rows ===================== */
.task-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  background: var(--card);
}
.task-row.done { background: var(--success-light); border-color: #BFE3CA; }
.task-row .title { font-weight: 600; font-size: 0.95rem; }
.task-row .shift-tag { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.02em; }
.task-toggle {
  min-width: 48px; min-height: 48px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: #fff;
  font-size: 1.3rem;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.task-toggle.checked { background: var(--success); border-color: var(--success); color: #fff; }

/* ===================== Misc ===================== */
.helper-text { color: var(--muted); font-size: 0.85rem; }
.login-wrap { max-width: 420px; margin: 0 auto; padding: 24px 16px; min-height: 100vh; display: flex; flex-direction: column; justify-content: center; }
.team-btn {
  display: flex; align-items: center; gap: 14px;
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  min-height: 64px;
}
.team-btn:hover { border-color: var(--primary); text-decoration: none; }
.team-btn .emoji { font-size: 1.6rem; }
.team-btn.owner { border-style: dashed; color: var(--muted); }

/* Banner Peringatan (paling atas Dashboard staff) - paling menonjol drpd card lain, supaya hal
   yang perlu ditindaklanjuti langsung kebaca duluan. Versi "semua beres" (warning-banner-ok)
   dideklarasikan SETELAH .warning-banner supaya override warna merah->hijau-nya menang. */
.warning-banner {
  background: var(--danger-light); border: 2px solid var(--danger);
  border-radius: var(--radius); padding: 14px 16px; margin-bottom: 16px;
}
.warning-banner-title {
  display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 0.95rem;
  color: var(--danger); margin-bottom: 8px;
}
.warning-banner-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 11px 12px; background: #fff; border-radius: var(--radius-sm); margin-top: 6px;
  text-decoration: none; color: var(--text); font-size: 0.88rem; font-weight: 600;
}
.warning-banner-item:hover { text-decoration: none; background: var(--danger-light); }
.warning-banner-item i { color: var(--muted); font-size: 0.8rem; flex-shrink: 0; }
.warning-banner-ok {
  display: flex; align-items: center; gap: 10px;
  background: var(--success-light); border-color: var(--success); color: var(--success);
  font-weight: 700; font-size: 0.92rem;
}
.warning-banner-ok i { font-size: 1.3rem; }

.ai-summary-card {
  background: linear-gradient(160deg, var(--dark-card) 0%, var(--dark-card-deep) 100%);
  color: #fff; border-radius: var(--radius);
  padding: 20px; margin-bottom: 16px; box-shadow: 0 8px 24px rgba(15, 24, 38, 0.28);
}
.ai-summary-header {
  display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 0.78rem;
  text-transform: uppercase; letter-spacing: 0.06em; opacity: 0.95; margin-bottom: 10px;
  color: var(--accent);
}
.ai-summary-text { font-size: 1rem; line-height: 1.65; margin: 0; }
.ai-summary-meta { margin-top: 14px; font-size: 0.74rem; opacity: 0.75; }

/* Quotes Semangat Harian (Dashboard staff) - SENGAJA kontras dgn .ai-summary-card yg serius/gelap:
   ceria, pastel peach->gold, teks tengah, tanda tangan persona "Min-koe". */
.daily-quote-card {
  background: linear-gradient(135deg, #FFE3D9 0%, #FFF1D0 100%);
  border: 1px solid #FFCBAF; border-radius: var(--radius);
  padding: 22px 20px; margin-bottom: 16px; text-align: center;
}
.daily-quote-header {
  font-weight: 700; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--brand-red); margin-bottom: 10px;
}
.daily-quote-text { font-size: 1.05rem; font-style: italic; color: var(--text); line-height: 1.6; margin: 0; }
.daily-quote-signature { margin-top: 12px; font-weight: 700; font-size: 0.85rem; color: var(--primary-dark); }

/* Catatan dari Admin (Dashboard staff) - notifikasi persisten sampai staff klik "Sudah Dibaca".
   Border kiri warna sesuai jenis (hijau=positif, merah=negatif) supaya langsung kebaca sekilas. */
.admin-note-card {
  background: var(--card); border: 1px solid var(--border); border-left: 4px solid var(--success);
  border-radius: var(--radius); padding: 16px; margin-bottom: 16px;
}
.admin-note-card.admin-note-negatif { border-left-color: var(--danger); }
.admin-note-header { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.admin-note-title { font-weight: 700; font-size: 0.9rem; }
.admin-note-date { font-size: 0.78rem; color: var(--muted); margin-left: auto; }
.admin-note-text { font-size: 0.9rem; line-height: 1.5; margin: 0; white-space: pre-wrap; }
.admin-note-photo { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; margin-top: 10px; display: block; }

/* Avatar bulat yg fallback ke logo-icon.png (belum ada foto profil sendiri) - beda perlakuan dari
   foto asli: pakai contain + padding supaya sun ray/jengger ayam yg mepet tepi kanvas 512x512
   TIDAK kepotong sama mask border-radius:50%. Foto asli tetap object-fit:cover di style inline. */
.avatar-fallback-logo { object-fit: contain; box-sizing: border-box; background: var(--primary-light); }

/* ===================== Dashboard: Perlu Perhatian ===================== */
.attention-card-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.attention-card-title { display: flex; align-items: center; gap: 8px; font-size: 1.1rem; font-weight: 700; margin: 0; }
.attention-count-badge {
  background: var(--danger); color: #fff; font-weight: 700; font-size: 0.76rem;
  min-width: 24px; height: 24px; border-radius: 12px; display: flex; align-items: center;
  justify-content: center; padding: 0 7px; flex-shrink: 0;
}
.attention-row {
  display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--border);
  text-decoration: none; color: inherit;
}
.attention-row:last-of-type { border-bottom: none; }
.attention-row:hover { text-decoration: none; }
.attention-avatar {
  width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--primary-light);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--primary-dark);
  font-size: 1.1rem;
}
.attention-info { flex: 1; min-width: 0; }
.attention-name { font-weight: 700; font-size: 0.9rem; }
.attention-desc { font-size: 0.78rem; color: var(--muted); margin-top: 2px; }
.attention-chip {
  font-size: 0.68rem; font-weight: 700; padding: 3px 9px; border-radius: 20px;
  white-space: nowrap; display: inline-block; margin-top: 5px;
}
.chip-warning { background: var(--warning-light); color: var(--warning); }
.chip-danger { background: var(--danger-light); color: var(--danger); }
.chip-info { background: var(--info-light); color: var(--info); }
.attention-chevron { color: var(--muted); flex-shrink: 0; font-size: 0.85rem; }
.attention-empty { padding: 16px 0; text-align: center; color: var(--muted); font-size: 0.85rem; }
.attention-row-hidden { display: none; }
.attention-see-all {
  display: block; width: 100%; text-align: center; margin-top: 8px; padding: 8px;
  font-weight: 700; font-size: 0.85rem; background: none; border: none; cursor: pointer; color: var(--primary-dark);
}

/* ===================== Dashboard: Ringkasan Minggu Ini ===================== */
.week-highlight-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 10px; }
@media (max-width: 560px) { .week-highlight-grid { grid-template-columns: 1fr; } }
.week-highlight-item {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 14px 10px; text-align: center;
}
.week-highlight-icon { font-size: 1.5rem; margin-bottom: 6px; }
.week-highlight-label {
  font-size: 0.7rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 700;
}
.week-highlight-value { font-size: 1.05rem; font-weight: 800; margin-top: 4px; }
.week-highlight-sub { font-size: 0.76rem; color: var(--muted); margin-top: 2px; }

.stat-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.stat-tile {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; display: flex; align-items: center; gap: 12px;
}
.stat-tile .stat-icon {
  width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 1.1rem; color: #fff;
}
.stat-tile .stat-icon.c-success { background: var(--success); }
.stat-tile .stat-icon.c-danger { background: var(--danger); }
.stat-tile .stat-icon.c-warning { background: var(--warning); }
.stat-tile .stat-icon.c-info { background: var(--info); }
.stat-tile .num { font-size: 1.35rem; font-weight: 800; color: var(--text); line-height: 1.1; }
.stat-tile .label { color: var(--muted); font-size: 0.72rem; line-height: 1.2; }

canvas.sig-pad { border: 1.5px dashed var(--border); border-radius: var(--radius-sm); background: #fff; touch-action: none; width: 100%; max-width: 320px; height: auto; }

.gps-status { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-radius: var(--radius-sm); font-size: 0.88rem; font-weight: 600; margin-top: 8px; }
.gps-status.pending { background: var(--warning-light); color: var(--warning); }
.gps-status.ok { background: var(--success-light); color: var(--success); }
.gps-status.error { background: var(--danger-light); color: var(--danger); }

/* Banner "Mohon Respon" Perizinan & Tukar Shift - ditaruh di partials/nav.ejs (di bawah header),
   jadi muncul di PALING ATAS SEMUA halaman (bukan cuma /absensi) begitu ada permintaan yg belum
   direspon staff ini sbg pengganti. max-height+overflow supaya kalau ada banyak sekaligus, tetap
   ringkas (scroll kecil) - bukan mendorong seluruh halaman ke bawah tak terkendali. */
.izin-banner-stack { max-height: 220px; overflow-y: auto; background: var(--warning-light); border-bottom: 2px solid var(--warning); }
.izin-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 16px; border-bottom: 1px solid rgba(0,0,0,0.06); }
.izin-banner:last-child { border-bottom: none; }
.izin-banner-text { color: var(--warning); font-size: 0.86rem; flex: 1; min-width: 200px; }
.izin-banner-text i { margin-right: 4px; }
.izin-banner-actions { display: flex; gap: 8px; }

/* Riwayat Absen: jam masuk/pulang ditandai merah+putih (bukan cuma yang telat) supaya jam absen
   gampang kelihatan sekilas di tabel/daftar riwayat - lihat views/absensi/index.ejs. */
.jam-absen-badge {
  display: inline-block;
  background: var(--danger);
  color: #fff;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.85rem;
  white-space: nowrap;
}

.selfie-preview { width: 100%; max-width: 240px; border-radius: var(--radius); border: 2px solid var(--border); display: block; margin-top: 10px; }
.selfie-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  width: 100%; max-width: 240px; aspect-ratio: 1 / 1;
  border: 2px dashed var(--border); border-radius: var(--radius);
  background: var(--primary-light); color: var(--primary-dark);
  font-weight: 700; cursor: pointer; font-size: 0.95rem;
}
.selfie-btn .icon { font-size: 2.2rem; }

.spinner {
  display: inline-block; width: 18px; height: 18px;
  border: 3px solid rgba(255,255,255,0.4); border-top-color: #fff;
  border-radius: 50%; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (min-width: 720px) {
  .container { max-width: 900px; }
}

/* ===================== Input Cepat (Kelola Jobdesk) ===================== */
.quick-sop-card { background: linear-gradient(180deg, var(--primary-light) 0%, var(--card) 100%); }
.quick-sop-card textarea { min-height: 150px; }

.quick-sop-item {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 0; border-bottom: 1px solid var(--border);
}
.quick-sop-item .qsi-target { width: auto; min-width: 140px; }
.quick-sop-item .qsi-title { flex: 1; min-width: 160px; }
.quick-sop-item .qsi-foto-label {
  display: flex; align-items: center; gap: 4px; margin: 0;
  font-weight: 400; font-size: 0.78rem; white-space: nowrap;
}
.quick-sop-item .qsi-foto-label input[type=checkbox] { width: auto; min-height: auto; }

/* ===================== Cek Kualitas Produk ===================== */
.kualitas-cell { font-weight: 700; white-space: nowrap; }
.kualitas-status-btn { border: 2px solid transparent; }
.kualitas-status-btn.selected { border-color: var(--text); }

/* ===================== Kelola Jobdesk (accordion Outlet > SOP > Kelompok > Item) ===================== */
.badge-entity { background: var(--info-light); color: var(--info); }

.jobdesk-outlet {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 4px 14px; margin-bottom: 10px;
}
.jobdesk-outlet > summary {
  cursor: pointer; font-weight: 800; font-size: 1.05rem; padding: 14px 0;
  display: flex; align-items: center; gap: 8px;
}

.jobdesk-sop {
  margin: 4px 0 12px 8px; padding-left: 10px; border-left: 3px solid var(--primary-light);
}
.jobdesk-sop > summary {
  cursor: pointer; font-weight: 700; font-size: 0.95rem; color: var(--primary-dark); padding: 8px 0;
  display: flex; align-items: center; gap: 8px;
}

.jobdesk-kelompok {
  border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: 4px 12px; margin: 10px 0;
  background: var(--bg);
}
.jobdesk-kelompok > summary {
  cursor: pointer; font-weight: 700; font-size: 0.85rem; color: var(--muted); padding: 10px 0;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.jobdesk-kelompok > summary [data-kelompok-nama] { color: var(--text); }
.jobdesk-kelompok > form,
.jobdesk-kelompok > .jobdesk-item-list,
.jobdesk-kelompok > .jobdesk-add-form { margin-left: 2px; }

.jobdesk-count, .jobdesk-count-wrap { font-weight: 400; font-size: 0.78rem; color: var(--muted); }

.jobdesk-item { border-bottom: 1px solid var(--border); }
.jobdesk-item:last-child { border-bottom: none; }
.jobdesk-item > summary {
  cursor: pointer; padding: 10px 4px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.jobdesk-item-title { flex: 1; min-width: 120px; font-weight: 600; font-size: 0.92rem; }
.jobdesk-item-body { padding: 6px 4px 16px; display: flex; flex-direction: column; gap: 6px; }
.jobdesk-item-body label { margin: 0; font-size: 0.85rem; }
.jobdesk-item-actions {
  display: flex; flex-wrap: wrap; gap: 16px; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--border);
}
.jobdesk-item-actions form { flex: 1; min-width: 180px; }

.jobdesk-hint { display: block; font-weight: 400; color: var(--muted); font-size: 0.74rem; margin-top: 2px; }

/* Panah disclosure native browser dipakai apa adanya sbg penanda expand/collapse - cukup rapikan
   marker & spacing supaya konsisten lintas level. */
.jobdesk-outlet > summary::marker,
.jobdesk-sop > summary::marker,
.jobdesk-kelompok > summary::marker,
.jobdesk-item > summary::marker { color: var(--primary); }
summary { list-style-position: outside; }
summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.jobdesk-item-reorder { display: flex; flex-direction: column; gap: 2px; flex-shrink: 0; }
.jobdesk-move-btn {
  border: 1px solid var(--border); background: var(--card); color: var(--muted);
  border-radius: 6px; width: 26px; height: 20px; font-size: 0.7rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.jobdesk-move-btn:hover:not(:disabled) { background: var(--primary-light); color: var(--primary-dark); border-color: var(--primary-light); }
.jobdesk-move-btn:disabled { opacity: 0.3; cursor: not-allowed; }
