/* WA Widget CSS — Classic Edition v2.2.4 (Opaque & Jade) */
:root {
    --wa-emerald: #00a884;
    --wa-gray-bg: #f0f2f5;
    --wa-premium-green: #25d366;
    --wa-premium-green-dark: #008069;
    --wa-premium-bg: #ffffff;
    --wa-premium-header-bg: #00a884;
    --wa-premium-chat-bg: #ffffff;
    --wa-premium-footer-bg: #f0f2f5;
    --wa-premium-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --wa-premium-radius: 12px;
    --wa-msg-out: linear-gradient(135deg, #dcf8c6, #c7efae);
    --wa-msg-in: #ffffff;
    --wa-msg-shadow: 0 1px 2px rgba(0,0,0,0.12);
}
body.wa-dark-mode {
    --wa-emerald: #00a884;
    --wa-premium-bg: #0b141a;
    --wa-premium-header-bg: #202c33;
    --wa-premium-chat-bg: #0b141a;
    --wa-premium-footer-bg: #202c33;
}

/* Base performance overrides */
#wa-widget-container * { animation: none !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
#wa-widget-container .wa-window { animation: wa-slide-in 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards !important; background: var(--wa-premium-bg) !important; }

#wa-widget-container {
    font-family: 'Segoe UI', Helvetica, Arial, sans-serif; display: none;
}
#wa-widget-container.logged-in { display: block; }
/* Float button: fixed left edge, vertically centered + floating */
.wa-float-btn {
    position: fixed !important;
    left: 0 !important; bottom: 20px !important; top: auto !important;
    transform: none !important;
    z-index: 99999 !important;
    animation: wa-btn-float 3s ease-in-out infinite;
}
@keyframes wa-btn-float {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateY(-6px) translateX(2px); }
}
/* Pulse saat tombol diklik / window terbuka */
.wa-float-btn.btn-active {
    animation: wa-btn-click 0.4s cubic-bezier(0.4, 0, 0.6, 1) forwards, wa-btn-float 3s ease-in-out 0.4s infinite !important;
}
@keyframes wa-btn-click {
    0% { transform: scale(1); }
    30% { transform: scale(1.18); }
    60% { transform: scale(0.94); }
    100% { transform: scale(1); }
}
/* Animasi pesan masuk — biarkan berjalan meski ada global none */
@keyframes wa-msg-appear { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }

