/* ==========================================================================
   Dashboard Karyawan (#viewDashboardSaya) — tampilan profesional
   Dimuat SETELAH assets/css/style.css & blok <style> inline di user/index.php,
   jadi aturan di sini sengaja memakai selector `#viewDashboardSaya .idc-layout …`
   (spesifisitas lebih tinggi) agar menang tanpa !important.
   ========================================================================== */

[hidden] { display: none !important; }

/* ---------- Urutan & tata letak ---------- */
/* Mobile / sempit (kolom tunggal): Hero → Pintasan → Absensi Hari Ini → Tugas → ID Card → Ringkasan → Jatah → Keuangan → Riwayat */
#viewDashboardSaya .idc-layout .idc-hero        { order: 0; }
#viewDashboardSaya .idc-layout .idc-p-pin       { order: 1; }
#viewDashboardSaya .idc-layout .idc-p-today     { order: 2; }
#viewDashboardSaya .idc-layout .idc-p-tugas     { order: 3; }
#viewDashboardSaya .idc-layout .idc-card-block  { order: 4; }
#viewDashboardSaya .idc-layout .idc-p-ring      { order: 5; }
#viewDashboardSaya .idc-layout .idc-p-jatah     { order: 6; }
#viewDashboardSaya .idc-layout .idc-p-fin       { order: 7; }
#viewDashboardSaya .idc-layout .idc-hist        { order: 8; }

/* Riwayat selalu satu kolom (tabel absensi punya 7 kolom, butuh lebar penuh) */
#viewDashboardSaya .idc-layout .idc-hist { grid-template-columns: minmax(0, 1fr); gap: 16px; }

/* Desktop: kolom kiri (ID Card) + kanan (konten); Hero & Pintasan melebar penuh */
@container dsaya (min-width: 860px) {
  #viewDashboardSaya .idc-layout .idc-hero,
  #viewDashboardSaya .idc-layout .idc-p-pin { grid-column: 1 / -1; }
  /* urutan di dalam kolom = urutan DOM */
  #viewDashboardSaya .idc-layout .idc-p-pin,
  #viewDashboardSaya .idc-layout .idc-p-today,
  #viewDashboardSaya .idc-layout .idc-p-tugas,
  #viewDashboardSaya .idc-layout .idc-card-block,
  #viewDashboardSaya .idc-layout .idc-p-ring,
  #viewDashboardSaya .idc-layout .idc-p-jatah,
  #viewDashboardSaya .idc-layout .idc-p-fin,
  #viewDashboardSaya .idc-layout .idc-hist { order: 0; }
  #viewDashboardSaya .idc-layout .idc-p-jatah { order: 1; }
  #viewDashboardSaya .idc-layout .idc-p-ring  { order: 2; }
}

