/* ============================================================
   style.css - v4.0 (CONSOLIDATED)
   Gabungan: css.css + themes.css + style.css + logo base64
   ============================================================ */

/* ============================================================
   PART 1: css.css (BASE)
   ============================================================ */

/* =====================
   THEME VARIABLES
===================== */
:root {
  --primary: #2563eb;
  --primary-600: #1d4ed8;
  --surface: #ffffff;
  --bg: #f4f6fb;
  --border: #e5e7eb;
  --text: #111827;
  --muted: #6b7280;

  --pending-bg: #fff3cd;
  --pending-text: #856404;
  --approved-bg: #d4edda;
  --approved-text: #155724;
  --rejected-bg: #f8d7da;
  --rejected-text: #721c24;
}

/* =====================
   BASE
===================== */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 8px;
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

h2,
h3 {
  margin: 0 0 10px 0;
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}

/* =====================
   BUTTONS
===================== */
button {
  border: none;
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Small button for table actions */
td button,
.btn-xs {
  padding: 4px 8px !important;
  font-size: 10px !important;
  border-radius: 4px !important;
  height: auto !important;
  line-height: 1 !important;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-600);
}

.btn-secondary {
  background: #e5e7eb;
  color: var(--text);
}

.btn-secondary:hover {
  background: #d1d5db;
}

.btn-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 13px;
}

/* =====================
   FORM
===================== */
.form-wrapper {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  width: 100%;
}

.pr-form label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 4px;
  display: block;
}

.pr-form input,
.pr-form textarea,
.pr-form select {
  width: 100%;
  padding: 7px 8px;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}

.pr-form input:focus,
.pr-form textarea:focus,
.pr-form select:focus {
  outline: none;
  border-color: var(--primary);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px 16px;
}

.form-grid .full {
  grid-column: span 2;
}

.form-actions {
  margin-top: 16px;
  display: flex;
  gap: 10px;
}

/* =====================
   TABLE & PAGINATION
===================== */
.table-wrapper {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow-x: auto;
  width: 100% !important;
  max-width: 100vw;
  margin: 0 auto;
}

table {
  border-collapse: collapse;
  width: 100% !important;
  /* Fill container width */
  min-width: 100%;
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  /* Matched with info text */
  color: #1f2937;
  line-height: 1.5;
}