/* -- Floating Button  nempel di dinding kiri, kotak rounded -- */
.wa-float-btn {
    width: 48px; height: 80px;
    background: linear-gradient(180deg, #25d366 0%, #0ea876 50%, #128c7e 100%);
    color: #fff;
    border-radius: 0 14px 14px 0;
    box-shadow: 4px 4px 20px rgba(37,211,102,0.35), 0 2px 8px rgba(0,0,0,0.1);
    display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 2px;
    font-size: 26px; cursor: pointer;
    transition: all 0.32s cubic-bezier(0.4,0,0.2,1);
    border: none; border-left: none;
}
.wa-float-btn:hover {
    width: 56px;
    box-shadow: 6px 6px 28px rgba(37,211,102,0.5), 0 2px 10px rgba(0,0,0,0.15) !important;
}
.wa-float-btn:active { width: 44px; }

/* Label kecil di bawah icon */
.wa-float-btn-label {
    font-size: 8px; font-weight: 700; letter-spacing: 0.5px;
    color: rgba(255,255,255,0.9); text-transform: uppercase;
    line-height: 1; margin-top: 1px;
}

/* -- Animasi berkedip saat ada WA masuk -- */
@keyframes wa-blink-alert {
    0%, 100% {
        background: linear-gradient(180deg, #25d366 0%, #0ea876 50%, #128c7e 100%);
        box-shadow: 4px 4px 20px rgba(37,211,102,0.35);
    }
    25% {
        background: linear-gradient(180deg, #ff5252 0%, #ff1744 50%, #d50000 100%);
        box-shadow: 4px 4px 28px rgba(255,23,68,0.6), 0 0 12px rgba(255,82,82,0.4);
    }
    50% {
        background: linear-gradient(180deg, #25d366 0%, #0ea876 50%, #128c7e 100%);
        box-shadow: 4px 4px 20px rgba(37,211,102,0.35);
    }
    75% {
        background: linear-gradient(180deg, #ff5252 0%, #ff1744 50%, #d50000 100%);
        box-shadow: 4px 4px 28px rgba(255,23,68,0.6), 0 0 12px rgba(255,82,82,0.4);
    }
}
.wa-float-btn.wa-has-unread {
    animation: wa-blink-alert 1.8s ease-in-out infinite;
}
.wa-float-btn.wa-has-unread:hover {
    animation: none;
    background: linear-gradient(180deg, #25d366 0%, #0ea876 50%, #128c7e 100%);
}

.wa-badge {
    position: absolute; top: -5px; right: -5px;
    background: linear-gradient(135deg, #ff3b30, #e60000); color: #fff;
    border-radius: 50%; width: 22px; height: 22px; font-size: 10px;
    display: none; align-items: center; justify-content: center;
    font-weight: 700; border: 2.5px solid #fff;
    box-shadow: 0 2px 8px rgba(255,59,48,0.45);
    animation: badge-pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), 
               wa-badge-pulse 2s infinite;
}
@keyframes wa-badge-pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.6); }
    70% { box-shadow: 0 0 0 10px rgba(255, 59, 48, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 59, 48, 0); }
}
@keyframes badge-pop { from { transform: scale(0); } to { transform: scale(1); } }

/* -- Main Window  Super Solid & Opaque (v2.2.2) -- */
.wa-window {
    position: fixed;
    bottom: 20px; left: 0;
    background: #ffffff !important; /* Force Solid White in Light Mode */
    border-radius: 0 var(--wa-premium-radius) var(--wa-premium-radius) 0;
    box-shadow: var(--wa-premium-shadow);
    display: flex;
    overflow: hidden;
    width: 900px;
    height: min(710px, calc(100vh - 40px));
    z-index: 9998;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    animation: wa-slide-in 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
body.wa-dark-mode .wa-window { background: #0b141a !important; }
@keyframes wa-slide-in {
    from { transform: translateX(-100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
.wa-window.sidebar-only { width: 380px; transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1); }
.wa-window.wa-hidden {
    animation: wa-slide-out 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    pointer-events: none;
}
@keyframes wa-slide-out {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(-100%); opacity: 0; }
}
.wa-window.wa-hidden.wa-no-anim { display: none !important; animation: none; }
.wa-window.sidebar-only .wa-chat-area { display: none !important; }

/* -- SIDEBAR -- */
.wa-sidebar {
    width: 360px; min-width: 360px; flex-shrink: 0;
    border-right: 1px solid #eceef0;
    display: flex; flex-direction: column;
    background: #ffffff !important; box-sizing: border-box; overflow: hidden;
}
body.wa-dark-mode .wa-sidebar { background: #111b21 !important; }

.wa-sidebar-header {
    background: var(--wa-premium-header-bg) !important;
    padding: 0 16px; height: 60px;
    display: flex; align-items: center; justify-content: space-between;
    box-sizing: border-box; flex-shrink: 0; gap: 8px;
    position: relative; overflow: hidden;
    color: #ffffff !important;
}
.wa-sidebar-header * { color: #ffffff !important; }
.wa-sidebar-header::after { display: none !important; }

/* Search */
.wa-search-box {
    padding: 8px 12px; background: #f7f8fa;
    border-bottom: 1px solid #eceef2; flex-shrink: 0;
}
.wa-search-input {
    width: 100%; padding: 8px 36px 8px 38px;
    border-radius: 20px; border: 1px solid #e2e5ea; background: #fff; outline: none;
    font-size: 14px; box-shadow: none;
    box-sizing: border-box; color: #333;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2.5' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: 13px center;
    transition: all 0.2s ease;
}
.wa-search-input:focus { border-color: #25d366; box-shadow: 0 0 0 3px rgba(37,211,102,0.12); }
.wa-search-input::placeholder { color: #999; }

/* === ASSIGN FILTER BAR (dot-only + queue chip) === */
.wa-assign-filter-bar{
    display:flex;
    gap:6px;
    flex-wrap:nowrap;
    overflow-x:auto;
    padding:4px 2px 6px 2px;
    -webkit-overflow-scrolling:touch;
    align-items:center;
}
.wa-assign-filter-bar::-webkit-scrollbar{ height:3px; }
.wa-assign-filter-bar::-webkit-scrollbar-thumb{ background:rgba(0,0,0,0.12); border-radius:999px; }
.wa-assign-chip{
    width:20px; height:20px;
    padding:0;
    border-radius:50%;
    cursor:pointer;
    border:2px solid rgba(0,0,0,0.12);
    background:#fff;
    box-shadow:0 1px 4px rgba(0,0,0,0.10);
    user-select:none;
    flex:0 0 auto;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    transition: all 0.15s ease;
    position:relative;
}
.wa-assign-chip:hover{
    transform: scale(1.15);
    box-shadow:0 2px 8px rgba(0,0,0,0.18);
}
.wa-assign-chip .dot{
    width:12px; height:12px; border-radius:50%; flex-shrink:0;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.15);
}
.wa-assign-chip.active{
    border-color:rgba(37,211,102,0.7);
    box-shadow:0 0 0 3px rgba(37,211,102,0.2), 0 1px 4px rgba(0,0,0,0.12);
    transform: scale(1.12);
}
/* Chip antrian desain: kotak rounded, warna ungu sesuai badge antrian */
.wa-assign-chip[data-op="__QUEUE__"]{
    border-radius:6px;
    width:22px; height:20px;
    background:linear-gradient(135deg,#7c4dff,#512da8);
    border-color:rgba(124,77,255,0.5);
}
.wa-assign-chip[data-op="__QUEUE__"] .dot{
    background:rgba(255,255,255,0.9);
    width:10px; height:7px;
    border-radius:2px;
    box-shadow:none;
}
.wa-assign-chip[data-op="__QUEUE__"].active{
    border-color:rgba(124,77,255,0.9);
    box-shadow:0 0 0 3px rgba(124,77,255,0.25), 0 1px 4px rgba(0,0,0,0.15);
}
.wa-assign-chip[data-op="__NOOP__"] .dot{
    background:transparent !important;
    box-shadow: inset 0 0 0 2px rgba(220,53,69,0.6);
    position:relative;
}
.wa-assign-chip[data-op="__NOOP__"] .dot:after{
    content:"";
    position:absolute;
    left:50%; top:50%;
    width:9px; height:2px;
    background:rgba(220,53,69,0.9);
    transform:translate(-50%,-50%) rotate(-45deg);
    border-radius:2px;
}
.wa-assign-chip[data-op="__NOOP__"].active{
    border-color:rgba(220,53,69,0.6);
    box-shadow:0 0 0 3px rgba(220,53,69,0.15), 0 1px 4px rgba(0,0,0,0.12);
}
.wa-assign-chip[data-op="__ALL__"] .dot{
    background:conic-gradient(from 90deg, #00a884, #34b7f1, #ffb020, #e83e8c, #00a884);
}
/* Chip Rohmah Desainer: bulat, dot warna coklat */
.wa-assign-chip[data-op="__ROHMAH__"] .dot{
    background:linear-gradient(135deg,#8d5524,#5d3a1a);
}
.wa-assign-chip[data-op="__ROHMAH__"].active{
    border-color:rgba(141,85,36,0.7);
    box-shadow:0 0 0 3px rgba(141,85,36,0.22), 0 1px 4px rgba(0,0,0,0.12);
}
/* Chip Arimbi: bulat, dot warna hitam */
.wa-assign-chip[data-op="ARIMBI"] .dot{
    background:#000000 !important;
}
.wa-assign-chip[data-op="ARIMBI"].active{
    border-color:rgba(0,0,0,0.65);
    box-shadow:0 0 0 3px rgba(0,0,0,0.15), 0 1px 4px rgba(0,0,0,0.12);
}
/* Tombol hapus teks pencarian */
.wa-search-clear-btn{
    position:absolute;
    right:10px;
    top:50%;
    transform:translateY(-50%);
    width:18px; height:18px;
    border-radius:50%;
    background:rgba(0,0,0,0.18);
    border:none;
    cursor:pointer;
    display:none;
    align-items:center;
    justify-content:center;
    font-size:11px;
    color:#fff;
    line-height:1;
    padding:0;
    flex-shrink:0;
    z-index:2;
    transition: background 0.15s;
}
.wa-search-clear-btn:hover{ background:rgba(0,0,0,0.35); }
.wa-search-clear-btn.visible{ display:flex; }
.wa-search-wrap{ position:relative; display:flex; align-items:center; }



/* === Avatar shows assigned operator (icon + full name tooltip) === */
.wa-avatar-op{
    width:100%; height:100%;
    border-radius:50%;
    display:flex; align-items:center; justify-content:center;
    font-weight:1000;
    letter-spacing:0.3px;
    color:#fff;
    text-shadow:0 1px 2px rgba(0,0,0,0.28);
    box-shadow:
        0 4px 12px rgba(0,0,0,0.14),
        inset 0 0 0 2px rgba(255,255,255,0.22);
    position:relative;
}
/* FIX #3: Perbaiki bracket yang hilang di .wa-avatar-op:before */
.wa-avatar-op:before{
    content:"";
    position:absolute;
    inset:-2px;
    border-radius:50%;
    box-shadow:0 0 0 2px rgba(0,0,0,0.10);
    pointer-events:none;
} /* ← bracket penutup yang hilang */

.wa-avatar-op-text{
    display:block;
    max-width:40px;
    padding:0 4px;
    font-size:10px;
    line-height:1;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
    transform: translateY(0.5px);
}


/* Contact List */
.wa-contact-list {
    flex: 1; overflow-y: auto; overflow-x: hidden; background: #fff;
}
.wa-contact-list::-webkit-scrollbar { width: 5px; }
.wa-contact-list::-webkit-scrollbar-track { background: transparent; }
.wa-contact-list::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.1); border-radius: 3px; }
.wa-contact-list::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.18); }

/* Contact Item - Premium Hover */
.wa-contact-item {
    display: flex; align-items: center;
    padding: 12px 16px; cursor: pointer;
    border-bottom: 1px solid rgba(0,0,0,0.04);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1); 
    position: relative;
    box-sizing: border-box;
    margin: 4px 8px; border-radius: 12px;
}
.wa-contact-item:hover { 
    background: rgba(37, 211, 102, 0.06); 
    transform: scale(1.01);
}
.wa-contact-item.active { 
    background: rgba(37, 211, 102, 0.12);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.08);
}
.wa-contact-item::before {
    content: ''; position: absolute; left: 0; top: 15%; bottom: 15%; width: 4px;
    background: var(--wa-premium-green); opacity: 0; transition: opacity 0.3s, transform 0.3s;
    border-radius: 0 4px 4px 0;
    transform: scaleY(0.5);
}
.wa-contact-item.active::before { 
    opacity: 1; transform: scaleY(1);
}

/* Avatar */
.wa-avatar {
    width: 50px; height: 50px; border-radius: 50%;
    background: linear-gradient(135deg,#25d366,#128c7e); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; margin-right: 12px; flex-shrink: 0;
    font-weight: 600; overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}
.wa-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.2);
}
.wa-avatar-img { width:100%; height:100%; border-radius:50%; object-fit:cover; }
.wa-avatar-placeholder {
    width:100%; height:100%; border-radius:50%;
    display:flex; align-items:center; justify-content:center;
    font-weight:700; font-size:18px; color:#fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

.wa-contact-info { flex:1; overflow:hidden; min-width:0; }
.wa-contact-name { font-size:15px; font-weight:600; color:#111b21; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.wa-contact-last-msg { font-size:13px; color:#667781; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; margin-top:3px; }
.wa-contact-meta { font-size:12px; color:#8696a0; flex-shrink:0; }

/* -- CHAT AREA -- */
.wa-chat-area {
    flex: 1; display: flex; flex-direction: column;
    background: var(--wa-premium-chat-bg) !important;
    overflow: hidden; box-sizing: border-box;
    position: relative;
}
/* Wallpaper dilepas untuk kejernihan (Clarity Edition) */
/* .wa-chat-area::before { content:''; position:absolute; inset:0; background: url(...) opacity:0.05; } */

/* === OPTIMASI: tombol load-more pesan lama === */
.wa-load-more-btn {
    contain: layout style;
}
.wa-load-more-btn:hover span {
    background: #c8f0d8 !important;
}
/* === OPTIMASI: hardware-accelerate scroll container === */
.wa-chat-body, #wa-messages-box {
    will-change: scroll-position;
    contain: layout;
}

/* Chat Header - Clarity Solid - Classic Emerald (v2.2.4) */
.wa-chat-header {
    height: 60px;
    background: #00a884 !important; /* Force Emerald */
    padding: 0 18px;
    display: flex; align-items: center; justify-content: space-between;
    box-sizing: border-box; flex-shrink: 0;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    z-index: 10;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    color: #ffffff !important;
}
.wa-chat-header #header-name { color:#ffffff !important; font-weight:700; font-size:15.5px; }
.wa-chat-header #header-number { color:rgba(255,255,255,0.85) !important; font-size:12px; }
.wa-chat-header .header-btn svg { color: #ffffff !important; }
body.wa-dark-mode .wa-chat-header { background: #202c33 !important; border-bottom-color: rgba(255,255,255,0.1); }
body.wa-dark-mode .wa-chat-header #header-name { color: #e9edef !important; }
body.wa-dark-mode .wa-chat-header #header-number { color: #8696a0 !important; }

/* Chat Body - Classic Ornament Edition (v2.2.6) */
.wa-chat-body {
    flex:1; overflow-y:auto; overflow-x:hidden;
    padding: 20px 24px; display:flex; flex-direction:column; gap:6px;
    box-sizing: border-box;
    background-color: #e5ddd5 !important; /* Classic WA Beige/Gray */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100' opacity='0.04'%3E%3Cpath d='M11,18 C11,18 15,20 17,15 C19,10 14,8 14,8 M30,40 L35,45 M60,20 Q70,25 65,35 M80,60 L85,65 M20,80 Q25,85 35,80' stroke='%23000' stroke-width='1' fill='none'/%3E%3Cpath d='M50,55 A5,5 0 1,1 49.9,55 Z' fill='%23000'/%3E%3Ccircle cx='75' cy='15' r='3' fill='%23000'/%3E%3Cpath d='M10,50 L15,50 M12.5,47.5 L12.5,52.5' stroke='%23000'/%3E%3C/svg%3E") !important;
    background-repeat: repeat;
    background-size: 420px;
    scroll-behavior: smooth;
    overscroll-behavior: contain;
}
.wa-chat-body::-webkit-scrollbar { width: 6px; }
.wa-chat-body::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); border-radius: 10px; }
body.wa-dark-mode .wa-chat-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); }

/* Chat Footer - Clarity Solid - Classic Gray (v2.2.4) */
.wa-chat-footer {
    min-height: 62px; 
    background: var(--wa-premium-footer-bg) !important;
    padding: 10px 18px; 
    display: flex; align-items: center; gap: 12px;
    border-top: 1px solid rgba(0,0,0,0.1) !important; 
    box-sizing: border-box; 
    max-width: 100%;
}
body.wa-dark-mode .wa-chat-footer { border-top-color: rgba(255,255,255,0.1); }

/* Input - Premium Glow */
.wa-input-msg {
    flex:1; padding: 10px 16px; border-radius: 22px;
    border: 1px solid rgba(0,0,0,0.08); 
    outline: none; font-size: 14px;
    background: #fff; 
    box-sizing: border-box; max-height: 120px; overflow-y: auto;
    white-space: pre-wrap; word-break: break-word; line-height: 1.5;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.02);
}
.wa-input-msg:focus { 
    border-color: var(--wa-premium-green); 
    box-shadow: 0 0 0 4px rgba(37,211,102,0.15), inset 0 1px 2px rgba(0,0,0,0.02);
    transform: translateY(-1px);
}
body.wa-dark-mode .wa-input-msg {
    background: #2a3942;
    border-color: rgba(255,255,255,0.1);
    color: #e9edef;
}
body.wa-dark-mode .wa-input-msg:focus {
    border-color: var(--wa-premium-green);
    box-shadow: 0 0 0 4px rgba(37,211,102,0.2);
}
.wa-input-msg:empty::before { content:attr(data-placeholder); color:#999; pointer-events:none; display:block; }

/* Icon Buttons (CARTOON + SOLID + 3D + ANIMATED) */
.wa-icon-btn{
    --waBg1:#22c55e;
    --waBg2:#06b6d4;
    border:2px solid rgba(0,0,0,0.22);
    cursor:pointer;
    width:22px; height:22px; padding:0;
    display:flex; align-items:center; justify-content:center;
    border-radius:8px; /* lebih kecil */
    background: linear-gradient(135deg,var(--waBg1),var(--waBg2)) !important;
    box-shadow:
        0 2px 0 rgba(0,0,0,0.28),
        0 6px 10px rgba(0,0,0,0.18);
    color:#ffffff; /* svg pakai currentColor */
    transition: transform .18s ease, filter .18s ease;
    position:relative;
    filter:saturate(1.2) contrast(1.1);
}
.wa-icon-btn:hover{
    transform: translateY(-2px) scale(1.05);
    animation: waBtnPop .28s ease-out both;
}
.wa-icon-btn:active{
    transform: translateY(1px) scale(0.98);
    box-shadow:
        0 2px 0 rgba(0,0,0,0.28),
        0 6px 12px rgba(0,0,0,0.18);
}
@keyframes waBtnPop{
    0%{ transform: translateY(0) scale(1); }
    60%{ transform: translateY(-3px) scale(1.08); }
    100%{ transform: translateY(-2px) scale(1.05); }
}

/* Ikon di header widget WA (atas kiri) lebih kecil agar tidak nutup teks */
.wa-widget-header .wa-icon-btn{ width:20px !important; height:20px !important; border-radius:7px !important; }
.wa-widget-header .wa-icon-btn svg{ width:10px !important; height:10px !important; }

/* SVG styling (lebih "kartun") */
.wa-icon-btn svg{
    width:11px; height:11px; /* lebih kecil */
    stroke: currentColor;
    stroke-width: 2.8;
    stroke-linecap: round;
    stroke-linejoin: round;
filter: drop-shadow(0 1px 0 rgba(0,0,0,0.35));
}
.wa-icon-btn:hover svg{
    animation: waIconWiggle .55s ease-in-out both;
}
@keyframes waIconWiggle{
    0%{ transform: rotate(0deg) scale(1); }
    25%{ transform: rotate(-8deg) scale(1.05); }
    55%{ transform: rotate(8deg) scale(1.08); }
    100%{ transform: rotate(0deg) scale(1.02); }
}

/* Warna per tombol (cerah) */
.wa-widget-header .wa-icon-btn[title="Refresh"]{ --waBg1:#3b82f6; --waBg2:#22c55e; }
.wa-widget-header .wa-icon-btn[title="Tutup"]{ --waBg1:#ef4444; --waBg2:#f97316; }

.wa-icon-btn[title="Chat Baru"]{ --waBg1:#a855f7; --waBg2:#ec4899; }
.wa-icon-btn[title="Emoji"]{ --waBg1:#f59e0b; --waBg2:#facc15; color:#1f2937; } /* icon gelap biar kontras */
.wa-icon-btn[title="Lampirkan File / Gambar"]{ --waBg1:#06b6d4; --waBg2:#6366f1; }
.wa-icon-btn[title="Kirim"]{ --waBg1:#22c55e; --waBg2:#16a34a; }
.wa-icon-btn[title="Matikan Notifikasi"]{ --waBg1:#fb7185; --waBg2:#f43f5e; }
.wa-icon-btn[title="Antrian Desain Online"]{ --waBg1:#14b8a6; --waBg2:#22c55e; }


/* Tombol "Selesai" (Premium Redesign) */
.wa-end-btn {
    border: none; cursor: pointer;
    display: flex; align-items: center; gap: 8px;
    padding: 8px 16px;
    border-radius: 12px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    font-size: 12px; font-weight: 700;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.wa-end-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.35);
    filter: brightness(1.05);
}
.wa-end-btn:active { transform: translateY(1px); }
.wa-end-btn svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 2.5; }


/* Bubbles - Clarity v2.1 */
.wa-msg {
    max-width: 82%; padding: 10px 14px; 
    border-radius: 16px;
    font-size: 14.5px; line-height: 1.5; 
    position: relative;
    box-shadow: var(--wa-msg-shadow);
    word-wrap: break-word; word-break: break-word; 
    box-sizing: border-box;
    margin-bottom: 2px;
}
.wa-msg.in { 
    background: var(--wa-msg-in); 
    align-self: flex-start; 
    border-bottom-left-radius: 4px;
    color: #111b21;
}
.wa-msg.out { 
    background: var(--wa-msg-out); 
    align-self: flex-end; 
    border-bottom-right-radius: 4px; 
    color: #111b21;
    box-shadow: 0 3px 10px rgba(37,211,102,0.12);
}
body.wa-dark-mode .wa-msg.in { color: #e9edef; }
body.wa-dark-mode .wa-msg.out { color: #e9edef; }
.wa-msg-time { 
    font-size: 10px; opacity: 0.6; 
    float: right; margin-top: 6px; margin-left: 10px; 
}

/* === WA -> KANBAN (Quick Add) === */
.wa-msg-meta { display:flex; justify-content:space-between; align-items:center; margin-top:6px; gap:8px; }
.wa-msg-meta-right { display:flex; align-items:center; gap:4px; justify-content:flex-end; }

/* Label nama operator di pesan keluar */
.wa-op-label {
    font-size: 9.5px;
    font-weight: 600;
    opacity: 0.82;
    border-radius: 20px;
    padding: 1px 7px 1px 5px;
    color: #fff;
    white-space: nowrap;
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    vertical-align: middle;
    line-height: 1.7;
    flex-shrink: 0;
}
.wa-op-label svg { flex-shrink: 0; opacity: 0.9; }
/* Typing indicator bubble antar operator */
.wa-op-typing-bar {
    padding: 4px 14px 2px;
    min-height: 22px;
    font-size: 11px;
    color: #888;
    font-style: italic;
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    flex-shrink: 0;
    transition: opacity 0.2s;
}
.wa-op-typing-dots {
    display: inline-flex;
    gap: 3px;
    align-items: center;
}
.wa-op-typing-dots span {
    width: 5px; height: 5px;
    border-radius: 50%;
    background: #25d366;
    display: inline-block;
    animation: waTypingBounce 1.1s infinite ease-in-out;
}
.wa-op-typing-dots span:nth-child(2) { animation-delay: 0.18s; }
.wa-op-typing-dots span:nth-child(3) { animation-delay: 0.36s; }
@keyframes waTypingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
    30% { transform: translateY(-5px); opacity: 1; }
}
.wa-kanban-btn{
  border: 1px solid rgba(13,117,96,0.22);
  background: rgba(255,255,255,0.88);
  color: #0d7560;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  line-height: 1;
}
.wa-kanban-btn:hover{ background:#fff; border-color: rgba(13,117,96,0.45); transform: translateY(-0.5px); }

/* === SUBBAR REDESIGN === */
/* Reset paksa wa-order-btn agar tidak ada CSS lain yang override */
#wa-order-btn {
    all: unset;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    padding: 3px 8px !important;
    border-radius: 6px !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    white-space: nowrap !important;
    line-height: 1 !important;
    flex-shrink: 0 !important;
    background: linear-gradient(135deg, #ff6b35, #e53e00) !important;
    color: #fff !important;
    box-shadow: 0 1px 4px rgba(229,62,0,0.35) !important;
}
#wa-order-btn:hover { filter: brightness(1.1); }
#wa-subbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 3px 8px;
    background: linear-gradient(180deg, rgba(0,0,0,0.20) 0%, rgba(0,0,0,0.26) 100%);
    border-bottom: 1px solid rgba(255,255,255,0.07);
    min-height: 28px;
    box-sizing: border-box;
    gap: 6px;
    overflow: hidden;
}
.subbar-left {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}
.subbar-right {
    display: flex;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
}
/* Badge antrian di subbar */
.subbar-queue-badge {
    padding: 1px 7px;
    border-radius: 999px;
    background: linear-gradient(135deg, #7c4dff, #512da8);
    font-size: 9.5px;
    font-weight: 800;
    color: #fff;
    letter-spacing: 0.3px;
    box-shadow: 0 1px 4px rgba(124,77,255,0.4);
}
/* Badge presence di subbar */
.subbar-presence-pill {
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(255,193,7,0.15);
    border: 1px solid rgba(255,193,7,0.4);
    font-size: 9.5px;
    font-weight: 700;
    color: #ffe082;
    white-space: nowrap;
}
/* Base tombol subbar */
.subbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 6px;
    border: none;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.1px;
    transition: filter 0.12s, transform 0.1s;
    white-space: nowrap;
    line-height: 1;
    flex-shrink: 0;
}
.subbar-btn:active { transform: translateY(1px); filter: brightness(0.9); }

/* Tombol Pesanan -- merah kekuningan / oranye-merah */
.subbar-btn-order {
    background: linear-gradient(135deg, #ff6b35, #e53e00);
    color: #fff;
    box-shadow: 0 1px 4px rgba(229,62,0,0.35);
}
.subbar-btn-order:hover { filter: brightness(1.1); }

/* Tombol Claim -- biru */
.subbar-btn-claim {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: #fff;
    box-shadow: 0 1px 4px rgba(59,130,246,0.3);
}
.subbar-btn-claim:hover { filter: brightness(1.1); }
/* Saat sudah di-claim -> hijau */
.subbar-btn-claim.claimed {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    box-shadow: 0 1px 4px rgba(34,197,94,0.3);
}

/* Tombol Analytics -- abu transparan */
.subbar-btn-analytics {
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.8);
    border: 1px solid rgba(255,255,255,0.15) !important;
    padding: 3px 6px;
    flex-shrink: 0;
}
.subbar-btn-analytics:hover { background: rgba(255,255,255,0.18); color: #fff; }

/* Claim bar strip - tidak dipakai lagi, claim inline di subbar */
.wa-claim-bar-strip { display: none !important; }

/* Claim pill inline di subbar kiri */
.subbar-claim-pill {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 1px 7px;
    border-radius: 999px;
    background: rgba(16,185,129,0.18);
    border: 1px solid rgba(16,185,129,0.35);
    font-size: 9.5px;
    font-weight: 700;
    color: #6ee7b7;
    white-space: nowrap;
}

/* === ONLINE DESIGN QUEUE (ANTRIAN DESAIN) === */
.wa-queue-badge{
  display:inline-flex;
  align-items:center;
  gap:4px;
  padding:2px 7px 2px 5px;
  border-radius:999px;
  font-size:9.5px;
  font-weight:800;
  line-height:1;
  background:linear-gradient(135deg,#7c4dff,#512da8);
  color:#fff;
  border:1px solid rgba(255,255,255,0.22);
  box-shadow:0 1px 4px rgba(124,77,255,0.22);
  white-space:nowrap;
  letter-spacing:0.2px;
}
.wa-queue-badge .qnum{
  background:rgba(255,255,255,0.9);
  border:1px solid rgba(0,0,0,0.12);
  padding:1px 5px;
  border-radius:999px;
  font-weight:900;
  color:#512da8;
  font-size:9px;
}
#wa-queue-btn{
  display:flex !important; align-items:center; gap:6px;
  background:rgba(255,255,255,0.13);
  border:1px solid rgba(255,255,255,0.32);
  border-radius:10px;
  color:rgba(255,255,255,0.95);
  font-size:11px;
  font-weight:800;
  padding:6px 10px;
  cursor:pointer;
  letter-spacing:.2px;
}
#wa-queue-btn{
  gap:0;
  padding:6px;
  width:34px;
  justify-content:center;
}
#wa-queue-btn:hover{ background:rgba(255,255,255,0.22); }

#wa-queue-modal{
  position:fixed; inset:0; z-index:999999;
  background:rgba(0,0,0,0.35);
  display:flex; align-items:center; justify-content:center;
  padding:12px;
}
#wa-queue-modal .card{
  width:min(520px, calc(100vw - 24px));
  max-height:min(78vh, calc(100vh - 24px));
  background:#fff;
  border-radius:18px;
  box-shadow:0 18px 60px rgba(0,0,0,0.25);
  overflow:hidden;
  display:flex; flex-direction:column;
  border:1px solid rgba(0,0,0,0.14);
}
#wa-queue-modal .hdr{
  display:flex; align-items:center; justify-content:space-between;
  padding:12px 12px;
  background: linear-gradient(135deg, #0d7560, #25d366);
  color:#fff;
}
#wa-queue-modal .hdr .ttl{
  font-weight:1000; font-size:13px; letter-spacing:.2px;
}
#wa-queue-modal .hdr .sub{
  font-weight:700; font-size:10.5px; color:rgba(255,255,255,0.8);
  margin-top:2px;
}
#wa-queue-modal .hdr .close{
  width:32px; height:32px; border:0; border-radius:12px;
  background: rgba(255,255,255,0.18);
  color:#fff; cursor:pointer; display:grid; place-items:center;
}
#wa-queue-modal .hdr .close:hover{ background: rgba(255,255,255,0.26); }
#wa-queue-modal .body{
  padding:12px;
  display:flex; flex-direction:column; gap:10px;
  overflow:auto;
}
#wa-queue-modal .search{
  width:100%;
  border:1.5px solid #e5e7eb;
  border-radius:14px;
  padding:10px 12px;
  font-size:12.5px;
  outline:none;
  box-sizing:border-box;
}
#wa-queue-modal .list{
  display:flex; flex-direction:column; gap:6px;
}
#wa-queue-modal .row{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding:10px 12px;
  border:1px solid rgba(0,0,0,0.08);
  border-radius:14px;
  cursor:pointer;
  transition:background .15s ease;
}
#wa-queue-modal .row:hover{ background:#f7f8fa; }
#wa-queue-modal .row .nm{ font-weight:800; font-size:12.5px; color:#111827; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
#wa-queue-modal .row .no{ font-size:11px; color:#6b7280; margin-top:2px; }
#wa-queue-modal .row .left{ display:flex; flex-direction:column; min-width:0; flex:1; }
#wa-queue-modal .actions{
  padding:10px 12px;
  display:flex;
  justify-content:flex-end;
  gap:10px;
  border-top:1px solid rgba(0,0,0,0.08);
  background:#fafbfc;
}
#wa-queue-modal .btn{
  border:0;
  border-radius:14px;
  padding:10px 14px;
  font-size:12px;
  font-weight:1000;
  cursor:pointer;
}
#wa-queue-modal .btn-cancel{ background:#eef2f7; color:#111827; }
#wa-queue-modal .btn-send{ background: linear-gradient(135deg,#25d366,#128c7e); color:#fff; }
#wa-queue-modal .preview{
  padding:10px 12px;
  background:#fff7ed;
  border:1px solid rgba(251,146,60,0.35);
  border-radius:14px;
  font-size:12px;
  color:#7c2d12;
  line-height:1.5;
}


