:root {
  --bg-color: #F2F2F7; 
  --card-bg: rgba(255, 255, 255, 0.75); 
  --glass-border: 1px solid rgba(255, 255, 255, 0.8);
  --primary: #007AFF; 
  --primary-dark: #0056b3;
  --text-main: #1C1C1E; 
  --text-muted: #8E8E93;
  --danger: #FF3B30; 
  --success: #34C759; 
  --warning: #FF9500; 
  --radius: 24px;
  --shadow-soft: 0 10px 40px rgba(0, 0, 0, 0.05);
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif; }

body { 
  background: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%);
  color: var(--text-main); 
  -webkit-font-smoothing: antialiased; 
  overflow-x: hidden; 
  touch-action: manipulation; 
  background-attachment: fixed;
}

#app-container { 
  width: 100%; max-width: 800px; margin: 0 auto; min-height: 100vh; position: relative; padding-bottom: 80px;
}

.glass { 
  background: var(--card-bg); backdrop-filter: blur(24px) saturate(180%); -webkit-backdrop-filter: blur(24px) saturate(180%); 
  border: var(--glass-border); border-radius: var(--radius); box-shadow: var(--shadow-soft); 
}

.view { display: none; padding: 24px; animation: fadeSlideIn 0.4s cubic-bezier(0.2, 0.8, 0.2, 1); }
.view.active { display: block; }
@keyframes fadeSlideIn { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }

h1 { font-size: clamp(28px, 6vw, 36px); font-weight: 800; margin-bottom: 8px; text-align: center; letter-spacing: -0.5px;}
p.subtitle { color: var(--text-muted); font-size: clamp(14px, 4vw, 16px); margin-bottom: 32px; text-align: center; }

@keyframes floatLogo { 0% { transform: translateY(0px); } 50% { transform: translateY(-10px); } 100% { transform: translateY(0px); } }

.brand-logo { 
  width: 120px; height: 120px; 
  background: transparent;
  border-radius: 28px; 
  margin: 60px auto 20px; 
  display: flex; align-items: center; justify-content: center; flex-direction: column;
  animation: floatLogo 4s ease-in-out infinite;
  color: #8B4513; 
  font-weight: 800; font-size: 20px; letter-spacing: 0.5px;
}
.brand-logo img {
  width: 64px; 
  height: 64px;
  margin-bottom: 6px;
  border-radius: 16px;
}

.input-group { margin-bottom: 16px; position: relative; display: flex; align-items: center; width: 100%; flex-wrap: wrap;}
.input-group input, .input-group textarea, .custom-input, select.custom-input { 
  width: 100%; padding: 18px 20px; border-radius: 18px; border: 1px solid rgba(0,0,0,0.06); 
  background: rgba(255,255,255,0.9); font-size: 16px; outline: none; transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1); 
  font-family: inherit; color: var(--text-main); font-weight: 500;
}
.input-group input:focus, .input-group textarea:focus, .custom-input:focus { background: #ffffff; box-shadow: 0 0 0 3px rgba(0,122,255,0.15); border-color: var(--primary); transform: translateY(-2px);}
.icon-btn { position: absolute; right: 16px; background: none; border: none; color: var(--text-muted); cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; z-index: 10;}

button { font-family: inherit; }
button.btn-primary { width: 100%; padding: 18px; background: var(--primary); color: white; border: none; border-radius: 18px; font-size: 17px; font-weight: 700; cursor: pointer; box-shadow: 0 8px 20px rgba(0,122,255,0.3); margin-top: 8px; transition: all 0.2s; letter-spacing: 0.5px;}
button.btn-primary:active { transform: scale(0.95); opacity: 0.9; box-shadow: 0 4px 10px rgba(0,122,255,0.2); }
button.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

button.btn-secondary { width: 100%; padding: 18px; background: rgba(0,0,0,0.05); color: var(--text-main); border: none; border-radius: 18px; font-size: 17px; font-weight: 700; cursor: pointer; margin-top: 8px; transition: 0.2s; }
button.btn-secondary:active { transform: scale(0.95); background: rgba(0,0,0,0.1);}

button.btn-danger { width: 100%; padding: 18px; background: rgba(255,59,48,0.1); color: var(--danger); border: none; border-radius: 18px; font-size: 17px; font-weight: 700; cursor: pointer; margin-top: 8px; transition: 0.2s; }
button.btn-danger:active { transform: scale(0.95); background: rgba(255,59,48,0.2);}

.link-text { color: var(--primary); font-size: 14px; font-weight: 600; text-align: center; display: block; margin-top: 20px; cursor: pointer; transition: 0.2s;}

.dash-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; padding-top: 10px;}

.profile-pic { 
  width: 48px; height: 48px; 
  border-radius: 50%; object-fit: cover; 
  border: 2px solid white; 
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}
.menu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 24px;}
.menu-card { padding: 24px 16px; text-align: center; cursor: pointer; transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1); display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px solid rgba(0,0,0,0.02);}
.menu-card:active { transform: scale(0.94); background: rgba(255,255,255,0.95);}

