/**
 * PRESENSIABSEN — Admin CSS Fixes & Enhancements
 * ================================================
 * File ini DITAMBAHKAN setelah main.css (link terpisah atau append ke main.css).
 * Berisi: perbaikan bug, peningkatan responsif, dan polish visual admin panel.
 *
 * Cara pakai: tambahkan di admin.html setelah baris main.css:
 *   <link rel="stylesheet" href="css/admin-fixes.css" />
 */


/* ============================================================
   BUG FIX 1: Broken Dark-Mode Skeleton Selector
   Di main.css baris ~114, selector [data-theme='dark'] tidak
   punya closing brace sebelum komentar .skeleton — CSS-nya
   "jatuh" ke selektor berikutnya sehingga dark-mode skeleton
   tidak pernah aktif.
   ============================================================ */
[data-theme='dark'] .skeleton {
  background: linear-gradient(90deg, #162542 25%, #1e2f4d 37%, #162542 63%);
  background-size: 400% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
}


/* ============================================================
   BUG FIX 2: --indigo-500 tidak didefinisikan di :root
   Dipakai di dark mode focus state & error teks, tapi variabel
   ini tidak ada di :root — fallback ke --indigo.
   ============================================================ */
:root {
  --indigo-500: #2563eb;
  --blue: #2563eb;
  --blue-soft: #dbeafe;
  --navy-mid-alt: #1e2f4d;
}


/* ============================================================
   BUG FIX 3: Tab-nav mobile – overflow & text terpotong
   Teks label tab terpotong di HP < 390px karena min-width
   dan font-size terlalu besar untuk jumlah tab yang banyak.
   ============================================================ */
@media (max-width: 1023px) {
  .tab-nav {
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .tab-nav::-webkit-scrollbar {
    display: none;
  }

  .tab-btn {
    min-width: 52px !important;
    flex-shrink: 0 !important;
  }
}

/* HP sangat kecil: sembunyikan label, hanya ikon */
@media (max-width: 360px) {
  .tab-btn span:not(.tab-icon) {
    display: none !important;
  }

  .tab-btn {
    min-width: 40px !important;
    padding: 6px 4px !important;
  }
}


/* ============================================================
   BUG FIX 4: Modal bottom-sheet di mobile – safe area
   Pada iPhone dengan notch/Dynamic Island, konten modal terpotong
   karena tidak memperhitungkan safe-area-inset-bottom.
   ============================================================ */
@media (max-width: 1023px) {
  .modal-overlay {
    padding-bottom: env(safe-area-inset-bottom, 0px) !important;
  }

  .modal-box {
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .tab-nav {
    padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px)) !important;
  }
}


/* ============================================================
   BUG FIX 5: Rekap grid di tablet (768–1023px) terlalu sempit
   Filter sidebar + konten tidak muat di satu baris,
   gunakan kolom penuh dan stack vertikal.
   ============================================================ */
@media (min-width: 768px) and (max-width: 1023px) {
  .rekap-grid-layout {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
  }

  #reports-grid-layout>.card:first-child {
    width: 100% !important;
  }
}


/* ============================================================
   BUG FIX 6: .btn width: 100% menimpa inline-flex tombol aksi
   di header laporan (export PDF/Excel/CSV tampil terlalu lebar).
   ============================================================ */
.btn-export-pdf,
.btn-export-excel,
.btn-export-csv {
  width: auto !important;
}

/* Khusus rekap-download-grid: tombol export tetap full di grid */
.rekap-download-grid .btn-export-pdf,
.rekap-download-grid .btn-export-excel {
  width: 100% !important;
}

/* Aksi koreksi absensi harus tetap terlihat sebagai tombol-tombol kecil,
   bukan melebar penuh seperti tombol form biasa. */
#report-display-container .attendance-admin-actions {
  padding: 8px 10px;
  min-width: 180px;
  vertical-align: middle;
}

#report-display-container .attendance-admin-actions__group {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

#report-display-container .attendance-admin-action {
  width: auto !important;
  flex: 0 0 auto;
  min-height: 28px;
  padding: 4px 7px !important;
  font-size: 10px !important;
  line-height: 1.2;
  white-space: nowrap;
}

#report-display-container .attendance-admin-action.btn-primary {
  background: var(--indigo);
  color: var(--text-on-dark);
  border-color: var(--indigo);
}

.correction-toolbar {
  display: flex;
  align-items: end;
  gap: 8px;
  flex-wrap: wrap;
}
.correction-toolbar .input { width: auto; min-width: 150px; }
.correction-toolbar .field-label { margin-bottom: 6px; }
.correction-table { min-width: 700px; }
@media (max-width: 767px) {
  .correction-toolbar { align-items: stretch; flex-direction: column; }
  .correction-toolbar .input,
  .correction-toolbar .btn { width: 100% !important; min-width: 0; }
  .correction-table { min-width: 680px; }
}


/* ============================================================
   BUG FIX 7: Table min-width memaksa horizontal scroll
   di desktop (> 1024px) — tidak perlu di layar lebar.
   ============================================================ */
@media (min-width: 1024px) {

  .table-responsive .table,
  table.table {
    min-width: unset;
    width: 100%;
  }
}


/* ============================================================
   BUG FIX 8: .admin-stat-card icon box-shadow "inset" error
   `box-shadow: inset 0 0 0 1px currentColor` pada ikon lingkaran
   memunculkan border putih yang tidak diinginkan di light mode.
   ============================================================ */
.admin-stat-icon {
  box-shadow: none !important;
}


/* ============================================================
   ENHANCEMENT: Dashboard Admin — Sticky header di atas
   Menambahkan sticky header dengan judul & tombol refresh
   agar selalu terlihat saat scroll.
   ============================================================ */
.admin-dash-header {
  position: sticky;
  top: 0;
  z-index: 15;
  background: var(--surface-1);
  margin: -24px -40px 20px;
  padding: 16px 40px;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(6, 13, 31, 0.05);
  backdrop-filter: blur(8px);
}

@media (max-width: 1023px) {
  .admin-dash-header {
    margin: -12px -12px 16px;
    padding: 12px 16px;
  }
}

@media (min-width: 1024px) and (max-width: 1279px) {
  .admin-dash-header {
    margin: -32px -40px 24px;
    padding: 16px 40px;
  }
}


/* ============================================================
   ENHANCEMENT: Pill tanggal di dashboard — lebih rapi
   ============================================================ */
.admin-dash-pill {
  align-items: center;
}

.admin-dash-pill>div {
  white-space: nowrap;
}

#admin-dash-date {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}


/* ============================================================
   ENHANCEMENT: Admin Stat Cards — gradient accent top border
   Setiap kartu dapat warna aksen kiri sebagai penanda kategori.
   ============================================================ */
.admin-stat-card {
  border-top: 3px solid transparent;
  transition: transform 0.18s var(--ease-out),
    box-shadow 0.18s var(--ease-out),
    border-color 0.18s;
}

.admin-stat-card:nth-child(1) {
  border-top-color: var(--indigo);
}

.admin-stat-card:nth-child(2) {
  border-top-color: var(--emerald);
}

.admin-stat-card:nth-child(3) {
  border-top-color: var(--amber);
}

.admin-stat-card:nth-child(4) {
  border-top-color: var(--rose);
}

.admin-stat-card:nth-child(5) {
  border-top-color: #8b5cf6;
}

/* purple */

.admin-stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

/* Ikon lingkaran – warna konsisten dengan aksen */
.admin-stat-card:nth-child(1) .admin-stat-icon {
  background: var(--indigo-soft);
  color: var(--indigo);
}

.admin-stat-card:nth-child(2) .admin-stat-icon {
  background: var(--emerald-soft);
  color: var(--emerald);
}

.admin-stat-card:nth-child(3) .admin-stat-icon {
  background: var(--amber-soft);
  color: var(--amber);
}

.admin-stat-card:nth-child(4) .admin-stat-icon {
  background: var(--rose-soft);
  color: var(--rose);
}

.admin-stat-card:nth-child(5) .admin-stat-icon {
  background: #f3e8ff;
  color: #8b5cf6;
}


/* ============================================================
   ENHANCEMENT: Sidebar nav desktop — hover + active state
   lebih halus dengan transisi warna & indikator strip kiri.
   ============================================================ */
@media (min-width: 1024px) {
  .tab-btn {
    position: relative;
    overflow: hidden;
    transition: all 0.2s var(--ease-out) !important;
  }

  .tab-btn::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 3px;
    background: transparent;
    border-radius: 0 2px 2px 0;
    transition: background 0.2s;
  }

  .tab-btn.active::before {
    background: #fff;
  }

  /* Badge di sidebar nav */
  .tab-badge {
    right: 10px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    position: absolute;
  }
}


/* ============================================================
   ENHANCEMENT: Rekap filter sidebar — lebih kompak & rapi
   ============================================================ */
@media (min-width: 900px) {
  #reports-grid-layout>.card:first-child {
    position: sticky;
    top: 72px;
    /* Tinggi sticky header admin-dash */
    max-height: calc(100vh - 100px);
    max-height: calc(100dvh - 100px);
    overflow-y: auto;
  }
}

/* Label filter lebih kecil & subtle */
.rekap-grid-layout .field-label {
  font-size: 10px;
  letter-spacing: 0.07em;
}

