/* =====================================================================================================
   Lazaro Scent — design system (light, clean, fast)
   One stylesheet for every page. No blur, no looping animations, no web fonts: renders fast on any PC.
   Colours come from the variables below; inline page styles use the same variables.
   ===================================================================================================== */
:root{
  --bg:#f5f6f8; --bg2:#f0f1f4; --sf:255,255,255; --surface:#fff; --dlg:#fff; --cs:light;
  --ink:#111827; --ink2:#374151; --mute:#6b7280; --fg:17,24,39; --bgc:17,24,39;
  --line:#e3e5ea; --line2:#d1d5db; --fill:#fff; --glow:transparent;
  --g0:#fff; --g1:#fafafb; --g2:#f3f4f6; --g3:#e5e7eb; --g4:#d1d5db; --g5:#9ca3af; --gline:#eceef1;
  --brand:#111827; --brand-ink:#fff; --accent:#2563eb; --accent-soft:#eff4ff;
  --ok:#15803d; --ok-soft:#ecfdf3; --warn:#b45309; --warn-soft:#fff7ed; --bad:#b91c1c; --bad-soft:#fef2f2;
  --r:10px; --r-sm:8px; --r-lg:14px; --r-pill:999px;
  --sh1:0 1px 2px rgba(17,24,39,.06); --sh2:0 4px 16px -4px rgba(17,24,39,.12); --sh3:0 24px 60px -20px rgba(17,24,39,.35);
  --font:Inter,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans Arabic",Tahoma,sans-serif;
  --tb-h:56px;
}
*,*::before,*::after{box-sizing:border-box}
html{height:100%; -webkit-text-size-adjust:100%}
body{margin:0; min-height:100%; font:400 14px/1.5 var(--font); color:var(--ink); background:var(--bg);
  font-variant-numeric:tabular-nums; -webkit-font-smoothing:antialiased; display:flex; flex-direction:column; align-items:center}
