/*
 * =============================================================================
 * SISTEM MANAJEMEN CUTI DAN IZIN KARYAWAN
 * File: style.css
 * Deskripsi: CSS kustom lengkap dengan Dark Mode & Light Mode
 * =============================================================================
 *
 * STRUKTUR FILE INI:
 * 1. CSS Variables (Design Tokens) — Warna, ukuran, dll.
 * 2. Reset & Base Styles
 * 3. Loading Overlay
 * 4. Halaman Login
 * 5. Sidebar Navigasi
 * 6. Topbar
 * 7. Konten Utama & Panel
 * 8. Komponen Reusable (Stat Cards, Badges, Upload Area)
 * 9. Tabel & List
 * 10. Dark Mode Overrides
 * 11. Animasi & Transisi
 * 12. Responsive / Media Queries
 */


/* =============================================================================
   1. CSS VARIABLES — DESIGN TOKENS
   Menggunakan CSS Custom Properties agar mudah diubah dan konsisten.
   Light mode values (default).
   ============================================================================= */

:root {
  /* --- Warna Utama --- */
  --color-primary: #4f46e5;
  /* Indigo */
  --color-primary-hover: #4338ca;
  --color-primary-light: #ede9fe;
  --color-secondary: #64748b;
  /* Slate */
  --color-success: #059669;
  --color-warning: #d97706;
  --color-danger: #dc2626;
  --color-info: #0284c7;

  /* --- Background & Surface --- */
  --bg-body: #f1f5f9;
  /* Background halaman utama */
  --bg-sidebar: #1e1b4b;
  /* Sidebar — ungu tua */
  --bg-card: #ffffff;
  --bg-topbar: rgba(255, 255, 255, 0.85);
  --bg-input: #ffffff;
  --bg-table-head: #f8fafc;

  /* --- Teks --- */
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --text-sidebar: #a5b4fc;
  /* Teks menu sidebar */
  --text-sidebar-active: #ffffff;

  /* --- Border --- */
  --border-color: #e2e8f0;
  --border-radius: 12px;
  --border-radius-sm: 8px;

  /* --- Shadow --- */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.07), 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.08), 0 4px 6px rgba(0, 0, 0, 0.05);

  /* --- Layout --- */
  --sidebar-width: 260px;
  --topbar-height: 64px;

  /* --- Transisi Global --- */
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* DARK MODE — Nilai variabel berubah, semua elemen ikut otomatis */
[data-bs-theme="dark"] {
  --bg-body: #0f172a;
  /* Biru tua gelap */
  --bg-sidebar: #1e293b;
  /* Slate gelap */
  --bg-card: #1e293b;
  --bg-topbar: rgba(15, 23, 42, 0.90);
  --bg-input: #334155;
  --bg-table-head: #1e293b;

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-sidebar: #94a3b8;
  --text-sidebar-active: #ffffff;

  --border-color: #334155;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.35);
}


/* =============================================================================
   2. RESET & BASE STYLES
   ============================================================================= */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--bg-body);
  color: var(--text-primary);
  font-size: 0.9rem;
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
  margin: 0;
  overflow-x: hidden;
}

/* Scrollbar kustom agar lebih estetis */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 10px;
}

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


/* =============================================================================
   3. LOADING OVERLAY
   ============================================================================= */

