*{box-sizing:border-box}
:root{--ink:#1F2328;--muted:#555B63;--line:#E5E7EB;--bg:#F6F5F9;--brand:#8B2FE0;--brand-d:#6C1FB5;--brand-soft:#F3E8FF;--side:#1E1A2B;--pos:#047857;--neg:#B91C1C;--warn:#B45309}
html{-webkit-text-size-adjust:100%}
body{margin:0;background:var(--bg);color:var(--ink);font-family:'Inter','Hind Siliguri',system-ui,sans-serif;font-size:15px;line-height:1.5}
a{color:var(--brand)}a:hover{color:var(--brand-d)}
h1,h2,h3{margin:0;line-height:1.25}
h2{font-size:18px}
.shell{display:flex;flex-wrap:wrap;min-height:100vh}
.side{flex:1 1 220px;max-width:100%;background:var(--side);color:#E8E8E8;padding:18px 12px;display:flex;flex-direction:column;gap:16px}
.brand{display:flex;align-items:center;gap:10px;padding:0 6px}
.brand{flex-direction:column;align-items:flex-start;gap:4px}.logoimg{height:34px;width:auto;display:block}.brand small{display:block;color:#B9BDC2;font-size:12px;letter-spacing:.08em;text-transform:uppercase;padding-left:2px}.brand b{display:block;font-size:17px}
.brand.dark{padding:0;color:var(--ink);flex-direction:row;align-items:center}
.logo{width:38px;height:38px;border-radius:50%;background:var(--brand);color:#fff;font-family:Inter,sans-serif;font-weight:700;display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto}
.links{display:flex;flex-wrap:wrap;gap:4px}
.links a{flex:1 1 150px;display:flex;align-items:center;min-height:42px;padding:0 12px;border-radius:8px;color:#D9DBDE;text-decoration:none;border-left:3px solid transparent}
.links a:hover{background:#2E3236;color:#fff}
.links a.on{background:#2E2840;color:#fff;font-weight:600;border-left-color:var(--brand)}
.me{margin-top:auto;display:flex;flex-direction:column;gap:6px;font-size:13px;color:#B9BDC2;padding:0 6px}
.me a{color:#D8B4FE}
.linkbtn{background:none;border:0;color:#D8B4FE;font:inherit;padding:0;cursor:pointer;text-decoration:underline}
.navtoggle{display:none}
.main{flex:999 1 560px;min-width:0;padding:22px clamp(12px,3vw,34px);display:flex;flex-direction:column;gap:18px}
.main.solo{min-height:100vh;align-items:center;justify-content:center}
.ph{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px}
.ph h1{font-size:26px}.sub{margin:2px 0 0;color:var(--muted);font-size:14px}
.acts{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.card{background:#fff;border:1px solid var(--line);border-radius:12px;padding:16px;display:flex;flex-direction:column;gap:12px;min-width:0}
.card.narrow{max-width:520px}
.authbox{width:min(420px,100%)}
.cols{display:flex;flex-wrap:wrap;gap:16px;align-items:flex-start}
.grow1{flex:1 1 280px;min-width:0}.grow2{flex:2 1 420px;min-width:0}.grow3{flex:3 1 480px;min-width:0}
.stack{display:flex;flex-direction:column;gap:16px}
.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:12px}
.stat{background:#fff;border:1px solid var(--line);border-radius:12px;padding:14px 16px;display:flex;flex-direction:column;gap:4px;min-width:0}
.stat span{color:var(--muted);font-size:14px}.stat b{font-family:Inter,'Hind Siliguri',sans-serif;font-size:24px;line-height:1.2;overflow-wrap:anywhere}.stat small{color:var(--muted);font-size:13px}
.alerts{display:flex;flex-wrap:wrap;gap:10px}
.alert{flex:1 1 260px;display:flex;flex-direction:column;gap:2px;padding:12px 14px;border-radius:10px;text-decoration:none;border:1px solid}
.alert b{font-size:15px}.alert small{font-size:13px}
.alert.red{background:#FEF2F2;border-color:#FECACA;color:#7F1D1D}
.alert.orange{background:#FFF7ED;border-color:#FED7AA;color:#7C2D12}
.alert.blue{background:#EFF6FF;border-color:#BFDBFE;color:#1E3A8A}
.alert.green{background:#F0FDF4;border-color:#BBF7D0;color:#14532D}
label{display:flex;flex-direction:column;gap:5px;font-size:14px;font-weight:600;color:#374151;flex:1 1 220px;min-width:0}
label small{font-weight:400;color:var(--muted)}
input,select,textarea{min-height:44px;width:100%;padding:0 12px;border:1px solid #D1D5DB;border-radius:8px;background:#fff;font:inherit;font-weight:400;color:var(--ink)}
textarea{padding:10px 12px;min-height:64px;resize:vertical}
input:focus,select:focus,textarea:focus{outline:2px solid #C4B5FD;border-color:var(--brand)}
input[type=checkbox],input[type=radio]{width:20px;height:20px;min-height:0;accent-color:var(--brand)}
.money{font-family:Inter,sans-serif;font-size:18px}
.otp{font-family:Inter,sans-serif;letter-spacing:6px;font-size:20px}
.row{display:flex;flex-wrap:wrap;gap:12px}
.seg{border:0;padding:0;margin:0;display:flex;flex-wrap:wrap;gap:8px}
.seg legend{font-size:14px;font-weight:600;color:#374151;margin-bottom:6px}
.segopt{flex:0 1 auto;flex-direction:row;align-items:center;gap:8px;border:1px solid #D8B4FE;border-radius:999px;padding:8px 14px;cursor:pointer;font-weight:500}
.segopt:has(input:checked){background:var(--brand-soft);border-color:var(--brand)}
.btn{min-height:44px;display:inline-flex;align-items:center;justify-content:center;padding:0 18px;border-radius:8px;background:var(--brand);color:#fff;font:inherit;font-weight:600;border:1px solid var(--brand);text-decoration:none;cursor:pointer;white-space:nowrap}
.btn:hover{background:var(--brand-d);color:#fff}
.btn.ghost{background:#fff;color:var(--brand);border-color:#D8B4FE}.btn.ghost:hover{background:var(--brand-soft)}
.btn.danger{background:#fff;color:var(--neg);border-color:#FECACA}.btn.danger:hover{background:#FEF2F2}
.btn.sm{min-height:36px;padding:0 12px;font-size:14px}
.tabs{display:flex;flex-wrap:wrap;gap:8px}
.tab{min-height:44px;display:inline-flex;align-items:center;padding:0 16px;border-radius:999px;border:1px solid #D8B4FE;background:#fff;color:var(--brand);font-weight:600;text-decoration:none}
.tab.on{background:var(--brand);border-color:var(--brand);color:#fff}
.flash{padding:10px 14px;border-radius:8px;background:#ECFDF5;border:1px solid #A7F3D0;color:#065F46}
.flash.err{background:#FEF2F2;border-color:#FECACA;color:#7F1D1D}
.flash.warn{background:#FFF7ED;border-color:#FED7AA;color:#7C2D12}
.hint{margin:0;font-size:14px;color:#1D4ED8}
.muted{color:var(--muted)}.small{font-size:13px}
.pos{color:var(--pos)}.neg{color:var(--neg)}.warnc{color:var(--warn)}
.li{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:8px 0;border-bottom:1px solid #F3F4F6}
.li:last-child{border-bottom:0}
.li small{display:block;color:var(--muted);font-size:13px}
.pill{display:inline-block;padding:2px 10px;border-radius:999px;font-size:12px;font-weight:600;white-space:nowrap}
.pill.ok{background:#DCFCE7;color:#166534}.pill.warn{background:#FFEDD5;color:#9A3412}.pill.bad{background:#FEE2E2;color:#991B1B}.pill.info{background:#E0E7FF;color:#3730A3}.pill.gray{background:#F3F4F6;color:#374151}
.tw{overflow-x:auto;-webkit-overflow-scrolling:touch}
table.t{width:100%;border-collapse:collapse;font-size:14px}
table.t th{text-align:left;font-weight:600;color:var(--muted);padding:8px 6px;border-bottom:1px solid var(--line);white-space:nowrap}
table.t td{padding:9px 6px;border-bottom:1px solid #F3F4F6;vertical-align:top}
table.t td.n,table.t th.n{text-align:right;font-family:Inter,'Hind Siliguri',sans-serif;white-space:nowrap}
table.t tr.tot td{font-weight:700;border-top:2px solid var(--ink)}
table.t tr.sel td{background:var(--brand-soft)}
.bar{height:9px;background:#F3F4F6;border-radius:5px;overflow:hidden}.bar i{display:block;height:9px;background:var(--brand)}
.chart{width:100%;height:220px;display:block}
.legend{display:flex;flex-wrap:wrap;gap:14px;font-size:13px;color:#374151}
.legend i{display:inline-block;width:14px;height:4px;margin-right:6px;vertical-align:middle}
.filters{flex-direction:row;flex-wrap:wrap;align-items:flex-end}
.filters label{flex:1 1 160px}
.check{display:flex;align-items:center;justify-content:center;width:44px;height:44px;cursor:pointer;flex:0 0 auto}
.hide{display:none!important}
/* Letterhead pages (vouchers, statements, reports) */
.printbar{position:sticky;top:0;background:#fff;border-bottom:1px solid var(--line);padding:10px;display:flex;flex-wrap:wrap;gap:8px;justify-content:center;align-items:center;z-index:5;width:100%}
.main.solo:has(.paper){justify-content:flex-start;padding:0 0 30px}
.paper{position:relative;background:#fff;width:100%;max-width:794px;margin:18px auto 0;box-shadow:0 1px 4px rgba(0,0,0,.12);display:flex;flex-direction:column;min-height:1123px;overflow:hidden}
.lh-head{display:flex;justify-content:space-between;align-items:center;gap:16px;padding:34px 40px 14px}
.lh-logo{height:46px;width:auto}
.lh-addr{display:flex;flex-direction:column;font-family:Poppins,Inter,sans-serif;font-size:11px;color:#333;text-align:left;line-height:1.55}
.lh-addr b{color:#8B2FE0;font-size:15px;font-weight:600}
.lh-rule{margin:0 40px;height:2px;background:#8B2FE0;position:relative}
.lh-rule i{position:absolute;left:28%;width:44%;top:-1.5px;height:5px;background:#8B2FE0;border-radius:3px}
.lh-mark{position:absolute;left:50%;top:50%;width:230px;transform:translate(-50%,-50%);opacity:.9;pointer-events:none;z-index:0}
.lh-foot{background:#8B2FE0;color:#fff;text-align:center;font-family:Poppins,Inter,sans-serif;font-weight:500;font-size:14px;padding:10px 16px}
.lh-bottom{margin-top:auto}
.lhwrap{width:100%;border-collapse:collapse;position:relative;z-index:1;flex:1 1 auto}
.lhwrap>thead>tr>td,.lhwrap>tfoot>tr>td{padding:0}
.lh-sp-top,.lh-sp-bot{height:0}
.lh-body{padding:22px 40px 30px;vertical-align:top}
.sheet{display:flex;flex-direction:column;gap:14px;min-height:860px;page-break-after:always;break-after:page;padding-bottom:10px}
.sheet:last-child{page-break-after:auto;break-after:auto}
.sheet+.sheet{border-top:1px dashed #ddd;padding-top:22px}
.sh-title{display:flex;justify-content:space-between;align-items:flex-end;gap:10px;flex-wrap:wrap}
.sh-title h2{font-size:22px;letter-spacing:.02em}
.sh-meta{text-align:right;font-size:13px;color:#333}
.sigs{display:grid;grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:18px;margin-top:auto;padding-top:70px;font-size:12px;text-align:center;color:#374151}
.sigs div{border-top:1px solid #6B7280;padding-top:6px}
.kv{display:grid;grid-template-columns:minmax(120px,32%) 1fr;gap:8px 14px;font-size:14px}
.kv span:nth-child(odd){color:var(--muted)}
.amtbox{border-radius:8px;padding:14px;display:flex;flex-direction:column;gap:2px}
.amtbox b{font-family:Inter,sans-serif;font-size:26px}
.copy{color:#B91C1C;font-weight:700;border:2px solid #B91C1C;padding:2px 10px;border-radius:6px;align-self:flex-start;letter-spacing:.1em}
.rep h2{font-size:17px;margin:6px 0}
.rep table.t{font-size:12.5px}
@media (max-width:779px){
  .navtoggle{display:inline-flex;align-self:center;min-height:40px;padding:0 14px;border-radius:8px;border:1px solid #4A4F55;background:#2E2840;color:#fff;font:inherit;cursor:pointer}
  .side{padding:12px}
  .side .links{display:none}
  .side.open .links{display:flex}
  .side{flex-direction:row;flex-wrap:wrap;align-items:center;justify-content:space-between}
  .side .links,.side .me{flex:1 1 100%}
  .me{margin-top:0}
  .ph h1{font-size:22px}
  .stat b{font-size:20px}
  .sheet{padding:20px 16px;min-height:0}
}
@media print{
  @page{size:A4;margin:0}
  html,body{background:#fff}
  body{font-size:11pt;-webkit-print-color-adjust:exact;print-color-adjust:exact}
  .side,.printbar,.noprint,.flash,.navtoggle{display:none!important}
  .main,.main.solo{padding:0!important;display:block}
  .paper{box-shadow:none;margin:0;max-width:none;min-height:0;overflow:visible;display:block}
  .lh-top{position:fixed;top:0;left:0;right:0;background:#fff;z-index:2}
  .lh-bottom{position:fixed;bottom:0;left:0;right:0;z-index:2}
  .lh-mark{position:fixed;top:50%;left:50%}
  .lh-sp-top{height:120px}
  .lh-sp-bot{height:60px}
  .lh-body{padding:8px 40px 0}
  .sheet{min-height:0;height:auto;border:0!important;padding-top:0!important}
  .sheet .sigs{padding-top:60px}
  .card{border:0;padding:0;box-shadow:none}
  a{color:inherit;text-decoration:none}
  .tw{overflow:visible}
  table.t tr{break-inside:avoid}
}
table.t td.c,table.t th.c{text-align:center}
table.t.perm input{width:18px;height:18px}
table.t tr.on td{background:#F5F0FF}
.card>label,.card>.segopt,.authbox label{flex:0 0 auto}
.authhead{display:flex;flex-direction:column;align-items:center;gap:6px;padding:4px 0 6px}.authhead img{height:44px;width:auto}.authhead span{font-size:13px;font-weight:600;letter-spacing:.12em;text-transform:uppercase;color:var(--muted)}
form>label,.stack>label{flex:0 0 auto}
.periodbar{display:flex;flex-wrap:wrap;gap:8px;align-items:center}.periodbar input[type=date]{min-height:34px;padding:0 8px;border:1px solid var(--line);border-radius:8px;font:inherit;font-size:13px}
.milestones{display:flex;flex-wrap:wrap;gap:0;position:relative}
.ms{flex:1 1 120px;display:flex;flex-direction:column;align-items:center;text-align:center;gap:2px;padding:10px 6px;position:relative}
.ms::before{content:"";position:absolute;top:24px;left:0;right:0;height:3px;background:#E5E7EB;z-index:0}
.ms:first-child::before{left:50%}.ms:last-child::before{right:50%}
.ms.done::before{background:#16A34A}
.ms i{font-style:normal;width:30px;height:30px;border-radius:999px;display:grid;place-items:center;background:#fff;border:2px solid #D1D5DB;color:#9CA3AF;z-index:1;font-size:14px}
.ms.done i{border-color:#16A34A;background:#16A34A;color:#fff}
.ms.be i{width:36px;height:36px}
.ms b{font-size:13px;margin-top:4px}.ms span{font-family:Inter,sans-serif;font-size:13px}.ms small{color:var(--muted);font-size:11px}
.salsheet table.sal{font-size:12px;width:100%}
.salsheet table.sal th{font-size:11px;padding:6px 4px;border-bottom:1.5px solid #111827;color:#111827;white-space:normal}
.salsheet table.sal td{padding:8px 4px;vertical-align:top;border-bottom:1px solid #D1D5DB}
.salsheet table.sal td small{color:#4B5563;font-size:10.5px}
.salsheet .signcell{width:120px;min-width:110px;height:44px;border-left:1px dashed #D1D5DB;position:relative}
.salsheet .paidtag{position:absolute;right:4px;bottom:2px;color:#166534;font-weight:600}
.salsheet tfoot td{font-weight:700;border-top:1.5px solid #111827;border-bottom:0}
.sal-sigs{padding-top:70px!important}
.salgrid input{min-height:36px;padding:0 8px;border:1px solid var(--line);border-radius:6px;font:inherit;font-size:14px;margin:2px 0;display:block}
/* HR & employee portal */
.tabs{margin-bottom:4px}
.badge{display:inline-flex;min-width:20px;height:20px;padding:0 6px;border-radius:999px;background:var(--brand);color:#fff;font-size:12px;font-weight:700;align-items:center;justify-content:center}
.tab.on .badge{background:#fff;color:var(--brand)}
.me .bell .badge{margin-left:4px}
.notes{list-style:none;margin:0;padding:0;display:flex;flex-direction:column}
.notes li{border-bottom:1px solid var(--line)}
.notes li:last-child{border-bottom:0}
.notes a{display:flex;flex-direction:column;gap:2px;padding:10px 4px 10px 12px;color:var(--ink);text-decoration:none;border-left:3px solid transparent}
.notes a:hover{background:#FAFAFA}
.notes span{font-size:14px;color:var(--muted)}
.notes small{font-size:12px;color:var(--muted)}
.notes li.unread a{background:#FAF5FF;border-left-color:var(--brand)}
.notes li.lv-bad b{color:var(--neg)}.notes li.lv-warn b{color:var(--warn)}.notes li.lv-ok b{color:var(--pos)}
.btn.big{min-height:56px;font-size:18px;padding:0 28px}
.startbox{border:2px solid var(--brand)}
.warnbox{border:2px solid var(--warn);background:#FFFBEB}
.breakbtns{display:flex;flex-wrap:wrap;gap:8px}
.chk{display:flex;flex-direction:row;align-items:center;gap:10px;font-weight:500}
.chk input{width:20px;height:20px;min-height:0}
.esign{font-family:'Brush Script MT','Segoe Script',cursive;font-size:22px;color:#1e3a8a;font-style:italic}
[hidden]{display:none!important}
/* Roster */
.roster th,.roster td{text-align:center;vertical-align:top;min-width:96px}
.roster th:first-child,.roster td:first-child{text-align:left;min-width:150px}
.roster .today{background:#FAF5FF}
.roster tr.mine td{background:#FFFBEB}
.rsel{min-height:36px;padding:4px 6px;font-size:14px;width:100%}
.rsel.on{border-color:var(--pos);background:#ECFDF5}
.rsel.off{color:var(--muted);background:#F3F4F6}
.roster tr.cov td{font-size:13px}
.roster td.short{background:#FEE2E2;color:var(--neg)}
.roster td.okc{background:#ECFDF5;color:var(--pos)}
.weekrow{display:grid;grid-template-columns:repeat(7,1fr);gap:6px}
.weekrow .wd{border:1px solid var(--line);border-radius:8px;padding:8px 6px;text-align:center;font-size:13px;display:flex;flex-direction:column;gap:4px}
.weekrow .wd.today{border-color:var(--brand);background:#FAF5FF}
@media (max-width:640px){.weekrow{grid-template-columns:repeat(4,1fr)}}
/* Courier handover */
a.ordcard{display:block;text-decoration:none;color:var(--ink);border-left:4px solid var(--warn)}
a.ordcard.bad{border-left-color:var(--neg);background:#FEF2F2}
.orders tr.lv-warn td{background:#FFFBEB}
.orders tr.lv-late td{background:#FEF2F2}
.orders tr.lv-late td:first-child{border-left:4px solid var(--neg)}
.orders tr.veryold td:first-child b{color:var(--neg)}
/* Sidebar sections by department */
.links{flex-direction:column;flex-wrap:nowrap;gap:2px}
.links a{flex:0 0 auto}
.navgrp{display:flex;flex-direction:column;gap:2px;margin-top:6px}
.navgrp summary{list-style:none;cursor:pointer;display:flex;align-items:center;justify-content:space-between;min-height:36px;padding:0 12px;color:#8E949A;font-size:12px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;border-radius:8px}
.navgrp summary::-webkit-details-marker{display:none}
.navgrp summary::after{content:'▸';font-size:12px;transition:transform .15s}
.navgrp[open] summary::after{transform:rotate(90deg)}
.navgrp summary:hover{background:#2E3236;color:#fff}
.navgrp a{padding-left:20px}
.chips{display:flex;flex-wrap:wrap;gap:8px}
.chip{display:inline-flex;align-items:center;gap:6px;padding:6px 6px 6px 12px;border:1px solid var(--line);border-radius:999px;background:#fff;font-size:14px}
.chip form{display:inline}
.chip button{border:0;background:#F3F4F6;border-radius:50%;width:24px;height:24px;cursor:pointer;font-size:16px;line-height:1;color:var(--neg)}
.navgrp{margin-top:12px;padding-top:10px;border-top:1px solid #383C40}
.navgrp summary{min-height:38px}
.links > a:first-child{margin-bottom:0}
/* ---------- Phone layout ---------- */
.topacts{display:none;align-items:center;gap:8px}
.bellm{position:relative;display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;border-radius:8px;background:#2E2840;text-decoration:none;font-size:18px}
.bellm .badge{position:absolute;top:-6px;right:-6px}
.tab.custom{display:inline-flex;flex-wrap:wrap;gap:6px;align-items:center}
@media (max-width:779px){
  .topacts{display:flex}
  .side .me{display:none}
  .side.open .me{display:flex;border-top:1px solid #383C40;padding-top:10px}
  .side .brand{flex-direction:row;align-items:baseline;gap:8px}
  .side .brand .logoimg{height:28px}
  .main{padding:14px 12px 28px;gap:14px}
  .ph{gap:8px}
  .ph .acts{width:100%;display:flex;flex-wrap:wrap;gap:8px}
  .ph .acts .btn,.ph .acts form{flex:1 1 auto}
  .ph .acts form .btn{width:100%}
}
@media (max-width:640px){
  .grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .stat{padding:10px 12px;border-radius:10px}
  .stat span{font-size:12.5px}
  .stat b{font-size:18px}
  .stat small{font-size:11.5px}
  .card{padding:12px;border-radius:10px}
  .card h2{font-size:17px}
  .tabs{flex-wrap:nowrap;overflow-x:auto;-webkit-overflow-scrolling:touch;padding-bottom:4px;scrollbar-width:none}
  .tabs::-webkit-scrollbar{display:none}
  .tabs .tab{flex:0 0 auto;min-height:38px;padding:0 14px;font-size:14px;white-space:nowrap}
  .periodbar{gap:6px}
  .periodbar .tab{min-height:38px;padding:0 12px;font-size:14px}
  .tab.custom{width:100%;border-radius:12px;padding:8px 10px}
  .tab.custom input[type=date]{flex:1 1 120px;min-width:0}
  .row > label,.row > div{flex:1 1 100%}
  .cols > *{flex:1 1 100%!important;min-width:0}
  .alerts{grid-template-columns:1fr!important}
  .kv{grid-template-columns:1fr;gap:2px 0}
  .kv span:nth-child(odd){margin-top:8px;font-size:13px}
  /* stacked tables */
  .tw:has(> table.stk){overflow:visible}
  table.t.stk{border:0;font-size:14px}
  table.t.stk thead{display:none}
  table.t.stk,table.t.stk tbody,table.t.stk tfoot,table.t.stk tr,table.t.stk td{display:block;width:100%}
  table.t.stk tr{background:#fff;border:1px solid var(--line);border-radius:10px;padding:6px 12px;margin:0 0 10px}
  table.t.stk tr.tot{background:#F9FAFB;font-weight:600}
  table.t.stk td{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;padding:7px 0;border:0;border-bottom:1px dashed #ECEDEF;text-align:right;min-height:0}
  table.t.stk td:last-child{border-bottom:0}
  table.t.stk td::before{content:attr(data-label);flex:0 0 38%;text-align:left;color:var(--muted);font-size:12.5px;font-weight:600;padding-top:2px}
  table.t.stk td[data-label=""]::before{display:none}
  table.t.stk td[data-label=""]{justify-content:flex-start;text-align:left}
  table.t.stk td.empty{display:none}
  table.t.stk td > *{max-width:62%}
  table.t.stk td[data-label=""] > *{max-width:100%}
  table.t.stk td form,table.t.stk td details{text-align:left}
  table.t.stk td input,table.t.stk td select{max-width:100%}
  table.t.stk td.nowrap{white-space:normal}
  .orders tr.lv-late{border-left:4px solid var(--neg)!important}
  .orders tr.lv-warn td,.orders tr.lv-late td{background:transparent}
  .orders tr.lv-warn{background:#FFFBEB!important}.orders tr.lv-late{background:#FEF2F2!important}
  .roster th,.roster td{min-width:84px}
  .weekrow{grid-template-columns:repeat(4,1fr)}
  .btn.big{width:100%}
  .breakbtns .btn{flex:1 1 40%}
}
@media (max-width:640px){
  table.t.stk td{border-top:0!important}
  table.t.stk td > .cv{flex:1 1 auto;min-width:0;max-width:62%;text-align:right;overflow-wrap:anywhere}
  table.t.stk td[data-label=""] > .cv{max-width:100%;text-align:left}
  table.t.stk td > .cv form,table.t.stk td > .cv details{display:inline-block;text-align:left}
  table.t.stk tr.tot td{border-bottom:1px dashed #E5E7EB}
  .navtoggle{min-height:40px;align-items:center}
}
@media (max-width:640px){ table.t.stk td[data-label=""] > .cv{display:flex;flex-wrap:wrap;gap:8px;align-items:center} }
/* Tasks, targets, performance */
.taskrow{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:10px;padding:10px 0;border-bottom:1px solid var(--line)}
.taskrow.done b{text-decoration:line-through;color:var(--muted)}
.taskdone{display:flex;gap:6px;flex-wrap:wrap}.taskdone input{min-height:36px;width:200px}
.linkbtn.small{font-size:12px}
.bar{height:6px;background:#EEF0F2;border-radius:99px;overflow:hidden;margin-top:6px}.bar i{display:block;height:100%;background:var(--pos)}
.stat.big b{font-size:30px}
.badges{flex-direction:row;flex-wrap:wrap;gap:8px;background:#FFFBEB;border-color:#FDE68A}
.badgecard{padding:6px 12px;border-radius:999px;background:#fff;border:1px solid #FDE68A;font-weight:600;font-size:14px}
a.ordcard.okc{border-left-color:var(--pos)}
.chkgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:4px;border:1px solid var(--line);border-radius:10px;padding:10px;max-height:260px;overflow:auto}
.perf tr.pl-bad td{background:#FEF2F2}.perf tr.pl-good td{background:#F0FDF4}
.awards{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:10px}
@media (max-width:640px){.perf tr.pl-bad{background:#FEF2F2!important}.perf tr.pl-good{background:#F0FDF4!important}.perf tr td{background:transparent!important}.taskdone input{width:100%}}
.thread{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px}
.thread li{background:#F9FAFB;border:1px solid var(--line);border-radius:10px;padding:8px 12px;max-width:85%}
.thread li.mine{align-self:flex-end;background:#F5F0FF;border-color:#E9D5FF}
.thread p{margin:4px 0 0}
.draftbox{border:1px dashed #D8B4FE;border-radius:10px;padding:10px;display:flex;flex-direction:column;gap:8px;background:#FFFBFB}
.items{border:1px solid var(--line);border-radius:10px;padding:10px;display:flex;flex-direction:column;gap:6px}
.itemrow{flex-wrap:nowrap}.itemrow input{min-width:0}
@media (max-width:640px){.itemrow{flex-wrap:wrap}.itemrow input{flex:1 1 30%}.itemrow input:first-child{flex:1 1 100%}}

/* ---------- Phase 4: stock, packing, chat ---------- */
.packscan input{font-size:1.15rem}
.packitems tr.okrow td{background:#e8f6ec}
.packitems tr.overrow td{background:#fde8e8}
.packmsg{margin:.6rem 0;padding:.8rem 1rem;border-radius:10px;font-weight:600;min-height:1.2em}
.packmsg:empty{display:none}
.packmsg.ok{background:#e8f6ec;color:#17643a}
.packmsg.bad{background:#c62828;color:#fff;font-size:1.1rem;animation:kmshake .35s}
@keyframes kmshake{25%{transform:translateX(-6px)}75%{transform:translateX(6px)}}
.btn.big{padding:.9rem 1.4rem;font-size:1.05rem;width:100%}
.btn[disabled]{opacity:.45;cursor:not-allowed}
.camview{width:100%;max-width:420px;border-radius:10px;margin-top:.6rem;display:block}
.chatnote{margin:-.4rem 0 .6rem}
.chatwrap{display:grid;grid-template-columns:260px 1fr;gap:1rem;align-items:start}
.chatlist{padding:.6rem;max-height:75vh;overflow:auto}
.chatlist ul{list-style:none;margin:.4rem 0 0;padding:0}
.chatlist li a{display:flex;justify-content:space-between;align-items:center;gap:.4rem;padding:.55rem .6rem;border-radius:8px;color:inherit;text-decoration:none}
.chatlist li a:hover{background:rgba(0,0,0,.04)}
.chatlist li a.on{background:#eef3ff;font-weight:600}
.chatnew{gap:.4rem}
.chatmain{display:flex;flex-direction:column;min-height:60vh}
.chathead{display:flex;align-items:center;gap:.6rem;border-bottom:1px solid #eee;padding-bottom:.6rem;margin-bottom:.4rem}
.chathead>div{flex:1;min-width:0;display:flex;flex-direction:column}
.chathead small{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.chatback{display:none}
.chatmenu{position:relative}
.chatmenu>.card{position:absolute;right:0;top:110%;z-index:20;width:260px;max-height:60vh;overflow:auto}
.chatmsgs{flex:1;overflow:auto;max-height:60vh;min-height:300px;padding:.4rem;display:flex;flex-direction:column;gap:.35rem;background:#f7f8fa;border-radius:10px}
.msg{color:var(--ink,#111827);max-width:78%;align-self:flex-start;background:#fff;border:1px solid #e6e8ec;border-radius:12px 12px 12px 3px;padding:.45rem .7rem;word-wrap:break-word;overflow-wrap:anywhere}
.msg.mine{align-self:flex-end;background:#dcf3e5;border-color:#c5e8d3;border-radius:12px 12px 3px 12px}
.msg .who{display:block;font-weight:600;color:#3b5bdb}
.msg .at{display:block;font-size:.7rem;color:#888;text-align:right;margin-top:.15rem}
.msg img{max-width:240px;max-height:240px;border-radius:8px;display:block;margin-top:.3rem}
.msg a.file{display:inline-block;margin-top:.3rem}
.chatform{display:flex;gap:.4rem;align-items:flex-end;margin-top:.6rem}
.chatform textarea{flex:1;resize:none;min-height:2.6rem;margin:0}
.chatattach{cursor:pointer;font-size:1.4rem;padding:.3rem;margin:0}
.pickmany{max-height:240px;overflow:auto;border:1px solid #e6e8ec;border-radius:8px;padding:.4rem .6rem}
.pickmany .chk{display:flex;gap:.4rem;align-items:center;font-weight:400;margin:.2rem 0}
.pickmany .chk input{width:auto;margin:0}
#navchat .badge{margin-left:.3rem}
@media (max-width:760px){
  .chatwrap{grid-template-columns:1fr}
  .chatwrap.hasroom .chatlist{display:none}
  .chatback{display:inline-flex}
  .chatmsgs{max-height:58vh}
  .msg{max-width:88%}
}
.badge[hidden]{display:none}
.card .linkbtn{color:var(--brand)}
/* Dashboard custom period: keep dates inline on desktop */
.periodbar .tab.custom{border-radius:12px;padding:5px 6px 5px 14px;flex-wrap:nowrap}
.periodbar .tab.custom input[type=date]{width:auto;flex:0 0 auto;min-height:34px}
.periodbar .tab.custom .btn{min-height:34px}
@media (max-width:760px){.periodbar .tab.custom{flex-wrap:wrap;padding:8px 10px}.periodbar .tab.custom input[type=date]{flex:1 1 120px;min-width:0}}
/* Notifications at the top of the sidebar */
.notibar{display:flex;align-items:center;gap:8px;margin:-4px 0 0;padding:10px 12px;border-radius:10px;background:#2E2840;color:#E8E8E8;text-decoration:none;font-weight:600;font-size:15px}
.notibar .badge{margin-left:auto}
.notibar:hover{background:#3A3350}
.notibar.has{background:#7f1d1d;color:#fff;box-shadow:0 0 0 1px #dc2626 inset}
.notibar.has .badge{background:#fff;color:#b91c1c}
.notibar.on{outline:2px solid var(--brand)}
.bellm.has{background:#7f1d1d}
@media (max-width:760px){.notibar{display:none}}
/* Targets by department */
.tgdep>summary{cursor:pointer;list-style:none;display:flex;flex-wrap:wrap;align-items:center;gap:8px;font-size:16px}
.tgdep>summary::-webkit-details-marker{display:none}
.tgdep>summary::before{content:'▸';color:var(--muted)}
.tgdep[open]>summary::before{content:'▾'}
.tgdep[open]>summary{margin-bottom:10px}
.tgtable .xm{display:none}
.tgform.showall .tgtable .xm{display:table-cell}
.tgtable tr.tgall td{background:#F9FAFB}
.tgtable tr.tgnone td:first-child b{color:var(--muted)}
.tgtable input{min-height:38px}

/* ---------- Ecommystery ---------- */
.side{background:linear-gradient(180deg,#1E1A2B 0%,#231B33 100%)}
.brand .logoimg{max-width:170px;height:auto}
.links a.on{border-left-color:#E040A0}
.notibar.has{background:#6D1FB5;box-shadow:0 0 0 1px #C026D3 inset}
.notibar.has .badge{color:#6D1FB5}
.btn{background:linear-gradient(90deg,#8B2FE0,#C026D3);border-color:#8B2FE0}
.btn:hover{background:linear-gradient(90deg,#6C1FB5,#A21CAF)}
.btn.ghost,.btn.ghost:hover{background:#fff}
.tab.on{background:linear-gradient(90deg,#8B2FE0,#C026D3)}
h2.sect{font-size:15px;text-transform:uppercase;letter-spacing:.06em;color:var(--muted);margin:18px 0 8px}
.progress{height:12px;background:#EEE8F6;border-radius:999px;overflow:hidden;margin:8px 0}
.progress i{display:block;height:100%;background:linear-gradient(90deg,#8B2FE0,#E040A0,#F7B32B)}
.bars{display:flex;gap:10px;align-items:flex-end;height:180px;padding-top:10px}
.barcol{flex:1;display:flex;flex-direction:column;align-items:center;gap:2px;height:100%}
.barpair{flex:1;width:100%;display:flex;gap:3px;align-items:flex-end;justify-content:center}
.barpair i{width:40%;max-width:26px;border-radius:4px 4px 0 0;min-height:2px}
.barpair i.in,.dot.in{background:#8B2FE0}.barpair i.out,.dot.out{background:#F7B32B}
.barcol small{color:var(--muted)}.barcol b{font-size:12px}
.dot{display:inline-block;width:10px;height:10px;border-radius:3px;margin:0 4px 0 8px;vertical-align:middle}
.dgrid input{min-width:84px;min-height:38px;padding:0 8px}
.dgrid tr.grp td{background:#F5F0FF;font-weight:700;font-size:13px;color:var(--brand-d)}
.dgrid tr.nodata td:first-child b{color:var(--muted)}
.dgrid input.sug{background:#FFF7ED}
fieldset.box{border:1px solid var(--line);border-radius:10px;padding:10px 14px;margin:6px 0 10px}
fieldset.box legend{font-weight:600;padding:0 6px}
.notirow{display:block;padding:10px 12px;border-bottom:1px solid var(--line);color:inherit;text-decoration:none}
.notirow.unread{background:#FAF5FF;border-left:3px solid var(--brand)}
.invdoc h3{margin:18px 0 6px}
.invtop{display:flex;justify-content:space-between;gap:20px;margin-bottom:12px}
table.inv{width:100%}
.stamp{display:inline-block;border:3px solid #16A34A;color:#16A34A;font-weight:800;font-size:22px;padding:4px 14px;border-radius:8px;transform:rotate(-6deg);margin-top:6px}
.sigs div i{display:block}
@media (max-width:760px){.bars{height:140px;gap:4px}.invtop{flex-direction:column}}
.periodbar .tab.custom input[type=month]{width:auto;flex:0 0 auto;min-height:34px;padding:0 8px;border:1px solid var(--line);border-radius:8px;font-size:13px}
.periodbar .tab.custom{border-radius:12px;padding:5px 6px 5px 14px}
@media (max-width:760px){.periodbar .tab.custom input[type=month]{flex:1 1 120px;min-width:0}}