/* Popover input pesanan (lebih rapi & tidak menutupi chat) */
#wa-order-popover{
  position: fixed;
  z-index: 999999;
  width: min(360px, calc(100vw - 24px));
  max-height: min(560px, calc(100vh - 24px));
  background:#fff;
  border:1px solid rgba(0,0,0,0.12);
  border-radius:18px;
  box-shadow:0 18px 60px rgba(0,0,0,0.22);
  overflow:hidden;
  display:flex;
  flex-direction:column;
}
#wa-order-popover .hdr{
  display:flex; align-items:center; justify-content:space-between;
  padding:12px 12px;
  background: linear-gradient(135deg, #0d7560, #25d366);
  color:#fff;
}
#wa-order-popover .hdr-left{ display:flex; align-items:center; gap:10px; min-width:0; }
#wa-order-popover .hdr-ic{
  width:34px; height:34px; border-radius:12px;
  background: rgba(255,255,255,0.18);
  display:grid; place-items:center;
  flex:0 0 auto;
}
#wa-order-popover .hdr-txt{ display:flex; flex-direction:column; line-height:1.1; min-width:0; }
#wa-order-popover .hdr-title{ font-weight:900; font-size:13px; letter-spacing:.2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
#wa-order-popover .hdr-sub{ font-weight:700; font-size:10.5px; color: rgba(255,255,255,0.78); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
#wa-order-popover .hdr-close{
  width:32px; height:32px; border:0; border-radius:12px;
  background: rgba(255,255,255,0.18);
  color:#fff; cursor:pointer;
  display:grid; place-items:center;
  flex:0 0 auto;
}
#wa-order-popover .hdr-close:hover{ background: rgba(255,255,255,0.26); }

