/* Staff app (mobile-first) */
body { background: var(--bg); min-height: 100vh; min-height: 100dvh; }
#root { max-width: 560px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; position: relative; }
@media (min-width: 600px) { body { background: #E3EAE9; } #root { background: var(--bg); box-shadow: 0 0 60px rgba(0,43,43,.08); } }

.splash { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; }
.splash img { width: 210px; }

/* header */
.top {
  position: sticky; top: 0; z-index: 50; padding: calc(10px + var(--safe-top)) 16px 10px;
  display: flex; align-items: center; gap: 10px; background: rgba(243, 246, 245, .92); backdrop-filter: saturate(1.4) blur(12px);
}
.top h2 { margin: 0; font-size: 19px; flex: 1; min-width: 0; }
.top .brand { height: 30px; }
.bell { position: relative; }
.bell .dot { position: absolute; top: 5px; right: 5px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--bg); }

.page { padding: 4px 16px calc(96px + var(--safe-bottom)); }
.page.no-tabs { padding-bottom: calc(120px + var(--safe-bottom)); }
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 22px 2px 10px; }
.section-title h3 { margin: 0; font-size: 16px; }

/* bottom tab bar */
.tabs {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 560px; z-index: 60;
  display: grid; grid-template-columns: repeat(4, 1fr); background: rgba(255, 255, 255, .96); backdrop-filter: blur(12px);
  border-top: 1px solid var(--border); padding: 6px 6px calc(6px + var(--safe-bottom));
}
.tabs a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; border-radius: 12px; color: var(--faint); font-size: 11.5px; font-weight: 600; text-decoration: none; }
.tabs a.on { color: var(--teal); }
.tabs a.on .icon { color: var(--green); }
.tabs .icon { width: 23px; height: 23px; }

/* sticky action bar for flows */
.actionbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 560px; z-index: 60;
  padding: 12px 16px calc(12px + var(--safe-bottom)); background: linear-gradient(to top, var(--bg) 70%, rgba(243,246,245,0));
  display: flex; gap: 10px;
}
.actionbar .btn { flex: 1; }
.actionbar .btn-outline { flex: 0 0 auto; }

/* hero / greeting */
.hello { margin: 6px 2px 16px; }
.hello h1 { font-size: 24px; margin: 0; }
.hello p { margin: 2px 0 0; color: var(--muted); }