a{color:inherit} img{max-width:100%}
h1,h2,h3,h4{color:var(--ink); letter-spacing:-.01em}
::selection{background:#dbe6ff}
:focus-visible{outline:2px solid var(--accent); outline-offset:2px}
[hidden]{display:none !important}
.dim,.mut,.mute{color:var(--mute)}
.grow{flex:1}

/* ----------------------------------------------------------------------------------- page layout */
main{flex:1; width:100%; display:flex; flex-direction:column; align-items:center; justify-content:center; padding:24px 16px; gap:24px}
.content{width:100%; max-width:1400px; flex:1; display:flex; flex-direction:column; padding:20px 24px 0; margin:0 auto}
body.has-tb .content{padding-top:calc(var(--tb-h) + 20px)}
.content > footer,main > footer,footer{margin-top:auto; padding:18px 0; font-size:12px; color:var(--mute); text-align:center}
.page-head{margin:0 0 16px}
.page-head h1{margin:0; font-size:22px; font-weight:600}
.page-head .sub,p.sub{margin:4px 0 0; color:var(--mute); font-size:13.5px}
.page-head .back,.back{display:inline-block; margin:0 0 6px; font-size:13px; color:var(--mute); text-decoration:none}
.page-head .hd{display:flex; flex-wrap:wrap; gap:10px; align-items:center}
.rise{animation:rise .25s ease-out both}
@keyframes rise{from{opacity:0; transform:translateY(6px)}}
@media (prefers-reduced-motion:reduce){*{animation:none !important; transition:none !important}}

/* ----------------------------------------------------------------------------------- top bar */
.tb{position:fixed; z-index:30; top:0; left:0; right:0; height:var(--tb-h); display:flex; align-items:center; gap:12px; padding:0 16px;
  background:var(--surface); border-bottom:1px solid var(--line)}
.tb-brand{display:flex; align-items:center; flex:none; text-decoration:none}
.tb-brand .brand{height:22px; width:auto; max-width:120px}
.brand{display:block; object-fit:contain}
.brand:not(.invert){filter:invert(1)}                       /* the logo artwork is white: dark on the light theme */
.brand-text{font-weight:700; letter-spacing:.16em; font-size:13px}
.tb-nav{display:flex; align-items:center; gap:2px; flex:1; min-width:0; overflow:visible}
.tb-link,.tb-gb{display:inline-flex; align-items:center; gap:6px; height:34px; padding:0 11px; border-radius:var(--r-sm); border:0; background:none;
  color:var(--ink2); font:500 13.5px var(--font); text-decoration:none; cursor:pointer; white-space:nowrap}
.tb-link svg{width:16px; height:16px; flex:none} .tb-gb svg{width:13px; height:13px; opacity:.6}
.tb-link:hover,.tb-gb:hover,.tb-grp.open>.tb-gb{background:var(--g2); color:var(--ink)}
.tb-link.on,.tb-grp.on>.tb-gb{background:var(--g2); color:var(--ink); box-shadow:inset 0 -2px 0 var(--brand)}
.tb-grp,.tb-user{position:relative}
.tb-dd{position:absolute; top:calc(100% + 6px); left:0; min-width:220px; z-index:40; display:none}
.tb-ud{left:auto; right:0}
.tb-ddi{background:var(--surface); border:1px solid var(--line); border-radius:var(--r); box-shadow:var(--sh2); padding:6px}
.tb-grp.open>.tb-dd,.tb-user.open>.tb-dd{display:block}
@media (hover:hover) and (min-width:901px){.tb-grp:hover>.tb-dd{display:block} .tb-grp:hover>.tb-gb{background:var(--g2)}}
.tb-item{display:flex; align-items:center; gap:10px; padding:8px 10px; border-radius:var(--r-sm); color:var(--ink2); text-decoration:none; font-size:13.5px; white-space:nowrap}
.tb-item .ic{display:inline-flex; width:18px; height:18px; color:var(--mute)} .tb-item .ic svg{width:18px; height:18px}
.tb-item:hover{background:var(--g2); color:var(--ink)} .tb-item.active{background:var(--accent-soft); color:var(--accent)} .tb-item.active .ic{color:var(--accent)}
.tb-item.needs::after,.tb-gb.needs::after{content:''; margin-left:auto; width:7px; height:7px; border-radius:50%; background:#f97316}
.tb-gb.needs::after{margin-left:2px}
.tb-tools{display:flex; align-items:center; gap:6px; flex:none}
.tb-btn{position:relative; width:34px; height:34px; display:inline-flex; align-items:center; justify-content:center; border-radius:var(--r-sm); color:var(--ink2); text-decoration:none}
.tb-btn:hover{background:var(--g2)} .tb-btn svg{width:18px; height:18px}
.tb-btn.spin svg{animation:spin .6s linear} @keyframes spin{to{transform:rotate(360deg)}}
.bellN{position:absolute; top:3px; right:3px; min-width:16px; height:16px; padding:0 4px; border-radius:8px; background:#ef4444; color:#fff; font:600 10px/16px var(--font); font-style:normal; text-align:center}
.tb-theme{display:none !important}
.tb-ub{display:flex; align-items:center; gap:8px; height:38px; padding:0 8px 0 4px; border:0; border-radius:var(--r-sm); background:none; color:var(--ink); font:500 13.5px var(--font); cursor:pointer}
.tb-ub:hover,.tb-user.open>.tb-ub{background:var(--g2)}
.tb-av,.th-av{position:relative; width:30px; height:30px; border-radius:50%; display:inline-flex; align-items:center; justify-content:center; background:var(--g3); color:var(--ink2); font-size:11.5px; font-weight:600; flex:none}
.tb-av img,.th-av img{position:absolute; inset:0; width:100%; height:100%; border-radius:50%; object-fit:cover}
.sb-dot{position:absolute; right:-1px; bottom:-1px; width:10px; height:10px; border-radius:50%; border:2px solid var(--surface); background:#22c55e}
.tb-user[data-s="Busy"] .sb-dot{background:#ef4444} .tb-user[data-s="Break"] .sb-dot{background:#f59e0b} .tb-user[data-s="Meeting"] .sb-dot{background:#3b82f6} .tb-user[data-s="Offline"] .sb-dot,.tb-user[data-s="AFK"] .sb-dot{background:#9ca3af}
.tb-me{padding:8px 10px 10px; border-bottom:1px solid var(--line); margin-bottom:6px} .tb-me b{display:block; font-weight:600} .tb-me small{color:var(--mute)}
.tb-st{display:flex; align-items:center; justify-content:space-between; gap:8px; padding:6px 10px} .tb-st small{color:var(--mute)}
.tb-st select{height:30px; border:1px solid var(--line); border-radius:var(--r-sm); background:var(--surface); font:inherit; padding:0 6px}
.tb-burger{display:none; width:36px; height:36px; border-radius:var(--r-sm); border:1px solid var(--line); background:var(--surface); color:var(--ink); cursor:pointer; align-items:center; justify-content:center}
.tb-burger svg{width:18px; height:18px}
@media (max-width:1180px){.tb-link svg{display:none} .tb-link:first-child svg{display:inline} .tb-un{display:none}}
@media (max-width:900px){
  .tb-burger{display:inline-flex}
  .tb-nav{position:absolute; top:var(--tb-h); left:0; right:0; display:none; flex-direction:column; align-items:stretch; gap:2px; padding:8px; background:var(--surface); border-bottom:1px solid var(--line); box-shadow:var(--sh2); max-height:calc(100vh - var(--tb-h)); overflow:auto}
  .tb-nav.open{display:flex}
  .tb-link,.tb-gb{height:40px; justify-content:flex-start} .tb-link svg{display:inline}
  .tb-dd{position:static; min-width:0} .tb-ddi{box-shadow:none; border:0; padding:0 0 0 14px}
  .content{padding:16px 12px 0} body.has-tb .content{padding-top:calc(var(--tb-h) + 14px)}
}
.lockpill{position:fixed; z-index:9999; right:14px; bottom:14px}

/* ----------------------------------------------------------------------------------- buttons */
.btn,.act,.pbtn,.mini,.icon-btn,.smb,.rbtn,.abtn,.chip,.badge,.tagadd,.del{font-family:var(--font)}
.btn{display:inline-flex; align-items:center; justify-content:center; gap:6px; width:100%; height:40px; padding:0 18px; border:1px solid var(--brand); border-radius:var(--r);
  background:var(--brand); color:var(--brand-ink); font-size:14px; font-weight:500; text-decoration:none; cursor:pointer; white-space:nowrap; transition:background .12s, border-color .12s}
.btn:hover{background:#1f2937} .btn:active{transform:translateY(1px)}
.btn.sm{width:auto; height:34px; padding:0 14px; font-size:13.5px}
.btn.ghost{background:var(--surface); color:var(--ink); border-color:var(--line2)} .btn.ghost:hover{background:var(--g2); border-color:var(--g5)}
.btn.ghost.on,.btn.on:not(.ghost){background:var(--brand); color:var(--brand-ink); border-color:var(--brand)}
.btn.red,.btn.danger{background:var(--bad); border-color:var(--bad)}
.btn:disabled,.act:disabled,.pbtn:disabled{opacity:.45; cursor:not-allowed; transform:none}
.icon-btn{display:inline-flex; align-items:center; justify-content:center; width:32px; height:32px; border:0; border-radius:var(--r-sm); background:none; color:var(--mute); cursor:pointer; font-size:15px}
.icon-btn:hover{background:var(--g2); color:var(--ink)}
.act,.rbtn,.smb,.abtn{display:inline-flex; align-items:center; gap:4px; height:28px; padding:0 10px; border:1px solid var(--line2); border-radius:var(--r-sm); background:var(--surface); color:var(--ink2); font-size:12.5px; cursor:pointer; white-space:nowrap; text-decoration:none}
.act:hover,.rbtn:hover,.smb:hover,.abtn:hover{border-color:var(--g5); color:var(--ink)}
.act.done{background:var(--ok-soft); border-color:#bbe5c8; color:var(--ok)}
.smb.warn,.abtn.warn{color:var(--bad); border-color:#f3c4c4}
.pbtn{display:flex; align-items:center; gap:6px; width:100%; padding:7px 10px; border:0; border-radius:var(--r-sm); background:none; color:var(--ink); font-size:13px; text-align:left; cursor:pointer}
.pbtn:hover,.pbtn.on{background:var(--g2)}
.mini{width:24px; height:24px; border:1px solid var(--line); border-radius:6px; background:var(--surface); cursor:pointer; color:var(--mute)}
.del{height:28px; padding:0 10px; border:1px solid #f3c4c4; border-radius:var(--r-sm); background:var(--surface); color:var(--bad); cursor:pointer}
.rowact{display:flex; gap:6px; flex-wrap:wrap}

/* ----------------------------------------------------------------------------------- inputs */
.input,select,textarea,input[type=date],input[type=time]{font:inherit; color:var(--ink)}
.input,.tbl-in{height:36px; padding:0 10px; border:1px solid var(--line2); border-radius:var(--r-sm); background:var(--surface); color:var(--ink); font-size:13.5px; max-width:100%}
textarea.input{height:auto; padding:8px 10px; line-height:1.5; resize:vertical}
.input:focus,.tbl-in:focus,.field input:focus,.field select:focus,.field textarea:focus{outline:none; border-color:var(--accent); box-shadow:0 0 0 3px rgba(37,99,235,.15)}
select.input,.field select{appearance:none; background:var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%236b7280' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 10px center/10px; padding-right:28px}
.tbl-in{width:100%; height:32px} .tbl-in.r{text-align:right}
input[type=checkbox],input[type=radio]{accent-color:var(--brand); width:15px; height:15px}
.field{position:relative; margin-bottom:12px}
.field input,.field select,.field textarea{width:100%; height:46px; padding:18px 12px 4px; border:1px solid var(--line2); border-radius:var(--r-sm); background:var(--surface); color:var(--ink); font:inherit; font-size:14px}
.field textarea{height:auto; min-height:84px; padding-top:22px}
.field label{position:absolute; left:12px; top:13px; font-size:14px; color:var(--mute); pointer-events:none; transition:all .12s}
.field input:focus + label,.field input:not(:placeholder-shown) + label,.field textarea:focus + label,.field textarea:not(:placeholder-shown) + label,
.field select + label,.field .cmb-in:focus + label,.field .cmb-in:not(:placeholder-shown) + label{top:5px; font-size:11px; color:var(--mute)}
.field select.empty + label{top:13px; font-size:14px}
.field.bad input,.field.bad select,.field.bad textarea{border-color:var(--bad); background:var(--bad-soft)}
.field.wide{grid-column:1/-1}
.field.has-suffix input{padding-right:150px} .field .suffix{position:absolute; right:12px; top:20px; font-size:13px; color:var(--mute); pointer-events:none}
.cmb-ar{position:absolute; right:12px; top:20px; width:8px; height:8px; border-right:1.5px solid var(--mute); border-bottom:1.5px solid var(--mute); transform:rotate(45deg); cursor:pointer}
.cmb-pop{position:absolute; left:0; right:0; top:calc(100% + 4px); z-index:20; max-height:260px; overflow:auto; background:var(--surface); border:1px solid var(--line); border-radius:var(--r-sm); box-shadow:var(--sh2); padding:4px}
.cmb-pop.up{top:auto; bottom:calc(100% + 4px)}
.cmb-it{padding:7px 10px; border-radius:6px; cursor:pointer; font-size:13.5px} .cmb-it.on,.cmb-it:hover{background:var(--g2)} .cmb-it.sel{font-weight:600}
.cmb-no{padding:8px 10px; color:var(--mute); font-size:13px}
label.l,.fl{display:block; font-size:13px; color:var(--ink2); margin:10px 0 5px; font-weight:500}
.msg,.msg2{min-height:18px; margin:8px 0 0; font-size:13px; color:var(--bad)} .msg2.bad{color:var(--bad)}
.hint,.note{font-size:13px; color:var(--mute)}
.chk-l{font-size:13px; color:var(--ink2); margin:0 0 6px} .chk-g{display:flex; flex-wrap:wrap; gap:6px 14px; font-size:13.5px}

/* ----------------------------------------------------------------------------------- cards, panels, KPI tiles */
.card,.cardx,.blk,.scard,.box,.panel,.card2{background:var(--surface); border:1px solid var(--line); border-radius:var(--r-lg); padding:18px 20px; box-shadow:var(--sh1)}
.blk,.scard,.cardx{margin:0 0 16px} .blk h2,.scard h2,.cardx h3,.card h2{margin:0 0 12px; font-size:15px; font-weight:600}
.card{width:100%; max-width:420px}
.stats,.kpis{display:flex; flex-wrap:wrap; gap:8px; margin:0 0 14px}
.stats>span,.stats>div{display:flex; flex-direction:column; min-width:120px; padding:10px 14px; background:var(--surface); border:1px solid var(--line); border-radius:var(--r); font-size:12px; color:var(--mute)}
.stats b{order:-1; color:var(--ink); font-size:18px; font-weight:600; line-height:1.3}
.kp,.kpis{display:grid; grid-template-columns:repeat(auto-fit,minmax(160px,1fr)); gap:10px; margin:0 0 16px}
.kp>div,.kpi{background:var(--surface); border:1px solid var(--line); border-radius:var(--r); padding:12px 14px; box-shadow:var(--sh1)}
.kp small,.kpi span{display:block; font-size:12px; color:var(--mute); margin-bottom:2px} .kp b,.kpi b{display:block; font-size:20px; font-weight:600; color:var(--ink)}
.kp em,.kpi small{display:block; font-style:normal; font-size:12px; color:var(--mute)} .kp em.up{color:var(--ok)} .kp em.down{color:var(--bad)}
.kpi.good b{color:var(--ok)} .kpi.bad b{color:var(--bad)} .kpi.warn b{color:var(--warn)}
.grid2,.two{display:grid; grid-template-columns:repeat(auto-fit,minmax(320px,1fr)); gap:16px}
.fgrid,.form-grid,.ed-grid{display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:10px 14px}
.empty,.empty2{padding:40px 16px; text-align:center; color:var(--mute); font-size:13.5px}
.row,.bar2,.filters,.actions,.fbar,.tot3,.dlg-actions{display:flex; flex-wrap:wrap; align-items:center; gap:8px}
.bar2,.filters,.fbar{margin:0 0 12px}
.dlg-actions{justify-content:flex-end; margin-top:16px}
.tabs,.subtabs,.hrnav,.tabs2,#tabs{display:flex; flex-wrap:wrap; gap:6px; margin:0 0 14px}
.count{font-size:13px; color:var(--mute)}

/* ----------------------------------------------------------------------------------- chips, tags, status pills */
.tag,.pill,.chip,.chipx,.ty,.badge,.st,.rel{display:inline-flex; align-items:center; gap:4px; padding:1px 8px; border-radius:var(--r-pill); font-size:12px; line-height:18px; white-space:nowrap;
  border:1px solid var(--line2); background:var(--g1); color:var(--ink2)}
.tag[style*="--c"]{border-color:color-mix(in srgb,var(--c) 45%,transparent); background:color-mix(in srgb,var(--c) 12%,#fff); color:color-mix(in srgb,var(--c) 80%,#000)}
.st[style*="--c"],.ty[style*="--c"]{border-color:color-mix(in srgb,var(--c) 40%,transparent); background:color-mix(in srgb,var(--c) 10%,#fff); color:color-mix(in srgb,var(--c) 75%,#000)}
.tag.warn,.pill.warn,.pill.upd,.ty.pending,.ty.wait,.rel.requested,.pill.pending{background:var(--warn-soft); border-color:#fbd7a8; color:var(--warn)}
.pill.ok,.ty.approved,.ty.ok,.ty.in,.ty.closed,.rel.released,.pill.approved,.chipx.open{background:var(--ok-soft); border-color:#bbe5c8; color:var(--ok)}
.pill.bad,.ty.rejected,.ty.bad,.ty.out,.rel.rejected,.pill.rejected{background:var(--bad-soft); border-color:#f3c4c4; color:var(--bad)}
.pill.info,.ty.open,.ty.resell,.ty.Individual{background:var(--accent-soft); border-color:#c9d8fb; color:var(--accent)}
.ty.Business{background:#f5f0ff; border-color:#dccbfb; color:#6d28d9}
.chip button,.chips button{border:0; background:none; cursor:pointer; color:var(--mute); padding:0 2px}
.chips{display:flex; flex-wrap:wrap; gap:6px; margin:0 0 8px}
.badge{min-width:18px; justify-content:center; background:#ef4444; border-color:#ef4444; color:#fff; font-weight:600; padding:0 5px; margin-left:4px}
.okline{color:var(--ok)} .badline{color:var(--bad)} .warnc,.warn{color:var(--warn)} .badc,.short,.no2{color:var(--bad)} .okc,.ok2{color:var(--ok)}
.st-pending{color:#6b7280} .st-processing{color:#2563eb} .st-waiting-for-action{color:#b45309} .st-hold{color:#c2410c} .st-delivered{color:#15803d} .st-returned{color:#7c3aed} .st-cancel{color:#b91c1c}
.act[class*="st-"]{font-weight:500}

/* ----------------------------------------------------------------------------------- tables */
table{border-collapse:collapse; width:100%; font-size:13px}
th{font-weight:600; color:var(--ink2); text-align:left}
td.num,th.num,td.r,th.r,td.qty{text-align:right; font-variant-numeric:tabular-nums}
td.num.neg,.neg{color:var(--bad)}
.wrapc{white-space:normal !important; min-width:180px}
.table-wrap,.sheet-wrap{width:100%; overflow:auto; background:var(--surface); border:1px solid var(--line); border-radius:var(--r-lg); box-shadow:var(--sh1); min-height:120px}
.table-wrap table th,.table-wrap table td{padding:8px 12px; border-bottom:1px solid var(--gline); white-space:nowrap; vertical-align:middle}
.table-wrap thead th{position:sticky; top:0; z-index:4; background:var(--g1); font-size:12px; text-transform:uppercase; letter-spacing:.03em; color:var(--mute); border-bottom:1px solid var(--line)}
.table-wrap tbody tr:hover td{background:#f8fafc}
.table-wrap tbody tr:last-child td{border-bottom:0}
.sheet{border-collapse:separate; border-spacing:0; width:max-content; min-width:100%; font-size:12.5px}
.sheet th,.sheet td{height:34px; padding:0 10px; max-width:300px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; text-align:left; border-bottom:1px solid var(--gline)}
.sheet thead th{position:sticky; top:0; z-index:3; height:36px; background:var(--g1); color:var(--mute); font-weight:600; font-size:11.5px; text-transform:uppercase; letter-spacing:.03em}
.sheet tbody tr.alt td{background:#fcfcfd}
.sheet tbody tr:hover td{background:#f5f8ff}
.sheet tbody tr.sel td{background:#eaf1ff !important}
.sheet .rn{position:sticky; left:0; z-index:2; min-width:52px; text-align:center; color:var(--mute); background:var(--surface)}
.sheet thead th.corner{left:0; z-index:5; background:var(--g1)}
.sheet .actcol,.sheet .actcell{position:sticky; right:0; z-index:2; background:var(--surface); border-left:1px solid var(--line); text-align:center}
.sheet thead th.actcol{z-index:5; background:var(--g1)}
.sheet .datecol,.sheet .datecell{text-align:center}
.sheet th[draggable="true"]{cursor:grab} .sheet th.dragover{box-shadow:inset 3px 0 0 var(--accent)}
.sheet .fbtn{margin-left:4px; border:0; background:none; color:var(--g5); cursor:pointer; font-size:11px; padding:0 2px} .sheet .fbtn.on{color:var(--accent)}
.sheet .arr{margin-left:3px; color:var(--accent)}
.sheet tr.sp td{padding:0; border:0}
tr.link{cursor:pointer} tr.rev td{color:var(--g5); text-decoration:line-through}
tr.sub td{font-weight:600; background:var(--g1)} tr.grand td{font-weight:700; border-top:2px solid var(--ink) !important; background:var(--g1)}
tr.hdr td{font-weight:600; color:var(--ink2); background:var(--g1)} tr.ind td:first-child{padding-left:28px}
label.ck{display:inline-flex; align-items:center; gap:6px; cursor:pointer} label.ck i{display:none} label.ck span{color:var(--mute); font-size:12px}
.col-item{display:flex; align-items:center; gap:8px; padding:4px 6px; border-radius:6px} .col-item span{flex:1; overflow:hidden; text-overflow:ellipsis}
.col-item:hover{background:var(--g2)}

/* ----------------------------------------------------------------------------------- popovers & menus */
.pop,#pop,#menu,#tagPop,#courPop,.colpanel,#colpanel{background:var(--surface); border:1px solid var(--line); border-radius:var(--r); box-shadow:var(--sh2); padding:8px}
.pop-row{display:flex; gap:6px; margin:0 0 6px} .pop-list{max-height:260px; overflow:auto; margin:6px 0}
.pop-list label{display:flex; align-items:center; gap:8px; padding:5px 6px; border-radius:6px; font-size:13px; cursor:pointer} .pop-list label:hover{background:var(--g2)}
.pop-list small{margin-left:auto; color:var(--mute)}
.pop-foot{display:flex; justify-content:flex-end; gap:6px; padding-top:6px; border-top:1px solid var(--line)}

/* ----------------------------------------------------------------------------------- dialogs, toast, success */
dialog{background:var(--dlg); color:var(--ink); border:1px solid var(--line); border-radius:var(--r-lg); padding:22px; max-width:min(440px,94vw); box-shadow:var(--sh3); color-scheme:light}
dialog.big{width:min(620px,94vw); max-width:none; max-height:90vh; overflow:auto}
dialog::backdrop{background:rgba(17,24,39,.4)}
dialog h2{margin:0 0 6px; font-size:17px; font-weight:600}
dialog p{margin:0; line-height:1.6}
.ohead{display:flex; justify-content:space-between; align-items:center; gap:10px; margin:0 0 12px}
.toast{position:fixed; left:50%; bottom:24px; transform:translate(-50%,12px); z-index:200; padding:10px 18px; border-radius:var(--r); background:#111827; color:#fff; font-size:13.5px; box-shadow:var(--sh2); opacity:0; pointer-events:none; transition:opacity .15s, transform .15s; max-width:92vw}
.toast.show{opacity:1; transform:translate(-50%,0)}
.okpop{position:fixed; inset:0; z-index:180; display:flex; align-items:center; justify-content:center; background:rgba(17,24,39,.2)}
.okbox{display:flex; flex-direction:column; align-items:center; gap:6px; padding:22px 30px; background:var(--surface); border-radius:var(--r-lg); box-shadow:var(--sh3); text-align:center}
.okbox svg{width:44px; height:44px} .okbox circle{fill:none; stroke:var(--ok); stroke-width:2} .okbox path{fill:none; stroke:var(--ok); stroke-width:3; stroke-linecap:round; stroke-linejoin:round}
.okbox b{font-size:15px} .okbox span{font-size:13px; color:var(--mute)}
#appError{background:var(--surface) !important; border-color:var(--bad) !important; color:var(--bad) !important; border-radius:var(--r) !important}
.shake{animation:shake .3s} @keyframes shake{25%{transform:translateX(-6px)} 75%{transform:translateX(6px)}}

/* ----------------------------------------------------------------------------------- photo / avatar */
.avatar{position:relative; width:72px; height:72px; border-radius:50%; overflow:hidden; display:grid; place-items:center; font-size:22px; font-weight:600; background:var(--g3); color:var(--ink2)}
.avatar img{position:absolute; inset:0; width:100%; height:100%; object-fit:cover}
.pwid{display:flex; align-items:center; gap:12px; grid-column:1/-1} .pbtns{display:flex; gap:6px} .phint{color:var(--mute); font-size:12px}

/* ----------------------------------------------------------------------------------- home (main.html) */
.hm-hero{width:100%; display:flex; flex-wrap:wrap; justify-content:space-between; align-items:flex-end; gap:12px; margin:0 0 18px}
.hm-hero h1{margin:0; font-size:22px; font-weight:600} .hm-chips{display:flex; flex-wrap:wrap; gap:6px; margin-top:6px}
.hm-chips span{padding:2px 10px; border-radius:var(--r-pill); background:var(--g2); font-size:12px; color:var(--ink2)} .hm-chips .ttl{background:var(--brand); color:#fff}
.hm-clock{text-align:right} .hm-clock b,#hmTime{font-size:20px; font-weight:600} .hm-date,#hmDate{display:block; color:var(--mute); font-size:12.5px}
.hm-grp{margin:0 0 18px} .hm-grp h2{margin:0 0 8px; font-size:12px; text-transform:uppercase; letter-spacing:.06em; color:var(--mute); font-weight:600}
.hm-grid{display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:10px}
.hm-card{display:flex; align-items:center; gap:12px; padding:12px 14px; background:var(--surface); border:1px solid var(--line); border-radius:var(--r); text-decoration:none; color:var(--ink); box-shadow:var(--sh1); transition:border-color .12s, box-shadow .12s}
.hm-card:hover{border-color:var(--g4); box-shadow:var(--sh2)}
.hm-ic{width:36px; height:36px; border-radius:var(--r-sm); display:inline-flex; align-items:center; justify-content:center; background:var(--g2); color:var(--ink2); flex:none} .hm-ic svg{width:18px; height:18px}
.hm-tx{flex:1; min-width:0} .hm-tx b{display:block; font-weight:600; font-size:14px} .hm-tx small{display:block; color:var(--mute); font-size:12px}
.hm-go{width:16px; height:16px; color:var(--g5)}
.tiles{display:flex; flex-wrap:wrap; gap:12px} .tile{display:flex; flex-direction:column; align-items:center; gap:8px; padding:18px; width:200px; background:var(--surface); border:1px solid var(--line); border-radius:var(--r); text-decoration:none}

/* ----------------------------------------------------------------------------------- phone order cards (sales) */
.mlist{display:flex; flex-direction:column; gap:8px; padding:8px}
.mcard{background:var(--surface); border:1px solid var(--line); border-radius:var(--r); padding:10px 12px}
.mh{display:flex; align-items:center; gap:8px} .mn{flex:1; font-weight:600} .ms{font-size:12.5px; color:var(--ink2); margin-top:2px}
.mact{display:flex; flex-wrap:wrap; gap:6px; margin-top:8px} .mdet{margin-top:8px; border-top:1px solid var(--line); padding-top:8px}
.mr{display:flex; justify-content:space-between; gap:10px; font-size:12.5px; padding:2px 0} .mr span{color:var(--mute)}

/* ----------------------------------------------------------------------------------- sign-in / landing */
body:not(.app){justify-content:center; background:var(--bg)}
body:not(.app) .card{padding:28px; border-radius:var(--r-lg); box-shadow:var(--sh2)}
.bg-grid,.orb,.waves{display:none !important}

/* ----------------------------------------------------------------------------------- print */
@media print{
  .tb,.toast,.okpop,footer,.btn,.act,.icon-btn,.lockpill{display:none !important}
  body{background:#fff} .content{padding:0 !important; max-width:none} .table-wrap,.sheet-wrap{max-height:none !important; overflow:visible; border:0; box-shadow:none}
}

/* =====================================================================================================
   Design v2 (Phase 4): pill buttons & fields, calm status colours, compact / comfortable tables,
   bell panel, quick search (Ctrl+K), phone bottom bar. Same variables, nothing animated in a loop.
   ===================================================================================================== */
:root{ --r-ctl:999px; --dt-pad-y:5px; --dt-pad-x:10px; --dt-fs:12.5px; --bn-h:60px }
body.comfy{ --dt-pad-y:10px; --dt-pad-x:14px; --dt-fs:13.5px }
/* buttons and single-line fields are fully rounded */
.btn,.act,.rbtn,.smb,.abtn,.del,.mini,.tbar select,.tbar button,.fin-tabs button,.tabs button,.subtabs button{border-radius:var(--r-ctl)}
.input:not(textarea),.tbl-in,select.input,.field input,.field select,.tb-st select,input[type=search]{border-radius:var(--r-ctl)}
.input:not(textarea),select.input{padding-left:14px; padding-right:14px}
select.input{padding-right:30px; background-position:right 12px center}
.field input,.field select{padding-left:16px} .field label{left:16px}
textarea.input,.field textarea{border-radius:16px}
dialog,.fin-dlg{border-radius:20px} .card,.cardx,.blk,.scard,.box,.panel,.card2,.table-wrap,.sheet-wrap{border-radius:16px}
.btn{height:38px} .btn.sm{height:32px; padding:0 14px}
.icon-btn,.tb-btn{border-radius:50%}
.tb-link,.tb-gb{border-radius:var(--r-ctl)} .tb-item{border-radius:12px}
/* calm status colours: green done · yellow waiting · red problem · grey cancelled */
.st-pill,.sb{display:inline-flex; align-items:center; gap:5px; padding:1px 9px; border-radius:var(--r-pill); font-size:11.5px; line-height:18px; white-space:nowrap; border:1px solid var(--line2); background:var(--g1); color:var(--ink2)}
.st-pill::before,.sb::before{content:''; width:6px; height:6px; border-radius:50%; background:currentColor; opacity:.8}
.st-pill.posted,.st-pill.valid,.sb.ok{background:var(--ok-soft); border-color:#bbe5c8; color:var(--ok)}
.st-pill.submitted,.st-pill.selected,.st-pill.submittedeta,.sb.wait{background:var(--warn-soft); border-color:#fbd7a8; color:var(--warn)}
.st-pill.rejected,.st-pill.invalid,.st-pill.returned,.sb.bad{background:var(--bad-soft); border-color:#f3c4c4; color:var(--bad)}
.st-pill.cancelled,.st-pill.draft,.sb.off{background:#f3f4f6; border-color:var(--line2); color:#6b7280}
.sb.info{background:var(--accent-soft); border-color:#c9d8fb; color:var(--accent)}

/* ----------------------------------------------------------------------------------- data tables (every .table-wrap / .sheet) */
.table-wrap table th,.table-wrap table td,.sheet th,.sheet td{padding:var(--dt-pad-y) var(--dt-pad-x); font-size:var(--dt-fs)}
.sheet th,.sheet td{height:auto}
.dt-sort{cursor:pointer; user-select:none} .dt-sort:hover{color:var(--ink)}
.dt-sort[data-dir]::after{content:'▲'; font-size:8px; margin-left:4px; color:var(--accent)} .dt-sort[data-dir="desc"]::after{content:'▼'}
tr.dt-filter th{padding:3px 4px !important; background:var(--surface) !important; top:var(--dt-head,30px) !important; text-transform:none !important; letter-spacing:0 !important}
tr.dt-filter input{width:100%; min-width:50px; height:24px; padding:0 8px; border:1px solid var(--line); border-radius:var(--r-ctl); font:12px var(--font); background:var(--g1)}
tr.dt-filter input:focus{outline:none; border-color:var(--accent); background:#fff}
tfoot tr.dt-tot td{position:sticky; bottom:0; background:var(--g1); font-weight:600; border-top:1px solid var(--line2)}
.tbar .dt-cols{position:relative} .dt-colpop{position:absolute; right:0; top:calc(100% + 4px); z-index:30; min-width:200px; max-height:320px; overflow:auto; background:var(--surface); border:1px solid var(--line); border-radius:12px; box-shadow:var(--sh2); padding:6px}
.dt-colpop label{display:flex; align-items:center; gap:8px; padding:5px 8px; border-radius:8px; font-size:13px; cursor:pointer; color:var(--ink)} .dt-colpop label:hover{background:var(--g2)}
.dt-hide{display:none !important}

/* ----------------------------------------------------------------------------------- bell panel */
.bellp{position:fixed; z-index:60; top:calc(var(--tb-h) + 6px); right:12px; width:min(380px,94vw); max-height:min(70vh,560px); overflow:auto; background:var(--surface); border:1px solid var(--line); border-radius:16px; box-shadow:var(--sh3); padding:8px}
.bellp h3{margin:6px 8px 4px; font-size:11px; text-transform:uppercase; letter-spacing:.06em; color:var(--mute)}
.bellp a{display:block; padding:8px 10px; border-radius:12px; text-decoration:none; color:var(--ink)} .bellp a:hover{background:var(--g2)}
.bellp a small{display:block; color:var(--mute); font-size:11.5px} .bellp a.new{background:var(--accent-soft)} .bellp .empty{padding:24px 8px}
.bellp .flag{color:var(--bad); font-weight:600}

/* ----------------------------------------------------------------------------------- quick search (Ctrl+K) */
.cmdk{position:fixed; inset:0; z-index:90; display:flex; justify-content:center; align-items:flex-start; padding-top:12vh; background:rgba(17,24,39,.35)}
.cmdk-box{width:min(620px,94vw); background:var(--surface); border-radius:18px; box-shadow:var(--sh3); overflow:hidden}
.cmdk-box input{width:100%; height:54px; border:0; border-bottom:1px solid var(--line); padding:0 20px; font:16px var(--font); outline:none}
.cmdk-res{max-height:52vh; overflow:auto; padding:6px}
.cmdk-res a{display:flex; gap:10px; align-items:center; padding:9px 12px; border-radius:12px; text-decoration:none; color:var(--ink)}
.cmdk-res a.on,.cmdk-res a:hover{background:var(--g2)} .cmdk-res small{color:var(--mute)} .cmdk-res .k{min-width:72px; font-size:11px; text-transform:uppercase; letter-spacing:.04em; color:var(--mute)}
.cmdk-hint{padding:8px 16px; font-size:12px; color:var(--mute); border-top:1px solid var(--line)}
.tb-search{display:inline-flex; align-items:center; gap:8px; height:34px; padding:0 14px; border:1px solid var(--line); border-radius:var(--r-ctl); background:var(--g1); color:var(--mute); font:13px var(--font); cursor:pointer}
.tb-search kbd{font:11px var(--font); padding:1px 6px; border:1px solid var(--line2); border-radius:6px; background:#fff}
@media (max-width:1180px){.tb-search span,.tb-search kbd{display:none} .tb-search{width:34px; padding:0; justify-content:center; border-radius:50%}}
.tb-search svg{width:16px; height:16px}

/* ----------------------------------------------------------------------------------- phone bottom bar (top 1–4 screens of the role) */
.bnav{display:none}
@media (max-width:900px){
  .bnav{position:fixed; z-index:35; left:0; right:0; bottom:0; height:calc(var(--bn-h) + env(safe-area-inset-bottom)); padding-bottom:env(safe-area-inset-bottom); display:flex; background:var(--surface); border-top:1px solid var(--line)}
  .bnav a{flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px; text-decoration:none; color:var(--mute); font-size:11px}
  .bnav a svg{width:22px; height:22px} .bnav a.on{color:var(--ink); font-weight:600}
  body.has-bn .content{padding-bottom:calc(var(--bn-h) + 16px + env(safe-area-inset-bottom))}
  body.has-bn .toast{bottom:calc(var(--bn-h) + 20px)}
  .btn,.btn.sm{min-height:40px} .input:not(textarea),select.input{min-height:40px}
}

/* ----------------------------------------------------------------------------------- role home */
.rh{display:grid; grid-template-columns:repeat(auto-fit,minmax(230px,1fr)); gap:12px; margin:0 0 18px}
.rh-card{background:var(--surface); border:1px solid var(--line); border-radius:16px; padding:14px 16px}
.rh-card h3{margin:0 0 8px; font-size:12px; text-transform:uppercase; letter-spacing:.06em; color:var(--mute); font-weight:600}
.rh-card .big{font-size:26px; font-weight:600} .rh-card .row2{display:flex; justify-content:space-between; gap:8px; font-size:13px; padding:3px 0}
.rh-card .row2 b{font-weight:600} .rh-card .acts{display:flex; flex-wrap:wrap; gap:6px; margin-top:10px}
/* attachments widget */
.att{display:flex; flex-wrap:wrap; gap:8px; align-items:center; margin:6px 0}
.att a,.att span.f{display:inline-flex; align-items:center; gap:6px; padding:4px 10px; border:1px solid var(--line2); border-radius:var(--r-ctl); font-size:12.5px; text-decoration:none; color:var(--ink); background:var(--g1); cursor:pointer}
.att button.x{border:0; background:none; color:var(--bad); cursor:pointer; padding:0 2px}
.att label.add{display:inline-flex; align-items:center; gap:6px; padding:4px 12px; border:1px dashed var(--g5); border-radius:var(--r-ctl); font-size:12.5px; cursor:pointer; color:var(--ink2)}
.att label.add input{display:none} .att .need{color:var(--bad); font-size:12px}
@media print{.bnav,.bellp,.cmdk{display:none !important}}
