/* DESi-FieldSync — "daily operation board": light canvas, white + pastel cards,
   avatar-led, yellow accent, black pill actions. */
:root {
  --canvas: #E7E6E3;
  --page: #F7F6F3;
  --card: #FFFFFF;
  --ink: #141414;
  --muted: #8A8780;
  --line: #E4E2DC;
  --yellow: #F2E126;
  --lilac: #EBD3EE;
  --violet: #D5CCF4;
  --mint: #D9EFD4;
  --black: #141414;
  --red: #D64545;
  --head: 'Space Grotesk', system-ui, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body { font-family: 'Manrope', system-ui, sans-serif; color: var(--ink); font-size: 15px; min-height: 100vh; background: var(--page); }
input, select, textarea, button { font-family: inherit; font-size: 15px; color: var(--ink); }
input, textarea { width: 100%; background: var(--card); border: 1.5px solid var(--line); border-radius: 14px; padding: 13px 14px; outline: none; }
input:focus, textarea:focus { border-color: var(--ink); }
label { font-size: .72rem; font-weight: 800; color: var(--muted); display: block; margin: 16px 0 7px; letter-spacing: .08em; text-transform: uppercase; }

.screen { min-height: 100vh; }
.center { display: grid; place-items: center; padding: 20px; }

/* login */
.login-card { width: min(380px, 94vw); background: var(--card); border-radius: 26px; padding: 34px 26px 28px; text-align: center;
  display: flex; flex-direction: column; gap: 12px; box-shadow: 0 24px 60px -24px rgba(20, 20, 20, .25); }
.mark { width: 64px; height: 64px; margin: 0 auto; border-radius: 0; background: transparent; display: grid; place-items: center; }
.mark img { width: 64px; height: 64px; }
.brand { font-family: var(--head); font-weight: 700; font-size: 1.5rem; margin: 6px 0 0; color: var(--ink); letter-spacing: -.5px; }
.brand span { background: #141414; color: var(--yellow); padding: 1px 8px; border-radius: 8px; }
.sub { color: var(--muted); font-size: .9rem; margin: 0 0 8px; }
.btn-grad { background: var(--black); color: #fff; font-weight: 800; border: none; border-radius: 999px; padding: 15px;
  cursor: pointer; font-size: .95rem; }
.btn-grad:disabled { opacity: .5; }
.ghost { background: var(--card); border: 1.5px solid var(--line); border-radius: 999px; padding: 8px 14px;
  font-weight: 700; font-size: .8rem; cursor: pointer; }
.note { background: #FBEAE7; border: 1px solid #F0C4BC; color: #A43B2E; border-radius: 12px; padding: 10px 12px; font-size: .85rem; text-align: left; }
.note.ok { background: var(--mint); border-color: #B9DCB0; color: #2F6B22; }
.note.warn { background: #FBF4D4; border-color: #E8DA8A; color: #7A6A12; }

.spin { width: 40px; height: 40px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--ink); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* shell */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 11px; padding: 14px 16px;
  padding-top: calc(14px + env(safe-area-inset-top)); background: rgba(247, 246, 243, .92); backdrop-filter: blur(12px); }
.mark.sm { width: 40px; height: 40px; margin: 0; flex: none; }
.mark.sm img { width: 40px; height: 40px; }
.top .t1 { font-family: var(--head); font-weight: 700; font-size: 1.02rem; letter-spacing: -.02em; }
.top .t2 { color: var(--muted); font-size: .78rem; margin-top: 1px; font-weight: 600; }
.top .tt { flex: 1; min-width: 0; }

main { padding: 6px 16px calc(96px + env(safe-area-inset-bottom)); max-width: 560px; margin: 0 auto; }

/* status pill + stats row (like "Still Running · 132 / 34 / 22") */
.staterow { display: flex; align-items: center; gap: 10px; margin: 6px 0 14px; flex-wrap: wrap; }
.livepill { display: inline-flex; align-items: center; gap: 8px; background: var(--black); color: #fff; border-radius: 999px;
  padding: 9px 16px; font-weight: 800; font-size: .8rem; }
.livepill .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--yellow); }
.stats { display: flex; gap: 22px; margin: 4px 2px 18px; }
.stat .n { font-family: var(--head); font-weight: 700; font-size: 1.7rem; letter-spacing: -.5px; }
.stat .l { color: var(--muted); font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; margin-top: 2px; }
.stat.hl .n { box-shadow: inset 0 -10px 0 var(--yellow); }

.h2 { font-family: var(--head); font-weight: 700; font-size: 1.05rem; margin: 18px 0 10px; letter-spacing: -.02em; }
.h2 small { color: var(--muted); font-weight: 600; font-size: .8rem; margin-left: 6px; }

/* mosaic grid of store cards */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { border-radius: 18px; padding: 14px 14px 12px; min-height: 118px; display: flex; flex-direction: column; cursor: pointer;
  background: var(--card); border: 1.5px solid var(--line); transition: transform .08s; position: relative; overflow: hidden; }
.tile:active { transform: scale(.97); }
.tile .nm { font-weight: 800; font-size: .84rem; line-height: 1.3; letter-spacing: -.01em; }
.tile .nm small { display: block; color: inherit; opacity: .55; font-weight: 700; font-size: .68rem; margin-bottom: 3px; letter-spacing: .04em; }
.tile .foot { margin-top: auto; display: flex; align-items: center; gap: 6px; padding-top: 12px; }
.tile .when { font-size: .68rem; font-weight: 700; opacity: .55; margin-left: auto; white-space: nowrap; }
.tile.p0 { background: var(--lilac); border-color: transparent; }
.tile.p1 { background: var(--violet); border-color: transparent; }
.tile.p2 { background: var(--yellow); border-color: transparent; }
.tile.closedt { background: #EDECE8; border-color: transparent; color: #6E6B64; }
.tile.staged { background: #FDFAE2; border: 1.5px dashed #C9B70F; }
.tile.staged .when.stagetag { color: #8A6A12; opacity: 1; letter-spacing: .02em; }
.tile.pending { background:
  repeating-linear-gradient(135deg, transparent 0 7px, rgba(20, 20, 20, .035) 7px 8px), var(--card); }
.tile.pending .cta { display: inline-flex; align-items: center; gap: 6px; font-size: .72rem; font-weight: 800; color: var(--ink);
  background: #fff; border: 1.5px solid var(--line); border-radius: 999px; padding: 5px 11px; }
.av { width: 28px; height: 28px; border-radius: 50%; background: #fff; border: 2px solid rgba(20, 20, 20, .1);
  display: grid; place-items: center; font-weight: 800; font-size: .62rem; letter-spacing: .02em; flex: none; }
.av + .av { margin-left: -9px; }
.gpsdot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.gpsdot.on { background: #43A047; }
.gpsdot.off { background: #C9C6BF; }

/* sheet */
#sheet-wrap { position: fixed; inset: 0; z-index: 50; }
.sheet-bg { position: absolute; inset: 0; background: rgba(20, 20, 20, .45); backdrop-filter: blur(2px); }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; max-height: 90vh; overflow: auto; background: var(--page);
  border-radius: 26px 26px 0 0; padding: 20px 18px calc(22px + env(safe-area-inset-bottom)); max-width: 560px; margin: 0 auto; }
.sheet .snm { font-family: var(--head); font-weight: 700; font-size: 1.15rem; padding-right: 40px; letter-spacing: -.02em; }
.sheet .x { position: absolute; top: 16px; right: 16px; width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--line);
  background: var(--card); color: var(--ink); font-size: 1rem; cursor: pointer; font-weight: 700; }
.chk { display: flex; gap: 10px; align-items: center; background: var(--card); border: 1.5px solid var(--line);
  border-radius: 14px; padding: 13px 14px; margin-top: 16px; font-weight: 800; font-size: .88rem; cursor: pointer; }
.chk input { width: 19px; height: 19px; accent-color: var(--black); }

/* promoter chip picker */
.pick-count { font-weight: 800; font-size: .8rem; color: var(--muted); float: right; text-transform: none; letter-spacing: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.pchip { display: inline-flex; align-items: center; gap: 8px; background: var(--card); border: 1.5px solid var(--line);
  border-radius: 999px; padding: 6px 13px 6px 6px; font-weight: 700; font-size: .82rem; cursor: pointer; user-select: none; }
.pchip .av { width: 26px; height: 26px; border-width: 1.5px; background: var(--page); }
.pchip.sel { background: var(--black); color: #fff; border-color: var(--black); }
.pchip.sel .av { background: var(--yellow); border-color: var(--yellow); color: var(--ink); }
.pchip.used { opacity: .45; }
.pchip .ord { width: 17px; height: 17px; border-radius: 50%; background: var(--yellow); color: var(--ink);
  font-size: .62rem; font-weight: 800; display: grid; place-items: center; }
.gps { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: .8rem; margin-top: 14px; font-weight: 600; }
.gps .dot { width: 9px; height: 9px; border-radius: 50%; background: #E0A800; }
.gps.ok .dot { background: #43A047; }

/* history */
.dayhead { display: flex; align-items: baseline; gap: 8px; margin: 18px 0 8px; }
.dayhead .d { font-family: var(--head); font-weight: 700; font-size: .95rem; }
.dayhead .c { color: var(--muted); font-size: .76rem; font-weight: 700; }
.hrow { background: var(--card); border: 1.5px solid var(--line); border-radius: 16px; padding: 12px 14px; margin-bottom: 8px; }
.hrow .d1 { display: flex; justify-content: space-between; gap: 8px; font-weight: 800; font-size: .86rem; }
.hrow .d1 .dt { color: var(--muted); font-weight: 700; font-size: .74rem; white-space: nowrap; }
.hrow .d2 { color: var(--muted); font-size: .8rem; margin-top: 3px; font-weight: 600; }

/* bottom nav */
.bottom { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 30;
  display: flex; gap: 4px; background: var(--card); border: 1.5px solid var(--line); border-radius: 999px; padding: 6px;
  box-shadow: 0 18px 44px -14px rgba(20, 20, 20, .35); }
.bottom button { display: flex; flex-direction: column; align-items: center; gap: 2px; border: none; background: transparent;
  color: var(--muted); font-weight: 800; font-size: .66rem; border-radius: 999px; padding: 9px 19px; cursor: pointer; }
.bottom button .ic { font-size: 1.05rem; filter: grayscale(1); }
.bottom button.on { background: var(--black); color: #fff; }
.bottom button.on .ic { filter: none; }

#toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 60;
  background: var(--black); color: var(--yellow); padding: 13px 24px; border-radius: 999px;
  font-weight: 800; font-size: .86rem; box-shadow: 0 14px 34px -10px rgba(20, 20, 20, .5); white-space: nowrap; }

.search { margin: 2px 0 12px; }

/* quick-fill board */
.quickfill { width: 100%; margin: 0 0 6px; font-size: .92rem; }
.boardhead { display: flex; align-items: center; gap: 10px; margin: 6px 0 4px; }
.boardhead .bt { font-family: var(--head); font-weight: 700; font-size: 1.15rem; letter-spacing: -.02em; flex: 1; }
.micbtn { width: 46px; height: 46px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--card);
  font-size: 1.15rem; cursor: pointer; }
.micbtn.rec { background: var(--red); border-color: var(--red); animation: pulse 1.1s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 10px rgba(214, 69, 69, .18); } }
.miclive { background: var(--black); color: var(--yellow); border-radius: 14px; padding: 11px 14px;
  font-weight: 700; font-size: .85rem; margin: 8px 0; }
.bhint { margin: 2px 0 12px; font-size: .82rem; color: var(--muted); }
.brow { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1.5px solid var(--line);
  border-radius: 16px; padding: 11px 13px; margin-bottom: 8px; cursor: pointer; }
.brow:active { transform: scale(.98); }
.brow.flash { border-color: #D9C713; background: #FDFAE2; }
.brow .bnm { flex: 1; min-width: 0; font-weight: 800; font-size: .84rem; line-height: 1.3; }
.brow .bnm small { display: block; color: var(--muted); font-weight: 700; font-size: .64rem; letter-spacing: .05em; }
.brow .bwho { display: flex; align-items: center; font-size: .78rem; font-weight: 700; }
.brow .bempty { color: var(--muted); }
.btag { flex: none; font-size: .64rem; font-weight: 800; letter-spacing: .04em; border-radius: 999px; padding: 4px 9px; }
.btag.done { background: var(--mint); color: #2F6B22; }
.btag.ready { background: var(--yellow); color: var(--ink); }
.btag.miss { background: var(--page); color: var(--muted); border: 1px solid var(--line); }
.submitbar { position: sticky; bottom: calc(84px + env(safe-area-inset-bottom)); padding-top: 10px;
  background: linear-gradient(0deg, var(--page) 70%, transparent); }
.submitbar .btn-grad { width: 100%; }
.rrow { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1.5px solid #D9C713;
  border-radius: 16px; padding: 12px 13px; margin-bottom: 8px; cursor: pointer; }
.rrow .bnm { flex: 1; min-width: 0; font-weight: 800; font-size: .86rem; line-height: 1.3; }
.rrow .bnm small { display: block; color: var(--muted); font-weight: 700; font-size: .64rem; letter-spacing: .05em; }
.rrow .rwho { display: flex; align-items: center; gap: 4px; font-weight: 700; font-size: .78rem; }
.rrow .rnames { margin-left: 6px; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.rrow.amb { border-color: #E0A800; background: #FDF6DC; }
.ramb { font-weight: 700; font-size: .72rem; color: #8A6A12; margin-top: 4px; }

/* day-status table */
.stbar { height: 8px; border-radius: 999px; background: #E9E7E1; margin-top: 12px; overflow: hidden; }
.stbar i { display: block; height: 100%; background: var(--yellow); border-radius: 999px; }
.strow { display: flex; align-items: center; gap: 11px; padding: 11px 4px; border-bottom: 1.5px solid var(--line); }
.strow:last-of-type { border-bottom: none; }
.strow .stt { width: 26px; height: 26px; border-radius: 50%; background: var(--mint); color: #2F6B22;
  display: grid; place-items: center; font-weight: 800; font-size: .8rem; flex: none; }
.strow .stt.o { background: var(--page); color: var(--muted); border: 1.5px solid var(--line); }
.strow .stt.s { background: var(--yellow); color: var(--ink); }
.strow.staged { background: #FDFAE2; border-radius: 12px; border-bottom: none; margin-bottom: 4px; padding: 11px 10px; }
.strow .stn { flex: 1; min-width: 0; font-weight: 800; font-size: .84rem; line-height: 1.3; }
.strow .stn small { display: block; color: var(--muted); font-weight: 700; font-size: .64rem; letter-spacing: .05em; }
.strow .stw { font-weight: 700; font-size: .76rem; color: var(--muted); max-width: 40%; text-align: right; }
.strow .stw.go { color: var(--ink); background: var(--yellow); border-radius: 999px; padding: 5px 11px; }
.strow.pend { cursor: pointer; }
.strow.pend:active { transform: scale(.98); }
.strow.donej { background: #FDFAE2; border-radius: 12px; border-bottom: none; margin-bottom: 4px; padding: 11px 10px; }

/* celebration */
.tile.pop { animation: tilepop .65s cubic-bezier(.2, 1.5, .4, 1) both; }
@keyframes tilepop {
  0% { transform: scale(.55) rotate(-3deg); opacity: 0; }
  60% { transform: scale(1.06) rotate(1.2deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); }
}
.stat .n.bump { animation: statbump .55s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes statbump { 35% { transform: scale(1.35); } }