.hero {
  border-radius: 24px; padding: 22px 20px; color: #fff; position: relative; overflow: hidden;
  background: radial-gradient(120% 140% at 100% 0%, #0A7C6B 0%, var(--teal) 45%, var(--teal-900) 100%);
  box-shadow: 0 12px 30px rgba(0, 80, 80, .28);
}
.hero::after { content: ''; position: absolute; right: -40px; top: -40px; width: 180px; height: 180px; border-radius: 40px; transform: rotate(45deg); background: rgba(8, 188, 55, .18); }
.hero h2, .hero h3 { color: #fff; position: relative; z-index: 1; }
.hero > * { position: relative; z-index: 1; }
.hero .muted { color: rgba(255,255,255,.75); }
.hero.green { background: radial-gradient(120% 140% at 100% 0%, #3ED66A 0%, var(--green) 40%, #058A28 100%); box-shadow: 0 12px 30px rgba(8, 188, 55, .32); }
.hero.green::after { background: rgba(0, 80, 80, .16); }
.hero .timer { font-family: var(--font-display); font-size: 44px; font-weight: 800; letter-spacing: -.02em; line-height: 1; margin: 6px 0 4px; font-variant-numeric: tabular-nums; }
.hero .btn-white { background: #fff; color: var(--teal-900); }
.hero .btn-glass { background: rgba(255,255,255,.16); color: #fff; }
.hero .btn-glass:hover { background: rgba(255,255,255,.24); }
.progress-pills { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 16px; }
.progress-pills span { background: rgba(255,255,255,.16); border-radius: 99px; padding: 5px 11px; font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.progress-pills .ok { background: rgba(255,255,255,.95); color: var(--green-700); }

.stat-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat { padding: 14px 16px; }
.stat b { display: block; font-family: var(--font-display); font-size: 22px; color: var(--teal-900); }
.stat span { font-size: 12.5px; color: var(--muted); font-weight: 600; }

/* schedule card */
.sched { padding: 16px; display: flex; gap: 14px; }
.sched .when { flex: none; width: 58px; text-align: center; border-radius: 14px; background: var(--teal-50); padding: 8px 0; height: fit-content; }
.sched .when b { display: block; font-family: var(--font-display); font-size: 20px; color: var(--teal); line-height: 1.1; }
.sched .when span { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.sched.today .when { background: var(--green); } .sched.today .when b, .sched.today .when span { color: #fff; }
.sched h4 { margin: 0 0 2px; font-size: 16px; }
.pchips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pchips span { font-size: 12px; font-weight: 600; background: var(--green-50); color: var(--green-700); padding: 3px 9px; border-radius: 8px; }

/* store picker */
.store-opt { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; background: transparent; border-left: 0; border-right: 0; border-top: 0; width: 100%; text-align: left; font: inherit; color: inherit; }
.store-opt:last-child { border-bottom: 0; }
.store-opt:hover { background: var(--surface-2); }
.store-opt .ic { width: 42px; height: 42px; border-radius: 12px; background: var(--teal-50); color: var(--teal); display: grid; place-items: center; flex: none; }
.store-opt.new .ic { background: var(--green-50); color: var(--green-700); }
.store-opt.sel { background: var(--green-50); }

/* locator status */
.gps { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-radius: 16px; font-weight: 600; font-size: 14.5px; }
.gps.ok { background: var(--green-50); color: var(--green-700); }
.gps.bad { background: var(--danger-50); color: #9B1C1F; }
.gps.wait { background: var(--teal-50); color: var(--teal); }
.gps .big { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.gps.ok .big { background: var(--green); color: #fff; }
.gps.bad .big { background: var(--danger); color: #fff; }

/* wizard */
.steps { display: flex; gap: 6px; margin: 4px 0 18px; }
.steps i { flex: 1; height: 5px; border-radius: 3px; background: var(--border); transition: background .3s; }
.steps i.on { background: var(--green); }
.step-head { margin-bottom: 16px; }
.step-head .tiny { font-weight: 700; color: var(--green-700); text-transform: uppercase; letter-spacing: .06em; }
.step-head h2 { margin: 2px 0 4px; }
.step-head p { margin: 0; color: var(--muted); font-size: 14px; }

.pcard { padding: 16px; }
.pcard + .pcard { margin-top: 14px; }
.faces { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.faces button { border: 1.5px solid var(--border); background: var(--surface); border-radius: 14px; padding: 8px 0 6px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; font-weight: 600; color: var(--muted); transition: .15s; }
.faces button em { font-style: normal; font-size: 26px; line-height: 1.1; filter: grayscale(.6); transition: .15s; }
.faces button.on { border-color: var(--green); background: var(--green-50); color: var(--green-700); transform: translateY(-2px); box-shadow: 0 4px 10px rgba(8,188,55,.18); }
.faces button.on em { filter: none; transform: scale(1.12); }

.traffic { padding: 14px 16px; }
.traffic + .traffic { margin-top: 10px; }
.traffic .seg button { font-size: 12.5px; }

.comp { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); position: relative; }
.comp .full { grid-column: 1 / -1; }
.comp .rm { position: absolute; top: 6px; right: 6px; }

.add-photo { aspect-ratio: 1; border-radius: 12px; border: 2px dashed var(--border-strong); background: var(--surface); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--teal); font-size: 12px; font-weight: 600; cursor: pointer; }
.add-photo:hover { border-color: var(--green); background: var(--green-50); }
.uploading { aspect-ratio: 1; border-radius: 12px; background: var(--teal-50); display: grid; place-items: center; }
.receipt { display: flex; gap: 12px; align-items: center; padding: 10px; }
.receipt .photo { width: 64px; flex: none; }
.receipt + .receipt { border-top: 1px solid var(--border); }
.total-row { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; background: var(--teal-50); border-radius: 0 0 var(--radius-lg) var(--radius-lg); font-weight: 700; color: var(--teal-900); }

.review-sec { padding: 16px; }
.review-sec + .review-sec { border-top: 1px solid var(--border); }
.review-sec h4 { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 4px 12px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; }

/* celebration */
.celebrate { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 32px 24px calc(32px + var(--safe-bottom)); background: radial-gradient(90% 60% at 50% 30%, #E8F8ED 0%, var(--bg) 70%); overflow: hidden; position: relative; }
.celebrate .face { width: 170px; height: 170px; border-radius: 50%; background: linear-gradient(145deg, #FFD84D, #FFB800); display: grid; place-items: center; position: relative; box-shadow: 0 20px 50px rgba(255, 184, 0, .35); animation: bounceIn .7s cubic-bezier(.2, 1.4, .4, 1) both; }
.celebrate .face .eyes { position: absolute; top: 58px; left: 0; right: 0; display: flex; justify-content: center; gap: 44px; }
.celebrate .face .eyes i { width: 16px; height: 22px; background: #5A3A00; border-radius: 50%; animation: blink 3.2s infinite 1.2s; }
.celebrate .face .mouth { position: absolute; top: 92px; left: 50%; width: 80px; height: 40px; margin-left: -40px; border-radius: 0 0 80px 80px; background: #5A3A00; overflow: hidden; }
.celebrate .face .mouth::after { content: ''; position: absolute; bottom: -12px; left: 18px; width: 44px; height: 26px; border-radius: 50%; background: #FF6B6B; }
.celebrate .face .cheek { position: absolute; top: 94px; width: 22px; height: 12px; border-radius: 50%; background: rgba(255, 107, 107, .45); }
.celebrate .face .cheek.l { left: 22px; } .celebrate .face .cheek.r { right: 22px; }
.celebrate .thumb { position: absolute; right: -26px; bottom: -8px; font-size: 76px; animation: thumb .9s cubic-bezier(.2, 1.6, .4, 1) .35s both; transform-origin: 60% 90%; filter: drop-shadow(0 6px 10px rgba(0,0,0,.18)); }
.celebrate h1 { margin: 36px 0 8px; font-size: 28px; animation: rise .5s .45s both; }
.celebrate p { color: var(--muted); font-size: 16.5px; max-width: 320px; animation: rise .5s .55s both; }
.celebrate .sum { display: flex; gap: 10px; margin: 8px 0 28px; animation: rise .5s .65s both; flex-wrap: wrap; justify-content: center; }
.celebrate .sum span { background: #fff; box-shadow: var(--shadow); border-radius: 99px; padding: 8px 14px; font-weight: 600; font-size: 14px; color: var(--teal-900); display: inline-flex; gap: 6px; align-items: center; }
.celebrate .btn { animation: rise .5s .75s both; }
.celebrate > *:not(.confetti) { position: relative; z-index: 1; }
.confetti { z-index: 0; position: absolute; top: -20px; width: 10px; height: 16px; border-radius: 3px; opacity: .9; animation: fall linear forwards; }
@keyframes bounceIn { from { transform: scale(.2); opacity: 0; } }
@keyframes thumb { from { transform: scale(0) rotate(-40deg); opacity: 0; } }
@keyframes rise { from { transform: translateY(14px); opacity: 0; } }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

/* auth */
.auth { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; padding: calc(24px + var(--safe-top)) 20px calc(24px + var(--safe-bottom)); }
.auth .logo { width: 190px; margin: 12px auto 0; display: block; }
.auth-hero { flex: 1; display: flex; flex-direction: column; justify-content: center; text-align: center; padding: 24px 0; }
.auth-hero .art { width: 150px; height: 150px; margin: 0 auto 24px; border-radius: 40px; transform: rotate(45deg); background: linear-gradient(135deg, var(--green), var(--teal)); display: grid; place-items: center; box-shadow: 0 20px 50px rgba(0,80,80,.25); }
.auth-hero .art span { transform: rotate(-45deg); font-size: 64px; }
.auth-hero h1 { font-size: 27px; margin-bottom: 8px; }
.auth-hero p { color: var(--muted); max-width: 320px; margin: 0 auto; }
.auth-form { flex: 1; padding-top: 24px; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--teal); font-weight: 600; text-decoration: none; background: none; border: 0; padding: 6px 0; cursor: pointer; font-size: 15px; }

/* avatar builder */
.ab-preview { display: flex; justify-content: center; margin: 4px 0 18px; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatches button { width: 38px; height: 38px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1.5px var(--border); cursor: pointer; }
.swatches button.on { box-shadow: 0 0 0 3px var(--green); }
.emojis { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; }
.emojis button { aspect-ratio: 1; border-radius: 12px; border: 1.5px solid var(--border); background: var(--surface); font-size: 20px; cursor: pointer; display: grid; place-items: center; }
.emojis button.on { border-color: var(--green); background: var(--green-50); }

/* profile */
.profile-head { text-align: center; padding: 24px 16px 20px; }
.profile-head h2 { margin: 12px 0 2px; }

.notif { display: flex; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; }
.notif:last-child { border-bottom: 0; }
.notif.unread { background: var(--green-50); }
.notif .ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--teal-50); color: var(--teal); flex: none; }

.install-tip { display: flex; gap: 12px; align-items: flex-start; }
.install-tip .ic { width: 40px; height: 40px; border-radius: 12px; background: var(--green-50); color: var(--green-700); display: grid; place-items: center; flex: none; }

/* breaks */
.hero.amber { background: radial-gradient(120% 140% at 100% 0%, #FFC04D 0%, #E08A00 45%, #A65F00 100%); box-shadow: 0 12px 30px rgba(224, 138, 0, .32); }
.hero.amber::after { background: rgba(255, 255, 255, .14); }
.hero .btn-white:hover { background: #F4F7F6; }

/* my demos stats */
.hist-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hist-stats > div { padding: 14px 12px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); min-width: 0; }
.hist-stats > div:nth-child(3n) { border-right: 0; }
.hist-stats > div:nth-last-child(-n+3) { border-bottom: 0; }
.hist-stats b { display: block; font-family: var(--font-display); font-size: 19px; color: var(--teal-900); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hist-stats span { font-size: 12px; color: var(--muted); font-weight: 600; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 130px; }
.bars.dense { gap: 2px; }
.bar { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; }
.bar i { display: block; width: 100%; max-width: 34px; border-radius: 6px 6px 3px 3px; background: var(--green); min-height: 2px; }
.bars.dense .bar i { border-radius: 3px 3px 1px 1px; }
.bar.today i { background: var(--teal); }
.bar .v { font-size: 10.5px; font-weight: 700; color: var(--teal-800); min-height: 13px; }
.bar .l { font-size: 11px; color: var(--muted); font-weight: 600; min-height: 14px; }

/* notes thread */
.notes { display: flex; flex-direction: column; gap: 10px; max-height: 50vh; overflow-y: auto; padding: 2px; }
.note { display: flex; gap: 8px; align-items: flex-start; }
.note .bubble { background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px 14px 14px 14px; padding: 8px 12px; flex: 1; min-width: 0; }
.note.mine { flex-direction: row-reverse; }
.note.mine .bubble { background: var(--green-50); border-color: var(--green-100); border-radius: 14px 4px 14px 14px; }

/* bigger logo */
.top .brand { height: 44px; }

/* 5-tab bar with raised green Messages button */
.tabs { grid-template-columns: repeat(5, 1fr); }
.tabs a.tab-chat { color: var(--teal); padding-top: 0; }
.chat-fab { position: relative; width: 54px; height: 54px; margin-top: -24px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center;
  box-shadow: 0 6px 16px rgba(8, 188, 55, .4); border: 4px solid #fff; transition: transform .15s; }
.tabs a.tab-chat .chat-fab .icon { color: #fff; width: 24px; height: 24px; }
.tabs a.tab-chat.on .chat-fab { background: var(--green-700); transform: scale(1.05); }
.red-dot { position: absolute; top: -3px; right: -3px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--danger);
  color: #fff; font-style: normal; font-size: 11px; font-weight: 800; display: grid; place-items: center; border: 2px solid #fff; }

/* messages screens */
.chat-card { margin: 0 12px; overflow: hidden; }
.chat-card .chat-list-head { border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.chat-screen { height: 100vh; height: 100dvh; display: flex; flex-direction: column; }
.chat-screen > div, .chat-screen .chat-thread { flex: 1; min-height: 0; }
.chat-screen .chat-head { padding-top: calc(10px + var(--safe-top)); }

/* welcome illustration */
.auth-hero .stand { width: auto; height: min(46vh, 380px); max-width: 100%; margin: 0 auto 18px; display: block; object-fit: contain;
  filter: drop-shadow(0 18px 24px rgba(0, 43, 43, .18)); animation: standIn .6s cubic-bezier(.2, 1.2, .4, 1) both; }
@keyframes standIn { from { opacity: 0; transform: translateY(16px) scale(.97); } }
@media (max-height: 640px) { .auth-hero .stand { height: 34vh; } }

.or-line { display: flex; align-items: center; gap: 10px; margin: 16px 0; color: var(--faint); font-size: 12.5px; font-weight: 600; }
.or-line::before, .or-line::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.auth-form > .btn-dark { margin-bottom: 4px; }

/* credit above the tab bar */
.with-tabs .page { padding-bottom: 4px; }
.tab-credit { padding: 10px 0 calc(100px + var(--safe-bottom)); }
.auth .credit { padding-bottom: 0; margin-top: 12px; }
.pchips span { display: inline-flex; align-items: center; gap: 5px; }
.pchips img { width: 18px; height: 18px; border-radius: 5px; object-fit: cover; }

/* packs used per product (report step 1) */
.list-item.qty-item { flex-direction: column; align-items: stretch; gap: 8px; }
.qty-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-left: 54px; }
.stepper { display: flex; align-items: center; border: 1.5px solid var(--border-strong, var(--border)); border-radius: 12px; overflow: hidden; background: var(--surface); }
.stepper button { width: 40px; height: 40px; border: 0; background: var(--surface-2); font-size: 20px; font-weight: 700; color: var(--teal); cursor: pointer; }
.stepper input { width: 56px; height: 40px; border: 0; text-align: center; font: inherit; font-size: 16px; font-weight: 700; background: none; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stock-dot { font-weight: 700; margin-left: 4px; }
.stock-dot::before { content: '●'; margin-right: 3px; }
.stock-dot.in { color: var(--green-700, #05892a); }
.stock-dot.low { color: #B45309; }
.stock-dot.out { color: var(--danger); }

/* My demos → Dates filter */
.hist-range { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.hist-range label span { display: block; font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
.hist-range .input { width: 100%; min-width: 0; }
.seg button { white-space: nowrap; }