th,
td {
  padding: 5px 8px;
  /* Slightly more breathable but still compact */
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  /* No wrapping */
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

th {
  background: #f9fafb;
  text-align: left;
  font-weight: 600;
  font-size: 13px;
  color: #111827;
  position: sticky;
  top: 0;
  z-index: 2;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

tbody tr:hover {
  background: #f9fafb;
}

.truncate {
  max-width: 150px;
  /* Limit width for long text columns */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============================================================
   FIX v4.2.9: Table column width — compact & consistent
   Setiap kolom punya max-width supaya tidak ada yang terlalu panjang.
   Long text columns (Description, Items) di-truncate dengan ellipsis.
   ============================================================ */

/* Default td: compact padding + truncate */
tbody td {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 8px 10px;
  font-size: 13px;
}

/* Kolom ID — pendek */
tbody td:nth-child(1) { max-width: 130px; }

/* Kolom tanggal — pendek */
tbody td.text-center { max-width: 140px; }

/* Kolom angka — pendek */
tbody td.text-right { max-width: 130px; }

/* Header ikut compact */
thead th {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 10px;
  font-size: 12px;
}

/* Tooltip untuk text yang ter-truncate */
tbody td[title]:hover {
  cursor: help;
  background: #f3f4f6;
}

/* Table layout fixed supaya width konsisten */
table {
  table-layout: auto;
  width: 100%;
}

.text-right {
  text-align: right;
}

.text-center {
  text-align: center;
}

.pagination-btn {
  border: 1px solid var(--border);
  background: #f9fafb;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  margin: 0 1px;
}

.pagination-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* =====================
   STATUS BADGE
===================== */
.status {
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
}

.status.pending {
  background: var(--pending-bg);
  color: var(--pending-text);
}

.status.approved {
  background: var(--approved-bg);
  color: var(--approved-text);
}

.status.rejected {
  background: var(--rejected-bg);
  color: var(--rejected-text);
}

.status.done {
  background: #e0f2fe;
  color: #0369a1;
}

/* =====================
   TOAST
===================== */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #16a34a;
  color: #fff;
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 13px;
  opacity: 0;
  transform: translateY(-5px);
  transition: all .25s ease;
  z-index: 9999;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* =====================
   RESPONSIVE
===================== */
@media (max-width: 768px) {
  body {
    padding: 10px;
  }

  .form-grid {
    grid-template-columns: 1fr !important;
  }

  .form-grid .full {
    grid-column: span 1 !important;
  }

  .head-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .head-actions {
    width: 100%;
    align-items: flex-start;
  }

  .filter-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .table-bottom {
    flex-direction: column;
    gap: 12px;
    align-items: center;
    text-align: center;
  }

  .modal-content {
    margin: 10px;
    padding: 12px;
  }

  /* User Info Box (the one from auth.js) */
  #user-info-box {
    position: static !important;
    margin-top: 20px;
    width: 100%;
    justify-content: space-between;
  }
}

@media (max-width: 480px) {
  .header h1 {
    font-size: 1.8rem;
  }

  .stats-grid {
    grid-template-columns: 1fr !important;
  }

  .stat-card {
    padding: 20px !important;
  }
}

/* =====================
   MODAL
===================== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .4);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 10px;
}

.modal.show {
  display: flex;
}

.modal-content {
  background: #fff;
  width: 100%;
  max-width: 900px;
  max-height: 95vh;
  overflow-y: auto;
  border-radius: 10px;
  padding: 16px;
  animation: scaleIn .2s ease;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.modal-close {
  background: transparent;
  font-size: 22px;
  border: none;
  cursor: pointer;
}

@keyframes scaleIn {
  from {
    transform: scale(.95);
    opacity: 0
  }

  to {
    transform: scale(1);
    opacity: 1
  }
}

/* =====================
   DASHBOARD
===================== */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  width: 100%;
}

.dashboard-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  text-decoration: none;
  color: var(--text);
  transition: transform .15s ease, box-shadow .15s ease;
}

.dashboard-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, .08);
}

.card-icon {
  font-size: 36px;
  margin-bottom: 10px;
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
}

.card-desc {
  font-size: 13px;
  color: var(--muted);
}

/* =====================
   UTILITAS BARU (dipakai sekarang)
===================== */
.head-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.head-bar h2 {
  margin: 0;
  font-size: 1.5rem;
}

.head-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
}

.head-actions .btn-link,
.head-actions button {
  white-space: nowrap;
  height: 32px;
  line-height: 32px;
  padding: 0 12px;
}

.filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 10px 0;
  font-size: 13px;
}

.filter-bar select,
.filter-bar input {
  padding: 5px 6px;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.table-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 5px;
  /* Dipersempit */
  padding: 5px 0;
  /* Diperkecil */
  width: 100%;
}

#infoText {
  color: var(--muted);
  font-size: 13px;
  font-weight: normal;
  text-transform: none;
  letter-spacing: normal;
}

#pagination {
  display: flex;
  gap: 4px;
}

/* ===== ukuran huruf lebih kecil & rapat ===== */
body {
  font-size: 12.5px;
  /* tengah antara 12 & 13 */
  line-height: 1.4;
}

button,
input,
select,
.btn-link {
  font-size: 12px;
}

.table-top,
.table-bottom {
  font-size: 12px;
}

/* =====================
   GLOBAL LOADER
===================== */
#globalLoading {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,.8);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.loading-box {
  background: white;
  padding: 20px 28px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 4px 15px rgba(0,0,0,.15);
}

