/* ============================================================================
   Otlub PLUS — shared POS shell
   Tokens, base, tablet shell and the fixed 1024x768 canvas, lifted out of
   index.html so every till screen that lives in its own file looks identical.
   ============================================================================ */

/* ============ 1. TOKENS — Otlub PLUS palette ============ */
:root{
  /* Otlub PLUS brand red, sampled from the logo artwork */
  --brand:#D40000;
  --brand-strong:#A80000;
  --brand-soft:#FDE7E7;
  --brand-ring:rgba(212,0,0,.28);
  --brand-ar:#E42827;          /* Arabic lockup plate red */

  --page:#E3E6EE;
  --bg:#EEF0F5;
  --surface:#FFFFFF;
  --surface-2:#F4F5F9;
  --rail:#FFFFFF;
  --rail-2:#F0F1F6;

  --ink:#26262E;
  --ink-2:#5C5C68;
  --ink-3:#9A9AA6;

  --line:#E4E6EE;
  --line-strong:#CDD1DE;
  --course:#22B36B;

  --ok:#128A4C;      --ok-soft:#E1F6EC;
  --warn:#9A5B04;    --warn-soft:#FCEFD6;
  --danger:#8A1010;  --danger-soft:#F7DADA;
  --info:#0B6B78;    --info-soft:#D9F1F4;

  --r-s:6px; --r-m:8px; --r-l:10px;
  --shadow:0 1px 2px rgba(20,20,40,.06);
  --pop:0 18px 44px -18px rgba(20,20,40,.4);

  --f-ui:"Plus Jakarta Sans","Almarai",system-ui,-apple-system,"Segoe UI",sans-serif;
  --f-ar:"Plus Jakarta Sans","Almarai",system-ui,-apple-system,"Segoe UI",sans-serif;
  --f-mono:"IBM Plex Mono",ui-monospace,monospace;
}
@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]){
    --page:#08080D; --bg:#12121A; --surface:#1C1C26; --surface-2:#23232F;
    --rail:#1C1C26; --rail-2:#23232F;
    --ink:#F2F2F7; --ink-2:#C2C2CE; --ink-3:#8E8E9C;
    --line:#2E2E3C; --line-strong:#40404F;
    --brand:#FF5F58; --brand-strong:#FF8A85; --brand-soft:#3A1210; --brand-ring:rgba(255,95,88,.34);
    --course:#3FD68A;
    --ok:#5CD99A; --ok-soft:#123626;
    --warn:#F0B65C; --warn-soft:#3A2A0E;
    --danger:#FF8A8A; --danger-soft:#3A1616;
    --info:#5FD3E0; --info-soft:#0E3138;
    --shadow:0 1px 2px rgba(0,0,0,.4);
    --pop:0 22px 50px -18px rgba(0,0,0,.8);
  }
}
:root[data-theme="dark"]{
  --page:#08080D; --bg:#12121A; --surface:#1C1C26; --surface-2:#23232F;
  --rail:#1C1C26; --rail-2:#23232F;
  --ink:#F2F2F7; --ink-2:#C2C2CE; --ink-3:#8E8E9C;
  --line:#2E2E3C; --line-strong:#40404F;
  --brand:#FF5F58; --brand-strong:#FF8A85; --brand-soft:#3A1210; --brand-ring:rgba(255,95,88,.34);
  --course:#3FD68A;
  --ok:#5CD99A; --ok-soft:#123626;
  --warn:#F0B65C; --warn-soft:#3A2A0E;
  --danger:#FF8A8A; --danger-soft:#3A1616;
  --info:#5FD3E0; --info-soft:#0E3138;
  --shadow:0 1px 2px rgba(0,0,0,.4);
  --pop:0 22px 50px -18px rgba(0,0,0,.8);
}

/* ============ 2. BASE ============ */
*{box-sizing:border-box}
body{
  margin:0; background:var(--page); color:var(--ink);
  font-family:var(--f-ui); font-size:15px; line-height:1.4;
  -webkit-font-smoothing:antialiased;
}
button{font:inherit;color:inherit;border:0;background:none;cursor:pointer}
:focus-visible{outline:3px solid var(--brand);outline-offset:2px;border-radius:3px}
.num{font-variant-numeric:tabular-nums;direction:ltr;unicode-bidi:isolate}