#wa-order-popover .body{
  padding:12px;
  display:grid;
  gap:10px;
  overflow:auto;
}
#wa-order-popover label{ font-size:11px; font-weight:800; color:#4b5563; }
#wa-order-popover input,
#wa-order-popover textarea,
#wa-order-popover select{
  width:100%;
  border:1.5px solid #e5e7eb;
  border-radius:14px;
  padding:9px 10px;
  font-size:12.5px;
  outline:none;
  background:#fff;
  box-sizing:border-box;
  font-family:'Poppins', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}
#wa-order-popover input[readonly]{ background:#f8fafc; }
#wa-order-popover textarea{ min-height:84px; resize:vertical; }
#wa-order-popover .grid2{ display:grid; grid-template-columns:1fr 1fr; gap:10px; }

#wa-order-popover .actions{
  padding:10px 12px;
  display:flex;
  justify-content:flex-end;
  gap:10px;
  border-top:1px solid rgba(0,0,0,0.08);
  background:#fafbfc;
}
#wa-order-popover .btn{
  border:0;
  border-radius:14px;
  padding:10px 14px;
  font-size:12px;
  font-weight:900;
  cursor:pointer;
}
#wa-order-popover .btn-cancel{ background:#eef2f7; color:#111827; }
#wa-order-popover .btn-save{ background: linear-gradient(135deg,#25d366,#128c7e); color:#fff; }

