/* Elite Inbox v2.1 — clean minimal, Intercom-style. Colours in theme.css */
*{box-sizing:border-box}
html,body{height:100%}
body{margin:0;font-family:var(--font);font-size:14px;line-height:1.45;color:var(--fg);background:var(--bg);-webkit-text-size-adjust:100%;overflow:hidden}
h1,h2,h3{margin:0;font-weight:650;letter-spacing:-.01em;color:var(--fg)}
h2{font-size:22px;margin-bottom:4px} h3{font-size:15px;margin-bottom:10px}
a{color:var(--acc-text)}
.hidden{display:none!important}
.muted{color:var(--muted)} .small{font-size:12.5px}
.lead{color:var(--muted);margin:0 0 18px;max-width:640px}
.err{color:var(--danger);margin:6px 0 0}
.err:empty{display:none}
label{display:block;font-size:13px;font-weight:550;color:var(--subtle);margin:14px 0 6px}
input,select,textarea{width:100%;font:inherit;font-size:16px;color:var(--fg);background:var(--surface);border:1px solid var(--line-strong);border-radius:var(--radius);padding:9px 12px;min-height:42px}
textarea{resize:vertical}
input:focus,select:focus,textarea:focus{outline:2px solid var(--acc-soft);border-color:var(--acc)}
.w-auto{width:auto}
.btn{font:inherit;font-weight:600;border-radius:8px;border:1px solid transparent;padding:8px 16px;min-height:40px;cursor:pointer;white-space:nowrap;display:inline-flex;align-items:center;justify-content:center;gap:6px}
.btn-sm{min-height:34px;padding:4px 12px;font-size:13px}
.btn-primary{background:var(--acc);color:var(--acc-fg)} .btn-primary:hover{background:var(--acc-h)}
.btn:disabled{opacity:.45;cursor:not-allowed}
.btn-dark{background:var(--dark);color:#fff}
.btn-ghost{background:var(--surface);color:var(--fg);border-color:var(--line-strong)} .btn-ghost:hover{background:var(--surface-2)}
.btn-danger{background:transparent;color:var(--danger)} .btn-danger:hover{background:var(--danger-soft)}
.btn-block{width:100%}
.link{background:none;border:0;font:inherit;color:var(--muted);cursor:pointer;padding:0 6px;min-height:40px;text-decoration:underline;text-underline-offset:3px}
.icon-btn{background:transparent;border:0;font-size:20px;cursor:pointer;color:var(--fg);width:40px;height:40px;border-radius:8px;display:inline-flex;align-items:center;justify-content:center;flex:none;padding:0}
.icon-btn:hover{background:var(--surface-2)}
.logo{display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;border-radius:8px;background:var(--dark);color:#fff;font-weight:800;font-size:12px;flex:none}
.brand{display:flex;align-items:center;gap:10px;text-decoration:none;color:var(--fg);font-size:15px}
.lab{display:inline-flex;align-items:center;font-size:11.5px;font-weight:600;padding:1px 8px;border-radius:6px;line-height:18px;white-space:nowrap;background:var(--l-gray);color:var(--l-gray-fg)}
.l-gray{background:var(--l-gray);color:var(--l-gray-fg)}.l-blue{background:var(--l-blue);color:var(--l-blue-fg)}.l-green{background:var(--l-green);color:var(--l-green-fg)}.l-red{background:var(--l-red);color:var(--l-red-fg)}.l-yellow{background:var(--l-yellow);color:var(--l-yellow-fg)}.l-purple{background:var(--l-purple);color:var(--l-purple-fg)}.l-teal{background:var(--l-teal);color:var(--l-teal-fg)}.l-orange{background:var(--l-orange);color:var(--l-orange-fg)}
.av{--h:200;width:38px;height:38px;flex:none;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;font-weight:650;font-size:13px;color:#fff;background:hsl(var(--h) 45% 55%)}
.av.sm{width:26px;height:26px;font-size:10.5px}.av.xs{width:20px;height:20px;font-size:9px}
.av.staff{background:hsl(var(--h) 55% 38%)}
.stf{display:inline-flex;align-items:center;gap:4px;font-size:11.5px;color:var(--muted)}

/* Login */
.login-wrap{min-height:100%;display:flex;align-items:center;justify-content:center;padding:16px;background:var(--bg)}
.login-card{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-lg);padding:32px 28px;width:100%;max-width:380px;box-shadow:var(--shadow)}
.login-card h1{font-size:22px;margin:22px 0 4px}
.login-card button{margin-top:20px}
.login-card .muted{margin:14px 0 0}

/* Shell */
.app{display:flex;flex-direction:column;height:100vh;height:100dvh}
.topbar{height:var(--topbar);flex:none;display:flex;align-items:center;gap:18px;padding:0 20px;background:var(--surface);border-bottom:1px solid var(--line);position:relative;z-index:40}
.nav{display:flex;align-items:center;gap:2px}
.nv{position:relative;display:inline-flex;align-items:center;gap:6px;padding:0 12px;height:36px;border-radius:8px;color:var(--subtle);text-decoration:none;font-weight:550}
.nv:hover{background:var(--surface-2);color:var(--fg)} .nv.active{background:var(--surface-2);color:var(--fg)}
.nv-badge{font-style:normal;font-size:11px;font-weight:700;background:var(--acc);color:#fff;border-radius:10px;padding:0 6px;min-width:20px;text-align:center;line-height:18px}
.nav-me{display:none}
.top-sp{flex:1}
.bell{font:inherit;font-size:13px;border:1px solid var(--line-strong);background:var(--surface);border-radius:8px;padding:0 10px;height:34px;cursor:pointer;color:var(--subtle)}
.me{display:flex;align-items:center;gap:8px;font-size:13.5px;color:var(--subtle)}
.menu-btn{display:none}
.main{flex:1;min-height:0;overflow-y:auto;position:relative}
.scrim{position:fixed;inset:0;background:rgba(16,24,40,.3);z-index:35}
.page{padding:28px 32px 40px;max-width:980px;margin:0 auto}
.page-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:18px}
.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-lg);padding:20px;margin-bottom:16px;min-width:0}
.card-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px}.card-head h3{margin:0}
details.card>summary{list-style:none;cursor:pointer;display:flex;align-items:center;justify-content:space-between;min-height:24px}
details.card>summary::-webkit-details-marker{display:none}
details.card>summary h3{margin:0}
details.card>summary::after{content:"＋";color:var(--muted);font-size:18px}
details.card[open]>summary::after{content:"−"}
details.card[open]>summary{margin-bottom:6px}
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:0 14px}
.grid2.gap{gap:0 16px}
.row-end{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:16px}
.top-gap{margin-top:16px}
.msg{margin:0}.msg.ok{color:var(--ok)}.msg.bad{color:var(--danger)}
.seg{display:inline-flex;gap:2px;background:var(--surface-2);border-radius:10px;padding:3px;margin:8px 0 20px;max-width:100%;overflow-x:auto}
.seg a{padding:0 14px;height:36px;display:inline-flex;align-items:center;border-radius:8px;text-decoration:none;color:var(--subtle);font-weight:550;white-space:nowrap}
.seg a.on{background:var(--surface);color:var(--fg);box-shadow:var(--shadow)}