/* ============ 3. SHELL — iPad status bar + tab bar ============ */
/* Bootstrap-style responsive container: set --container to 100% for a fluid layout */
:root{--container:100%}
@media (min-width:576px){ :root{--container:540px} }
@media (min-width:768px){ :root{--container:720px} }
@media (min-width:992px){ :root{--container:960px} }
@media (min-width:1200px){ :root{--container:1140px} }
@media (min-width:1400px){ :root{--container:1320px} }

.app{
  display:flex;flex-direction:column;height:100vh;min-height:600px;overflow:hidden;
  width:100%;max-width:var(--container);margin-inline:auto;
  background:var(--bg);
  box-shadow:0 0 0 1px rgba(20,20,40,.06), 0 22px 60px -30px rgba(20,20,40,.45);
}
@media (min-width:576px){ .app{border-radius:0} }
.app[dir="rtl"]{direction:rtl}

.topbar{
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  padding:5px 16px;font-size:12px;font-weight:700;color:var(--ink-2);
  background:var(--bg);flex:none;
}
.tb-right{display:flex;align-items:center;gap:10px}

/* brand lockup — Otlub PLUS.
   Four cuts of the wordmark ship in assets/brand: latin/arabic x red/white.
   Only one is ever shown; the rest are hidden by locale (dir) and theme. */
.brandmark{display:flex;align-items:center;gap:9px;flex:none;user-select:none}
.brandmark img.bm-mark{width:24px;height:24px;display:block}
.brandmark img.bm-word{height:16px;width:auto;display:none}
.brandmark img.bm-word.bm-ar{height:18px}

/* locale: latin lockup by default, arabic lockup in RTL */
.brandmark .bm-en.bm-red{display:block}
.app[dir="rtl"] .brandmark .bm-en{display:none !important}
.app[dir="rtl"] .brandmark .bm-ar.bm-red{display:block}

/* theme: the red cut reads on light surfaces, the white cut on dark */
@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]) .brandmark .bm-red{display:none !important}
  :root:not([data-theme="light"]) .brandmark .bm-en.bm-white{display:block}
  :root:not([data-theme="light"]) .app[dir="rtl"] .brandmark .bm-ar.bm-white{display:block}
}
:root[data-theme="dark"] .brandmark .bm-red{display:none !important}
:root[data-theme="dark"] .brandmark .bm-en.bm-white{display:block}
:root[data-theme="dark"] .app[dir="rtl"] .brandmark .bm-ar.bm-white{display:block}

:root[data-theme="light"] .brandmark .bm-white{display:none !important}
:root[data-theme="light"] .brandmark .bm-en.bm-red{display:block}
:root[data-theme="light"] .app[dir="rtl"] .brandmark .bm-ar.bm-red{display:block}
.tb-left{display:flex;align-items:center;gap:12px;min-width:0}
.tb-div{width:1px;height:14px;background:var(--line-strong);flex:none}
.branchmini{font-size:12px;font-weight:700;color:var(--ink-3)}
.lang-toggle{display:flex;border:1.5px solid var(--line-strong);border-radius:4px;overflow:hidden}
.lang-toggle button{padding:3px 9px;font-size:11.5px;font-weight:800;color:var(--ink-3);background:var(--surface)}
.lang-toggle button[aria-pressed="true"]{background:var(--brand);color:#fff}
.ico{
  width:26px;height:26px;border-radius:4px;border:1.5px solid var(--line-strong);
  background:var(--surface);display:grid;place-items:center;color:var(--ink-2);
}
.ico svg{width:15px;height:15px}

.stage{flex:1;min-height:0;display:flex;position:relative}
.screens{flex:1;min-height:0;position:relative}
.screen{position:absolute;inset:0;display:none;min-height:0;padding:12px;gap:12px}
.screen.on{display:flex;animation:fade .24s ease both}
@keyframes fade{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}

.tabbar{
  flex:none;height:62px;background:var(--surface);border-radius:var(--r-m);
  display:grid;grid-template-columns:repeat(4,1fr);box-shadow:var(--shadow);
}
.rail-btn{
  display:flex;align-items:center;justify-content:center;gap:9px;
  font-size:13.5px;font-weight:700;letter-spacing:.03em;text-transform:uppercase;color:var(--ink-2);
  border-radius:var(--r-m);transition:.15s;
}
.rail-btn{text-decoration:none}
.rail-btn svg{width:21px;height:21px}
.rail-btn:hover{color:var(--brand)}
.rail-btn[aria-current="true"]{color:var(--brand)}

/* ============ 9. TOAST + RESPONSIVE ============ */
.toast{
  /* physical left:50% — translateX(-50%) below is physical, see #device */
  position:fixed;bottom:26px;left:50%;transform:translateX(-50%) translateY(20px);
  background:var(--ink);color:var(--surface);padding:14px 22px;border-radius:999px;
  font-size:15px;font-weight:700;opacity:0;pointer-events:none;transition:.28s;z-index:60;
}
.toast.on{opacity:1;transform:translateX(-50%) translateY(0)}
@media (max-width:1180px){
  .two{grid-template-columns:1fr}
  .act-tile,.actbar .tbtn{height:72px;font-size:10.5px;gap:5px}
  .act-tile svg,.actbar .tbtn svg{width:24px;height:24px}
}
@media (max-width:900px){
  .pos{flex-direction:column}
  .order{width:auto;max-height:46vh}
  .actbar{grid-template-columns:repeat(4,minmax(0,1fr))}
}
@media (prefers-reduced-motion:reduce){
  *{animation-duration:.01ms!important;transition-duration:.01ms!important}
}
}