.loading-overlay {
  position: fixed;
  inset: 0;
  /* shorthand untuk top:0, right:0, bottom:0, left:0 */
  background: var(--bg-body);
  z-index: 99999;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

/* Animasi spinner ring kustom */
.spinner-ring {
  width: 52px;
  height: 52px;
  border: 4px solid var(--border-color);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  margin: 0 auto;
}

.loading-text {
  color: var(--text-secondary);
  font-size: 0.875rem;
  letter-spacing: 0.025em;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* State tersembunyi untuk overlay */
.loading-overlay.hide {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}


/* =============================================================================
   4. HALAMAN LOGIN
   ============================================================================= */

.login-container {
  min-height: 100vh;
  background: linear-gradient(135deg, #ede9fe 0%, #dbeafe 50%, #d1fae5 100%);
  position: relative;
  overflow: hidden;
}

[data-bs-theme="dark"] .login-container {
  background: linear-gradient(135deg, #1e1b4b 0%, #0f172a 50%, #042f2e 100%);
}

/* Elemen dekoratif background halaman login */
.login-bg-shapes {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.shape {
  position: absolute;
  border-radius: 50%;
  opacity: 0.15;
  animation: float 6s ease-in-out infinite;
}

.shape-1 {
  width: 400px;
  height: 400px;
  background: var(--color-primary);
  top: -100px;
  right: -100px;
  animation-delay: 0s;
}

.shape-2 {
  width: 300px;
  height: 300px;
  background: var(--color-info);
  bottom: -80px;
  left: -80px;
  animation-delay: 2s;
}

.shape-3 {
  width: 200px;
  height: 200px;
  background: var(--color-success);
  top: 50%;
  left: 10%;
  animation-delay: 4s;
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0) scale(1);
  }

  50% {
    transform: translateY(-20px) scale(1.03);
  }
}

/* Card Login */
.login-card {
  width: 100%;
  max-width: 420px;
  border-radius: var(--border-radius) !important;
  background: var(--bg-card) !important;
  position: relative;
  z-index: 1;
  box-shadow: var(--shadow-lg) !important;
  border: 1px solid var(--border-color) !important;
}

/* Ikon brand di halaman login */
.brand-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--color-primary), #7c3aed);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  font-size: 1.8rem;
  color: white;
  box-shadow: 0 8px 25px rgba(79, 70, 229, 0.4);
}

/* Custom logo images */
.brand-logo-img {
  max-height: 72px;
  max-width: 200px;
  object-fit: contain;
  border-radius: 8px;
}

.sidebar-logo-img {
  max-height: 38px;
  max-width: 120px;
  object-fit: contain;
  border-radius: 6px;
}

.logo-upload-box {
  min-height: 120px;
  padding: 16px;
}

.preview-logo-image {
  max-height: 80px;
  max-width: 160px;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: var(--shadow-sm);
}


/* =============================================================================
   5. SIDEBAR NAVIGASI
   ============================================================================= */

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  z-index: 1030;
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}

/* Brand / Logo Sidebar */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.brand-icon-sm {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--color-primary), #7c3aed);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

.brand-name {
  font-weight: 700;
  font-size: 1.1rem;
  color: white;
  letter-spacing: 0.01em;
}

/* Info User di Sidebar */
.sidebar-user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary), #7c3aed);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  color: white;
  flex-shrink: 0;
}

.user-name {
  color: white;
  font-size: 0.875rem;
  line-height: 1.3;
}

.role-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  background: rgba(165, 180, 252, 0.15);
  color: #a5b4fc;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Menu Navigasi Sidebar */
.sidebar-nav {
  list-style: none;
  padding: 12px 12px;
  margin: 0;
  flex-grow: 1;
}

.sidebar-nav li {
  margin-bottom: 2px;
}

.nav-section-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: rgba(165, 180, 252, 0.5);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 12px 8px 6px;
  margin-top: 4px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text-sidebar);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--transition);
  cursor: pointer;
}

.sidebar-link i {
  font-size: 1rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: white;
  transform: translateX(3px);
}

.sidebar-link.active {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.6), rgba(124, 58, 237, 0.4));
  color: var(--text-sidebar-active);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

/* Footer Sidebar */
.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

/* Tombol tutup sidebar di mobile */
.btn-close-sidebar {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: none;
  /* Hanya tampil di mobile */
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  z-index: 10;
}

.btn-close-sidebar:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Overlay gelap saat sidebar buka di mobile */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1029;
  backdrop-filter: blur(2px);
}


