/* Tengenium demo app — shared mobile UI. Each app sets --p, --p2, --ps, --bg tokens. */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: "Hind Siliguri", system-ui, -apple-system, sans-serif; background: #E9EBEE; color: #14171C; -webkit-font-smoothing: antialiased; font-size: 15px; line-height: 1.45; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--p); outline-offset: 2px; border-radius: 6px; }
.app { position: relative; max-width: 440px; height: 100dvh; margin: 0 auto; background: var(--bg); display: flex; flex-direction: column; overflow: hidden; }
@media (min-width: 700px) { body:not(.embed) { padding: 24px 0; } body:not(.embed) .app { height: min(860px, calc(100dvh - 48px)); border-radius: 36px; box-shadow: 0 30px 80px -30px rgba(0,0,0,.45), 0 0 0 10px #101216; } }

/* top bar */
.top { padding: 14px 18px 10px; background: var(--p); color: #fff; position: relative; }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.biz { display: flex; align-items: center; gap: 10px; }
.biz-logo { width: 38px; height: 38px; border-radius: 12px; background: rgba(255,255,255,.18); display: grid; place-items: center; font-weight: 700; font-family: var(--fd); font-size: 1.05rem; }
.biz b { display: block; font-family: var(--fd); font-size: 1.05rem; line-height: 1.1; }
.biz small { opacity: .8; font-size: .8rem; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; border: 0; background: rgba(255,255,255,.16); color: #fff; display: grid; place-items: center; cursor: pointer; position: relative; }
.icon-btn svg { width: 20px; height: 20px; }
.badge { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; border-radius: 9px; background: #FFC531; color: #14171C; font-size: .7rem; font-weight: 700; display: grid; place-items: center; padding: 0 4px; }
.hello { margin-top: 14px; }
.hello h1 { margin: 0; font-family: var(--fd); font-size: 1.45rem; line-height: 1.15; }
.hello p { margin: 2px 0 0; opacity: .85; font-size: .9rem; }

/* scroll area */
.screen { flex: 1; overflow-y: auto; padding: 14px 16px 96px; -webkit-overflow-scrolling: touch; }
.screen[hidden] { display: none; }
.h2 { font-family: var(--fd); font-size: 1.05rem; margin: 18px 2px 10px; display: flex; justify-content: space-between; align-items: center; }
.h2 button { border: 0; background: none; color: var(--p); font-weight: 600; cursor: pointer; font-size: .88rem; min-height: 32px; }

/* KPI cards */
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: -30px; position: relative; }
.kpi { background: #fff; border-radius: 16px; padding: 12px 14px; box-shadow: 0 6px 18px -10px rgba(0,0,0,.25); }
.kpi small { color: #5B636E; font-size: .78rem; display: block; }
.kpi b { font-family: var(--fd); font-size: 1.35rem; display: block; line-height: 1.2; }
.kpi em { font-style: normal; font-size: .75rem; color: #1A8754; }
.kpi.alert em { color: #C2410C; }

/* banner for website orders */
.inbox-banner { display: flex; gap: 12px; align-items: center; background: var(--ps); border: 1.5px dashed var(--p); border-radius: 16px; padding: 12px 14px; margin-top: 14px; }
.inbox-banner b { display: block; }
.inbox-banner small { color: #5B636E; }
.inbox-banner button { margin-left: auto; flex: none; }

/* chart */
.card { background: #fff; border-radius: 18px; padding: 14px; box-shadow: 0 6px 18px -12px rgba(0,0,0,.2); }
.bars { display: flex; align-items: flex-end; gap: 8px; height: 120px; margin-top: 10px; }
.bars div { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.bars i { display: block; width: 100%; border-radius: 8px 8px 4px 4px; background: var(--ps); transition: height .5s; }
.bars div.today i { background: var(--p); }
.bars span { font-size: .7rem; color: #5B636E; }

/* list rows */
.list { display: grid; gap: 10px; }
.row { display: grid; grid-template-columns: 46px 1fr auto; gap: 12px; align-items: center; background: #fff; border-radius: 16px; padding: 10px 12px; border: 0; width: 100%; text-align: left; cursor: pointer; box-shadow: 0 4px 14px -10px rgba(0,0,0,.25); }
.row:active { transform: scale(.99); }
.thumb { width: 46px; height: 46px; border-radius: 12px; background: var(--ps) center/cover no-repeat; display: grid; place-items: center; font-weight: 700; color: var(--p); }
.row b { display: block; font-size: .95rem; line-height: 1.25; }
.row small { color: #5B636E; font-size: .8rem; display: block; }
.row .amt { text-align: right; font-weight: 700; font-size: .95rem; }
.pill { display: inline-block; font-size: .72rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; margin-top: 3px; white-space: nowrap; }
.s0 { background: #FFF1D6; color: #8A5300; } .s1 { background: #E0EBFF; color: #1F4FB8; } .s2 { background: #F1E4FF; color: #6A2BB0; } .s3 { background: #DDF4E8; color: #136B43; } .s4 { background: #ECEEF1; color: #4A525C; } .sx { background: #FFE2E0; color: #B42318; }
.src { font-size: .68rem; font-weight: 700; color: var(--p); margin-left: 4px; }

/* chips */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; margin: 0 -2px; scrollbar-width: none; }
.chips button { flex: none; border: 1.5px solid #D7DBE0; background: #fff; border-radius: 999px; padding: 0 14px; min-height: 36px; cursor: pointer; font-weight: 500; font-size: .88rem; }
.chips button[aria-pressed="true"] { background: var(--p); border-color: var(--p); color: #fff; }
.search { width: 100%; min-height: 44px; border-radius: 14px; border: 1.5px solid #D7DBE0; padding: 0 14px; background: #fff; margin-bottom: 10px; }

/* stock rows */
.stock { display: grid; grid-template-columns: 46px 1fr auto; gap: 12px; align-items: center; background: #fff; border-radius: 16px; padding: 10px 12px; box-shadow: 0 4px 14px -10px rgba(0,0,0,.25); }
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper button { width: 34px; height: 34px; border-radius: 10px; border: 0; background: var(--ps); color: var(--p); font-weight: 700; font-size: 1.1rem; cursor: pointer; }
.stepper span { min-width: 26px; text-align: center; font-weight: 700; }
.low { color: #C2410C; font-weight: 600; }

/* cook list / special panels */
.tally { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; }
.tally b { text-align: right; font-family: var(--fd); }

/* bottom nav */
.nav { position: absolute; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid #E3E6EA; display: grid; grid-template-columns: repeat(5, 1fr); padding: 6px 6px calc(8px + env(safe-area-inset-bottom)); z-index: 5; }
.nav button { border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .7rem; color: #6A727D; cursor: pointer; min-height: 52px; justify-content: center; }
.nav button svg { width: 22px; height: 22px; }
.nav button[aria-current="page"] { color: var(--p); font-weight: 700; }
.nav .fab { width: 52px; height: 52px; border-radius: 18px; background: var(--p); color: #fff; margin: -22px auto 0; box-shadow: 0 10px 20px -8px var(--p); display: grid; place-items: center; }
.nav .fab svg { width: 26px; height: 26px; }

/* sheet */
.scrim { position: absolute; inset: 0; background: rgba(10,12,16,.45); opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 10; }
.scrim.on { opacity: 1; pointer-events: auto; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; max-height: 88%; background: var(--bg); border-radius: 24px 24px 0 0; z-index: 11; transform: translateY(105%); transition: transform .32s cubic-bezier(.2,.8,.2,1); display: flex; flex-direction: column; }
.sheet.on { transform: none; }
.grab { width: 40px; height: 5px; border-radius: 3px; background: #C9CED4; margin: 8px auto 0; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 18px 6px; }
.sheet-head h2 { margin: 0; font-family: var(--fd); font-size: 1.25rem; }
.close { width: 38px; height: 38px; border-radius: 50%; border: 0; background: #E4E7EB; cursor: pointer; font-size: 1.1rem; }
.sheet-body { overflow-y: auto; padding: 6px 18px 24px; }
.dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; background: #fff; border-radius: 16px; padding: 14px; margin: 0; }
.dl dt { color: #5B636E; font-size: .88rem; }
.dl dd { margin: 0; font-weight: 600; text-align: right; }
.timeline { display: flex; gap: 6px; margin: 14px 0; }
.timeline div { flex: 1; text-align: center; font-size: .7rem; color: #6A727D; }
.timeline i { display: block; height: 6px; border-radius: 3px; background: #D7DBE0; margin-bottom: 6px; }
.timeline .done i { background: var(--p); }
.timeline .done { color: #14171C; font-weight: 600; }
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 50px; border-radius: 16px; border: 0; background: var(--p); color: #fff; font-weight: 700; cursor: pointer; margin-top: 10px; }
.btn.ghost { background: #fff; color: #14171C; border: 1.5px solid #D7DBE0; }
.btn.sm { width: auto; min-height: 38px; padding: 0 14px; border-radius: 12px; margin: 0; font-size: .85rem; }
.btn.wa { background: #1FA855; }
.fld { display: grid; gap: 5px; margin-bottom: 12px; }
.fld label { font-weight: 600; font-size: .88rem; }
.fld input, .fld select, .fld textarea { min-height: 46px; border-radius: 12px; border: 1.5px solid #D7DBE0; background: #fff; padding: 8px 12px; }
.fld input:focus, .fld select:focus { outline: none; border-color: var(--p); }
.fld .err { color: #B42318; font-size: .8rem; display: none; }
.fld.bad .err { display: block; }
.fld.bad input, .fld.bad select { border-color: #B42318; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.items-mini { list-style: none; margin: 10px 0 0; padding: 0; background: #fff; border-radius: 16px; overflow: hidden; }
.items-mini li { display: flex; justify-content: space-between; padding: 10px 14px; border-top: 1px solid #EEF0F2; font-size: .92rem; }
.items-mini li:first-child { border-top: 0; }

/* toast */
.toast { position: absolute; left: 16px; right: 16px; bottom: 92px; background: #14171C; color: #fff; padding: 12px 16px; border-radius: 14px; z-index: 20; transform: translateY(400%); opacity: 0; transition: transform .3s, opacity .3s; font-weight: 500; }
.toast.on { transform: none; opacity: 1; }
.empty { text-align: center; color: #5B636E; padding: 30px 10px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
