:root{
  --green:#72a353;--green-2:#006838;--green-dark:#00552e;--deep:#173726;--bg:#f3f7f2;--card:#fff;
  --text:#1f3225;--muted:#758078;--line:#dce7da;--danger:#b74949;--warning:#a66a10;--shadow:0 10px 30px rgba(23,55,38,.08)
}
*{box-sizing:border-box}html,body{min-height:100%}body{margin:0;font-family:'Almarai',sans-serif;background:var(--bg);color:var(--text)}
button,input,textarea,select{font:inherit}button{cursor:pointer}button:disabled{opacity:.55;cursor:not-allowed}img{max-width:100%}
[hidden]{display:none!important}h1,h2,h3,p{margin:0}.form-error{color:var(--danger);font-size:13px;min-height:18px;margin-top:8px}

.login-view{min-height:100vh;display:grid;place-items:center;padding:30px;background:radial-gradient(circle at 20% 10%,#e7f3e2 0,transparent 30%),linear-gradient(135deg,#f8fbf7,#edf5ea)}
.login-shell{width:min(980px,100%);display:grid;grid-template-columns:1.1fr .9fr;background:#fff;border:1px solid var(--line);border-radius:28px;overflow:hidden;box-shadow:0 24px 70px rgba(26,67,42,.14)}
.login-brand{padding:54px;display:flex;flex-direction:column;justify-content:center;background:linear-gradient(145deg,#f7fbf5,#e7f1e3);position:relative}
.login-brand:after{content:"";position:absolute;inset:auto -80px -120px auto;width:280px;height:280px;border-radius:50%;background:rgba(114,163,83,.12)}
.login-brand img{width:min(390px,100%);height:145px;object-fit:contain;object-position:right center;margin-bottom:24px}.login-brand h1{font-size:32px;color:var(--green-2)}.login-brand p{margin-top:10px;color:var(--muted);font-size:16px}
.login-card{padding:54px 46px;display:flex;flex-direction:column;justify-content:center}.login-card h2{font-size:28px}.login-card>p{margin:8px 0 24px;color:var(--muted);line-height:1.7}.login-card label,.stack-form label{display:block;margin-bottom:15px}.login-card label span,.stack-form label span{display:block;font-size:13px;margin-bottom:7px}.login-card input,.stack-form input,.stack-form select{width:100%;border:1px solid var(--line);border-radius:11px;padding:12px 13px;background:#fbfcfb;outline:none}.login-card input:focus,.stack-form input:focus,.stack-form select:focus{border-color:var(--green);box-shadow:0 0 0 3px rgba(114,163,83,.12)}

.app{min-height:100vh;display:grid;grid-template-columns:245px minmax(0,1fr)}
.side{background:linear-gradient(180deg,#123824,#1b432f);color:#fff;padding:20px 15px;display:flex;flex-direction:column;gap:26px;position:sticky;top:0;height:100vh}
.brand{display:flex;align-items:center;gap:11px;padding:4px 5px 12px;border-bottom:1px solid rgba(255,255,255,.1)}.brand img{width:72px;height:48px;object-fit:contain;filter:brightness(0) invert(1)}.brand b,.brand span{display:block}.brand b{font-size:15px}.brand span{font-size:12px;color:#c6d7cb;margin-top:4px}
.side nav{display:grid;gap:7px}.nav{border:0;background:transparent;color:#d7e5da;text-align:right;padding:13px 14px;border-radius:12px;display:flex;align-items:center;gap:10px}.nav span{width:22px;text-align:center;opacity:.9}.nav:hover,.nav.active{background:rgba(255,255,255,.12);color:#fff}.side-bottom{margin-top:auto;display:grid;gap:5px}.side-link{border:0;background:transparent;text-align:right;color:#c6d7cb;padding:9px 12px}.side-link:hover{color:#fff}.side-link.danger{color:#f1b7b7}.version{padding:8px 12px;color:#91aa99;font-size:11px}
main{min-width:0;padding:24px 28px 36px}header{display:flex;justify-content:space-between;align-items:center;margin-bottom:22px;gap:20px}header h1{font-size:27px}header p{color:var(--muted);margin-top:6px}.header-actions{display:flex;align-items:center;gap:12px}.badge{padding:9px 13px;border-radius:999px;font-size:13px;display:flex;align-items:center;gap:8px}.badge i{width:8px;height:8px;border-radius:50%;background:currentColor}.badge.off{background:#f4dfdf;color:#994848}.badge.on{background:#e0f1dc;color:#3e712e}.badge.wait{background:#fff0cf;color:#956313}.user-chip{border-right:1px solid var(--line);padding-right:14px}.user-chip span,.user-chip small{display:block}.user-chip span{font-weight:bold}.user-chip small{color:var(--muted);margin-top:3px}
.page{display:none}.page.active{display:block}.grid{display:grid;gap:14px}.stats{grid-template-columns:repeat(4,1fr);margin-bottom:16px}.report-stats{grid-template-columns:repeat(4,1fr);margin-bottom:16px}.stat,.card{background:var(--card);border:1px solid var(--line);border-radius:17px;box-shadow:var(--shadow)}.stat{padding:18px;position:relative;overflow:hidden}.stat.accent{background:linear-gradient(135deg,#fff,#eff7eb)}.stat span{display:block;color:var(--muted);font-size:13px}.stat b{display:block;font-size:28px;margin-top:8px}.stat b em{font-style:normal}.stat small{color:var(--muted)}.card{padding:20px}.two{display:grid;grid-template-columns:1.05fr .95fr;gap:16px;margin-bottom:16px}.users-layout{grid-template-columns:370px 1fr}.cardhead{display:flex;justify-content:space-between;align-items:flex-start;gap:14px;margin-bottom:16px}.cardhead p,.qr-copy p{color:var(--muted);margin-top:6px;line-height:1.6}.toolbar{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.toolbar.compact{justify-content:flex-end}.toolbar.center{justify-content:center}
.btn{border:0;border-radius:10px;padding:10px 15px;white-space:nowrap}.btn.primary{background:var(--green-2);color:#fff}.btn.primary:hover{background:var(--green-dark)}.btn.secondary{background:#e7f1e3;color:#3e6b31}.btn.ghost{background:#f1f4f0;color:#56615a}.btn.plain{background:transparent;color:var(--muted)}.btn.big{padding:13px 25px;font-weight:bold}.wide-btn{width:100%;padding:13px}
.manual-customer{display:grid;grid-template-columns:1fr 1fr auto;gap:10px;align-items:end}.manual-customer label span,.upload-panel label span,.form label span{display:block;font-size:13px;margin-bottom:7px}.manual-customer input,.upload-panel input,.form input,.form textarea,.library-tools input,.library-tools select,.recipient-tools input{width:100%;border:1px solid var(--line);border-radius:10px;padding:10px 12px;background:#fbfcfb;outline:none}.manual-customer input:focus,.upload-panel input:focus,.form input:focus,.form textarea:focus,.library-tools input:focus,.recipient-tools input:focus{border-color:var(--green)}.import-options{display:flex;gap:18px;font-size:13px;color:var(--muted);margin:12px 0}.customer-list-head{display:flex;justify-content:space-between;align-items:center;margin:12px 0 8px}.preview{border:1px solid var(--line);border-radius:12px;max-height:260px;overflow:auto}.preview.empty{padding:28px;text-align:center;color:var(--muted)}.customer-row{display:grid;grid-template-columns:minmax(0,1fr) 140px 34px;gap:10px;align-items:center;padding:10px 12px;border-bottom:1px solid #edf1eb}.customer-row:last-child{border-bottom:0}.customer-row b{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.customer-row span{font-size:12px;color:var(--muted);direction:ltr;text-align:left}.customer-row button{border:0;background:#f9e6e6;color:var(--danger);border-radius:8px;width:30px;height:30px}
.drop{border:1.5px dashed #b9cbb4;border-radius:14px;min-height:112px;display:grid;place-items:center;text-align:center;padding:18px;background:#fafcf9}.drop b,.drop span{display:block}.drop span{font-size:12px;color:var(--muted);margin-top:5px}.images{display:grid;gap:12px}.campaign-images{grid-template-columns:repeat(4,minmax(0,1fr));margin-top:14px}.imageCard{position:relative;border:1px solid var(--line);border-radius:13px;background:#fff;overflow:hidden}.imageCard>img{width:100%;height:140px;object-fit:cover;display:block;background:#f3f5f2}.campaign-images .imageCard>img{height:95px}.imageActions{display:flex;gap:5px;padding:8px}.imageActions button{flex:1;border:0;background:#f3f5f2;border-radius:7px;padding:6px;font-size:11px}.danger-text{color:var(--danger)!important}
.form{display:grid;grid-template-columns:2fr repeat(3,1fr);gap:12px}.form .wide{grid-column:auto}.form textarea{height:74px;resize:vertical}.sendbar{margin-top:15px;background:#f5f8f3;border-radius:13px;padding:12px 14px;display:flex;align-items:center;gap:24px}.sendbar>div span,.sendbar>div b{display:block}.sendbar>div span{font-size:12px;color:var(--muted)}.sendbar>div b{margin-top:4px}.sendbar .btn{margin-right:auto}
.library-head{align-items:center}.library-tools{min-width:420px}.library-tools input{flex:1}.library-tools select{border:1px solid var(--line);border-radius:10px;padding:10px}.upload-panel{display:grid;grid-template-columns:1.1fr 1fr 1.1fr auto auto;gap:10px;align-items:end;background:#f7faf6;border:1px solid var(--line);padding:13px;border-radius:13px}.upload-button{display:flex;align-items:center;justify-content:center;height:42px}.upload-progress{height:22px;background:#edf2eb;border-radius:999px;position:relative;overflow:hidden;margin:10px 0}.upload-progress span{position:absolute;inset:0 auto 0 0;width:0;background:var(--green)}.upload-progress b{position:absolute;inset:0;display:grid;place-items:center;font-size:11px}.selectionbar{display:flex;align-items:center;gap:8px;margin:14px 0;padding:10px 12px;background:#f3f7f1;border-radius:12px;flex-wrap:wrap}.selectionbar>div{margin-left:auto}.selectionbar>div b,.selectionbar>div span{display:block}.selectionbar>div span{font-size:11px;color:var(--muted);margin-top:3px}.library{grid-template-columns:repeat(5,minmax(0,1fr))}.product-card{transition:.15s}.product-card.selected{outline:3px solid rgba(0,104,56,.28);border-color:var(--green-2)}.select-box{position:absolute;top:8px;right:8px;z-index:2}.select-box input{width:20px;height:20px;accent-color:var(--green-2)}.product-info{padding:9px 10px}.product-info b,.product-info span,.product-info small{display:block}.product-info b{color:var(--green-2)}.product-info span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:4px;font-size:13px}.product-info small{color:var(--muted);margin-top:5px}.empty-state{padding:55px;text-align:center;color:var(--muted)}
.qr{text-align:center;max-width:700px;margin:30px auto}.qr-copy img{width:270px;height:100px;object-fit:contain;margin-bottom:12px}.qrbox{width:390px;max-width:100%;min-height:390px;margin:25px auto;border:1px dashed #b9cbb4;border-radius:18px;display:grid;place-items:center;background:#fafcf9}.qrbox img{width:360px;max-width:95%}.qrbox span{color:var(--muted)}.wa-details{margin:-10px auto 20px;color:var(--muted)}
.table-wrap{overflow:auto}table{width:100%;border-collapse:collapse}th,td{text-align:right;padding:12px;border-bottom:1px solid #edf1eb;font-size:13px}th{color:var(--muted);font-weight:normal;background:#fafcf9}.status-pill{display:inline-flex;align-items:center;gap:6px;border-radius:999px;padding:5px 9px;font-size:11px}.status-pill.connected{background:#e0f1dc;color:#3f6f31}.status-pill.other{background:#f1f2f0;color:#6f7771}
.stack-form{display:grid}.users-list{display:grid;gap:10px}.user-card{border:1px solid var(--line);border-radius:13px;padding:13px;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px}.user-main{display:flex;gap:12px;align-items:center}.user-avatar{width:42px;height:42px;border-radius:12px;background:#e7f1e3;color:var(--green-2);display:grid;place-items:center;font-weight:bold}.user-meta b,.user-meta span,.user-meta small{display:block}.user-meta span{font-size:12px;color:var(--muted);margin-top:3px}.user-meta small{font-size:11px;margin-top:4px}.user-actions{display:flex;align-items:center;gap:6px;flex-wrap:wrap}.user-actions button{border:0;border-radius:8px;padding:7px 9px;font-size:11px}.toggle-user{background:#edf3ea;color:#456e36}.reset-user{background:#f1f2f0;color:#5e665f}
.modal{position:fixed;inset:0;background:rgba(8,27,16,.55);display:grid;place-items:center;padding:20px;z-index:50}.modal-card{width:min(780px,100%);max-height:90vh;overflow:auto;background:#fff;border-radius:18px;padding:22px;position:relative;box-shadow:0 25px 80px rgba(0,0,0,.25)}.small-modal{width:min(450px,100%)}.modal-close{position:absolute;left:14px;top:12px;border:0;background:#f1f3f0;border-radius:50%;width:32px;height:32px;font-size:20px}.modal-head{display:flex;justify-content:space-between;align-items:flex-start;padding-left:40px}.modal-head p{color:var(--muted);margin-top:5px}.recipient-tools{display:grid;grid-template-columns:1fr auto auto;gap:8px;margin:16px 0}.recipients-list{border:1px solid var(--line);border-radius:12px;max-height:430px;overflow:auto}.recipient-row{display:grid;grid-template-columns:28px minmax(0,1fr) 150px;align-items:center;gap:8px;padding:10px 12px;border-bottom:1px solid #edf1eb}.recipient-row:last-child{border-bottom:0}.recipient-row input{width:18px;height:18px;accent-color:var(--green-2)}.recipient-row span{color:var(--muted);font-size:12px;direction:ltr;text-align:left}.modal-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:15px}.copy-image{display:block;max-height:65vh;margin:15px auto;border-radius:12px}
.toast{position:fixed;left:28px;bottom:28px;background:#183826;color:#fff;padding:12px 16px;border-radius:11px;box-shadow:var(--shadow);opacity:0;transform:translateY(12px);pointer-events:none;transition:.2s;z-index:100}.toast.show{opacity:1;transform:translateY(0)}

@media(max-width:1180px){.library{grid-template-columns:repeat(4,minmax(0,1fr))}.upload-panel{grid-template-columns:repeat(3,1fr)}.upload-button{height:auto}.report-stats,.stats{grid-template-columns:repeat(2,1fr)}.form{grid-template-columns:repeat(3,1fr)}.form .wide{grid-column:1/-1}.users-layout{grid-template-columns:1fr}}
@media(max-width:900px){.app{grid-template-columns:1fr}.side{position:static;height:auto}.side nav{grid-template-columns:repeat(3,1fr)}.side-bottom{display:flex;align-items:center}.version{margin-right:auto}.two{grid-template-columns:1fr}.library{grid-template-columns:repeat(3,minmax(0,1fr))}.login-shell{grid-template-columns:1fr}.login-brand{padding:30px}.login-brand img{height:95px}.login-card{padding:32px}.header-actions{align-items:flex-end}.user-chip{display:none}}
@media(max-width:650px){main{padding:18px 12px}.side nav{grid-template-columns:1fr 1fr}.brand img{width:60px}header{align-items:flex-start}.header-actions{display:grid}.report-stats,.stats{grid-template-columns:1fr 1fr}.manual-customer{grid-template-columns:1fr}.form{grid-template-columns:1fr}.campaign-images{grid-template-columns:repeat(3,1fr)}.library{grid-template-columns:repeat(2,minmax(0,1fr))}.library-tools{min-width:0;width:100%}.upload-panel{grid-template-columns:1fr}.selectionbar>div{width:100%;margin:0}.sendbar{flex-wrap:wrap}.sendbar .btn{margin:0;width:100%}.recipient-tools{grid-template-columns:1fr 1fr}.recipient-tools input{grid-column:1/-1}.recipient-row{grid-template-columns:26px minmax(0,1fr)}.recipient-row span{grid-column:2}.login-view{padding:12px}.login-brand h1{font-size:26px}}

/* v0.4.0 management, sender selection and interactive reports */
.stats{grid-template-columns:repeat(5,minmax(0,1fr))}.report-stats{grid-template-columns:repeat(5,minmax(0,1fr))}.stat.response{background:linear-gradient(145deg,#fff,#edf8e9)}
.customer-row.with-owner{grid-template-columns:minmax(0,1fr) 150px}.customer-row>div b,.customer-row>div small{display:block}.customer-row>div small,.recipient-row div small{font-size:11px;color:var(--muted);margin-top:4px}
.sender-panel{margin-bottom:16px}.sender-chips{display:flex;gap:9px;flex-wrap:wrap}.sender-chip{display:inline-flex;align-items:center;gap:7px;background:#f2f6f0;border:1px solid var(--line);padding:9px 11px;border-radius:999px;font-size:12px}.sender-chip i{width:9px;height:9px;border-radius:50%;background:#aab3ac}.sender-chip i.on{background:#3d9a53}.sender-chip small{color:var(--muted)}.muted{color:var(--muted)}
.sender-row.disabled{opacity:.55;background:#fafafa}.sender-row span{direction:rtl;text-align:right}.linked-state{display:grid;place-items:center;gap:12px;color:var(--green-2)}.linked-state b{font-size:24px}.linked-state span{direction:ltr;color:var(--muted)}
.report-filter{display:flex;align-items:center;justify-content:space-between;gap:18px;margin-bottom:16px}.report-filter p{color:var(--muted);margin-top:5px}.date-tools{display:flex;align-items:end;gap:8px;flex-wrap:wrap}.date-tools label span{display:block;font-size:11px;color:var(--muted);margin-bottom:5px}.date-tools input{border:1px solid var(--line);background:#fbfcfb;border-radius:9px;padding:9px}.report-preset{border:1px solid var(--line)}
.report-chart{height:175px;display:flex;align-items:flex-end;gap:10px;overflow-x:auto;padding:15px 8px 4px;border-bottom:1px solid var(--line)}.chart-day{min-width:42px;display:grid;gap:6px;text-align:center}.chart-day small{font-size:10px;color:var(--muted)}.bars{height:125px;display:flex;align-items:flex-end;justify-content:center;gap:3px}.bar{display:block;width:8px;min-height:3px;border-radius:5px 5px 1px 1px}.bar.images,.legend-images{background:var(--green-2)}.bar.customers,.legend-customers{background:var(--green)}.bar.replies,.legend-replies{background:#d79d26}.chart-legend{display:flex;gap:18px;justify-content:center;margin-top:12px;color:var(--muted);font-size:12px}.chart-legend span{display:flex;align-items:center;gap:6px}.chart-legend i{width:10px;height:10px;border-radius:3px}
@media(max-width:1180px){.stats,.report-stats{grid-template-columns:repeat(3,1fr)}}
@media(max-width:900px){.report-filter{align-items:flex-start;flex-direction:column}.date-tools{width:100%}.stats,.report-stats{grid-template-columns:repeat(2,1fr)}}
@media(max-width:650px){.stats,.report-stats{grid-template-columns:1fr 1fr}.date-tools label{flex:1;min-width:130px}.date-tools input{width:100%}.sender-chip{width:100%;justify-content:center}}


/* v0.4.1 manager-owned customers, automatic recipients and browser icon */
.manual-customer{grid-template-columns:1fr 1fr minmax(190px,1fr) auto}
.manual-customer select,.customer-list-head select{width:100%;border:1px solid var(--line);border-radius:10px;padding:10px 12px;background:#fbfcfb;outline:none}
.customer-list-head>div:first-child b,.customer-list-head>div:first-child small{display:block}.customer-list-head>div:first-child small{font-size:11px;color:var(--muted);margin-top:4px}
.customer-row.recipient-selected{background:#f6faf4;box-shadow:inset -3px 0 0 var(--green)}
.sender-tools{grid-template-columns:1fr auto auto;margin:12px 0 8px}.sender-tools>div{min-height:1px}
#customerOwnerFilter{min-width:170px}.selectionbar .manager-only{white-space:nowrap}
@media(max-width:1180px){.manual-customer{grid-template-columns:1fr 1fr}.manual-customer .btn{align-self:end}.customer-list-head{align-items:flex-start;gap:10px}.customer-list-head .toolbar{flex-wrap:wrap;justify-content:flex-end}}
@media(max-width:650px){.manual-customer{grid-template-columns:1fr}.customer-list-head{display:grid}.customer-list-head .toolbar{display:grid;grid-template-columns:1fr}.customer-list-head .toolbar>*{width:100%}.sender-tools{grid-template-columns:1fr 1fr}.sender-tools>div{display:none}}

/* v0.4.2 product-number library, square previews and Google Drive */
.library-source-tabs{display:flex;gap:6px;background:#eef4ec;border:1px solid var(--line);padding:4px;border-radius:12px}
.source-tab{border:0;background:transparent;color:var(--muted);padding:9px 15px;border-radius:9px}
.source-tab.active{background:#fff;color:var(--green-2);box-shadow:0 3px 12px rgba(23,55,38,.09);font-weight:bold}
.library-search-row{display:grid;grid-template-columns:minmax(260px,1fr) 260px;gap:12px;align-items:end;margin-bottom:13px}
.library-search-row label span{display:block;font-size:13px;margin-bottom:7px}
.library-search-row input,.library-search-row select{width:100%;border:1px solid var(--line);border-radius:11px;padding:12px 13px;background:#fbfcfb;outline:none}
.library-search-row input{font-size:18px;font-weight:bold;letter-spacing:.5px}
.library-search-row input:focus,.library-search-row select:focus{border-color:var(--green);box-shadow:0 0 0 3px rgba(114,163,83,.11)}
.product-search small{display:block;margin-top:5px;color:var(--muted);font-size:11px}
.drive-panel{background:linear-gradient(135deg,#f8faf7,#eef5eb);border:1px solid var(--line);border-radius:14px;padding:14px}
.drive-fields{display:grid;grid-template-columns:minmax(320px,1fr) auto auto auto;gap:10px;align-items:end}
.drive-fields label span{display:block;font-size:13px;margin-bottom:7px}.drive-fields input{width:100%;border:1px solid var(--line);border-radius:10px;padding:10px 12px;background:#fff;outline:none}
.drive-folder-field{min-width:0}.drive-note{margin-top:10px;color:var(--muted);font-size:12px;line-height:1.7}.drive-note b{color:var(--green-2)}
.library .imageCard{display:flex;flex-direction:column;min-width:0}
.library .image-open{width:100%;aspect-ratio:1/1;border:0;padding:0;background:#fff;display:grid;place-items:center;overflow:hidden;cursor:zoom-in}
.library .image-open img{width:100%;height:100%;object-fit:contain;display:block;background:#fff;padding:7px}
.library .product-info{display:grid;gap:4px;min-height:100px}
.library .product-info b{font-size:16px}.library .product-info span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;direction:rtl}
.source-badge{justify-self:start;font-style:normal;font-size:10px;border-radius:999px;padding:4px 7px;background:#edf4ea;color:#4f7244}.source-badge.drive{background:#edf2fb;color:#416395}
.image-preview-modal{padding:28px}.image-preview-card{width:min(1000px,95vw);height:min(880px,92vh);padding:18px;display:grid;grid-template-rows:minmax(0,1fr) auto;overflow:hidden;background:#fff}
.image-preview-card>img{width:100%;height:100%;min-height:0;object-fit:contain;background:#f8faf7;border-radius:13px}
.preview-close{z-index:3;background:#263b2e;color:#fff;font-size:25px;line-height:1}
.preview-caption{display:flex;align-items:center;justify-content:center;gap:12px;padding-top:12px;min-width:0}.preview-caption b{font-size:18px;color:var(--green-2)}.preview-caption span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--muted)}
@media(max-width:1000px){.drive-fields{grid-template-columns:1fr 1fr}.drive-folder-field{grid-column:1/-1}.library-search-row{grid-template-columns:1fr 220px}}
@media(max-width:650px){.library-head{display:grid}.library-source-tabs{width:100%;margin-top:10px}.source-tab{flex:1}.library-search-row{grid-template-columns:1fr}.drive-fields{grid-template-columns:1fr}.drive-folder-field{grid-column:auto}.image-preview-modal{padding:8px}.image-preview-card{height:92vh;padding:10px}.preview-caption{display:grid;text-align:center;gap:5px}.library .image-open img{padding:4px}}


/* v0.4.3 stability, customer management, sticky library controls and live progress */
.customer-tools{display:grid;grid-template-columns:minmax(220px,1fr) auto auto minmax(170px,auto) auto;gap:8px;align-items:center;flex:1;max-width:900px}
.customer-tools input{width:100%;border:1px solid var(--line);border-radius:10px;padding:10px 12px;background:#fbfcfb;outline:none}
.customer-tools input:focus{border-color:var(--green);box-shadow:0 0 0 3px rgba(114,163,83,.1)}
.customer-row.with-owner{grid-template-columns:minmax(0,1fr) 145px minmax(128px,auto)}
.customer-actions{display:flex;gap:6px;justify-content:flex-end}
.customer-row .customer-actions button{width:auto;height:31px;padding:0 10px;background:#edf4ea;color:var(--green-2);font-size:11px;font-weight:bold}
.customer-row .customer-actions button.delete{background:#f9e6e6;color:var(--danger)}

.library-sticky-tools{position:sticky;top:0;z-index:18;background:rgba(255,255,255,.97);backdrop-filter:blur(8px);margin:-4px -4px 12px;padding:8px 4px 4px;border-bottom:1px solid rgba(220,231,218,.9);box-shadow:0 9px 18px rgba(23,55,38,.06)}
.library-search-row{grid-template-columns:minmax(260px,1fr) 230px auto auto}
.library-search-row .search-action{height:44px;align-self:end}

.stat.handled{background:linear-gradient(145deg,#fff,#e9f6f0)}
.stat.pending{background:linear-gradient(145deg,#fff,#fff4e6)}
.stat.speed{background:linear-gradient(145deg,#fff,#eef2fb)}
.bar.handled,.legend-handled{background:#4e78b7}
.interactions-table{max-height:520px;overflow:auto}
.interactions-table thead{position:sticky;top:0;z-index:2}
.interaction-status{display:inline-flex;align-items:center;border-radius:999px;padding:5px 9px;font-size:11px;font-weight:bold;white-space:nowrap}
.interaction-status.handled{background:#e0f1dc;color:#3f6f31}
.interaction-status.pending{background:#fff0cf;color:#956313}
.interaction-status.no-reply{background:#f1f2f0;color:#6f7771}
.empty-cell{text-align:center;color:var(--muted);padding:28px}

.campaign-progress-modal{z-index:80;background:rgba(7,24,14,.7)}
.progress-card{width:min(620px,96vw);text-align:center;padding:34px 32px 28px;overflow:visible}
.progress-icon{width:62px;height:62px;border-radius:50%;margin:0 auto 14px;display:grid;place-items:center;background:linear-gradient(135deg,var(--green-2),var(--green));color:#fff;font-size:28px;box-shadow:0 12px 25px rgba(0,104,56,.22)}
.progress-card>p{color:var(--muted);margin:8px 0 20px}
.live-customer{background:#f5f9f3;border:1px solid var(--line);border-radius:14px;padding:13px 15px;margin-bottom:16px}
.live-customer span,.live-customer b{display:block}.live-customer span{font-size:12px;color:var(--muted)}.live-customer b{font-size:20px;color:var(--green-2);margin-top:5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.campaign-progress-track{height:16px;background:#e8eee5;border-radius:999px;overflow:hidden;box-shadow:inset 0 1px 3px rgba(0,0,0,.08)}
.campaign-progress-track span{display:block;width:0;height:100%;background:linear-gradient(90deg,var(--green-2),var(--green));border-radius:inherit;transition:width .35s ease}
.campaign-percent{display:flex;align-items:center;justify-content:space-between;margin:9px 2px 18px}.campaign-percent b{font-size:21px;color:var(--green-2)}.campaign-percent span{color:var(--muted);font-size:13px}
.progress-metrics{display:grid;grid-template-columns:repeat(4,1fr);gap:9px}.progress-metrics>div{background:#f8faf7;border:1px solid var(--line);border-radius:12px;padding:11px 6px}.progress-metrics span,.progress-metrics b{display:block}.progress-metrics span{font-size:11px;color:var(--muted)}.progress-metrics b{font-size:21px;margin-top:5px}

@media(max-width:1180px){.customer-tools{grid-template-columns:minmax(200px,1fr) auto auto}.customer-tools select,.customer-tools #chooseCampaignRecipients{grid-row:2}.library-search-row{grid-template-columns:minmax(240px,1fr) 210px auto auto}}
@media(max-width:760px){.customer-tools{display:grid;grid-template-columns:1fr 1fr;max-width:none;width:100%}.customer-tools input,.customer-tools select{grid-column:1/-1}.customer-list-head{gap:12px}.library-sticky-tools{top:0;margin-left:-12px;margin-right:-12px;padding:8px 12px}.library-search-row{grid-template-columns:1fr 1fr}.library-search-row label{grid-column:1/-1}.selectionbar{max-height:42vh;overflow:auto}.progress-card{padding:28px 18px 20px}.progress-metrics{grid-template-columns:1fr 1fr}}

/* v0.4.3 interactive report colors inspired by modern comparison dashboards */
.report-user-filter select{min-width:175px;border:1px solid var(--line);background:#fbfcfb;border-radius:9px;padding:9px 11px;outline:none}
.report-user-filter select:focus{border-color:#0b91f3;box-shadow:0 0 0 3px rgba(11,145,243,.12)}
.metric-card{--metric:#64748b;--metric-soft:#f1f5f9;--metric-border:#dbe4ec;min-height:126px;border-color:var(--metric-border);background:linear-gradient(145deg,#fff 0%,var(--metric-soft) 100%);transition:transform .2s ease,box-shadow .2s ease,border-color .2s ease;cursor:default}
.metric-card:before{content:"";position:absolute;inset:0 0 auto 0;height:4px;background:var(--metric);opacity:.9}
.metric-card:hover{transform:translateY(-4px);border-color:var(--metric);box-shadow:0 16px 35px color-mix(in srgb,var(--metric) 18%,transparent)}
.metric-card .metric-icon{position:absolute;left:15px;top:16px;width:34px;height:34px;border-radius:11px;display:grid;place-items:center;background:color-mix(in srgb,var(--metric) 12%,white);color:var(--metric);font-size:18px;font-weight:bold}
.metric-card>b{color:var(--metric)}
.metric-blue{--metric:#0b91f3;--metric-soft:#eef8ff;--metric-border:#cfeaff}
.metric-cyan{--metric:#04a7a4;--metric-soft:#edfbfa;--metric-border:#c9f0ee}
.metric-purple{--metric:#8056c7;--metric-soft:#f6f1ff;--metric-border:#e2d6fb}
.metric-green{--metric:#16a66a;--metric-soft:#edf9f3;--metric-border:#caeedc}
.metric-orange{--metric:#f39a1f;--metric-soft:#fff7e9;--metric-border:#ffe0ad}
.metric-slate{--metric:#536579;--metric-soft:#f3f6f8;--metric-border:#dae1e7}
.metric-teal{--metric:#238a67;--metric-soft:#eef8f4;--metric-border:#cfe8dd}
.metric-speed{--metric:#536579;--metric-soft:#f3f6f8;--metric-border:#dae1e7}
.metric-speed.speed-fast{--metric:#16a66a;--metric-soft:#edf9f3;--metric-border:#caeedc}
.metric-speed.speed-medium{--metric:#f39a1f;--metric-soft:#fff7e9;--metric-border:#ffe0ad}
.metric-speed.speed-slow{--metric:#dc4f52;--metric-soft:#fff0f1;--metric-border:#f7cfd1}
.metric-speed.speed-empty{--metric:#7c8792;--metric-soft:#f5f7f8;--metric-border:#dde3e7}

.report-chart{position:relative;height:205px;padding-top:48px;background:linear-gradient(180deg,#fbfdff,#fff);border:1px solid #e4ebf0;border-radius:14px}
.chart-day{border-radius:8px;padding:4px 3px;transition:background .18s ease,transform .18s ease}
.chart-day:hover{background:#f0f7fc;transform:translateY(-2px)}
.bar{transition:height .3s ease,filter .18s ease,transform .18s ease;box-shadow:0 3px 9px rgba(20,45,70,.12)}
.bar:hover{filter:brightness(1.08);transform:scaleX(1.25)}
.bar.images,.legend-images{background:#0b91f3}.bar.customers,.legend-customers{background:#04a7a4}.bar.replies,.legend-replies{background:#8056c7}.bar.handled,.legend-handled{background:#16a66a}
.chart-tooltip{position:absolute;z-index:8;width:200px;padding:11px 12px;border-radius:12px;background:rgba(24,43,55,.96);color:#fff;box-shadow:0 14px 35px rgba(10,25,36,.24);pointer-events:none;text-align:right}
.chart-tooltip b{display:block;margin-bottom:7px;font-size:13px}.chart-tooltip span{display:flex;align-items:center;gap:7px;font-size:11px;margin:5px 0;color:#e9f1f5}.chart-tooltip i{width:9px;height:9px;border-radius:3px;flex:0 0 auto}
.chart-legend{gap:8px;flex-wrap:wrap}
.chart-legend .chart-toggle{display:flex;align-items:center;gap:7px;border:1px solid var(--line);background:#fff;color:#66736b;border-radius:999px;padding:7px 11px;transition:.18s ease}
.chart-legend .chart-toggle:hover{border-color:#9fc1d6;transform:translateY(-1px)}
.chart-legend .chart-toggle:not(.active){opacity:.45;filter:grayscale(1);background:#f2f3f3}
.chart-legend .chart-toggle i{width:10px;height:10px;border-radius:3px}

.speed-badge{display:inline-flex;align-items:center;border-radius:999px;padding:5px 9px;font-size:11px;font-weight:bold;white-space:nowrap}
.speed-badge.speed-fast{background:#e0f6e9;color:#14794b}.speed-badge.speed-medium{background:#fff0cf;color:#956313}.speed-badge.speed-slow{background:#fde2e3;color:#a43c40}.speed-badge.speed-empty{background:#eff1f2;color:#717a81}
#reportTable tr[data-report-user]{cursor:pointer;transition:background .16s ease}
#reportTable tr[data-report-user]:hover{background:#f2f8fc}
.report-stats{grid-template-columns:repeat(4,minmax(0,1fr))}

@media(max-width:1100px){.report-stats{grid-template-columns:repeat(2,minmax(0,1fr))}.report-user-filter{min-width:175px}}
@media(max-width:650px){.metric-card{min-height:112px}.metric-card .metric-icon{width:30px;height:30px;font-size:15px}.report-chart{height:195px}.chart-tooltip{width:175px}.report-user-filter,.report-user-filter select{width:100%}}

/* v0.4.4 — light, calm dashboard inspired by modern Zid-style admin panels */
:root{
  --bg:#f7f7f9;--card:#ffffff;--text:#1f2933;--muted:#7b8190;--line:#ececf1;
  --green:#72a353;--green-2:#18784f;--green-dark:#11633f;--shadow:0 8px 24px rgba(31,41,51,.055)
}
body{background:var(--bg);font-family:'Almarai',sans-serif}
.app{grid-template-columns:236px minmax(0,1fr)}
.side{background:#fff;color:var(--text);border-left:1px solid var(--line);padding:18px 14px;box-shadow:-5px 0 20px rgba(31,41,51,.035)}
.brand{border-bottom:1px solid var(--line);padding:4px 7px 17px}.brand img{filter:none;width:76px;height:48px}.brand b{color:#173726}.brand span{color:var(--muted)}
.side nav{gap:5px}.nav{color:#555d69;border:1px solid transparent;padding:12px 13px;font-weight:600}.nav:hover{background:#f6f4f9;color:#4b2a66;border-color:#eee8f3}.nav.active{background:#f1edf6;color:#512b6e;border-color:#e8def1;box-shadow:inset -3px 0 0 #6a3d89}.nav span{color:#765094}
.side-link{color:#6d7480;border-radius:9px}.side-link:hover{background:#f6f4f9;color:#512b6e}.side-link.danger{color:#b44a4a}.version{color:#9a9fab}
main{padding:26px 30px 42px}header{background:#fff;border:1px solid var(--line);border-radius:18px;padding:18px 20px;box-shadow:var(--shadow);margin-bottom:18px}header h1{font-size:28px;letter-spacing:-.2px}header p{font-size:14px}
.card,.stat{border-color:var(--line);box-shadow:var(--shadow);border-radius:18px}.card{padding:22px}.stat{padding:19px}.stat:hover{box-shadow:0 12px 28px rgba(31,41,51,.075)}
.btn{border-radius:10px;font-weight:600;transition:.18s ease}.btn.primary{background:#18784f}.btn.primary:hover{background:#12633f;transform:translateY(-1px)}.btn.secondary{background:#eef6f1;color:#176746}.btn.ghost{background:#f5f5f7;color:#5f6672}.btn.plain{color:#747b86}
.report-filter{background:linear-gradient(135deg,#fff,#fbf9fd)}
.metric-card{border-width:1px;box-shadow:0 7px 22px rgba(31,41,51,.045)}.metric-card:hover{transform:translateY(-3px)}
.report-chart{background:#fff;border-color:var(--line)}
.table-wrap{border:1px solid var(--line);border-radius:14px;overflow:auto}table{border-collapse:separate;border-spacing:0}thead th{background:#fafafa;color:#626975;border-bottom:1px solid var(--line)}tbody tr:hover{background:#faf8fc}
.library-card{background:#fff}.library-sticky-tools{top:10px;border:1px solid var(--line);border-radius:14px;padding:11px 12px;margin:0 0 14px;background:rgba(255,255,255,.96);box-shadow:0 10px 26px rgba(31,41,51,.07)}
.library-source-tabs{background:#f4f3f6;border:1px solid #e9e7ec}.source-tab.active{background:#fff;color:#512b6e;box-shadow:0 2px 8px rgba(81,43,110,.1)}
.library .image-card{border-color:var(--line);box-shadow:0 6px 18px rgba(31,41,51,.045);transition:.2s ease}.library .image-card:hover{transform:translateY(-3px);box-shadow:0 13px 28px rgba(31,41,51,.09)}
input,select,textarea{border-color:#dedfe5!important;background:#fff!important}.badge.on{background:#eaf6ef;color:#18784f}.badge.off{background:#fbebeb;color:#a94c4c}.user-chip{border-color:var(--line)}
.drive-panel{background:#faf9fb;border:1px solid var(--line);border-radius:15px}.drive-note{color:#6f7580}
.image-preview-card{border-radius:20px;box-shadow:0 28px 70px rgba(20,24,32,.22)}
@media(max-width:900px){.side{border-left:0;border-bottom:1px solid var(--line);box-shadow:none}.side nav{grid-template-columns:repeat(3,1fr)}.nav.active{box-shadow:inset 0 -3px 0 #6a3d89}.app{grid-template-columns:1fr}main{padding:18px}}


/* v0.4.5 — media library interface */
:root{--purple:#6b4a83;--purple-soft:#f3eef7;--surface:#fff;--surface-2:#faf9fb}
.side{width:auto;padding:16px 12px}.brand{display:grid;grid-template-columns:56px 1fr;gap:10px;align-items:center;padding:8px 8px 18px}.brand img{width:56px;height:56px;object-fit:contain}.brand-copy{display:flex;flex-direction:column;min-width:0}.brand-copy b{font-size:14px}.brand-copy span{font-size:12px;margin-top:3px}.brand-copy small{font-size:11px;color:#765094;margin-top:5px}.brand-copy i{font-size:10px;color:#8b919b;font-style:normal;margin-top:3px}
.library-head{align-items:center}.library-source-tabs{order:-1}.library-sticky-tools{position:relative;top:auto;box-shadow:none;padding:10px;background:var(--surface-2)}.library-search-row{display:grid;grid-template-columns:minmax(240px,1fr) minmax(170px,.35fr) auto auto;gap:9px;align-items:end}.library-search-row label span{font-size:11px}.product-search small{display:none}.selectionbar{position:fixed;z-index:60;right:50%;bottom:22px;transform:translateX(50%);width:min(920px,calc(100vw - 32px));background:#fff;border:1px solid #e4dbea;border-radius:18px;padding:11px 13px;box-shadow:0 18px 50px rgba(45,30,57,.2);display:flex;gap:8px;align-items:center;flex-wrap:wrap;animation:actionBarIn .18s ease}.selectionbar>div{margin-inline-end:auto}.selectionbar>div span{display:none}@keyframes actionBarIn{from{opacity:0;transform:translate(50%,12px)}to{opacity:1;transform:translate(50%,0)}}
.upload-panel{background:#fbfafc;border:1px dashed #ded6e5;border-radius:15px}.library{grid-template-columns:repeat(auto-fill,minmax(185px,1fr));gap:14px}.library .product-card{overflow:hidden;border-radius:16px;background:#fff}.library .image-open{aspect-ratio:1/1;border:0;background:#f4f4f6;padding:0;width:100%;display:grid;place-items:center}.library .image-open img,.library .image-open video{width:100%;height:100%;object-fit:cover}.media-video{position:relative}.media-video:after{content:'▶';position:absolute;inset:50% auto auto 50%;transform:translate(-50%,-50%);width:42px;height:42px;border-radius:50%;background:rgba(19,22,27,.72);color:#fff;display:grid;place-items:center;font-size:18px;pointer-events:none}.product-info em.video{background:#f2eafb;color:#694183}.product-card.selected{outline:3px solid #765094;outline-offset:-3px}.source-tab{min-width:124px}.source-tab.active{color:#512b6e}.upload-button{white-space:nowrap}
@media(max-width:800px){.library-search-row{grid-template-columns:1fr 1fr}.library-search-row .search-action{width:100%}.selectionbar{bottom:10px}.library{grid-template-columns:repeat(2,minmax(0,1fr))}.brand{grid-template-columns:45px 1fr}.brand img{width:45px;height:45px}}


/* v0.4.6 — settings separation and compact sticky media search */
.library-sticky-tools{position:sticky;top:10px;z-index:35;background:rgba(255,255,255,.96);backdrop-filter:blur(12px);box-shadow:0 8px 24px rgba(31,41,51,.08)}
.library-search-row{grid-template-columns:minmax(260px,1fr) minmax(170px,.32fr) auto auto}
.library-search-row input,.library-search-row select{height:42px}
.settings-grid{display:grid;grid-template-columns:minmax(0,1.25fr) minmax(300px,.75fr);gap:18px}.settings-card{min-height:220px}.settings-badge{display:inline-flex;align-items:center;padding:6px 10px;border-radius:999px;background:#eef6f1;color:#176746;font-size:11px;font-weight:700}.settings-badge.pending{background:#f3eef7;color:#6b4a83}.settings-card .drive-panel{display:block!important;margin-top:8px}.desktop-app-summary{padding:20px;border:1px dashed #ded6e5;border-radius:15px;background:#fbfafc}.desktop-app-summary b{display:block;font-size:18px;color:#173726}.desktop-app-summary p{color:#626975;line-height:1.8}.desktop-app-summary small{color:#8b919b}.settings-card .drive-fields{display:grid;grid-template-columns:minmax(260px,1fr) auto auto auto;gap:10px;align-items:end}
@media(max-width:1000px){.settings-grid{grid-template-columns:1fr}.settings-card .drive-fields{grid-template-columns:1fr 1fr}.library-sticky-tools{top:6px}}
@media(max-width:650px){.settings-card .drive-fields,.library-search-row{grid-template-columns:1fr}.library-sticky-tools{position:relative;top:auto}}

/* v0.4.7 — complete web conversations and WhatsApp linking inside settings */
.chat-workspace{height:calc(100vh - 154px);min-height:620px;display:grid;grid-template-columns:360px minmax(0,1fr);background:#fff;border:1px solid var(--line);border-radius:20px;overflow:hidden;box-shadow:var(--shadow)}
.chat-list-pane{display:flex;flex-direction:column;min-width:0;background:#fff;border-left:1px solid var(--line)}
.chat-list-head{display:flex;align-items:center;justify-content:space-between;padding:18px 18px 12px}.chat-list-head h2{margin:0;font-size:21px}.chat-list-head small{display:block;margin-top:5px;color:var(--muted);font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:275px}
.icon-action{width:38px;height:38px;border-radius:11px;border:1px solid var(--line);background:#fff;color:#52606b;font-size:20px;display:grid;place-items:center;cursor:pointer;transition:.18s ease}.icon-action:hover{background:#f4f8f6;border-color:#cfe0d6;color:#18784f;transform:translateY(-1px)}
.chat-account-field{padding:0 16px 10px}.chat-account-field span{display:block;color:#777e88;font-size:11px;margin-bottom:5px}.chat-account-field select{width:100%;height:40px}
.chat-search-box{margin:0 16px 10px;height:42px;border-radius:12px;background:#f5f6f7;border:1px solid transparent;display:flex;align-items:center;gap:8px;padding:0 11px;transition:.18s ease}.chat-search-box:focus-within{background:#fff;border-color:#c7d9cf;box-shadow:0 0 0 3px rgba(24,120,79,.08)}.chat-search-box span{font-size:19px;color:#7f8791}.chat-search-box input{border:0!important;background:transparent!important;outline:0;width:100%;height:38px;padding:0}.chat-search-box button{border:0;background:transparent;color:#8b929b;font-size:18px;cursor:pointer}
.chat-filter-row{display:flex;gap:7px;padding:0 16px 12px;border-bottom:1px solid var(--line)}.chat-filter,.chat-refresh{border:1px solid var(--line);background:#fff;color:#6c7480;border-radius:999px;padding:6px 11px;font-size:11px;cursor:pointer}.chat-filter.active{background:#e9f5ee;color:#176746;border-color:#cbe3d4;font-weight:700}.chat-refresh{margin-inline-start:auto}
.chat-list{overflow:auto;min-height:0;flex:1}.chat-list-empty{padding:50px 20px;text-align:center;color:#8a919b;font-size:13px}.chat-list-item{width:100%;border:0;border-bottom:1px solid #f1f1f3;background:#fff;display:grid;grid-template-columns:46px minmax(0,1fr) auto;gap:11px;align-items:center;text-align:right;padding:12px 15px;cursor:pointer;transition:.14s ease}.chat-list-item:hover{background:#fafbfb}.chat-list-item.active{background:#edf6f1;box-shadow:inset -3px 0 0 #18784f}.chat-avatar{width:44px;height:44px;border-radius:50%;display:grid;place-items:center;background:linear-gradient(145deg,#e9f3ed,#d9e9df);color:#176746;font-weight:800;font-size:17px;flex:0 0 auto}.chat-item-copy{min-width:0;display:flex;flex-direction:column;gap:5px}.chat-item-copy b{font-size:13px;color:#2c343b;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.chat-item-copy small{color:#818892;font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.chat-item-meta{align-self:stretch;display:flex;flex-direction:column;align-items:flex-end;justify-content:space-between;min-width:40px}.chat-item-meta time{font-size:10px;color:#969ca4}.chat-item-meta i{font-style:normal;background:#25a76f;color:#fff;border-radius:999px;min-width:20px;height:20px;padding:0 5px;display:grid;place-items:center;font-size:10px;font-weight:700}
.chat-conversation-pane{min-width:0;position:relative;background:#efeae2;background-image:radial-gradient(rgba(94,107,93,.065) 1px,transparent 1px);background-size:22px 22px}.chat-welcome{height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:35px;background:rgba(249,250,249,.86)}.chat-welcome img{width:118px;height:78px;object-fit:contain;margin-bottom:18px}.chat-welcome h2{margin:0 0 9px;color:#26372d}.chat-welcome p{max-width:520px;line-height:1.9;color:#747c85;margin:0}
.active-chat-view{height:100%;display:grid;grid-template-rows:auto minmax(0,1fr) auto auto}.active-chat-head{margin:0!important;border:0!important;border-radius:0!important;box-shadow:none!important;background:rgba(255,255,255,.97)!important;padding:12px 17px!important;display:flex;align-items:center;gap:11px;border-bottom:1px solid var(--line)!important}.active-chat-head>div:nth-child(2){display:flex;flex-direction:column;gap:4px;min-width:0}.active-chat-head b{font-size:14px}.active-chat-head span{color:#7c838d;font-size:11px;direction:ltr;text-align:right}.active-chat-actions{margin-inline-start:auto;display:flex;align-items:center;gap:8px}.active-chat-actions .btn{padding:9px 12px;font-size:11px}
.chat-messages{min-height:0;overflow:auto;padding:18px 4.5% 24px;scroll-behavior:smooth}.load-older{display:block;margin:0 auto 15px;border:1px solid #dfe4e1;background:rgba(255,255,255,.92);border-radius:999px;padding:7px 13px;color:#65716a;cursor:pointer;font-size:11px}.chat-day{text-align:center;margin:12px 0}.chat-day span{display:inline-block;background:rgba(255,255,255,.9);color:#65716a;border-radius:9px;padding:6px 10px;font-size:10px;box-shadow:0 1px 4px rgba(31,41,51,.08)}.message-row{display:flex;margin:3px 0}.message-row.outgoing{justify-content:flex-start}.message-row.incoming{justify-content:flex-end}.message-bubble{max-width:min(620px,78%);border-radius:12px;padding:7px 8px 5px;box-shadow:0 1px 2px rgba(30,38,33,.13);overflow:hidden}.message-row.outgoing .message-bubble{background:#d9fdd3;border-top-left-radius:3px}.message-row.incoming .message-bubble{background:#fff;border-top-right-radius:3px}.message-bubble p{margin:3px 5px 2px;line-height:1.65;font-size:13px;white-space:normal;overflow-wrap:anywhere}.message-bubble footer{display:flex;align-items:center;justify-content:flex-end;gap:4px;min-height:15px;padding:0 3px}.message-bubble footer time{font-size:9px;color:#7b837e}.message-bubble footer i{font-style:normal;color:#3d91c8;font-size:10px}.message-bubble img,.message-bubble video{display:block;width:min(380px,100%);max-height:430px;object-fit:contain;border-radius:8px;background:#e5e6e6}.message-bubble audio{width:min(330px,65vw);height:40px}.chat-image-open{border:0;padding:0;background:transparent;cursor:zoom-in;display:block}.chat-document{min-width:260px;display:flex;align-items:center;gap:10px;padding:11px;border-radius:9px;background:rgba(255,255,255,.55);color:#35433b;text-decoration:none}.chat-document>span{width:40px;height:40px;border-radius:10px;background:#edf1ef;display:grid;place-items:center;font-size:19px}.chat-document div{display:flex;flex-direction:column;min-width:0}.chat-document b{font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:260px}.chat-document small{color:#7a837e;font-size:10px;margin-top:4px}.missing-chat-media{padding:12px;border-radius:8px;background:#f1f2f2;color:#6c746f}.chat-empty-thread{text-align:center;margin:70px auto;color:#748078;background:rgba(255,255,255,.8);width:max-content;max-width:90%;border-radius:999px;padding:8px 14px;font-size:11px}
.chat-attachment-preview{margin:0 14px;padding:9px 12px;border-radius:12px 12px 0 0;background:#fff;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between}.chat-attachment-preview div{display:flex;flex-direction:column;gap:3px;min-width:0}.chat-attachment-preview b{font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.chat-attachment-preview small{font-size:10px;color:#858c95}.chat-attachment-preview button{border:0;background:#f2f3f3;width:28px;height:28px;border-radius:8px;cursor:pointer;color:#68716c}
.chat-composer{padding:10px 13px;background:#f4f5f4;display:flex;align-items:flex-end;gap:9px;border-top:1px solid #e3e5e3}.composer-attach,.composer-send{width:42px;height:42px;border-radius:50%;display:grid;place-items:center;flex:0 0 auto;cursor:pointer;border:0}.composer-attach{background:#fff;color:#68736d;font-size:24px;border:1px solid #e1e4e2}.composer-send{background:#18784f;color:#fff;font-size:19px;transition:.18s ease}.composer-send:hover{background:#12633f;transform:scale(1.04)}.composer-send:disabled{opacity:.55}.chat-composer textarea{min-height:42px;max-height:120px;resize:none;border-radius:21px!important;padding:11px 16px!important;line-height:1.55;overflow:auto}
.settings-wa-layout{display:grid;grid-template-columns:minmax(260px,1fr) 250px;gap:18px;align-items:center}.settings-wa-layout .qr-copy{text-align:right}.settings-wa-layout .qr-copy img{width:90px;height:55px;object-fit:contain}.settings-wa-layout .qr-copy h3{margin:6px 0}.settings-wa-layout .qr-copy p{color:#737b84}.settings-wa-layout .qrbox{min-height:235px}.settings-accounts-list{display:flex;flex-direction:column;gap:8px}.settings-account-row{display:grid;grid-template-columns:12px minmax(0,1fr) auto;gap:10px;align-items:center;padding:12px;border:1px solid var(--line);border-radius:12px;background:#fbfbfc}.settings-account-row .account-dot{width:10px;height:10px;border-radius:50%;background:#c6c9cd}.settings-account-row .account-dot.connected{background:#24a66f;box-shadow:0 0 0 4px rgba(36,166,111,.1)}.settings-account-row div:nth-child(2){display:flex;flex-direction:column;gap:3px}.settings-account-row b{font-size:12px}.settings-account-row span{font-size:10px;color:#7e858e}.settings-account-row em{font-style:normal;font-size:10px;color:#69716d}
@media(max-width:1100px){.chat-workspace{grid-template-columns:320px minmax(0,1fr)}.settings-wa-layout{grid-template-columns:1fr}}
@media(max-width:780px){.chat-workspace{height:auto;min-height:calc(100vh - 180px);grid-template-columns:1fr}.chat-list-pane{border-left:0;max-height:42vh;border-bottom:1px solid var(--line)}.chat-conversation-pane{min-height:55vh}.active-chat-view{min-height:55vh}.chat-welcome{min-height:55vh}.message-bubble{max-width:88%}.active-chat-actions .btn{display:none}}
.settings-wa-layout .qrbox{width:100%;max-width:250px;min-height:235px;margin:0;justify-self:end}.settings-wa-layout .qrbox img{width:220px;max-width:92%}

/* v0.4.8 — keep the composer visible and prevent duplicate LID/phone threads */
.chat-conversation-pane{min-height:0;overflow:hidden}
.active-chat-view{min-height:0;overflow:hidden}
.chat-messages{overscroll-behavior:contain}
.chat-composer{position:relative;z-index:5;flex:0 0 auto;box-shadow:0 -4px 14px rgba(38,55,45,.045)}
#chats.page.active{min-height:0;overflow:hidden}
@media(max-height:760px) and (min-width:781px){.chat-workspace{min-height:440px}.active-chat-head{padding-top:9px!important;padding-bottom:9px!important}.chat-composer{padding-top:7px;padding-bottom:7px}}


/* v0.4.12 — WhatsApp Desktop-inspired conversation workspace */
@media (min-width:901px){
  .app{display:block!important;min-height:100vh}
  .side{
    position:fixed!important;top:0!important;right:0!important;bottom:0!important;left:auto!important;
    width:236px!important;height:100dvh!important;min-height:0!important;z-index:120!important;
    overflow:hidden!important;display:flex!important;flex-direction:column!important
  }
  .side nav{min-height:0;overflow-y:auto;overflow-x:hidden;padding-inline-end:3px}
  .side-bottom{flex:0 0 auto}
  main{margin-right:236px!important;min-height:100vh}
  body.chat-page-open{overflow:hidden!important}
  body.chat-page-open main{height:100dvh!important;min-height:0!important;overflow:hidden!important;padding:0!important}
  body.chat-page-open main>header{display:none!important}
  body.chat-page-open #chats.page.active{display:block!important;height:100dvh!important;min-height:0!important;overflow:hidden!important}
  body.chat-page-open .chat-workspace{
    width:100%!important;height:100dvh!important;min-height:0!important;margin:0!important;
    border:0!important;border-radius:0!important;box-shadow:none!important;
    grid-template-columns:360px minmax(0,1fr)!important
  }
}

.chat-workspace{background:#fff}
.chat-list-pane{height:100%;min-height:0;overflow:hidden}
.chat-list-head,.chat-account-field,.chat-search-box,.chat-filter-row{flex:0 0 auto}
.chat-list{flex:1 1 auto;min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;scrollbar-gutter:stable}
.chat-list::-webkit-scrollbar,.chat-messages::-webkit-scrollbar,.thread-search-results::-webkit-scrollbar,.side nav::-webkit-scrollbar{width:7px}
.chat-list::-webkit-scrollbar-thumb,.chat-messages::-webkit-scrollbar-thumb,.thread-search-results::-webkit-scrollbar-thumb,.side nav::-webkit-scrollbar-thumb{background:#cbd2ce;border-radius:999px}
.chat-list::-webkit-scrollbar-track,.chat-messages::-webkit-scrollbar-track,.thread-search-results::-webkit-scrollbar-track,.side nav::-webkit-scrollbar-track{background:transparent}

.chat-conversation-pane{height:100%!important;min-height:0!important;overflow:hidden!important;background-color:#efeae2}
.active-chat-view{height:100%!important;min-height:0!important;overflow:hidden!important;display:grid!important;grid-template-rows:64px minmax(0,1fr) auto 64px!important;position:relative!important}
.active-chat-view[hidden]{display:none!important}
.active-chat-head{
  min-height:64px!important;height:64px!important;padding:8px 14px!important;margin:0!important;border-radius:0!important;
  border:0!important;border-bottom:1px solid #e3e6e4!important;background:#f8faf9!important;box-shadow:none!important;
  display:flex!important;align-items:center!important;gap:10px!important;z-index:30!important
}
.active-chat-identity{display:flex;flex-direction:column;gap:3px;min-width:0}
.active-chat-identity b{font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.active-chat-identity span{font-size:11px;color:#778079;direction:ltr;text-align:right}
.active-chat-actions{margin-inline-start:auto;display:flex;align-items:center;gap:4px;position:relative}
.chat-head-icon{
  width:40px;height:40px;border:0;border-radius:50%;display:grid;place-items:center;background:transparent;color:#59625d;
  font-size:21px;line-height:1;transition:.16s ease
}
.chat-head-icon:hover{background:#e9eeeb;color:#1d3b2a}
.chat-more-menu{
  position:absolute;top:48px;left:0;width:225px;background:#fff;border:1px solid #e2e6e3;border-radius:12px;
  box-shadow:0 14px 38px rgba(25,42,32,.16);padding:7px;z-index:95
}
.chat-more-menu button{width:100%;border:0;background:transparent;border-radius:8px;padding:10px 11px;display:flex;align-items:center;gap:10px;text-align:right;color:#3e4942;font-size:12px}
.chat-more-menu button:hover{background:#f1f5f2}.chat-more-menu button span{width:20px;text-align:center;color:#68726c;font-size:17px}

.chat-messages{grid-row:2!important;min-height:0!important;overflow-y:auto!important;overflow-x:hidden!important;padding:18px 5% 24px!important;overscroll-behavior:contain;scroll-behavior:smooth}
.message-row.search-highlight .message-bubble{animation:chatSearchPulse 2.5s ease}
@keyframes chatSearchPulse{0%,100%{box-shadow:0 1px 2px rgba(30,38,33,.13)}20%,65%{box-shadow:0 0 0 4px rgba(244,190,35,.55),0 6px 18px rgba(30,38,33,.18)}}
.chat-scroll-bottom{
  position:absolute;left:18px;bottom:82px;width:42px;height:42px;border:1px solid #dfe4e1;border-radius:50%;
  background:#fff;color:#5f6963;box-shadow:0 5px 18px rgba(28,45,35,.16);font-size:24px;z-index:45
}
.chat-scroll-bottom:hover{background:#f5f8f6}

.chat-thread-search-panel{
  position:absolute;top:64px;bottom:64px;left:0;width:min(380px,43%);min-width:320px;background:#fff;
  border-right:1px solid #e1e5e2;box-shadow:12px 0 30px rgba(32,46,38,.08);z-index:70;
  display:grid;grid-template-rows:auto auto auto minmax(0,1fr);overflow:hidden
}
.thread-search-head{height:58px;padding:0 16px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #e8ebe9}
.thread-search-head b{font-size:15px}.thread-search-head button{width:34px;height:34px;border:0;border-radius:50%;background:transparent;color:#68716c;font-size:22px}.thread-search-head button:hover{background:#f0f3f1}
.thread-search-box{margin:12px;height:42px;border:1px solid #dfe4e1;background:#f4f6f5;border-radius:10px;display:flex;align-items:center;gap:8px;padding:0 11px}
.thread-search-box:focus-within{background:#fff;border-color:#8eb9a2;box-shadow:0 0 0 3px rgba(24,120,79,.08)}
.thread-search-box span{color:#737d77;font-size:19px}.thread-search-box input{flex:1;min-width:0;border:0;outline:0;background:transparent}.thread-search-box button{border:0;background:transparent;color:#89908c;font-size:18px}
.thread-search-summary{padding:0 15px 10px;color:#858d88;font-size:10px;border-bottom:1px solid #edf0ee}
.thread-search-results{min-height:0;overflow-y:auto}.thread-search-empty{padding:45px 20px;text-align:center;color:#8b928e;font-size:12px}
.thread-search-result{width:100%;border:0;border-bottom:1px solid #f0f2f1;background:#fff;padding:12px 14px;display:grid;grid-template-columns:38px minmax(0,1fr);gap:10px;align-items:center;text-align:right}
.thread-search-result:hover{background:#f5f8f6}.thread-search-result-icon{width:36px;height:36px;border-radius:50%;display:grid;place-items:center;background:#e8f1eb;color:#176746;font-size:17px}
.thread-search-result>span:last-child{display:flex;flex-direction:column;gap:5px;min-width:0}.thread-search-result b{font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.thread-search-result small{font-size:10px;color:#858d88}

.chat-attachment-preview{grid-row:3!important;min-height:52px!important;margin:0!important;border-radius:0!important;z-index:35!important}
#chatComposer.chat-composer{
  grid-row:4!important;position:relative!important;display:flex!important;align-items:center!important;gap:8px!important;
  min-height:64px!important;height:auto!important;padding:9px 12px!important;margin:0!important;background:#f0f2f1!important;
  border-top:1px solid #dfe4e1!important;box-shadow:none!important;overflow:visible!important;z-index:60!important
}
.composer-action,.composer-send{width:42px;height:42px;min-width:42px;border-radius:50%;display:grid;place-items:center;border:0;line-height:1}
.composer-action{background:transparent;color:#59645d;font-size:25px}.composer-action:hover{background:#e2e7e4}.composer-emoji{font-size:23px}
#chatComposer textarea{flex:1 1 auto!important;min-width:0!important;min-height:42px!important;max-height:120px!important;border:0!important;border-radius:21px!important;background:#fff!important;padding:10px 16px!important;outline:0!important;box-shadow:0 0 0 1px #e1e5e2 inset!important}
#chatComposer textarea:focus{box-shadow:0 0 0 1px #8db79f inset,0 0 0 3px rgba(24,120,79,.06)!important}
.composer-send{background:#18784f;color:#fff;font-size:18px}.composer-send:hover{background:#11643f}
.chat-attach-menu,.chat-emoji-panel{position:absolute;bottom:60px;right:10px;background:#fff;border:1px solid #e0e5e2;border-radius:14px;box-shadow:0 14px 38px rgba(25,42,32,.18);z-index:110}
.chat-attach-menu{width:280px;padding:8px}.chat-attach-menu button{width:100%;border:0;background:transparent;border-radius:10px;padding:10px;display:grid;grid-template-columns:42px minmax(0,1fr);gap:10px;align-items:center;text-align:right}
.chat-attach-menu button:hover{background:#f2f6f3}.chat-attach-menu button>span{width:40px;height:40px;border-radius:50%;display:grid;place-items:center;background:#e7f1eb;color:#18784f;font-size:19px}.chat-attach-menu button div{display:flex;flex-direction:column;gap:4px}.chat-attach-menu b{font-size:12px}.chat-attach-menu small{font-size:10px;color:#818984}
.chat-emoji-panel{right:58px;width:265px;padding:10px;display:grid;grid-template-columns:repeat(6,1fr);gap:4px}.chat-emoji-panel button{border:0;background:transparent;border-radius:8px;font-size:22px;padding:7px 3px}.chat-emoji-panel button:hover{background:#f0f4f1}

@media(max-width:1100px) and (min-width:901px){
  body.chat-page-open .chat-workspace{grid-template-columns:320px minmax(0,1fr)!important}
  .chat-thread-search-panel{width:350px;min-width:300px}
}
@media(max-width:900px){
  .side{position:static!important;width:auto!important;height:auto!important;overflow:visible!important}
  main{margin-right:0!important}
  body.chat-page-open{overflow:auto!important}
  body.chat-page-open main>header{display:flex!important}
  .chat-thread-search-panel{position:absolute;inset:64px 0 64px 0;width:100%;min-width:0;border-right:0}
}

/* v0.4.13 — WhatsApp groups are distinct from individual customer chats */
.chat-avatar.group-avatar{background:linear-gradient(145deg,#e8f2ff,#d9e8fb);color:#2d5f91;font-size:19px}
.chat-list-item.group-chat-item .chat-item-copy b{display:flex;align-items:center;gap:6px;min-width:0}
.chat-group-badge{font-style:normal;font-size:9px;line-height:1;background:#e9f2ff;color:#2c669b;border:1px solid #cddff1;border-radius:999px;padding:3px 6px;white-space:nowrap;font-weight:700}
.group-message-sender{font-size:11px;font-weight:800;color:#1d7554;margin:0 0 5px;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.chat-filter-row{flex-wrap:wrap}
.chat-filter-row .chat-refresh{white-space:nowrap}

/* v0.4.14 — administrative observer mode and compact media search */
.chat-observer-badge{
  display:inline-flex;align-items:center;gap:6px;max-width:190px;padding:6px 9px;border:1px solid #d9c8e5;
  border-radius:999px;background:#f6f0fa;color:#68447f;font-size:10px;font-weight:800;white-space:nowrap
}
.chat-observer-badge:before{content:'◉';font-size:11px;color:#7a5590}
.chat-observer-badge[hidden]{display:none!important}

.compact-library-search{grid-template-columns:minmax(210px,430px) minmax(170px,230px) auto auto!important;justify-content:start}
.compact-library-search .product-search input{font-size:14px!important;font-weight:600!important;letter-spacing:0!important}
.compact-library-search .search-action{min-width:82px}
.library-search-report{
  margin-top:9px;display:flex;align-items:center;gap:10px;max-width:590px;padding:10px 12px;border:1px solid #d8e8df;
  border-radius:12px;background:#f4faf6;box-shadow:0 7px 18px rgba(29,75,48,.07);animation:searchReportIn .18s ease
}
.library-search-report[hidden]{display:none!important}
.library-search-report.searching{border-color:#e1d8e9;background:#faf7fc}.library-search-report.empty{border-color:#f0d8d8;background:#fff8f8}
.library-search-report-icon{width:32px;height:32px;border-radius:50%;display:grid;place-items:center;background:#dff1e6;color:#19734d;font-weight:900;flex:0 0 auto}
.library-search-report.searching .library-search-report-icon{background:#eee5f3;color:#6b4a83;animation:searchSpin 1s linear infinite}
.library-search-report.empty .library-search-report-icon{background:#f8e4e4;color:#af4d4d;animation:none}
.library-search-report>div{display:flex;flex-direction:column;gap:3px;min-width:0}.library-search-report b{font-size:12px}.library-search-report small{font-size:10px;color:#747d77;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.library-search-report>button{margin-inline-start:auto;width:30px;height:30px;border:0;border-radius:50%;background:transparent;color:#7c8580;font-size:19px}.library-search-report>button:hover{background:#e9efeb}
@keyframes searchSpin{to{transform:rotate(360deg)}}@keyframes searchReportIn{from{opacity:0;transform:translateY(-5px)}to{opacity:1;transform:translateY(0)}}

@media(max-width:900px){
  .chat-observer-badge{max-width:145px;font-size:9px;padding:5px 7px}
  .compact-library-search{grid-template-columns:1fr 1fr!important}.compact-library-search label{grid-column:1/-1}.library-search-report{max-width:none}
}

/* v0.4.16 — multi-branch management and branch-isolated workspaces */
.header-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.branch-switcher{display:flex;align-items:center;gap:8px;background:#fff;border:1px solid #e2e7e4;border-radius:12px;padding:6px 9px;box-shadow:0 3px 12px rgba(25,55,38,.04)}
.branch-switcher[hidden]{display:none!important}
.branch-switcher span{font-size:10px;color:#7b847f;font-weight:700}
.branch-switcher select{min-width:150px;border:0;background:#f2f6f3;border-radius:8px;padding:8px 10px;color:#244433;font-weight:800;outline:0}
.branch-switcher select:focus{box-shadow:0 0 0 3px rgba(24,120,79,.1)}
.brand-copy small{display:block;color:#7f668f;font-weight:800;margin-top:2px}

.branches-layout{align-items:start}
.branches-list{display:grid;gap:12px}
.branch-card{border:1px solid #dfe7e2;border-radius:16px;background:#fff;padding:15px;box-shadow:0 7px 20px rgba(28,65,42,.05);transition:.18s ease}
.branch-card:hover{transform:translateY(-1px);box-shadow:0 10px 25px rgba(28,65,42,.08)}
.branch-card.disabled{opacity:.7;background:#fafafa}
.branch-card-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:13px}
.branch-card-head>div{display:flex;flex-direction:column;gap:3px}.branch-card-head b{font-size:15px}.branch-card-head span{font-size:10px;color:#7c8580}
.branch-status{display:inline-flex!important;align-items:center;gap:5px;border-radius:999px;padding:5px 9px;background:#f2e5e5;color:#a34747!important;font-weight:800}
.branch-status.active{background:#e3f3e9;color:#176d49!important}.branch-status:before{content:'•';font-size:18px;line-height:0}
.branch-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-bottom:13px}
.branch-stats>div{background:#f5f8f6;border:1px solid #e8ece9;border-radius:11px;padding:10px;text-align:center;display:flex;flex-direction:column;gap:3px}
.branch-stats b{font-size:18px;color:#176d49}.branch-stats span{font-size:10px;color:#7d8580}
.branch-edit{display:grid;grid-template-columns:minmax(120px,1fr) minmax(110px,.7fr) auto auto;gap:8px;align-items:center}
.branch-edit input{width:100%;border:1px solid #dfe5e1;border-radius:9px;padding:9px 10px;background:#fff;outline:0}.branch-edit input:focus{border-color:#83ad96;box-shadow:0 0 0 3px rgba(24,120,79,.08)}
.danger-outline{border:1px solid #e8caca!important;color:#a34242!important;background:#fff7f7!important}.danger-outline:hover{background:#fbeaea!important}

.user-card{grid-template-columns:minmax(240px,1fr) minmax(150px,210px) auto!important;align-items:center}
.user-branch-area{min-width:0}.user-branch-control{display:flex;flex-direction:column;gap:4px}.user-branch-control span{font-size:9px;color:#7d8580;font-weight:700}.user-branch-control select{width:100%;border:1px solid #dce4df;background:#f7faf8;border-radius:9px;padding:8px;color:#28513a;font-size:11px;font-weight:700}
.user-branch-badge{display:inline-flex;padding:6px 9px;border-radius:999px;background:#e7f2eb;color:#176d49;font-size:10px;font-weight:800}.user-branch-badge.global{background:#f1eaf5;color:#69477d}
.toolbar.compact select{min-width:150px}
#driveBranchBadge{max-width:220px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.settings-account-row span:after{content:attr(data-branch);display:inline-block;margin-inline-start:6px;color:#775a88}

@media(max-width:1150px){.branch-edit{grid-template-columns:1fr 1fr}.branch-edit .btn{width:100%}.user-card{grid-template-columns:1fr auto!important}.user-branch-area{grid-column:1/-1}}
@media(max-width:900px){.branch-switcher{width:100%;justify-content:space-between}.branch-switcher select{flex:1}.branch-edit{grid-template-columns:1fr}.branch-stats{grid-template-columns:repeat(3,1fr)}}

/* v0.4.16 — multi-account WhatsApp status publishing */
.status-layout{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(340px,.85fr);gap:16px;align-items:start}
.status-composer-card,.status-history-card{min-height:0}.status-live-note{display:inline-flex;align-items:center;border-radius:999px;background:#e8f4ec;color:#176d49;padding:7px 11px;font-size:11px;font-weight:800;white-space:nowrap}
.status-form{display:grid;gap:16px}.status-target-head{display:flex;align-items:center;justify-content:space-between;gap:12px}.status-target-head>div{display:flex;flex-direction:column;gap:4px}.status-target-head small{color:#79827d}.status-all-branches{display:flex;align-items:center;gap:7px;border:1px solid #dfe8e2;background:#f7faf8;border-radius:10px;padding:8px 10px;font-size:11px;font-weight:800;color:#28513a}.status-all-branches input{accent-color:#176d49}
.status-account-tools{display:flex;gap:8px;margin-top:-6px}.status-accounts-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;max-height:280px;overflow:auto;padding:2px}.status-account-item{display:grid;grid-template-columns:auto 1fr auto;gap:9px;align-items:center;border:1px solid #e1e8e3;border-radius:13px;background:#fff;padding:10px;cursor:pointer;transition:.16s ease}.status-account-item:hover{border-color:#9fc4ad;box-shadow:0 5px 14px rgba(27,83,49,.06)}.status-account-item.selected{background:#eef8f1;border-color:#72a353}.status-account-item input{accent-color:#176d49}.status-account-meta{display:flex;flex-direction:column;min-width:0}.status-account-meta b{font-size:12px}.status-account-meta span{font-size:10px;color:#7b847f;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.status-account-state{border-radius:999px;padding:5px 7px;font-size:9px;font-weight:800;background:#f1f2f1;color:#7b817d}.status-account-state.connected{background:#dcf1e4;color:#146a46}
.status-text-field{display:grid;gap:7px}.status-text-field textarea{width:100%;resize:vertical;min-height:105px;border:1px solid #dce5df;border-radius:13px;padding:12px;background:#fbfcfb;outline:0;font-family:inherit}.status-text-field textarea:focus{border-color:#72a353;box-shadow:0 0 0 3px rgba(114,163,83,.1)}.status-text-field small,.status-options-grid small{color:#8a918d;font-size:10px}
.status-media-row{display:grid;gap:10px}.status-media-upload{display:flex;align-items:center;gap:12px;border:1px dashed #a9c4b2;background:#f8fbf9;border-radius:14px;padding:14px;cursor:pointer}.status-media-upload>span{display:grid;place-items:center;width:38px;height:38px;border-radius:11px;background:#e2f1e7;color:#176d49;font-size:24px}.status-media-upload>div{display:flex;flex-direction:column;gap:3px}.status-media-upload small{color:#818984}.status-media-preview{position:relative;display:grid;grid-template-columns:92px 1fr auto;gap:12px;align-items:center;border:1px solid #dce7df;border-radius:14px;padding:10px;background:#fff}.status-media-preview[hidden]{display:none}.status-media-preview img,.status-media-preview video{width:92px;height:92px;object-fit:cover;border-radius:10px;background:#f2f3f2}.status-media-preview>div{display:flex;flex-direction:column;gap:4px;min-width:0}.status-media-preview b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.status-media-preview small{color:#7e8782}.status-media-preview>button{border:0;background:#f1f2f1;border-radius:50%;width:28px;height:28px;font-size:18px;cursor:pointer}
.status-options-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.status-options-grid>label{display:grid;gap:7px}.status-options-grid input[type=datetime-local]{width:100%;border:1px solid #dce5df;border-radius:11px;padding:11px;background:#fff;outline:0}.status-color-line{display:flex;align-items:center;gap:10px}.status-color-line input[type=color]{width:48px;height:40px;border:1px solid #dce5df;border-radius:10px;background:#fff;padding:3px}.status-color-presets{display:flex;gap:6px;flex-wrap:wrap}.status-color-presets button{width:26px;height:26px;border-radius:50%;border:2px solid #fff;box-shadow:0 0 0 1px #d8dedb;cursor:pointer}.status-color-presets button:nth-child(1){background:#176d49}.status-color-presets button:nth-child(2){background:#72a353}.status-color-presets button:nth-child(3){background:#6a3f78}.status-color-presets button:nth-child(4){background:#1f5f99}.status-color-presets button:nth-child(5){background:#aa5b32}.status-color-presets button:nth-child(6){background:#262626}
.status-submit-row{display:flex;align-items:center;justify-content:space-between;gap:12px;border-top:1px solid #edf0ee;padding-top:14px}.status-submit-row>div{font-size:11px;color:#66706a}.status-submit-row .btn{min-width:150px}
.status-history{display:grid;gap:11px;max-height:720px;overflow:auto;padding:2px}.status-post-card{border:1px solid #e0e7e2;border-radius:14px;padding:12px;background:#fff;display:grid;gap:10px}.status-post-card-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}.status-post-title{display:flex;gap:9px;align-items:center;min-width:0}.status-post-icon{display:grid;place-items:center;width:38px;height:38px;border-radius:11px;background:#e8f4ec;color:#176d49;font-size:18px}.status-post-title>div{display:flex;flex-direction:column;min-width:0}.status-post-title b{font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.status-post-title span{font-size:10px;color:#7e8782}.status-post-state{border-radius:999px;padding:5px 8px;font-size:9px;font-weight:900;white-space:nowrap}.status-post-state.queued{background:#fff2d9;color:#93630b}.status-post-state.running{background:#e7effc;color:#315f9f}.status-post-state.done{background:#def2e5;color:#156944}.status-post-state.partial{background:#fff0dc;color:#995e11}.status-post-state.failed{background:#f8e1e1;color:#a33838}.status-post-preview{font-size:11px;color:#4d5851;background:#f8faf8;border-radius:10px;padding:9px;max-height:70px;overflow:hidden}.status-post-preview img,.status-post-preview video{width:100%;max-height:160px;object-fit:cover;border-radius:9px}.status-post-metrics{display:grid;grid-template-columns:repeat(3,1fr);gap:7px}.status-post-metrics div{display:flex;flex-direction:column;align-items:center;background:#f6f8f7;border-radius:9px;padding:8px}.status-post-metrics b{font-size:15px;color:#176d49}.status-post-metrics span{font-size:9px;color:#7d8580}.status-target-errors{display:grid;gap:5px}.status-target-error{font-size:10px;color:#934646;background:#fff4f4;border-radius:8px;padding:7px}.status-post-actions{display:flex;gap:7px;justify-content:flex-end}.status-post-actions button{border:0;border-radius:8px;padding:7px 9px;font-size:10px;cursor:pointer}.status-retry{background:#e7f2eb;color:#176d49}.status-delete{background:#f8e8e8;color:#a34040}
@media(max-width:1100px){.status-layout{grid-template-columns:1fr}.status-history{max-height:none}.status-accounts-list{grid-template-columns:1fr 1fr}}
@media(max-width:700px){.status-accounts-list,.status-options-grid{grid-template-columns:1fr}.status-submit-row,.status-target-head{align-items:stretch;flex-direction:column}.status-submit-row .btn{width:100%}}

/* v0.4.17 — employee status publishing, polished identity header, quick PIN lock and announcements */
.brand{
  display:flex!important;flex-direction:column!important;grid-template-columns:none!important;
  align-items:center!important;justify-content:center!important;text-align:center!important;
  gap:7px!important;padding:8px 8px 18px!important
}
.brand img{width:104px!important;height:62px!important;object-fit:contain!important}
.brand-copy{align-items:center!important;text-align:center!important;width:100%}
.brand-copy b{font-size:15px!important;color:#173726;line-height:1.35}
.brand-copy span{font-size:12px!important;font-weight:800;color:#34483c!important;margin-top:4px!important}
.brand-copy small{font-size:11px!important;color:#765094!important;margin-top:2px!important}
.brand-copy i{font-size:10px!important;color:#79817d!important;margin-top:5px!important;background:#f5f7f5;border-radius:999px;padding:5px 9px}
.lock-link{color:#315f4a!important}.lock-link:hover{background:#edf6f1!important;color:#176d49!important}

.announcement-bar{height:44px;display:flex;align-items:center;gap:10px;background:linear-gradient(90deg,#fff8dc,#fffdf3);border:1px solid #f0dfa3;border-radius:14px;padding:0 12px;margin-bottom:12px;box-shadow:0 5px 16px rgba(122,96,23,.07);overflow:hidden;color:#6b561b}
.announcement-bar[hidden]{display:none!important}.announcement-icon{flex:0 0 auto;font-size:18px}.announcement-window{min-width:0;flex:1;overflow:hidden;white-space:nowrap;direction:ltr}.announcement-text{display:inline-block;min-width:100%;padding-left:100%;direction:rtl;text-align:right;font-size:12px;font-weight:800;animation:announcementMove 24s linear infinite}.announcement-bar:hover .announcement-text{animation-play-state:paused}.announcement-bar>button{flex:0 0 auto;border:0;background:transparent;color:#8d793e;font-size:20px;width:28px;height:28px;border-radius:50%}.announcement-bar>button:hover{background:rgba(138,110,33,.09)}
@keyframes announcementMove{from{transform:translateX(0)}to{transform:translateX(-100%)}}
body.chat-page-open .announcement-bar{display:none!important}

.status-own-account-note{display:flex;align-items:center;gap:12px;padding:13px 14px;border:1px solid #cfe4d7;background:#eef8f2;border-radius:14px;color:#176d49}.status-own-account-note>span{display:grid;place-items:center;width:38px;height:38px;border-radius:50%;background:#d9efe2;font-size:18px}.status-own-account-note>div{display:flex;flex-direction:column;gap:3px}.status-own-account-note small{color:#60776a;font-size:10px}

.security-form,.announcement-form{display:grid;gap:12px}.security-form{grid-template-columns:repeat(3,minmax(0,1fr));align-items:end}.security-form label,.announcement-form label{display:grid;gap:7px}.security-form label>span,.announcement-form label>span{font-size:12px;font-weight:700;color:#53605a}.security-form input,.security-form select,.announcement-form textarea{width:100%;border:1px solid #dce5df;border-radius:11px;padding:11px 12px;background:#fff;outline:0}.security-form input:focus,.security-form select:focus,.announcement-form textarea:focus{border-color:#72a353;box-shadow:0 0 0 3px rgba(114,163,83,.1)}.remove-pin-option,.announcement-enable{display:flex!important;align-items:center!important;gap:8px!important;font-size:11px;color:#65706a}.remove-pin-option input,.announcement-enable input{width:18px!important;height:18px;accent-color:#176d49}.security-actions{display:flex;gap:9px;align-items:center;flex-wrap:wrap;grid-column:1/-1}.announcement-form textarea{resize:vertical;min-height:92px;font-family:inherit}

.lock-view{position:fixed;inset:0;z-index:1000;display:grid;place-items:center;padding:20px;background:radial-gradient(circle at 20% 15%,rgba(114,163,83,.2),transparent 30%),linear-gradient(145deg,#f3f8f1,#e8f1e5)}.lock-view[hidden]{display:none!important}.lock-card{width:min(420px,100%);background:#fff;border:1px solid #dce7da;border-radius:24px;padding:34px;text-align:center;box-shadow:0 24px 80px rgba(23,55,38,.18)}.lock-card>img{width:180px;height:72px;object-fit:contain;margin-bottom:10px}.lock-icon{display:grid;place-items:center;width:54px;height:54px;margin:4px auto 10px;border-radius:18px;background:#e7f3eb;font-size:26px}.lock-card h2{font-size:24px;color:#173726}.lock-card>p{margin:7px 0 20px;color:#758078}.lock-card form{display:grid;gap:11px}.lock-card input{width:180px;max-width:100%;margin:auto;text-align:center;direction:ltr;letter-spacing:14px;font-size:24px;border:1px solid #cbdacf;border-radius:13px;padding:12px 8px;outline:0}.lock-card input:focus{border-color:#18784f;box-shadow:0 0 0 4px rgba(24,120,79,.1)}.lock-card form .btn{width:180px;max-width:100%;margin:auto}.lock-logout{margin-top:16px;border:0;background:transparent;color:#a14a4a;font-size:12px}

@media(max-width:900px){.brand{flex-direction:row!important;text-align:right!important}.brand img{width:70px!important;height:50px!important}.brand-copy{align-items:flex-start!important;text-align:right!important}.announcement-bar{border-radius:10px}.security-form{grid-template-columns:1fr}}


/* v0.4.18 — live WhatsApp presence, Excel customer distribution and Almarai typography */
html,body,button,input,textarea,select{font-family:'Almarai',sans-serif}
.user-wa-state{display:inline-flex;align-items:center;gap:6px;font-weight:700}.user-wa-state:before{content:'';width:8px;height:8px;border-radius:50%;background:#aeb7b1}.user-wa-state.connected{color:#16754a}.user-wa-state.connected:before{background:#21a66a;box-shadow:0 0 0 4px rgba(33,166,106,.12)}.user-wa-state.pending{color:#a16c16}.user-wa-state.pending:before{background:#d69a33}.user-wa-state.offline{color:#8a938e}.users-list-card .settings-badge{white-space:nowrap}
.customer-import-layout{display:grid;grid-template-columns:minmax(0,1.08fr) minmax(360px,.92fr);gap:18px;align-items:start}.customer-import-card,.customer-distribution-card{min-height:520px}.import-branch-banner{display:grid;grid-template-columns:auto 1fr;gap:4px 12px;align-items:center;background:linear-gradient(135deg,#f3f8f4,#fbfdfb);border:1px solid #dfe9e2;border-radius:14px;padding:13px 15px;margin-bottom:16px}.import-branch-banner span{font-size:11px;color:#78827c}.import-branch-banner b{color:#176d49}.import-branch-banner small{grid-column:1/-1;color:#8a928e;font-size:10px}.customer-import-upload{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;align-items:stretch}.file-drop{position:relative;border:1.5px dashed #b9cdbf;border-radius:14px;background:#fafcfb;padding:18px;display:grid;gap:5px;cursor:pointer}.file-drop:hover{border-color:#72a353;background:#f6faf7}.file-drop input{position:absolute;inset:0;opacity:0;cursor:pointer}.file-drop span{font-size:11px;color:#6e7973}.file-drop b{font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.file-drop small{font-size:10px;color:#929994}.customer-import-preview{margin-top:16px;border:1px solid #e0e7e2;border-radius:14px;overflow:hidden}.customer-import-preview.empty{padding:34px;text-align:center;color:#89918c}.import-preview-summary{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;padding:12px;background:#f7faf8;border-bottom:1px solid #e7ece8}.import-preview-summary div{background:#fff;border:1px solid #e7ece9;border-radius:10px;padding:10px;text-align:center}.import-preview-summary b,.import-preview-summary span{display:block}.import-preview-summary b{font-size:20px;color:#176d49}.import-preview-summary .warn b{color:#b27a18}.import-preview-summary .danger b{color:#b65353}.import-preview-summary span{font-size:9px;color:#7f8883;margin-top:3px}.import-preview-list{max-height:260px;overflow:auto}.import-preview-row{display:grid;grid-template-columns:minmax(0,1fr) 145px 88px;gap:10px;align-items:center;padding:9px 12px;border-bottom:1px solid #edf1ee;font-size:11px}.import-preview-row:last-child{border-bottom:0}.import-preview-row span{direction:ltr;text-align:left;color:#64706a}.import-preview-row em{font-style:normal;color:#8a928e;text-align:left}.distribution-form{display:grid;gap:13px}.distribution-form>label{display:grid;gap:7px}.distribution-form>label>span{font-size:11px;font-weight:700;color:#59655e}.distribution-form select,.distribution-form input{width:100%;border:1px solid #dce5df;border-radius:11px;padding:11px 12px;background:#fff;outline:0}.distribution-form select:focus,.distribution-form input:focus{border-color:#72a353;box-shadow:0 0 0 3px rgba(114,163,83,.1)}.distribution-users-field{border:1px solid #e0e7e2;border-radius:13px;overflow:hidden}.distribution-users-head{display:flex;justify-content:space-between;align-items:center;padding:10px 12px;background:#f7faf8;border-bottom:1px solid #e6ece8}.distribution-users{max-height:245px;overflow:auto}.distribution-user{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:10px;padding:10px 12px;border-bottom:1px solid #edf1ee;cursor:pointer}.distribution-user:last-child{border-bottom:0}.distribution-user:hover{background:#fafcfb}.distribution-user input{width:18px;height:18px;accent-color:#176d49}.distribution-user b,.distribution-user small{display:block}.distribution-user small{font-size:9px;color:#808983;margin-top:3px}.distribution-user em{font-style:normal;font-size:10px;border-radius:999px;padding:5px 8px;background:#eef3ef;color:#68736c}.distribution-user em.connected{background:#e3f4e9;color:#16754a}.empty-state.compact{padding:24px}.customer-import-report{margin-top:16px;border:1px solid #dce7df;border-radius:14px;background:#f8fbf9;padding:14px}.import-report-title{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:11px}.import-report-title b{color:#176d49}.import-report-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}.import-report-grid div{background:#fff;border:1px solid #e5ebe7;border-radius:10px;padding:10px;text-align:center}.import-report-grid b,.import-report-grid span{display:block}.import-report-grid b{font-size:19px}.import-report-grid span{font-size:9px;color:#7d8781;margin-top:3px}.import-user-results{display:grid;gap:6px;margin-top:10px}.import-user-result{display:flex;justify-content:space-between;align-items:center;background:#fff;border:1px solid #e8ece9;border-radius:9px;padding:8px 10px;font-size:11px}.import-user-result b{color:#176d49}.customer-import-card .btn,.customer-distribution-card .btn{align-self:stretch}
@media(max-width:1050px){.customer-import-layout{grid-template-columns:1fr}.customer-import-card,.customer-distribution-card{min-height:0}}@media(max-width:680px){.customer-import-upload{grid-template-columns:1fr}.import-preview-summary{grid-template-columns:1fr 1fr}.import-preview-row{grid-template-columns:1fr 120px}.import-preview-row em{display:none}}


/* v0.4.19 — cross-branch chat account visibility and paced campaign batches */
.campaign-safety-note{margin-top:12px;padding:11px 14px;border:1px solid #e8dfb8;background:#fffaf0;border-radius:12px;color:#705d1f;font-size:12px;line-height:1.8}
.form label small{display:block;margin-top:5px;color:#8b93a1;font-size:10px;line-height:1.5}
.chat-account-field select optgroup{font-weight:800;color:#294c39}
.chat-account-field select option{font-weight:400;color:#222}


/* v0.4.20 — isolate login from the authenticated dashboard */
body.auth-screen{overflow:hidden!important;background:#f3f7f2}
body.auth-screen #appView,body.auth-screen #lockView{display:none!important}
body.auth-screen #loginView{display:grid!important;position:fixed;inset:0;width:100%;height:100dvh;z-index:5000;overflow:auto}
body:not(.auth-screen) #loginView{display:none!important}
body.session-locked #appView,body.session-locked #loginView{display:none!important}
body.session-locked #lockView{display:grid!important}