.rekap-grid-layout .input,
.rekap-grid-layout .select {
  font-size: 13.5px;
  padding: 9px 11px;
}


/* ============================================================
   ENHANCEMENT: KPI Cards — lebih distinktif
   ============================================================ */
.kpi-card-exec {
  transition: transform 0.18s var(--ease-out), box-shadow 0.18s;
}

.kpi-card-exec:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.kpi-card-exec .kpi-value {
  font-size: 22px;
  font-family: var(--font-mono);
}


/* ============================================================
   ENHANCEMENT: Report table — header sticky
   Saat tabel laporan panjang, header kolom tetap terlihat.
   ============================================================ */
#report-display-container table thead th {
  position: sticky;
  top: 0;
  background: var(--surface-1);
  z-index: 5;
  box-shadow: 0 2px 0 var(--border);
}

/* Table row hover effect */
#report-display-container table tbody tr {
  transition: background 0.12s;
}

#report-display-container table tbody tr:hover {
  background: var(--indigo-soft) !important;
}


/* ============================================================
   ENHANCEMENT: Tombol export — ukuran & ikon konsisten
   ============================================================ */
.btn-export-pdf,
.btn-export-excel {
  padding: 8px 14px !important;
  font-size: 12.5px !important;
  font-weight: 700 !important;
  border-radius: var(--r-md) !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  white-space: nowrap;
}


/* ============================================================
   ENHANCEMENT: Approval cards — lebih profesional
   ============================================================ */
.approval {
  transition: transform 0.18s var(--ease-out),
    box-shadow 0.18s var(--ease-out),
    border-color 0.18s;
  border-left: 3px solid transparent;
}

.approval:hover {
  border-left-color: var(--indigo);
}

.approval-head {
  align-items: center;
}

/* Badge status pada approval */
.approval .badge {
  font-size: 10px;
  padding: 2px 8px;
}


/* ============================================================
   ENHANCEMENT: Scroll indicator di tabel mobile
   ============================================================ */
.table-responsive {
  position: relative;
}

@media (max-width: 768px) {
  .table-responsive::after {
    content: '← scroll →';
    display: block;
    text-align: center;
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 600;
    padding: 4px 0 2px;
    letter-spacing: 0.06em;
  }
}


/* ============================================================
   ENHANCEMENT: Dark mode – perbaikan warna yang kurang kontras
   ============================================================ */
[data-theme='dark'] .admin-stat-card {
  background: var(--surface-1);
  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme='dark'] .admin-stat-value {
  color: #f0f4ff;
}

[data-theme='dark'] .admin-stat-label {
  color: var(--text-secondary);
}

[data-theme='dark'] .admin-stat-delta {
  color: var(--text-muted);
}

[data-theme='dark'] .kpi-card-exec {
  background: var(--surface-1);
  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme='dark'] .kpi-card-exec .kpi-value {
  color: #f0f4ff;
}

[data-theme='dark'] .admin-log-row {
  background: var(--surface-1);
  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme='dark'] .admin-log-row:hover {
  background: var(--surface-2);
  border-color: var(--indigo);
}

[data-theme='dark'] .admin-dash-header {
  background: rgba(6, 13, 31, 0.85);
  border-bottom-color: rgba(255, 255, 255, 0.07);
}

[data-theme='dark'] .bulk-day-date {
  color: var(--text-primary);
}

[data-theme='dark'] #report-display-container table thead th {
  background: var(--surface-2);
  color: var(--text-secondary);
}

[data-theme='dark'] #report-display-container table tbody tr:hover {
  background: rgba(59, 91, 255, 0.12) !important;
}


/* ============================================================
   ENHANCEMENT: Tablet layout (768–1023px) — header app tampil
   Di tablet, tampilkan header mini horizontal (bukan sidebar).
   ============================================================ */
@media (min-width: 768px) and (max-width: 1023px) {

  .app-header .header-row,
  .app-header .header-meta {
    display: flex !important;
  }

  .app-header {
    display: block !important;
    padding: 10px 20px !important;
    background: #ffffff !important;
  }

  .header-row {
    flex-direction: row !important;
    align-items: center !important;
  }

  .header-greeting .name {
    font-size: 15px !important;
  }

  .header-meta {
    margin-top: 6px !important;
    font-size: 10px !important;
  }
}


/* ============================================================
   ENHANCEMENT: Jadwal bulk input — grid lebih rapi di tablet
   ============================================================ */
@media (min-width: 600px) and (max-width: 1023px) {
  #bulk-day-rows {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }
}

.bulk-day-row {
  align-items: center;
}

.bulk-day-date {
  line-height: 1.2;
}


/* ============================================================
   ENHANCEMENT: Pengaturan / Settings — tabel akses hak
   Scroll horizontal lebih smooth dengan snapping
   ============================================================ */
#page-pengaturan .table-responsive {
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

#page-pengaturan .table-responsive table {
  min-width: 680px;
}


/* ============================================================
   ENHANCEMENT: Empty state — tampil lebih menarik
   ============================================================ */
.empty-state {
  padding: 48px 24px;
  text-align: center;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.5;
}

.empty-state-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.empty-state-desc {
  font-size: 13px;
  line-height: 1.6;
}


/* ============================================================
   ENHANCEMENT: Toast — animasi masuk/keluar lebih smooth
   ============================================================ */
.toast {
  animation: toastIn 0.3s var(--ease-out) both;
  pointer-events: auto;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(-12px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.toast.removing {
  animation: toastOut 0.25s ease-in both;
}

@keyframes toastOut {
  from {
    opacity: 1;
    transform: scale(1);
  }

  to {
    opacity: 0;
    transform: scale(0.9);
  }
}


/* ============================================================
   ENHANCEMENT: Loading skeleton — animasi lebih smooth
   ============================================================ */
.skeleton {
  animation: skeleton-shimmer 1.6s ease-in-out infinite !important;
}


/* ============================================================
   ENHANCEMENT: Fokus aksesibilitas — ring lebih jelas
   (penting untuk keyboard navigation & audit WCAG)
   ============================================================ */
:focus-visible {
  outline: 2px solid var(--indigo);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

button:focus-visible,
.tab-btn:focus-visible {
  outline: 2px solid var(--indigo);
  outline-offset: 2px;
}


/* ============================================================
   ENHANCEMENT: Print styles — laporan cetak rapi
   ============================================================ */
@media print {

  .app-header,
  .tab-nav,
  .admin-dash-header,
  .btn-export-pdf,
  .btn-export-excel,
  .btn-export-csv,
  .btn-secondary,
  .chips,
  .rekap-grid-layout>.card:first-child {
    display: none !important;
  }

  .main {
    padding-bottom: 0 !important;
    overflow: visible !important;
  }

  .page {
    padding: 0 !important;
  }

  table {
    page-break-inside: avoid;
  }

  thead {
    display: table-header-group;
  }

  tbody tr {
    page-break-inside: avoid;
  }
}


/* ============================================================
   ENHANCEMENT: Smooth scrollbar custom (desktop)
   ============================================================ */
@media (min-width: 1024px) {

  .main::-webkit-scrollbar,
  #reports-grid-layout>*::-webkit-scrollbar {
    width: 5px;
  }

  .main::-webkit-scrollbar-track,
  #reports-grid-layout>*::-webkit-scrollbar-track {
    background: transparent;
  }

  .main::-webkit-scrollbar-thumb,
  #reports-grid-layout>*::-webkit-scrollbar-track:hover {
    background: var(--border-mid);
    border-radius: 3px;
  }

  .main::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
  }
}


/* ============================================================
   ENHANCEMENT: Transisi halaman (page switch)
   ============================================================ */
.page.active {
  animation: fadeSlideIn 220ms var(--ease-out) both;
}

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* ============================================================
   RESPONSIVE POLISH — Specific page tweaks
   ============================================================ */

/* Dashboard: chart height adaptif */
@media (max-width: 480px) {

  #trendChart,
  #reportChart {
    max-height: 180px;
  }

  .card [style*="height:250px"],
  .card [style*="height: 250px"] {
    height: 200px !important;
  }
}

/* Approval: action buttons full-width di mobile */
@media (max-width: 520px) {
  .approval-actions {
    flex-direction: column !important;
  }

  .approval-actions .btn {
    width: 100% !important;
    justify-content: center;
  }
}

/* Karyawan filter: wrap & full-width input di mobile */
@media (max-width: 600px) {

  #emp-search,
  #emp-filter-div,
  #emp-filter-regu {
    width: 100% !important;
    min-width: 0 !important;
  }
}

/* Admin dash pill: sembunyikan teks tanggal di HP kecil */
@media (max-width: 480px) {
  .admin-dash-pill>div {
    display: none !important;
  }

  .admin-dash-pill {
    padding: 6px !important;
    gap: 6px !important;
  }
}

/* Report export buttons: wrap 2 per baris di mobile */
@media (max-width: 600px) {
  #report-display-container+div [style*="display:flex"][style*="gap"] {
    flex-wrap: wrap !important;
  }
}

/* ================================================================
   UPDATE v2 — REKAP PAGE LAYOUT FIX (terpotong di web/desktop)
   Root cause: min-width:0 hilang di grid column ke-2 +  
   overflow-x tidak diset di .main + grid column pakai 1fr bukan minmax(0,1fr)
   ================================================================ */