.btn-ios-nav { position: relative; z-index: 100; background: rgba(255,255,255,0.9); backdrop-filter: blur(10px); border: 1px solid rgba(0, 0, 0, 0.05); border-radius: 16px; width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: 0.3s ease; color: var(--primary); box-shadow: 0 4px 12px rgba(0,0,0,0.05); }
.btn-ios-nav:active { transform: scale(0.85); background: #f0f0f5; }

.btn-logout-icon { color: var(--danger); background: rgba(255, 59, 48, 0.1); border: 1px solid rgba(255, 59, 48, 0.2); position: relative; z-index: 100; backdrop-filter: blur(10px); border-radius: 16px; width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: 0.3s ease; box-shadow: 0 4px 12px rgba(255,59,48,0.1); }
.btn-logout-icon:active { transform: scale(0.85); background: rgba(255, 59, 48, 0.2); }

@keyframes spinSync { 100% { transform: rotate(360deg); } }
.is-syncing { background: rgba(255, 149, 0, 0.1); border-color: rgba(255, 149, 0, 0.3); pointer-events: none;}
.is-syncing svg { animation: spinSync 1s linear infinite; stroke: var(--warning); }

.sync-badge { position:absolute; top:-4px; right:-4px; background:var(--danger); color:white; font-size:10px; font-weight:bold; padding:2px 6px; border-radius:10px; border:2px solid white; display:none; }
.sync-badge.show { display:block; }

#toast { position: fixed; top: -100px; left: 50%; transform: translateX(-50%); background: rgba(25, 25, 27, 0.85); backdrop-filter: blur(20px); color: white; padding: 16px 24px; border-radius: 30px; box-shadow: 0 10px 40px rgba(0,0,0,0.2); font-weight: 600; z-index: 999999 !important;  transition: all 0.5s cubic-bezier(0.2, 0.8, 0.2, 1); text-align: center; width: 90%; max-width: 400px; font-size: 14px;}
#toast.show { top: 40px; } 
#toast.error { background: rgba(255, 59, 48, 0.9); } 
#toast.success { background: rgba(52, 199, 89, 0.9); }
#toast.warning { background: rgba(255, 149, 0, 0.9); }

.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); backdrop-filter: blur(8px); align-items: center; justify-content: center; opacity: 0; transition: 0.3s; z-index: 100000 !important; overflow-y:auto; padding: 20px 0;}
.modal-overlay.active { display: flex; opacity: 1; }
.modal-content { width: 92%; max-width: 440px; padding: 32px 24px; transform: scale(0.9); transition: 0.4s cubic-bezier(0.2, 0.8, 0.2, 1); max-height: 85vh; overflow-y: auto;}
.modal-overlay.active .modal-content { transform: scale(1); }

/* Memaksa Popup Konfirmasi Tampil Paling Depan Menembus Scanner */
#action-modal {
    z-index: 999999 !important;
}

/* Memastikan tulisan input dan elemen lain di dalamnya juga bisa di-klik */
#action-modal .modal-content {
    z-index: 1000000 !important;
    position: relative;
}
#modal-expedisi { z-index: 7500 !important; }

.loader { display: none; width: 24px; height: 24px; border: 3px solid rgba(255,255,255,0.3); border-radius: 50%; border-top-color: white; animation: spin 1s infinite; margin: 0 auto; }
.loader.dark { border-color: rgba(0,0,0,0.1); border-top-color: var(--primary); }
@keyframes spin { to { transform: rotate(360deg); } }

.input-label { width: 100%; font-size: 13px; font-weight: 700; color: var(--text-muted); margin-bottom: 8px; padding-left: 8px; display:block; text-align:left; text-transform: uppercase; letter-spacing: 0.5px;}
.scan-wrapper { position: relative; width: 100%; display: flex; align-items: center; }
.scan-wrapper input { padding-right: 70px; width: 100%; }
.scan-btn { position: absolute; right: 8px; width: 44px; height: 44px; background: rgba(0,122,255,0.1); color: var(--primary); border: none; border-radius: 14px; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: 0.2s; z-index: 100;}
.scan-btn:active { transform: scale(0.9); background: rgba(0,122,255,0.2);}

#staff-profile-modal { z-index: 9000 !important; }
#image-viewer { z-index: 9999 !important; }

/* ========================================================================= */
/* ⬇️ CSS KHUSUS SCANNER MPOS AESTHETIC ⬇️                                 */
/* ========================================================================= */

:root {
    --scanner-guide: rgba(255, 255, 255, 0.9);
    --scanner-dim: rgba(0, 0, 0, 0.8);
}

/* --- FONDASI FULLSCREEN --- */
.scanner-box-fullscreen {
    display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background-color: #000; padding: 0 !important; margin: 0 !important;
    z-index: 99999 !important; flex-direction: column; overflow: hidden;
}
.scanner-box-fullscreen.active { display: flex !important; }
.scanner-window-murni { width: 100%; height: 100%; position: relative; }

/* Paksa video memenuhi seluruh sudut tanpa celah */
#interactive.viewport { width: 100vw; height: 100vh; position: absolute; top: 0; left: 0; }
#interactive.viewport video { width: 100%; height: 100%; object-fit: cover !important; position: absolute; top: 0; left: 0; }
#interactive.viewport canvas.drawingBuffer { display: none; }