/* =============================================================================
   6. TOPBAR
   ============================================================================= */

.topbar {
  height: var(--topbar-height);
  background: var(--bg-topbar);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.topbar-user {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* Badge notifikasi */
.notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--color-danger);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}


/* =============================================================================
   7. LAYOUT KONTEN UTAMA & PANEL
   ============================================================================= */

.main-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.content-area {
  padding: 24px;
  flex-grow: 1;
}

/* Setiap panel merupakan satu "halaman" dalam SPA */
.panel {
  animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

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


/* =============================================================================
   8. KOMPONEN REUSABLE
   ============================================================================= */

/* --- Stat Cards (Kartu statistik di dashboard) --- */
.stat-card {
  background: var(--bg-card) !important;
  border-radius: var(--border-radius) !important;
  border: 1px solid var(--border-color) !important;
  box-shadow: var(--shadow-sm) !important;
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md) !important;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* --- Cards Umum --- */
.card {
  background: var(--bg-card) !important;
  border-radius: var(--border-radius) !important;
  border: 1px solid var(--border-color) !important;
  box-shadow: var(--shadow-sm) !important;
  transition: var(--transition);
}

.card-header {
  background: var(--bg-card) !important;
  color: var(--text-primary) !important;
  border-bottom-color: var(--border-color) !important;
}

/* --- Upload Area (Drag & Drop) --- */
.upload-area {
  border: 2px dashed var(--border-color);
  border-radius: var(--border-radius);
  padding: 32px 20px;
  text-align: center;
  transition: var(--transition);
  cursor: pointer;
  background: var(--bg-body);
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.upload-area:hover,
.upload-area.drag-over {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
}

[data-bs-theme="dark"] .upload-area:hover,
[data-bs-theme="dark"] .upload-area.drag-over {
  background: rgba(79, 70, 229, 0.1);
}

.upload-placeholder {
  width: 100%;
}

/* Preview gambar yang sudah diupload */
.upload-preview {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.preview-image {
  max-width: 100%;
  max-height: 200px;
  border-radius: var(--border-radius-sm);
  object-fit: contain;
  box-shadow: var(--shadow-md);
}

.preview-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* --- Status Badge untuk tabel --- */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-status.menunggu {
  background: #fef3c7;
  color: #92400e;
}

.badge-status.disetujui {
  background: #d1fae5;
  color: #064e3b;
}

.badge-status.ditolak {
  background: #fee2e2;
  color: #7f1d1d;
}

.badge-status.menunggu_atasan {
  background: #fef3c7;
  color: #b45309;
}

.badge-status.menunggu_hr {
  background: #e0f2fe;
  color: #0369a1;
}

.badge-status.dibatalkan {
  background: #f1f5f9;
  color: #475569;
}

[data-bs-theme="dark"] .badge-status.menunggu {
  background: rgba(217, 119, 6, 0.2);
  color: #fcd34d;
}

[data-bs-theme="dark"] .badge-status.menunggu_atasan {
  background: rgba(245, 158, 11, 0.25);
  color: #fde68a;
}

[data-bs-theme="dark"] .badge-status.menunggu_hr {
  background: rgba(14, 165, 233, 0.25);
  color: #7dd3fc;
}

[data-bs-theme="dark"] .badge-status.disetujui {
  background: rgba(5, 150, 105, 0.2);
  color: #6ee7b7;
}

[data-bs-theme="dark"] .badge-status.ditolak {
  background: rgba(220, 38, 38, 0.2);
  color: #fca5a5;
}

[data-bs-theme="dark"] .badge-status.dibatalkan {
  background: rgba(100, 116, 139, 0.2);
  color: #94a3b8;
}

/* --- Role Badge --- */
.badge-role {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-role.superadmin {
  background: #7c3aed;
  color: white;
}

.badge-role.partner {
  background: #0284c7;
  color: white;
}

.badge-role.manager {
  background: #059669;
  color: white;
}

.badge-role.hr_staff {
  background: #d97706;
  color: white;
}

.badge-role.karyawan {
  background: #64748b;
  color: white;
}

/* --- Label wajib (tanda * merah) --- */
.required-label::after {
  content: " *";
  color: var(--color-danger);
}

/* --- Progress bar kuota --- */
.progress-kuota {
  height: 8px;
  border-radius: 4px;
  background: var(--border-color);
  overflow: hidden;
  min-width: 80px;
}

.progress-kuota-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}


/* =============================================================================
   9. TABEL
   ============================================================================= */

.table {
  color: var(--text-primary) !important;
}

.table thead th {
  background: var(--bg-table-head) !important;
  color: var(--text-secondary) !important;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 2px solid var(--border-color) !important;
  padding: 12px 16px;
  white-space: nowrap;
}

.table td {
  border-bottom: 1px solid var(--border-color) !important;
  padding: 12px 16px;
  vertical-align: middle;
  color: var(--text-primary) !important;
}

.table-hover tbody tr:hover {
  background-color: rgba(79, 70, 229, 0.04) !important;
}

[data-bs-theme="dark"] .table-hover tbody tr:hover {
  background-color: rgba(79, 70, 229, 0.1) !important;
}

/* Tampilan kosong tabel */
.empty-state {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
}

.empty-state i {
  font-size: 2.5rem;
  opacity: 0.4;
  display: block;
  margin-bottom: 12px;
}


/* =============================================================================
   10. DARK MODE OVERRIDES (Bootstrap Overrides)
   ============================================================================= */

[data-bs-theme="dark"] .modal-content {
  background: var(--bg-card) !important;
  border-color: var(--border-color) !important;
  color: var(--text-primary) !important;
}

[data-bs-theme="dark"] .modal-header {
  border-color: var(--border-color) !important;
}

[data-bs-theme="dark"] .modal-footer {
  border-color: var(--border-color) !important;
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
  background: var(--bg-input) !important;
  border-color: var(--border-color) !important;
  color: var(--text-primary) !important;
}

[data-bs-theme="dark"] .form-control::placeholder {
  color: var(--text-muted) !important;
}

[data-bs-theme="dark"] .input-group-text {
  background: var(--bg-input) !important;
  border-color: var(--border-color) !important;
  color: var(--text-secondary) !important;
}

[data-bs-theme="dark"] .alert-info {
  background: rgba(2, 132, 199, 0.15) !important;
  border-color: rgba(2, 132, 199, 0.3) !important;
  color: #7dd3fc !important;
}

[data-bs-theme="dark"] .alert-warning {
  background: rgba(217, 119, 6, 0.15) !important;
  border-color: rgba(217, 119, 6, 0.3) !important;
  color: #fcd34d !important;
}

[data-bs-theme="dark"] .alert-light {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: var(--border-color) !important;
  color: var(--text-primary) !important;
}

[data-bs-theme="dark"] .btn-outline-secondary {
  color: var(--text-secondary) !important;
  border-color: var(--border-color) !important;
}

[data-bs-theme="dark"] .btn-outline-secondary:hover {
  background: var(--border-color) !important;
  color: var(--text-primary) !important;
}

[data-bs-theme="dark"] .bg-primary-subtle {
  background: rgba(79, 70, 229, 0.2) !important;
}

[data-bs-theme="dark"] .bg-warning-subtle {
  background: rgba(217, 119, 6, 0.2) !important;
}

[data-bs-theme="dark"] .bg-info-subtle {
  background: rgba(2, 132, 199, 0.2) !important;
}

[data-bs-theme="dark"] .bg-success-subtle {
  background: rgba(5, 150, 105, 0.2) !important;
}


/* =============================================================================
   11. ANIMASI & TRANSISI
   ============================================================================= */

/* Fade in dari atas untuk konten yang baru dimuat */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* Pulse efek untuk badge notifikasi */
@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.15);
  }
}