/* ============================================================
   PATCH: Rekap / Laporan page layout fix
   Root cause: 3 masalah bertumpuk yang menyebabkan konten
   terpotong di sebelah kanan pada halaman Rekap.
   ============================================================ */

/* Fix 1: .main perlu overflow-x: hidden agar kolom grid
   tidak bisa "kabur" melewati batas container */
.main {
  overflow-x: hidden;
}

/* Fix 2: .rekap-grid-layout — kolom konten (1fr) WAJIB
   punya min-width:0. Tanpa ini, 1fr bisa overflow karena
   konten di dalamnya (tabel, kard) punya lebar intrinsik. */
.rekap-grid-layout {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

/* Kolom kedua rekap grid (konten area) */
.rekap-grid-layout>*:last-child,
#reports-grid-layout>div:last-child {
  min-width: 0;
  overflow: hidden;
}

/* Fix 3: Di desktop, paksa grid pakai minmax agar
   kolom konten tidak meluber */
@media (min-width: 1024px) {
  .rekap-grid-layout {
    display: grid !important;
    grid-template-columns: 260px minmax(0, 1fr) !important;
    gap: 20px !important;
    align-items: start !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Page rekap tidak perlu max-width yang membatasi */
  #page-rekap {
    max-width: 100% !important;
    padding: 24px 32px !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }
}

/* Fix 4: Konten area di dalam kolom ke-2 juga perlu
   min-width: 0 dan overflow terkontrol */
#reports-grid-layout>div:last-child>.card,
#reports-grid-layout>div:last-child>div {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

/* Fix 5: Table di dalam rekap — pakai scroll horizontal
   yang proper, bukan overflow meluber */
#report-display-container {
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

#report-display-container table {
  width: 100%;
  min-width: 600px;
  /* Batas minimum kolom tabel agar tidak terlalu sempit */
  table-layout: auto;
}

/* Fix 6: Ringkasan Statistik Kehadiran (kartu di atas tabel)
   tidak boleh overflow horizontal */
#report-stats-card {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden;
}

#report-stats-card>div[style*="display:grid"],
.kpi-summary-grid {
  min-width: 0;
  width: 100%;
}

/* Fix 7: Chip tabs di header rekap — overflow wrap */
#report-view-selector {
  flex-wrap: wrap !important;
  gap: 6px !important;
}

/* Fix 8: Header kartu "Laporan Kehadiran" + tombol export
   wrap ke bawah jika tidak muat */
#page-rekap .card>div[style*="display:flex"][style*="justify-content:space-between"] {
  flex-wrap: wrap !important;
  gap: 10px !important;
}

/* Tombol export: wrap dan tidak overflow */
#page-rekap [style*="display:flex"][style*="gap:8px"] {
  flex-wrap: wrap !important;
}

/* Fix 9: Filter sidebar — pastikan tidak meluber */
#reports-grid-layout>.card:first-child {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

/* Fix 10: Input date di filter tidak boleh melebihi lebar sidebar */
#filter-date-range-wrap input[type="date"],
#filter-date-single-wrap input[type="date"],
#rep-date-from,
#rep-date-to,
#rep-date-single {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* Tablet (768-1023px): stack vertikal, tidak ada overflow */
@media (min-width: 768px) and (max-width: 1023px) {
  .rekap-grid-layout {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
    overflow: hidden !important;
  }

  #reports-grid-layout>.card:first-child,
  #reports-grid-layout>div:last-child {
    width: 100% !important;
    min-width: 0 !important;
  }
}

/* Mobile (< 768px): full stack */
@media (max-width: 767px) {

  .rekap-grid-layout,
  #reports-grid-layout {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    overflow: hidden !important;
  }
}

/* ============================================================
   COMPREHENSIVE ADMIN DASHBOARD LAYOUT FIX
   Overrides all conflicting rules in main.css to ensure:
   - No right-side overflow/clipping
   - Proper spacing and alignment
   - Clean avatar fallbacks (no black squares)
   - Responsive on mobile + desktop
   ============================================================ */

/* === ROOT CAUSE FIX: Prevent grid child overflow === */
#page-dashboard-admin {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  overflow-x: hidden !important;
}

/* Force .main to not overflow its grid track */
.main {
  min-width: 0 !important;
  overflow-x: hidden !important;
}

/* Force all tables inside dashboard to not push parent wider */
#page-dashboard-admin .table {
  min-width: 0 !important;
  width: 100% !important;
  table-layout: auto !important;
}

#page-dashboard-admin .table-responsive {
  overflow-x: auto !important;
  max-width: 100% !important;
  min-width: 0 !important;
}

/* === 1. HEADER V2 === */
.admin-dash-header-v2 {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  margin-bottom: 16px !important;
  background: var(--surface-0) !important;
  border: 1px solid var(--border) !important;
  border-radius: 12px !important;
  padding: 14px 18px !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04) !important;
  position: static !important;
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
}

.admin-dash-titlewrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex-shrink: 1;
}

.admin-dash-title {
  font-size: 18px !important;
  font-weight: 800 !important;
  color: var(--text-primary) !important;
  margin: 0 !important;
}

.admin-dash-subtitle {
  font-size: 12px !important;
  color: var(--text-muted) !important;
  margin: 0 !important;
}

.admin-dash-actions-bar {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  flex-wrap: wrap !important;
  flex-shrink: 0 !important;
}

.admin-dash-time-info {
  text-align: right;
  line-height: 1.3;
}

.dash-date-text {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
}

.dash-updated-text {
  font-size: 10.5px;
  color: var(--text-muted);
}

.admin-dash-btn-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.admin-dash-btn-group .btn-sm {
  padding: 5px 10px !important;
  font-size: 11.5px !important;
  font-weight: 700 !important;
  border-radius: 6px !important;
  white-space: nowrap !important;
}

.admin-dash-refresh-icon {
  width: 30px !important;
  height: 30px !important;
  padding: 0 !important;
  border-radius: 6px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* === 2. STAT GRID & CARDS === */
/* Override main.css .admin-stat-grid (repeat(2,1fr), gap:var(--s3)) */
.admin-stat-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)) !important;
  gap: 12px !important;
  margin-bottom: 16px !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}

/* Override main.css .admin-stat-grid .admin-stat-card:nth-child(5):last-child span */
.admin-stat-grid .admin-stat-card:nth-child(5):last-child {
  grid-column: auto !important;
}

/* Override main.css .admin-stat-card */
.admin-stat-card {
  background: var(--surface-0) !important;
  border: 1px solid var(--border) !important;
  border-radius: 10px !important;
  padding: 12px 14px !important;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04) !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  box-sizing: border-box !important;
  transition: transform 0.15s ease, box-shadow 0.15s ease !important;
  /* Override main.css border-top colors from admin-fixes.css lines 217-237 */
  border-top-color: var(--border) !important;
}

.admin-stat-card:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06) !important;
  border-color: var(--indigo) !important;
}

.admin-stat-icon {
  width: 38px !important;
  height: 38px !important;
  border-radius: 8px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  box-shadow: none !important;
}

.admin-stat-body {
  flex: 1 !important;
  min-width: 0 !important;
}

.admin-stat-label {
  font-size: 11px !important;
  font-weight: 600 !important;
  color: var(--text-muted) !important;
  margin-bottom: 1px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.admin-stat-value {
  font-size: 20px !important;
  font-weight: 800 !important;
  color: var(--text-primary) !important;
  line-height: 1.2 !important;
  margin-bottom: 2px !important;
}

.admin-stat-delta {
  font-size: 10.5px !important;
  font-weight: 600 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* === 3. CARDS — override main.css === */
#page-dashboard-admin .card {
  background: var(--surface-0) !important;
  border: 1px solid var(--border) !important;
  border-radius: 12px !important;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04) !important;
  margin-bottom: 16px !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
}

#page-dashboard-admin .card-header {
  padding: 12px 16px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
  flex-wrap: wrap !important;
  border-bottom: 1px solid var(--border) !important;
  background: var(--surface-0) !important;
}

#page-dashboard-admin .card-title {
  font-size: 13px !important;
  font-weight: 800 !important;
  color: var(--text-primary) !important;
  margin: 0 !important;
  white-space: nowrap !important;
}

/* === 4. CHART LEGEND === */
.enterprise-chart-legend {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  flex-wrap: wrap !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  color: var(--text-muted) !important;
}

.enterprise-legend-dot {
  width: 8px !important;
  height: 8px !important;
  border-radius: 50% !important;
  display: inline-block !important;
  margin-right: 3px !important;
}

/* === 5. LOG ABSENSI LIST — override main.css === */
/* Override main.css .admin-log-list { gap: 8px } */
#page-dashboard-admin .admin-log-list {
  padding: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 0 !important;
}

/* Override main.css .admin-log-row { border: 1.5px solid; border-radius; } */
#page-dashboard-admin .admin-log-row {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 10px 16px !important;
  border: none !important;
  border-bottom: 1px solid var(--border) !important;
  border-radius: 0 !important;
  gap: 10px !important;
  transition: background 0.12s ease !important;
  background: var(--surface-0) !important;
  cursor: default !important;
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
}

#page-dashboard-admin .admin-log-row:last-child {
  border-bottom: none !important;
}

