:root {
    --primary: #001a66;       
    --secondary: #0044cc;     
    --accent: #fbc531;        
    --bg-light: #f4f6f9;
    --white: #ffffff;
    --text-dark: #1e293b;
    --text-grey: #64748b;
    --border-color: #e2e8f0;
    --danger: #ef4444;
    --success: #10b981;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Poppins', sans-serif; }
body, html { width: 100%; height: 100dvh; overflow: hidden; background-color: var(--bg-light); color: var(--text-dark); }
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }

/* --- HEADER FIXED --- */
.app-header { position: fixed; top: 0; left: 0; width: 100%; height: 75px; background: radial-gradient(circle at 50% 50%, #00298a 0%, #000720 100%); display: flex; justify-content: center; align-items: center; box-shadow: 0 4px 15px rgba(0, 7, 32, 0.5); z-index: 1005; transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); transform: translate3d(0,0,0); will-change: transform; }
body.header-hidden .app-header { transform: translate3d(0,-100%,0); }
.app-header img { height: 50px; width: auto; object-fit: contain; mix-blend-mode: screen; }

.header-pull-tab { position: fixed; top: max(0px, env(safe-area-inset-top)); left: 50%; transform: translate(-50%, -100%); background: rgba(0, 26, 102, 0.85); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); color: var(--accent); padding: 5px 24px; border-radius: 0 0 14px 14px; font-size: 0.75rem; font-weight: 700; cursor: pointer; letter-spacing: 0.5px; z-index: 1004; transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); border: 1px solid rgba(255,255,255,0.2); border-top: none; box-shadow: 0 4px 10px rgba(0,0,0,0.2); will-change: transform; }
body.header-hidden .header-pull-tab { transform: translate(-50%, 0); }

/* --- MODALS --- */
.modal-wrap { position: fixed; top: 0; left: 0; width: 100vw; height: 100dvh; background: rgba(0, 7, 32, 0.65); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); z-index: 9999; display: flex; justify-content: center; align-items: center; opacity: 0; pointer-events: none; transition: opacity 0.3s ease; transform: translate3d(0,0,0); will-change: opacity; }
.modal-wrap.active { opacity: 1; pointer-events: auto; }
.modal-box { background: linear-gradient(135deg, rgba(0, 30, 100, 0.85) 0%, rgba(0, 10, 30, 0.98) 100%); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid rgba(255, 255, 255, 0.15); border-top: 1px solid rgba(255, 255, 255, 0.3); border-left: 1px solid rgba(255, 255, 255, 0.2); box-shadow: 0 20px 40px rgba(0,0,0,0.7); border-radius: 32px; width: 90%; max-width: 450px; text-align: center; padding: 35px 25px; transform: translate3d(0, 40px, 0) scale(0.95); transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1); will-change: transform; }
.modal-wrap.active .modal-box { transform: translate3d(0, 0, 0) scale(1); }
.note-modal-box { background: white; width: 90%; max-width: 400px; border-radius: 24px; padding: 25px; text-align: left; transform: translateY(30px) scale(0.95); transition: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); box-shadow: 0 20px 40px rgba(0,0,0,0.3); }
.modal-wrap.active .note-modal-box { transform: translateY(0) scale(1); }