/* ---------- Hero: tile statistik ---------- */
.idc-hero-stats {
  flex: 1 1 100%; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 4px;
}
.idc-hs {
  background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 14px; padding: 10px 14px; backdrop-filter: blur(2px);
}
.idc-hs-v { font-size: clamp(18px, 2vw, 24px); font-weight: 800; line-height: 1.1; color: #fff; }
.idc-hs-v small { font-size: 11px; font-weight: 700; opacity: .8; }
.idc-hs-l { font-size: 11px; font-weight: 600; opacity: .85; margin-top: 3px; }
@container dsaya (max-width: 640px) {
  .idc-hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.idc-hero-btn[data-goto] { white-space: nowrap; }

/* ---------- Pintasan: SATU baris slide geser kiri/kanan ---------- */
.idc-p-pin { padding: 14px 0 12px; overflow: hidden; }
.idc-p-pin .idc-panel-title { padding: 0 18px; margin-bottom: 8px; }
.idc-pin-hint { margin-left: auto; font-size: 11px; font-weight: 600; color: #94a3b8; }
.idc-slider { position: relative; }

.idc-pin-track {
  display: flex; flex-wrap: nowrap; gap: 10px;
  overflow-x: auto; overflow-y: hidden;
  padding: 8px 18px 14px; scroll-padding: 0 18px;
  scroll-snap-type: x proximity; scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain;
  scrollbar-width: none; cursor: grab; outline: none;
}
.idc-pin-track::-webkit-scrollbar { display: none; }
.idc-pin-track:focus-visible { box-shadow: inset 0 0 0 2px #93b4f5; border-radius: 12px; }
.idc-pin-track.dragging { cursor: grabbing; scroll-snap-type: none; scroll-behavior: auto; user-select: none; }
.idc-pin-track.dragging .idc-pin-btn { pointer-events: none; }

#viewDashboardSaya .idc-pin-track .idc-pin-btn {
  flex: 0 0 108px; width: 108px; min-height: 100px; scroll-snap-align: start;
  padding: 14px 6px 12px; user-select: none; -webkit-user-select: none;
}
.idc-pin-track .idc-pin-label { font-size: 12px; max-width: 100%; word-break: break-word; }
@container dsaya (max-width: 520px) {
  #viewDashboardSaya .idc-pin-track .idc-pin-btn { flex-basis: 92px; width: 92px; min-height: 92px; }
}

/* Bayangan pudar di tepi kiri/kanan sebagai petunjuk "masih bisa digeser" */
.idc-slider::before, .idc-slider::after {
  content: ''; position: absolute; top: 0; bottom: 6px; width: 40px; z-index: 2;
  pointer-events: none; opacity: 1; transition: opacity .2s;
}
.idc-slider::before { left: 0;  background: linear-gradient(90deg, #fff 18%, rgba(255, 255, 255, 0)); }
.idc-slider::after  { right: 0; background: linear-gradient(270deg, #fff 18%, rgba(255, 255, 255, 0)); }
.idc-slider.at-start::before, .idc-slider.at-end::after, .idc-slider.no-scroll::before, .idc-slider.no-scroll::after { opacity: 0; }

/* Tombol panah */
.idc-sl-nav {
  position: absolute; top: calc(50% - 8px); transform: translateY(-50%); z-index: 3;
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid #dbe3ee; background: #fff;
  color: #1155CC; font-size: 22px; line-height: 1; font-weight: 700; cursor: pointer;
  display: grid; place-items: center; padding: 0 0 3px;
  box-shadow: 0 6px 16px rgba(15, 23, 42, .16); transition: opacity .15s, transform .12s, background .12s;
}
.idc-sl-nav:hover { background: #eef4ff; transform: translateY(-50%) scale(1.06); }
.idc-sl-nav:active { transform: translateY(-50%) scale(.96); }
.idc-sl-nav.prev { left: 6px; }
.idc-sl-nav.next { right: 6px; }
.idc-slider.at-start .idc-sl-nav.prev, .idc-slider.at-end .idc-sl-nav.next,
.idc-slider.no-scroll .idc-sl-nav { opacity: 0; pointer-events: none; }
/* Layar sentuh: cukup swipe, panah disembunyikan */
@media (hover: none) and (pointer: coarse) { .idc-sl-nav { display: none; } }

/* Penanda posisi geser */
.idc-sl-prog { height: 3px; margin: 0 18px; border-radius: 99px; background: #eef2f7; overflow: hidden; }
.idc-sl-prog > i { display: block; height: 100%; width: 30%; border-radius: 99px; background: #1155CC; transition: margin-left .08s linear; }

/* ---------- Judul panel: elemen kanan ---------- */
.idc-title-right { margin-left: auto; display: inline-flex; align-items: center; }

/* ---------- Absensi Hari Ini ---------- */
.idc-p-today { border-color: #c7d7f5; background: linear-gradient(160deg, #f4f8ff 0%, #fff 62%); }
.idc-td-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.idc-td-tile {
  --c: #94a3b8; background: #fff; border: 1px solid #e6ecf5; border-left: 4px solid var(--c);
  border-radius: 14px; padding: 12px 14px; min-width: 0;
}
.idc-td-tile.in  { --c: #10b981; }
.idc-td-tile.out { --c: #f43f5e; }
.idc-td-l { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 800; color: #64748b; text-transform: uppercase; letter-spacing: .04em; }
.idc-td-l i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); display: inline-block; }
.idc-td-v { font-size: clamp(24px, 3vw, 30px); font-weight: 800; color: #cbd5e1; line-height: 1.15; margin-top: 4px; font-variant-numeric: tabular-nums; }
.idc-td-tile.done .idc-td-v { color: #0f172a; }
.idc-td-s { font-size: 11.5px; color: #64748b; margin-top: 2px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; min-height: 22px; }
.idc-td-jadwal { margin-top: 10px; font-size: 12.5px; color: #334155; background: #f1f5fb; border-radius: 10px; padding: 8px 12px; }
.idc-td-jadwal.muted { color: #94a3b8; }
.idc-td-cta { width: 100%; justify-content: center; margin-top: 10px; padding: 10px 14px; border-radius: 12px; font-weight: 800; }
.idc-alert { margin-top: 10px; font-size: 12.5px; font-weight: 600; border-radius: 10px; padding: 8px 12px; }
.idc-alert.warn { background: #fef3c7; color: #92400e; }
.idc-alert.bad  { background: #fee2e2; color: #991b1b; }
.idc-jd-title { margin: 14px 0 6px; font-size: 12px; font-weight: 800; color: #475569; text-transform: uppercase; letter-spacing: .04em; }
.idc-jd-strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.idc-jd-chip {
  flex: 0 0 auto; min-width: 84px; background: #fff; border: 1px solid #e6ecf5; border-radius: 12px;
  padding: 8px 10px; display: flex; flex-direction: column; gap: 1px; text-align: center;
}
.idc-jd-chip b { font-size: 12.5px; color: #0f172a; }
.idc-jd-chip span { font-size: 11.5px; font-weight: 700; color: #1155CC; }
.idc-jd-chip small { font-size: 10.5px; color: #64748b; }

/* ---------- Foto bukti absen ---------- */
.idc-foto-btn {
  border: 1px solid #dbe3ee; background: #f8fafc; color: #334155; border-radius: 999px;
  font: inherit; font-size: 11px; font-weight: 800; padding: 2px 9px; cursor: pointer; white-space: nowrap;
}
.idc-foto-btn:hover { background: #eaf1ff; border-color: #93b4f5; color: #1155CC; }
.idc-foto-btn.pulang:hover { background: #ffe9ee; border-color: #f9a8b8; color: #be123c; }

/* ---------- Ringkasan absensi: kartu mini ---------- */
.idc-mini-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.idc-mini { --c: #94a3b8; background: #f8fafc; border: 1px solid #eef2f7; border-left: 3px solid var(--c); border-radius: 12px; padding: 10px 12px; min-width: 0; }
.idc-mini-l { font-size: 10.5px; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: .03em; }
.idc-mini-v { font-size: 17px; font-weight: 800; color: var(--c); margin-top: 3px; line-height: 1.2; }
@media (max-width: 480px) {
  .idc-mini-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .idc-mini-grid .idc-mini:last-child { grid-column: 1 / -1; }
}

/* ---------- Riwayat absensi: filter + tabel ---------- */
.idc-filter { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.idc-fchip {
  border: 1px solid #dbe3ee; background: #fff; color: #475569; border-radius: 999px;
  font: inherit; font-size: 12px; font-weight: 700; padding: 5px 12px; cursor: pointer; transition: background .12s, border-color .12s;
}
.idc-fchip b { margin-left: 3px; color: #1155CC; }
.idc-fchip:hover { background: #f1f6ff; }
.idc-fchip.on { background: #1155CC; border-color: #1155CC; color: #fff; }
.idc-fchip.on b { color: #fff; }

.idc-scroll { max-height: 440px; overflow: auto; border: 1px solid #eef2f7; border-radius: 12px; }
.idc-scroll-sm { max-height: 340px; }
.idc-scroll .idc-table thead th { position: sticky; top: 0; z-index: 1; }
.idc-table-abs td { vertical-align: middle; }
.idc-td-tgl b { display: block; font-size: 12.5px; }
.idc-td-tgl small, .idc-telat, .idc-ket { display: block; font-size: 10.5px; color: #64748b; margin-top: 1px; }
.idc-telat { color: #b45309; font-weight: 700; }
.idc-td-jam { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.idc-td-foto { white-space: nowrap; }
.idc-td-foto .idc-foto-btn + .idc-foto-btn { margin-left: 4px; }
.idc-table tr.is-today td { background: #f3f8ff; }
.idc-today-tag { display: inline-block; font-size: 9.5px; font-weight: 800; color: #1155CC; background: #dbe8ff; border-radius: 999px; padding: 1px 7px; margin-left: 4px; vertical-align: middle; }
.idc-row-link { cursor: pointer; }
.idc-row-link:hover td { background: #f1f6ff !important; }

/* ---------- Riwayat pengajuan: ringkasan status ---------- */
.idc-sum-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 8px; }
.idc-sum { border-radius: 12px; padding: 9px 12px; display: flex; align-items: baseline; gap: 8px; border: 1px solid; }
.idc-sum b { font-size: 20px; font-weight: 800; line-height: 1; }
.idc-sum span { font-size: 11.5px; font-weight: 700; }
.idc-sum.warn { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.idc-sum.ok   { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.idc-sum.bad  { background: #fef2f2; border-color: #fecaca; color: #991b1b; }

/* ---------- Kerapian umum ---------- */
.idc-panel-title .idc-tg-lihat { white-space: nowrap; }
@media (prefers-reduced-motion: reduce) {
  .idc-pin-track { scroll-behavior: auto; }
  .idc-sl-nav, .idc-sl-prog > i { transition: none; }
}