/* Override main.css .admin-log-row:hover { border-color: var(--indigo) } */
#page-dashboard-admin .admin-log-row:hover {
  background: var(--surface-1) !important;
  border-color: transparent !important;
  border-bottom-color: var(--border) !important;
}

.admin-log-main-col {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  min-width: 0 !important;
  flex: 1 !important;
  cursor: pointer !important;
}

/* Override main.css .admin-log-thumb { width:46px; background: var(--surface-1) } */
/* FIX: background was causing black squares */
#page-dashboard-admin .admin-log-thumb {
  width: 40px !important;
  height: 40px !important;
  border-radius: 8px !important;
  overflow: hidden !important;
  flex-shrink: 0 !important;
  border: 1px solid var(--border) !important;
  background: #f1f5f9 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

#page-dashboard-admin .admin-log-thumb img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
  background: transparent !important;
}

.admin-log-info {
  min-width: 0 !important;
  flex: 1 !important;
}

.admin-log-name {
  font-size: 13px !important;
  font-weight: 700 !important;
  color: var(--text-primary) !important;
  display: flex !important;
  align-items: center !important;
  gap: 5px !important;
  flex-wrap: wrap !important;
  margin-bottom: 2px !important;
}

.admin-log-meta {
  font-size: 11px !important;
  color: var(--text-muted) !important;
  display: flex !important;
  align-items: center !important;
  gap: 5px !important;
  flex-wrap: wrap !important;
  margin-top: 2px !important;
}

.admin-log-actions-col {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  flex-shrink: 0 !important;
}

.admin-log-actions-col .btn-sm,
.admin-log-actions-col .btn {
  padding: 4px 8px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  border-radius: 6px !important;
  white-space: nowrap !important;
}

/* === 6. SUSPICIOUS ATTEMPTS TABLE FIX === */
#card-suspicious-attempts .card-header {
  gap: 8px !important;
}

#card-suspicious-attempts .card-header .btn-sm {
  padding: 4px 10px !important;
  font-size: 11px !important;
  white-space: nowrap !important;
}

/* === 7. LOG ABSENSI SEARCH/FILTER FIX === */
.admin-log-card .card-header {
  gap: 8px !important;
}

#admin-dash-search {
  width: 150px !important;
  max-width: 180px !important;
  min-width: 100px !important;
  font-size: 12px !important;
  padding: 6px 10px !important;
  box-sizing: border-box !important;
}

#admin-dash-filter-regu {
  width: 130px !important;
  max-width: 160px !important;
  min-width: 100px !important;
  font-size: 12px !important;
  padding: 6px 10px !important;
  box-sizing: border-box !important;
}

/* === 8. ALERT BANNERS === */
#page-dashboard-admin .dash-banner {
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
}

/* === 8B. DASHBOARD HERO — selaras dengan referensi dashboard v2 === */
.admin-hero-summary {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 218px;
  margin-bottom: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface-0);
  box-shadow: var(--shadow-md, 0 8px 24px rgba(15, 25, 60, 0.08));
}

.admin-hero-radial {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  padding: 22px 18px;
  color: #fff;
  text-align: center;
  background: linear-gradient(165deg, var(--navy), #132445);
}

.admin-hero-ring {
  --attendance-progress: 0deg;
  width: 136px;
  height: 136px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--emerald) var(--attendance-progress), rgba(255, 255, 255, 0.14) 0deg);
  position: relative;
}

.admin-hero-ring::after {
  content: '';
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: var(--navy);
}

.admin-hero-ring-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.admin-hero-ring-content strong {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 500;
  line-height: 1;
}

.admin-hero-ring-content span {
  margin-top: 5px;
  color: var(--text-on-dark-2);
  font-size: 10px;
}

.admin-hero-radial p {
  max-width: 220px;
  margin: 0;
  color: var(--text-on-dark-2);
  font-size: 11px;
  line-height: 1.45;
}

.admin-hero-radial p strong {
  color: #fff;
}

.admin-hero-details {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 22px;
  min-width: 0;
  padding: 24px;
}

.admin-hero-details-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.admin-hero-eyebrow {
  display: block;
  margin-bottom: 4px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.admin-hero-details h3 {
  margin: 0;
  color: var(--text-primary);
  font-size: 16px;
}

.admin-hero-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  padding: 5px 9px;
  border-radius: var(--r-full);
  background: var(--emerald-soft);
  color: var(--success-600);
  font-size: 10px;
  font-weight: 700;
}

.admin-hero-live i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 0 3px rgba(0, 201, 122, .14);
}

.admin-hero-chips {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.admin-hero-chip {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
}

.admin-hero-chip span {
  display: block;
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 10.5px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-hero-chip strong {
  display: block;
  margin-top: 6px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 23px;
  font-weight: 500;
}

.admin-hero-chip.chip-ontime { background: var(--success-50); }
.admin-hero-chip.chip-late { background: var(--warning-50); }
.admin-hero-chip.chip-absent { background: var(--danger-50); }
.admin-hero-chip.chip-leave { background: var(--indigo-soft); }

@media (max-width: 760px) {
  .admin-hero-summary { grid-template-columns: 1fr; }
  .admin-hero-radial { min-height: 220px; }
  .admin-hero-details { padding: 18px; }
  .admin-hero-chips { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 420px) {
  .admin-hero-details-head { flex-direction: column; }
  .admin-hero-live { align-self: flex-start; }
}

/* === 9. RESPONSIVE: MOBILE (<768px) === */
@media (max-width: 768px) {
  .admin-dash-header-v2 {
    flex-direction: column !important;
    align-items: flex-start !important;
    padding: 12px 14px !important;
    gap: 10px !important;
  }

  .admin-dash-actions-bar {
    width: 100% !important;
    justify-content: flex-start !important;
    gap: 8px !important;
  }

  .admin-dash-time-info {
    text-align: left !important;
  }

  .admin-stat-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }

  #page-dashboard-admin .admin-log-row {
    padding: 8px 12px !important;
  }

  .admin-log-actions-col {
    gap: 4px !important;
  }

  #admin-dash-search {
    width: 120px !important;
  }

  #admin-dash-filter-regu {
    width: 110px !important;
  }
}

@media (max-width: 480px) {
  .admin-stat-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 6px !important;
  }

  .admin-stat-card {
    padding: 10px !important;
  }

  .admin-stat-value {
    font-size: 18px !important;
  }

  #page-dashboard-admin .admin-log-row {
    flex-wrap: wrap !important;
  }

  .admin-log-actions-col {
    width: 100% !important;
    justify-content: flex-end !important;
    margin-top: 4px !important;
    padding-left: 50px !important;
  }
}

/* === 10. RESPONSIVE: DESKTOP (1024px+) === */
@media (min-width: 1024px) {
  .admin-stat-grid {
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 14px !important;
  }

  #page-dashboard-admin .card-title {
    font-size: 14px !important;
  }
}

/* === 11. DARK MODE === */
[data-theme='dark'] .admin-dash-header-v2 {
  background: var(--surface-1) !important;
  border-color: rgba(255,255,255,0.08) !important;
}

[data-theme='dark'] #page-dashboard-admin .card {
  background: var(--surface-1) !important;
  border-color: rgba(255,255,255,0.08) !important;
}

[data-theme='dark'] #page-dashboard-admin .card-header {
  background: var(--surface-1) !important;
  border-bottom-color: rgba(255,255,255,0.06) !important;
}

[data-theme='dark'] .admin-stat-card {
  background: var(--surface-1) !important;
  border-color: rgba(255,255,255,0.08) !important;
  border-top-color: rgba(255,255,255,0.08) !important;
}

[data-theme='dark'] #page-dashboard-admin .admin-log-row {
  background: var(--surface-1) !important;
  border-bottom-color: rgba(255,255,255,0.06) !important;
}

[data-theme='dark'] #page-dashboard-admin .admin-log-row:hover {
  background: var(--surface-2) !important;
}

[data-theme='dark'] #page-dashboard-admin .admin-log-thumb {
  background: #0f172a !important;
  border-color: rgba(255,255,255,0.1) !important;
}

[data-theme='dark'] .admin-dash-title,
[data-theme='dark'] .dash-date-text,
[data-theme='dark'] .admin-stat-value,
[data-theme='dark'] #page-dashboard-admin .card-title,
[data-theme='dark'] .admin-log-name {
  color: #f0f4ff !important;
}


/* ============================================================
   PREMIUM DRIBBBLE-STYLE EMPLOYEE DASHBOARD (#page-beranda)
   ============================================================ */

#page-beranda {
  background: #FAF6F0 !important;
  min-height: 100vh;
  padding: 0 !important;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif !important;
  box-sizing: border-box;
}

.beranda-header-block {
  background: #3D2E25; /* Coffee Brown */
  color: #FAF6F0;
  padding: 24px 20px 84px; /* Space for card overhang */
  border-bottom-left-radius: 32px;
  border-bottom-right-radius: 32px;
  position: relative;
  box-sizing: border-box;
}

.beranda-profile-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.beranda-profile-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.beranda-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #FAF6F0;
  color: #3D2E25;
  font-size: 16px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(250, 246, 240, 0.2);
}

.beranda-profile-info {
  display: flex;
  flex-direction: column;
}

.beranda-welcome {
  font-size: 11px;
  color: rgba(250, 246, 240, 0.7);
  font-weight: 500;
}

