/* Polikor — calm working surface: white sheets on a cool green-grey ground, one green for "do it", blue for the rest. */
:root {
  --green: #15803d;
  --green-d: #0e5a2b;
  --green-2: #16a34a;
  --green-bg: #e6f4eb;
  --blue: #1d4ed8;
  --blue-2: #2563eb;
  --blue-bg: #e9effc;
  --amber: #9a5a06;
  --amber-bg: #fbf1df;
  --bg: #f2f5f3;
  --card: #ffffff;
  --text: #13201a;
  --muted: #5a6862;
  --faint: #8a968f;
  --line: #e1e7e3;
  --line-2: #d3dbd6;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(19, 32, 26, .05), 0 2px 8px rgba(19, 32, 26, .04);
  --shadow-lift: 0 10px 30px rgba(19, 32, 26, .14), 0 2px 6px rgba(19, 32, 26, .06);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --side: 264px;
  --ease: cubic-bezier(.16, 1, .3, 1);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body {
  font: 16px/1.45 "Segoe UI Variable Text", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg); color: var(--text);
  overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
button, input, select, textarea { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
a { color: var(--blue); text-underline-offset: 3px; }
::selection { background: rgba(22, 163, 74, .22); }
input, textarea { caret-color: var(--green); }
:focus-visible { outline: 2.5px solid var(--blue-2); outline-offset: 2px; }
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 10px; border: 3px solid var(--bg); }

.ic { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.25em; }
.ic .fill { fill: currentColor; stroke: none; }

/* ---------- frame ---------- */
.shell { min-height: 100vh; }
.side { display: none; }
.page { max-width: 760px; margin: 0 auto; padding-bottom: calc(84px + var(--safe-b)); }

.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  padding: calc(12px + var(--safe-t)) 16px 12px;
  background: rgba(242, 245, 243, .9);
  -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
}
.top h1 { font-size: 22px; margin: 0; flex: 1; font-weight: 750; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .back {
  border: 1px solid var(--line); background: var(--card); color: var(--text); width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center; cursor: pointer; flex: none; box-shadow: var(--shadow);
}
.top .back .ic { width: 20px; height: 20px; }
.top .hint { font-size: 13px; color: var(--muted); }
main { padding: 4px 16px 16px; }

.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; justify-content: center;
  background: rgba(255, 255, 255, .96);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  padding-bottom: var(--safe-b);
}
.nav-in { display: grid; grid-template-columns: repeat(5, 1fr); width: 100%; max-width: 760px; }
.nav button {
  border: 0; background: none; padding: 7px 2px 8px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 11.5px; color: var(--muted); font-weight: 600;
}
.nav button .i {
  display: grid; place-items: center; width: 56px; height: 30px; border-radius: 15px;
  transition: background .25s var(--ease), color .25s var(--ease);
}
.nav button .ic { width: 23px; height: 23px; }
.nav button.on { color: var(--green-d); }
.nav button.on .i { background: var(--green-bg); color: var(--green); }
.nav button.on .ic { stroke-width: 2.2; }
.nav .badge { position: relative; }
.dot {
  position: absolute; top: -3px; right: 6px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--blue-2); color: #fff; font-size: 11px; line-height: 18px; text-align: center; font-weight: 700;
  box-shadow: 0 0 0 2px #fff;
}