/* Inbox — 2 panes */
.page-inbox{padding:0;max-width:none;height:100%}
.inbox{display:grid;grid-template-columns:var(--listw) minmax(0,1fr);height:100%;min-height:0}
.list{background:var(--surface);border-right:1px solid var(--line);display:flex;flex-direction:column;min-height:0;min-width:0}
.list-top{padding:14px 14px 8px}
.list-top input{background:var(--surface-2);border-color:transparent}
.tabs{display:flex;gap:4px;align-items:center;margin-top:10px;overflow-x:auto;scrollbar-width:none}
.tabs::-webkit-scrollbar{display:none}
.tab{font:inherit;font-size:13.5px;border:0;background:transparent;color:var(--muted);border-radius:7px;padding:0 11px;height:34px;white-space:nowrap;cursor:pointer;flex:none;font-weight:550}
.tab:hover{background:var(--surface-2)}
.tab.on{background:var(--dark);color:#fff}
.tab-sel{width:auto;flex:none;height:34px;min-height:34px;padding:0 8px;border:0;background:transparent;color:var(--muted);font-size:13.5px;font-weight:550;margin-left:auto}
.convs{overflow-y:auto;flex:1;min-height:0;padding:4px 8px 12px}
.cv{display:flex;gap:12px;padding:11px 10px;cursor:pointer;align-items:flex-start;border-radius:10px;margin-bottom:2px}
.cv:hover{background:var(--hover)}.cv.active{background:var(--selected);box-shadow:inset 3px 0 var(--acc)}
.cvb{flex:1;min-width:0}
.r1,.r2{display:flex;align-items:center;justify-content:space-between;gap:8px}
.r1 b{font-size:14.5px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.r1 time{font-size:12px;color:var(--muted);white-space:nowrap;flex:none}
.unread .r1 time{color:var(--acc-text);font-weight:600}
.pv{color:var(--muted);font-size:13.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.unread .pv{color:var(--fg);font-weight:500}
.ub{background:var(--badge);color:#fff;font-size:11px;font-weight:700;min-width:20px;height:20px;border-radius:10px;display:inline-flex;align-items:center;justify-content:center;padding:0 6px;flex:none}
.r3{display:flex;gap:4px;align-items:center;margin-top:5px;flex-wrap:wrap}
.r3:empty{display:none}
.empty{padding:40px 16px;text-align:center;color:var(--muted)}

.chat{display:flex;flex-direction:column;min-height:0;min-width:0;background:var(--surface)}
.chat-empty{flex:1;display:flex;align-items:center;justify-content:center;text-align:center;color:var(--muted)}
.chat-empty .big{font-size:40px;margin:0}
.chat-inner{display:flex;flex-direction:column;height:100%;min-height:0;position:relative}
.chead{display:flex;align-items:center;gap:10px;padding:10px 20px;border-bottom:1px solid var(--line);min-height:64px}
.who{display:flex;flex-direction:column;min-width:0;line-height:1.25;flex:1 1 auto}
.who b{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-weight:650;font-size:15px}
.who small{color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:12.5px}
.win{font-size:12px;padding:4px 10px;border-radius:var(--pill);background:var(--acc-soft);color:var(--acc-text);font-weight:600;white-space:nowrap;flex:none}
.win.closed{color:var(--warn);background:var(--warn-soft)}
.cact{display:flex;align-items:center;gap:8px;flex:none}
.assign{width:auto;max-width:160px;min-height:40px;height:40px;padding:0 10px;border-radius:8px;font-size:14px}
.back-btn{display:none}
.labwrap{position:relative}
.menu{position:absolute;right:0;top:calc(100% + 6px);background:var(--surface);border:1px solid var(--line);border-radius:12px;box-shadow:var(--shadow-lg);padding:6px;min-width:200px;z-index:30}
.menu button{display:flex;align-items:center;gap:8px;width:100%;border:0;background:transparent;font:inherit;padding:0 10px;min-height:40px;border-radius:8px;cursor:pointer;text-align:left}
.menu button:hover{background:var(--surface-2)}
.menu .ck{width:18px;color:var(--acc-text);font-weight:700}
.chat-tags{display:flex;gap:6px;padding:8px 20px 0;flex-wrap:wrap}
.chat-tags:empty{display:none}
.msgs{flex:1;overflow-y:auto;padding:20px 40px 24px;display:flex;flex-direction:column;gap:14px;min-height:0}
.day-sep{align-self:center;font-size:12px;color:var(--muted);margin:4px 0}
.m{display:flex;flex-direction:column;align-items:flex-start;max-width:min(560px,78%)}
.m.out{align-self:flex-end;align-items:flex-end}
.mh{display:flex;align-items:center;gap:6px;font-size:12.5px;color:var(--muted);margin-bottom:4px}
.mh b{color:var(--fg);font-weight:600}
.mh .src{font-size:11px;padding:0 6px;border-radius:5px;background:var(--surface-2);color:var(--subtle)}
.bubble{padding:9px 13px;border-radius:16px;overflow-wrap:anywhere;max-width:100%}
.m.in .bubble{background:var(--in);color:var(--in-fg);border-bottom-left-radius:4px}
.m.out .bubble{background:var(--out);color:var(--out-fg);border-bottom-right-radius:4px}
.m.out.auto .bubble{background:var(--out);color:var(--out-fg)}
.bubble .txt{white-space:pre-wrap;font-size:14.5px}
.tick{font-size:11.5px;color:var(--muted)}.tick.read{color:var(--acc-text)}.tick.failed{color:var(--danger)}
.m .errline{color:var(--danger);font-size:12px;margin-top:4px;text-align:right}
.att{font:inherit;border:0;cursor:pointer;text-decoration:none;display:inline-flex;gap:6px;align-items:center;font-size:13px;color:inherit;background:rgba(0,0,0,.06);border-radius:8px;padding:8px 10px;margin-bottom:6px;min-height:40px}
.m.out .att{background:rgba(0,0,0,.05)}
.bubble img.media,.bubble video.media{max-width:260px;width:100%;max-height:300px;object-fit:cover;border-radius:10px;display:block;margin:2px 0 6px;cursor:zoom-in;background:rgba(0,0,0,.05)}
.bubble audio{max-width:260px;width:100%;display:block;margin-bottom:4px}
.composer{margin:0 24px 18px;border:1px solid var(--line-strong);border-radius:14px;box-shadow:0 4px 16px rgba(0,0,0,.06);background:var(--surface);padding:8px 10px 8px;position:relative}
.composer textarea{border:0;min-height:44px;max-height:160px;resize:none;padding:8px 4px;background:transparent}
.composer textarea:focus{outline:0}
.crow{display:flex;align-items:center;gap:4px}
.tool{font:inherit;font-size:13.5px;border:0;background:transparent;color:var(--subtle);border-radius:8px;padding:0 10px;min-height:40px;cursor:pointer;display:inline-flex;align-items:center;gap:6px;position:relative;white-space:nowrap}
.tool:hover{background:var(--surface-2)}
.attach{overflow:hidden;margin:0;font-weight:400}
.attach input{position:absolute;inset:0;opacity:0;cursor:pointer;min-height:0}
.send{min-height:40px;padding:0 18px}
.reply-note{background:var(--warn-soft);color:var(--warn);border-radius:10px;padding:10px 12px;font-size:13.5px;display:flex;gap:10px;align-items:center;justify-content:space-between;flex-wrap:wrap;margin-bottom:6px}
.qr-pick{position:absolute;left:8px;right:8px;bottom:calc(100% + 8px);background:var(--surface);border:1px solid var(--line);border-radius:12px;box-shadow:var(--shadow-lg);max-height:300px;overflow-y:auto;z-index:20;padding:6px}
.qr-item{display:block;width:100%;text-align:left;border:0;background:transparent;font:inherit;padding:9px 10px;border-radius:8px;cursor:pointer;min-height:44px}
.qr-item b{font-family:ui-monospace,Menlo,Consolas,monospace;color:var(--acc-text);margin-right:8px;font-weight:600}
.qr-item span{color:var(--muted);font-size:13px}
.qr-item.on,.qr-item:hover{background:var(--acc-soft)}
.file-bar{display:flex;align-items:center;justify-content:space-between;gap:8px;background:var(--surface-2);border-radius:8px;padding:2px 4px 2px 12px;font-size:13px;margin-bottom:4px}

/* Lists */
.rows{display:flex;flex-direction:column}
.row{display:flex;gap:12px;align-items:center;justify-content:space-between;padding:12px 0;border-bottom:1px solid var(--line)}
.row:last-child{border-bottom:0}
.row:first-child{padding-top:0}
.row-main{min-width:0;flex:1}
.row-main .pre-wrap{white-space:pre-wrap;color:var(--muted);font-size:13.5px;margin-top:3px;overflow-wrap:anywhere}
.row-act{display:flex;gap:4px;align-items:center;flex:none;flex-wrap:wrap;justify-content:flex-end}
.mono{font-family:ui-monospace,Menlo,Consolas,monospace;color:var(--acc-text)}
.tbl{width:100%;border-collapse:collapse;margin-bottom:8px}
.tbl td{border-bottom:1px solid var(--line);padding:8px 4px;vertical-align:top;overflow-wrap:anywhere}
.kv td:first-child{color:var(--muted);width:50%}
.copy-row{display:flex;gap:8px;align-items:center}.copy-row .btn{margin:0}
.hint{background:var(--surface-2);border-radius:8px;padding:10px 12px;margin:8px 0 0;color:var(--subtle);white-space:pre-wrap;overflow-wrap:anywhere}
.pre{background:var(--surface-2);padding:10px;border-radius:8px;overflow:auto;white-space:pre-wrap;max-width:100%}
.switch{display:flex;align-items:center;gap:10px;font-size:14px;color:var(--fg);font-weight:500;margin:6px 0;cursor:pointer;min-height:40px}
.switch input{position:absolute;opacity:0;width:1px;height:1px;min-height:0}
.switch span{width:36px;height:20px;border-radius:10px;background:var(--line-strong);position:relative;flex:none;transition:.15s}
.switch span::after{content:"";position:absolute;width:16px;height:16px;border-radius:50%;background:#fff;top:2px;left:2px;transition:.15s;box-shadow:var(--shadow)}
.switch input:checked+span{background:var(--acc)}.switch input:checked+span::after{left:18px}
.switch input:focus-visible+span{outline:2px solid var(--acc);outline-offset:2px}
.perm-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:0 16px}
.tpl-pick{display:flex;flex-direction:column;gap:8px;margin-top:10px}
.tpl-item{border:1px solid var(--line);border-radius:10px;padding:12px;text-align:left;background:var(--surface);font:inherit;color:inherit;width:100%;cursor:pointer;min-height:44px}
.tpl-item:hover{border-color:var(--acc);background:var(--acc-soft)}
.tpl-top{display:flex;justify-content:space-between;align-items:center;gap:8px;flex-wrap:wrap}
.tpl-body{white-space:pre-wrap;color:var(--muted);font-size:13px;margin-top:4px;overflow-wrap:anywhere}
.tpl-preview{border-radius:10px;padding:14px;display:flex;flex-direction:column;background:var(--surface-2);min-height:64px}
.tpl-preview .bubble{border-radius:14px;align-self:flex-start;background:var(--surface)}
.tpl-preview .bubble.out{align-self:flex-end;background:var(--out);color:var(--out-fg)}
.st-APPROVED{background:var(--l-green);color:var(--l-green-fg)}.st-PENDING,.st-IN_APPEAL{background:var(--l-yellow);color:var(--l-yellow-fg)}.st-REJECTED,.st-DISABLED,.st-PAUSED{background:var(--l-red);color:var(--l-red-fg)}

/* Reports */
.kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:12px;margin-bottom:16px}
.kpi{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-lg);padding:16px}
.kpi b{display:block;font-size:26px;font-weight:650;letter-spacing:-.02em}.kpi small{color:var(--muted);font-size:13px}
.chart{display:flex;align-items:flex-end;gap:4px;height:200px;padding-top:8px;overflow-x:auto}
.chart-sm{height:150px}
.bar-col{flex:1 0 12px;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;height:100%;min-width:12px}
.bar-pair{display:flex;align-items:flex-end;gap:2px;width:100%;height:calc(100% - 18px);justify-content:center}
.bar{width:42%;max-width:16px;border-radius:4px 4px 0 0;min-height:2px}
.bar.in{background:#a8e6d4}.bar.out{background:var(--acc)}.bar.cv{background:var(--acc);width:60%}
.bar-col small{font-size:10px;color:var(--muted);height:18px;line-height:18px;white-space:nowrap}
.legend{display:flex;gap:8px;align-items:center;font-size:12.5px;color:var(--muted)}
.lgd{display:inline-block;width:10px;height:10px;border-radius:3px}.lgd.in{background:#a8e6d4}.lgd.out{background:var(--acc)}
.hbar{height:6px;border-radius:3px;background:var(--acc);margin-top:6px}

/* Modal + toast */
.modal{position:fixed;inset:0;background:rgba(16,24,40,.35);display:flex;align-items:center;justify-content:center;z-index:60;padding:16px}
.modal-card{background:var(--surface);border-radius:var(--radius-lg);box-shadow:var(--shadow-lg);width:100%;max-width:520px;max-height:90vh;max-height:90dvh;display:flex;flex-direction:column}
.modal-head{display:flex;justify-content:space-between;align-items:center;padding:12px 12px 12px 20px;border-bottom:1px solid var(--line)}
.modal-body{padding:16px 20px 20px;overflow-y:auto}
.toast{position:fixed;left:50%;bottom:24px;transform:translateX(-50%);background:var(--dark);color:#fff;padding:10px 16px;border-radius:10px;box-shadow:var(--shadow-lg);z-index:80;max-width:90vw}

/* Tablet */
@media (max-width:1100px){
  .topbar{gap:10px;padding:0 14px}
  .me-name{display:none}
  .inbox{grid-template-columns:300px minmax(0,1fr)}
  .msgs{padding:16px 20px}
  .composer{margin:0 14px 14px}
  .chead{flex-wrap:wrap;row-gap:6px;padding:10px 14px}
  .cact{margin-left:auto}
}
@media (max-width:900px){ .tool span{display:none} .bell{display:none} }
/* Mobile */
@media (max-width:760px){
  body{font-size:15px}
  .topbar{height:54px}
  .menu-btn{display:inline-flex}
  .me,.bell{display:none!important}
  .nav{position:fixed;top:0;right:0;bottom:0;width:min(290px,86vw);background:var(--surface);flex-direction:column;align-items:stretch;padding:16px 12px;gap:2px;transform:translateX(102%);transition:transform .2s;z-index:50;box-shadow:var(--shadow-lg)}
  .nav.open{transform:none}
  .nv{height:46px;font-size:16px;padding:0 14px}
  .nv-badge{margin-left:auto}
  .nav-me{display:flex;align-items:center;gap:10px;margin-top:auto;padding:12px 6px 0;border-top:1px solid var(--line)}
  .nav-me>span:nth-child(2){display:flex;flex-direction:column;line-height:1.2;flex:1;min-width:0}
  .nav-me small{color:var(--muted)}
  .page{padding:18px 14px 32px}
  .grid2{grid-template-columns:minmax(0,1fr)}
  .inbox{grid-template-columns:minmax(0,1fr)}
  .inbox .chat{display:none}
  .inbox.chat-open .list{display:none}
  .inbox.chat-open .chat{display:flex}
  body.chat-mode .topbar{display:none}
  .back-btn{display:inline-flex}
  .chead{padding:6px 10px 8px 4px;gap:8px;flex-wrap:wrap}
  .chead .av{width:34px;height:34px}
  .who{flex:1 1 0}
  .win{order:5;margin-left:44px;font-size:11.5px;padding:3px 9px}
  .cact{order:6;margin-left:auto;gap:6px}
  .assign{max-width:118px}
  .cact .btn{padding:0 12px}
  .chat-tags{padding:8px 12px 0}
  .msgs{padding:14px 12px}
  .m{max-width:88%}
  .composer{margin:0 8px calc(8px + env(safe-area-inset-bottom));border-radius:14px}
  .row{flex-direction:column;align-items:stretch}
  .row-act{justify-content:flex-start}
  .modal{padding:0;align-items:flex-end}
  .modal-card{max-height:92dvh;border-radius:var(--radius-lg) var(--radius-lg) 0 0}
  .copy-row{flex-wrap:wrap}
  .copy-row input{flex:1 1 180px}
  .chart{height:160px}
  .kpis{grid-template-columns:1fr 1fr}
}
@media (max-width:370px){ .assign{max-width:100px} .cact .btn{padding:0 10px;font-size:13px} .tool{padding:0 8px} }
.urow{display:flex;gap:12px;align-items:center}
@media (max-width:1024px){ .btn-sm,.tab,.tab-sel,.bell{min-height:40px;height:40px} .seg a{height:40px} }
@media (max-width:1024px){ .tab-sel,.assign{font-size:16px} .nv{height:40px} }
@media (max-width:760px){
  .page.page-inbox{padding:0}
  .who{flex:1 1 calc(100% - 60px)}
  .win{order:5;margin-left:44px;margin-right:auto}
  .wl,.bl{display:none}
  #labBtn{width:40px;padding:0}
  .chead{row-gap:4px}
}
.kpis{grid-template-columns:repeat(3,minmax(0,1fr))}
@media (max-width:760px){
  .kpis{grid-template-columns:1fr 1fr}
  .who{flex:1 1 calc(100% - 100px)}
  .win{margin-left:4px}
  .assign{max-width:110px}
}

/* ===== v2.2 — WhatsApp feel on the minimal layout ===== */
.logo{background:var(--acc)}
.nv.active{background:var(--acc-soft);color:var(--acc-text)}
.nv-badge{background:var(--badge);color:var(--badge-fg)}
.btn-dark{background:var(--dark)} .btn-dark:hover{background:var(--teal)}
.list-top input{background:var(--surface-2);border-radius:8px}
.tab{border-radius:var(--pill);background:var(--surface-2);color:var(--subtle);padding:0 13px}
.tab:hover{background:#e6e9ec}
.tab.on{background:#d9fdd3;color:var(--acc-text)}
.tab-sel{border-radius:var(--pill);background:var(--surface-2);color:var(--subtle);padding:0 10px;margin-left:0}
/* chat list rows — WhatsApp style */
.convs{padding:0}
.cv{border-radius:0;margin:0;padding:0 0 0 14px;gap:14px;align-items:center}
.cv .av{width:46px;height:46px;font-size:15px}
.cvb{padding:12px 14px 12px 0;border-bottom:1px solid var(--line);min-height:72px;display:flex;flex-direction:column;justify-content:center}
.cv:last-child .cvb{border-bottom:0}
.cv.active{background:var(--selected);box-shadow:none}
.r1 b{font-size:16px;font-weight:500}
.unread .r1 b{font-weight:600}
.unread .r1 time{color:var(--acc)}
.pv{font-size:14px}
.ub{background:var(--badge);color:var(--badge-fg)}
/* chat area */
.chat{background:var(--chat-bg) url(doodle.svg) repeat;background-size:260px}
.chead{background:var(--surface)}
.chat-tags{padding:10px 24px 0}
.win{background:var(--acc-soft);color:var(--acc-text)}
.day-sep{background:var(--surface);color:var(--muted);padding:4px 12px;border-radius:8px;box-shadow:0 1px .5px rgba(11,20,26,.13);font-size:12.5px}
.msgs{gap:10px}
.mh{margin:0 4px 3px;font-size:12.5px}
.m.out .mh{margin-right:6px}
.mh b{color:var(--acc-text)}
.m.in .mh b{color:#c2185b}
.bubble{position:relative;border-radius:8px;padding:6px 9px 8px;box-shadow:0 1px .5px rgba(11,20,26,.13)}
.m.in .bubble{background:var(--in);border-top-left-radius:0;border-bottom-left-radius:8px}
.m.out .bubble{background:var(--out);color:var(--out-fg);border-top-right-radius:0;border-bottom-right-radius:8px}
.m.in .bubble::before,.m.out .bubble::before{content:"";position:absolute;top:0;width:0;height:0;border-top:9px solid}
.m.in .bubble::before{left:-8px;border-top-color:var(--in);border-left:8px solid transparent}
.m.out .bubble::before{right:-8px;border-top-color:var(--out);border-right:8px solid transparent}
.bubble .txt{display:inline;font-size:14.5px}
.meta{float:right;margin:8px 0 -4px 12px;font-size:11px;color:var(--muted);display:inline-flex;align-items:center;gap:3px;line-height:15px;white-space:nowrap}
.tk{display:inline-flex;color:var(--tick)} .tk.read{color:var(--tick-read)} .tk.failed{color:var(--danger);font-weight:600}
.tk svg{width:16px;height:11px}
.bubble img.media,.bubble video.media{border-radius:6px}
.m .errline{background:rgba(255,255,255,.85);border-radius:6px;padding:2px 8px}
.composer{border-color:transparent;box-shadow:0 2px 10px rgba(11,20,26,.10);border-radius:16px}
.send{border-radius:var(--pill)}
.chat-empty{background:var(--surface)}
.qr-item.on,.qr-item:hover{background:var(--acc-soft)}
.seg a.on{color:var(--acc-text)}
@media (max-width:760px){
  .cv .av{width:46px;height:46px}
  .chat-tags{padding:8px 12px 0}
}
/* v2.3 order confirm: photo + address */
.tp-sec{margin:18px 0 0;padding-top:14px;border-top:1px solid var(--line);font-weight:600;font-size:14px}
.tp-photo{display:flex;flex-direction:column;gap:8px}
.tp-photo input[type=file]{padding:7px 10px;font-size:14px}
.tp-addr .span2{grid-column:1/-1}
.tp-img{display:block;width:100%;max-height:180px;object-fit:cover;border-radius:10px;margin-bottom:8px;background:var(--surface-2)}
.tp-img.empty-img{height:90px;display:flex;align-items:center;justify-content:center;color:var(--muted);font-size:13px}