.beranda-name {
  font-size: 15px;
  font-weight: 800;
  color: #FAF6F0;
}

.beranda-role {
  font-size: 10px;
  color: #F39C12;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 1px;
}

.beranda-notif-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(250, 246, 240, 0.1);
  border: none;
  color: #FAF6F0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}

.beranda-notif-btn:hover {
  background: rgba(250, 246, 240, 0.2);
}

.beranda-notif-btn svg {
  width: 18px;
  height: 18px;
}

.beranda-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 20px;
}

.beranda-title {
  font-size: 20px !important;
  font-weight: 800 !important;
  color: #FAF6F0 !important;
  margin: 0 !important;
  line-height: 1.2 !important;
}

.beranda-date {
  font-size: 12px;
  color: rgba(250, 246, 240, 0.8);
  font-weight: 700;
}

/* White Overlapping Attendance Card */
.beranda-attendance-card {
  background: #FFFFFF;
  border-radius: 24px;
  padding: 20px;
  box-shadow: 0 10px 25px rgba(61, 46, 37, 0.08);
  position: absolute;
  bottom: -90px;
  left: 20px;
  right: 20px;
  z-index: 5;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.beranda-attn-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.beranda-clock {
  font-size: 32px;
  font-weight: 800;
  color: #3D2E25;
  margin: 6px 0;
  letter-spacing: -0.02em;
  font-family: 'DM Mono', monospace;
}

.beranda-shift-row {
  display: flex;
  justify-content: space-around;
  width: 100%;
  margin: 8px 0 12px;
  padding: 8px 0;
  border-top: 1px solid #FAF6F0;
  border-bottom: 1px solid #FAF6F0;
}

.beranda-shift-row .shift-col {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.beranda-shift-row .shift-col .lbl {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.beranda-shift-row .shift-col .val {
  font-size: 13px;
  font-weight: 800;
  color: #3D2E25;
  margin-top: 2px;
}

.beranda-shift-row .shift-col .val.positive {
  color: #00c97a;
}

.beranda-location {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 16px;
  text-align: center;
  width: 100%;
}

.beranda-location svg {
  color: #F39C12;
}

.beranda-btn-checkin {
  width: 100%;
  background: #F39C12 !important; /* Orange-yellow primary */
  color: #FFFFFF !important;
  border: none !important;
  border-radius: 99px !important;
  padding: 12px 24px !important;
  font-size: 14px !important;
  font-weight: 800 !important;
  cursor: pointer !important;
  transition: background 0.2s, transform 0.15s !important;
  box-shadow: 0 4px 12px rgba(243, 156, 18, 0.25) !important;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.beranda-btn-checkin:hover {
  background: #E67E22 !important;
  transform: translateY(-1px);
}

.beranda-btn-checkin:active {
  transform: translateY(1px);
}

/* Content Area */
.beranda-content-area {
  padding: 110px 20px 24px; /* Offset overlapping card */
  box-sizing: border-box;
}

.beranda-section-title {
  font-size: 13px;
  font-weight: 800;
  color: #3D2E25;
  margin: 24px 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Stats Cards */
.beranda-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.beranda-stat-card {
  background: #FFFFFF;
  border-radius: 18px;
  padding: 14px 10px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(61, 46, 37, 0.03);
  border: 1px solid rgba(61, 46, 37, 0.03);
  box-sizing: border-box;
}

.beranda-stat-card .val {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 2px;
}

.beranda-stat-card .lbl {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
}

.beranda-stat-card.present {
  background: #E5FFF4;
  border: 1px solid rgba(0, 201, 122, 0.15);
}

.beranda-stat-card.present .val {
  color: #00c97a;
}

.beranda-stat-card.late {
  background: #FFF7E0;
  border: 1px solid rgba(245, 158, 11, 0.15);
}

.beranda-stat-card.late .val {
  color: #f59e0b;
}

.beranda-stat-card.absent {
  background: #FFF0F3;
  border: 1px solid rgba(244, 63, 94, 0.15);
}

.beranda-stat-card.absent .val {
  color: #f43f5e;
}

/* Chart Widget */
.beranda-chart-card {
  background: #FFFFFF;
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(61, 46, 37, 0.03);
  border: 1px solid rgba(61, 46, 37, 0.03);
  box-sizing: border-box;
}

.beranda-chart-bars {
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
  height: 120px;
  padding-top: 20px;
  position: relative;
}

.beranda-chart-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  height: 100%;
  justify-content: flex-end;
  gap: 8px;
}

.beranda-chart-bar-wrap {
  width: 14px;
  height: 80px;
  background: #FAF6F0;
  border-radius: 10px;
  display: flex;
  align-items: flex-end;
  position: relative;
  cursor: pointer;
}

.beranda-chart-bar-fill {
  width: 100%;
  background: #F39C12;
  border-radius: 10px;
  height: 0%;
  transition: height 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.beranda-chart-col.is-today .beranda-chart-bar-fill {
  background: #3D2E25;
}

.beranda-chart-label {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-muted);
}

.beranda-chart-value-popup {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  background: #3D2E25;
  color: #FAF6F0;
  font-size: 8px;
  font-weight: 700;
  padding: 2px 4px;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
  z-index: 2;
}

.beranda-chart-bar-wrap:hover .beranda-chart-value-popup {
  opacity: 1;
}

/* Tabs active layout updates to match Dribbble style */
.tab-btn.active {
  color: #F39C12 !important;
}

.tab-btn.active .tab-icon {
  background: rgba(243, 156, 18, 0.1) !important;
  color: #F39C12 !important;
  border-radius: 8px;
  padding: 2px;
}


/* ============================================================
   DARK MODE FOR EMPLOYEE BERANDA
   ============================================================ */

[data-theme='dark'] #page-beranda {
  background: #121E31 !important;
}

[data-theme='dark'] .beranda-header-block {
  background: #18263E;
  color: #F0F4FF;
}

[data-theme='dark'] .beranda-avatar {
  background: #121E31;
  color: #F0F4FF;
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme='dark'] .beranda-notif-btn {
  background: rgba(255, 255, 255, 0.05);
}

[data-theme='dark'] .beranda-attendance-card {
  background: #1E2D4A;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

[data-theme='dark'] .beranda-clock {
  color: #F0F4FF;
}

[data-theme='dark'] .beranda-shift-row {
  border-top-color: rgba(255, 255, 255, 0.06);
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

[data-theme='dark'] .beranda-shift-row .shift-col .val {
  color: #F0F4FF;
}

[data-theme='dark'] .beranda-section-title {
  color: #FAF6F0;
}

[data-theme='dark'] .beranda-stat-card {
  box-shadow: none;
  border-color: rgba(255, 255, 255, 0.05);
}

[data-theme='dark'] .beranda-stat-card.present {
  background: rgba(0, 201, 122, 0.1);
}

[data-theme='dark'] .beranda-stat-card.late {
  background: rgba(245, 158, 11, 0.1);
}

[data-theme='dark'] .beranda-stat-card.absent {
  background: rgba(244, 63, 94, 0.1);
}

[data-theme='dark'] .beranda-chart-card {
  background: #1E2D4A;
  border-color: rgba(255, 255, 255, 0.05);
  box-shadow: none;
}

[data-theme='dark'] .beranda-chart-bar-wrap {
  background: #121E31;
}

[data-theme='dark'] .beranda-chart-col.is-today .beranda-chart-bar-fill {
  background: #F0F4FF;
}

/* ============================================================
   PANEL COLOR-CODED & VISUAL ACCENTS (MP CKD VS SECURITY)
   ============================================================ */
.bulk-panel-security {
  border-left: 6px solid #3b82f6 !important;
  background: rgba(59, 130, 246, 0.035) !important;
  border-radius: 12px;
  padding: 16px !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.bulk-panel-mpckd {
  border-left: 6px solid #f59e0b !important;
  background: rgba(245, 158, 11, 0.045) !important;
  border-radius: 12px;
  padding: 16px !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.bulk-panel-nonshift {
  border-left: 6px solid #10b981 !important;
  background: rgba(16, 185, 129, 0.035) !important;
  border-radius: 12px;
  padding: 16px !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Badges for departments */
.regu-badge-security {
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #93c5fd;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.regu-badge-mpckd {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* Info Banner Styling */
.schedule-info-banner {
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 13px;
  line-height: 1.5;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  animation: bannerFadeIn 0.25s ease-out;
}

.schedule-info-banner.mpckd {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 1.5px solid #f59e0b;
  color: #78350f;
}

.schedule-info-banner.security {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border: 1.5px solid #3b82f6;
  color: #1e3a8a;
}

.schedule-info-banner.nonshift {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  border: 1.5px solid #10b981;
  color: #065f46;
}

[data-theme='dark'] .schedule-info-banner.mpckd {
  background: linear-gradient(135deg, #2a1f09 0%, #3d2b0e 100%);
  border-color: #d97706;
  color: #fef3c7;
}

[data-theme='dark'] .schedule-info-banner.security {
  background: linear-gradient(135deg, #0e1e38 0%, #162a4d 100%);
  border-color: #2563eb;
  color: #dbeafe;
}

[data-theme='dark'] .schedule-info-banner.nonshift {
  background: linear-gradient(135deg, #06231a 0%, #0d3628 100%);
  border-color: #059669;
  color: #d1fae5;
}

/* Preset buttons theme adjustment */
.preset-mpckd-theme #preset-btn-1 {
  border-color: #f59e0b !important;
  background: #fffbeb !important;
  color: #b45309 !important;
}
.preset-mpckd-theme #preset-btn-2 {
  border-color: #ea580c !important;
  background: #fff7ed !important;
  color: #c2410c !important;
}
.preset-mpckd-theme #preset-btn-3 {
  border-color: #7c3aed !important;
  background: #faf5ff !important;
  color: #6d28d9 !important;
}

[data-theme='dark'] .preset-mpckd-theme #preset-btn-1 {
  background: rgba(245, 158, 11, 0.15) !important;
  color: #fde68a !important;
}
[data-theme='dark'] .preset-mpckd-theme #preset-btn-2 {
  background: rgba(234, 88, 12, 0.15) !important;
  color: #fed7aa !important;
}
[data-theme='dark'] .preset-mpckd-theme #preset-btn-3 {
  background: rgba(124, 58, 237, 0.15) !important;
  color: #e9d5ff !important;
}

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

/* --- Row highlights for MP CKD vs Security --- */
.bulk-panel-mpckd .bulk-day-row {
  background: rgba(245, 158, 11, 0.04);
  border-left: 3px solid #f59e0b;
}

.bulk-panel-mpckd .bulk-day-row:hover {
  background: rgba(245, 158, 11, 0.08);
}

.bulk-panel-security .bulk-day-row {
  background: rgba(59, 130, 246, 0.035);
  border-left: 3px solid #3b82f6;
}

.bulk-panel-security .bulk-day-row:hover {
  background: rgba(59, 130, 246, 0.07);
}

[data-theme='dark'] .bulk-panel-mpckd .bulk-day-row {
  background: rgba(245, 158, 11, 0.08);
  border-left-color: #d97706;
}

[data-theme='dark'] .bulk-panel-security .bulk-day-row {
  background: rgba(59, 130, 246, 0.08);
  border-left-color: #2563eb;
}

[data-theme='dark'] #bulk-weekly-rotator {
  background: rgba(245, 158, 11, 0.12) !important;
  border-color: rgba(245, 158, 11, 0.3) !important;
}

[data-theme='dark'] #bulk-weekly-rotator span {
  color: #fde68a !important;
}

/* ============================================================
   NEW MODERN ELEGANT DESIGN: SIDEBAR & JADWAL KERJA
   ============================================================ */

/* --- Sidebar Modern Minimalist --- */
@media (min-width: 1024px) {
  .app-header {
    background: #111620 !important;
    border-right: 1px solid rgba(255, 255, 255, 0.07) !important;
    padding: 24px 16px 20px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
  }

  .sidebar-brand-block {
    padding: 0 8px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 16px;
  }

  .sidebar-brand-title {
    font-size: 16px;
    font-weight: 700;
    color: #f8fafc;
    letter-spacing: -0.01em;
  }

  .sidebar-brand-sub {
    font-size: 11.5px;
    color: #94a3b8;
    margin-top: 2px;
  }

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

  .tab-nav {
    gap: 4px !important;
  }

  .tab-btn {
    border-radius: 8px !important;
    padding: 9px 12px !important;
    color: #94a3b8 !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    transition: all 0.15s ease !important;
    border: none !important;
    background: transparent !important;
  }

  .tab-btn:hover {
    background: rgba(255, 255, 255, 0.04) !important;
    color: #f1f5f9 !important;
  }

  .tab-btn.active {
    background: rgba(37, 99, 235, 0.14) !important;
    color: #60a5fa !important;
    font-weight: 600 !important;
  }

  .tab-btn.active .tab-icon svg {
    stroke: #60a5fa !important;
  }

  .tab-btn .tab-badge {
    background: #2563eb !important;
    color: #fff !important;
    font-size: 10.5px !important;
    font-weight: 700 !important;
    padding: 2px 7px !important;
    border-radius: 12px !important;
    margin-left: auto !important;
  }

  .sidebar-user-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 10px 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin-top: auto;
  }

  .sidebar-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #1e3a8a;
    color: #93c5fd;
    font-weight: 700;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  .sidebar-user-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
  }

  .sidebar-user-info {
    flex: 1;
    min-width: 0;
  }

  .sidebar-user-name {
    font-size: 12.5px;
    font-weight: 700;
    color: #f1f5f9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .sidebar-user-role {
    font-size: 11px;
    color: #64748b;
  }
}

/* --- Jadwal Kerja Modern Layout --- */
.jadwal-modern-wrap {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.jadwal-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.jadwal-topbar-left h1 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.01em;
}

.jadwal-topbar-left .jadwal-meta {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

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

.btn-topbar-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-topbar-export {
  background: var(--surface-1);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-topbar-export:hover {
  background: var(--surface-2);
}

.btn-topbar-save {
  background: #2563eb;
  color: #fff;
  border: 1px solid #1d4ed8;
}
.btn-topbar-save:hover {
  background: #1d4ed8;
}

/* Subnav Segmented Tabs */
.jadwal-subnav-tabs {
  display: flex;
  gap: 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 4px;
}

.jdw-subtab {
  padding: 8px 4px 12px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}

.jdw-subtab:hover {
  color: var(--text-primary);
}

.jdw-subtab.active {
  color: #3b82f6;
  border-bottom-color: #3b82f6;
}

/* Filter Control Bar */
.jadwal-control-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.month-picker-pill {
  display: inline-flex;
  align-items: center;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2px 4px;
}

.month-picker-pill button {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 6px;
}
.month-picker-pill button:hover {
  background: var(--surface-2);
  color: var(--text-primary);
}

.jdw-month-input {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  padding: 4px 8px;
  cursor: pointer;
}

.jdw-target-select {
  min-width: 220px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

/* Card: Isi Cepat Seluruh Bulan */
.jdw-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

.jdw-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.jdw-card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.jdw-btn-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}

.jdw-preset-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.jdw-preset-btn:hover {
  border-color: #3b82f6;
  color: #3b82f6;
}

.jdw-role-presets {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
}

.jdw-role-presets-title {
  margin-bottom: 8px;
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .02em;
}

.jdw-role-presets-grid .jdw-preset-btn {
  background: var(--surface-1);
  color: var(--text-secondary);
}

/* Card: Kalender Jadwal Grid */
.cal-grid-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  padding-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.cal-month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

.cal-grid-cell {
  background: var(--surface-0);
  border: 1px solid var(--border);
  border-radius: 10px;
  min-height: 74px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  position: relative;
}

.cal-grid-cell:hover {
  border-color: #3b82f6;
  transform: translateY(-1px);
}

.cal-grid-cell.is-empty {
  background: transparent;
  border: 1px dashed rgba(255, 255, 255, 0.03);
  cursor: default;
  pointer-events: none;
}

.cal-grid-cell.is-off {
  background: rgba(239, 68, 68, 0.08) !important;
  border-color: rgba(239, 68, 68, 0.25) !important;
}

.cal-cell-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.cal-cell-day {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.cal-cell-desc {
  font-size: 9.5px;
  color: #f87171;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60px;
}

.cal-cell-bottom {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  padding-top: 4px;
}

/* Penanda pada sel kalender jadwal ketika jadwal berubah otomatis oleh
   sistem (mis. hasil tukar jaga yang disetujui) — teks penuhnya ada di
   atribut title agar tetap terbaca saat sel terlalu sempit. */
.cal-cell-auto {
  display: inline-grid;
  place-items: center;
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  border-radius: 4px;
  background: rgba(148, 163, 184, 0.18);
  border: 1px solid rgba(148, 163, 184, 0.4);
  color: #cbd5e1;
  font-size: 9px;
  line-height: 1;
  cursor: help;
}

.cal-cell-auto.is-tukar {
  background: rgba(168, 85, 247, 0.2);
  border-color: rgba(168, 85, 247, 0.5);
  color: #d8b4fe;
}

/* Visual Color-Coded Pills */
.shift-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: all 0.15s ease;
}

.shift-pill.pill-1 {
  background: rgba(37, 99, 235, 0.2);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.35);
}

.shift-pill.pill-2 {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.shift-pill.pill-3 {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.shift-pill.pill-off {
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.shift-pill.pill-ns {
  background: rgba(20, 184, 166, 0.2);
  color: #2dd4bf;
  border: 1px solid rgba(20, 184, 166, 0.35);
}

.shift-pill.pill-flx {
  background: rgba(168, 85, 247, 0.2);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.35);
}

.shift-pill.pill-empty {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  border: 1px dashed rgba(255, 255, 255, 0.1);
}

.cal-dept-badge {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

@media (max-width: 768px) {
  .cal-grid-header,
  .cal-month-grid {
    min-width: 520px;
  }
  .cal-scroll-wrap {
    overflow-x: auto;
    padding-bottom: 8px;
  }
}

/* ================================================================
   MODAL DETAIL KARYAWAN (2-KOLOM ENTERPRISE)
   ================================================================ */

.emp-detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease-in-out;
}

.emp-detail-overlay.open {
  opacity: 1;
  visibility: visible;
}

.emp-detail-dialog {
  background: var(--surface-0, #ffffff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 16px;
  width: 100%;
  max-width: 1060px;
  height: min(90vh, 860px);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 48px -12px rgba(15, 23, 42, 0.35);
  overflow: hidden;
  animation: modalPopIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPopIn {
  from {
    transform: scale(0.96) translateY(8px);
    opacity: 0;
  }
  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

/* --- Topbar Header --- */
.emp-detail-topbar {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border, #e2e8f0);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface-0, #ffffff);
  flex-shrink: 0;
}

.emp-detail-topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.emp-topbar-badge {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--indigo, #4f46e5);
  background: rgba(79, 70, 229, 0.1);
  padding: 3px 8px;
  border-radius: 4px;
}

.emp-topbar-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--navy, #0f172a);
  margin: 0;
}

.emp-topbar-nik {
  font-size: 12px;
  font-family: monospace;
  font-weight: 700;
  color: var(--text-muted, #64748b);
  background: var(--surface-1, #f8fafc);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid var(--border, #e2e8f0);
}

.emp-detail-topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-emp-delete {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff1f2;
  border: 1px solid #fecdd3;
  color: #e11d48;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-emp-delete:hover {
  background: #ffe4e6;
  border-color: #fda4af;
  color: #be123c;
  transform: translateY(-1px);
}

.emp-modal-close {
  background: var(--surface-1, #f1f5f9);
  border: 1px solid var(--border, #e2e8f0);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-secondary, #475569);
  cursor: pointer;
  transition: all 0.15s ease;
}

.emp-modal-close:hover {
  background: var(--surface-2, #e2e8f0);
  color: var(--navy, #0f172a);
}

/* --- 2-Column Body --- */
.emp-detail-body {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* --- Kolom Kiri: Sidebar Profil & Live Status --- */
.emp-detail-sidebar {
  background: var(--surface-1, #f8fafc);
  border-right: 1px solid var(--border, #e2e8f0);
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.emp-id-card {
  text-align: center;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border, #e2e8f0);
}

.emp-avatar-circle {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  margin: 0 auto 10px;
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: #ffffff;
  font-size: 22px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
  letter-spacing: 1px;
}

.emp-name {
  font-size: 16px;
  font-weight: 800;
  color: var(--navy, #0f172a);
  margin: 0 0 6px 0;
}

.emp-nik-role {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}

.nik-pill {
  font-size: 11px;
  font-family: monospace;
  color: var(--text-secondary, #475569);
  background: var(--surface-0, #ffffff);
  border: 1px solid var(--border, #e2e8f0);
  padding: 2px 7px;
  border-radius: 4px;
}

.role-pill {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #1d4ed8;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 2px 7px;
  border-radius: 4px;
}

.emp-regu-div {
  font-size: 12px;
  color: var(--text-muted, #64748b);
  margin-top: 6px;
  font-weight: 500;
}

/* Live Status Box */
.emp-status-card {
  background: var(--surface-0, #ffffff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.emp-status-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--border, #e2e8f0);
}

.pulse-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.pulse-indicator.green {
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
}

.pulse-indicator.amber {
  background: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.25);
}

.pulse-indicator.gray {
  background: #94a3b8;
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.25);
}

.pulse-indicator.blue {
  background: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.emp-status-label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--navy, #0f172a);
}

.emp-today-shift {
  margin-top: 8px;
}

.shift-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  margin-bottom: 8px;
}

.shift-lbl {
  color: var(--text-muted, #64748b);
}

.shift-val {
  font-weight: 700;
  color: var(--navy, #0f172a);
}

.shift-times {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.time-box {
  background: var(--surface-1, #f8fafc);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 6px;
  padding: 6px 8px;
  text-align: center;
}

.time-box .t-lbl {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted, #64748b);
  display: block;
}

.time-box .t-val {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--navy, #0f172a);
  margin-top: 2px;
  display: block;
}

/* Statistik Ringkas */
.emp-stats-card {
  background: var(--surface-0, #ffffff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
  padding: 12px 14px;
}

.emp-stats-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--navy, #0f172a);
  margin-bottom: 8px;
}

.emp-stats-month {
  font-size: 10.5px;
  color: var(--text-muted, #64748b);
  font-weight: 600;
}

.emp-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.stat-mini-box {
  padding: 8px 6px;
  border-radius: 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.stat-mini-box.present {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.stat-mini-box.late {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}

.stat-mini-box.leave {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
}

.stat-mini-box.absent {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.stat-mini-box .stat-num {
  font-size: 17px;
  font-weight: 800;
  line-height: 1.1;
}

.stat-mini-box .stat-lbl {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  margin-top: 3px;
  opacity: 0.85;
}

/* Info Kontak */
.emp-contact-box {
  background: var(--surface-0, #ffffff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--text-secondary, #475569);
  word-break: break-all;
}

.contact-item .c-icon {
  font-size: 13px;
  flex-shrink: 0;
}

.btn-device-reset {
  width: 100%;
  padding: 8px 12px;
  border: 1px dashed var(--border, #e2e8f0);
  background: transparent;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-secondary, #475569);
  cursor: pointer;
  transition: all 0.15s ease;
  margin-top: auto;
}

.btn-device-reset:hover {
  background: var(--indigo-dim, #eef2ff);
  border-color: var(--indigo, #4f46e5);
  color: var(--indigo, #4f46e5);
}

/* --- Kolom Kanan: Panel 3 Tab --- */
.emp-detail-main {
  background: var(--surface-0, #ffffff);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.emp-tabs-nav {
  display: flex;
  gap: 6px;
  padding: 0 20px;
  border-bottom: 1px solid var(--border, #e2e8f0);
  background: var(--surface-0, #ffffff);
  flex-shrink: 0;
}

.emp-tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2.5px solid transparent;
  padding: 14px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted, #64748b);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.emp-tab-btn:hover {
  color: var(--navy, #0f172a);
}

.emp-tab-btn.active {
  color: var(--indigo, #4f46e5);
  border-bottom-color: var(--indigo, #4f46e5);
  font-weight: 700;
}

.emp-tab-pane {
  display: none;
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.emp-tab-pane.active {
  display: block;
}

/* Form Grid */
.emp-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.emp-form-grid .full-width {
  grid-column: 1 / -1;
}

.emp-form-actions {
  margin-top: 18px;
  display: flex;
  justify-content: flex-end;
}

.emp-activity-section {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border, #e2e8f0);
}

.section-subtitle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--navy, #0f172a);
  margin-bottom: 12px;
}

.activity-timeline {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 12px;
  background: var(--surface-1, #f8fafc);
  border-radius: 8px;
  border: 1px solid var(--border, #e2e8f0);
  font-size: 12px;
}

.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--indigo, #4f46e5);
  margin-top: 5px;
  flex-shrink: 0;
}

.activity-content {
  flex: 1;
}

.activity-title {
  font-weight: 700;
  color: var(--navy, #0f172a);
}

.activity-desc {
  color: var(--text-secondary, #475569);
  font-size: 11.5px;
  margin-top: 2px;
}

.activity-time {
  font-size: 10.5px;
  color: var(--text-muted, #64748b);
  white-space: nowrap;
}

.activity-empty {
  text-align: center;
  color: var(--text-muted, #64748b);
  font-size: 12px;
  padding: 16px 0;
}

/* Riwayat Toolbar & Table */
.riwayat-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.riwayat-month-picker {
  display: inline-flex;
  align-items: center;
  background: var(--surface-1, #f8fafc);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  padding: 2px;
}

.btn-picker-nav {
  background: transparent;
  border: none;
  font-size: 16px;
  font-weight: 700;
  padding: 4px 10px;
  color: var(--text-secondary, #475569);
  cursor: pointer;
  border-radius: 6px;
}

.btn-picker-nav:hover {
  background: var(--surface-2, #e2e8f0);
  color: var(--navy, #0f172a);
}

.input-sm {
  border: none !important;
  background: transparent !important;
  padding: 4px 8px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  color: var(--navy, #0f172a) !important;
}

.riwayat-stats-summary {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary, #475569);
}

.riwayat-subtabs {
  display: flex;
  gap: 6px;
  background: var(--surface-1, #f8fafc);
  padding: 3px;
  border-radius: 8px;
  border: 1px solid var(--border, #e2e8f0);
}

.riwayat-subtab-btn {
  background: transparent;
  border: none;
  font-size: 11.5px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 6px;
  color: var(--text-muted, #64748b);
  cursor: pointer;
  transition: all 0.15s ease;
}

.riwayat-subtab-btn:hover {
  color: var(--navy, #0f172a);
}

.riwayat-subtab-btn.active {
  background: var(--surface-0, #ffffff);
  color: var(--indigo, #4f46e5);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.riwayat-table-wrap {
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  overflow: hidden;
}

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

.table-compact th {
  background: var(--surface-1, #f8fafc);
  color: var(--text-secondary, #475569);
  font-weight: 700;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border, #e2e8f0);
}

.table-compact td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border, #e2e8f0);
  color: var(--navy, #0f172a);
  vertical-align: middle;
}

.table-compact tr:last-child td {
  border-bottom: none;
}

.table-compact tr:hover td {
  background: var(--surface-1, #f8fafc);
}

/* Hak Akses */
.perm-info-banner {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
}

.perm-info-banner .info-icon {
  font-size: 16px;
}

.perm-info-banner .info-text {
  font-size: 12px;
  color: #1e40af;
  line-height: 1.5;
}

.permissions-toggle-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.perm-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  background: var(--surface-1, #f8fafc);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  transition: all 0.15s ease;
}

.perm-item:hover {
  background: var(--surface-0, #ffffff);
  border-color: #cbd5e1;
}

.perm-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--navy, #0f172a);
}

.perm-sub {
  font-size: 11.5px;
  color: var(--text-muted, #64748b);
  margin-top: 2px;
}

/* iOS-style Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

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

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #cbd5e1;
  transition: 0.2s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.2s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

input:checked + .slider {
  background-color: var(--indigo, #4f46e5);
}

input:checked + .slider:before {
  transform: translateX(20px);
}

.perm-actions {
  margin-top: 18px;
  display: flex;
  justify-content: flex-end;
}

/* Mobile & Tablet Responsive */
@media (max-width: 860px) {
  .emp-detail-dialog {
    max-width: 100%;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    border-radius: 0;
  }
  
  .emp-detail-body {
    grid-template-columns: 1fr;
    min-height: 0;
    overflow-y: auto;
  }

  .emp-detail-sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border, #e2e8f0);
  }

  .emp-form-grid {
    grid-template-columns: 1fr;
  }

  .emp-tabs-nav {
    overflow-x: auto;
    white-space: nowrap;
  }
}

/* Dark Mode untuk Modal Detail Karyawan */
[data-theme='dark'] .emp-detail-dialog {
  background: #111827;
  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme='dark'] .emp-detail-topbar,
[data-theme='dark'] .emp-tabs-nav,
[data-theme='dark'] .emp-detail-main {
  background: #111827;
  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme='dark'] .emp-detail-sidebar {
  background: #0f172a;
  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme='dark'] .emp-status-card,
[data-theme='dark'] .emp-stats-card,
[data-theme='dark'] .emp-contact-box {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme='dark'] .time-box,
[data-theme='dark'] .activity-item,
[data-theme='dark'] .perm-item {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.06);
}

[data-theme='dark'] .emp-topbar-title,
[data-theme='dark'] .emp-name,
[data-theme='dark'] .emp-status-label,
[data-theme='dark'] .shift-val,
[data-theme='dark'] .time-box .t-val,
[data-theme='dark'] .emp-stats-title,
[data-theme='dark'] .perm-name,
[data-theme='dark'] .activity-title,
[data-theme='dark'] .table-compact td {
  color: #f1f5f9;
}

[data-theme='dark'] .table-compact th {
  background: #1e293b;
  color: #94a3b8;
  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme='dark'] .table-compact td {
  border-color: rgba(255, 255, 255, 0.06);
}

[data-theme='dark'] .table-compact tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

[data-theme='dark'] .perm-info-banner {
  background: rgba(37, 99, 235, 0.12);
  border-color: rgba(37, 99, 235, 0.3);
}

[data-theme='dark'] .perm-info-banner .info-text {
  color: #93c5fd;
}

/* ============================================================
   APPROVAL PAGE - layout selaras dengan desain referensi
   ============================================================ */
.approval-page-header { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin-bottom:16px; }
.approval-page-title { margin:0 0 4px; color:var(--text-primary); font-size:22px; font-weight:800; }
.approval-page-subtitle { margin:0; color:var(--text-secondary); font-size:12.5px; }
.approval-refresh-btn { display:inline-flex; align-items:center; gap:7px; flex-shrink:0; }
.approval-stat-strip { display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:10px; margin-bottom:14px; }
.approval-stat-card { display:flex; align-items:center; gap:11px; min-width:0; padding:14px 16px; border:1px solid var(--border); border-radius:14px; background:var(--surface-0); box-shadow:var(--shadow-sm); }
.approval-stat-icon { width:36px; height:36px; display:grid; place-items:center; flex-shrink:0; border-radius:10px; font-size:20px; font-weight:800; }
.approval-stat-card.pending .approval-stat-icon { background:var(--warning-50); color:var(--warning-600); }
.approval-stat-card.approved .approval-stat-icon { background:var(--success-50); color:var(--success-600); }
.approval-stat-card.registered .approval-stat-icon { background:var(--indigo-soft); color:var(--indigo); }
.approval-stat-card strong { display:block; color:var(--text-primary); font-family:var(--font-mono); font-size:21px; font-weight:500; line-height:1.15; }
.approval-stat-card span { display:block; margin-top:3px; color:var(--text-secondary); font-size:11px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.approval-filter-bar { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:14px; padding:11px 13px; border:1px solid var(--border); border-radius:14px; background:var(--surface-0); box-shadow:var(--shadow-sm); }
.approval-filter-tabs { display:flex; gap:3px; padding:3px; border-radius:999px; background:var(--surface-2); }
.approval-filter-tab { border:0; border-radius:999px; padding:7px 13px; background:transparent; color:var(--text-secondary); font-size:12px; font-weight:700; cursor:pointer; }
.approval-filter-tab.active { background:var(--surface-0); color:var(--text-primary); box-shadow:var(--shadow-sm); }
.approval-filter-tab span { margin-left:4px; color:var(--text-muted); font-family:var(--font-mono); font-size:10px; }
.approval-filter-divider { width:1px; height:22px; background:var(--border-mid); }
.approval-search { width:210px; max-width:100%; }
.approval-filter-reset { margin-left:auto; color:var(--text-muted); font-size:11.5px; font-weight:700; cursor:pointer; }
.approval-filter-reset:hover { color:var(--rose); }
.approval-panel { margin-bottom:14px !important; }
.approval-panel-header { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:14px 16px; border-bottom:1px solid var(--border); }
.approval-panel-title { display:block; color:var(--text-primary); font-size:13.5px; font-weight:800; }
.approval-panel-subtitle { display:block; margin-top:3px; color:var(--text-muted); font-size:11px; }
.approval-panel-actions { display:flex; align-items:center; gap:9px; flex-shrink:0; }
.approval-panel-actions .btn { white-space:nowrap; }
.approval-list-empty { padding:42px 18px; color:var(--text-muted); font-size:12px; text-align:center; }
.approval-request-row { animation:fadeSlideIn 220ms var(--ease-out) both; }
@media (max-width:760px) {
  .approval-page-header { align-items:stretch; flex-direction:column; }
  .approval-refresh-btn { align-self:flex-start; }
  .approval-stat-strip { grid-template-columns:1fr; }
  .approval-filter-divider { display:none; }
  .approval-search { width:100%; }
  .approval-filter-reset { margin-left:0; }
  .approval-panel-header { align-items:flex-start; flex-direction:column; }
  .approval-panel-actions { width:100%; justify-content:space-between; }
}
/* Approval redesign: clickable approval history and four-stage timeline */
.approval-history-row {
  position:relative; padding:14px 16px; border-bottom:1px solid var(--border);
  cursor:pointer; transition:background .18s ease, box-shadow .18s ease;
}
.approval-history-row:last-child { border-bottom:0; }
.approval-history-row:hover { background:var(--surface-2); }
.approval-history-row:focus-visible { outline:2px solid var(--indigo); outline-offset:-2px; }
.approval-history-summary { display:flex; align-items:center; gap:12px; }
.approval-history-meta { margin-top:4px; font-size:11px; color:var(--text-muted); }
.approval-history-status { margin-left:5px; font-size:10px; }
.approval-history-chevron { margin-left:auto; color:var(--text-muted); font-size:20px; transition:transform .2s ease; }
.approval-history-row.is-expanded .approval-history-chevron { transform:rotate(180deg); color:var(--indigo); }
.approval-history-detail { display:none; margin:14px 0 0 48px; padding:14px 16px; border:1px solid var(--border); border-radius:12px; background:var(--surface-2); cursor:default; }
.approval-history-detail-title { margin-bottom:12px; color:var(--text-primary); font-size:12px; font-weight:800; }
.approval-history-timeline { position:relative; }
.approval-history-timeline:before { content:""; position:absolute; left:10px; top:10px; bottom:10px; width:2px; background:var(--border-mid); }
.approval-timeline-step { position:relative; display:flex; align-items:flex-start; gap:11px; min-height:48px; color:var(--text-muted); }
.approval-timeline-step > div { display:flex; flex-direction:column; gap:3px; }
.approval-timeline-step b { color:var(--text-secondary); font-size:11.5px; }
.approval-timeline-step small { font-size:11px; }
.approval-timeline-step.done b, .approval-timeline-step.done small { color:var(--text-primary); }
.approval-timeline-step.rejected b, .approval-timeline-step.rejected small { color:var(--danger-500); }
.approval-timeline-dot { z-index:1; display:grid; place-items:center; width:22px; height:22px; flex:0 0 22px; border:2px solid var(--border-mid); border-radius:50%; background:var(--surface-2); color:var(--text-muted); font-size:12px; font-weight:800; }
.approval-timeline-step.done .approval-timeline-dot { border-color:var(--success-600); background:var(--success-50); color:var(--success-600); }
.approval-timeline-step.rejected .approval-timeline-dot { border-color:var(--danger-500); background:var(--danger-50); color:var(--danger-500); }
@media (max-width:760px) {
  .approval-history-detail { margin-left:0; }
  .approval-history-summary { align-items:flex-start; }
  #approval-history-panel .approval-panel-actions { align-items:stretch; flex-direction:column; }
}