.notif-badge.active {
  animation: pulse 1.5s ease infinite;
}

/* Skeleton loading animation */
.skeleton {
  background: linear-gradient(90deg, var(--border-color) 25%, var(--bg-body) 50%, var(--border-color) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: 6px;
  display: inline-block;
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

/* Hover efek tombol aksi di tabel */
.btn-aksi {
  padding: 4px 10px;
  font-size: 0.78rem;
  border-radius: 6px;
  transition: var(--transition);
}

.btn-aksi:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}


/* =============================================================================
   12. RESPONSIVE / MEDIA QUERIES
   ============================================================================= */

/* Tablet & Mobile (< 992px) */
@media (max-width: 991.98px) {

  /* Sembunyikan sidebar ke kiri (off-canvas) */
  .sidebar {
    transform: translateX(-100%);
  }

  /* Tampilkan sidebar saat ada class 'open' */
  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

  /* Tampilkan tombol close di sidebar */
  .btn-close-sidebar {
    display: flex;
  }

  /* Konten utama tidak perlu margin karena sidebar off-canvas */
  .main-content {
    margin-left: 0;
  }

  /* Area konten lebih sempit di mobile */
  .content-area {
    padding: 16px;
  }

  /* Topbar tetap full width */
  .topbar {
    padding: 0 16px;
  }
}

/* Mobile kecil (< 576px) */
@media (max-width: 575.98px) {
  .stat-value {
    font-size: 1.3rem;
  }

  .content-area {
    padding: 12px;
  }

  .table thead th,
  .table td {
    padding: 8px 10px;
    font-size: 0.8rem;
  }
}


/* =============================================================================
   13. TABEL RESPONSIF MODE MOBILE (Stacked Card View)
   Tambahkan class "table-stack-mobile" pada <table> untuk mengaktifkan.
   Di layar < 768px, setiap baris tabel tampil sebagai card bertumpuk.
   data-label pada setiap <td> digunakan sebagai label kolom.
   ============================================================================= */

@media (max-width: 767.98px) {

  /* Sembunyikan header tabel karena label sudah tampil dari data-label */
  .table-stack-mobile thead {
    display: none !important;
  }

  /* Setiap baris menjadi card terpisah */
  .table-stack-mobile tbody tr {
    display: block;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    margin-bottom: 12px;
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
  }

  /* Hilangkan border bawaan bootstrap antar baris */
  .table-stack-mobile tbody tr:last-child {
    margin-bottom: 0;
  }

  /* Setiap sel menjadi baris horisontal: label | nilai */
  .table-stack-mobile tbody td {
    display: flex !important;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 14px !important;
    border-bottom: 1px solid var(--border-color) !important;
    font-size: 0.82rem;
    min-height: 40px;
    text-align: right;
  }

  .table-stack-mobile tbody td:last-child {
    border-bottom: none !important;
  }

  /* Label kolom dari data-label */
  .table-stack-mobile tbody td::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--text-secondary);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 90px;
    text-align: left;
    padding-top: 2px;
  }

  /* Konten nilai rata kanan */
  .table-stack-mobile tbody td > * {
    text-align: right;
  }

  /* Kolom yang tidak perlu label (misal: kolom aksi) */
  .table-stack-mobile tbody td[data-label=""] {
    justify-content: flex-end;
    padding-left: 14px;
  }

  .table-stack-mobile tbody td[data-label=""]::before {
    display: none;
  }

  /* Pastikan badge & tombol aksi tidak terpotong di mobile */
  .table-stack-mobile .d-flex.gap-1 {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .table-stack-mobile .badge-status {
    font-size: 0.65rem;
  }

  /* Wrapper table-responsive tidak perlu overflow-x di mode stacked */
  .table-stack-mobile-wrapper {
    overflow-x: visible !important;
  }
}