/* =========================================================
   ContractPulse - Theme Polish & UX Fixes (v2)
   Path: css/modules/theme-fixes.css
   ========================================================= */

/* ============================================
   1. DARK MODE — IMPROVED CONTRAST (WCAG AA)
   ============================================ */

[data-theme="dark"] {
  --text-muted: #a3adbf;
  --text-subtle: #7c8798;
}

[data-theme="dark"] thead th {
  color: #94a3b8 !important;
}

[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
  color: #64748b !important;
}

[data-theme="dark"] label {
  color: #cbd5e1;
}

[data-theme="dark"] .text-slate-400 { color: #94a3b8 !important; }
[data-theme="dark"] .text-slate-500 { color: #a3adbf !important; }

/* ============================================
   2. BADGE — Muted di Dark Mode
   ============================================ */

[data-theme="dark"] .bg-emerald-100 {
  background-color: #064e3b !important;
  color: #6ee7b7 !important;
}
[data-theme="dark"] .bg-amber-100 {
  background-color: #78350f !important;
  color: #fcd34d !important;
}
[data-theme="dark"] .bg-rose-100 {
  background-color: #7f1d1d !important;
  color: #fca5a5 !important;
}
[data-theme="dark"] .bg-violet-100 {
  background-color: #4c1d95 !important;
  color: #ddd6fe !important;
}
[data-theme="dark"] .bg-indigo-100 {
  background-color: #1e3a8a !important;
  color: #93c5fd !important;
}

/* ============================================
   3. TABLE — Zebra Stripe + Hover
   ============================================ */

table tbody tr:nth-child(even) {
  background-color: rgba(248, 250, 252, 0.4);
}
[data-theme="dark"] table tbody tr:nth-child(even) {
  background-color: rgba(255, 255, 255, 0.015);
}
table tbody tr { transition: background-color 0.12s ease; }
table tbody tr:hover {
  background-color: rgba(99, 102, 241, 0.04) !important;
}
[data-theme="dark"] table tbody tr:hover {
  background-color: rgba(99, 102, 241, 0.08) !important;
}

/* ============================================
   4. FIX: Restore from File Button Kontras
   ============================================ */

label:has(#importBackupFile),
label[for*="importBackup"] {
  border: 1px solid #cbd5e1 !important;
  background: #f8fafc !important;
  color: #334155 !important;
  transition: all 0.15s ease;
}
label:has(#importBackupFile):hover {
  background: #f1f5f9 !important;
  border-color: #94a3b8 !important;
}
[data-theme="dark"] label:has(#importBackupFile),
[data-theme="dark"] label[for*="importBackup"] {
  border: 1px solid #475569 !important;
  background: #232838 !important;
  color: #e2e8f0 !important;
}
[data-theme="dark"] label:has(#importBackupFile):hover {
  background: #2a3142 !important;
  border-color: #64748b !important;
}

/* ============================================
   5. FIX: Tombol "+ Add Expense" Konsistensi
   ============================================ */

#quickAddExpenseBtn {
  background-color: #4f46e5 !important;
}
#quickAddExpenseBtn:hover {
  background-color: #4338ca !important;
}

/* ============================================
   6. FIX: Theme Toggle Active State
   ============================================ */

.theme-toggle-btn[data-theme-value].bg-indigo-600,
.theme-toggle-btn[data-theme-value].bg-indigo-600 * {
  color: #ffffff !important;
  font-weight: 800 !important;
}
.theme-toggle-btn[data-theme-value]:not(.bg-indigo-600) {
  color: #64748b !important;
}
[data-theme="dark"] .theme-toggle-btn[data-theme-value]:not(.bg-indigo-600) {
  color: #94a3b8 !important;
}

/* ============================================
   7. FIX: Progress Bar Lebih Tebal
   ============================================ */

.reclients-project-progress {
  height: 6px !important;
  border-radius: 9999px !important;
  overflow: hidden;
}
[data-theme="dark"] .reclients-project-progress {
  background: rgba(255, 255, 255, 0.08) !important;
}

/* ============================================
   8. FIX: Bill button di milestone
   ============================================ */

.reclients-ms-bill {
  padding: 4px 10px !important;
  font-size: 10px !important;
  min-height: 24px !important;
  border-radius: 6px !important;
  font-weight: 800 !important;
  background: #4f46e5 !important;
  transition: all 0.15s ease;
}
.reclients-ms-bill:hover {
  background: #4338ca !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px -2px rgba(79, 70, 229, 0.4);
}

/* ============================================
   9. FIX: Chart Empty State
   ============================================ */

.chart-empty-state {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(2px);
  border-radius: 12px;
  z-index: 5;
  pointer-events: none;
}
[data-theme="dark"] .chart-empty-state {
  background: rgba(26, 31, 46, 0.85);
}
.chart-empty-state svg {
  width: 32px; height: 32px;
  color: #94a3b8;
  margin-bottom: 8px;
}
.chart-empty-state p {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  margin: 0;
  max-width: 220px;
  line-height: 1.5;
}
[data-theme="dark"] .chart-empty-state p { color: #94a3b8; }

/* ============================================
   10. FIX: Nav Items Font Size
   ============================================ */

#cpMainNav .tab-btn {
  font-size: 13px !important;
  font-weight: 600 !important;
  letter-spacing: -0.01em;
  transition: background-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}
#cpMainNav .tab-btn:active { transform: scale(0.97); }

/* ============================================
   11. FIX: Input Focus
   ============================================ */

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #6366f1;
  outline-offset: 1px;
}
[data-theme="dark"] input:focus-visible,
[data-theme="dark"] select:focus-visible,
[data-theme="dark"] textarea:focus-visible {
  outline-color: #818cf8;
}

/* ============================================
   12. FIX KRITIS: Upgrade Plan Button (LIGHT)
   ---------------------------------------------------
   Di light mode, tombol "Upgrade Plan" di Settings
   teks putih di background gradient indigo-violet —
   TERLALU KONTRAS tapi terlihat "hilang" karena gradient
   terlalu terang. Fix: naikkan kontras + border.
   ============================================ */

#settingsPlanCard button[onclick*="openUpgradeModal"],
#settingsPlanCard .upgrade-cta-btn {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%) !important;
  color: #ffffff !important;
  font-weight: 800 !important;
  box-shadow: 0 4px 12px -2px rgba(79, 70, 229, 0.4),
              inset 0 1px 0 rgba(255, 255, 255, 0.15) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  transition: all 0.15s ease;
}
#settingsPlanCard button[onclick*="openUpgradeModal"]:hover {
  background: linear-gradient(135deg, #4338ca 0%, #6d28d9 100%) !important;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px -2px rgba(79, 70, 229, 0.5),
              inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
}
#settingsPlanCard button[onclick*="openUpgradeModal"]:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px -2px rgba(79, 70, 229, 0.4) !important;
}