.modal-box img.logo { height: 60px; width: auto; object-fit: contain; mix-blend-mode: screen; margin-bottom: 15px; filter: drop-shadow(0 0 15px rgba(0, 115, 230, 0.6)); }
.modal-box h2 { color: #ffffff; font-weight: 800; font-size: 1.4rem; margin-bottom: 5px; text-shadow: 0 4px 10px rgba(0,0,0,0.5); }
.modal-box p { color: rgba(255, 255, 255, 0.85); font-size: 0.85rem; margin-bottom: 20px; line-height: 1.5; }

/* --- DRIVER LIST WIDGET --- */
.welcome-driver-list { max-height: 250px; overflow-y: auto; margin-bottom: 20px; text-align: left; padding: 10px; background: rgba(0,0,0,0.2); border-radius: 16px; border: 1px solid rgba(255,255,255,0.1); }
.driver-card { display: flex; align-items: center; gap: 12px; background: rgba(255,255,255,0.95); padding: 12px; border-radius: 12px; margin-bottom: 10px; box-shadow: 0 4px 10px rgba(0,0,0,0.2); transition: transform 0.2s; }
.driver-card:hover { transform: translateY(-2px); }
.driver-card img { width: 45px; height: 45px; border-radius: 50%; object-fit: cover; border: 2px solid var(--secondary); flex-shrink: 0; background: #e2e8f0; }
.driver-card-info { flex: 1; overflow: hidden; }
.driver-card-name { font-weight: 700; color: var(--primary); font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.driver-card-armada { font-size: 0.7rem; color: var(--text-grey); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn-save-contact { background: linear-gradient(135deg, var(--success), #059669); color: white; border: none; padding: 8px 12px; border-radius: 8px; font-weight: 700; font-size: 0.75rem; cursor: pointer; box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3); flex-shrink: 0;}
.btn-save-contact:active { transform: scale(0.9); }

/* --- PROMO & KUPON CSS --- */
.promo-card { background: white; border: 2px solid var(--border-color); border-radius: 12px; padding: 15px; margin-bottom: 12px; cursor: pointer; transition: 0.2s; position: relative; overflow: hidden; text-align: left; }
.promo-card:active { transform: scale(0.97); }
.promo-card:hover { border-color: var(--secondary); background: #f8fafc; }
.promo-title { font-weight: 800; color: var(--primary); font-size: 1rem; margin-bottom: 5px; padding-right: 60px; }
.promo-desc { font-size: 0.75rem; color: var(--text-grey); margin-bottom: 10px; line-height: 1.4; }
.promo-price { font-size: 1rem; font-weight: 800; color: var(--accent); }
.promo-badge { position: absolute; top: 0; right: 0; background: var(--danger); color: white; font-size: 0.65rem; font-weight: 700; padding: 4px 10px; border-bottom-left-radius: 12px; }
.input-kupon-wrap { display: flex; gap: 10px; }
.btn-apply { background: var(--primary); color: white; border: none; padding: 0 15px; border-radius: 10px; font-weight: 600; cursor: pointer; transition: 0.2s; }
.btn-apply:active { transform: scale(0.95); }

/* --- BUTTONS & INPUTS --- */
.btn-main { background: linear-gradient(135deg, var(--secondary), var(--primary)); color: var(--white); border: none; border-radius: 12px; padding: 14px 20px; font-weight: 600; font-size: 1rem; cursor: pointer; width: 100%; box-shadow: 0 6px 15px rgba(0, 68, 204, 0.3); transition: transform 0.2s; }
.btn-main:active { transform: scale(0.98); }
.btn-main:disabled { background: #cbd5e1; box-shadow: none; cursor: not-allowed; color: #94a3b8; }
.btn-outline { background: var(--white); color: var(--text-dark); border: 1px solid var(--border-color); border-radius: 12px; padding: 10px; width: 100%; font-weight: 600; font-size: 0.85rem; cursor: pointer; margin-top: 10px; transition: background 0.2s, border-color 0.2s; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
.btn-outline:active { background: #f8fafc; color: var(--danger); border-color: var(--danger); }
.input-group { margin-bottom: 12px; }
.input-label { display: block; font-size: 0.75rem; color: var(--text-grey); font-weight: 600; margin-bottom: 6px; text-align: left; }
.std-input, .modern-input { width: 100%; border: 1.5px solid var(--border-color); padding: 12px 15px; border-radius: 12px; font-size: 0.85rem; outline: none; transition: border-color 0.2s, box-shadow 0.2s; background: #f8fafc; font-weight: 500; color: var(--text-dark); }
.std-input:focus, .modern-input:focus { background: #fff; border-color: var(--secondary); box-shadow: 0 0 0 3px rgba(0,68,204,0.1); }

/* --- SEARCH BOX RUTE PERJALANAN --- */
.glass-search { background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-radius: 20px; padding: 20px 18px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1); border: 1px solid rgba(255,255,255,0.8); transform: translate3d(0,0,0); display: flex; flex-direction: column; will-change: transform; }
.search-title { color: var(--primary); font-size: 1.1rem; font-weight: 700; margin: 0 0 15px 0; display: flex; align-items: center; gap: 8px; }
.search-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; position: relative; }
.search-row:last-of-type { margin-bottom: 0; }
.dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.dot-blue { background: var(--secondary); box-shadow: 0 0 6px var(--secondary); }
.dot-red { background: var(--danger); box-shadow: 0 0 6px var(--danger); }
.btn-locate { background: #e2e8f0; border: none; border-radius: 10px; width: 40px; height: 40px; display: flex; justify-content: center; align-items: center; cursor: pointer; transition: background 0.2s; flex-shrink: 0; }
.btn-locate:hover { background: var(--secondary); color: white; }
.floating-search.collapsed-search .hide-on-collapse { display: none !important; }
.floating-search.collapsed-search .search-title { font-size: 0.9rem; margin-bottom: 10px; }
.floating-search.collapsed-search .btn-locate { display: none; } 
.btn-expand-search { display: none; background: #fee2e2; color: var(--danger); border: none; border-radius: 10px; padding: 10px 14px; font-size: 0.75rem; font-weight: 700; cursor: pointer; white-space: nowrap; transition: transform 0.2s; }
.btn-expand-search:active { transform: scale(0.95); }
.floating-search.collapsed-search .btn-expand-search { display: block; }
.suggestions-list { position: absolute; top: 100%; left: 22px; right: 0; background: white; border-radius: 10px; box-shadow: 0 5px 15px rgba(0,0,0,0.1); list-style: none; padding: 5px 0; margin: 5px 0 0 0; z-index: 1010; max-height: 180px; overflow-y: auto; display: none; border: 1px solid var(--border-color); }
.suggestions-list li { padding: 12px 18px; border-bottom: 1px solid var(--bg-light); font-size: 0.85rem; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.suggestions-list li:hover { background: #f1f5f9; color: var(--secondary); }

/* --- FLOATING BOTTOM PANEL (Form Pemesanan) --- */
.bottom-panel { position: fixed; z-index: 1000; background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px); border: 1px solid rgba(255,255,255,0.6); box-shadow: 0 -10px 30px rgba(0,0,0,0.1); transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); display: flex; flex-direction: column; transform: translate3d(0,0,0); will-change: transform; bottom: calc(64px + env(safe-area-inset-bottom, 0px)); left: 0; width: 100%; border-radius: 28px 28px 0 0; }
.panel-header { padding: 18px 25px; cursor: pointer; display: flex; flex-direction: column; align-items: center; }
.sheet-handle { width: 45px; height: 5px; background: #cbd5e1; border-radius: 10px; margin-bottom: 12px; }
.panel-title-row { width: 100%; display: flex; justify-content: space-between; align-items: center; }
.panel-title-wrapper { display: flex; flex-direction: column; align-items: flex-start; }
.panel-title-wrapper h3 { color: var(--primary); font-size: 1.15rem; font-weight: 700; margin: 0; }
.swipe-hint { font-size: 0.7rem; color: var(--secondary); font-weight: 600; margin-top: 2px; display: inline-block; opacity: 0.9; }
.swipe-hint::after { content: 'Tarik ke bawah / Klik di sini'; }
.bottom-panel.collapsed .swipe-hint::after { content: 'Tarik ke atas / Klik di sini'; }
.toggle-icon { background: #f1f5f9; color: var(--primary); width: 30px; height: 30px; border-radius: 50%; display: flex; justify-content: center; align-items: center; font-size: 0.8rem; font-weight: bold; transition: transform 0.3s; }
.bottom-panel.collapsed .toggle-icon { transform: rotate(180deg); }
.panel-body { padding: 0 25px 25px 25px; max-height: 65vh; overflow-y: auto; opacity: 1; transition: max-height 0.4s ease, opacity 0.3s ease, padding 0.4s ease; will-change: max-height, opacity; }
.bottom-panel.collapsed .panel-body { max-height: 0; padding-bottom: 0; opacity: 0; margin: 0; overflow: hidden; }

/* --- DISPLAY CATATAN --- */
.catatan-box { font-size: 0.8rem; padding: 10px 12px; border-radius: 10px; margin-bottom: 8px; display: none; border-left: 4px solid; }
.cb-jemput { background: #e0f2fe; color: #0369a1; border-left-color: var(--secondary); }
.cb-tujuan { background: #fce7f3; color: #be185d; border-left-color: var(--danger); }

/* --- CONNECTING PUBLIC TRANSPORTATION --- */
.connecting-section { margin-top: 20px; padding-top: 15px; border-top: 1px dashed var(--border-color); }
.connecting-header { text-align: center; margin-bottom: 15px; }
.connecting-header h4 { color: var(--primary); font-size: 0.95rem; font-weight: 700; margin-bottom: 4px; }
.connecting-header p { color: var(--text-grey); font-size: 0.7rem; font-weight: 500; }
.connecting-grid { display: flex; overflow-x: auto; gap: 12px; padding-bottom: 10px; -webkit-overflow-scrolling: touch; scrollbar-width: none;}
.connecting-grid::-webkit-scrollbar { display: none; }
.connecting-card { min-width: 100px; background: #f8fafc; border: 1px solid var(--border-color); border-radius: 12px; padding: 12px 10px; display: flex; flex-direction: column; align-items: center; text-align: center; position: relative; flex-shrink: 0; opacity: 0.7; cursor: pointer; transition: 0.2s;}
.connecting-card:active { transform: scale(0.95); }
.connecting-card .c-icon { font-size: 1.8rem; margin-bottom: 8px; }
.connecting-card .c-title { font-size: 0.75rem; font-weight: 600; color: var(--text-dark); }
.coming-soon-badge { position: absolute; top: -6px; background: var(--danger); color: white; font-size: 0.6rem; font-weight: 700; padding: 2px 6px; border-radius: 10px; border: 1px solid white; }

/* INSTRUCTION MAP */
.map-instruction { position: absolute; top: 95px; left: 50%; transform: translate3d(-50%,0,0); color: white; padding: 10px 20px; border-radius: 30px; font-size: 0.85rem; z-index: 1000; font-weight: 600; box-shadow: 0 6px 15px rgba(0,0,0,0.15); transition: top 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); will-change: top; }
.instr-jemput { background: rgba(0, 26, 102, 0.9); }
.instr-tujuan { background: rgba(239, 68, 68, 0.9); }
.instr-tips { background: rgba(0, 68, 204, 0.9); }
body.header-hidden .map-instruction { top: calc(45px + env(safe-area-inset-top)); }

.price-box { display: flex; justify-content: space-between; align-items: flex-end; margin: 20px 0; padding-top: 18px; border-top: 2px dashed var(--border-color); }
.price-val { font-size: 1.8rem; font-weight: 800; color: var(--accent); line-height: 1; text-shadow: 0 1px 1px rgba(0,0,0,0.05); }
.dist-val { font-size: 1.2rem; font-weight: 700; color: var(--text-dark); line-height: 1; }

/* LEAFLET POPUP CUSTOM */
.leaflet-popup-content-wrapper { border-radius: 16px; padding: 0; box-shadow: 0 10px 25px rgba(0,0,0,0.15); overflow: hidden; border: 1px solid rgba(255,255,255,0.8); }
.leaflet-popup-content { margin: 0; }
.popup-custom-body { padding: 18px; text-align: center; min-width: 220px; font-family: 'Poppins', sans-serif; }
.popup-btn { width: 100%; padding: 10px; background: #fee2e2; color: var(--danger); border: none; border-radius: 10px; font-weight: 600; margin-top: 12px; cursor: pointer; transition: transform 0.2s; }
.popup-btn:active { transform: scale(0.95); }
.modern-select { width: 100%; margin-top: 8px; padding: 10px; border-radius: 10px; border: 2px solid var(--border-color); font-size: 0.85rem; font-family: 'Poppins', sans-serif; outline: none; color: var(--primary); font-weight: 600; }
.modern-select:focus { border-color: var(--secondary); }

/* --- HALAMAN AKTIVITAS & AKUN --- */
.activity-view { position: fixed; top: 0; left: 0; width: 100vw; height: 100dvh; background: var(--bg-light); z-index: 2000; display: flex; flex-direction: column; transform: translateY(100%); transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); will-change: transform; }
.activity-view.active { transform: translateY(0); }
.act-header { background: var(--white); padding: 20px; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 2px 10px rgba(0,0,0,0.05); z-index: 2; padding-top: max(20px, env(safe-area-inset-top)); }
.act-header h2 { font-size: 1.2rem; color: var(--primary); font-weight: 800; margin: 0; }
.btn-close-act { background: #f1f5f9; border: none; width: 35px; height: 35px; border-radius: 50%; font-weight: bold; color: var(--text-dark); cursor: pointer; font-size: 1rem; }
.act-body { flex: 1; overflow-y: auto; padding: 20px; padding-bottom: 100px; }
.act-search-box { background: var(--white); padding: 15px; border-radius: 16px; box-shadow: 0 4px 15px rgba(0,0,0,0.03); display: flex; gap: 10px; margin-bottom: 20px; }
.act-search-box input { flex: 1; border: 1.5px solid var(--border-color); border-radius: 10px; padding: 12px; font-size: 0.9rem; outline: none; background: #f8fafc; }
.act-search-box button { background: var(--secondary); color: white; border: none; border-radius: 10px; padding: 0 20px; font-weight: 600; cursor: pointer; }
.act-tabs { display: flex; gap: 10px; margin-bottom: 20px; }
.act-tab { flex: 1; padding: 12px; text-align: center; background: #e2e8f0; color: var(--text-grey); border-radius: 12px; font-weight: 600; font-size: 0.9rem; cursor: pointer; transition: 0.2s; }
.act-tab.active { background: var(--primary); color: white; box-shadow: 0 4px 10px rgba(0, 26, 102, 0.3); }
.order-card { background: var(--white); border-radius: 16px; padding: 20px; margin-bottom: 15px; box-shadow: 0 4px 15px rgba(0,0,0,0.04); border: 1px solid var(--border-color); }
.ord-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; border-bottom: 1px dashed var(--border-color); padding-bottom: 10px; }
.ord-id { font-weight: 700; color: var(--text-dark); font-size: 0.9rem; }
.ord-date { font-size: 0.75rem; color: var(--text-grey); }
.ord-status { padding: 4px 12px; border-radius: 20px; font-size: 0.75rem; font-weight: 700; }
.stat-pending { background: #fef3c7; color: #d97706; }
.stat-selesai { background: #d1fae5; color: var(--success); }
.ord-route { display: flex; flex-direction: column; gap: 8px; margin-bottom: 15px; }
.ord-point { display: flex; align-items: flex-start; gap: 10px; font-size: 0.85rem; font-weight: 500; }
.ord-point span { color: var(--text-grey); font-weight: 400; font-size: 0.75rem; display: block; }
.ord-foot { display: flex; justify-content: space-between; align-items: center; background: #f8fafc; padding: 12px; border-radius: 12px; }
.ord-price { font-weight: 800; color: var(--primary); font-size: 1.1rem; }
.btn-invoice { background: var(--white); border: 1.5px solid var(--secondary); color: var(--secondary); padding: 8px 15px; border-radius: 8px; font-size: 0.8rem; font-weight: 700; cursor: pointer; transition: 0.2s; }
.btn-invoice:active { background: var(--secondary); color: white; }
.empty-state { text-align: center; padding: 50px 20px; color: var(--text-grey); }
.empty-state h3 { margin-bottom: 10px; color: var(--primary); }
.account-avatar { width: 80px; height: 80px; background: #e2e8f0; border-radius: 50%; display: flex; justify-content: center; align-items: center; font-size: 2.5rem; margin-bottom: 15px; box-shadow: 0 4px 10px rgba(0,0,0,0.05); }

/* --- MODAL INVOICE --- */
.inv-modal { position: fixed; top: 0; left: 0; width: 100vw; height: 100dvh; background: rgba(0,0,0,0.7); backdrop-filter: blur(5px); z-index: 3000; display: flex; justify-content: center; align-items: flex-end; opacity: 0; pointer-events: none; transition: 0.3s; }
.inv-modal.active { opacity: 1; pointer-events: auto; }
.inv-box { background: white; width: 100%; max-width: 500px; border-radius: 24px 24px 0 0; padding: 30px; transform: translateY(100%); transition: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); }
.inv-modal.active .inv-box { transform: translateY(0); }
.inv-btn-wrap { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.btn-dl, .btn-pr { background: var(--primary); color: white; border: none; padding: 15px; border-radius: 12px; font-weight: 600; cursor: pointer; display: flex; justify-content: center; align-items: center; gap: 10px; font-size: 1rem; }
.btn-pr { background: var(--secondary); }

/* --- BOTTOM NAVIGATION BAR --- */
.bottom-nav { position: fixed; bottom: 0; left: 0; width: 100%; min-height: 65px; background: rgba(255, 255, 255, 0.98); backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px); display: flex; justify-content: space-between; align-items: center; padding: 10px 15px max(15px, env(safe-area-inset-bottom)) 15px; box-shadow: 0 -5px 20px rgba(0,0,0,0.08); z-index: 1001; border-top: 1px solid var(--border-color); transform: translate3d(0,0,0); }
.nav-item { display: flex; flex-direction: column; align-items: center; text-decoration: none; color: var(--text-grey); font-size: 0.7rem; font-weight: 600; transition: 0.2s; flex: 1; }
.nav-item.active { color: var(--secondary); }
.nav-item .icon { font-size: 1.3rem; margin-bottom: 2px; filter: grayscale(100%); opacity: 0.5; transition: 0.2s; }
.nav-item.active .icon { filter: none; opacity: 1; }
.nav-spacer { width: 70px; flex-shrink: 0; }
.nav-fab-wrapper { position: absolute; top: -25px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; width: 70px; }
.nav-fab { width: 56px; height: 56px; background: linear-gradient(135deg, var(--secondary), var(--primary)); border-radius: 50%; display: flex; justify-content: center; align-items: center; color: white; font-size: 1.5rem; text-decoration: none; box-shadow: 0 6px 15px rgba(0, 68, 204, 0.3); transition: transform 0.2s; margin-bottom: 4px; }
.nav-fab:active { transform: scale(0.95); }
.nav-fab-text { font-size: 0.7rem; font-weight: 700; color: var(--primary); letter-spacing: 0.2px; }

/* --- LIVE CHAT WIDGET --- */
.chat-widget-btn { position: fixed; bottom: 90px; right: 20px; width: 60px; height: 60px; background: linear-gradient(135deg, #10b981, #059669); border-radius: 50%; display: flex; justify-content: center; align-items: center; color: white; font-size: 2rem; cursor: pointer; box-shadow: 0 5px 20px rgba(16, 185, 129, 0.4); z-index: 1010; transition: 0.3s; }
.chat-widget-btn:active { transform: scale(0.9); }
.chat-widget-btn .notif-badge { position: absolute; top: -5px; right: -5px; background: #ef4444; color: white; font-size: 0.7rem; font-weight: bold; width: 20px; height: 20px; border-radius: 50%; display: flex; justify-content: center; align-items: center; border: 2px solid white; display: none; }
.chat-window { position: fixed; bottom: 100px; right: 20px; width: 350px; height: 500px; background: white; border-radius: 20px; box-shadow: 0 10px 40px rgba(0,0,0,0.15); z-index: 1011; display: flex; flex-direction: column; overflow: hidden; transform: scale(0); transform-origin: bottom right; opacity: 0; transition: 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); border: 1px solid var(--border-color); }
.chat-window.show { transform: scale(1); opacity: 1; }
.cw-header { background: linear-gradient(135deg, var(--secondary), var(--primary)); padding: 15px 20px; color: white; display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; }
.cw-header h3 { font-size: 1rem; margin: 0; display: flex; align-items: center; gap: 8px; }
.cw-close { background: rgba(255,255,255,0.2); border: none; color: white; width: 30px; height: 30px; border-radius: 50%; cursor: pointer; font-weight: bold; }
.cw-reg { padding: 30px 20px; flex: 1; overflow-y: auto; display: flex; flex-direction: column; justify-content: center; text-align: center; }
.cw-reg img { width: 80px; height: 80px; margin: 0 auto 15px auto; }
.cw-reg p { font-size: 0.85rem; color: var(--text-grey); margin-bottom: 20px; }
.cw-body { flex: 1; background: #e5e5f7; padding: 15px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; display: none; }
.cw-bubble-wrap { display: flex; flex-direction: column; max-width: 85%; }
.cw-bubble-wrap.in { align-self: flex-start; }
.cw-bubble-wrap.out { align-self: flex-end; }
.cw-bubble { padding: 10px 15px; border-radius: 12px; font-size: 0.85rem; box-shadow: 0 1px 2px rgba(0,0,0,0.1); word-wrap: break-word; }
.cw-bubble-wrap.in .cw-bubble { background: white; border-top-left-radius: 2px; }
.cw-bubble-wrap.out .cw-bubble { background: #dcf8c6; border-top-right-radius: 2px; }
.cw-sender { font-size: 0.7rem; font-weight: bold; color: var(--secondary); margin-bottom: 3px; }
.cw-bubble-wrap.out .cw-sender { display: none; } 
.cw-input-area { background: white; padding: 10px; display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--border-color); display: none; flex-shrink: 0;}
.cw-input { flex: 1; border: 1px solid var(--border-color); padding: 10px 15px; border-radius: 20px; outline: none; font-size: 0.85rem; background: #f8fafc; font-family: 'Poppins', sans-serif;}
.cw-send { background: var(--secondary); color: white; border: none; width: 38px; height: 38px; border-radius: 50%; cursor: pointer; display: flex; justify-content: center; align-items: center; flex-shrink: 0;}
#invoice-render-area { position: absolute; left: -9999px; top: 0; background: white; color: black; z-index: -1; }

/* =========================================
    TAMPILAN MOBILE & TABLET 
    ========================================= */
.app-container { position: relative; width: 100%; height: 100dvh; display: flex; flex-direction: column; } 
.map-area { position: absolute; top: 0; left: 0; width: 100%; height: 100dvh; z-index: 1; }
#map { width: 100%; height: 100%; background: #e5e7eb; } 
.floating-search { position: absolute; top: 95px; left: 50%; transform: translate3d(-50%,0,0); width: 92%; max-width: 450px; z-index: 1000; pointer-events: auto; transition: top 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); will-change: top; }
body.header-hidden .floating-search { top: calc(45px + env(safe-area-inset-top)); }

@media (max-width: 768px) {
    .chat-window { width: 90vw; right: 5vw; bottom: 80px; height: 60vh; }
    .chat-widget-btn { bottom: 80px; right: 15px; width: 55px; height: 55px; font-size: 1.8rem; }
}

/* =========================================
    TAMPILAN PC / DESKTOP
    ========================================= */
@media (min-width: 768px) {
    .app-container { flex-direction: row; }
    .map-area { position: absolute; top: 0; left: 0; width: 100vw; height: 100dvh; }
    .floating-search { position: absolute; top: 100px; right: 30px; left: auto; transform: translate3d(0,0,0); width: 380px; }
    body.header-hidden .floating-search { top: 30px; }
    .map-instruction { top: 100px; }
    body.header-hidden .map-instruction { top: 30px; }
    .bottom-panel { bottom: 30px; left: 30px; width: 400px; border-radius: 24px; box-shadow: 0 15px 40px rgba(0,0,0,0.15); border: 1px solid rgba(255,255,255,0.8); }
    .swipe-hint::after { content: 'Klik di sini untuk menutup'; }
    .bottom-panel.collapsed .swipe-hint::after { content: 'Klik di sini untuk membuka'; }
    .bottom-nav { bottom: 25px; left: 50%; transform: translateX(-50%); width: max-content; min-width: 400px; border-radius: 40px; border: 1px solid rgba(255,255,255,0.8); box-shadow: 0 15px 40px rgba(0,0,0,0.15); padding: 0 40px; height: 75px; justify-content: space-between; padding-bottom: 0; padding-top: 0; }
    .nav-item { flex: none; width: 65px; } 
    .nav-spacer { width: 80px; }
    .nav-fab-wrapper { top: -30px; }
    .nav-fab { width: 65px; height: 65px; font-size: 1.8rem; box-shadow: 0 10px 25px rgba(0, 68, 204, 0.4); margin-bottom: 6px; }
    .nav-fab-text { font-size: 0.75rem; }
    .inv-modal { align-items: center; }
    .inv-box { border-radius: 24px; transform: translateY(30px) scale(0.9); }
    .inv-modal.active .inv-box { transform: translateY(0) scale(1); }
    .activity-view { width: 450px; border-radius: 0 30px 30px 0; box-shadow: 10px 0 30px rgba(0,0,0,0.1); transform: translateX(-100%); transition: transform 0.4s; }
    .activity-view.active { transform: translateX(0); }
}

/* =========================================
    TAMPILAN MOBILE LANDSCAPE
    ========================================= */
@media (max-height: 600px) and (orientation: landscape) {
    .app-header { height: 50px; }
    .app-header img { height: 35px; }
    .floating-search { top: 60px; width: 320px; right: 15px; left: auto; transform: none; }
    body.header-hidden .floating-search { top: 15px; }
    .map-instruction { top: 60px; }
    body.header-hidden .map-instruction { top: 15px; }
    .bottom-panel { bottom: 15px; left: 15px; width: 340px; border-radius: 20px; position: absolute; }
    .panel-body { max-height: 45dvh; }
    .suggestions-list { max-height: 120px; }
    .bottom-nav { bottom: 15px; height: 60px; min-width: 350px; border-radius: 35px; left: 50%; transform: translateX(-50%); width: max-content; padding: 0 20px; gap: 10px; }
    .nav-item { flex: none; width: 60px; } 
    .nav-spacer { display: none; }
    .nav-fab-wrapper { position: relative; top: auto; left: auto; transform: none; }
    .nav-fab { width: 45px; height: 45px; font-size: 1.2rem; margin-bottom: 0; }
    .nav-fab-text { display: none; }
}