.spinner {
  width: 26px;
  height: 26px;
  border: 4px solid #e5e7eb;
  border-top: 4px solid #2563eb;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================================
   PART 2: themes.css
   ============================================================ */

/* ============================================================ 
   LIGHT COLORFUL THEME - Clean & Professional
   Multi Pastel Colors dengan kombinasi:
   Dashboard = Blue, Request = Purple, Approval = Pink,
   Done = Green, Rekap = Orange, Rejected = Red
   Modern pastel colors with white/light backgrounds
============================================================ */

body {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 100vh;
  background: #f8f9fa !important;
  position: relative;
  color: #1f2937;
}

/* Clean Glassmorphism */
.form-wrapper,
.table-wrapper,
.modal-content,
.dashboard-card {
  background: #ffffff !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: 1px solid #e5e7eb !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
  border-radius: 12px !important;
}

/* Modern Header Typography */
.head-bar h2 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1.75rem !important;
  letter-spacing: -0.025em;
  color: #1f2937;
}

/* ===== DASHBOARD (dashboard.html) - PASTEL BLUE ===== */
.theme-dashboard {
  --primary: #93c5fd;
  --primary-600: #60a5fa;
  --bg: #eff6ff;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%) !important;
}

.theme-dashboard th {
  background: #dbeafe;
  color: #1e40af;
  font-weight: 700;
}