/* Empty State */
.wa-empty-state { display:flex; flex-direction:column; align-items:center; justify-content:center; height:100%; text-align:center; color:#41525d; padding:24px; }
.wa-empty-state h3 { color:#0d7560; font-weight:700; margin-bottom:8px; font-size:16px; }
.wa-empty-state p { color:#667781; line-height:1.6; font-size:12.5px; }
#wa-active-chat:not(.hidden) { display:flex; }

/* Toggle Chat Button  ikon saja, no label */
.wa-toggle-chat-btn {
    background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.92); border-radius: 8px; padding: 5px 6px;
    cursor: pointer; display: flex; align-items: center; gap: 0;
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.wa-toggle-chat-btn:hover { background: rgba(255,255,255,0.22); transform: scale(1.05); }
.wa-toggle-chat-btn svg { transition: transform 0.3s; }
.wa-window.sidebar-only .wa-toggle-chat-btn svg { transform: scaleX(-1); display:inline-block; }

/* Responsive */
@media (max-width: 900px) {
    .wa-window { width: calc(100vw - 10px); height: calc(100vh - 60px); }
    .wa-window.sidebar-only { width: 300px; height: calc(100vh - 60px); }
}
        body.theme-lebaran {
            --bg-color: #f0fff0; --accent-gradient: linear-gradient(90deg, #28a745, #1e8449); --accent-red: #28a745;
            --motivation-bg: linear-gradient(135deg, #d4edda, #c3e6cb);
            --motivation-border: var(--success-color);
            --motivation-header: #1e8449;
            --sticky-note-bg: #e8f5e9;
            --sticky-note-border: #4caf50;
            /* Task Input Panel - Lebaran Theme (Hijau) */
            --task-input-bg: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 50%, #a5d6a7 100%);
            --task-input-border: #4caf50;
            --task-input-header: #2e7d32;
            --task-input-label: #1b5e20;
            --task-input-field-border: #81c784;
            --task-input-btn-bg: linear-gradient(135deg, #4caf50 0%, #2e7d32 100%);
            --task-input-btn-hover: linear-gradient(135deg, #66bb6a 0%, #388e3c 100%);
            --task-input-glow: rgba(76, 175, 80, 0.4);
            /* Icon & UI Colors - Lebaran Theme */
            --icon-add: #4caf50;
            --icon-sticky: #81c784;
            --icon-monitor: #2e7d32;
            --icon-search: #2e7d32;
            --icon-users: #1b5e20;
            --icon-history: #388e3c;
            --icon-motivation: #ffc107;
            /* Kanban Colors - Lebaran Theme */
            --kanban-todo: #66bb6a;
            --kanban-doing: #43a047;
            --kanban-done: #2e7d32;
            --kanban-todo-border: #66bb6a;
            --kanban-doing-border: #43a047;
            --kanban-done-border: #2e7d32;
            /* Action Button Colors - Lebaran Theme */
            --btn-left: #43a047;
            --btn-right: #2e7d32;
            --btn-archive: #1b5e20;
            --btn-delete: #c62828;
            /* Task Type & Print Colors - Lebaran Theme */
            --type-biasa: #66bb6a;
            --type-ditunggu: #c62828;
            --print-mmt: #43a047;
            --print-a3: #2e7d32;
            --print-lainnya: #1b5e20;
            --emoji-btn: #81c784;
        }
        body.theme-kemerdekaan {
            --bg-color: #fafafa; --accent-gradient: linear-gradient(90deg, #ff0000, #ffffff); --accent-red: #ff0000;
            --motivation-bg: linear-gradient(135deg, #f8d7da, #f5c6cb);
            --motivation-border: var(--accent-red);
            --motivation-header: #842029;
            --sticky-note-bg: #ffebee;
            --sticky-note-border: #e53935;
            /* Task Input Panel - Kemerdekaan Theme (Merah-Putih) */
            --task-input-bg: linear-gradient(135deg, #ffebee 0%, #ffcdd2 50%, #ef9a9a 100%);
            --task-input-border: #e53935;
            --task-input-header: #b71c1c;
            --task-input-label: #c62828;
            --task-input-field-border: #ef5350;
            --task-input-btn-bg: linear-gradient(135deg, #e53935 0%, #b71c1c 100%);
            --task-input-btn-hover: linear-gradient(135deg, #ef5350 0%, #c62828 100%);
            --task-input-glow: rgba(229, 57, 53, 0.4);
            /* Icon & UI Colors - Kemerdekaan Theme */
            --icon-add: #e53935;
            --icon-sticky: #ef5350;
            --icon-monitor: #c62828;
            --icon-search: #c62828;
            --icon-users: #b71c1c;
            --icon-history: #d32f2f;
            --icon-motivation: #ffc107;
            /* Kanban Colors - Kemerdekaan Theme */
            --kanban-todo: #ef5350;
            --kanban-doing: #e53935;
            --kanban-done: #c62828;
            --kanban-todo-border: #ef5350;
            --kanban-doing-border: #e53935;
            --kanban-done-border: #c62828;
            /* Action Button Colors - Kemerdekaan Theme */
            --btn-left: #d32f2f;
            --btn-right: #c62828;
            --btn-archive: #b71c1c;
            --btn-delete: #880e4f;
            /* Task Type & Print Colors - Kemerdekaan Theme */
            --type-biasa: #ef5350;
            --type-ditunggu: #b71c1c;
            --print-mmt: #e53935;
            --print-a3: #c62828;
            --print-lainnya: #b71c1c;
            --emoji-btn: #ef5350;
        }
        body.theme-light {
            --bg-color: #e3f2fd; --accent-gradient: linear-gradient(90deg, #0288d1, #01579b); --accent-red: #d32f2f;
            --motivation-bg: linear-gradient(135deg, #cce5ff, #b8daff);
            --motivation-border: #007bff;
            --motivation-header: #004085;
            --sticky-note-bg: #e3f2fd;
            --sticky-note-border: #1976d2;
            /* Task Input Panel - Light Theme (Biru) */
            --task-input-bg: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 50%, #90caf9 100%);
            --task-input-border: #1976d2;
            --task-input-header: #0d47a1;
            --task-input-label: #1565c0;
            --task-input-field-border: #64b5f6;
            --task-input-btn-bg: linear-gradient(135deg, #1976d2 0%, #0d47a1 100%);
            --task-input-btn-hover: linear-gradient(135deg, #42a5f5 0%, #1565c0 100%);
            --task-input-glow: rgba(25, 118, 210, 0.4);
            /* Icon & UI Colors - Light Theme */
            --icon-add: #1976d2;
            --icon-sticky: #42a5f5;
            --icon-monitor: #0d47a1;
            --icon-search: #0d47a1;
            --icon-users: #1565c0;
            --icon-history: #1976d2;
            --icon-motivation: #ffc107;
            /* Kanban Colors - Light Theme */
            --kanban-todo: #42a5f5;
            --kanban-doing: #1976d2;
            --kanban-done: #0d47a1;
            --kanban-todo-border: #42a5f5;
            --kanban-doing-border: #1976d2;
            --kanban-done-border: #0d47a1;
            /* Action Button Colors - Light Theme */
            --btn-left: #1976d2;
            --btn-right: #0d47a1;
            --btn-archive: #01579b;
            --btn-delete: #c62828;
            /* Task Type & Print Colors - Light Theme */
            --type-biasa: #42a5f5;
            --type-ditunggu: #c62828;
            --print-mmt: #1976d2;
            --print-a3: #0d47a1;
            --print-lainnya: #01579b;
            --emoji-btn: #42a5f5;
        }
        body.theme-ceria {
            --bg-color: #fffde7; --accent-gradient: linear-gradient(90deg, #ff7e5f, #feb47b); --accent-red: #ff7e5f;
            --motivation-bg: linear-gradient(135deg, #ffecb3, #ffcc80);
            --motivation-border: #ff9800;
            --motivation-header: #e65100;
            --sticky-note-bg: #fce4ec;
            --sticky-note-border: #e91e63;
            /* Task Input Panel - Ceria Theme (Orange-Pink) */
            --task-input-bg: linear-gradient(135deg, #fce4ec 0%, #f8bbd9 50%, #f48fb1 100%);
            --task-input-border: #e91e63;
            --task-input-header: #880e4f;
            --task-input-label: #ad1457;
            --task-input-field-border: #f06292;
            --task-input-btn-bg: linear-gradient(135deg, #e91e63 0%, #880e4f 100%);
            --task-input-btn-hover: linear-gradient(135deg, #f06292 0%, #ad1457 100%);
            --task-input-glow: rgba(233, 30, 99, 0.4);
            /* Icon & UI Colors - Ceria Theme */
            --icon-add: #e91e63;
            --icon-sticky: #f06292;
            --icon-monitor: #ad1457;
            --icon-search: #ad1457;
            --icon-users: #880e4f;
            --icon-history: #c2185b;
            --icon-motivation: #ffc107;
            /* Kanban Colors - Ceria Theme */
            --kanban-todo: #f06292;
            --kanban-doing: #e91e63;
            --kanban-done: #ad1457;
            --kanban-todo-border: #f06292;
            --kanban-doing-border: #e91e63;
            --kanban-done-border: #ad1457;
            /* Action Button Colors - Ceria Theme */
            --btn-left: #e91e63;
            --btn-right: #ad1457;
            --btn-archive: #880e4f;
            --btn-delete: #c62828;
            /* Task Type & Print Colors - Ceria Theme */
            --type-biasa: #f06292;
            --type-ditunggu: #c62828;
            --print-mmt: #e91e63;
            --print-a3: #ad1457;
            --print-lainnya: #880e4f;
            --emoji-btn: #f06292;
        }

/* ============================================
   MOBILE RESPONSIVE — WA Widget (max-width: 768px)
   ============================================ */
@media (max-width: 768px) {
    /* Float button: smaller, bottom-left */
    .wa-float-btn {
        width: 40px !important;
        height: 65px !important;
        font-size: 20px !important;
        border-radius: 0 10px 10px 0 !important;
        bottom: 15px !important;
        left: 0 !important;
    }
    .wa-float-btn-label {
        font-size: 6px !important;
    }
    .wa-badge {
        width: 18px !important;
        height: 18px !important;
        font-size: 8px !important;
        top: -3px !important;
        right: -3px !important;
    }

    /* WA Window: full screen on mobile */
    .wa-window {
        width: 100vw !important;
        height: calc(100vh - 10px) !important;
        height: calc(100dvh - 10px) !important;
        bottom: 5px !important;
        left: 0 !important;
        border-radius: 0 8px 8px 0 !important;
        z-index: 99999 !important;
        position: fixed !important;
    }
    .wa-window.sidebar-only {
        width: 100vw !important;
    }

    /* Sidebar: full width on mobile, always visible */
    .wa-sidebar {
        width: 100% !important;
        min-width: 100% !important;
        flex-shrink: 0 !important;
    }

    /* Chat area: overlay on top of sidebar when chat is open */
    .wa-chat-area {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        z-index: 10 !important;
        background: #fff !important;
    }
    body.wa-dark-mode .wa-chat-area {
        background: var(--wa-premium-chat-bg) !important;
    }

    /* When sidebar-only, chat area is already hidden by existing CSS */

    /* Sidebar header */
    .wa-sidebar-header {
        height: 50px !important;
        padding: 0 10px !important;
    }

    /* Chat header */
    .wa-chat-header {
        height: 50px !important;
        padding: 0 10px !important;
    }

    /* Chat body */
    .wa-chat-body {
        padding: 10px 8px !important;
    }

    /* Chat footer */
    .wa-chat-footer {
        padding: 8px 10px !important;
        min-height: 50px !important;
        gap: 8px !important;
    }

    /* Contact items */
    .wa-contact-item {
        padding: 10px 12px !important;
        margin: 2px 4px !important;
    }
    .wa-avatar {
        width: 40px !important;
        height: 40px !important;
        margin-right: 10px !important;
        font-size: 15px !important;
    }
    .wa-contact-name {
        font-size: 13px !important;
    }
    .wa-contact-last-msg {
        font-size: 11px !important;
    }

    /* Subbar */
    #wa-subbar {
        padding: 2px 6px !important;
        min-height: 24px !important;
        gap: 4px !important;
    }

    /* Message bubbles */
    .wa-msg {
        max-width: 88% !important;
        font-size: 13px !important;
        padding: 8px 10px !important;
    }

    /* Input */
    .wa-input-msg {
        font-size: 13px !important;
        padding: 8px 12px !important;
    }

    /* Icon buttons */
    .wa-icon-btn {
        width: 20px !important;
        height: 20px !important;
    }
    .wa-icon-btn svg {
        width: 10px !important;
        height: 10px !important;
    }
}

/* --- TEMPLATE MANAGER MODAL (v14) --- */
.wa-modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex; align-items: center; justify-content: center;
    z-index: 20000;
    backdrop-filter: blur(4px);
    opacity: 0; visibility: hidden;
    transition: all 0.3s ease;
}
.wa-modal-overlay.active { opacity: 1; visibility: visible; }
.wa-modal-content {
    background: #fff; width: 650px; max-width: 95%; border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    display: flex; flex-direction: column; overflow: hidden;
    transform: translateY(20px); transition: transform 0.3s ease;
}
.wa-modal-overlay.active .wa-modal-content { transform: translateY(0); }
.wa-modal-header {
    background: #00a884; color: #fff; padding: 16px 20px;
    display: flex; align-items: center; justify-content: space-between;
}
.wa-modal-header h3 { margin: 0; font-size: 18px; }
.wa-close-modal { cursor: pointer; font-size: 20px; opacity: 0.8; transition: 0.2s; }
.wa-close-modal:hover { opacity: 1; transform: scale(1.1); }

.wa-modal-body { padding: 20px; overflow-y: auto; max-height: 80vh; }
.wa-template-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px; margin-bottom: 20px; padding: 4px;
}
.wa-template-card {
    border: 1px solid #ddd; border-radius: 10px; padding: 10px;
    cursor: pointer; transition: all 0.2s; position: relative;
    background: #f9f9f9; display: flex; flex-direction: column; gap: 6px;
}
.wa-template-card:hover { border-color: #25d366; background: #fff; transform: translateY(-2px); box-shadow: 0 4px 8px rgba(0,0,0,0.1); }
.wa-template-card.active { border-color: #25d366; background: #f0fdf4; box-shadow: 0 0 0 2px rgba(37,211,102,0.2); }
.wa-template-card .thumb { width:100%; height:90px; background:#eee; border-radius:6px; object-fit:cover; }
.wa-template-card .title { font-weight: 700; font-size: 13px; color: #333; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-template-card .category { font-size: 10px; color: #666; text-transform: uppercase; font-weight: 600; }

.wa-template-form { display: flex; flex-direction: column; gap: 12px; border-top: 1px solid #eee; padding-top: 20px; margin-top: 10px; }
.wa-template-form-row { display: flex; gap: 12px; }
.wa-template-form-group { display: flex; flex-direction: column; gap: 5px; flex: 1; }
.wa-template-form label { font-size: 12px; font-weight: 700; color: #555; }
.wa-template-form input, .wa-template-form textarea, .wa-template-form select {
    padding: 10px; border: 1px solid #ddd; border-radius: 8px; outline: none; font-size: 14px;
    background: #fff; transition: border-color 0.2s;
}
.wa-template-form input:focus, .wa-template-form textarea:focus { border-color: #25d366; }
.wa-template-form textarea { height: 100px; resize: vertical; }

.wa-template-image-preview {
    width: 120px; height: 120px; border: 2px dashed #ddd; border-radius: 8px;
    display: flex; align-items: center; justify-content: center; overflow: hidden;
    background: #fcfcfc; cursor: pointer; position: relative;
}
.wa-template-image-preview img { width: 100%; height: 100%; object-fit: cover; }
.wa-template-image-preview .placeholder { font-size: 11px; color: #999; text-align: center; padding: 10px; }

.wa-template-btns { display: flex; gap: 10px; margin-top: 10px; justify-content: space-between; }
.btn-save { background: #25d366; color: #fff; border: none; padding: 10px 24px; border-radius: 8px; cursor: pointer; font-weight: 700; font-size: 14px; transition: 0.2s; }
.btn-save:hover { background: #1fb355; transform: translateY(-1px); }
.btn-delete { background: #fff; color: #ff5252; border: 1px solid #ff5252; padding: 10px 16px; border-radius: 8px; cursor: pointer; font-weight: 600; transition: 0.2s; }
.btn-delete:hover { background: #fff1f1; }
.btn-cancel { background: #eee; color: #666; border: none; padding: 10px 16px; border-radius: 8px; cursor: pointer; font-weight: 600; }

/* Quick Reply Bar in Chat Area */
.wa-quick-replies-bar {
    display: flex; gap: 8px; padding: 8px 16px; background: #fff;
    border-top: 1px solid #eee; overflow-x: auto; flex-shrink: 0;
    align-items: center; scroll-behavior: smooth;
}
.wa-quick-replies-bar::-webkit-scrollbar { height: 4px; }
.wa-quick-replies-bar::-webkit-scrollbar-thumb { background: #ddd; border-radius: 10px; }

.wa-quick-reply-pill {
    display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px;
    background: #f0fdf4; border: 1px solid #dcfce7; border-radius: 20px;
    font-size: 13px; font-weight: 600; color: #166534;
    cursor: pointer; transition: all 0.2s; white-space: nowrap;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.wa-quick-reply-pill:hover { background: #dcfce7; transform: translateY(-1.5px); box-shadow: 0 3px 6px rgba(0,0,0,0.08); }
.wa-quick-reply-pill .pill-img { width: 24px; height: 24px; border-radius: 4px; object-fit: cover; background: #eee; }
.wa-quick-reply-pill .pill-icon { font-size: 14px; color: #25d366; }

.wa-manage-templates-btn {
    width: 32px; height: 32px; border-radius: 50%; background: #f3f4f6;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: 0.2s; border: 1px solid #e5e7eb; color: #6b7280; flex-shrink: 0;
}
.wa-manage-templates-btn:hover { background: #e5e7eb; color: #374151; transform: rotate(45deg); }