/* Fallback: semua tombol dengan gradient dari-indigo-600 to-violet-600 */
button.bg-gradient-to-r.from-indigo-600.to-violet-600,
button[class*="from-indigo-600"][class*="to-violet-600"] {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%) !important;
  color: #ffffff !important;
  font-weight: 800 !important;
  box-shadow: 0 4px 12px -2px rgba(79, 70, 229, 0.4) !important;
}

/* ============================================
   13. FIX KRITIS: RESPONSIVE HEADER (HP)
   ---------------------------------------------------
   Di HP, header nav dengan banyak button + dropdown +
   tombol Add Client + Exit — semua muat dalam 1 baris.
   Hasilnya: layout rusak, konten tidak muat, tombol
   saling tindih.
   
   Fix: Mobile-first responsive rules.
   ============================================ */

/* --- HEADER UTAMA --- */
@media (max-width: 1023px) {
  /* Header container: izinkan wrap */
  #mainWorkspaceView > header > div {
    flex-wrap: wrap !important;
    height: auto !important;
    min-height: 64px !important;
    padding-top: 12px !important;
    padding-bottom: 12px !important;
    gap: 12px !important;
  }

  /* Nav: full width, scroll horizontal */
  #cpMainNav {
    order: 3;
    width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    flex-wrap: nowrap;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  #cpMainNav::-webkit-scrollbar { display: none; }

  #cpMainNav .tab-btn {
    flex-shrink: 0;
    padding: 8px 14px !important;
    font-size: 13px !important;
  }

  /* Sembunyikan label "ContractPulse" di logo, cukup icon */
  #mainWorkspaceView > header > div > div:first-child > a > span {
    display: none !important;
  }

  /* Tombol Add Client: lebih kecil */
  #quickAddClientBtn {
    padding: 8px 12px !important;
    font-size: 11px !important;
  }

  /* Tombol Exit: sembunyikan di mobile, ganti icon */
  #mainWorkspaceView > header > div > div:last-child > a[href="index.html"] {
    padding: 8px !important;
    font-size: 0 !important;
  }
  #mainWorkspaceView > header > div > div:last-child > a[href="index.html"]::before {
    content: "✕";
    font-size: 16px;
  }
}

