:root{--green:#16b86f;--green2:#0b7c4e;--green3:#e9fbf2;--bg:#f5f8fb;--card:#fff;--text:#102033;--muted:#7b8ba3;--line:#e8eef3;--danger:#ef4444;--warn:#f59e0b;--shadow:0 16px 45px rgba(16,32,51,.08)}
*{box-sizing:border-box}body{margin:0;background:var(--bg);font-family:Inter,system-ui,-apple-system,Segoe UI,Arial,sans-serif;color:var(--text)}button,input,select,textarea{font:inherit}a{text-decoration:none}.hidden{display:none!important}.mobile-only{display:none!important}.toast{position:fixed;right:24px;top:24px;background:#111827;color:#fff;padding:13px 18px;border-radius:14px;box-shadow:var(--shadow);z-index:50;opacity:0;transform:translateY(-12px);transition:.2s}.toast.show{opacity:1;transform:none}.auth-screen{min-height:100vh;display:grid;place-items:center;background:radial-gradient(circle at top left,#e7fff3,transparent 42%),linear-gradient(135deg,#0a7a4f,#19c577)}.auth-card{width:min(440px,92vw);background:#fff;padding:34px;border-radius:30px;box-shadow:0 35px 95px rgba(0,0,0,.2)}.brand-row{display:flex;align-items:center;gap:14px}.brand-row.center{justify-content:center}.brand-row h1{font-size:26px;line-height:1;margin:0;font-weight:900;letter-spacing:-.6px}.brand-row p{margin:4px 0 0;color:var(--muted);font-weight:600}.brand-mark{width:60px;height:60px;border-radius:18px;background:linear-gradient(135deg,var(--green),var(--green2));display:grid;place-items:center;color:#fff;font-weight:900;overflow:hidden;box-shadow:0 12px 28px rgba(22,184,111,.28)}.brand-mark:before{content:'CRM';font-size:13px;letter-spacing:.8px}.brand-mark img{width:100%;height:100%;object-fit:cover}.auth-copy{text-align:center;margin:26px 0}.auth-copy h2{font-size:28px;margin:15px 0 8px;letter-spacing:-.8px}.auth-copy p{margin:0;color:var(--muted);line-height:1.55}.pill{display:inline-flex;align-items:center;gap:5px;border-radius:999px;padding:5px 11px;font-size:12px;font-weight:800}.pill.green{background:var(--green3);color:var(--green2)}.pill.gray{background:#eef2f7;color:#566579}.pill.warn{background:#fff7e6;color:#b46900}.form-stack{display:flex;flex-direction:column;gap:14px}.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.form-grid .wide,.wide{grid-column:1/-1}label span{display:block;font-size:12px;text-transform:uppercase;letter-spacing:.55px;color:var(--muted);font-weight:900;margin-bottom:7px}input,select,textarea{width:100%;border:1.5px solid var(--line);background:#f9fbfd;border-radius:14px;padding:12px 14px;outline:none;color:var(--text);transition:.16s}input:focus,select:focus,textarea:focus{border-color:var(--green);background:#fff;box-shadow:0 0 0 4px rgba(22,184,111,.1)}textarea{resize:vertical}.btn{border:0;border-radius:14px;padding:12px 17px;font-weight:900;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;gap:8px;transition:.18s}.btn:hover{transform:translateY(-1px)}.btn.primary{background:linear-gradient(135deg,var(--green),var(--green2));color:#fff}.btn.soft{background:#edf7f2;color:var(--green2)}.btn.ghost{background:#f2f5f8;color:#334155}.btn.danger{background:#fee2e2;color:#b91c1c}.btn.wide,.wide{width:100%}.notice{background:#fff7ed;color:#9a3412;border:1px solid #fed7aa;border-radius:16px;padding:12px;font-size:13px;font-weight:700}.app-shell{min-height:100vh;display:flex}.sidebar{width:285px;background:linear-gradient(180deg,#0c7b4e,#075b3a);color:#fff;display:flex;flex-direction:column;min-height:100vh;position:sticky;top:0}.sidebar-head{padding:20px 18px;border-bottom:1px solid rgba(255,255,255,.12);display:flex;justify-content:space-between;align-items:center}.sidebar .brand-row p,.sidebar .brand-row h1{color:#fff}.sidebar .brand-mark{background:rgba(255,255,255,.16);box-shadow:none}.nav{padding:14px 10px;flex:1;overflow:auto}.nav-item{width:100%;display:flex;align-items:center;gap:12px;border:0;background:transparent;color:rgba(255,255,255,.78);padding:13px 14px;border-radius:15px;cursor:pointer;text-align:left;margin-bottom:5px}.nav-item b{flex:1}.nav-item span{width:20px;text-align:center}.nav-item:hover,.nav-item.active{background:rgba(255,255,255,.14);color:#fff}.nav-item i{background:#ef4444;color:#fff;border-radius:999px;font-size:11px;padding:2px 7px;font-style:normal}.sidebar-foot{padding:16px;border-top:1px solid rgba(255,255,255,.12)}.mini-profile{display:flex;align-items:center;gap:11px;margin-bottom:12px}.avatar{width:40px;height:40px;border-radius:50%;display:grid;place-items:center;background:#dff7ec;color:var(--green2);font-weight:900;overflow:hidden;flex-shrink:0}.avatar img{width:100%;height:100%;object-fit:cover}.mini-profile b{display:block}.mini-profile span{font-size:12px;color:rgba(255,255,255,.72)}.main{flex:1;min-width:0}.topbar{height:82px;background:#fff;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 26px;position:sticky;top:0;z-index:15}.topbar h2{margin:0;font-size:24px;letter-spacing:-.55px}.topbar p{margin:4px 0 0;color:var(--muted);font-size:13px}.top-actions{display:flex;gap:10px}.workspace{padding:26px}.page{display:none}.page.active{display:block}.hero{background:linear-gradient(135deg,#fff,#f1fff7);border:1px solid var(--line);border-radius:28px;padding:26px;box-shadow:var(--shadow);margin-bottom:20px}.hero h3{font-size:30px;margin:12px 0 8px;letter-spacing:-1px}.hero p{color:var(--muted);margin:0;max-width:820px;line-height:1.55}.stats-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin-bottom:20px}.stats-grid article,.panel{background:#fff;border:1px solid var(--line);border-radius:24px;box-shadow:var(--shadow)}.stats-grid article{padding:21px}.stats-grid span{color:var(--muted);font-size:13px;font-weight:800}.stats-grid b{display:block;font-size:30px;margin:8px 0 3px}.stats-grid small{color:var(--muted)}.panel{padding:22px;margin-bottom:18px}.panel.mini{box-shadow:none;background:#fafdfb;border-style:dashed}.panel.narrow{max-width:720px}.panel-head{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:18px}.panel-head h3{margin:0;font-size:19px;letter-spacing:-.3px}.split.two{display:grid;grid-template-columns:minmax(320px,.95fr) minmax(360px,1.05fr);gap:18px}.list{display:flex;flex-direction:column;gap:10px}.list.empty,.empty{color:var(--muted);font-weight:700}.list-item{border:1px solid var(--line);border-radius:18px;padding:15px;display:flex;justify-content:space-between;gap:12px;align-items:center}.list-item b{display:block}.list-item span{display:block;color:var(--muted);font-size:13px;margin-top:3px}.table-wrap{overflow:auto}.data-table{width:100%;border-collapse:collapse}.data-table th,.data-table td{padding:13px;border-bottom:1px solid var(--line);text-align:left;font-size:14px}.data-table th{font-size:12px;text-transform:uppercase;color:var(--muted)}.quick-cards{display:grid;grid-template-columns:repeat(3,1fr);gap:14px}.quick-cards button{border:1px solid var(--line);background:#f8fffb;border-radius:18px;padding:22px;font-weight:900;color:var(--green2);cursor:pointer}.inbox{display:grid;grid-template-columns:310px 1fr;min-height:calc(100vh - 140px);background:#fff;border:1px solid var(--line);border-radius:26px;overflow:hidden;box-shadow:var(--shadow)}.chat-list{border-right:1px solid var(--line);display:flex;flex-direction:column;min-width:0}.search{padding:14px;display:flex;gap:8px;border-bottom:1px solid var(--line)}.search button{border:0;border-radius:12px;padding:0 12px;background:#eef8f2}.chat-list-inner{overflow:auto;flex:1}.chat-row{display:flex;align-items:center;gap:11px;padding:14px;border-bottom:1px solid var(--line);cursor:pointer}.chat-row.active,.chat-row:hover{background:#f0fbf5}.chat-row b{display:block}.chat-row p{margin:3px 0 0;color:var(--muted);font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:170px}.chat-box{display:flex;flex-direction:column;min-width:0}.chat-head{height:72px;border-bottom:1px solid var(--line);display:flex;align-items:center;gap:12px;padding:0 18px}.chat-head span{display:block;color:var(--muted);font-size:13px;margin-top:3px}.chat-messages{flex:1;overflow:auto;padding:20px;background:#f9fcfa}.msg{max-width:76%;margin:0 0 12px;padding:12px 15px;border-radius:18px;white-space:pre-wrap}.msg.in{background:#fff;border:1px solid var(--line);border-bottom-left-radius:5px}.msg.out{background:var(--green);color:#fff;margin-left:auto;border-bottom-right-radius:5px}.msg small{display:block;margin-top:6px;font-size:11px;opacity:.7}.reply{display:flex;gap:10px;padding:14px;border-top:1px solid var(--line)}.row{display:flex;gap:10px;flex-wrap:wrap;margin-top:12px}.image-preview{border:1px dashed var(--line);border-radius:18px;padding:10px;min-height:74px;background:#fbfdfc}.image-preview img{max-width:100%;max-height:170px;border-radius:14px;display:block}.tpl-button-row{display:grid;grid-template-columns:140px 1fr 1fr auto;gap:10px;margin-bottom:10px}.flow{display:flex;gap:14px;align-items:center;flex-wrap:wrap}.flow div{background:#f1fbf6;border:1px solid #cdeedd;border-radius:18px;padding:20px;font-weight:900}.flow span{color:var(--green2);font-size:26px}hr{border:0;border-top:1px solid var(--line);margin:20px 0}.icon-btn{border:0;border-radius:13px;background:#edf7f2;color:var(--green2);width:43px;height:43px;font-weight:900;cursor:pointer}
@media (max-width:1100px){.stats-grid{grid-template-columns:repeat(2,1fr)}.split.two{grid-template-columns:1fr}.inbox{grid-template-columns:260px 1fr}.top-actions{display:none}}
@media (max-width:760px){.mobile-only{display:inline-grid!important}.sidebar{position:fixed;z-index:30;inset:0 auto 0 0;transform:translateX(-102%);transition:.22s;width:min(305px,90vw)}.sidebar.open{transform:none}.topbar{padding:0 15px}.workspace{padding:14px}.stats-grid{grid-template-columns:1fr}.inbox{grid-template-columns:1fr}.chat-list{height:260px;border-right:0;border-bottom:1px solid var(--line)}.form-grid{grid-template-columns:1fr}.tpl-button-row{grid-template-columns:1fr}.quick-cards{grid-template-columns:1fr}.hero h3{font-size:24px}.auth-card{padding:24px}}


/* UI fixes requested: clean login, no top sidebar brand, bottom profile only, plain menu icons */
.auth-card.clean-login{padding-top:38px}
.auth-copy.login-only{margin:0 0 26px;text-align:center}
.auth-copy.login-only h2{margin:0 0 10px;font-size:30px;letter-spacing:-.9px}
.auth-copy.login-only p{font-size:14px;min-height:22px}
.sidebar-head.compact{padding:10px 14px;border-bottom:0;min-height:48px;justify-content:flex-end}
.sidebar-head.compact:empty{display:none}
.sidebar-foot{padding:18px 16px 20px;margin-top:auto;background:rgba(0,0,0,.08)}
.mini-profile{background:rgba(255,255,255,.10);border-radius:18px;padding:12px;margin-bottom:12px}
.mini-profile b{font-size:15px;line-height:1.2;text-transform:uppercase;letter-spacing:.2px}
.mini-profile span{font-size:12px;color:rgba(255,255,255,.78)}
.icon-btn.menu-toggle,.icon-btn.close-toggle{background:transparent!important;border:0!important;box-shadow:none!important;color:var(--green2);width:auto;height:auto;border-radius:0;padding:6px;display:inline-flex!important;align-items:center;justify-content:center;transform:none!important}
.icon-btn.menu-toggle span{display:block;width:24px;height:3px;background:var(--green2);border-radius:999px;margin:3px 0}
.icon-btn.menu-toggle{flex-direction:column;gap:0}
.icon-btn.close-toggle{font-size:36px;line-height:1;color:#fff;padding:6px 8px;margin-left:auto}
.icon-btn.menu-toggle:hover,.icon-btn.close-toggle:hover{transform:none!important;opacity:.75}
@media (min-width:761px){.sidebar-head.compact{display:none}}
@media (max-width:760px){.sidebar-head.compact{display:flex}.topbar .menu-toggle{margin-right:2px}.topbar{gap:10px;justify-content:flex-start}.topbar>div{flex:1}.sidebar{padding-top:0}.nav{padding-top:4px}}

/* v4 requested fixes: top profile, desktop menu hidden, template preview, clickable chatbot, restore UI */
.sidebar-profile-top{padding:18px 16px 12px;border-bottom:1px solid rgba(255,255,255,.12)}
.sidebar-profile-top .mini-profile{background:rgba(255,255,255,.12);border-radius:18px;padding:12px;margin:0}
.sidebar-foot.logout-only{margin-top:auto;padding:16px;background:rgba(0,0,0,.08);border-top:1px solid rgba(255,255,255,.12)}
.sidebar-foot.logout-only .btn{margin:0}.nav{padding-top:12px}
@media (min-width:761px){.topbar .menu-toggle{display:none!important}.sidebar-head.compact{display:none!important}.main{margin-left:0}}
@media (max-width:760px){.topbar .menu-toggle{display:inline-flex!important}.sidebar-profile-top{padding-top:10px}.icon-btn.close-toggle{font-size:42px!important}}
.inline-check{display:flex;align-items:center;gap:10px;font-weight:800;color:var(--green2);margin:10px 0}.inline-check input{width:auto;box-shadow:none!important}
.wa-preview{background:#f4fff8;border:1px solid var(--line);border-radius:22px;padding:18px;min-height:220px}.wa-card{background:#fff;border:1px solid #dbe9e1;border-radius:20px;padding:14px;max-width:420px;box-shadow:0 10px 25px rgba(0,0,0,.06)}.wa-card>b{display:block;margin-bottom:8px;color:#0f172a}.wa-card img{display:block;width:100%;max-height:210px;object-fit:cover;border-radius:16px;margin-bottom:10px}.wa-card p{white-space:pre-wrap;line-height:1.55;margin:0 0 10px}.wa-card small{color:var(--muted)}.wa-buttons{display:flex;flex-direction:column;gap:8px;margin-top:12px}.wa-buttons button{border:1px solid #cfeede;background:#edfdf5;color:var(--green2);border-radius:12px;padding:10px;font-weight:900}.flow.editable{align-items:stretch;padding:8px 0}.flow.editable .flow-node{background:#f1fbf6;border:1px solid #cdeedd;border-radius:18px;padding:18px 20px;font-weight:900;color:var(--text);cursor:pointer;text-align:left;min-width:150px}.flow.editable .flow-node small{display:block;color:var(--muted);font-size:12px;margin-top:5px}.flow.editable .flow-node.active,.flow.editable .flow-node:hover{background:linear-gradient(135deg,var(--green),var(--green2));color:#fff}.flow.editable .flow-node.active small,.flow.editable .flow-node:hover small{color:rgba(255,255,255,.78)}
@media (max-width:760px){.wa-card{max-width:100%}.flow.editable{flex-direction:column}.flow.editable span{display:none}}
/* v5 fixes */
.list-item .row{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.clickable-reports article,.report-card{cursor:pointer;transition:transform .15s ease, box-shadow .15s ease, border-color .15s ease}
.clickable-reports article:hover,.report-card:hover{transform:translateY(-2px);box-shadow:0 14px 34px rgba(0,0,0,.10)}
.report-card.active{border-color:#22c55e;box-shadow:0 0 0 2px rgba(34,197,94,.16),0 14px 34px rgba(0,0,0,.08)}
#clientsList .list-item{align-items:flex-start}
#templatesList .list-item{align-items:center}
@media(min-width:900px){.mobile-only{display:none!important}}

/* v6 WATI/AiSensy style status pills and diagnostics */
.pill.approved{background:#dcfce7;color:#15803d}.pill.rejected{background:#fee2e2;color:#b91c1c}.pill.pending{background:#fef3c7;color:#b45309}.notice.small{font-size:12px;margin-top:12px}.notice.small b{background:#fff;padding:2px 6px;border-radius:8px}.data-table td .pill{white-space:nowrap}.webhook-ok{color:#15803d}.webhook-bad{color:#b91c1c}

/* v7 fixes */
.dashboard-clicks article{cursor:pointer;transition:transform .15s ease,box-shadow .15s ease,border-color .15s ease}.dashboard-clicks article:hover{transform:translateY(-2px);border-color:#16a34a;box-shadow:0 14px 30px rgba(0,0,0,.08)}
.meta-status-note{display:flex;align-items:center;gap:10px;flex-wrap:wrap;background:#f8fafc;border:1px solid #e2e8f0;border-radius:14px;padding:12px 14px}.meta-status-note small{color:#64748b;font-weight:600}.pill.approved{background:#dcfce7;color:#15803d}.pill.rejected{background:#fee2e2;color:#b91c1c}.pill.pending{background:#fef3c7;color:#b45309}.pill.gray{background:#f1f5f9;color:#475569}
.btn.tiny{padding:6px 10px;font-size:12px;border-radius:10px}
.webhook-url-box{background:#f0fdf4;border:1px solid #bbf7d0;border-radius:12px;padding:10px;font-size:12px;word-break:break-all;color:#065f46}

/* v10 live inbox + broadcast fixes */
.template-send-bar{display:flex;gap:10px;padding:12px 14px;border-top:1px solid var(--line);background:#fbfefd}.template-send-bar select{flex:1}.contact-picker{max-height:310px;overflow:auto;display:grid;gap:8px}.contact-check{display:flex;align-items:center;gap:10px;border:1px solid var(--line);border-radius:14px;padding:10px;background:#fff}.contact-check input{width:auto}.contact-check b{display:block}.contact-check small{display:block;color:var(--muted);font-size:12px;margin-top:3px}.campaign-status{white-space:nowrap}.broadcast-note{font-size:12px;color:var(--muted);font-weight:700}.template-send-bar .btn{white-space:nowrap}@media(max-width:760px){.template-send-bar{flex-direction:column}}
.product-row{display:flex;gap:12px;align-items:center}.product-row img{width:62px;height:62px;object-fit:cover;border-radius:12px;border:1px solid var(--border,#e5e7eb)}.commerce-send-bar{border-bottom:1px solid var(--border,#e5e7eb)}.small{font-size:12px}.tiny{padding:6px 10px;font-size:12px}.product-card .row{flex-wrap:nowrap}
.bulk-box{border:1px dashed #c9d8cf;background:#f8fffb;border-radius:14px;padding:14px;margin:12px 0 16px}
.bulk-box b{display:block;margin-bottom:4px;color:#087344}
.bulk-box input[type=file]{width:100%;background:#fff;border:1px solid #dfe7e2;border-radius:10px;padding:10px;margin:8px 0 10px}

/* v17 World No.1 UI/UX Design System — UI-only safe redesign */
:root{
  --green:#25D366;--green2:#128C4A;--green3:#E8F9EF;
  --blue:#0071E3;--blueTint:#E5F0FF;
  --orange:#FF9500;--orangeTint:#FFF3E0;
  --purple:#AF52DE;--purpleTint:#F5E8FF;
  --danger:#FF3B30;--redTint:#FFEEEE;
  --bg:#F2F2F7;--card:#FFFFFF;--input:#F9F9FB;
  --text:#1C1C1E;--muted:#8E8E93;--tertiary:#C7C7CC;
  --line:rgba(0,0,0,.06);--line2:rgba(0,0,0,.10);--shadow:none;
}

/* v38 final overrides */
@media (min-width:901px){
  .sidebar{position:sticky!important;top:0!important;height:100vh!important;padding-bottom:74px!important;}
  .sidebar-foot.logout-only{position:absolute!important;left:8px!important;right:8px!important;bottom:12px!important;padding:0!important;border-top:0!important;cursor:pointer!important;background:transparent!important;}
  .sidebar-foot.logout-only:after{content:'↪'!important;display:grid!important;place-items:center!important;width:52px!important;height:52px!important;border-radius:18px!important;background:#e8f9ef!important;color:#ff3b30!important;font-size:30px!important;font-weight:900!important;box-shadow:0 8px 22px rgba(0,0,0,.18)!important;}
  .sidebar-foot.logout-only:hover:after{background:#25d366!important;color:#fff!important;transform:translateY(-1px)!important;}
}

/* v39 dashboard order table + sticky logout */
#clientDashboardWidgets > .dashboard-widget-row.wide-layout:nth-of-type(3){display:none!important}
.dash-orders-widget{overflow:hidden}
.dash-orders-table-wrap{max-height:390px;overflow:auto}
.dash-orders-table td,.dash-orders-table th{vertical-align:middle}
.dash-orders-table .btn{white-space:normal;line-height:1.25;min-width:96px}
@media (min-width:901px){
  .sidebar{height:100vh!important;min-height:100vh!important;position:sticky!important;top:0!important;}
  .sidebar-foot.logout-only{position:sticky!important;bottom:12px!important;margin-top:auto!important;padding:8px!important;background:#1c1c1e!important;z-index:80!important;}
  .sidebar-foot.logout-only:after{display:none!important}
  .sidebar-foot.logout-only .btn{display:flex!important;width:52px!important;height:52px!important;min-height:52px!important;padding:0!important;border-radius:18px!important;background:#e8f9ef!important;color:#ff3b30!important;font-size:0!important;box-shadow:0 8px 22px rgba(0,0,0,.18)!important;}
  .sidebar-foot.logout-only .btn .logout-icon{display:grid!important;place-items:center!important;font-size:15px!important;font-weight:900!important;color:#ff3b30!important;line-height:1!important;}
  .sidebar-foot.logout-only .btn b{display:none!important}
  .sidebar-foot.logout-only .btn:hover{background:#25d366!important}
  .sidebar-foot.logout-only .btn:hover .logout-icon{color:#fff!important}
}

/* v38 logout, order dashboard, close chat */
@media (min-width:901px){
  .sidebar{position:sticky!important;top:0!important;height:100vh!important;padding-bottom:74px!important;}
  .sidebar-foot.logout-only{position:absolute!important;left:8px!important;right:8px!important;bottom:12px!important;padding:0!important;border-top:0!important;cursor:pointer!important;}
  .sidebar-foot.logout-only:after{content:'↪'!important;width:52px!important;height:52px!important;border-radius:18px!important;background:#e8f9ef!important;color:#ff3b30!important;font-size:30px!important;font-weight:900!important;box-shadow:0 8px 22px rgba(0,0,0,.18)!important;}
  .sidebar-foot.logout-only:hover:after{background:#25d366!important;color:#fff!important;transform:translateY(-1px)!important;}
  .nav{padding-bottom:18px!important;}
}
.chat-head{position:relative}
.chat-head-actions{margin-left:auto;display:flex;align-items:center;gap:8px}
.close-chat-btn{white-space:nowrap;color:#c21f16!important;background:#ffeeee!important;border:1px solid rgba(255,59,48,.16)!important}
.dash-orders-list{display:flex;flex-direction:column;gap:8px}
.dash-order-item{display:flex;align-items:center;justify-content:space-between;gap:12px;border:1px solid rgba(0,0,0,.06);border-radius:14px;padding:12px;background:#fff}
.dash-order-item b{display:block;font-size:14px;font-weight:600}
.dash-order-item small{display:block;margin-top:4px;color:var(--muted)}
.dash-order-pages{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px}
*{box-sizing:border-box}
body{background:var(--bg)!important;font-family:-apple-system,BlinkMacSystemFont,"SF Pro Display","SF Pro Text","Segoe UI",Roboto,sans-serif!important;color:var(--text);font-weight:400;letter-spacing:-.01em}
a{color:var(--blue)}
.auth-screen{background:var(--bg)!important}.auth-card{border:1px solid var(--line);border-radius:24px;box-shadow:none!important}.auth-copy h2{font-weight:600!important;color:var(--text)}
.app-shell{background:var(--bg)}
.sidebar{background:#1C1C1E!important;background-image:none!important;box-shadow:none;border-right:0;transition:width .18s ease,transform .22s ease}
.sidebar-profile-top{border-bottom:1px solid rgba(255,255,255,.08)}
.sidebar-profile-top .mini-profile{background:transparent!important;border-radius:0;padding:0;margin:0;justify-content:center}
.avatar{background:#E8F9EF;color:#128C4A;font-weight:600;border-radius:50%}
.nav{padding:12px 10px}.nav-item{position:relative;color:#636366!important;background:transparent!important;border-radius:12px;font-weight:500;transition:all 150ms ease}.nav-item span{font-size:19px}.nav-item b{font-weight:500}.nav-item:hover,.nav-item.active{background:#2C2C2E!important;color:#EBEBF5!important}.nav-item.active{color:#fff!important}.nav-item.active:before{content:"";position:absolute;left:-10px;top:9px;width:3px;height:26px;background:var(--green);border-radius:0 3px 3px 0}.nav-item i{background:var(--danger);color:#fff;min-width:18px;height:18px;padding:0 5px;display:grid;place-items:center;font-size:10px}
.sidebar-foot.logout-only{background:transparent;border-top:1px solid rgba(255,255,255,.08)}
.topbar{height:52px!important;background:rgba(255,255,255,.9)!important;backdrop-filter:blur(20px);border-bottom:1px solid rgba(0,0,0,.05);padding:0 24px;box-shadow:none}.topbar h2{font-size:17px;font-weight:600;letter-spacing:-.35px;color:var(--text)}.topbar p{font-size:12px;color:var(--muted);margin-top:1px}.top-actions .btn{height:36px;border-radius:12px;padding:0 14px}.top-actions .btn:last-child{background:#1C1C1E;color:#fff}
.workspace{padding:24px;max-width:none}.hero,.panel,.stats-grid article{background:var(--card)!important;background-image:none!important;border:1px solid var(--line)!important;border-radius:16px!important;box-shadow:none!important}.panel{padding:20px}.panel-head{padding:0 0 12px;margin-bottom:16px;border-bottom:1px solid rgba(0,0,0,.05)}.panel-head h3{font-size:14px;font-weight:600;letter-spacing:-.2px;color:var(--text)}
.greeting-strip{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:0!important;margin:0 0 16px!important;background:transparent!important;border:0!important}.greeting-strip h3{font-size:22px!important;font-weight:600!important;letter-spacing:-.5px;margin:5px 0 3px!important}.greeting-strip p{font-size:13px;color:var(--muted)}.micro-label,label span{font-size:11px!important;font-weight:500!important;letter-spacing:.04em!important;text-transform:uppercase!important;color:var(--muted)!important}.connected-pill{display:inline-flex;align-items:center;gap:7px;background:#fff;border:1px solid rgba(0,0,0,.07);border-radius:999px;padding:7px 12px;color:var(--green2);font-size:12px;font-weight:500;white-space:nowrap}.connected-pill i{width:7px;height:7px;border-radius:50%;background:var(--green);display:block}
.stats-grid{gap:10px;margin-bottom:16px}.premium-stat,.stats-grid article{position:relative;overflow:hidden;padding:20px 20px 16px!important;transition:all 160ms ease}.premium-stat:hover,.stats-grid article:hover{transform:translateY(-2px);border-color:rgba(0,0,0,.12)!important}.stats-grid article:after{content:"";position:absolute;left:0;right:0;bottom:0;height:2px;background:var(--green)}.stats-grid article:nth-child(2):after{background:var(--blue)}.stats-grid article:nth-child(3):after{background:var(--orange)}.stats-grid article:nth-child(4):after{background:var(--purple)}.stats-grid span{font-size:11px!important;font-weight:500!important;letter-spacing:.04em;text-transform:uppercase;color:var(--muted)!important}.stats-grid b{font-size:42px!important;font-weight:200!important;letter-spacing:-.04em;color:var(--text);line-height:1.05;margin:10px 0 4px}.stats-grid article.is-zero b{color:var(--tertiary)}.stats-grid small,.stat-link{font-size:12px!important;font-weight:400!important;color:var(--blue)!important}.stats-grid article.is-zero small:before{content:"Set up first → ";color:inherit}.btn{border-radius:12px!important;font-weight:600!important;box-shadow:none!important;transition:transform 120ms ease,background 150ms ease,border-color 150ms ease}.btn:active{transform:scale(.97)}.btn:hover{transform:translateY(-1px)}.btn.primary{background:#1C1C1E!important;color:#fff!important}.btn.soft{background:#F9F9FB!important;border:1px solid rgba(0,0,0,.05)!important;color:var(--text)!important}.btn.ghost{background:#F2F2F7!important;color:var(--text)!important}.btn.danger{background:#FFEEEE!important;color:#C21F16!important}
input,select,textarea{background:var(--input)!important;border:1px solid rgba(0,0,0,.10)!important;border-radius:14px!important;color:var(--text);padding:12px 14px;transition:border-color 160ms ease,background 160ms ease}input:focus,select:focus,textarea:focus{border-color:var(--blue)!important;background:#fff!important;box-shadow:none!important}.notice{border-radius:14px;border:1px solid rgba(255,149,0,.22);background:#FFF3E0;color:#8C4A00}.pill{font-weight:500!important}.pill.green{background:var(--green3)!important;color:var(--green2)!important}.pill.gray{background:#F2F2F7!important;color:#636366!important}.pill.warn{background:var(--orangeTint)!important;color:#A45A00!important}.pill.approved{background:var(--green3)!important;color:var(--green2)!important}.pill.rejected{background:var(--redTint)!important;color:#C21F16!important}.pill.pending{background:var(--orangeTint)!important;color:#A45A00!important}
.list-item{border:0;border-radius:14px;border-bottom:1px solid rgba(0,0,0,.05);background:transparent;padding:12px 10px;transition:background 130ms ease}.list-item:hover{background:#F9F9FB}.data-table{border-collapse:separate;border-spacing:0}.data-table th,.data-table td{border-bottom:1px solid rgba(0,0,0,.05)!important}.data-table th{font-size:11px!important;font-weight:500!important;letter-spacing:.04em;color:var(--muted)!important}.data-table tr:hover td{background:#F9F9FB}
.quick-cards{gap:10px}.quick-cards button{background:#F9F9FB!important;border:1px solid rgba(0,0,0,.05)!important;border-radius:12px!important;color:var(--text)!important;transition:all 150ms ease}.quick-cards button:hover{background:#F2F2F7!important;border-color:rgba(0,0,0,.12)!important}
.inbox{display:grid;grid-template-columns:260px minmax(320px,1fr) 300px!important;min-height:calc(100vh - 100px);border-radius:16px!important;border:1px solid var(--line)!important;box-shadow:none!important;background:#fff;overflow:hidden}.chat-list{border-right:1px solid rgba(0,0,0,.05)}.search{padding:12px;border-bottom:1px solid rgba(0,0,0,.05);background:#fff}.chat-row{height:60px;padding:10px 16px;border-bottom:0;transition:background 130ms ease;position:relative}.chat-row:hover,.chat-row.active{background:#F9F9FB!important}.chat-row .avatar{width:40px;height:40px}.chat-row b{font-size:14px;font-weight:500;color:var(--text)}.chat-row p{font-size:12px;color:var(--muted)}.chat-head{height:60px;border-bottom:1px solid rgba(0,0,0,.05);padding:0 16px}.chat-messages{background:#fff;padding:20px}.msg{border-radius:18px;padding:10px 13px;font-size:14px;line-height:1.45}.msg.in{background:#F2F2F7!important;border:0!important;border-bottom-left-radius:4px}.msg.out{background:#DCF8E8!important;color:#1C1C1E!important;border-bottom-right-radius:4px}.reply{padding:10px 12px;background:#fff}.reply input{height:52px;border-radius:999px!important}.template-send-bar{background:#fff;border-top:1px solid rgba(0,0,0,.05);border-bottom:0!important}.contact-detail-panel{border-left:1px solid rgba(0,0,0,.05);background:#fff;padding:18px;overflow:auto}.detail-avatar{width:56px;height:56px;margin:14px 0 10px}.contact-detail-panel h3{margin:0 0 4px;font-size:18px;font-weight:600}.detail-actions{display:grid;gap:8px;margin-top:16px}.workspace-health{display:grid;gap:12px}.workspace-health div{display:flex;justify-content:space-between;align-items:center;font-size:12px;color:var(--muted)}.workspace-health b{color:var(--text);font-weight:500}.step-indicator{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 16px}.step-indicator span{border-radius:999px;background:#F2F2F7;color:var(--muted);font-size:12px;font-weight:500;padding:8px 12px}.step-indicator .done{background:var(--green3);color:var(--green2)}.step-indicator .current{background:#1C1C1E;color:#fff}
.flow.editable{gap:12px;align-items:center;max-height:480px;overflow:auto;padding:4px}.flow.editable .flow-node{background:#fff!important;border:1px solid rgba(0,0,0,.06)!important;border-radius:16px!important;min-width:160px;padding:16px;box-shadow:none;color:var(--text);transition:all 160ms ease}.flow.editable .flow-node:hover,.flow.editable .flow-node.active{background:#F9F9FB!important;border-color:rgba(0,0,0,.12)!important;color:var(--text);transform:translateY(-2px)}.flow.editable .flow-node b{font-size:14px;font-weight:600}.flow.editable .flow-node small{color:var(--muted)!important;font-weight:400}.flow.editable span{color:var(--green);font-size:22px}.bulk-box{border:1px dashed rgba(0,0,0,.12)!important;background:#F9F9FB!important;border-radius:16px!important}.empty-state{text-align:center;padding:44px 20px;border:1px dashed rgba(0,0,0,.12);border-radius:16px;background:#F9F9FB}.empty-state b{display:block;font-size:18px;font-weight:600;color:var(--text);margin-bottom:6px}.empty-state p{margin:0 0 16px;color:var(--muted)}.automation-rule-card span{display:block;margin-top:4px;color:var(--muted);font-size:13px}
.product-row img{border-radius:12px;border:1px solid rgba(0,0,0,.06)}.wa-preview{background:#F9F9FB;border:1px solid rgba(0,0,0,.06);border-radius:16px}.wa-card{box-shadow:none;border:1px solid rgba(0,0,0,.06);border-radius:16px}.webhook-url-box{background:#F9F9FB;border:1px solid rgba(0,0,0,.06);color:var(--text)}
@media (min-width:901px){
  .sidebar{width:64px!important;min-width:64px!important;overflow:visible}.sidebar-profile-top{padding:14px 10px}.sidebar .mini-profile div:not(.avatar),.nav-item b,.sidebar-foot.logout-only .btn{display:none!important}.nav{padding:8px 10px;overflow:visible}.nav-item{width:44px;height:44px;padding:0!important;justify-content:center;gap:0;margin-bottom:6px}.nav-item span{width:auto}.nav-item i{position:absolute;top:5px;right:4px;font-size:0;width:7px;height:7px;min-width:7px;padding:0;border:1.5px solid #1C1C1E}.nav-item:hover:after{content:attr(data-tooltip);position:absolute;left:54px;top:50%;transform:translateY(-50%);background:#1C1C1E;color:#fff;border-radius:999px;padding:7px 10px;font-size:12px;font-weight:500;white-space:nowrap;z-index:50;box-shadow:0 10px 24px rgba(0,0,0,.18)}.sidebar-foot.logout-only{padding:10px}.sidebar-foot.logout-only:after{content:'⎋';display:grid;place-items:center;width:44px;height:44px;border-radius:12px;color:#636366}.sidebar-foot.logout-only:hover:after{background:#2C2C2E;color:#fff}
}
@media (max-width:1100px){.inbox{grid-template-columns:250px 1fr!important}.contact-detail-panel{display:none}.split.two{grid-template-columns:1fr}.top-actions{display:flex}.stats-grid{grid-template-columns:repeat(2,1fr)}}
@media (max-width:760px){.mobile-only{display:inline-grid!important}.sidebar{width:min(305px,90vw)!important;background:#1C1C1E!important}.sidebar .mini-profile div:not(.avatar),.nav-item b,.sidebar-foot.logout-only .btn{display:block!important}.nav-item{width:100%;height:auto;padding:13px 14px!important;justify-content:flex-start;gap:12px}.workspace{padding:14px}.top-actions{display:none}.topbar{padding:0 15px}.greeting-strip{align-items:flex-start;flex-direction:column}.stats-grid{grid-template-columns:1fr}.inbox{grid-template-columns:1fr!important}.chat-list{height:260px}.form-grid{grid-template-columns:1fr}.stats-grid b{font-size:38px!important}.panel{padding:16px}}

/* PWA + Push additions */
.push-panel textarea{font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:12px;line-height:1.45}
.grid.two-mini{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
#installAppBtn[hidden],#clientInstallAppBtn[hidden]{display:none!important}
.pill.danger{background:#FFEEEE;color:#FF3B30}
@media(max-width:780px){.grid.two-mini{grid-template-columns:1fr}.top-actions{gap:6px;flex-wrap:wrap}.top-actions .btn{padding:10px 12px}}

/* v24 Live Inbox order/read fixes + dashboard widgets */
.nav-item{position:relative;overflow:visible!important;z-index:1}
.nav-item:hover{z-index:9999}
.nav-item[data-tooltip]:hover::after{z-index:99999!important;left:58px!important;top:50%;transform:translateY(-50%);white-space:nowrap;pointer-events:none;max-width:220px;overflow:visible}
.sidebar{overflow:visible!important;z-index:40}.nav{overflow:visible!important}.main{position:relative;z-index:1}.topbar{z-index:30}

/* Inbox: newest chat top, opened unread clears, keep composer compact and visible */
.inbox{grid-template-columns:300px minmax(0,1fr) 300px;min-height:calc(100vh - 118px);height:calc(100vh - 118px)}
.chat-list-inner{scroll-behavior:smooth}.chat-row{position:relative}.chat-row .pill.green{margin-left:auto;min-width:24px;height:24px;display:grid;place-items:center;padding:0 8px}
.chat-box{min-height:0;height:100%;overflow:hidden}.chat-head{flex:0 0 64px}.chat-messages{flex:1 1 auto;min-height:0;overflow:auto;padding-bottom:18px}
.template-send-bar{flex:0 0 auto;padding:8px 12px;gap:8px;background:#fff}.template-send-bar select{height:46px}.template-send-bar .btn{height:46px;border-radius:12px}
.reply{flex:0 0 auto;padding:8px 12px 10px!important;background:#fff;align-items:center}.reply input{height:48px;border-radius:999px}.reply .btn{height:48px;border-radius:14px;min-width:74px;background:#1C1C1E!important;color:#fff!important}
.contact-detail-panel{height:100%;overflow:auto;background:#fff;border-left:1px solid var(--line)}
@media(max-width:1100px){.inbox{grid-template-columns:280px 1fr}.contact-detail-panel{display:none}}
@media(max-width:760px){.inbox{height:auto;min-height:calc(100vh - 120px)}.chat-box{height:calc(100vh - 380px);min-height:520px}.template-send-bar,.reply{position:relative}}

/* Dashboard useful widgets */
#clientDashboardWidgets{margin-top:16px}.dashboard-widget-row{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin-bottom:16px}.dashboard-widget-row.wide-layout{grid-template-columns:minmax(0,1.35fr) minmax(280px,.65fr)}
.dash-widget{padding:20px!important;border-radius:18px!important}.mini-metrics{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}.mini-metrics div,.health-list-v24 div{background:#F9F9FB;border:1px solid rgba(0,0,0,.05);border-radius:14px;padding:14px}.mini-metrics b{display:block;font-size:28px;font-weight:300;letter-spacing:-.04em;color:#1C1C1E}.mini-metrics span,.health-list-v24 span{display:block;font-size:11px;color:#8E8E93;text-transform:uppercase;letter-spacing:.04em;font-weight:600;margin-top:4px}
.quick-actions-v24{display:grid;grid-template-columns:repeat(2,1fr);gap:10px}.quick-actions-v24 button{border:1px solid rgba(0,0,0,.06);background:#F9F9FB;border-radius:14px;padding:16px;font-weight:600;cursor:pointer;text-align:left}.quick-actions-v24 button:hover{background:#F2F2F7;border-color:rgba(0,0,0,.12)}
.dash-latest-list{display:flex;flex-direction:column;gap:8px}.dash-latest-item{display:grid;grid-template-columns:40px 1fr auto auto;align-items:center;gap:10px;width:100%;border:0;background:#fff;border-radius:14px;padding:10px;text-align:left;cursor:pointer}.dash-latest-item:hover{background:#F9F9FB}.dash-latest-item span:nth-child(2){min-width:0}.dash-latest-item b{display:block;font-size:14px;font-weight:600}.dash-latest-item small{display:block;color:#8E8E93;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:520px}.dash-latest-item em{font-style:normal;font-size:11px;color:#C7C7CC}.dash-latest-item i{font-style:normal;background:#25D366;color:#fff;border-radius:999px;min-width:20px;height:20px;padding:0 6px;display:grid;place-items:center;font-size:11px;font-weight:700}.health-list-v24{display:grid;grid-template-columns:1fr 1fr;gap:10px}.health-list-v24 b{font-size:20px;font-weight:400}
@media(max-width:900px){.dashboard-widget-row,.dashboard-widget-row.wide-layout{grid-template-columns:1fr}.mini-metrics{grid-template-columns:1fr 1fr}}

/* v25 mobile WhatsApp-style inbox */
@media (max-width:760px){
  .workspace{padding:0!important;background:#f2f2f7!important;}
  .page.active#page-inbox{height:calc(100vh - 46px);overflow:hidden;}
  .inbox.whatsapp-mobile{display:block!important;height:calc(100vh - 46px)!important;min-height:0!important;border:0!important;border-radius:0!important;box-shadow:none!important;background:#fff!important;overflow:hidden!important;}
  .inbox.whatsapp-mobile .chat-list{display:flex!important;height:100%!important;border:0!important;background:#fff!important;}
  .inbox.whatsapp-mobile .chat-box{display:none!important;height:100%!important;min-height:0!important;background:#fff!important;}
  .inbox.whatsapp-mobile.mobile-chat-open .chat-list{display:none!important;}
  .inbox.whatsapp-mobile.mobile-chat-open .chat-box{display:flex!important;}
  .inbox.whatsapp-mobile .contact-detail-panel{display:none!important;}
  .inbox.whatsapp-mobile .search{position:sticky;top:0;z-index:4;background:#fff;padding:10px 12px;border-bottom:1px solid rgba(0,0,0,.06);}
  .inbox.whatsapp-mobile .search input{height:44px;border-radius:22px;background:#f2f2f7;border:0;padding-left:16px;}
  .inbox.whatsapp-mobile .search button{height:44px;width:44px;border-radius:22px;background:#e8f9ef;}
  .inbox.whatsapp-mobile .chat-list-inner{height:100%;overflow:auto;padding-bottom:20px;background:#fff;}
  .inbox.whatsapp-mobile .chat-row{height:72px;padding:10px 14px;border-bottom:1px solid rgba(0,0,0,.04)!important;background:#fff!important;}
  .inbox.whatsapp-mobile .chat-row.active,.inbox.whatsapp-mobile .chat-row:hover{background:#f9f9fb!important;}
  .inbox.whatsapp-mobile .chat-row .avatar{width:48px;height:48px;font-size:16px;}
  .inbox.whatsapp-mobile .chat-row b{font-size:15px;font-weight:600;}
  .inbox.whatsapp-mobile .chat-row p{font-size:13px;max-width:210px;color:#6b7280;}
  .inbox.whatsapp-mobile .chat-row .pill.green{height:22px;min-width:22px;font-size:12px;margin-left:auto;background:#dff7ec!important;color:#087a4a!important;}
  .inbox.whatsapp-mobile .chat-head{height:56px;flex:0 0 56px;background:#fff;border-bottom:1px solid rgba(0,0,0,.06);padding:0 10px;position:sticky;top:0;z-index:5;}
  .mobile-chat-back,.mobile-chat-tools{display:inline-flex!important;align-items:center;justify-content:center;width:40px;height:40px;border:0;background:transparent;border-radius:50%;font-size:22px;color:#1c1c1e;}
  .mobile-chat-tools{margin-left:auto;font-size:20px;}
  .inbox.whatsapp-mobile .chat-head .avatar{width:38px;height:38px;}
  .inbox.whatsapp-mobile .chat-head b{font-size:15px;}
  .inbox.whatsapp-mobile .chat-head span{font-size:12px;max-width:180px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
  .inbox.whatsapp-mobile .chat-messages{flex:1 1 auto;min-height:0;overflow:auto;background:#efeae2!important;padding:14px 10px 12px!important;background-image:radial-gradient(rgba(0,0,0,.025) 1px, transparent 1px);background-size:18px 18px;}
  .inbox.whatsapp-mobile .msg{max-width:84%;font-size:14px;line-height:1.35;padding:8px 10px;margin-bottom:8px;border-radius:10px!important;box-shadow:0 1px 0 rgba(0,0,0,.05);}
  .inbox.whatsapp-mobile .msg.in{background:#fff!important;border:0!important;border-top-left-radius:3px!important;}
  .inbox.whatsapp-mobile .msg.out{background:#d9fdd3!important;color:#1c1c1e!important;border-top-right-radius:3px!important;}
  .inbox.whatsapp-mobile .msg small{font-size:10px;text-align:right;color:#667085;opacity:.78;}
  .inbox.whatsapp-mobile .reply{flex:0 0 auto;display:flex!important;gap:8px;padding:8px 8px;background:#f6f6f6;border-top:1px solid rgba(0,0,0,.06);order:99;}
  .inbox.whatsapp-mobile .reply input{height:44px;border-radius:22px!important;border:0!important;background:#fff!important;padding:0 14px;box-shadow:none!important;}
  .inbox.whatsapp-mobile .reply .btn{width:50px;height:44px;border-radius:22px;padding:0;background:#1c1c1e!important;color:#fff!important;}
  .inbox.whatsapp-mobile .template-send-bar{display:none!important;order:90;padding:8px 10px;background:#fff;border-top:1px solid rgba(0,0,0,.06);gap:8px;}
  .inbox.whatsapp-mobile.mobile-tools-open .template-send-bar{display:flex!important;}
  .inbox.whatsapp-mobile .template-send-bar select{height:44px;border-radius:14px;}
  .inbox.whatsapp-mobile .template-send-bar .btn{height:42px;border-radius:14px;}
  body.mobile-inbox-open .topbar{height:46px!important;padding:0 10px!important;}
  body.mobile-inbox-open .topbar h2{font-size:16px!important;}
  body.mobile-inbox-open .topbar p,.body.mobile-inbox-open .top-actions{display:none!important;}
}
@media (min-width:761px){.mobile-chat-back,.mobile-chat-tools{display:none!important;}}

/* v26 desktop inbox height fix: keep reply/product/template controls visible on laptop screens */
@media (min-width:761px){
  body:has(#page-inbox.active) .workspace{padding-top:16px;padding-bottom:12px;overflow:hidden;}
  #page-inbox.active{height:calc(100dvh - 112px);min-height:560px;overflow:hidden;}
  #page-inbox.active .inbox{height:100%!important;min-height:0!important;max-height:100%!important;overflow:hidden!important;}
  #page-inbox.active .chat-list,
  #page-inbox.active .chat-box,
  #page-inbox.active .contact-detail-panel{height:100%!important;min-height:0!important;}
  #page-inbox.active .chat-box{display:grid!important;grid-template-rows:60px minmax(0,1fr) auto auto auto;overflow:hidden!important;background:#fff;}
  #page-inbox.active .chat-head{height:60px!important;min-height:60px!important;}
  #page-inbox.active .chat-messages{min-height:0!important;overflow-y:auto!important;padding-bottom:12px!important;}
  #page-inbox.active .reply{position:relative!important;z-index:3;display:flex!important;align-items:center;background:#fff!important;border-top:1px solid rgba(0,0,0,.06)!important;padding:10px 12px!important;}
  #page-inbox.active .reply input{height:46px!important;}
  #page-inbox.active .template-send-bar{display:grid!important;grid-template-columns:minmax(0,1fr) 130px;gap:10px;margin:0!important;padding:8px 12px!important;background:#fff!important;border-top:1px solid rgba(0,0,0,.04)!important;}
  #page-inbox.active .template-send-bar select{height:42px!important;padding-top:8px!important;padding-bottom:8px!important;}
  #page-inbox.active .template-send-bar .btn{height:42px!important;padding:8px 12px!important;white-space:nowrap;}
  #page-inbox.active .chat-list-inner{min-height:0!important;overflow-y:auto!important;}
  #page-inbox.active .contact-detail-panel{overflow-y:auto!important;}
}

@media (min-width:761px) and (max-height:760px){
  #page-inbox.active{height:calc(100dvh - 96px);min-height:0;}
  #page-inbox.active .chat-head{height:54px!important;min-height:54px!important;}
  #page-inbox.active .msg{margin-bottom:8px!important;padding:9px 12px!important;}
  #page-inbox.active .reply{padding:7px 10px!important;}
  #page-inbox.active .reply input{height:40px!important;}
  #page-inbox.active .reply .btn{height:40px!important;padding:8px 14px!important;}
  #page-inbox.active .template-send-bar{padding:6px 10px!important;}
  #page-inbox.active .template-send-bar select,
  #page-inbox.active .template-send-bar .btn{height:38px!important;}
}


/* v27 mobile alignment fix: keep dashboard and all pages padded; only inbox uses full-screen WhatsApp mode */
@media (max-width:760px){
  body:not(.mobile-inbox-open) .workspace{
    padding:16px!important;
    background:#F2F2F7!important;
    overflow-x:hidden!important;
  }
  body:not(.mobile-inbox-open) .page.active{
    width:100%!important;
    max-width:100%!important;
    overflow-x:hidden!important;
  }
  body:not(.mobile-inbox-open) .topbar{
    height:68px!important;
    padding:0 16px!important;
    gap:12px!important;
  }
  body:not(.mobile-inbox-open) .topbar > div:first-child{
    min-width:0!important;
    display:flex!important;
    align-items:center!important;
    gap:12px!important;
  }
  body:not(.mobile-inbox-open) .topbar h2{
    font-size:20px!important;
    line-height:1.15!important;
    letter-spacing:-.35px!important;
    margin:0!important;
  }
  body:not(.mobile-inbox-open) .topbar p{
    font-size:12px!important;
    line-height:1.2!important;
    margin-top:3px!important;
    max-width:250px!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
  }
  body:not(.mobile-inbox-open) .mobile-only{
    width:40px!important;
    height:40px!important;
    min-width:40px!important;
    border-radius:12px!important;
    display:inline-grid!important;
    place-items:center!important;
    font-size:24px!important;
    color:#0b7c4e!important;
    background:transparent!important;
  }
  body:not(.mobile-inbox-open) .greeting-strip{
    width:100%!important;
    display:flex!important;
    align-items:flex-start!important;
    justify-content:flex-start!important;
    flex-direction:column!important;
    gap:12px!important;
    padding:2px 2px 6px!important;
    margin:0 0 16px!important;
    text-align:left!important;
  }
  body:not(.mobile-inbox-open) .greeting-strip > div{
    width:100%!important;
    min-width:0!important;
  }
  body:not(.mobile-inbox-open) .greeting-strip .micro-label{
    display:block!important;
    margin-bottom:8px!important;
    font-size:11px!important;
    line-height:1.2!important;
  }
  body:not(.mobile-inbox-open) .greeting-strip h3{
    font-size:24px!important;
    line-height:1.15!important;
    letter-spacing:-.55px!important;
    margin:0 0 8px!important;
    max-width:100%!important;
    overflow-wrap:anywhere!important;
  }
  body:not(.mobile-inbox-open) .greeting-strip p{
    font-size:13px!important;
    line-height:1.45!important;
    margin:0!important;
    max-width:100%!important;
  }
  body:not(.mobile-inbox-open) .connected-pill{
    align-self:flex-start!important;
    margin-top:2px!important;
    max-width:100%!important;
  }
  body:not(.mobile-inbox-open) .stats-grid{
    grid-template-columns:1fr!important;
    gap:14px!important;
    margin:0 0 16px!important;
    width:100%!important;
  }
  body:not(.mobile-inbox-open) .stats-grid article{
    width:100%!important;
    padding:20px 22px 18px!important;
    border-radius:18px!important;
    margin:0!important;
    box-shadow:none!important;
  }
  body:not(.mobile-inbox-open) .stats-grid span{
    font-size:11px!important;
    letter-spacing:.04em!important;
  }
  body:not(.mobile-inbox-open) .stats-grid b{
    font-size:42px!important;
    line-height:1!important;
    margin:14px 0 10px!important;
  }
  body:not(.mobile-inbox-open) .panel,
  body:not(.mobile-inbox-open) .dash-widget{
    width:100%!important;
    max-width:100%!important;
    border-radius:18px!important;
    padding:16px!important;
    margin-left:0!important;
    margin-right:0!important;
    box-shadow:none!important;
  }
  body:not(.mobile-inbox-open) .dashboard-widget-row,
  body:not(.mobile-inbox-open) .dashboard-widget-row.wide-layout,
  body:not(.mobile-inbox-open) .quick-cards,
  body:not(.mobile-inbox-open) .quick-actions-v24{
    grid-template-columns:1fr!important;
    gap:12px!important;
  }
  body:not(.mobile-inbox-open) .mini-metrics,
  body:not(.mobile-inbox-open) .health-list-v24{
    grid-template-columns:1fr 1fr!important;
    gap:10px!important;
  }
  body:not(.mobile-inbox-open) .split.two,
  body:not(.mobile-inbox-open) .form-grid,
  body:not(.mobile-inbox-open) .grid.two-mini{
    grid-template-columns:1fr!important;
  }
  body:not(.mobile-inbox-open) input,
  body:not(.mobile-inbox-open) select,
  body:not(.mobile-inbox-open) textarea{
    max-width:100%!important;
  }
  body:not(.mobile-inbox-open) .table-wrap{
    max-width:100%!important;
    overflow-x:auto!important;
  }
  body:not(.mobile-inbox-open) .dash-latest-item{
    grid-template-columns:38px minmax(0,1fr) auto!important;
  }
  body:not(.mobile-inbox-open) .dash-latest-item em{display:none!important;}
}


/* v28 mobile menu + responsive pages full check */
@media (max-width:760px){
  html,body{max-width:100%;overflow-x:hidden!important;}
  .app-shell{min-width:0;width:100%;}
  .main{width:100%;min-width:0;}
  .sidebar-overlay{position:fixed!important;inset:0!important;background:rgba(0,0,0,.38)!important;z-index:35!important;opacity:0!important;pointer-events:none!important;transition:opacity .18s ease!important;display:block!important;}
  body.sidebar-open .sidebar-overlay{opacity:1!important;pointer-events:auto!important;}
  .sidebar{height:100dvh!important;max-height:100dvh!important;min-height:0!important;width:min(330px,88vw)!important;z-index:60!important;overflow:hidden!important;display:flex!important;flex-direction:column!important;border-radius:0!important;box-shadow:20px 0 50px rgba(0,0,0,.28)!important;}
  .sidebar.open{transform:translateX(0)!important;}
  .sidebar-head.compact{flex:0 0 auto!important;padding:12px 18px!important;min-height:52px!important;}
  .sidebar-profile-top{flex:0 0 auto!important;padding:10px 18px 18px!important;border-bottom:1px solid rgba(255,255,255,.08)!important;}
  .sidebar-profile-top .mini-profile{justify-content:flex-start!important;gap:13px!important;margin:0!important;}
  .sidebar-profile-top .avatar{width:54px!important;height:54px!important;}
  .sidebar-profile-top b{font-size:17px!important;color:#fff!important;}
  .sidebar-profile-top span{font-size:13px!important;color:#c7c7cc!important;}
  .nav{flex:1 1 auto!important;min-height:0!important;max-height:none!important;overflow-y:auto!important;overflow-x:hidden!important;padding:14px 12px 18px!important;-webkit-overflow-scrolling:touch!important;overscroll-behavior:contain!important;}
  .nav::-webkit-scrollbar{width:4px}.nav::-webkit-scrollbar-thumb{background:rgba(255,255,255,.18);border-radius:99px}
  .nav-item{min-height:52px!important;margin:0 0 6px!important;border-radius:14px!important;color:#8e8e93!important;font-size:16px!important;}
  .nav-item span{font-size:21px!important;width:28px!important;}
  .nav-item b{font-size:16px!important;font-weight:600!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;color:inherit!important;}
  .nav-item.active{background:#2c2c2e!important;color:#fff!important;}
  .nav-item i{margin-left:auto!important;min-width:22px!important;text-align:center!important;}
  .sidebar-foot.logout-only{flex:0 0 auto!important;padding:12px 14px calc(12px + env(safe-area-inset-bottom))!important;background:#1C1C1E!important;}
  .sidebar-foot.logout-only .btn{display:flex!important;width:100%!important;min-height:46px!important;}
  .close-toggle{position:absolute!important;right:18px!important;top:16px!important;color:#25D366!important;background:transparent!important;font-size:26px!important;z-index:2!important;}

  /* Make every page use safe mobile spacing */
  .workspace{width:100%!important;max-width:100%!important;overflow-x:hidden!important;}
  .split.two,.form-grid,.quick-cards,.stats-grid,.dashboard-widget-row,.dashboard-widget-row.wide-layout{grid-template-columns:1fr!important;}
  .panel,.hero,.stats-grid article{max-width:100%!important;overflow:hidden!important;}
  .panel-head{align-items:flex-start!important;gap:10px!important;flex-wrap:wrap!important;}
  .row{gap:8px!important;}
  .row .btn,.panel .btn{max-width:100%;}
  input,select,textarea,.btn{font-size:16px!important;}
  .form-grid label,.form-stack label{min-width:0!important;width:100%!important;}

  /* Contacts page mobile: form first, contacts list/table scrolls cleanly */
  #page-contacts .split.two{display:grid!important;grid-template-columns:1fr!important;gap:14px!important;}
  #page-contacts .panel{padding:16px!important;border-radius:18px!important;}
  #page-contacts .panel h3{font-size:18px!important;line-height:1.25!important;}
  #contactsList.table-wrap{overflow-x:auto!important;-webkit-overflow-scrolling:touch!important;padding-bottom:4px!important;}
  #contactsList .data-table{min-width:640px!important;}
  #contactsList .data-table th,#contactsList .data-table td{white-space:nowrap!important;padding:11px 10px!important;font-size:13px!important;}
  #categoryList.chip-list{display:flex!important;gap:8px!important;flex-wrap:wrap!important;max-width:100%!important;}

  /* Broadcast/contact pickers and tables responsive */
  .contact-picker,.table-wrap{max-width:100%!important;overflow-x:auto!important;}
  .step-indicator{display:flex!important;overflow-x:auto!important;gap:8px!important;padding-bottom:4px!important;white-space:nowrap!important;}
  .step-indicator span{flex:0 0 auto!important;}
  .tpl-button-row{grid-template-columns:1fr!important;}

  /* Prevent hidden right content in mobile */
  .top-actions{display:none!important;}
  .toast{left:16px!important;right:16px!important;top:16px!important;}
}

@media (min-width:761px){
  .sidebar-overlay{display:none!important;}
}

/* v29 universal commerce + mobile composer/app icon fixes */
.commerce-universal-note{font-size:12px;color:#8E8E93;margin-top:8px}
#page-commerce .panel-head .pill.green{background:#E8F9EF!important;color:#087a4a!important}
#clientAppIconPreview img,#clientLogoPreview img{max-width:96px;max-height:96px;object-fit:cover;border-radius:20px}
@media (max-width:760px){
  body.mobile-inbox-open .page.active#page-inbox{height:calc(var(--app-vvh, 100dvh) - 46px)!important;}
  body.mobile-inbox-open .inbox.whatsapp-mobile{height:calc(var(--app-vvh, 100dvh) - 46px)!important;}
  body.mobile-inbox-open .inbox.whatsapp-mobile.mobile-chat-open .chat-box{height:calc(var(--app-vvh, 100dvh) - 46px)!important;position:relative!important;overflow:hidden!important;}
  body.mobile-inbox-open .inbox.whatsapp-mobile.mobile-chat-open .chat-messages{padding-bottom:78px!important;}
  body.mobile-inbox-open .inbox.whatsapp-mobile.mobile-chat-open .reply{position:fixed!important;left:0!important;right:0!important;bottom:0!important;z-index:80!important;padding:8px 8px calc(8px + env(safe-area-inset-bottom))!important;background:#f6f6f6!important;box-shadow:0 -6px 22px rgba(0,0,0,.08)!important;}
  body.mobile-inbox-open .inbox.whatsapp-mobile.mobile-chat-open.mobile-tools-open .chat-messages{padding-bottom:190px!important;}
  body.mobile-inbox-open .inbox.whatsapp-mobile.mobile-chat-open.mobile-tools-open .template-send-bar{position:fixed!important;left:0!important;right:0!important;bottom:calc(60px + env(safe-area-inset-bottom))!important;z-index:79!important;background:#fff!important;box-shadow:0 -3px 14px rgba(0,0,0,.05)!important;}
  body.mobile-inbox-open .inbox.whatsapp-mobile .reply input{font-size:16px!important;}
  body.mobile-inbox-open .inbox.whatsapp-mobile .reply .btn{flex:0 0 56px!important;}
}

/* v32 mobile inbox tools + keyboard fix */
@media (max-width:760px){
  body.mobile-inbox-open .inbox.whatsapp-mobile.mobile-chat-open .chat-box{
    height:calc(var(--app-vvh, 100dvh) - 46px)!important;
    display:flex!important;
    flex-direction:column!important;
    overflow:hidden!important;
  }
  body.mobile-inbox-open .inbox.whatsapp-mobile.mobile-chat-open .chat-messages{
    flex:1 1 auto!important;
    min-height:0!important;
    overflow-y:auto!important;
    padding-bottom:86px!important;
  }
  body.mobile-inbox-open .inbox.whatsapp-mobile.mobile-chat-open .reply{
    position:fixed!important;
    left:0!important;
    right:0!important;
    bottom:0!important;
    z-index:120!important;
    display:flex!important;
    align-items:center!important;
    gap:8px!important;
    padding:8px 8px calc(8px + env(safe-area-inset-bottom))!important;
    background:#f6f6f6!important;
    box-shadow:0 -6px 22px rgba(0,0,0,.08)!important;
  }
  body.mobile-inbox-open .inbox.whatsapp-mobile.mobile-chat-open .reply input{
    height:46px!important;
    font-size:16px!important;
    border-radius:24px!important;
  }
  body.mobile-inbox-open .inbox.whatsapp-mobile.mobile-chat-open .reply .btn{
    flex:0 0 64px!important;
    width:64px!important;
    height:46px!important;
    border-radius:18px!important;
  }
  body.mobile-inbox-open .inbox.whatsapp-mobile.mobile-chat-open .template-send-bar{display:none!important;}
  body.mobile-inbox-open .inbox.whatsapp-mobile.mobile-chat-open.mobile-tools-open .template-send-bar{
    position:fixed!important;
    left:10px!important;
    right:10px!important;
    z-index:110!important;
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:8px!important;
    padding:10px!important;
    background:#fff!important;
    border:1px solid rgba(0,0,0,.08)!important;
    border-radius:18px!important;
    box-shadow:0 -8px 28px rgba(0,0,0,.14)!important;
  }
  body.mobile-inbox-open .inbox.whatsapp-mobile.mobile-chat-open.mobile-tools-open .commerce-send-bar{bottom:calc(172px + env(safe-area-inset-bottom))!important;}
  body.mobile-inbox-open .inbox.whatsapp-mobile.mobile-chat-open.mobile-tools-open .template-send-bar:not(.commerce-send-bar){bottom:calc(76px + env(safe-area-inset-bottom))!important;}
  body.mobile-inbox-open .inbox.whatsapp-mobile.mobile-chat-open.mobile-tools-open .chat-messages{padding-bottom:250px!important;}
  body.mobile-inbox-open .inbox.whatsapp-mobile.mobile-chat-open .template-send-bar select{width:100%!important;height:44px!important;border-radius:14px!important;font-size:15px!important;}
  body.mobile-inbox-open .inbox.whatsapp-mobile.mobile-chat-open .template-send-bar .btn{width:100%!important;height:42px!important;border-radius:14px!important;}
  body.mobile-inbox-open .inbox.whatsapp-mobile.mobile-chat-open:not(.mobile-tools-open) .template-send-bar{display:none!important;}
}

/* v38 final end overrides */
@media (min-width:901px){
  .sidebar{position:sticky!important;top:0!important;height:100vh!important;padding-bottom:74px!important;}
  .sidebar-foot.logout-only{position:absolute!important;left:8px!important;right:8px!important;bottom:12px!important;padding:0!important;border-top:0!important;cursor:pointer!important;background:transparent!important;}
  .sidebar-foot.logout-only:after{content:'↪'!important;display:grid!important;place-items:center!important;width:52px!important;height:52px!important;border-radius:18px!important;background:#e8f9ef!important;color:#ff3b30!important;font-size:30px!important;font-weight:900!important;box-shadow:0 8px 22px rgba(0,0,0,.18)!important;}
  .sidebar-foot.logout-only:hover:after{background:#25d366!important;color:#fff!important;transform:translateY(-1px)!important;}
}

/* v46 WhatsApp media/location inbox fixes */
.msg.has-media{max-width:min(330px,88%)}
.msg-media img{display:block;max-width:260px;max-height:320px;width:auto;height:auto;border-radius:14px;cursor:pointer;object-fit:cover;background:#f3f4f6}
.msg-video{display:block;max-width:280px;max-height:320px;border-radius:14px;background:#111}
.msg audio{max-width:260px;width:100%}
.msg-text{margin-top:8px;white-space:pre-wrap}
.location-card,.doc-card{display:block;background:rgba(255,255,255,.55);border:1px solid rgba(0,0,0,.08);border-radius:14px;padding:10px 12px;line-height:1.35;text-decoration:none;color:inherit}
.location-card p{margin:4px 0 0}.location-card a{display:inline-flex;margin-top:8px;font-weight:700;text-decoration:none}.media-error{padding:10px 12px;border-radius:12px;background:#fff3cd;color:#7a5300;font-size:13px}
.msg.out .location-card,.msg.out .doc-card{background:rgba(255,255,255,.35)}