/* ============ 15. Foodics-accurate finishing touches ============ */
.total-bar .lbl{text-transform:uppercase}

.screen[data-screen="tables"],.screen[data-screen="orders"],.screen[data-screen="dash"]{
  flex-direction:column;gap:12px;
}
.screen[data-screen="tables"] .sec-bar,
.screen[data-screen="orders"] .oh-tabs,
.screen[data-screen="orders"] .oh-filters{border-radius:var(--r-m);border:0;box-shadow:var(--shadow)}
.screen[data-screen="orders"] .oh-body{border-radius:var(--r-m);overflow:hidden;background:var(--surface);box-shadow:var(--shadow)}
.screen[data-screen="tables"] .floor{background:none;padding:0}
.screen[data-screen="dash"]{overflow:auto}
.screen[data-screen="dash"] .dash-in{padding:0}
.screens .tabbar{margin-top:auto}

/* ============ 18. FIXED TABLET CANVAS (iPad landscape, 1024 × 768) ============
   The app is drawn at tablet size and scaled to fit whatever screen it is
   opened on, so the proportions never change. Viewport media queries are
   therefore neutralised — the canvas is always 1024 wide. */
html,body{height:100%}
body{overflow:hidden;background:var(--page)}
#device{
  /* Centred with PHYSICAL left/top on purpose: the matching transform below is
     translate(-50%,-50%), and transform axes are always physical. Under dir=rtl
     inset-inline-start resolves to `right`, so the pair pushed the canvas a full
     width off the left edge — and body{overflow:hidden} made it unreachable. */
  position:absolute;top:50%;left:50%;
  width:1024px;height:768px;transform-origin:center center;
  background:var(--bg);border-radius:6px;overflow:hidden;
  box-shadow:0 0 0 1px rgba(20,20,40,.12), 0 30px 70px -28px rgba(20,20,40,.5);
}
:root[data-theme="dark"] #device{box-shadow:0 0 0 1px rgba(255,255,255,.07), 0 30px 70px -28px rgba(0,0,0,.85)}
#device .app{height:100%;max-width:none;margin:0;border-radius:0;box-shadow:none}

/* hold the tablet layout at every screen size */
.screen.pos.on{display:flex;flex-direction:row}
.order{width:330px;max-height:none}
.actbar{grid-template-columns:repeat(7,minmax(0,1fr))}
.act-tile,.actbar .tbtn{height:72px;font-size:10.5px;gap:5px}
.act-tile svg,.actbar .tbtn svg{width:24px;height:24px}
.mask{inset-inline-start:354px}
.two{grid-template-columns:1.6fr 1fr}
.oh-body{grid-template-columns:1fr 430px}
.oh-detail{display:flex}
.sp-cols{grid-template-columns:repeat(var(--cols,4),minmax(0,1fr))}
.rt-grid{grid-template-columns:repeat(3,1fr)}
.rt-inv{grid-template-columns:1fr 1fr}
.dc-grid{grid-template-columns:1fr 260px}
.dc-pre{grid-template-columns:repeat(2,1fr)}
.padwrap.on{grid-template-columns:1fr 260px}