@media (max-width: 640px) {
  /* Header: sembunyikan "Clients & SOW" label, ganti icon */
  #cpMainNav .tab-btn {
    padding: 8px 10px !important;
    font-size: 12px !important;
  }

  /* Toolbar timer di HP: stack vertikal */
  #mainWorkspaceView > div.bg-white > div {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  /* Timer display + tombol: full width */
  #mainTimerDisplay {
    font-size: 20px !important;
    text-align: center;
  }
  #mainTimerToggleBtn {
    width: 100%;
  }

  /* Dashboard stats: 1 kolom */
  #tabContentDashboard .grid.sm\:grid-cols-3 {
    grid-template-columns: 1fr !important;
  }

  /* Chart containers: full width */
  #tabContentDashboard .grid.md\:grid-cols-2 {
    grid-template-columns: 1fr !important;
  }

  /* Client card: full width */
  #reclientsRoot .reclients-masonry {
    column-count: 1 !important;
  }

  /* Table: horizontal scroll */
  #tabContentInvoices > div,
  #tabContentExpenses > div,
  #tabContentReports > div {
    overflow-x: auto;
  }

  /* Invoice action bar: stack */
  #invoiceActionBar > div > div:first-child {
    flex-direction: column !important;
    align-items: stretch !important;
  }

  #invoiceActionBar select,
  #invoiceActionBar button,
  #invoiceActionBar input[type="number"] {
    width: 100% !important;
    margin-bottom: 6px !important;
  }
}

@media (max-width: 480px) {
  /* Sangat sempit: nav jadi 2 baris */
  #cpMainNav {
    flex-wrap: wrap !important;
  }

  /* Padding konten utama lebih kecil */
  #mainWorkspaceView main.max-w-7xl {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  /* Semua heading utama diperkecil */
  #mainWorkspaceView h2.text-xl,
  #mainWorkspaceView h1,
  #mainWorkspaceView .text-2xl {
    font-size: 18px !important;
  }
}

/* ============================================
   14. FIX: Invoice Table — Hapus Duplikat "Paid"
   ---------------------------------------------------
   Kolom ACTION hanya boleh punya Print/PDF + More.
   Kalau invoice sudah Paid, tidak boleh ada:
   - Tombol "Mark Paid"
   - Teks "Paid" hijau tambahan
   ============================================ */

/* Sembunyikan tombol "Mark Paid" kalau status = Paid */
/* (Ini di-handle di JS, tapi CSS fallback juga) */
#invoicesTableBody tr[data-invoice-paid="true"] .cp-invoice-btn[onclick*="markInvoiceAsPaid"] {
  display: none !important;
}

/* Sembunyikan teks "Paid" yang tidak perlu di kolom ACTION */
#invoicesTableBody .cp-invoice-actions > span.text-emerald-600.font-bold {
  display: none !important;
}

/* ============================================
   15. FIX: Settings Card "Current Plan" 
   ============================================ */

.plan-card.current {
  box-shadow: 0 0 0 2px #6366f1, 0 8px 24px -8px rgba(99, 102, 241, 0.4);
}

.plan-card .plan-badge-current {
  background: linear-gradient(135deg, #10b981, #059669);
  box-shadow: 0 4px 12px -2px rgba(16, 185, 129, 0.5);
}

/* Tombol "Current Plan" abu — lebih jelas */
.plan-card button[disabled],
.plan-card span.bg-slate-100 {
  background: #f1f5f9 !important;
  color: #94a3b8 !important;
  font-weight: 700 !important;
}
[data-theme="dark"] .plan-card button[disabled],
[data-theme="dark"] .plan-card span.bg-slate-100 {
  background: #232838 !important;
  color: #64748b !important;
}

/* ============================================
   16. SMOOTH TAB TRANSITION
   ============================================ */

#mainWorkspaceView main > div[id^="tabContent"]:not(.hidden) {
  animation: cpTabFadeIn 0.2s ease;
}

