/* SaiDaily owner app. Same palette and type as the desktop program and the approved prototype. */
@font-face { font-family: Plex; font-weight: 400; font-display: swap; src: url(fonts/plex-arabic-400.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: Plex; font-weight: 600; font-display: swap; src: url(fonts/plex-arabic-600.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: Plex; font-weight: 700; font-display: swap; src: url(fonts/plex-arabic-700.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: Plex; font-weight: 400; font-display: swap; src: url(fonts/plex-latin-400.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Plex; font-weight: 600; font-display: swap; src: url(fonts/plex-latin-600.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Plex; font-weight: 700; font-display: swap; src: url(fonts/plex-latin-700.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #F2F5F4; --card: #fff; --ink: #12201C; --muted: #53645F; --line: #DCE4E1; --line2: #E7EEEC;
  --accent: #0F766E; --accent-ink: #0F766E; --accent-soft: #E7F1EF; --accent-2: #5FA9A2;
  --green: #0F6E45; --green-bg: #E4F3EA; --amber: #8F4505; --amber-bg: #FCEFDC; --amber-dot: #E08A1E; --amber-line: #F2D5AE;
  --red: #B42318; --red-bg: #FDECEA; --red-line: #F5C2BC; --grey: #8A9894;
  --r: 22px; --ease: cubic-bezier(.2,.8,.2,1);
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: Plex, system-ui, sans-serif; font-size: 15px; }
body { min-height: 100dvh; overscroll-behavior-y: contain; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
.num { direction: ltr; unicode-bidi: isolate; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.wrap { max-width: 520px; margin: 0 auto; min-height: 100dvh; position: relative; }
.page { padding: calc(18px + var(--safe-t)) 20px calc(100px + var(--safe-b)); display: flex; flex-direction: column; gap: 14px; }
.page.plain { padding-bottom: calc(28px + var(--safe-b)); min-height: 100dvh; }
h1 { margin: 2px 0; font-size: 26px; letter-spacing: -0.01em; }
p { margin: 0; line-height: 1.55; }

/* motion */
.rise { animation: rise .5s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.pop { animation: pop .5s cubic-bezier(.3,1.5,.5,1) both; }
@keyframes pop { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: scale(1); } }
.float { animation: float 4s ease-in-out infinite; }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.pulse { animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(180,35,24,.5); } 70% { box-shadow: 0 0 0 10px rgba(180,35,24,0); } 100% { box-shadow: 0 0 0 0 rgba(180,35,24,0); } }
.live { animation: live 2s infinite; }
@keyframes live { 0% { box-shadow: 0 0 0 0 rgba(15,110,69,.5); } 70% { box-shadow: 0 0 0 7px rgba(15,110,69,0); } 100% { box-shadow: 0 0 0 0 rgba(15,110,69,0); } }
.bar { transform-origin: bottom; animation: grow .8s var(--ease) both; }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.hbar { transform-origin: left; animation: hgrow .9s var(--ease) both; }
[dir=rtl] .hbar { transform-origin: right; }
@keyframes hgrow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.spin { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }

/* building blocks */
.card { background: var(--card); border-radius: var(--r); padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 1px 2px rgba(16,46,40,.05); }
.label { font-size: 13px; color: var(--muted); font-weight: 500; }
.row { display: flex; align-items: center; gap: 12px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.btn { height: 54px; border-radius: 18px; border: none; background: var(--accent); color: #fff; font-size: 16px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 0 18px; transition: transform .15s, background .2s, opacity .2s; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.secondary { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn.ghost { background: none; color: var(--accent); height: 44px; padding: 0 8px; }
.btn.danger { background: #fff; color: var(--red); border: 1px solid var(--red-line); }
.btn.small { height: 40px; border-radius: 14px; font-size: 14px; padding: 0 14px; }
.icon-btn { width: 44px; height: 44px; border-radius: 14px; border: 1px solid var(--line); background: #fff; display: flex; align-items: center; justify-content: center; position: relative; flex: none; }
.icon-btn .badge { position: absolute; top: 6px; inset-inline-end: 6px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
svg.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[dir=rtl] svg.flip { transform: scaleX(-1); }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -20px; padding: 2px 20px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 36px; padding: 0 14px; border-radius: 18px; border: 1px solid var(--line); background: #fff; font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 7px; transition: background .2s, color .2s; }
.chip.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.chip .dot { width: 7px; height: 7px; border-radius: 4px; }
.pill { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 10px; white-space: nowrap; }
.tone-0 { background: var(--accent-soft); color: var(--accent-ink); }
.tone-1 { background: var(--green-bg); color: var(--green); }
.tone-2 { background: var(--amber-bg); color: var(--amber); }
.tone-3 { background: var(--red-bg); color: var(--red); }
.grey { background: #EEF1F0; color: var(--muted); }
.field { display: flex; flex-direction: column; gap: 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.input { height: 56px; border-radius: 16px; background: #fff; border: 2px solid var(--line); padding: 0 16px; font-size: 17px; font-weight: 600; color: var(--ink); outline: none; width: 100%; transition: border-color .2s; }
.input:focus { border-color: var(--accent); }
.phone { display: flex; align-items: center; gap: 10px; direction: ltr; }
.phone .cc { font: inherit; font-size: 17px; font-weight: 600; color: var(--ink); background: none; border: none; outline: none; padding: 0 4px 0 0; -webkit-appearance: none; appearance: none; border-inline-end: 1px solid var(--line, #d7dfdc); margin-inline-end: 4px; cursor: pointer; }
.code-input { letter-spacing: .5em; text-align: center; font-size: 26px; direction: ltr; }
.error { color: var(--red); font-size: 14px; font-weight: 600; min-height: 20px; }
.spacer { flex: 1; }

/* header */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand img { width: 38px; height: 38px; border-radius: 11px; background: #fff; }
.brand .t { display: flex; flex-direction: column; min-width: 0; }
.brand .t b { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand .t span { font-size: 12px; color: var(--muted); }

/* today */
.status { border: none; border-radius: var(--r); padding: 16px; display: flex; align-items: center; gap: 14px; text-align: start; width: 100%; }
.status .ic { width: 40px; height: 40px; border-radius: 20px; display: flex; align-items: center; justify-content: center; color: #fff; flex: none; }
.status .tx { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.status .tx b { font-size: 16px; }
.status .tx span { font-size: 13px; opacity: .85; }
.big { font-size: 38px; font-weight: 700; letter-spacing: -0.02em; }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 64px; direction: ltr; }
.bars > div { flex: 1; border-radius: 4px; background: var(--accent); min-height: 3px; }
.bars > div.now { background: var(--accent-2); }
.bars > div.zero { background: var(--line); }
.axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: -6px; direction: ltr; }
.kpi { background: #fff; border-radius: 20px; padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.kpi .v { font-size: 22px; font-weight: 700; }
.kpi .k { font-size: 13px; color: var(--muted); }
.kpi .s { font-size: 12px; color: var(--muted); }
.avatar { width: 38px; height: 38px; border-radius: 19px; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 14px; display: flex; align-items: center; justify-content: center; flex: none; }
.empty { text-align: center; padding: 26px 10px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 10px; }

/* alerts */
.alert { border: 1px solid var(--line); background: #fff; border-radius: 18px; padding: 14px; display: flex; gap: 12px; align-items: flex-start; text-align: start; width: 100%; }
.alert .mk { width: 34px; height: 34px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px; flex: none; margin-top: 2px; }
.alert .tx { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.alert .tx b { font-size: 15px; }
.alert .tx span { font-size: 13px; color: var(--muted); line-height: 1.4; }
.alert .tm { font-size: 12px; color: var(--muted); white-space: nowrap; }
.alert.t3 { border-color: var(--red-line); }
.alert.t2 { border-color: var(--amber-line); }

/* bottom nav */
.nav { position: fixed; bottom: 0; inset-inline: 0; max-width: 520px; margin: 0 auto; background: rgba(255,255,255,.95); backdrop-filter: blur(10px); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 6px 8px calc(10px + var(--safe-b)); z-index: 5; }
.nav button { border: none; background: none; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--muted); padding: 6px 0; transition: color .2s; }
.nav button.on { color: var(--accent); }
.nav svg.i { width: 23px; height: 23px; }

/* sheet */
.sheet-wrap { position: fixed; inset: 0; z-index: 20; }
.sheet-wrap .shade { position: absolute; inset: 0; background: rgba(16,46,40,.4); opacity: 0; transition: opacity .3s; }
.sheet-wrap.open .shade { opacity: 1; }
.sheet { position: absolute; bottom: 0; inset-inline: 0; max-width: 520px; margin: 0 auto; background: #fff; border-radius: 28px 28px 0 0; padding: 10px 20px calc(24px + var(--safe-b)); display: flex; flex-direction: column; gap: 14px; transform: translateY(105%); transition: transform .38s var(--ease); max-height: 88dvh; overflow-y: auto; box-shadow: 0 -10px 40px rgba(16,46,40,.18); }
.sheet-wrap.open .sheet { transform: none; }
.sheet .grab { align-self: center; width: 40px; height: 5px; border-radius: 3px; background: var(--line); }
.facts { background: var(--bg); border-radius: 16px; padding: 4px 14px; }
.facts > div { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; font-size: 14px; border-bottom: 1px solid var(--line); }
.facts > div:last-child { border-bottom: none; }
.facts span:first-child { color: var(--muted); }
.facts span:last-child { font-weight: 700; text-align: end; }

/* settings */
.setting { padding: 14px 0; border-bottom: 1px solid var(--line2); display: flex; flex-direction: column; gap: 10px; }
.setting:last-child { border-bottom: none; }
.switch { position: relative; width: 52px; height: 32px; border-radius: 16px; border: none; padding: 0; background: #C9D3D0; flex: none; transition: background .25s; }
.switch[aria-checked=true] { background: var(--accent); }
.switch::after { content: ''; position: absolute; top: 3px; inset-inline-start: 3px; width: 26px; height: 26px; border-radius: 13px; background: #fff; box-shadow: 0 1px 3px rgba(16,46,40,.3); transition: transform .3s var(--ease); }
.switch[aria-checked=true]::after { transform: translateX(20px); }
[dir=rtl] .switch[aria-checked=true]::after { transform: translateX(-20px); }
.opts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.opts .chip { height: 34px; font-size: 13px; background: var(--bg); }
.opts .chip.on { background: var(--accent); }
.lock { display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; color: var(--red); background: var(--red-bg); padding: 6px 10px; border-radius: 10px; flex: none; }

/* scanning */
.scanner { position: relative; height: 260px; border-radius: 26px; background: #0E1A18; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.scanner video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scanner .frame { position: relative; width: 180px; height: 180px; border-radius: 20px; border: 3px solid rgba(255,255,255,.9); box-shadow: 0 0 0 999px rgba(0,0,0,.35); }
.scanner .line { position: absolute; left: 10px; right: 10px; height: 3px; border-radius: 2px; background: #5EEAD4; box-shadow: 0 0 14px #5EEAD4; animation: scan 1.8s ease-in-out infinite; }
@keyframes scan { 0%,100% { top: 12%; } 50% { top: 84%; } }
.scanner .hint { position: absolute; bottom: 12px; left: 0; right: 0; text-align: center; font-size: 13px; color: rgba(255,255,255,.85); }

/* welcome */
.hero { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 22px; }
.hero .logo { width: 108px; height: 108px; border-radius: 32px; background: #fff; box-shadow: 0 20px 40px rgba(15,118,110,.25); display: flex; align-items: center; justify-content: center; }
.hero .logo img { width: 84px; height: 84px; }
.glow { background: radial-gradient(120% 70% at 50% 0%, #D6ECE8 0%, var(--bg) 60%); }

.toast { position: fixed; bottom: calc(96px + var(--safe-b)); left: 50%; transform: translateX(-50%); z-index: 30; background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 14px; font-size: 14px; font-weight: 600; max-width: calc(100% - 40px); box-shadow: 0 8px 24px rgba(0,0,0,.2); animation: rise .35s var(--ease) both; }
.offline { background: #EEF1F0; color: var(--muted); border-radius: 16px; padding: 12px 14px; font-size: 13px; display: flex; align-items: center; gap: 10px; }

/* Alerts: seen, swipe to delete */
.alert { position: relative; transition: transform .3s var(--ease), border-color .3s, background .3s; touch-action: pan-y; }
.alert.seen { border-color: var(--line); }
.alert.seen .tx b { font-weight: 600; color: var(--muted); }
.alert.seen .mk { opacity: .55; }
.alert .tm { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.alert .new { width: 8px; height: 8px; border-radius: 4px; background: var(--accent); display: block; }
.swipe { position: relative; border-radius: 18px; transition: height .3s var(--ease), opacity .3s, margin .3s; }
.swipe-bg { position: absolute; inset: 0; border-radius: 18px; background: var(--grey); color: #fff; display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; font-size: 14px; font-weight: 700; opacity: 0; transition: opacity .15s, background .2s; }
.swipe-bg span { display: flex; align-items: center; gap: 6px; }
.swipe.dragging .swipe-bg, .swipe.gone .swipe-bg { opacity: 1; }
.swipe.armed .swipe-bg { background: var(--red); }
.swipe.dragging .alert { transition: none; }
.swipe.gone { height: 0 !important; opacity: 0; margin-bottom: -14px; overflow: hidden; }
.toast { display: flex; align-items: center; gap: 16px; }
[hidden] { display: none !important; }
.toast button { background: none; border: none; color: #7FE0D3; font: inherit; font-weight: 700; padding: 4px 0; cursor: pointer; }
.btn.danger .i { stroke: currentColor; }
.toast { left: 0; right: 0; margin-inline: auto; width: max-content; transform: none; }

/* Notifications */
.push-card { border: 1px solid var(--accent-soft); background: linear-gradient(180deg, var(--accent-soft), var(--card) 70%); gap: 14px; }
.push-card .ic { width: 42px; height: 42px; border-radius: 14px; background: var(--accent); display: flex; align-items: center; justify-content: center; flex: none; animation: ring 2.4s var(--ease) 0.6s 2; }
.push-card .ic .i { stroke: #fff; }
@keyframes ring { 0%, 60%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(-12deg); } 20%, 40% { transform: rotate(12deg); } 50% { transform: rotate(-4deg); } }
@media (prefers-reduced-motion: reduce) { .push-card .ic { animation: none; } }

/* Stock to watch */
.stock-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.stock-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.stock-item > span:first-child { display: flex; flex-direction: column; min-width: 0; }
.stock-item b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stock-item small { color: var(--muted); font-size: 11px; }
.stock-item .qty { font-size: 12px; white-space: nowrap; text-align: end; }

/* Morning summary in full */
.morning-detail { display: flex; flex-direction: column; gap: 18px; }
.morning-ph { display: flex; flex-direction: column; gap: 6px; }
.morning-ph + .morning-ph { border-top: 1px solid var(--line); padding-top: 16px; }

/* Order list */
.order-group { gap: 0; padding-bottom: 10px; }
.order-group > .between:first-child { padding-bottom: 8px; }
.order-line { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.ol-name { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; background: none; border: none; padding: 0; text-align: start; font: inherit; color: inherit; cursor: pointer; }
.ol-name b { font-size: 15px; font-weight: 600; }
.ol-name .muted { font-size: 12px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tag { font-style: normal; font-weight: 700; font-size: 11px; padding: 2px 7px; border-radius: 7px; }
.tag.t3 { background: var(--red-bg); color: var(--red); }
.tag.t2 { background: var(--amber-bg); color: var(--amber); }
.stepper { display: flex; align-items: center; gap: 4px; flex: none; }
.stepper button { width: 34px; height: 34px; border-radius: 11px; border: 1px solid var(--line); background: var(--card); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.stepper button:active { transform: scale(.92); }
.stepper > span { min-width: 46px; display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.stepper > span b { font-size: 17px; }
.stepper > span small { font-size: 10px; color: var(--muted); }
.order-foot { border-top: 1px solid var(--line); padding-top: 10px; }
.hit { display: flex; justify-content: space-between; align-items: center; padding: 10px 2px; border: none; border-top: 1px solid var(--line); background: none; font: inherit; color: inherit; text-align: start; cursor: pointer; }
.order-msg { white-space: pre-wrap; font: inherit; font-size: 14px; line-height: 1.6; background: var(--bg); border-radius: 14px; padding: 12px 14px; margin: 0; max-height: 40dvh; overflow: auto; }
