:root { --bg:#f4f5f7; --card:#fff; --ink:#1d2330; --muted:#6b7280; --line:#e3e6ea; --brand:#1f4e78; --ok:#15803d; --bad:#b91c1c; }
* { box-sizing: border-box; }
body { margin:0; font:15px/1.4 system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif; background:var(--bg); color:var(--ink); }
.hidden { display:none !important; }
.muted { color:var(--muted); } .error { color:var(--bad); min-height:1em; } .ok { color:var(--ok); min-height:1em; }
header { display:flex; gap:16px; align-items:center; padding:10px 20px; background:var(--brand); color:#fff; flex-wrap:wrap; }
header .muted { color:#cfd9e4; margin-left:auto; }
nav button { background:none; border:0; color:#cfd9e4; font:inherit; padding:6px 10px; border-radius:6px; cursor:pointer; }
nav button.active { background:rgba(255,255,255,.18); color:#fff; }
button.link { background:none; border:0; color:#fff; text-decoration:underline; cursor:pointer; font:inherit; }
main { padding:16px 20px; max-width:1300px; margin:0 auto; }
.card { background:var(--card); border:1px solid var(--line); border-radius:10px; padding:16px; margin-bottom:14px; }
.row { display:flex; gap:12px; align-items:end; flex-wrap:wrap; }
label { display:block; font-size:13px; color:var(--muted); margin:8px 0; }
input, select { display:block; font:inherit; padding:8px 10px; border:1px solid #c9ced6; border-radius:7px; margin-top:4px; width:100%; }
.row input, .row select { width:auto; }
input.big { font-size:20px; padding:12px 14px; }
button.primary { background:var(--brand); color:#fff; border:0; border-radius:8px; padding:10px 18px; font:inherit; font-weight:600; cursor:pointer; }
button.primary.big { width:100%; padding:16px; font-size:18px; margin-top:10px; }
button.primary:disabled { opacity:.5; }
button.small { font:inherit; font-size:13px; padding:3px 8px; border:1px solid var(--line); background:#fff; border-radius:6px; cursor:pointer; }
button.primary.small { background:var(--brand); color:#fff; border:0; font-weight:600; padding:4px 10px; }   /* a small main button keeps its colour */
table { width:100%; border-collapse:collapse; }
th, td { text-align:left; padding:7px 8px; border-bottom:1px solid var(--line); vertical-align:top; }
th { font-size:12px; text-transform:uppercase; letter-spacing:.03em; color:var(--muted); }
tr.click { cursor:pointer; } tr.click:hover { background:#f0f4f8; }
.sell-grid { display:grid; grid-template-columns: 1fr 360px; gap:14px; }
@media (max-width:900px) { .sell-grid { grid-template-columns:1fr; } }
.total-box { display:flex; justify-content:space-between; align-items:baseline; font-size:18px; }
.total-box b { font-size:34px; }
.pay { display:flex; gap:18px; margin:10px 0; } .pay label { display:flex; gap:6px; align-items:center; color:var(--ink); font-size:15px; }
.pay input { width:auto; margin:0; }
.login-card { max-width:360px; margin:12vh auto; }
.login-card h1 { margin:0; color:var(--brand); }
.login-card button { width:100%; margin-top:8px; }
.pill { display:inline-block; padding:1px 8px; border-radius:99px; font-size:12px; background:#eef2f6; }
.pill.sale { background:#fde8e8; } .pill.opening { background:#eef2f6; } .pill.transfer_in, .pill.received { background:#e5f4ea; }
.stockgrid { display:grid; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:8px; margin:10px 0; }
.stockgrid div { border:1px solid var(--line); border-radius:8px; padding:8px 10px; }
.stockgrid b { font-size:22px; display:block; }

/* 80 mm receipt printer */
@media print {
  body { background:#fff; }
  #app, #login, #watermark, .overlay { display:none !important; }
  #receipt { display:block !important; width:72mm; font:12px/1.35 monospace; color:#000; }
  @page { size:80mm auto; margin:3mm; }
}
#receipt h2 { text-align:center; margin:0 0 4px; font-size:16px; }
#receipt .c { text-align:center; } #receipt table td, #receipt table th { padding:2px 0; border:0; font-size:11px; }
#receipt hr { border:0; border-top:1px dashed #000; }
#receipt th { color:#000; text-transform:none; letter-spacing:0; font-size:12px; }   /* totals print black, not faint grey */
#tabs .badge { display:inline-block; background:var(--bad); color:#fff; border-radius:99px; padding:0 7px; font-size:11px; margin-left:4px; }
.waiting { background:#fff8e6; border-color:#f3d48a; } .waiting button { margin:4px 6px 4px 0; }
.approve { background:#fff8e6; border-color:#f3d48a; margin-top:12px; }
.pill.refund { background:#fde8e8; } .pill.exchange { background:#fff1d6; }
td.money-back { color:var(--bad); font-weight:600; }
.where { background:#eef6ff; border:1px solid #c7ddf5; border-radius:8px; padding:10px 14px; margin:6px 0; }
.where ul { margin:6px 0 0; padding-left:20px; } .where li { font-size:16px; }
.kpis { display:grid; grid-template-columns:repeat(auto-fill,minmax(230px,1fr)); gap:12px; margin-bottom:14px; }
.kpi { background:var(--card); border:1px solid var(--line); border-radius:10px; padding:14px 16px; }
.kpi h4 { margin:0 0 6px; } .kpi .big { font-size:26px; font-weight:700; } .kpi .sub { color:var(--muted); font-size:13px; }
.kpi.verdi { border-top:4px solid #7a5c2e; } .kpi.hajjo { border-top:4px solid var(--brand); }
.emp { display:grid; grid-template-columns: 1.1fr 1fr 1.3fr; gap:16px; }
@media (max-width:900px) { .emp { grid-template-columns:1fr; } }
.stat { display:flex; justify-content:space-between; border-bottom:1px dashed var(--line); padding:3px 0; }
.bar { display:flex; align-items:center; gap:8px; margin:3px 0; font-size:13px; }
.bar span:first-child { width:95px; } .bar .track { flex:1; background:#eef2f6; border-radius:4px; height:12px; }
.bar .fill { background:var(--brand); height:12px; border-radius:4px; }
.good { color:var(--ok); font-weight:600; } .weak { color:var(--bad); font-weight:600; }
.tcard { border:1px solid var(--line); border-radius:8px; padding:10px 12px; margin:10px 0; }
.tcard.on_the_way { border-left:5px solid #e0a106; } .tcard.received { border-left:5px solid var(--ok); } .tcard.missing { border-left:5px solid var(--bad); }
.pill.missing { background:#fde8e8; color:var(--bad); } .pill.transfer_out { background:#fff1d6; }

/* ---------- Odoo-style shop screen ---------- */
:root { --odoo:#714b67; --odoo-dark:#5a3b52; --teal:#017e84; --teal-dark:#016569; }
main:has(#tab-sell:not(.hidden)) { max-width:none; padding:0; }
.pos-wrap { display:grid; grid-template-columns:400px minmax(0,1fr); height:calc(100vh - var(--head,92px)); background:#fff; }
.pos-left { display:flex; flex-direction:column; border-right:1px solid var(--line); background:#fff; min-height:0; }
.pos-lines { flex:1; overflow-y:auto; }
.line { padding:10px 14px; border-bottom:1px solid #f0f0f0; cursor:pointer; }
.line.sel { background:#e6f2f3; border-left:4px solid var(--teal); }
.line-top { display:flex; justify-content:space-between; gap:8px; font-weight:600; }
.line-sub { color:var(--muted); font-size:13px; margin-top:2px; }
.empty { text-align:center; color:#b0b4bb; margin-top:30%; font-size:16px; } .empty br { line-height:2.4; }
.pos-total { padding:10px 14px; border-top:1px solid var(--line); }
.pos-total div { display:flex; justify-content:space-between; align-items:baseline; font-size:18px; }
.pos-total b { font-size:28px; } .pos-total small { color:var(--ok); }
.pos-tools { display:grid; grid-template-columns:1fr 1fr; gap:6px; padding:0 8px 6px; }
.pos-btn { font:inherit; padding:10px; border:1px solid #d6d9de; background:#f8f9fa; border-radius:6px; cursor:pointer; }
.pos-btn:hover { background:#eef0f2; } .pos-btn.need { border-color:var(--bad); color:var(--bad); }
.pos-pad { display:grid; grid-template-columns:repeat(4,1fr); gap:1px; background:var(--line); border-top:1px solid var(--line); }
.pos-pad button { font:inherit; font-size:18px; padding:14px 0; border:0; background:#fff; cursor:pointer; }
.pos-pad button:hover:not(:disabled) { background:#f2f2f2; }
.pos-pad .mode { font-size:14px; color:var(--muted); } .pos-pad .mode.on { background:var(--odoo); color:#fff; }
.pos-pad button:disabled { color:#c4c7cc; cursor:not-allowed; }
.pos-pay { font:inherit; font-size:20px; font-weight:600; padding:18px; border:0; background:var(--teal); color:#fff; cursor:pointer; width:100%; }
.pos-pay:hover { background:var(--teal-dark); } .pos-pay:disabled { background:#9cc7c9; cursor:not-allowed; }
.pos-right { display:flex; flex-direction:column; background:#f4f5f7; min-height:0; }
.pos-top { padding:10px 12px 0; } .pos-top input { font-size:16px; padding:11px 14px; margin:0; }
#posMsg { padding:0 12px; } #posMsg .where { margin:8px 0 0; } .where.error { background:#fdecec; border-color:#f3c0c0; color:var(--bad); }
.pos-cats { display:flex; gap:6px; padding:10px 12px; overflow-x:auto; flex-wrap:nowrap; }
.cat { font:inherit; font-size:14px; padding:7px 14px; border:1px solid #d6d9de; background:#fff; border-radius:20px; cursor:pointer; white-space:nowrap; }
.cat.on { background:var(--odoo); border-color:var(--odoo); color:#fff; } .cat small { opacity:.7; }
.pos-grid { flex:1; overflow-y:auto; padding:4px 12px 16px; display:grid; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:10px; align-content:start; grid-auto-rows:max-content; }
.tile { position:relative; font:inherit; text-align:left; background:#fff; border:1px solid #e2e4e8; border-radius:8px; padding:0 0 8px; cursor:pointer; overflow:hidden; }
.tile:hover { border-color:var(--teal); box-shadow:0 2px 8px rgba(0,0,0,.08); }
.tile-img { height:70px; display:flex; align-items:center; justify-content:center; font-size:26px; font-weight:700; color:#fff; background:#8a95a5; margin-bottom:6px; }
.cat-SUIT { background:#3d4f6b; } .cat-SHIRT { background:#4b8bbe; } .cat-PANTS { background:#6b5b3d; } .cat-BLAZER { background:#5c3d6b; }
.cat-T-SHIRT { background:#3d8a6b; } .cat-PULLOVER { background:#8a5a3d; } .cat-COAT { background:#4a4a4a; } .cat-JACKET { background:#6b3d3d; }
.cat-ACCESSORIES { background:#b08a2e; } .cat-SHOES { background:#2e2e2e; } .cat-VEST { background:#3d6b6b; }
.tile-name { padding:0 8px; font-size:13px; font-weight:600; line-height:1.25; height:2.5em; overflow:hidden; }
.tile-meta { padding:2px 8px 0; font-size:12px; color:var(--muted); }
.tile-price { padding:2px 8px 0; } .tile-price s { color:#9aa0a8; font-size:12px; }
.tile-off { position:absolute; top:6px; right:6px; background:#d9363e; color:#fff; font-size:12px; font-weight:700; padding:2px 6px; border-radius:4px; }
.tile-off.inline { position:static; margin-left:4px; }
.overlay { position:fixed; inset:0; background:rgba(0,0,0,.35); display:flex; align-items:center; justify-content:center; z-index:20; }
.modal { background:#fff; border-radius:10px; padding:20px; width:min(520px,92vw); max-height:85vh; overflow:auto; }
.modal h3 { margin:0; }
.size-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(90px,1fr)); gap:8px; margin:14px 0; }
.size { font:inherit; padding:14px 6px; border:1px solid #d6d9de; border-radius:8px; background:#fff; cursor:pointer; display:flex; flex-direction:column; align-items:center; }
.size b { font-size:20px; } .size small { color:var(--muted); } .size:hover { border-color:var(--teal); background:#e6f2f3; }
.cust { display:block; width:100%; text-align:left; font:inherit; padding:10px; border:0; border-bottom:1px solid #eee; background:#fff; cursor:pointer; }
.cust:hover { background:#e6f2f3; }
.pos-screen { position:fixed; inset:0; background:#fff; z-index:15; display:flex; flex-direction:column; }
.pay-head { display:flex; justify-content:space-between; align-items:center; padding:10px 16px; border-bottom:1px solid var(--line); }
.pay-head h2 { margin:0; color:var(--odoo); }
.pay-body { flex:1; display:grid; grid-template-columns:300px 1fr; min-height:0; }
.pay-methods { border-right:1px solid var(--line); padding:14px; display:flex; flex-direction:column; gap:10px; background:#f8f9fa; }
.method { font:inherit; font-size:18px; padding:18px; border:1px solid #d6d9de; background:#fff; border-radius:8px; cursor:pointer; text-align:left; }
.method.on { border:2px solid var(--teal); background:#e6f2f3; font-weight:600; }
.pay-main { padding:20px 40px; max-width:620px; overflow:auto; }
.due, .given { display:flex; justify-content:space-between; align-items:baseline; font-size:18px; padding:6px 0; }
.due b { font-size:36px; color:var(--odoo); } .given b { font-size:28px; }
.change { font-size:20px; min-height:34px; padding:4px 0 10px; } .change b { font-size:28px; color:var(--ok); }
.pay-pad { border:1px solid var(--line); margin-bottom:14px; } .pay-pad button[data-add] { color:var(--teal); font-weight:600; }
.done-box { margin:auto; text-align:center; display:flex; flex-direction:column; gap:14px; }
.done-ok { font-size:30px; color:var(--ok); font-weight:700; } .done-total { font-size:44px; font-weight:700; }
.done-change { font-size:22px; } .done-change b { font-size:34px; color:var(--teal); }
@media (max-width:900px) { .pos-wrap { grid-template-columns:1fr; height:auto; } .pay-body { grid-template-columns:1fr; } }
.checks { background:#f7faf7; border-color:#cfe3cf; margin-top:12px; }
label.check { display:flex; gap:10px; align-items:center; color:var(--ink); font-size:16px; margin:10px 0; cursor:pointer; }
label.check input { width:22px; height:22px; margin:0; }
.alt-row { margin-top:6px; display:flex; gap:6px; align-items:center; }
.alt-btn { font:inherit; font-size:12px; padding:3px 9px; border:1px dashed #b9bec6; background:#fff; border-radius:12px; cursor:pointer; color:var(--muted); white-space:nowrap; }
.alt-btn.on { border:1px solid #c26a00; background:#fff3e0; color:#9a4f00; font-weight:600; }
.alt-note { font-size:13px; padding:4px 8px; margin:0; border-color:#e8b778; }
.alt-flag { margin-top:4px; color:#9a4f00; background:#fff3e0; border:1px solid #f0c890; border-radius:6px; padding:3px 8px; font-size:13px; font-weight:600; }
tr.altered td { background:#fffaf2; }
.alt-sum { margin-top:4px; font-size:12px; color:#9a4f00; background:#fff8ee; border-radius:6px; padding:4px 8px; }
.alt-modal { width:min(640px,94vw); }
.alt-group { border:1px solid var(--line); border-radius:8px; padding:8px 12px; margin:10px 0; }
.alt-group h4 { margin:2px 0 6px; }
.alt-field { display:grid; grid-template-columns:150px auto 80px 24px; gap:8px; align-items:center; padding:6px 0; border-top:1px dashed var(--line); }
.alt-field:first-of-type { border-top:0; }
.alt-label small, .alt-dir small { color:var(--muted); }
.alt-dirs { display:flex; gap:4px; }
.alt-dir { font:inherit; font-size:13px; padding:5px 10px; border:1px solid #d6d9de; background:#fff; border-radius:6px; cursor:pointer; line-height:1.2; }
.alt-dir.on { border-color:var(--teal); background:#e6f2f3; font-weight:600; }
.alt-field input { margin:0; text-align:center; }
.np-block { margin:14px 0; }
.chips { display:flex; flex-wrap:wrap; gap:6px; margin-top:8px; max-height:190px; overflow:auto; }
.chip { font:inherit; font-size:13px; padding:5px 11px; border:1px solid #d6d9de; background:#fff; border-radius:16px; cursor:pointer; }
.chip.on { background:var(--odoo); border-color:var(--odoo); color:#fff; }
.fd-table input { width:62px; margin:0; text-align:center; padding:6px; }
.fd-table th, .fd-table td { text-align:center; }
.filters { display:flex; flex-wrap:wrap; gap:12px; align-items:end; }
.filters label { margin:0; } .filters select, .filters input { width:auto; }
.quick { display:flex; gap:4px; flex-wrap:wrap; }
.quick button { font:inherit; font-size:13px; padding:7px 11px; border:1px solid #d6d9de; background:#fff; border-radius:6px; cursor:pointer; }
.quick button.on { background:var(--brand); border-color:var(--brand); color:#fff; }
.chart { position:relative; } .chart svg { display:block; width:100%; height:260px; }
.chart .bar { fill:var(--brand); } .chart .hit:hover + .bar, .chart .bar.hover { fill:#2f6aa0; }
.chart text { font-size:11px; fill:var(--muted); } .chart .grid { stroke:#eceef1; } .chart .base { stroke:#c9ced6; }
.tip { position:fixed; z-index:30; background:#1d2330; color:#fff; padding:7px 10px; border-radius:6px; font-size:13px; pointer-events:none; line-height:1.4; }
.meter { display:flex; align-items:center; gap:6px; } .meter .track { flex:1; min-width:60px; height:8px; background:#eef2f6; border-radius:4px; }
.meter .fill { height:8px; background:var(--brand); border-radius:4px; } .meter span { min-width:42px; text-align:right; font-variant-numeric:tabular-nums; }
details summary { cursor:pointer; margin-top:8px; }
.scroll-x { overflow-x:auto; }
.gtable td, .gtable th { white-space:nowrap; } .gtable td.num, .gtable th.num { text-align:right; font-variant-numeric:tabular-nums; }
.gtable tr.grp { cursor:pointer; } .gtable tr.grp:hover td { background:#f0f4f8; } .gtable tr.sub td { background:#fafbfc; font-size:13px; }
.gtable .tot { font-weight:700; border-left:2px solid var(--line); } .gtable .ar { color:var(--muted); font-size:12px; margin-left:6px; }
.progress { height:10px; background:#eef2f6; border-radius:5px; margin-top:8px; } .progress div { height:10px; background:var(--ok); border-radius:5px; }
.bulk { position:sticky; top:0; background:#fff; padding:6px 0; z-index:2; align-items:center; }
.sugg { font-size:11px; color:#9a4f00; background:#fff3e0; border-radius:8px; padding:1px 6px; margin-left:4px; }
.tile-photo { width:100%; height:120px; object-fit:cover; display:block; margin-bottom:6px; background:#f4f5f7; }
.size-photo { width:64px; height:64px; object-fit:cover; border-radius:8px; vertical-align:middle; margin-right:10px; }
.pd-head { display:flex; gap:18px; align-items:flex-start; }
.pd-pic { width:160px; flex-shrink:0; text-align:center; } .pd-pic img, .pd-pic .tile-img { width:160px; height:160px; object-fit:cover; border-radius:8px; margin-bottom:6px; }
.thumb { width:44px; height:44px; object-fit:cover; border-radius:6px; display:block; }
.thumb.empty { display:flex; align-items:center; justify-content:center; background:#f4f5f7; border:1px dashed #c9ced6; font-size:16px; }
.thumbs { display:flex; gap:4px; flex-wrap:wrap; max-width:260px; }
.thumb-btn { border:0; background:none; padding:0; cursor:pointer; text-align:center; } .thumb-btn small { display:block; font-size:10px; color:var(--muted); max-width:44px; overflow:hidden; }
.pics { display:flex; gap:10px; flex-wrap:wrap; margin-top:8px; }
.pic-slot { display:flex; flex-direction:column; align-items:center; gap:4px; cursor:pointer; margin:0; color:var(--ink); }
.pic-slot img, .pic-empty { width:96px; height:96px; object-fit:cover; border-radius:8px; border:1px solid var(--line); }
.pic-empty { display:flex; align-items:center; justify-content:center; font-size:28px; background:#f4f5f7; border-style:dashed; }
@media (max-width:700px) { .pd-head { flex-direction:column; } }
/* a box with a wrong value (e.g. a minus number of pieces) */
input.bad { border-color:var(--bad); background:#fdecea; }
/* refund / exchange done: number, money back and Print again stay on screen */
#rDone { margin-top:14px; border:2px solid var(--ok); }
#rDone .done-ok { font-size:24px; }
.alt-warn { background:#fdecea; color:var(--bad); border-radius:8px; padding:8px 10px; font-weight:700; margin:8px 0; }

/* Employees page: a person's all-stores total, with their store cards under it */
.card.emp-total { border-left: 5px solid var(--brand); margin-bottom: 4px; }
.emp-stores { margin: 0 0 16px 28px; border-left: 2px dashed var(--line); padding-left: 12px; }
.emp-stores .card { opacity: .95; }

/* staff screens: text can't be selected or copied (typing boxes still work); name watermark over everything */
body.locked { -webkit-user-select:none; user-select:none; }
body.locked input, body.locked textarea, body.locked select { -webkit-user-select:text; user-select:text; }
#watermark { position:fixed; inset:0; pointer-events:none; z-index:9999; background-repeat:repeat; }

/* a receipt copy waiting for the owner's answer */
tr.waiting-row td { background:#fff7e0; }