@keyframes cpTabFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   17. SCROLLBAR Dark Mode
   ============================================ */

[data-theme="dark"] ::-webkit-scrollbar-track { background: #0f1419; }
[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 9999px;
}
[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: #475569; }

/* ============================================
   18. REDUCED MOTION
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================
   19. FIX: Dashboard Card Spacing (Task 1)
   ============================================ */

/* Card summary di dashboard: kurangi gap */
#tabContentDashboard > .grid.sm\:grid-cols-3 {
  gap: 1rem !important; /* 16px, dari 24px (gap-6) */
}

/* Card dashboard: kurangi padding */
#tabContentDashboard > .grid.sm\:grid-cols-3 > .bg-white {
  padding: 1.25rem !important; /* 20px, dari 24px (p-6) */
}

/* Grid chart: kurangi gap juga */
#tabContentDashboard > .grid.md\:grid-cols-2 {
  gap: 1rem !important;
}

@media (min-width: 640px) {
  #tabContentDashboard > .grid.sm\:grid-cols-3 {
    gap: 1.25rem !important; /* 20px di tablet+ */
  }
}

/* ============================================
   20. FIX: Chart Empty State (Task 2)
   ---------------------------------------------------
   Empty state SEHARUSNYA hanya nutupin chart area,
   tidak menutupi card. Dan canvas harus di-hide.
   ============================================ */

/* Container chart wrapper */
.chart-empty-state {
  position: absolute !important;
  inset: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  padding: 16px !important;
  background: rgba(255, 255, 255, 0.92) !important;
  backdrop-filter: blur(2px) !important;
  border-radius: 12px !important;
  z-index: 5 !important;
  pointer-events: none !important;
}

[data-theme="dark"] .chart-empty-state {
  background: rgba(26, 31, 46, 0.92) !important;
}

.chart-empty-state svg {
  width: 28px !important;
  height: 28px !important;
  color: #94a3b8 !important;
  margin-bottom: 8px !important;
  opacity: 0.6 !important;
}

.chart-empty-state p {
  font-size: 11px !important;
  font-weight: 600 !important;
  color: #64748b !important;
  margin: 0 !important;
  max-width: 220px !important;
  line-height: 1.5 !important;
}

[data-theme="dark"] .chart-empty-state p {
  color: #94a3b8 !important;
}

/* Sembunyikan canvas kalau ada empty state di parent */
.chart-empty-state ~ canvas,
canvas:has(+ .chart-empty-state) {
  opacity: 0 !important;
  pointer-events: none !important;
}

/* ============================================
   21. FIX: Drawer Form Submit Button (Task 3)
   ---------------------------------------------------
   Tombol submit harus selalu terlihat.
   Drawer body harus punya padding-bottom agar tombol
   tidak tertutup.
   ============================================ */

/* Drawer body: beri ruang bawah lebih */
#drawerBody {
  padding-bottom: 80px !important; /* space untuk sticky button */
}

/* Semua form di drawer: buat tombol submit sticky di bottom */
#drawerBody form {
  position: relative;
  padding-bottom: 0 !important;
}

/* Sticky submit button di drawer */
#drawerBody form > button[type="submit"]:last-of-type,
#drawerBody form > button:last-of-type:not([type="button"]),
#drawerBody form > .form-submit-btn {
  position: sticky !important;
  bottom: -60px !important; /* turun melewati padding drawer */
  margin-top: 24px !important;
  margin-bottom: 0 !important;
  z-index: 10 !important;
  box-shadow: 0 -4px 12px -2px rgba(0, 0, 0, 0.08) !important;
}

[data-theme="dark"] #drawerBody form > button[type="submit"]:last-of-type,
[data-theme="dark"] #drawerBody form > button:last-of-type:not([type="button"]),
[data-theme="dark"] #drawerBody form > .form-submit-btn {
  box-shadow: 0 -4px 12px -2px rgba(0, 0, 0, 0.4) !important;
}

/* Drawer body: background untuk sticky button */
#drawerBody::after {
  content: "";
  display: block;
  height: 60px;
  pointer-events: none;
}

/* ============================================
   22. FIX: Tombol Save Payment Invisible
   ---------------------------------------------------
   Masalah: Tombol dengan bg-emerald-600 di light mode
   jadi putih. Kemungkinan ada CSS yang override.
   
   Fix: force background-color dengan !important
   ============================================ */