/* ---------- blocks ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 12px; }
.card h2 { font-size: 16px; margin: 0 0 10px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.big { font-size: 28px; font-weight: 800; letter-spacing: -.02em; display: flex; align-items: center; justify-content: center; gap: 8px; }
.debt { color: var(--amber); font-weight: 700; }
.ok { color: var(--green); font-weight: 700; }
.row { display: flex; align-items: center; gap: 12px; }
.row > .grow { flex: 1; min-width: 0; }
.between { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.between b, .between h2 { display: inline-flex; align-items: center; gap: 6px; }
.stack > * + * { margin-top: 12px; }
/* a label sits on its own field and keeps clear of the field above */
.stack > label.f + * { margin-top: 0; }
.stack > * + label.f, .stack > * + :has(> label.f:first-child) { margin-top: 22px; }
.sep { height: 1px; background: var(--line); margin: 12px 0; }
.center { text-align: center; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hide { display: none !important; }
.s .ic, .small .ic { width: 1.05em; height: 1.05em; vertical-align: -.17em; color: var(--faint); margin-right: 1px; }

/* numbers: one tile family, the day's sales lead */
.tiles {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin-bottom: 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
.tile { background: var(--card); padding: 14px 16px; min-width: 0; box-shadow: 0 0 0 1px var(--line); }
.tile .k { font-size: 13px; color: var(--muted); font-weight: 600; }
.tile .v { font-size: 21px; font-weight: 780; margin-top: 3px; letter-spacing: -.015em; word-break: break-word; }
.tile .small { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px 10px; }
.tile.wide { grid-column: 1 / -1; }
.tile.g.wide { background: var(--green-d); color: #fff; padding: 18px 18px 20px; }
.tile.g.wide .k { color: rgba(255, 255, 255, .78); }
.tile.g.wide .v { font-size: 34px; letter-spacing: -.03em; }
.tile.g.wide .small, .tile.g.wide .muted { color: rgba(255, 255, 255, .8); }
.tile.g .v { color: var(--green); }
.tile.g.wide .v { color: #fff; }
.tile.b .v { color: var(--blue); }
.tile.a .v { color: var(--amber); }
.tiles > .tile.b.wide:only-child { background: var(--blue-bg); color: var(--blue); font-weight: 650; }

/* ---------- buttons ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 50px; padding: 12px 18px; border: 0; border-radius: 12px;
  font-weight: 650; font-size: 16px; cursor: pointer; text-decoration: none;
  background: var(--blue-2); color: #fff;
  transition: transform .12s var(--ease), background .2s, box-shadow .2s;
}
.btn .ic { width: 20px; height: 20px; }
.btn:active { transform: scale(.98); }
.btn.green { background: var(--green); box-shadow: 0 1px 2px rgba(14, 90, 43, .25), 0 4px 12px rgba(21, 128, 61, .18); }
.btn.light { background: var(--card); color: var(--blue); border: 1px solid var(--line-2); }
.btn.lightg { background: var(--green-bg); color: var(--green-d); }
.btn.ghost { background: transparent; color: var(--muted); min-height: 44px; }
.btn.small { min-height: 38px; padding: 7px 12px; font-size: 14px; border-radius: 10px; width: auto; }
.btn.small .ic { width: 17px; height: 17px; }
.btn:disabled { opacity: .55; cursor: default; }
@media (hover: hover) {
  .btn.green:hover { background: var(--green-d); }
  .btn:not(.green):not(.light):not(.lightg):not(.ghost):hover { background: var(--blue); }
  .btn.light:hover { border-color: var(--blue-2); background: #f7f9ff; }
  .btn.lightg:hover { background: #d8eee0; }
  .btn.ghost:hover { color: var(--text); }
}
.btns { display: grid; gap: 10px; }
.btns.two { grid-template-columns: 1fr 1fr; }

.menu { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.menu .m {
  position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 10px; min-height: 104px;
  transition: border-color .2s, transform .15s var(--ease), box-shadow .2s;
}
.menu .m .i {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  background: var(--blue-bg); color: var(--blue);
}
.menu .m .i .ic { width: 22px; height: 22px; }
.menu .m .t { font-weight: 680; font-size: 15px; line-height: 1.25; }
.menu .m.g .i { background: var(--green-bg); color: var(--green); }
.menu .m .s { font-size: 12.5px; color: var(--muted); }
.menu .m .go { position: absolute; top: 14px; right: 12px; color: var(--faint); width: 18px; height: 18px; }
.menu .m:active { transform: scale(.985); }
@media (hover: hover) { .menu .m:hover { border-color: var(--line-2); box-shadow: var(--shadow-lift); } }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 1px 1px 3px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line-2); background: var(--card); border-radius: 999px; padding: 8px 15px;
  font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; color: var(--muted);
  transition: background .2s, color .2s, border-color .2s;
}
.chip .ic { width: 16px; height: 16px; }
.chip.on { border-color: var(--green); background: var(--green); color: #fff; }

/* ---------- lists ---------- */
.list { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 12px; }
.item {
  display: flex; align-items: center; gap: 12px; padding: 13px 16px; border: 0; border-bottom: 1px solid var(--line);
  cursor: pointer; background: var(--card); width: 100%; text-align: left; transition: background .15s;
}
.item:last-child { border-bottom: 0; }
.item:active { background: #f4f7f5; }
@media (hover: hover) { .item:hover { background: #f8faf9; } }
.item .grow { flex: 1; min-width: 0; }
.item .t { font-weight: 650; }
.item .s { font-size: 13px; color: var(--muted); margin-top: 1px; }
.item .r { text-align: right; font-weight: 700; white-space: nowrap; }
.item .go { color: var(--faint); width: 18px; height: 18px; }
.item.wrong { opacity: .55; text-decoration: line-through; }
.avatar {
  width: 40px; height: 40px; flex: none; border-radius: 12px; background: var(--green-bg); color: var(--green-d);
  display: flex; align-items: center; justify-content: center; font-weight: 750; border: 0; font-size: 16px;
}
.avatar .ic { width: 20px; height: 20px; }
button.avatar { cursor: pointer; }
.empty { text-align: center; color: var(--muted); padding: 32px 12px; }

/* ---------- products ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); gap: 10px; }
.prod {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
  padding: 0; text-align: left; cursor: pointer; display: flex; flex-direction: column;
  transition: border-color .2s, box-shadow .2s, transform .15s var(--ease);
}
.prod:active { transform: scale(.985); }
@media (hover: hover) { .prod:hover { box-shadow: var(--shadow-lift); border-color: var(--line-2); } }
.prod .ph { aspect-ratio: 4 / 3; background: #edf2ef; color: #a9b8af; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.prod .ph .ic { width: 40px; height: 40px; stroke-width: 1.4; }
.prod .ph img { width: 100%; height: 100%; object-fit: cover; }
.prod .b { padding: 10px 12px 12px; }
.prod .t { font-weight: 680; font-size: 14.5px; line-height: 1.25; }
.prod .s { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.prod .p { font-weight: 780; color: var(--green); margin-top: 6px; }
.prod .low { color: var(--amber); font-weight: 650; }
.prod.added { border-color: var(--green-2); box-shadow: 0 0 0 2px var(--green-2), var(--shadow); }

/* ---------- forms ---------- */
label.f { display: block; font-size: 14px; font-weight: 650; color: var(--text); margin: 0 0 7px; }
.input, select.input, textarea.input {
  width: 100%; min-height: 50px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-2);
  background: var(--card); font-size: 17px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: var(--faint); }
.input:focus { border-color: var(--green-2); box-shadow: 0 0 0 4px rgba(22, 163, 74, .14); }
.search { position: sticky; top: calc(64px + var(--safe-t)); z-index: 10; margin: 0 -16px 12px; padding: 4px 16px 10px; background: var(--bg); }
.money { display: flex; gap: 8px; }
.money .input { flex: 1; min-width: 0; }
.seg { display: inline-flex; background: #e6ebe8; border-radius: 12px; padding: 3px; flex: none; }
.seg button { border: 0; background: none; padding: 9px 12px; border-radius: 9px; font-weight: 650; cursor: pointer; color: var(--muted); min-width: 52px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.seg button.on { background: var(--card); color: var(--green-d); box-shadow: 0 1px 3px rgba(19, 32, 26, .12); }
.seg.full { display: flex; width: 100%; }
.seg.full button { flex: 1; }
.qty { display: flex; align-items: center; gap: 8px; }
.qty button { width: 52px; height: 52px; border-radius: 12px; border: 0; background: var(--green-bg); color: var(--green-d); font-size: 26px; font-weight: 700; cursor: pointer; flex: none; }
.qty .input { text-align: center; font-weight: 780; font-size: 21px; }
.err { color: var(--amber); font-size: 14px; font-weight: 650; }
.err:empty { display: none; }
.photo-pick { display: flex; align-items: center; gap: 12px; }
.photo-pick img { width: 64px; height: 64px; object-fit: cover; border-radius: 12px; }
.photo-pick > span .ic { width: 40px; height: 40px; color: var(--faint); }

/* ---------- cart bar and sheets ---------- */
.cartbar {
  position: fixed; left: 0; right: 0; bottom: calc(64px + var(--safe-b)); z-index: 25; display: flex; justify-content: center; padding: 0 12px 10px; pointer-events: none;
  animation: rise .35s var(--ease);
}
.cartbar .btn { max-width: 736px; pointer-events: auto; box-shadow: 0 10px 28px rgba(14, 90, 43, .32); justify-content: space-between; min-height: 56px; border-radius: 14px; }
.cartbar .btn > span { display: inline-flex; align-items: center; gap: 8px; }
.cartbar .n { background: rgba(255, 255, 255, .2); border-radius: 8px; padding: 2px 9px; font-size: 14px; }

.sheet-bg { position: fixed; inset: 0; background: rgba(12, 22, 17, .42); z-index: 50; display: flex; align-items: flex-end; justify-content: center; animation: fade .2s; }
.sheet {
  background: var(--bg); width: 100%; max-width: 760px; max-height: 92vh; overflow-y: auto; border-radius: 22px 22px 0 0;
  padding: 8px 16px calc(18px + var(--safe-b)); animation: up .32s var(--ease); box-shadow: var(--shadow-lift);
}
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line-2); margin: 2px auto 12px; }
.sheet h3 { margin: 0 0 14px; font-size: 19px; font-weight: 750; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
@keyframes up { from { transform: translateY(48px); opacity: .3; } to { transform: none; opacity: 1; } }
@keyframes pop { from { transform: translateY(14px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes rise { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.toast {
  position: fixed; left: 50%; bottom: calc(150px + var(--safe-b)); transform: translateX(-50%); z-index: 80;
  display: flex; align-items: center; gap: 8px;
  background: #13201a; color: #fff; padding: 12px 18px; border-radius: 12px; max-width: 92vw; font-weight: 600; font-size: 15px;
  box-shadow: var(--shadow-lift); animation: fade .2s;
}
.toast.good { background: var(--green-d); }
.offline { background: var(--amber-bg); color: var(--amber); text-align: center; padding: 8px; font-weight: 700; font-size: 14px; }

.receipt .line { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line-2); font-size: 15px; }
.receipt .line:last-child { border-bottom: 0; }
.pre { white-space: pre-wrap; font-size: 15px; line-height: 1.55; }
.spin { width: 26px; height: 26px; border: 3px solid var(--line); border-top-color: var(--green-2); border-radius: 50%; animation: rot .7s linear infinite; margin: 40px auto; }
@keyframes rot { to { transform: rotate(360deg); } }
.sheet-photo { width: 100%; max-height: 180px; object-fit: cover; border-radius: 12px; margin-bottom: 12px; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 24px; max-width: 420px; margin: 0 auto; }
.logo { width: 76px; height: 76px; border-radius: 22px; margin: 0 auto 16px; box-shadow: var(--shadow-lift); }
.login h1 { text-align: center; margin: 0 0 4px; font-size: 26px; letter-spacing: -.02em; }
.login > p { margin: 0 0 22px; }
.code { letter-spacing: .4em; text-align: center; font-size: 30px; font-weight: 800; padding-left: .4em; }
.steps { padding-left: 20px; margin: 0; color: var(--muted); font-size: 14.5px; }
.steps li { margin: 5px 0; }
.steps .ic { color: var(--green); }
.login .chips { justify-content: center; margin-top: 8px; }

/* ---------- bigger phones and tablets ---------- */
@media (min-width: 560px) {
  .tiles { grid-template-columns: repeat(3, 1fr); }
  .menu { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- computer: side menu, wide page ---------- */
@media (min-width: 960px) {
  .shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); }
  .nav { display: none; }
  .side {
    display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
    background: var(--card); border-right: 1px solid var(--line); padding: 18px 12px;
  }
  .brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 18px; }
  .brand img { width: 38px; height: 38px; border-radius: 11px; }
  .brand b { display: block; font-size: 17px; letter-spacing: -.01em; }
  .brand span { display: block; font-size: 12.5px; color: var(--muted); max-width: 170px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .slabel { font-size: 12px; font-weight: 700; color: var(--faint); padding: 16px 12px 6px; }
  .sgroup { display: flex; flex-direction: column; gap: 2px; }
  .sl {
    display: flex; align-items: center; gap: 12px; width: 100%; border: 0; background: none; cursor: pointer;
    padding: 9px 12px; border-radius: 10px; font-size: 14.5px; font-weight: 600; color: var(--muted); text-align: left;
    transition: background .15s, color .15s;
  }
  .sl .ic { width: 19px; height: 19px; }
  .sl:hover { background: #f2f5f3; color: var(--text); }
  .sl.on { background: var(--green-bg); color: var(--green-d); }
  .sl .cnt { background: var(--blue-2); color: #fff; border-radius: 9px; font-size: 11.5px; font-weight: 700; padding: 1px 7px; }
  .sfoot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }

  .page { max-width: 1120px; width: 100%; padding: 0 40px 48px; margin: 0; }
  .top { padding: 26px 0 18px; background: rgba(242, 245, 243, .92); }
  .top h1 { font-size: 28px; }
  main { padding: 0; }
  .search { top: 80px; margin: 0 0 14px; padding: 0 0 10px; }
  .search .input { max-width: 460px; }

  .tiles { grid-template-columns: repeat(4, 1fr); }
  .tiles.hero { grid-template-columns: 2fr 1fr 1fr; }
  .tiles.hero .tile.g.wide { grid-column: 1; grid-row: span 2; display: flex; flex-direction: column; justify-content: flex-end; padding: 22px; }
  .tiles.hero:not(:has(.tile:nth-child(4))) .tile.g.wide { grid-row: auto; }
  .tiles.hero .tile.g.wide .v { font-size: 42px; }
  .tile { padding: 16px 18px; }
  .menu { grid-template-columns: repeat(3, 1fr); gap: 12px; }
  .menu .m { flex-direction: row; align-items: center; min-height: 76px; gap: 14px; padding: 16px; }
  .menu .m .go { position: static; margin-left: auto; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
  .list { max-width: 880px; }

  .cartbar { left: var(--side); bottom: 24px; }
  .cartbar .btn { max-width: 520px; }
  .sheet-bg { align-items: center; padding: 24px; }
  .sheet { max-width: 560px; border-radius: 20px; padding: 22px 24px 24px; max-height: 88vh; animation: pop .3s var(--ease); }
  .sheet .grab { display: none; }
  .toast { bottom: 40px; left: calc(50% + var(--side) / 2); }
}
@media (min-width: 1400px) {
  .page { padding: 0 56px 56px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
.item.paid { opacity: .6; }
