:root {
  --brand: #D4900A;
  --brand-light: #FEF3C7;
  --brand-dark: #B47800;
  --green: #22C55E;
  --green-light: #DCFCE7;
  --green-dark: #15803D;
  --amber: #F59E0B;
  --amber-light: #FEF3C7;
  --blue: #3B82F6;
  --blue-light: #EFF6FF;
  --red: #EF4444;
  --red-light: #FEF2F2;
  --purple: #8B5CF6;
  --purple-light: #F5F3FF;
  --bg: #FAF8F5;
  --surface: #FFFFFF;
  --surface2: #F5F2EE;
  --border: #E8E2DA;
  --text: #1A1510;
  --text2: #7A6E63;
  --text3: #B0A89E;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 2px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.10);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Plus Jakarta Sans', sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; }
.app { display: flex; flex-direction: column; min-height: 100vh; max-width: 480px; margin: 0 auto; background: var(--surface); box-shadow: 0 0 40px rgba(0,0,0,0.08); }
.header { background: var(--brand); padding: 20px 20px 16px; position: sticky; top: 0; z-index: 100; }
.header-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.logo { display: flex; align-items: center; gap: 10px; }
.logo-icon { width: 36px; height: 36px; background: rgba(255,255,255,0.25); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; }
.logo-text { font-size: 20px; font-weight: 800; color: white; letter-spacing: -0.5px; }
.sub-text { font-size: 14px; font-weight: 100; color: white; letter-spacing: -0.5px; text-align: right; font-family: 'Plus Jakarta Sans', sans-serif;}
.logo-sub { font-size: 11px; color: rgba(255,255,255,0.7); font-weight: 500; }
.header-date { font-size: 12px; color: rgba(255,255,255,0.75); font-weight: 500; background: rgba(255,255,255,0.15); padding: 6px 12px; border-radius: 20px; }
.sync-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 20px; }
.sync-ok { background: rgba(34,197,94,0.25); color: #86EFAC; }
.sync-loading { background: rgba(255,255,255,0.15); color: rgba(255,255,255,0.7); }
.sync-err { background: rgba(239,68,68,0.25); color: #FCA5A5; }
.nav { display: flex; gap: 4px; background: rgba(255,255,255,0.15); border-radius: 10px; padding: 4px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; scroll-snap-type: x proximity; }
.nav::-webkit-scrollbar { display: none; }
.nav-btn { flex: 1 1 0; min-width: 54px; padding: 8px 3px; border: none; background: none; color: rgba(255,255,255,0.7); font-size: 12px; font-weight: 600; cursor: pointer; border-radius: 7px; transition: all 0.2s; font-family: inherit; display: flex; flex-direction: column; align-items: center; gap: 2px; white-space: nowrap; scroll-snap-align: start; }
.nav-btn.active { background: white; color: var(--brand); }
.nav-btn .nav-icon { font-size: 16px; }
@media (max-width: 400px) {
  .nav-btn { font-size: 10.5px; min-width: 48px; padding: 8px 2px; }
  .nav-btn .nav-icon { font-size: 15px; }
}
@media (max-width: 340px) {
  .nav-btn { font-size: 9.5px; min-width: 44px; }
}
.content { flex: 1; padding: 16px; }
.tab-panel { 
  display: none; 
  opacity: 0;
  transform: translateY(10px);
}
.tab-panel.active { 
  display: block; 
  animation: fadeInTab 0.35s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
@keyframes fadeInTab {
  0% { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: translateY(0); }
}
.section-title { font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.section-title span { font-size: 13px; font-weight: 500; color: var(--text2); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.form-group { margin-bottom: 12px; }
.form-label { font-size: 12px; font-weight: 600; color: var(--text2); margin-bottom: 6px; display: block; text-transform: uppercase; letter-spacing: 0.5px; }
.form-input, .form-select { width: 100%; padding: 11px 14px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-size: 14px; font-family: inherit; color: var(--text); background: var(--surface); transition: border 0.2s; outline: none; }
.form-input:focus, .form-select:focus { border-color: var(--brand); }
.form-row { display: flex; gap: 8px; }
.form-row .form-group { flex: 1; }
.btn { padding: 11px 18px; border: none; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit; transition: all 0.15s; display: inline-flex; align-items: center; gap: 6px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: white; width: 100%; justify-content: center; }
.btn-primary:hover:not(:disabled) { background: var(--brand-dark); }
.btn-primary:active:not(:disabled) { transform: scale(0.98); }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 6px; }
.btn-ghost { background: none; border: 1.5px solid var(--border); color: var(--text2); }
.btn-ghost:hover { border-color: var(--text2); }
.btn-danger { background: var(--red-light); color: var(--red); }
.btn-success { background: var(--green-light); color: var(--green-dark); }
.btn-warning { background: var(--amber-light); color: #92400E; }
.order-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 8px; display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; transition: background 0.2s; }
.order-item.paid { background: var(--green-light); border-color: #86EFAC; }
.order-item-info { flex: 1; min-width: 0; }
.order-item-name { font-size: 14px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.order-item-buyer { font-size: 12px; color: var(--text2); margin-top: 2px; }
.order-item-details { font-size: 12px; color: var(--text3); margin-top: 2px; }
.order-item-price { font-size: 15px; font-weight: 700; color: var(--brand); white-space: nowrap; font-family: 'DM Mono', monospace; }
.order-item-actions { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; }
.summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.stat-label { font-size: 11px; font-weight: 600; color: var(--text2); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.stat-value { font-size: 18px; font-weight: 800; color: var(--text); font-family: 'DM Mono', monospace; line-height: 1.2; }
.stat-value.green { color: var(--green-dark); }
.stat-value.orange { color: var(--brand); }
.stat-value.blue { color: var(--blue); }
.stat-sub { font-size: 11px; color: var(--text3); margin-top: 4px; }
.period-tabs { display: flex; gap: 4px; background: var(--surface2); border-radius: var(--radius-sm); padding: 4px; margin-bottom: 16px; }
.period-tab { flex: 1; padding: 8px 4px; border: none; background: none; font-size: 13px; font-weight: 600; color: var(--text2); cursor: pointer; border-radius: 6px; font-family: inherit; transition: all 0.2s; }
.period-tab.active { background: white; color: var(--brand); box-shadow: var(--shadow); }
.deposit-item { background: var(--blue-light); border: 1px solid #BFDBFE; border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 8px; display: flex; align-items: flex-start; justify-content: space-between; }
.deposit-item.depleted { background: var(--red-light); border-color: #FCA5A5; }
.deposit-item.partial { background: var(--amber-light); border-color: #FDE68A; }
.deposit-item.full { background: var(--blue-light); border-color: #BFDBFE; }
.deposit-name { font-size: 14px; font-weight: 600; color: var(--text); }
.deposit-amount { font-size: 15px; font-weight: 700; color: var(--blue); font-family: 'DM Mono', monospace; }
.deposit-amount.red { color: var(--red); }
.deposit-amount.orange { color: #B45309; }
.deposit-date { font-size: 11px; color: var(--text3); margin-top: 2px; }
.deposit-balance-bar { height: 4px; border-radius: 2px; background: #BFDBFE; margin-top: 6px; overflow: hidden; }
.deposit-balance-fill { height: 100%; border-radius: 2px; background: var(--blue); transition: width 0.4s; }
.deposit-balance-fill.orange { background: var(--amber); }
.deposit-balance-fill.red { background: var(--red); }
.badge-deposit { background: #EFF6FF; color: #1D4ED8; border: 1px solid #BFDBFE; }
.badge-deposit-used { background: var(--amber-light); color: #92400E; border: 1px solid #FDE68A; }
.buyer-select { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.buyer-option { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; transition: all 0.2s; }
.buyer-option:hover { border-color: var(--brand); background: var(--brand-light); }
.buyer-option.selected { border-color: var(--brand); background: var(--brand-light); }
.buyer-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--brand); color: white; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; flex-shrink: 0; }
.buyer-info { flex: 1; }
.buyer-name { font-size: 14px; font-weight: 600; }
.buyer-total { font-size: 12px; color: var(--text2); font-family: 'DM Mono', monospace; }
.bill-preview { background: var(--surface2); border-radius: var(--radius); padding: 16px; margin-top: 12px; font-family: 'DM Mono', monospace; font-size: 13px; }
.bill-preview pre { white-space: pre-wrap; word-break: break-word; color: var(--text); line-height: 1.7; }
.bill-actions { display: flex; gap: 8px; margin-top: 12px; }
.bill-actions .btn { flex: 1; justify-content: center; }
.empty-state { text-align: center; padding: 40px 20px; color: var(--text3); }
.empty-icon { font-size: 40px; margin-bottom: 12px; }
.empty-text { font-size: 14px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--text); color: white; padding: 12px 20px; border-radius: 30px; font-size: 13px; font-weight: 600; z-index: 999; opacity: 0; transition: all 0.3s; pointer-events: none; max-width: 320px; text-align: center; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.chart-bars { display: flex; align-items: flex-end; gap: 6px; height: 80px; margin-bottom: 4px; }
.bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.bar { width: 100%; background: var(--brand-light); border-radius: 4px 4px 0 0; transition: height 0.5s; min-height: 3px; }
.bar.current { background: var(--brand); }
.bar-label { font-size: 10px; color: var(--text3); font-weight: 600; }
.orders-list { max-height: 55vh; overflow-y: auto; padding-right: 2px; }
.orders-list::-webkit-scrollbar { width: 4px; }
.orders-list::-webkit-scrollbar-track { background: transparent; }
.orders-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.note-input { font-size: 12px; padding: 7px 10px; }
.bulk-row { display:flex; align-items:center; justify-content:space-between; padding:7px 10px; border-radius:var(--radius-sm); font-size:13px; margin-bottom:4px; gap:8px; }
.bulk-row.valid { background:var(--green-light); border:1px solid #86EFAC; }
.bulk-row.invalid { background:var(--red-light); border:1px solid #FCA5A5; }
.bulk-row-info { flex:1; min-width:0; }
.bulk-row-name { font-weight:600; color:var(--text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.bulk-row-buyer { font-size:11px; color:var(--text2); }
.bulk-row-price { font-family:'DM Mono',monospace; font-weight:700; font-size:13px; white-space:nowrap; }
.bulk-row.valid .bulk-row-price { color:var(--green-dark); }
.bulk-row.invalid .bulk-row-price { color:var(--red); }
.qris-upload-zone { display: flex; flex-direction: column; align-items: center; justify-content: center; border: 2px dashed var(--border); border-radius: var(--radius); padding: 32px 20px; cursor: pointer; transition: all 0.2s; text-align: center; background: var(--surface2); }
.qris-upload-zone:hover { border-color: var(--brand); background: var(--brand-light); }
.qris-upload-icon { font-size: 36px; margin-bottom: 10px; }
.qris-upload-text { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.qris-upload-sub { font-size: 12px; color: var(--text3); }
.qris-frame { position: relative; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border); }
.qris-tap-hint { position: absolute; bottom: 0; left: 0; right: 0; background: linear-gradient(transparent, rgba(0,0,0,0.6)); color: white; font-size: 12px; font-weight: 600; text-align: center; padding: 20px 8px 8px; }
.nominal-chip { display: inline-flex; align-items: center; padding: 6px 12px; background: white; border: 1.5px solid var(--brand); border-radius: 20px; font-size: 13px; font-weight: 700; color: var(--brand); cursor: pointer; font-family: 'DM Mono', monospace; transition: all 0.15s; }
.nominal-chip:hover { background: var(--brand); color: white; }
.nominal-chip:active { transform: scale(0.96); }
.w-full { width: 100%; }
.text-right { text-align: right; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.text-sm { font-size: 12px; }
.text-muted { color: var(--text2); }
.font-bold { font-weight: 700; }
.filter-row { display: flex; gap: 6px; margin-bottom: 12px; align-items: center; flex-wrap: wrap; }
.filter-input { flex: 1; min-width: 120px; padding: 8px 12px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; font-family: inherit; outline: none; color: var(--text); background: var(--surface); }
.filter-input:focus { border-color: var(--brand); }
.date-filter-bar { display: flex; gap: 6px; margin-bottom: 14px; align-items: center; flex-wrap: wrap; }
.date-filter-bar .date-label { font-size: 11px; font-weight: 700; color: var(--text2); text-transform: uppercase; letter-spacing: 0.5px; white-space: nowrap; }
.date-filter-input { padding: 7px 10px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; font-family: inherit; outline: none; color: var(--text); background: var(--surface); transition: border 0.2s; cursor: pointer; }
.date-filter-input:focus { border-color: var(--brand); }
.date-shortcut-row { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 12px; }
.date-shortcut { padding: 5px 10px; border: 1.5px solid var(--border); border-radius: 20px; font-size: 11px; font-weight: 600; color: var(--text2); background: var(--surface); cursor: pointer; font-family: inherit; transition: all 0.15s; white-space: nowrap; }
.date-shortcut:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-light); }
.date-shortcut.active { border-color: var(--brand); color: var(--brand); background: var(--brand-light); }
.filter-section { background: var(--surface2); border-radius: var(--radius-sm); padding: 12px; margin-bottom: 14px; border: 1px solid var(--border); }
.filter-section-title { font-size: 11px; font-weight: 700; color: var(--text2); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
.active-filter-badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; background: var(--brand-light); border: 1px solid #FFB899; border-radius: 20px; font-size: 11px; font-weight: 700; color: var(--brand); margin-left: auto; }
.order-item-date { font-size: 11px; color: var(--text3); margin-top: 2px; }
.period-tabs-wrap { position: relative; margin-bottom: 14px; }
.summary-date-range { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.summary-date-range .date-filter-input { flex: 1; font-size: 12px; padding: 6px 10px; }
.summary-date-range-label { font-size: 11px; color: var(--text3); font-weight: 600; }
.tagihan-filter { background: var(--surface2); border-radius: var(--radius-sm); padding: 12px; margin-bottom: 14px; border: 1px solid var(--border); }
.tagihan-filter-row { display: flex; gap: 8px; align-items: center; }
.tagihan-filter-row .date-filter-input { flex: 1; font-size: 12px; padding: 6px 10px; }
.antrian-item { background: var(--surface); border: 1.5px solid var(--amber-light); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 8px; }
.antrian-item-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.antrian-item-name { font-size: 14px; font-weight: 700; color: var(--text); }
.antrian-item-price { font-size: 14px; font-weight: 700; color: var(--brand); font-family: 'DM Mono', monospace; white-space: nowrap; }
.antrian-buyer-row { display: flex; gap: 6px; align-items: center; }
.antrian-buyer-input { flex: 1; padding: 7px 10px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; font-family: inherit; outline: none; color: var(--text); background: var(--surface2); }
.antrian-buyer-input:focus { border-color: var(--brand); background: white; }
.antrian-send-btn { padding: 7px 12px; background: var(--green-light); color: var(--green-dark); border: none; border-radius: var(--radius-sm); font-size: 12px; font-weight: 700; cursor: pointer; font-family: inherit; white-space: nowrap; transition: all 0.15s; }
.antrian-send-btn:hover { background: var(--green); color: white; }
.antrian-del-btn { padding: 7px 10px; background: var(--red-light); color: var(--red); border: none; border-radius: var(--radius-sm); font-size: 12px; font-weight: 700; cursor: pointer; font-family: inherit; transition: all 0.15s; }
.antrian-del-btn:hover { background: var(--red); color: white; }
.antrian-sent { opacity: 0.45; pointer-events: none; }
#adminModal { position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,0.6);z-index:9990;display:none;align-items:center;justify-content:center; }
#adminModal.show { display:flex; }
.admin-modal-box { background:var(--surface);border-radius:20px;padding:28px 24px;width:90%;max-width:340px;text-align:center;box-shadow:var(--shadow-lg); }
.admin-modal-icon { font-size:42px;margin-bottom:8px; }
.admin-modal-title { font-size:18px;font-weight:800;color:var(--text);margin-bottom:4px; }
.admin-modal-sub { font-size:13px;color:var(--text2);margin-bottom:20px; }
.pin-dots { display:flex;gap:10px;justify-content:center;margin-bottom:18px; }
.pin-dot { width:14px;height:14px;border-radius:50%;border:2px solid var(--border);background:var(--surface2);transition:all 0.2s; }
.pin-dot.filled { background:var(--brand);border-color:var(--brand); }
.pin-dot.error { background:var(--red);border-color:var(--red); }
.pin-numpad { display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-bottom:14px; }
.pin-key { padding:14px;border:1.5px solid var(--border);border-radius:var(--radius-sm);font-size:18px;font-weight:700;background:var(--surface);color:var(--text);cursor:pointer;transition:all 0.15s;font-family:inherit; }
.pin-key:hover { background:var(--brand-light);border-color:var(--brand); }
.pin-key:active { transform:scale(0.94); }
.pin-key.del { font-size:16px;color:var(--red); }
.pin-error-msg { font-size:12px;color:var(--red);font-weight:600;min-height:18px;margin-bottom:6px; }
.admin-badge { display:inline-flex;align-items:center;gap:5px;font-size:11px;font-weight:700;padding:3px 10px;border-radius:20px;cursor:pointer;transition:all 0.2s; }
.admin-badge.is-admin { background:rgba(255,255,255,0.25);color:white; }
.admin-badge.is-user { background:rgba(255,255,255,0.15);color:rgba(255,255,255,0.8); }
/* Menu khusus admin disembunyikan total untuk user biasa (class "locked" dilepas saat admin login) */
.nav-btn.locked { display:none !important; }
#loadingOverlay { 
  position: fixed; 
  top: 0; left: 0; width: 100%; height: 100%; 
  background: rgba(250, 248, 245, 0.7); 
  backdrop-filter: blur(10px); /* Efek blur tembus pandang */
  -webkit-backdrop-filter: blur(10px);
  z-index: 9998; 
  display: flex; 
  flex-direction: column; 
  align-items: center; 
  justify-content: center; 
  gap: 16px; 
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
#loadingOverlay.hide {
  opacity: 0;
  visibility: hidden;
}
#loadingOverlay .load-icon { 
  font-size: 56px; 
  animation: bounceSpin 1.5s infinite cubic-bezier(0.68, -0.55, 0.265, 1.55); 
}
#loadingOverlay .load-text { 
  font-size: 16px; 
  font-weight: 800; 
  color: var(--brand); 
  letter-spacing: 1px;
  animation: pulseText 1.5s infinite ease-in-out; 
}
@keyframes bounceSpin { 
  0% { transform: translateY(0) rotate(0deg); } 
  50% { transform: translateY(-25px) rotate(180deg); } 
  100% { transform: translateY(0) rotate(360deg); } 
}
@keyframes pulseText { 
  0%, 100% { opacity: 1; } 
  50% { opacity: 0.5; } 
}
.sort-btn { display:inline-flex;align-items:center;gap:5px;padding:7px 12px;border:1.5px solid var(--border);border-radius:var(--radius-sm);font-size:12px;font-weight:700;background:var(--surface);color:var(--text2);cursor:pointer;font-family:inherit;transition:all 0.15s;white-space:nowrap; }
.sort-btn:hover { border-color:var(--brand);color:var(--brand);background:var(--brand-light); }
.sort-btn.active { border-color:var(--brand);color:var(--brand);background:var(--brand-light); }
.order-item.paid {
  background: linear-gradient(135deg, #DCFCE7 0%, #BBF7D0 100%) !important;
  border-color: #4ADE80 !important;
  box-shadow: 0 0 0 2px rgba(34,197,94,0.25), 0 2px 8px rgba(34,197,94,0.15);
  position: relative;
}
.order-item.paid::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(74,222,128,0.12) 0%, transparent 60%);
  pointer-events: none;
}
.order-item.paid .order-item-name { color: #15803D; }
.order-item.paid .order-item-price { color: #15803D; }
.buyer-option.all-paid {
  background: linear-gradient(135deg, #DCFCE7 0%, #BBF7D0 100%);
  border-color: #4ADE80;
  box-shadow: 0 0 0 2px rgba(34,197,94,0.2);
}
.buyer-option.all-paid .buyer-avatar { background: var(--green-dark) !important; }
.summary-buyer-row.all-paid {
  background: linear-gradient(135deg, #DCFCE7, #BBF7D0);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  margin: -4px -6px;
  box-shadow: 0 0 0 1.5px rgba(34,197,94,0.35);
}
.utb-name-card { text-align: center; padding: 28px 20px; }
.utb-name-icon { font-size: 40px; margin-bottom: 10px; }
.utb-name-title { font-size: 17px; font-weight: 800; color: var(--text); margin-bottom: 4px; }
.utb-name-sub { font-size: 13px; color: var(--text2); margin-bottom: 18px; }
.utb-user-bar { display:flex; align-items:center; justify-content:space-between; padding:12px 14px; }
.utb-user-bar-name { font-size: 14px; font-weight: 700; color: var(--text); }
.utb-user-bar-name span { font-size: 11px; font-weight: 600; color: var(--text2); display:block; text-transform:uppercase; letter-spacing:0.5px; margin-bottom:2px; }
.utb-list { padding-bottom: 90px; }
.utb-item { display:flex; align-items:center; gap:12px; background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 8px; transition: all 0.2s; }
.utb-item.checked { background: var(--green-light); border-color: #86EFAC; }
.utb-item.locked { background: var(--surface2); border-color: var(--border); opacity: 0.65; }
.utb-item-info { flex: 1; min-width: 0; }
.utb-item-name { font-size: 14px; font-weight: 700; color: var(--text); }
.utb-item-note { font-size: 11px; color: var(--text3); margin-top: 2px; }
.utb-item-locked-by { font-size: 11px; font-weight: 700; color: var(--amber); margin-top: 3px; display:flex; align-items:center; gap:4px; }
.utb-item-price { font-size: 14px; font-weight: 800; color: var(--brand); font-family: 'DM Mono', monospace; white-space: nowrap; }
.utb-order-bar { position: sticky; bottom: 0; left: 0; right: 0; background: var(--surface); border-top: 1.5px solid var(--border); padding: 12px 16px; margin: 12px -16px -16px; box-shadow: 0 -4px 16px rgba(0,0,0,0.08); }

/* Delete by date card */
.delete-date-card { background: var(--red-light); border: 1.5px solid #FCA5A5; border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.delete-date-card .section-title { color: var(--red); }
.delete-date-card .form-row { align-items: flex-end; }
.delete-date-card .btn-danger { background: var(--red); color: white; border: none; }
.delete-date-card .btn-danger:hover { background: #DC2626; }
.delete-date-card .btn-danger:disabled { opacity: 0.5; cursor: not-allowed; }

/* Order item highlight for delete mode */
.order-item.pending-delete { background: var(--red-light) !important; border-color: #FCA5A5 !important; opacity: 0.6; }

/* UTB Order Confirm Modal */
#utbConfirmModal { position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,0.6);z-index:9991;display:none;align-items:center;justify-content:center;padding:20px; }
#utbConfirmModal.show { display:flex; }
.utb-confirm-box { background:var(--surface);border-radius:20px;padding:24px 20px;width:100%;max-width:360px;box-shadow:var(--shadow-lg);max-height:85vh;overflow-y:auto; }
.utb-confirm-icon { font-size:36px;text-align:center;margin-bottom:6px; }
.utb-confirm-title { font-size:17px;font-weight:800;color:var(--text);text-align:center;margin-bottom:12px; }
.utb-confirm-buyer { font-size:14px;font-weight:700;color:var(--brand);text-align:center;background:var(--brand-light);padding:8px 12px;border-radius:var(--radius-sm);margin-bottom:14px; }
.utb-confirm-list { display:flex;flex-direction:column;gap:8px;margin-bottom:14px; }
.utb-confirm-item { display:flex;justify-content:space-between;align-items:flex-start;gap:8px;padding:10px 12px;background:var(--surface2);border-radius:var(--radius-sm); }
.utb-confirm-item-name { font-size:13px;font-weight:700;color:var(--text); }
.utb-confirm-item-note { font-size:11px;color:var(--text3);margin-top:2px; }
.utb-confirm-item-price { font-size:13px;font-weight:700;color:var(--brand);font-family:'DM Mono',monospace;white-space:nowrap; }
.utb-confirm-total-row { display:flex;justify-content:space-between;align-items:center;font-size:15px;font-weight:800;color:var(--text);padding-top:12px;border-top:1.5px solid var(--border);margin-bottom:16px; }
.utb-confirm-total-row span:last-child { color:var(--brand);font-family:'DM Mono',monospace; }
.utb-confirm-actions { display:flex;gap:8px; }

/* ============================================================
   HOME TAB / PRODUCTS
============================================================ */
.home-hero { background: linear-gradient(135deg, var(--brand-light) 0%, #FFF7ED 60%, var(--surface) 100%); border: 1px solid #FFE3B0; border-radius: var(--radius); padding: 22px 18px; margin-bottom: 16px; text-align: center; }
.home-hero-icon { font-size: 38px; margin-bottom: 8px; }
.home-hero-title { font-size: 18px; font-weight: 800; color: var(--text); margin-bottom: 4px; }
.home-hero-sub { font-size: 13px; color: var(--text2); }

.product-form-upload { display: flex; flex-direction: column; align-items: center; justify-content: center; border: 2px dashed var(--border); border-radius: var(--radius-sm); padding: 18px; cursor: pointer; transition: all 0.2s; text-align: center; background: var(--surface2); margin-bottom: 12px; min-height: 100px; }
.product-form-upload:hover { border-color: var(--brand); background: var(--brand-light); }
.product-form-upload img { max-width: 100%; max-height: 160px; border-radius: var(--radius-sm); object-fit: cover; display: block; }
.product-form-upload .upload-icon { font-size: 28px; margin-bottom: 6px; color: var(--text3); }
.product-form-upload .upload-text { font-size: 12px; font-weight: 600; color: var(--text2); }

.product-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.product-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform 0.2s, box-shadow 0.2s; display: flex; flex-direction: column; cursor: pointer; position: relative; }
.product-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.product-card-img-wrap { width: 100%; aspect-ratio: 1 / 1; background: var(--surface2); overflow: hidden; }
.product-card-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-card-img-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 34px; color: var(--text3); background: linear-gradient(135deg, var(--surface2), var(--brand-light)); }
.product-card-body { padding: 10px 12px 8px; flex: 1; }
.product-card-name { font-size: 13.5px; font-weight: 700; color: var(--text); margin-bottom: 3px; line-height: 1.3; }
.product-card-price { font-size: 14px; font-weight: 800; color: var(--brand); font-family: 'DM Mono', monospace; margin-bottom: 4px; }
.product-card-desc { font-size: 11.5px; color: var(--text2); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-card-admin-actions { display: flex; gap: 6px; padding: 0 12px 12px; }
.product-card-admin-actions .btn { flex: 1; justify-content: center; padding: 6px 8px; font-size: 11px; }

/* Product Detail Modal */
#productDetailModal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); z-index: 9992; display: none; align-items: center; justify-content: center; padding: 20px; }
#productDetailModal.show { display: flex; }
.product-detail-box { background: var(--surface); border-radius: 20px; width: 100%; max-width: 380px; max-height: 85vh; overflow-y: auto; box-shadow: var(--shadow-lg); position: relative; animation: fadeInTab 0.25s ease; }
.product-detail-close { position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; border-radius: 50%; background: rgba(0,0,0,0.55); color: white; border: none; font-size: 15px; cursor: pointer; z-index: 2; display: flex; align-items: center; justify-content: center; transition: background 0.15s; }
.product-detail-close:hover { background: rgba(0,0,0,0.75); }
.product-detail-img-wrap { width: 100%; aspect-ratio: 1 / 1; background: var(--surface2); overflow: hidden; border-radius: 20px 20px 0 0; }
.product-detail-img-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-detail-img-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 56px; color: var(--text3); background: linear-gradient(135deg, var(--surface2), var(--brand-light)); }
.product-detail-body { padding: 18px 20px 24px; }
.product-detail-name { font-size: 18px; font-weight: 800; color: var(--text); margin-bottom: 6px; line-height: 1.3; }
.product-detail-price { font-size: 17px; font-weight: 800; color: var(--brand); font-family: 'DM Mono', monospace; margin-bottom: 16px; }
.product-detail-desc-label { font-size: 11px; font-weight: 700; color: var(--text2); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.product-detail-desc { font-size: 13.5px; color: var(--text2); line-height: 1.7; white-space: pre-wrap; word-break: break-word; }

/* Toggle switch */
.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #D6D0C6; transition: 0.2s; border-radius: 24px; }
.switch .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.25); }
.switch input:checked + .slider { background-color: var(--green); }
.switch input:checked + .slider::before { transform: translateX(18px); }

/* Product badge (stok) */
.product-card-img-wrap, .product-detail-img-wrap { position: relative; }
.product-badge { position: absolute; top: 8px; right: 8px; z-index: 3; font-size: 10px; font-weight: 800; padding: 4px 10px; border-radius: 20px; letter-spacing: 0.3px; box-shadow: 0 2px 6px rgba(0,0,0,0.15); }
.product-badge.habis { background: var(--red); color: white; }
.product-card.unavailable .product-card-img,
.product-card.unavailable .product-card-img-placeholder,
.product-detail-img-wrap.unavailable img,
.product-detail-img-wrap.unavailable .product-detail-img-placeholder { filter: grayscale(0.85) brightness(0.82); }
.product-card.unavailable .product-card-name,
.product-card.unavailable .product-card-price { opacity: 0.6; }

/* Drag handle (admin reorder) */
.product-drag-handle { position: absolute; top: 8px; left: 8px; z-index: 3; width: 28px; height: 28px; border-radius: 50%; background: rgba(0,0,0,0.55); color: white; display: flex; align-items: center; justify-content: center; font-size: 15px; cursor: grab; touch-action: none; }
.product-drag-handle:active { cursor: grabbing; background: rgba(0,0,0,0.75); }

/* Sortable drag states */
.product-card-ghost { opacity: 0.35; }
.product-card-chosen { box-shadow: var(--shadow-lg); transform: scale(1.02); }
.product-card-drag { opacity: 0.95; }


/* 1. Desktop Application Container Refinement */
@media (min-width: 481px) {
  .app {
    margin: 24px auto;
    border-radius: 24px;
    min-height: calc(100vh - 48px);
    box-shadow: 0 16px 48px rgba(0,0,0,0.12), 0 0 0 8px rgba(255,255,255,0.4);
    border: 1px solid var(--border);
  }
}

/* 2. Glassmorphism Sticky Header */
.header { 
  background: rgba(212, 144, 10, 0.85); 
  backdrop-filter: blur(12px); 
  -webkit-backdrop-filter: blur(12px);
  padding: 20px 20px 16px; 
  position: sticky; 
  top: 0; 
  z-index: 100; 
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

/* 3. Fluid Tab Transitions */
.tab-panel { 
  display: none; 
  opacity: 0;
  transform: translateY(15px) scale(0.98);
}
.tab-panel.active { 
  display: block; 
  animation: smoothFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes smoothFadeIn {
  0% { opacity: 0; transform: translateY(15px) scale(0.98); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* 4. Enhanced Button Interactions */
.btn { 
  padding: 11px 18px; border: none; border-radius: var(--radius-sm); 
  font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit; 
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
  display: inline-flex; align-items: center; gap: 6px; 
}
.btn:hover:not(:disabled) { 
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}
.btn:active:not(:disabled) { 
  transform: translateY(0) scale(0.98);
  box-shadow: none;
}
.nav-btn {
  transition: all 0.3s ease;
}
.nav-btn:active {
  transform: scale(0.92);
}

/* 5. Hover Depth for Interactive Cards */
.card, .order-item, .utb-item, .deposit-item, .product-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.card:hover, .order-item:hover, .utb-item:hover, .deposit-item:hover, .product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}

/* ============================================================
   RUNNING TEXT (UTB REMINDER)
============================================================ */
.running-text-container {
  background: linear-gradient(135deg, #FFF7E8, #FEF3C7);
  border: 1.5px solid #FDE68A;
  border-radius: var(--radius-sm);
  padding: 10px 0;
  margin-bottom: 14px;
  overflow: hidden;
  white-space: nowrap;
  position: relative;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.08);
}

.running-text {
  display: inline-block;
  font-size: 12.5px;
  font-weight: 800;
  color: #92400E;
  padding-left: 100%; /* Starts just outside the right edge */
  animation: scrollText 14s linear infinite; /* Adjust '14s' to make it faster/slower */
}

@keyframes scrollText {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-100%);
  }
}


/* ============================================================
   CUSTOM ANIMATED CHECKBOX UTB
============================================================ */
.utb-checkbox-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  cursor: pointer;
  flex-shrink: 0;
}

/* Sembunyikan checkbox asli bawaan browser */
.utb-checkbox-wrap input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

/* Kotak checkbox kustom (rounded box) */
.custom-check {
  position: absolute;
  top: 0;
  left: 0;
  height: 28px;
  width: 28px;
  background-color: var(--surface2);
  border: 2px solid var(--border);
  border-radius: 8px; /* Lebih modern membulat */
  transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
}

/* Efek saat mouse mendekat (hover) */
.utb-checkbox-wrap:hover input:not(:disabled) ~ .custom-check {
  border-color: var(--brand);
  transform: scale(1.05);
}

/* Efek saat dicentang (Checked) */
.utb-checkbox-wrap input:checked ~ .custom-check {
  background-color: var(--green-dark);
  border-color: var(--green-dark);
  animation: checkBounce 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Ikon Ceklis (awalnya disembunyikan) */
.custom-check:after {
  content: "";
  position: absolute;
  display: none;
  left: 9px;
  top: 4px;
  width: 6px;
  height: 12px;
  border: solid white;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}

/* Munculkan Ikon Ceklis saat dicentang */
.utb-checkbox-wrap input:checked ~ .custom-check:after {
  display: block;
  animation: checkDraw 0.3s ease-in-out forwards;
}

/* Status Disabled (jika item sudah dipilih orang lain) */
.utb-checkbox-wrap input:disabled ~ .custom-check {
  background-color: var(--surface2);
  border-color: var(--border);
  opacity: 0.5;
  cursor: not-allowed;
}

/* Animasi Memantul (Bounce) */
@keyframes checkBounce {
  0% { transform: scale(1); }
  50% { transform: scale(0.85); }
  100% { transform: scale(1); }
}

/* Animasi Ceklis Digambar */
@keyframes checkDraw {
  0% { height: 0; width: 0; opacity: 0; }
  100% { height: 12px; width: 6px; opacity: 1; }
}

/* ============================================================
   MODERN BADGES (LUNAS / BELUM LUNAS)
============================================================ */
.badge { 
  display: inline-flex; 
  align-items: center; 
  padding: 3px 10px; 
  border-radius: 24px; 
  font-size: 11px; 
  font-weight: 800; 
  gap: 4px; 
  letter-spacing: 0.3px;
  text-transform: uppercase;
  transition: all 0.3s ease;
}

/* Badge LUNAS (Gradasi Hijau + Glow) */
.badge-paid { 
  background: linear-gradient(135deg, #DCFCE7 0%, #BBF7D0 100%); 
  color: #15803D; 
  border: 1px solid #86EFAC;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.2), inset 0 1px 0 rgba(255,255,255,0.5);
}

/* Efek saat card lunas di-hover (Glow membesar) */
.order-item.paid:hover .badge-paid {
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3), inset 0 1px 0 rgba(255,255,255,0.6);
  transform: translateY(-1px);
}

/* Badge BELUM (Gradasi Oranye/Kuning + Glow) */
.badge-unpaid { 
  background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%); 
  color: #B45309; 
  border: 1px solid #FCD34D;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.2), inset 0 1px 0 rgba(255,255,255,0.6);
}

/* Efek saat card belum lunas di-hover */
.order-item:not(.paid):hover .badge-unpaid {
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3), inset 0 1px 0 rgba(255,255,255,0.6);
  transform: translateY(-1px);
}

/* Menyesuaikan badge UTB Biru agar senada */
.badge-deposit, .badge[style*="#EFF6FF"] { 
  background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%) !important;
  color: #1D4ED8 !important; 
  border: 1px solid #BFDBFE !important; 
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15), inset 0 1px 0 rgba(255,255,255,0.6);
}

/* Animasi Icon Berputar saat Sinkronisasi */
@keyframes spinBadge {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.sync-badge .spin {
  display: inline-block;
  animation: spinBadge 1s linear infinite;
}


/* ============================================================
   RESPONSIVE DESIGN (Menyesuaikan Layar HP, Tablet, & PC)
   ============================================================ */

/* Untuk Layar HP / Mobile (Lebar max 768px) */
@media screen and (max-width: 768px) {
  body {
    font-size: 14px; /* Perkecil sedikit teks standar agar proporsional di HP */
    padding: 5px;
  }

  /* Kontainer Utama / Kartu Aplikasi */
  .container, .card, .main-container {
    padding: 10px !important;
    margin: 5px auto !important;
    width: 100% !important;
    box-sizing: border-box;
  }

  /* Navigasi Tab / Menu Atas */
  .nav-tabs, .tab-header {
    display: flex;
    overflow-x: auto; /* Bisa digeser horizontal jika menu banyak */
    white-space: nowrap;
    padding-bottom: 5px;
  }

  .nav-tabs button, .tab-btn {
    flex: 0 0 auto;
    padding: 8px 12px;
    font-size: 13px;
  }

  /* Grid Katalog Produk Beranda: 2 Kolom di HP */
  .product-grid, .menu-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }

  /* Tabel agar bisa digeser horizontal jika melebihi layar HP */
  .table-responsive, table {
    width: 100%;
    overflow-x: auto;
    display: block;
  }

  /* Tombol aksi agar lebih besar dan nyaman disentuh jari */
  button, .btn {
    padding: 10px 14px;
    font-size: 14px;
  }
}

/* Untuk Layar Sangat Kecil / HP Sempit (Lebar max 480px) */
@media screen and (max-width: 480px) {
  /* Katalog Produk Beranda: 1 atau 2 kolom rapat */
  .product-grid, .menu-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 6px !important;
  }

  /* Ukuran Judul Utama */
  h1, .header-title {
    font-size: 1.2rem !important;
  }
}

/* Untuk Layar Tablet & Desktop (Lebar di atas 769px) */
@media screen and (min-width: 769px) {
  .container {
    max-width: 800px; /* Batasi lebar maksimal agar tetap rapi dibaca di layar PC */
    margin: 20px auto;
  }

  /* Katalog Produk Beranda: 3-4 Kolom di Layar Lebar */
  .product-grid, .menu-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 15px !important;
  }
}

/* Responsif sentuhan jari untuk daftar pesanan & tombol */
.order-item:active, 
.utb-item:active, 
.buyer-option:active,
.product-card:active {
  transform: scale(0.98);
  opacity: 0.9;
  transition: transform 0.1s ease;
}


/* ============================================================
   STORE CLOSED UI (TAB UTB)
============================================================ */
.closed-store-card {
  background: linear-gradient(135deg, #FFF7ED 0%, #FFEDD5 100%);
  border: 1.5px solid #FDBA74;
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  margin: 10px 0 20px;
  box-shadow: 0 12px 32px rgba(253, 186, 116, 0.25);
  animation: smoothFadeIn 0.5s ease;
}
.closed-store-icon { 
  font-size: 64px; 
  margin-bottom: 16px; 
  animation: floatIcon 3s ease-in-out infinite; 
}
.closed-store-title { 
  font-size: 20px; 
  font-weight: 800; 
  color: #9A3412; 
  margin-bottom: 8px; 
  line-height: 1.3; 
}
.closed-store-sub { 
  font-size: 13px; 
  color: #C2410C; 
  font-weight: 600; 
  line-height: 1.5;
}
@keyframes floatIcon {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

/* ============================================================
   DARK MODE THEME (ELEGANT DARK GRAY)
============================================================ */
/* Efek transisi halus saat berganti tema */
body, .card, .bottom-nav, .order-item, .utb-item, input, select {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* ============================================================
   SMOOTH TRANSITION (Animasi halus saat ganti mode)
   ============================================================ */
body, .card, .order-item, .antrian-item, .deposit-item, .utb-item, 
.stat-card, input, select, textarea, .nav-btn, .header, .modal-content, .bill-preview {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease !important;
}

/* ============================================================
   SMOOTH TRANSITION (Animasi halus untuk semua elemen)
   ============================================================ */
*, *::before, *::after {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* ============================================================
   DARK MODE MODERN "ZINC/SLATE"
   ============================================================ */
body.dark-mode {
  /* Palet Warna Modern (Elegan, kontras pas, tidak bikin sakit mata) */
  --bg-base: #09090b;        /* Background paling luar (sangat gelap/Zinc 950) */
  --bg-surface: #18181b;     /* Background kartu/panel (Zinc 900) */
  --bg-surface-hover: #27272a;/* Hover state (Zinc 800) */
  --text-main: #f4f4f5;      /* Teks utama (putih bersih/Zinc 50) */
  --text-muted: #a1a1aa;     /* Teks sekunder (abu-abu terang/Zinc 400) */
  --border-color: #27272a;   /* Garis pembatas */
  
  --brand: #f97316;          /* Orange utama JajanYuk */
  --brand-dim: rgba(249, 115, 22, 0.15); /* Orange transparan */
  
  background-color: var(--bg-base) !important;
  color: var(--text-main) !important;
}

/* 1. Paksa area putih di luar kartu menjadi gelap (Fix Gambar 2) */
body.dark-mode #app, 
body.dark-mode .container, 
body.dark-mode .main-content,
body.dark-mode .tab-panel {
  background-color: var(--bg-base) !important;
}

/* 2. Kartu, List Item, dan Panel Wrapper */
body.dark-mode .card,
body.dark-mode .order-item,
body.dark-mode .antrian-item,
body.dark-mode .deposit-item,
body.dark-mode .utb-item,
body.dark-mode .stat-card,
body.dark-mode .bill-preview,
body.dark-mode .buyer-option,
body.dark-mode .modal-content,
/* Tangkap panel yang punya warna inline mencolok di JS (Fix Gambar 1) */
body.dark-mode div[style*="background:linear-gradient"],
body.dark-mode div[style*="background: linear-gradient"],
body.dark-mode div[style*="background:#F3F4F6"] {
  background: var(--bg-surface) !important;
  border-color: var(--border-color) !important;
  box-shadow: 0 4px 12px rgba(0,0,0, 0.4) !important;
}

/* 3. Perbaiki Teks Hitam yang Tidak Terbaca (Fix Gambar 2) */
body.dark-mode .order-item-name,
body.dark-mode .order-item-buyer,
body.dark-mode .buyer-name,
body.dark-mode .buyer-total,
body.dark-mode .antrian-item-name,
body.dark-mode .product-card-name,
body.dark-mode .section-title,
body.dark-mode .stat-label,
body.dark-mode .stat-value,
body.dark-mode pre,
body.dark-mode strong,
body.dark-mode b {
  color: var(--text-main) !important;
}

/* Teks keterangan sekunder */
body.dark-mode .order-item-date,
body.dark-mode .order-item-details,
body.dark-mode .stat-sub,
body.dark-mode .empty-text,
body.dark-mode .deposit-date,
body.dark-mode .utb-item-note {
  color: var(--text-muted) !important;
}

/* 4. Form Input & Dropdown (Biar menyatu dengan tema) */
body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea {
  background-color: #000000 !important; /* Kolom input lebih gelap dari kartu */
  color: var(--text-main) !important;
  border: 1px solid var(--border-color) !important;
}
body.dark-mode input:focus,
body.dark-mode select:focus {
  border-color: var(--brand) !important;
  outline: none !important;
  box-shadow: 0 0 0 3px var(--brand-dim) !important;
}
body.dark-mode input::placeholder {
  color: #52525b !important;
}

/* 5. Perbaikan Warna Kotak Pembeli Lunas (Fix Gambar 1 warna hijau terang) */
body.dark-mode .buyer-option.selected {
  background-color: var(--bg-surface-hover) !important;
  border-color: var(--brand) !important;
}
body.dark-mode .buyer-option.all-paid {
  background-color: rgba(21, 128, 61, 0.15) !important; /* Hijau kalem tembus pandang */
  border-color: #166534 !important;
}

/* 6. Perbaikan Tombol Filter Tanggal (Hari Ini, Kemarin, dll) */
body.dark-mode .nav-btn,
body.dark-mode .btn[style*="background:white"],
body.dark-mode .shortcut-btn {
  background-color: var(--bg-surface) !important;
  color: var(--text-muted) !important;
  border-color: var(--border-color) !important;
}
body.dark-mode .nav-btn.active,
body.dark-mode .shortcut-btn.active {
  background-color: var(--brand) !important;
  color: #ffffff !important;
  border-color: var(--brand) !important;
}

/* 7. Redam teks inline warna-warni dari JavaScript agar tidak sakit mata */
body.dark-mode [style*="color:var(--red)"],
body.dark-mode [style*="color:#92400E"] {
  color: #fca5a5 !important; /* Ubah merah terang jadi merah pastel */
}
body.dark-mode [style*="color:#15803D"] {
  color: #86efac !important; /* Ubah hijau terang jadi hijau pastel */
}
body.dark-mode [style*="color:var(--brand-dark)"] {
  color: var(--brand) !important;
}