/* Semua tombol dengan bg-emerald-600 atau bg-emerald-* harus
   punya background yang benar */
button.bg-emerald-600,
button[class*="bg-emerald-600"] {
  background-color: #059669 !important;
  color: #ffffff !important;
}

button.bg-emerald-600:hover,
button[class*="bg-emerald-600"]:hover {
  background-color: #047857 !important;
}

button.bg-emerald-500,
button[class*="bg-emerald-500"] {
  background-color: #10b981 !important;
  color: #ffffff !important;
}

button.bg-emerald-500:hover,
button[class*="bg-emerald-500"]:hover {
  background-color: #059669 !important;
}

/* Tombol di dalam form drawer (#cpPaymentForm) */
#cpPaymentForm button[type="submit"],
form[id*="Payment"] button[type="submit"],
form[id*="payment"] button[type="submit"] {
  background-color: #059669 !important;
  color: #ffffff !important;
  font-weight: 800 !important;
  border: none !important;
  box-shadow: 0 4px 12px -2px rgba(5, 150, 105, 0.4) !important;
}

#cpPaymentForm button[type="submit"]:hover,
form[id*="Payment"] button[type="submit"]:hover,
form[id*="payment"] button[type="submit"]:hover {
  background-color: #047857 !important;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px -2px rgba(5, 150, 105, 0.5) !important;
}

/* Dark mode override — sama saja tapi lebih gelap */
[data-theme="dark"] #cpPaymentForm button[type="submit"],
[data-theme="dark"] form[id*="Payment"] button[type="submit"],
[data-theme="dark"] form[id*="payment"] button[type="submit"] {
  background-color: #059669 !important;
  color: #ffffff !important;
}

[data-theme="dark"] #cpPaymentForm button[type="submit"]:hover,
[data-theme="dark"] form[id*="Payment"] button[type="submit"]:hover,
[data-theme="dark"] form[id*="payment"] button[type="submit"]:hover {
  background-color: #10b981 !important;
}

/* ============================================
   23. FIX: Drawer Body — padding untuk tombol sticky
   ============================================ */

#drawerBody {
  padding-bottom: 100px !important;
}

/* Container form di drawer */
#drawerBody form {
  display: flex;
  flex-direction: column;
}

/* Semua tombol submit di form drawer: sticky di bottom */
#drawerBody form > button[type="submit"] {
  position: sticky !important;
  bottom: 0 !important;
  z-index: 10 !important;
  margin-top: auto !important;
  margin-bottom: 0 !important;
}

/* ============================================
   24. FIX FINAL: Dashboard Spacing Tight
   ---------------------------------------------------
   Buat dashboard lebih padat dan proporsional
   di layar lebar (1920px+).
   ============================================ */

/* --- Container Utama: batasi lebar maksimum --- */
#mainWorkspaceView main.max-w-7xl {
  max-width: 1280px !important; /* default 1280px, tetap, tapi kalau mau lebih kecil: 1200px */
}

/* --- Main body: kurangi spacing vertikal --- */
#mainWorkspaceView main.max-w-7xl {
  padding-left: 1.25rem !important;
  padding-right: 1.25rem !important;
}

/* --- Dashboard: spacing seluruh section lebih rapat --- */
#tabContentDashboard {
  gap: 1rem !important; /* dari space-y-8 (32px) */
}

#tabContentDashboard > .space-y-8 {
  gap: 1rem !important;
}

/* --- Grid kartu summary: 3 kartu --- */
#tabContentDashboard .grid.sm\:grid-cols-3 {
  gap: 0.75rem !important; /* 12px, dari 24px */
}

/* --- Card summary: padding lebih kecil --- */
#tabContentDashboard .grid.sm\:grid-cols-3 > .bg-white {
  padding: 1rem 1.25rem !important; /* 16px 20px, dari 24px */
}

/* --- Angka besar di card summary: sedikit lebih kecil --- */
#tabContentDashboard .grid.sm\:grid-cols-3 .text-3xl {
  font-size: 1.75rem !important; /* 28px, dari 30px */
  line-height: 1.15 !important;
}

/* --- Grid chart: 2 chart --- */
#tabContentDashboard .grid.md\:grid-cols-2 {
  gap: 0.75rem !important;
}