.theme-dashboard .btn-primary {
  background: linear-gradient(135deg, #93c5fd, #60a5fa);
  color: white;
  box-shadow: 0 1px 3px rgba(96, 165, 250, 0.3);
}

.theme-dashboard .btn-primary:hover {
  background: linear-gradient(135deg, #60a5fa, #3b82f6);
  box-shadow: 0 4px 6px rgba(96, 165, 250, 0.4);
  transform: translateY(-1px);
}

/* ===== REQUEST (index.html) - PASTEL MINT ===== */
.theme-request {
  --primary: #a7f3d0;
  --primary-600: #6ee7b7;
  --bg: #f0fdf4;
  background: linear-gradient(135deg, #f0fdf4 0%, #d1fae5 100%) !important;
}

.theme-request th {
  background: #ccfbf1;
  color: #065f46;
  font-weight: 700;
}

.theme-request .btn-primary {
  background: linear-gradient(135deg, #a7f3d0, #6ee7b7);
  color: white;
  box-shadow: 0 1px 3px rgba(110, 231, 183, 0.3);
}

.theme-request .btn-primary:hover {
  background: linear-gradient(135deg, #6ee7b7, #34d399);
  box-shadow: 0 4px 6px rgba(110, 231, 183, 0.4);
  transform: translateY(-1px);
}

/* ===== APPROVAL (approval.html) - PASTEL PINK ===== */
.theme-approval {
  --primary: #f9a8d4;
  --primary-dark: #f472b6;
  --bg: #fce7f3;
  background: linear-gradient(135deg, #fdf2f8 0%, #fce7f3 100%) !important;
}

.theme-approval th {
  background: #fbcfe8;
  color: #be185d;
  font-weight: 700;
}

.theme-approval .btn-primary {
  background: linear-gradient(135deg, #f9a8d4, #f472b6);
  color: white;
  box-shadow: 0 1px 3px rgba(244, 114, 182, 0.3);
}

.theme-approval .btn-primary:hover {
  background: linear-gradient(135deg, #f472b6, #ec4899);
  box-shadow: 0 4px 6px rgba(244, 114, 182, 0.4);
  transform: translateY(-1px);
}

/* ===== DONE (done.html) - PASTEL GREEN ===== */
.theme-done {
  --primary: #86efac;
  --primary-600: #4ade80;
  --bg: #f0fdf4;
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%) !important;
}

.theme-done th {
  background: #c6f6d5;
  color: #15803d;
  font-weight: 700;
}

.theme-done .btn-primary {
  background: linear-gradient(135deg, #86efac, #4ade80);
  color: white;
  box-shadow: 0 1px 3px rgba(74, 222, 128, 0.3);
}

.theme-done .btn-primary:hover {
  background: linear-gradient(135deg, #4ade80, #22c55e);
  box-shadow: 0 4px 6px rgba(74, 222, 128, 0.4);
  transform: translateY(-1px);
}

/* ===== REKAP (rekap.html) - PASTEL ORANGE ===== */
.theme-rekap {
  --primary: #fed7aa;
  --primary-dark: #fdba74;
  --bg: #fffbeb;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%) !important;
}

.theme-rekap th {
  background: #fdd5a6;
  color: #92400e;
  font-weight: 700;
}

.theme-rekap .btn-primary {
  background: linear-gradient(135deg, #fed7aa, #fdba74);
  color: white;
  box-shadow: 0 1px 3px rgba(251, 146, 60, 0.3);
}

.theme-rekap .btn-primary:hover {
  background: linear-gradient(135deg, #fdba74, #fb923c);
  box-shadow: 0 4px 6px rgba(251, 146, 60, 0.4);
  transform: translateY(-1px);
}

/* ===== REJECTED (rejected.html) - PASTEL RED ===== */
.theme-rejected {
  --primary: #fca5a5;
  --primary-dark: #f87171;
  --bg: #fef2f2;
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%) !important;
}

.theme-rejected th {
  background: #fecaca;
  color: #991b1b;
  font-weight: 700;
}

.theme-rejected .btn-primary {
  background: linear-gradient(135deg, #fca5a5, #f87171);
  color: white;
  box-shadow: 0 1px 3px rgba(248, 113, 113, 0.3);
}

.theme-rejected .btn-primary:hover {
  background: linear-gradient(135deg, #f87171, #ef4444);
  box-shadow: 0 4px 6px rgba(248, 113, 113, 0.4);
  transform: translateY(-1px);
}

/* Professional Table Headers */
th {
  padding: 12px 16px !important;
  text-transform: uppercase;
  font-size: 11px !important;
  letter-spacing: 1px;
  border-bottom: 2px solid #e5e7eb !important;
  font-weight: 700 !important;
}

/* Modern Status Badges */
.status {
  padding: 4px 12px !important;
  border-radius: 6px !important;
  font-weight: 600 !important;
  font-size: 10px !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
}

.status.pending {
  background: #fef3c7;
  color: #92400e;
}

.status.approved {
  background: #dcfce7;
  color: #166534;
}

.status.done {
  background: #dbeafe;
  color: #1e40af;
}

.status.rejected {
  background: #fee2e2;
  color: #991b1b;
}

/* Button Refinement */
button,
.btn-link {
  font-weight: 600 !important;
  border-radius: 8px !important;
  transition: all 0.2s ease !important;
}

td button {
  padding: 4px 10px !important;
  border-radius: 6px !important;
  font-size: 10px !important;
}

.btn-primary {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border: none;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}

.btn-secondary {
  background: #f3f4f6;
  color: #374151;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-secondary:hover {
  background: #e5e7eb;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

/* Clean Toast */
.toast {
  background: #1f2937;
  border-radius: 8px !important;
  padding: 12px 20px !important;
  font-weight: 600 !important;
  box-shadow: 0 10px 15px rgba(0, 0, 0, 0.2) !important;
  color: white;
}

/* Table Row Hover */
tbody tr {
  transition: all 0.15s ease;
  border-bottom: 1px solid #f3f4f6;
}

tbody tr:hover {
  background: #f9fafb !important;
}

td {
  color: #374151;
}

/* Professional Pagination */
.pagination-btn {
  transition: all 0.2s ease !important;
  font-weight: 600 !important;
  background: white !important;
  color: #374151 !important;
  border: 1px solid #e5e7eb !important;
}

.pagination-btn:hover:not(.active) {
  background: #f9fafb !important;
  border-color: var(--primary) !important;
  transform: translateY(-1px);
}

.pagination-btn.active {
  background: var(--primary) !important;
  color: white !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
  border: 1px solid var(--primary) !important;
}

/* Text Color Overrides */
.text-center,
.text-right {
  color: #374151 !important;
}

#infoText {
  color: #6b7280;
}

label {
  color: #374151 !important;
}

/* Input Styling */
input,
select,
textarea {
  background: white !important;
  color: #1f2937 !important;
  border: 1px solid #d1d5db !important;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
}

/* ===== CUSTOM UNTUK DASHBOARD CARDS ===== */
.dashboard-card {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08) !important;
}

.dashboard-card:hover {
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08) !important;
  transform: translateY(-4px);
}

.stat-card {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08) !important;
}

.stat-card:hover {
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1) !important;
  transform: translateY(-4px);
}

/* Menu Item dari Dashboard */
.menu-item {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08) !important;
  border: 1px solid #e5e7eb !important;
}

.menu-item:hover {
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1) !important;
  transform: translateY(-4px);
  border-color: #d1d5db !important;
}

/* ============================================================
   PART 3: style.css (v2 additions)
   ============================================================ */

/* ============================
   style.css - v2.0 additions
   Tambahan style untuk v2.0:
   - .btn-danger (untuk reject/delete)
   - .status.partial (sebagian dibeli)
   - .empty-state (tabel kosong dengan ilustrasi)
   - #confirmModal styles (dari confirmDialog di ui-helper.js)
   - Anti-race-condition styles
   Load SETELAH css.css & themes.css
============================ */

/* ===== DANGER BUTTON ===== */
.btn-danger {
  background: #dc2626;
  color: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border: none;
}

.btn-danger:hover {
  background: #b91c1c;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}

/* ===== STATUS PARTIAL (sebagian dibeli) ===== */
.status.partial {
  background: #fef3c7 !important;
  color: #92400e !important;
}

/* ===== EMPTY STATE (tabel kosong) ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #6b7280;
}

.empty-state-icon {
  font-size: 64px;
  margin-bottom: 12px;
  opacity: 0.4;
}

.empty-state-msg {
  font-size: 14px;
  font-weight: 600;
  color: #6b7280;
}

.empty-state-cta {
  margin-top: 16px;
}

/* ===== CONFIRM MODAL (dari confirmDialog) ===== */
#confirmModal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 10px;
  animation: prFadeIn 0.2s ease;
}

#confirmModal .modal-content {
  background: #fff;
  width: 100%;
  max-width: 480px;
  max-height: 95vh;
  overflow-y: auto;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  animation: prScaleIn 0.2s ease;
}

#confirmModal .modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

#confirmModal .modal-close {
  background: transparent;
  font-size: 24px;
  border: none;
  cursor: pointer;
  color: #6b7280;
  padding: 0;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

#confirmModal .modal-close:hover {
  background: #f3f4f6;
  color: #1f2937;
}

#confirmModal .form-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  justify-content: flex-end;
}

#confirmModal input {
  width: 100%;
  padding: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 14px;
  background: #fff;
  color: #1f2937;
  transition: border-color 0.15s;
}

#confirmModal input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

@keyframes prFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes prScaleIn {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ===== TABLE ROW OPTIMISTIC UPDATE ANIMATION ===== */
tbody tr {
  transition: background 0.2s ease, opacity 0.3s ease;
}

tbody tr[data-id] {
  /* Marker untuk row yang punya ID (bisa di-animate) */
}

/* ===== ANTI-FLICKER: hide tbody during render ===== */
tbody[data-rendering="true"] {
  opacity: 0.5;
}

/* ===== SYNC BUTTON INDICATOR ===== */
#syncButton {
  position: relative;
}

#syncButton.syncing::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 8px;
  width: 12px;
  height: 12px;
  border: 2px solid #6b7280;
  border-top-color: transparent;
  border-radius: 50%;
  animation: prSpin 0.8s linear infinite;
  transform: translateY(-50%);
}

#syncButton.syncing {
  padding-left: 28px;
  opacity: 0.7;
  cursor: not-allowed;
}

@keyframes prSpin {
  to { transform: translateY(-50%) rotate(360deg); }
}


/* ===== END OF CONSOLIDATED CSS ===== */
