/* Back office app: interactive bits the static mockup didn't need (buttons, inputs, sheets, toasts, sign-in).
   Colours only from tokens.css. */
a{color:inherit;text-decoration:none;cursor:pointer}
button{font:inherit;color:inherit;background:none;border:0;cursor:pointer}
button.btn,a.btn{cursor:pointer}
.btn:disabled{opacity:.45;cursor:default}
.btn.pri:hover:not(:disabled){filter:brightness(1.25)}
.btn.line:hover:not(:disabled){background:var(--fill)}
.nav:hover:not(.on){background:rgba(0,0,0,.035)}
.sw{cursor:pointer;border:0;padding:0;transition:background .15s}
.sw::after{transition:transform .15s}
.sw:disabled{opacity:.4;cursor:default}
.seg button{height:30px;padding:0 14px;border-radius:var(--r-pill);display:flex;align-items:center;gap:6px;font-size:13px;font-weight:600;color:var(--muted);white-space:nowrap}
.seg button.on{background:var(--surface);color:var(--ink);box-shadow:var(--shadow-knob)}
.seg.sm button{height:26px;padding:0 10px;font-size:12px}
input.field,select.field,textarea.field{font:inherit;font-size:13.5px;font-weight:550;color:var(--ink);outline:none;min-width:0}
input.field:focus,select.field:focus,textarea.field:focus{border-color:var(--ink);box-shadow:0 0 0 3px var(--acc-soft)}
select.field{appearance:none;padding-right:30px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236E6E73' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 10px center}
textarea.field{height:auto;min-height:72px;padding:9px 12px;white-space:normal;line-height:1.45;resize:vertical;width:100%}
input.field.time{width:84px;text-align:center}
input.field.money{width:96px;text-align:right}
input.field.w100{width:100%}
.field.search input{border:0;outline:0;font:inherit;background:none;flex:1;min-width:0;color:var(--ink)}
.cat{cursor:pointer;width:100%;text-align:left}
.cat:hover:not(.on){background:rgba(0,0,0,.025)}
tr.click{cursor:pointer}
tr.click:hover td{background:var(--canvas)}
.step button{width:28px;height:28px;border-radius:50%;background:var(--surface);display:flex;align-items:center;justify-content:center;box-shadow:var(--shadow-knob)}
.step button:disabled{opacity:.4}
.chip{border:0}
button.chip{cursor:pointer}
.chip.off{text-decoration:line-through;color:var(--faint)}
.chip.sold{background:var(--fill-2);color:var(--muted);text-decoration:line-through} /* sold out is a state, not an error: ink/grey (red only for real errors) */
.tag.sold{background:var(--fill-2);color:var(--ink)}
.empty{padding:28px 20px;text-align:center;color:var(--muted);font-size:13.5px}
.pad{padding:16px 20px 20px}
.err{color:var(--late);font-size:13px;font-weight:550}
.okt{color:var(--ok);font-size:13px;font-weight:600}
.spacer{flex:1}
.mt8{margin-top:8px}.mt12{margin-top:12px}.mt16{margin-top:16px}.mt24{margin-top:24px}
.flexr{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.tabs a,.nav{cursor:pointer}
.side{overflow-y:auto}
.side-foot button{color:var(--muted);display:flex}
/* sheets: a centred form sheet on iPad / desktop, a bottom sheet with a grabber on the phone (drag down to close).
   Header and footer stay put, the body scrolls. */
.scrim{position:fixed;inset:0;background:rgba(0,0,0,.28);z-index:50;display:flex;align-items:center;justify-content:center;padding:24px;animation:fade .15s}
.sheet{background:var(--surface);border-radius:var(--r-xl);box-shadow:var(--shadow-pop);width:min(560px,100%);max-height:calc(100vh - 48px);max-height:calc(100dvh - 48px);display:flex;flex-direction:column;overflow:hidden;animation:pop .18s}
.sheet.wide{width:min(760px,100%)}
.sheet-grab{display:none}
.sheet-h{flex:none;display:flex;align-items:flex-start;gap:12px;padding:22px 24px 4px}
.sheet-h>div{min-width:0}
.sheet-h h3{font-size:19px;font-weight:700;letter-spacing:-.025em;overflow-wrap:break-word}
.sheet-h p{font-size:13px;color:var(--muted);margin-top:4px}
/* × : a 44 px target drawn as a 32 px circle */
.sheet-h .x{margin:-6px;margin-inline-start:auto;width:44px;height:44px;border-radius:50%;background:none;display:flex;align-items:center;justify-content:center;flex:none;position:relative}
.sheet-h .x::before{content:"";position:absolute;inset:6px;border-radius:50%;background:var(--fill);z-index:-1}
.sheet-h .x{isolation:isolate}
.sheet-b{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:16px 24px}
.sheet-f{flex:none;display:flex;flex-wrap:wrap;gap:8px;justify-content:flex-end;padding:8px 24px 22px}
.sheet-h:last-child{padding-bottom:20px}
@keyframes fade{from{opacity:0}} @keyframes pop{from{opacity:0;transform:translateY(8px) scale(.98)}}
@media (max-width:699px){
  .scrim{align-items:flex-end;padding:env(safe-area-inset-top) 0 0}
  .sheet,.sheet.wide{width:100%;border-radius:16px 16px 0 0;max-height:calc(100dvh - env(safe-area-inset-top) - 12px);animation:sheet-up .28s cubic-bezier(.2,.8,.2,1);transition:transform .22s cubic-bezier(.2,.8,.2,1)}
  .sheet-grab{flex:none;display:flex;justify-content:center;padding:7px 0 2px;touch-action:none;cursor:grab}
  .sheet-grab i{width:36px;height:5px;border-radius:3px;background:var(--line-2)}
  .sheet-h{padding:8px 16px 4px;touch-action:none}
  .sheet-b{padding:12px 16px}
  .sheet-f{padding:10px max(16px,env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left));border-top:1px solid var(--line)}
  .sheet-f>.btn{flex:1 1 auto;justify-content:center}
  .sheet-h:last-child{padding-bottom:calc(16px + env(safe-area-inset-bottom))}
}
/* while a sheet is open the page behind stays put (touch) */
@media (max-width:1099px),(pointer:coarse),(hover:none){html.bo-lock body{overflow:hidden}}
/* toast: above the tab bar and the save bar */
.toasts{position:fixed;left:50%;bottom:calc(var(--tb-h,0px) + 24px);transform:translateX(-50%);z-index:80;display:flex;flex-direction:column;gap:8px;align-items:center;pointer-events:none;width:max-content;max-width:calc(100vw - 32px)}
.toast{background:var(--acc);color:var(--acc-on);padding:11px 18px;border-radius:var(--r-pill);font-size:13.5px;font-weight:600;box-shadow:var(--shadow-pop);display:flex;gap:10px;align-items:center;pointer-events:auto;animation:pop .18s;max-width:100%}
.toast.bad{background:var(--late);color:#fff}
.toast button{color:inherit;opacity:.8;font-weight:700;text-decoration:underline;min-height:32px}
@media (max-width:699px){.toast{font-size:14.5px;padding:12px 18px}}
/* sign-in (Auth, Invite, Signup, ResetPassword): safe areas, 16 px inputs (no zoom on iOS), 48 px controls */
.auth{min-height:100vh;min-height:100dvh;display:flex;align-items:center;justify-content:center;background:var(--canvas);
  padding:max(24px,env(safe-area-inset-top)) max(24px,env(safe-area-inset-right)) max(24px,env(safe-area-inset-bottom)) max(24px,env(safe-area-inset-left))}
.auth-card{width:min(400px,100%);background:var(--surface);border:1px solid var(--line);border-radius:var(--r-xl);box-shadow:var(--shadow);padding:32px 28px 28px}
.auth-card .logo{width:44px;height:44px;font-size:20px;border-radius:12px}
.auth-card h1{font-size:24px;font-weight:700;letter-spacing:-.035em;margin-top:22px;overflow-wrap:break-word}
.auth-card p.sub{font-size:14px;color:var(--muted);margin-top:6px;line-height:1.45}
.auth-card form{display:flex;flex-direction:column;gap:14px;margin-top:22px}
.auth-card label{display:flex;flex-direction:column;gap:6px;font-size:12.5px;font-weight:600;color:var(--muted)}
.auth-card input.field,.auth-card select.field{height:48px;font-size:16px;width:100%;border-radius:var(--r-md)}
.auth-card .btn{height:48px;justify-content:center;font-size:16px;width:100%}
.auth-card .foot{font-size:12.5px;color:var(--faint);text-align:center;margin-top:18px;line-height:1.45}
@media (max-width:699px){
  .auth{align-items:flex-start;padding-top:max(32px,calc(env(safe-area-inset-top) + 16px))}
  .auth-card{padding:28px 20px 24px;border-radius:var(--r-lg)}
  .auth-card p.sub,.auth-card label{font-size:14px}
  .auth-card .foot{font-size:13px}
}
input.code{letter-spacing:.35em;text-align:center;font-size:22px !important;font-weight:700 !important}
.qr{display:flex;justify-content:center;margin:18px 0 6px}
.qr svg{width:184px;height:184px;border-radius:12px;background:#fff;padding:10px;box-shadow:inset 0 0 0 1px var(--line)}
.key{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12.5px;background:var(--fill);border-radius:var(--r-sm);padding:8px 10px;word-break:break-all;text-align:center;letter-spacing:.06em;user-select:all}
.center{display:flex;align-items:center;justify-content:center;min-height:60vh;color:var(--muted)}
/* item photo upload */
.item-photo{position:relative;cursor:pointer}
.item-photo .ph-over{position:absolute;inset:auto 0 0 0;padding:10px;display:flex;justify-content:center;opacity:0;transition:opacity .15s}
.item-photo:hover .ph-over,.item-photo.busy .ph-over{opacity:1}
.item-photo.busy img{opacity:.6}
.item-photo.drag{box-shadow:0 0 0 3px var(--ink)}
.ph-empty{width:100%;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;color:var(--muted);font-size:13px;font-weight:600}
/* orders */
.olist .row{align-items:flex-start;padding:12px 0}
.onum{font-size:22px;font-weight:750;letter-spacing:-.03em;font-variant-numeric:tabular-nums;width:52px;flex:none;line-height:1.1}
.olines{font-size:12.5px;color:var(--muted);margin-top:3px;line-height:1.45}
.void .onum,.void .t1{text-decoration:line-through;color:var(--faint)}
/* translations */
table.tr td{height:auto;padding-top:10px;padding-bottom:10px;vertical-align:top}
table.tr input.field{width:100%}
table.tr .base{font-weight:600}
table.tr .kind{font-size:11.5px;color:var(--faint);text-transform:uppercase;letter-spacing:.05em;font-weight:650}
.rtl{direction:rtl;font-family:var(--font-he)}
/* hours editor */
.day .times input.field{height:34px}
.win{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:10px 0;border-top:1px solid var(--line)}
.win:first-child{border-top:0}
.daypick{display:flex;gap:4px;flex-wrap:wrap}
.daypick button{width:40px;height:32px;border-radius:var(--r-pill);background:var(--fill);font-size:12.5px;font-weight:650;color:var(--muted)}
.daypick button.on{background:var(--acc);color:var(--acc-on)}
.pin{font-size:30px;letter-spacing:.4em;text-align:center;font-weight:750}
.code-big{font-size:34px;font-weight:750;letter-spacing:.08em;text-align:center;font-variant-numeric:tabular-nums;padding:18px;background:var(--fill);border-radius:var(--r-lg)}
.kv{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px 16px;font-size:13.5px}
.kv .k{color:var(--muted)}
.kv .v{text-align:right;font-variant-numeric:tabular-nums;font-weight:600}
.swatchin{width:36px;height:36px;border-radius:50%;border:1px solid var(--line-2);padding:0;overflow:hidden;cursor:pointer;flex:none}
.swatchin::-webkit-color-swatch-wrapper{padding:0}.swatchin::-webkit-color-swatch{border:0}
.preview-start{border-radius:var(--r-lg);height:260px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;position:relative;overflow:hidden}
.preview-start .w{font-size:14px;font-weight:600}
.preview-start .b{font-size:40px;font-weight:800;letter-spacing:-.04em}
.preview-start .c{margin-top:10px;padding:10px 20px;border-radius:999px;font-weight:700;font-size:14px}
.cat-meta .tag{height:auto;min-height:22px;white-space:normal;padding:3px 8px;line-height:1.3}
.err-box{max-width:520px;margin:12vh auto;text-align:center}
.err-box h2{font-size:20px;font-weight:700;letter-spacing:-.02em}
.err-box p{color:var(--muted);margin:8px 0 18px;font-size:14px}
.set-wrap>*{min-width:0}
.seg{max-width:100%;overflow-x:auto;scrollbar-width:none}.seg::-webkit-scrollbar{display:none}.seg>button{flex:none}
@media (max-width:1099px){.subnav{overflow-x:auto;scrollbar-width:none}.subnav::-webkit-scrollbar{display:none}}

/* ---- invites (Staff → Back office, and the /invite page) ---- */
.avatar.inv{background:var(--fill);color:var(--muted)}
.mt6{margin-top:6px}
.inv-link{display:flex;align-items:center;gap:10px;padding:14px 16px;background:var(--fill);border-radius:var(--r-lg);cursor:pointer;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:13px;color:var(--ink);user-select:all}
.inv-link span{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.inv-link .i{flex:none;color:var(--muted)}
.inv-actions{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px;margin-top:14px}
.btn.big{height:50px;justify-content:center;font-size:15px;border-radius:var(--r-pill)}
@media (max-width:640px){.inv-actions{grid-template-columns:minmax(0,1fr)}}
.stepup{padding:4px 0}
.stepup .t1{display:flex;align-items:center;gap:8px;font-weight:650;font-size:15px;margin-bottom:4px}
.stepup .btn{width:100%;justify-content:center;height:44px}
.auth-card .field.ro{background:var(--fill);border-color:transparent;color:var(--muted)}
.auth-card .pw{position:relative;display:block}
.auth-card .pw .field{padding-inline-end:72px}
.auth-card .pw-eye{position:absolute;inset-inline-end:6px;top:6px;height:36px;padding:0 10px;border-radius:var(--r-pill);font-size:12.5px;font-weight:600;color:var(--muted)}
.auth-card .pw-eye:hover{background:var(--fill)}
.auth-card .pw-hint{font-weight:500;color:var(--muted);display:flex;align-items:center;gap:5px}
.auth-card .pw-hint.ok{color:var(--ok)}
.auth-card .logo.inv-ico{background:var(--fill);color:var(--ink)}
/* "Forgot password?" under the password field (44px touch target, right-aligned) */
.auth-card .link.forgot{align-self:flex-end;min-height:44px;margin:-10px 0 -8px;padding:0 2px;color:var(--ink);font-size:13px;font-weight:600;background:none;border:0;cursor:pointer}
.auth-card .link.forgot:hover{text-decoration:underline}
.auth-card .mt16{margin-top:16px}
.auth-card .mt24.btn+.mt12.btn{margin-top:10px}

/* ================= touch sizing (SPEC §2): 44 px targets, 16 px inputs (iOS zooms the page into anything smaller) =================
   Last in this file on purpose: app.css loads after bo.css, so these must come after the base sizes above (.seg button,
   .step button, input.field …). Page stylesheets that load later can still size their own controls. */
@media (max-width:1099px),(pointer:coarse),(hover:none){
  .btn{height:44px;padding:0 18px;font-size:15px}
  .btn.sm{position:relative;height:36px;padding:0 14px;font-size:13.5px}
  .btn.sm::after{content:"";position:absolute;inset:-4px 0}
  .btn.icon-only{width:44px}
  .btn.am-btn{width:44px;padding:0}
  .field{height:44px;font-size:16px}
  input.field,select.field,textarea.field{font-size:16px}
  textarea.field{height:auto}
  :where(input:not([type=checkbox],[type=radio],[type=range],[type=color],[type=file],[type=button],[type=submit])),:where(select,textarea){font-size:16px}
  .costin{height:44px;font-size:16px}
  .vat-rate .name-in{height:44px;font-size:16px}
  body .lang-pick select{font-size:16px;min-height:44px}
  .seg button{height:38px;padding:0 14px;font-size:14px}
  .seg.sm button{height:38px;padding:0 12px;font-size:13.5px}
  .sw{width:51px;height:31px}
  .sw::after{width:27px;height:27px}
  .sw.on::after{transform:translateX(20px)}
  [dir=rtl] .sw.on::after{transform:translateX(-20px)}
  .step{height:44px;padding:0 3px}
  .step button{width:38px;height:38px}
  .step b{min-width:38px;font-size:16px}
  input[type=checkbox],input[type=radio]{width:20px;height:20px;accent-color:var(--acc)}
  .sb .nav{min-height:44px}
  .sb-search{height:40px}
  .am-i{min-height:44px;font-size:15px}
  .lrow{min-height:52px}
  .sb-search input,.more-search input{font-size:16px}
  .sb-chev{width:44px;height:44px}
  /* text links that act ("Report", "See all", "Edit order", "Add a break"…): a 44 px tap area, same look */
  :is(.link,.sm-link,.help-link,.os-link,.ev-link,.ev-link-b,.wlink,.inv-link){position:relative}
  :is(.link,.sm-link,.help-link,.os-link,.ev-link,.ev-link-b,.wlink)::after{content:"";position:absolute;left:50%;top:50%;width:max(100%,44px);height:max(100%,44px);transform:translate(-50%,-50%)}
}