/* --- Chart card: padding lebih kecil --- */
#tabContentDashboard .grid.md\:grid-cols-2 > .bg-white {
  padding: 1.25rem !important; /* 20px, dari 24px */
}

/* --- Table card: padding header lebih kecil --- */
#tabContentDashboard > .bg-white.rounded-3xl .p-6 {
  padding: 1rem 1.25rem !important;
}

/* --- Table: baris lebih rapat --- */
#workLogsTableBody td {
  padding: 0.75rem 1rem !important; /* dari p-4 (16px) */
}

#workLogsTableBody th {
  padding: 0.75rem 1rem !important;
}

/* ============================================
   RESPONSIVE: di layar sangat lebar (> 1600px)
   beri max-width supaya tidak terlalu melar
   ============================================ */

@media (min-width: 1600px) {
  #mainWorkspaceView main.max-w-7xl {
    max-width: 1400px !important;
  }
}

@media (min-width: 1920px) {
  #mainWorkspaceView main.max-w-7xl {
    max-width: 1440px !important;
  }
}

/* ============================================
   25. FIX: Semua Halaman Konsisten
   ============================================ */

/* --- Semua card di tab lain: padding lebih rapi --- */
#tabContentInvoices > .bg-white,
#tabContentExpenses > .bg-white,
#tabContentReports > .bg-white,
#tabContentEstimates > .bg-white,
#tabContentSettings .bg-white {
  padding: 1.25rem !important;
}

/* --- Semua grid gap di tab lain --- */
#tabContentInvoices .grid,
#tabContentExpenses .grid,
#tabContentReports .grid {
  gap: 0.75rem !important;
}

/* --- Card summary di expenses --- */
#tabContentExpenses .grid.grid-cols-1.sm\:grid-cols-3 {
  gap: 0.75rem !important;
}

#tabContentExpenses .grid.grid-cols-1.sm\:grid-cols-3 > div {
  padding: 1rem !important;
}

/* --- Kartu stats di Dashboard: text lebih compact --- */
#tabContentDashboard .text-\[11px\] {
  font-size: 10px !important;
}

/* ============================================
   26. FIX: Header Tracking Bar (Timer)
   ---------------------------------------------------
   Tracking bar dengan timer — perlebar sedikit
   ============================================ */

#mainWorkspaceView > div.bg-white > div {
  gap: 1rem !important;
  padding-top: 0.75rem !important;
  padding-bottom: 0.75rem !important;
}

/* Timer select: jangan terlalu lebar */
#timerClientSelect,
#timerProjectSelect {
  min-width: 140px !important;
  max-width: 200px !important;
}

/* ============================================
   27. FIX: Navbar Lebih Proporsional
   ============================================ */

#mainWorkspaceView > header > div {
  padding-left: 1.25rem !important;
  padding-right: 1.25rem !important;
}

/* ============================================
   28. FIX: Tombol Cancel + Save Payment Konsisten
   ---------------------------------------------------
   Kadang Cancel terlalu sempit, ini fix-nya
   ============================================ */

#cpPaymentForm > .flex.gap-2 > button,
#cpPaymentForm > div > button {
  min-height: 40px !important;
  font-weight: 800 !important;
}

/* Cancel button */
#cpPaymentForm button[type="button"] {
  background-color: #f1f5f9 !important;
  color: #475569 !important;
}

[data-theme="dark"] #cpPaymentForm button[type="button"] {
  background-color: #232838 !important;
  color: #cbd5e1 !important;
}

/* Submit button (Save Payment) */
#cpPaymentForm button[type="submit"] {
  background-color: #059669 !important;
  color: #ffffff !important;
}

#cpPaymentForm button[type="submit"]:hover {
  background-color: #047857 !important;
}

/* ============================================
   FIX: Messages tab — kolom obrolan tidak muncul
   .cp-messages-wrap (styles.css) sudah punya grid sendiri
   (sidebar 300px + chat 1fr). Kontainer luar tidak boleh
   jadi grid 240px, kalau tidak kolom chat terpotong.
   ============================================ */
#cpMessagesTabBody {
  display: block !important;
  width: 100%;
  max-width: none;
}
#cpMessagesTabBody > .cp-messages-wrap {
  width: 100%;
}
#cpMessagesTabBody .cp-messages-chat {
  display: flex;
  min-width: 0;
}