/* --- TOP BAR & TOMBOL --- */
.top-bar-mpos {
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%;
    display: flex; 
    justify-content: space-between; 
    align-items: center; /* KEMBALIKAN KE CENTER AGAR TOMBOL RAPI */
    /* Padding dinamis: Aman dari poni layar, tapi tombol tetap terpusat di area gelap */
    padding: max(30px, env(safe-area-inset-top)) 20px 15px 20px; 
    box-sizing: border-box; 
    z-index: 50; 
    background: linear-gradient(180deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.4) 60%, rgba(0,0,0,0) 100%);
    pointer-events: none; 
}

.top-bar-mpos > * {
    pointer-events: auto;
}
/* --- OVERLAY GELAP & KOTAK FOKUS --- */
.scanner-overlay-mpos {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 5; pointer-events: auto; /* Dinyalakan agar bisa di-tap */
    display: flex; flex-direction: column; justify-content: center; align-items: center;
}
.guide-box-mpos {
    width: 85%; height: 150px; max-width: 380px; pointer-events: none;
    border: 3px solid var(--scanner-guide); border-radius: 16px; position: relative;
    box-shadow: 0 0 0 9999px var(--scanner-dim);
    transition: border-color 0.2s ease, background-color 0.2s ease;
}
.guide-box-mpos.success {
    border-color: var(--success); background-color: rgba(52, 199, 89, 0.3);
    box-shadow: 0 0 0 9999px var(--scanner-dim), 0 0 25px var(--success);
}
.center-dot-mpos {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 6px; height: 6px; background-color: #ff3b30;
    border-radius: 50%; box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.9);
}
.scan-line-mpos {
    position: absolute; top: 0; left: 0; width: 100%; height: 2px;
    background-color: var(--success); box-shadow: 0 0 10px var(--success);
    animation: scanAnim 2.2s infinite linear;
}
@keyframes scanAnim { 0% { top: 0; opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { top: 100%; opacity: 0; } }
.help-text-mpos {
    color: white; font-size: 14px; font-weight: 600; margin-top: 30px; 
    text-shadow: 0 2px 6px rgba(0,0,0,0.9); z-index: 6; text-align: center; line-height: 1.6; padding: 0 30px; pointer-events: none;
}

/* Animasi Tap Fokus Kuning ala Kamera HP */
.tap-focus-ring {
    position: absolute; width: 60px; height: 60px; border: 2px solid #ffd60a; border-radius: 8px;
    box-shadow: 0 0 8px rgba(0,0,0,0.5); transform: translate(-50%, -50%) scale(1.5);
    opacity: 0; pointer-events: none; z-index: 100; transition: all 0.3s ease-out;
}
.tap-focus-ring.active { transform: translate(-50%, -50%) scale(1); opacity: 1; }

/* --- BOTTOM BAR & TOMBOL JEPRET --- */
.bottom-bar-mpos {
    position: absolute; bottom: max(30px, env(safe-area-inset-bottom)); left: 0; width: 100%;
    display: flex; flex-direction: column; align-items: center; gap: 15px; z-index: 20; pointer-events: none;
}
.btn-shutter-mpos {
    background-color: white; border: 6px solid rgba(0,0,0,0.3); pointer-events: auto;
    width: 75px; height: 75px; border-radius: 50%; cursor: pointer;
    box-shadow: 0 4px 20px rgba(0,0,0,0.6); transition: transform 0.1s;
}
.btn-shutter-mpos:active { transform: scale(0.92); }
.done-btn-mpos {
    background: var(--success); color: white; border: none; padding: 15px 30px; pointer-events: auto;
    border-radius: 20px; font-weight: 800; font-size: 16px; box-shadow: 0 4px 15px rgba(0,0,0,0.3); cursor: pointer; transition: 0.2s;
}
.done-btn-mpos:active { transform: scale(0.95); }

/* --- OCR WORKFLOW UI (MODERN DARK MODE PRO) --- */
.ocr-full-overlay {
    display: none; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: #000; z-index: 30; flex-direction: column; overflow: hidden;
}
.cropper-container-mpos { 
    width: 100%; flex: 1; overflow: hidden; display: flex; align-items: center; justify-content: center; background-color: black;
}
.ocr-bottom-panel {
    padding: 32px 24px calc(32px + env(safe-area-inset-bottom)); box-sizing: border-box;
    background: rgba(28, 28, 30, 0.85); /* Dark Glassmorphism */
    backdrop-filter: blur(25px); -webkit-backdrop-filter: blur(25px);
    border-top-left-radius: 32px; border-top-right-radius: 32px; 
    display: flex; flex-direction: column; align-items: center;
    box-shadow: 0 -10px 40px rgba(0,0,0,0.5); border-top: 1px solid rgba(255,255,255,0.15);
}
.ocr-instruction { font-size: 15px; color: rgba(255,255,255,0.8); font-weight: 500; text-align: center; margin-bottom: 24px; letter-spacing: 0.3px;}
.ocr-instruction b { color: #ffd60a; font-weight: 800;}
.ocr-btn-group { display: flex; gap: 14px; width: 100%; max-width: 380px;}
.ocr-btn-process { flex: 1.5; padding: 16px; border-radius: 18px; border:none; background: var(--primary); color: #fff; font-size: 16px; font-weight: 800; cursor: pointer; transition: 0.2s; box-shadow: 0 8px 20px rgba(0,122,255,0.3); display: flex; justify-content: center; align-items: center;}
.ocr-btn-retry { flex: 1; padding: 16px; border-radius: 18px; border:none; background: rgba(255,255,255,0.15); color: #fff; font-size: 16px; font-weight: 700; cursor: pointer; transition: 0.2s; display: flex; justify-content: center; align-items: center;}
.ocr-btn-process:active, .ocr-btn-retry:active { transform: scale(0.94); opacity: 0.8;}

/* --- MODIFIKASI CROPPER.JS MPOS KUNING ELEGAN --- */
.cropper-point {
    width: 30px !important; height: 30px !important;
    background-color: #ffd60a !important; border: 2px solid white !important;
    border-radius: 50% !important; opacity: 1 !important; box-shadow: 0 2px 4px rgba(0,0,0,0.4);
}
.cropper-point.point-se { right: -15px !important; bottom: -15px !important; }
.cropper-point.point-sw { left: -15px !important; bottom: -15px !important; }
.cropper-point.point-ne { right: -15px !important; top: -15px !important; }
.cropper-point.point-nw { left: -15px !important; top: -15px !important; }
.cropper-point.point-e, .cropper-point.point-w, .cropper-point.point-n, .cropper-point.point-s { display: none !important; }
.cropper-view-box { outline: 2px solid #ffd60a !important; box-shadow: 0 0 0 1px rgba(0,0,0,0.5); transition: outline 0.2s ease;}
.cropper-line { background-color: transparent !important; }

/* ⬆️ AKHIR CSS SCANNER MPOS AESTHETIC ⬆️                                 */
/* ========================================================================= */

.img-upload-box { position: relative; width: 100%; height: 120px; border: 2px dashed rgba(0,0,0,0.1); border-radius: 20px; display: flex; align-items: center; justify-content: center; flex-direction: column; overflow: hidden; cursor: pointer; background: rgba(255,255,255,0.5); transition: all 0.2s ease; gap: 8px;}
.img-upload-box:active { background: rgba(0,122,255,0.05); transform: scale(0.97); border-color: rgba(0,122,255,0.3);}
.img-upload-box input[type="file"] { position: absolute; top:0; left:0; width:100%; height:100%; opacity: 0; cursor: pointer; z-index: 10;}
.img-preview { position: absolute; top:0; left:0; width:100%; height:100%; object-fit: cover; display: none; z-index: 2;}
.img-upload-box span { font-size: 13px; color: var(--text-main); font-weight: 600; z-index: 1;}

.img-grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: 12px; margin-bottom: 20px; width: 100%;}
.img-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; width: 100%;}

.list-item-select { display: flex; align-items: center; gap: 16px; padding: 16px; border-bottom: 1px solid rgba(0,0,0,0.05); font-size: 15px; font-weight: 600; cursor: pointer; transition: 0.2s;}

#sig-canvas { border: 1px solid rgba(0,0,0,0.1); border-radius: 20px; background-color: #ffffff; width: 100%; height: 180px; touch-action: none; margin-bottom: 8px; box-shadow: inset 0 2px 10px rgba(0,0,0,0.02);}

.card-list { display: flex; flex-direction: column; gap: 16px; width: 100%; padding-bottom: 30px;}
.hist-card { background: rgba(255, 255, 255, 0.85); border-radius: 24px; padding: 20px; display: flex; gap: 16px; align-items: center; box-shadow: 0 4px 20px rgba(0,0,0,0.04); cursor: pointer; transition: all 0.3s ease; border: 1px solid rgba(255,255,255,0.8); backdrop-filter: blur(16px);}
.hist-card:active { transform: scale(0.96); box-shadow: 0 2px 10px rgba(0,0,0,0.04); }
.hist-img-wrapper { position: relative; width: 85px; height: 85px; border-radius: 18px; flex-shrink: 0; overflow: hidden; background: #f0f0f5; display:flex; align-items:center; justify-content:center; border: 1px solid rgba(0,0,0,0.05);}
.hist-img { width: 100%; height: 100%; object-fit: cover; }
.hist-type-icon { position: absolute; bottom: 4px; right: 4px; background: rgba(255,255,255,0.95); padding: 6px; border-radius: 12px; font-size: 14px; box-shadow: 0 4px 10px rgba(0,0,0,0.15); }
.hist-info { flex: 1; overflow: hidden; display: flex; flex-direction: column; justify-content: center;}
.hist-title { font-weight: 800; font-size: 16px; color: var(--text-main); margin-bottom: 4px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.hist-sub { font-size: 14px; font-weight: 600; color: var(--primary); margin-bottom: 8px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;}
.hist-badge { font-size: 11px; font-weight: 800; padding: 6px 12px; border-radius: 12px; text-transform: uppercase; color: white; position:absolute; top: 20px; right: 20px; box-shadow: 0 4px 10px rgba(0,0,0,0.1);}

.filter-tabs { display: flex; gap: 8px; margin-bottom: 20px; background: rgba(0,0,0,0.04); padding: 6px; border-radius: 20px; overflow-x: auto; scrollbar-width: none;}
.filter-tabs::-webkit-scrollbar { display: none; }
.tab-btn { flex: 1; padding: 12px 16px; border: none; background: transparent; border-radius: 16px; font-weight: 700; color: var(--text-muted); cursor: pointer; transition: 0.3s; white-space: nowrap; font-size: 14px;}
.tab-btn.active { background: white; color: var(--primary); box-shadow: 0 4px 12px rgba(0,0,0,0.05); }

.bulk-action-bar { display: none; gap: 12px; margin-bottom: 20px; animation: fadeSlideIn 0.3s ease; }
.bulk-action-bar.active { display: flex; }
.bulk-btn { flex: 1; padding: 12px; border-radius: 16px; font-weight: 700; font-size: 14px; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; transition: 0.2s;}
.bulk-btn:active { transform: scale(0.95); }
.bulk-btn.approve { background: rgba(52, 199, 89, 0.15); color: var(--success); }
.bulk-btn.reject { background: rgba(255, 59, 48, 0.15); color: var(--danger); }

#image-viewer { z-index: 9999999 !important; flex-direction: column; background: rgba(0,0,0,0.95); backdrop-filter: blur(20px); }
#image-viewer img { 
  max-width: 95%; max-height: 80vh; object-fit: contain; 
  border-radius: 16px; transition: transform 0.3s ease; 
  position:relative; z-index: 9999999 !important;
  user-select: none; 
  -webkit-user-drag: none; 
}
.viewer-controls { display: flex; gap: 24px; margin-top: 24px; position: relative; z-index: 9999999 !important; }
.viewer-btn { background: rgba(255,255,255,0.15); color: white; border: none; width: 56px; height: 56px; border-radius: 50%; font-size: 24px; cursor: pointer; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(10px); z-index: 9999999 !important; transition: 0.2s;}
#upload-queue { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 9999; pointer-events: none; }
.upload-task { background: rgba(255,255,255,0.95); backdrop-filter: blur(20px); border: 1px solid rgba(0,0,0,0.05); border-radius: 20px; padding: 16px 20px; display: flex; align-items: center; gap: 12px; box-shadow: 0 10px 40px rgba(0,0,0,0.15); font-size: 14px; font-weight: 600; color: var(--text-main); pointer-events: auto; animation: slideInRight 0.4s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes slideInRight { from { transform: translateX(120%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.upload-task.done { border-left: 5px solid var(--success); }
.upload-task.error { border-left: 5px solid var(--danger); }

.icon-action-btn { flex: 1; background: white; border: 1px solid rgba(0,0,0,0.05); border-radius: 16px; padding: 14px 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; cursor: pointer; transition: 0.2s; color: var(--text-main); font-size: 12px; font-weight: 700; box-shadow: 0 4px 12px rgba(0,0,0,0.03);}
.icon-action-btn:active { transform: scale(0.92); }
.icon-action-btn.danger { color: var(--danger); background: rgba(255,59,48,0.05); border-color: rgba(255,59,48,0.1);}
.icon-action-btn.warning { color: var(--warning); background: rgba(255,149,0,0.05); border-color: rgba(255,149,0,0.1);}

.profile-info { 
  display: flex; align-items: center; gap: 12px; cursor: pointer; 
  padding: 6px 16px 6px 6px;
  border-radius: 28px;
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1); 
  background: rgba(255, 255, 255, 0.85); 
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}
.profile-info:active { 
  transform: scale(0.95); 
  background: #ffffff; 
  box-shadow: 0 4px 12px rgba(0,0,0,0.02); 
}

.profile-edit-pic-wrapper { position: relative; width: 100px; height: 100px; border-radius: 50%; margin: 0 auto 20px; border: 3px solid var(--primary); overflow: hidden; display: flex; align-items: center; justify-content: center; background: #f0f0f5; box-shadow: 0 8px 24px rgba(0,122,255,0.25); }
.profile-edit-pic-wrapper img { width: 100%; height: 100%; object-fit: cover; position: relative; z-index: 2; }

.profile-detail-text { font-size: 15px; margin-bottom: 12px; display: flex; justify-content: space-between; border-bottom: 1px solid rgba(0,0,0,0.05); padding-bottom: 12px; }
.profile-detail-text span { color: var(--text-muted); font-weight: 600; }
.profile-detail-text b { color: var(--text-main); font-weight: 700;}

.log-item { background: rgba(255,255,255,0.8); padding: 18px; border-radius: 20px; margin-bottom: 16px; border: 1px solid rgba(0,0,0,0.03); display: flex; justify-content: space-between; align-items: center; cursor: pointer; transition: 0.2s; box-shadow: 0 4px 12px rgba(0,0,0,0.02);}
.log-item:active { transform: scale(0.96); background: white;}
.log-item-left { display: flex; flex-direction: column; gap: 6px; }
.log-item-title { font-weight: 800; font-size: 16px; color: var(--primary);}
.log-item-meta { font-size: 13px; color: var(--text-muted); font-weight: 600; display:flex; align-items:center; gap:6px;}
.log-pic { width:24px; height:24px; border-radius:50%; object-fit:cover; border:1px solid rgba(0,0,0,0.1);}

.stat-box { cursor: pointer; transition: transform 0.2s; padding: 10px; border-radius: 16px; background: transparent;}
.stat-box:active { transform: scale(0.9); background: rgba(0,0,0,0.03);}

@keyframes pulse-warn { 0% { box-shadow: 0 0 0 0 rgba(255, 149, 0, 0.4); } 70% { box-shadow: 0 0 0 10px rgba(255, 149, 0, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 149, 0, 0); } }
.pending-banner { background: rgba(255,149,0,0.1); border: 1px solid rgba(255,149,0,0.3); border-radius: 16px; padding: 12px 16px; display: flex; align-items: center; gap: 12px; margin-top: 12px; cursor: pointer; animation: pulse-warn 2s infinite; transition: 0.3s; }
.pending-banner:active { transform: scale(0.97); }

.chat-wrap { display: flex; flex-direction: column; gap: 14px; margin-top: 12px; background: rgba(0,0,0,0.02); padding: 16px; border-radius: 20px; border: 1px solid rgba(0,0,0,0.05); max-height: 300px; overflow-y: auto;}
.chat-row { display: flex; gap: 10px; align-items: flex-end; width: 100%; animation: fadeSlideIn 0.3s ease; }
.chat-row.admin { flex-direction: row-reverse; }
.chat-ava { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex-shrink: 0; border: 1px solid rgba(0,0,0,0.1); background: white; }
.chat-bubble { max-width: 80%; padding: 12px 16px; font-size: 13px; font-weight: 600; box-shadow: 0 4px 10px rgba(0,0,0,0.04); position: relative; line-height: 1.4; word-break: break-word;}
.chat-bubble.staff { background: white; color: var(--text-main); border-radius: 20px 20px 20px 4px; border: 1px solid rgba(0,0,0,0.04); }
.chat-bubble.admin { background: var(--primary); color: white; border-radius: 20px 20px 4px 20px; }
.chat-meta { font-size: 10px; font-weight: 800; margin-bottom: 6px; display: block; text-transform: uppercase; letter-spacing: 0.5px; }
.chat-bubble.staff .chat-meta { color: var(--text-muted); }
.chat-bubble.admin .chat-meta { color: rgba(255,255,255,0.8); text-align: right; }

#splash-screen {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: #FFFFFF;
  z-index: 999999; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  transition: opacity 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0.6s;
}
#splash-screen.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.splash-content { display: flex; flex-direction: column; align-items: center; animation: splashFloat 3s ease-in-out infinite; }
.splash-logo-box { width: 100px; height: 100px; background: transparent; display: flex; align-items: center; justify-content: center; margin-bottom: 20px; }
.splash-logo-box img { width: 80px; height: 80px; border-radius: 20px; }
.splash-title { color: #8B4513; font-size: 28px; font-weight: 800; letter-spacing: 1px; margin-bottom: 8px; } 
.splash-subtitle { color: var(--text-muted); font-size: 14px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; } 
.splash-loader-bar { width: 150px; height: 4px; background: rgba(0, 0, 0, 0.1); border-radius: 4px; margin-top: 40px; overflow: hidden; position: relative; }
.splash-loader-bar::after { content: ''; position: absolute; top: 0; left: 0; height: 100%; width: 40%; background: var(--primary); border-radius: 4px; animation: loadingSlide 1.5s cubic-bezier(0.4, 0, 0.2, 1) infinite; }

@keyframes splashFloat { 0% { transform: translateY(0px); } 50% { transform: translateY(-10px); } 100% { transform: translateY(0px); } }
@keyframes loadingSlide { 0% { transform: translateX(-100%); } 100% { transform: translateX(300%); } }

.help-section-card { 
  background: rgba(255, 255, 255, 0.95); 
  border-radius: 20px; 
  padding: 20px; 
  border: 1px solid rgba(0,0,0,0.04); 
  box-shadow: 0 10px 30px rgba(0,0,0,0.04); 
  transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1); 
}
.help-section-card:active { transform: scale(0.97); }
.help-section-header { 
  display: flex; align-items: center; gap: 14px; 
  margin-bottom: 14px; padding-bottom: 14px; 
  border-bottom: 1px dashed rgba(0,0,0,0.08); 
}
.help-icon-box { 
  width: 44px; height: 44px; border-radius: 14px; 
  display: flex; align-items: center; justify-content: center; 
  font-size: 22px; flex-shrink: 0; box-shadow: inset 0 2px 4px rgba(255,255,255,0.5);
}
.help-section-title { font-weight: 800; font-size: 17px; color: var(--text-main); letter-spacing: -0.3px; }
.help-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.help-list li { 
  font-size: 13.5px; color: var(--text-muted); line-height: 1.5; 
  padding-left: 24px; position: relative; font-weight: 500;
}
.help-list li b { color: var(--text-main); font-weight: 700; }
.help-list li::before { content: '✨'; position: absolute; left: 0; top: 1px; font-size: 14px; }
.help-list.security li::before { content: '🔒'; color: var(--success); }

.chat-change-box { margin-top: 10px; padding: 10px 12px; background: rgba(0,0,0,0.04); border-radius: 12px; font-size: 11.5px; color: var(--text-main); line-height: 1.6; border: 1px dashed rgba(0,0,0,0.08); }
.chat-change-box b { color: var(--primary); font-weight: 800; }
.chat-bubble.admin .chat-change-box { background: rgba(255,255,255,0.15); color: white; border-color: rgba(255,255,255,0.2); }
.chat-title-badge { display: inline-block; font-weight: 800; margin-bottom: 6px; font-size: 13px; }
.chat-thumb { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; cursor: zoom-in; border: 1px solid rgba(0,0,0,0.1); vertical-align: middle; margin-right: 6px; display: inline-block; box-shadow: 0 2px 6px rgba(0,0,0,0.05); }
.chat-new-img { display: inline-block; padding: 6px 10px; background: rgba(0,122,255,0.1); border-radius: 8px; font-size: 11px; font-weight: 800; color: var(--primary); vertical-align: middle; border: 1px dashed rgba(0,122,255,0.3); }
.chat-bubble.admin .chat-new-img { background: rgba(255,255,255,0.2); color: white; border-color: rgba(255,255,255,0.4); }

@keyframes subtleFloat {
  0%, 100% { transform: translateY(0px) scale(1); }
  50% { transform: translateY(-6px) scale(1.05); }
}
.menu-card div:first-child { display: inline-block; animation: subtleFloat 3.5s ease-in-out infinite; filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1)); }
.btn-ios-nav svg, .btn-logout-icon svg { transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.btn-ios-nav:active svg { transform: scale(0.6) rotate(-15deg); }
.btn-logout-icon:active svg { transform: scale(0.6) translateX(5px); }

@keyframes wobblePop {
  0%, 100% { transform: rotate(0deg) scale(1); }
  25% { transform: rotate(-15deg) scale(1.2); }
  75% { transform: rotate(15deg) scale(1.2); }
}
.icon-action-btn svg { transition: transform 0.2s ease; }
.icon-action-btn:active svg { animation: wobblePop 0.4s ease-in-out; color: inherit; }

.stat-box div:first-child { transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1); display: inline-block; }
.stat-box:active div:first-child { transform: scale(1.3) translateY(-2px); }

@keyframes pulseUpload {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(0,122,255,0.4); }
  70% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(0,122,255,0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(0,122,255,0); }
}
.img-upload-box .icon { border-radius: 50%; animation: pulseUpload 2.5s infinite; }
.img-upload-box:active .icon { animation: none; transform: scale(0.8); }

.help-icon-box { transition: transform 0.3s ease, background 0.3s ease; }
.help-section-card:active .help-icon-box { transform: scale(1.2) rotate(10deg); }

.scan-btn svg { transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.scan-btn:active svg { transform: scale(0.65) rotate(20deg); }
.icon-btn svg { transition: transform 0.2s ease, opacity 0.2s ease; }
.icon-btn:active svg { transform: scale(0.7); opacity: 0.6; }

@keyframes popBounce {
  0% { transform: scale(0.3) translateY(20px); opacity: 0; }
  50% { transform: scale(1.2) translateY(-5px); opacity: 1; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}
#action-icon { display: inline-block; animation: popBounce 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }

@keyframes statusHeartbeat {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1)); }
  25% { transform: scale(1.2) rotate(5deg); filter: drop-shadow(0 8px 12px rgba(0,0,0,0.2)); }
  50% { transform: scale(1); filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1)); }
  75% { transform: scale(1.2) rotate(-5deg); filter: drop-shadow(0 8px 12px rgba(0,0,0,0.2)); }
}
#univ-input-box span[style*="font-size:32px"] { display: inline-block; animation: statusHeartbeat 2.5s infinite ease-in-out; }

@keyframes popInRotate {
  0% { transform: scale(0) rotate(-30deg); opacity: 0; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}
#univ-input-box div[style*="48px"][style*="rgba"] { animation: popInRotate 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }

.log-item-title span, .hist-type-icon { display: inline-block; transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.log-item:active .log-item-title span, .hist-card:active .hist-type-icon { transform: scale(1.4) rotate(15deg); }

details summary .acc-arrow { display: inline-block; transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1) !important; }
details[open] summary .acc-arrow { transform: rotate(180deg) !important; color: var(--primary) !important; }

.bot-chat-container { background: #F4F5F7; display: flex; flex-direction: column; height: 100%; border-radius: 0 0 24px 24px; overflow: hidden; }
.bot-header { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: white; padding: 16px 20px; display: flex; align-items: center; gap: 14px; border-radius: 24px 24px 0 0; flex-shrink: 0; box-shadow: 0 4px 15px rgba(0,0,0,0.1); z-index: 10;}
.bot-avatar { font-size: 26px; background: rgba(255,255,255,0.2); border-radius: 50%; width: 46px; height: 46px; display: flex; justify-content: center; align-items: center; box-shadow: 0 2px 10px rgba(0,0,0,0.1); border: 2px solid rgba(255,255,255,0.4);}
.bot-msg-area { flex: 1; overflow: auto; padding: 20px; display: flex; flex-direction: column; gap: 14px; background-color: #EFEFF4; background-image: radial-gradient(rgba(0,0,0,0.06) 1px, transparent 1px); background-size: 20px 20px; }
.bot-bubble { max-width: 85%; padding: 12px 16px; border-radius: 18px; font-size: 14.5px; line-height: 1.5; position: relative; box-shadow: 0 2px 8px rgba(0,0,0,0.04); font-weight: 500; word-wrap: break-word; animation: fadeSlideIn 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);}
.bot-bubble.received { background: #ffffff; color: var(--text-main); align-self: flex-start; border-top-left-radius: 4px; border: 1px solid rgba(0,0,0,0.02); }
.bot-bubble.sent { background: linear-gradient(135deg, #007AFF, #0062CC); color: white; align-self: flex-end; border-top-right-radius: 4px; box-shadow: 0 4px 12px rgba(0,122,255,0.25); }
.bot-bubble.sent .bot-time { color: rgba(255,255,255,0.8); }
.bot-time { font-size: 10px; color: var(--text-muted); text-align: right; margin-top: 6px; display: block; font-weight: 700;}
.bot-input-area { background: #ffffff; padding: 12px 16px; display: flex; gap: 12px; align-items: center; flex-shrink: 0; padding-bottom: calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid rgba(0,0,0,0.05);}
.bot-input-box { flex:1; border: 1px solid rgba(0,0,0,0.1); padding: 14px 18px; border-radius: 24px; font-size: 14.5px; background: #f9f9f9; outline:none; transition: 0.3s; color: var(--text-main); font-weight: 500; }
.bot-input-box:focus { background: #fff; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0,122,255,0.1); }
.bot-suggestions-wrapper { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.bot-quick-reply { display: inline-flex; align-items: center; justify-content: center; background: rgba(0,122,255,0.08); color: var(--primary-dark); padding: 8px 14px; border-radius: 20px; font-size: 12.5px; font-weight: 700; border: 1px solid rgba(0,122,255,0.15); cursor: pointer; transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1); margin: 0; box-shadow: 0 2px 4px rgba(0,122,255,0.05);}
.bot-quick-reply:active { transform: scale(0.95); background: rgba(0,122,255,0.15); box-shadow: none;}
.bot-send-btn { background: var(--primary); color: white; border: none; width: 46px; height: 46px; border-radius: 50%; display: flex; justify-content: center; align-items: center; cursor: pointer; flex-shrink: 0; box-shadow: 0 4px 12px rgba(0,122,255,0.3); transition: transform 0.2s; }
.bot-send-btn:active { transform: scale(0.9); }

#stat-staff-filter::-webkit-scrollbar { display: none; }
#hist-staff-filter::-webkit-scrollbar { display: none; }
#log-staff-filter::-webkit-scrollbar { display: none; }

details > summary::-webkit-details-marker { display: none; }
.ios-list-row { display: flex; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid rgba(0,0,0,0.04); align-items: center; }
.ios-list-row:last-child { border-bottom: none; }
.ios-label { font-size: 13px; color: var(--text-muted); font-weight: 600; }
.ios-value { font-size: 14px; color: var(--text-main); font-weight: 700; text-align: right; max-width: 60%; word-break: break-word; }
.ios-img-label { position: absolute; bottom: 8px; left: 8px; background: rgba(255,255,255,0.85); color: var(--text-main); font-size: 11px; padding: 4px 10px; border-radius: 12px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); font-weight: 800; z-index: 10; box-shadow: 0 4px 10px rgba(0,0,0,0.1); }


/* --- KEMBALIKAN: TOMBOL TOP BAR YANG EMPUK --- */
.btn-icon-mpos {
    background: rgba(255, 255, 255, 0.25); 
    backdrop-filter: blur(20px); 
    -webkit-backdrop-filter: blur(20px);
    color: white; 
    border: 1px solid rgba(255,255,255,0.5); 
    border-radius: 20px; 
    padding: 12px 20px; 
    font-size: 13.5px; 
    font-weight: 800; 
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15); 
    transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1); 
}

.btn-icon-mpos:active {
    transform: scale(0.92); 
    background: rgba(255, 255, 255, 0.4);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.btn-icon-mpos.on { 
    background-color: #ffd60a; 
    color: black; 
    border-color: #ffd60a; 
    box-shadow: 0 4px 15px rgba(255, 214, 10, 0.35); 
}

.scan-badge-mpos { 
    background: var(--primary); 
    color: white; 
    padding: 10px 18px; 
    border-radius: 20px; 
    font-weight: 800; 
    font-size: 14px;
    box-shadow: 0 4px 15px rgba(0, 122, 255, 0.4); 
    transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}
