@font-face { font-family: Onest; src: url(/fonts/onest-cyrillic.woff2) format('woff2'); font-weight: 100 900; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: Onest; src: url(/fonts/onest-latin.woff2) format('woff2'); font-weight: 100 900; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+2000-206F, U+20BD, U+2190-2193, U+2212; }

:root {
  --blue: #24348a; --blue-deep: #1a2668; --blue-bright: #3447d6; --sky: #dfe6ee; --fog: #eef1f5;
  --paper: #ffffff; --bg: #f3f5f8; --ink: #141a33; --soft: #4a5370; --muted: #7a839c; --line: #e3e7ee;
  --green: #17925f; --green-bg: #e3f4ec; --red: #d9443b; --red-bg: #fbe9e7; --amber: #d68a10; --amber-bg: #fdf1dc;
  --r: 18px; --ease: cubic-bezier(.2,.8,.2,1);
  --c1: #24348a; --c2: #4f6bed; --c3: #8fa4f5; --c4: #c48e52; --c5: #17925f; --c6: #e3a02c; --c7: #9aa3b8;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 400 15px/1.4 Onest, -apple-system, 'Segoe UI', Roboto, sans-serif; -webkit-font-smoothing: antialiased; overscroll-behavior-y: none; }
button { font: inherit; color: inherit; cursor: pointer; }
.num { font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.hidden { display: none !important; }

/* ---------- вход */
.login { position: fixed; inset: 0; background: radial-gradient(120% 80% at 50% 0%, #2f43a8 0%, var(--blue) 45%, var(--blue-deep) 100%); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: calc(28px + env(safe-area-inset-top)) 24px calc(24px + env(safe-area-inset-bottom)); overflow: hidden; }
.login .top { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-top: 4vh; }
.login svg.star { width: 112px; height: 112px; overflow: visible; }
.star line { stroke: #fff; stroke-width: 26; stroke-linecap: butt; transition: transform .9s var(--ease), opacity .6s; }
.login h1 { margin: 6px 0 0; font-size: 30px; font-weight: 750; letter-spacing: .02em; }
.login .sub { opacity: .72; font-size: 14px; margin-top: -6px; }
.dots { display: flex; gap: 18px; margin: 26px 0 6px; }
.dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255,255,255,.7); transition: all .18s; }
.dots i.on { background: #fff; border-color: #fff; transform: scale(1.1); }
.dots.bad { animation: shake .45s; }
.dots.bad i { border-color: #ffb4ae; }
@keyframes shake { 0%,100% { transform: none; } 20%,60% { transform: translateX(-10px); } 40%,80% { transform: translateX(10px); } }
.pin-msg { height: 20px; font-size: 13px; opacity: .85; }
.pad { display: grid; grid-template-columns: repeat(3, 76px); gap: 16px 26px; margin-bottom: 2vh; }
.pad button { width: 76px; height: 76px; border-radius: 50%; border: 0; background: rgba(255,255,255,.1); color: #fff; font-size: 30px; font-weight: 450; transition: background .15s, transform .1s; backdrop-filter: blur(6px); }
.pad button:active { background: rgba(255,255,255,.28); transform: scale(.94); }
.pad button.ghost { background: transparent; font-size: 15px; }
.pad button.ghost:active { background: rgba(255,255,255,.12); }
.login.ok .star line { opacity: 0; }
.login.ok { animation: fadeout .7s .45s forwards; }
@keyframes fadeout { to { opacity: 0; visibility: hidden; } }
.login .foot { font-size: 11px; opacity: .45; }

/* ---------- каркас */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100dvh; }
.side { background: var(--blue); color: #fff; padding: 22px 14px; position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 4px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 18px; font-weight: 750; font-size: 18px; }
.brand svg { width: 30px; height: 30px; }
.brand small { display: block; font-weight: 500; font-size: 11.5px; opacity: .6; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border: 0; border-radius: 12px; background: transparent; color: rgba(255,255,255,.72); font-size: 14.5px; font-weight: 550; text-align: left; }
.nav-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-item[aria-current=page] { background: rgba(255,255,255,.14); color: #fff; }
.nav-item svg { width: 21px; height: 21px; flex: none; }
.nav-item .badge { margin-left: auto; }
.side .spacer { flex: 1; }
.side .out { font-size: 13px; opacity: .6; }
.badge { min-width: 19px; height: 19px; border-radius: 99px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; padding: 0 5px; }
main { min-width: 0; padding-bottom: 40px; }
.tabbar { display: none; }

.head { position: sticky; top: 0; z-index: 20; background: rgba(243,245,248,.88); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px); padding: calc(12px + env(safe-area-inset-top)) 20px 8px; }
.head-row { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.head h2 { margin: 0; font-size: 22px; font-weight: 750; letter-spacing: -.01em; }
.head .mini-brand { display: none; }
.pt-pick { border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: 7px 12px 7px 14px; font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; max-width: 58vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-pick.on { background: var(--blue); color: #fff; border-color: var(--blue); }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 10px -20px 0; padding: 0 20px 4px; scroll-snap-type: x proximity; }
.chips::-webkit-scrollbar { display: none; }
.chips button { flex: none; border: 0; background: var(--paper); border-radius: 999px; padding: 8px 14px; font-size: 13px; font-weight: 600; color: var(--soft); box-shadow: 0 0 0 1px var(--line) inset; scroll-snap-align: start; transition: all .2s; }
.chips button[aria-pressed=true] { background: var(--ink); color: #fff; box-shadow: none; }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); font-weight: 500; }
.live i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(23,146,95,.5); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgba(23,146,95,0); } 100% { box-shadow: 0 0 0 0 rgba(23,146,95,0); } }

.wrap { padding: 6px 20px 20px; display: grid; gap: 14px; max-width: 1180px; }
.grid2 { display: grid; grid-template-columns: 1.35fr 1fr; gap: 14px; align-items: start; }
.card { background: var(--paper); border-radius: var(--r); padding: 18px; box-shadow: 0 1px 2px rgba(20,26,51,.04), 0 6px 24px rgba(20,26,51,.04); min-width: 0; }
.card h3 { margin: 0 0 12px; font-size: 15px; font-weight: 700; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card h3 small { font-size: 12px; color: var(--muted); font-weight: 500; }
.anim .fade-in { animation: up .45s var(--ease) both; }
@keyframes up { from { opacity: 0; transform: translateY(10px); } }

/* главная цифра */
.hero { background: linear-gradient(135deg, var(--blue) 0%, #2c3fa8 60%, #3a4fc4 100%); color: #fff; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -40px; top: -40px; width: 220px; height: 220px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-310 -310 620 620'%3E%3Cg stroke='white' stroke-width='26' opacity='.09'%3E%3Cline x1='-106' y1='-302' x2='-106' y2='-150'/%3E%3Cline x1='-57' y1='-242' x2='10' y2='-170'/%3E%3Cline x1='35' y1='-210' x2='117' y2='-295'/%3E%3Cline x1='110' y1='-232' x2='110' y2='-97'/%3E%3Cline x1='148' y1='-110' x2='302' y2='-110'/%3E%3Cline x1='238' y1='-64' x2='172' y2='6'/%3E%3Cline x1='210' y1='28' x2='295' y2='112'/%3E%3Cline x1='96' y1='106' x2='232' y2='106'/%3E%3Cline x1='110' y1='143' x2='110' y2='296'/%3E%3Cline x1='63' y1='238' x2='-4' y2='168'/%3E%3Cline x1='-28' y1='205' x2='-112' y2='288'/%3E%3Cline x1='-106' y1='90' x2='-106' y2='226'/%3E%3Cline x1='-297' y1='106' x2='-144' y2='106'/%3E%3Cline x1='-236' y1='58' x2='-168' y2='-10'/%3E%3Cline x1='-206' y1='-32' x2='-290' y2='-118'/%3E%3Cline x1='-92' y1='-110' x2='-226' y2='-110'/%3E%3C/g%3E%3C/svg%3E") center/contain no-repeat; }
.hero .lbl { font-size: 13px; opacity: .75; font-weight: 500; }
.hero .big { font-size: clamp(40px, 11vw, 56px); font-weight: 750; letter-spacing: -.025em; line-height: 1.05; margin: 4px 0 8px; }
.hero .big small { font-size: .5em; font-weight: 600; opacity: .8; margin-left: 4px; }
.delta { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; font-size: 13px; padding: 4px 9px; border-radius: 99px; }
.delta.up { background: var(--green-bg); color: var(--green); }
.delta.down { background: var(--red-bg); color: var(--red); }
.hero .delta.up { background: rgba(120,230,180,.18); color: #9ff0cc; }
.hero .delta.down { background: rgba(255,140,130,.18); color: #ffc0b9; }
.hero .cmp { font-size: 12.5px; opacity: .75; margin-left: 6px; }
.fc { margin-top: 16px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.16); display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; }
.fc b { display: block; font-size: 19px; font-weight: 700; }
.fc span { opacity: .72; }
.fc .bar { flex-basis: 100%; height: 6px; border-radius: 9px; background: rgba(255,255,255,.15); overflow: hidden; }
.fc .bar i { display: block; height: 100%; border-radius: 9px; background: #fff; transition: width 1.2s var(--ease); }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.kpi { background: var(--paper); border-radius: 16px; padding: 14px; box-shadow: 0 1px 2px rgba(20,26,51,.04); min-width: 0; }
.kpi .k { font-size: 12px; color: var(--muted); font-weight: 550; }
.kpi .v { font-size: 22px; font-weight: 720; margin: 3px 0 2px; white-space: nowrap; }
.kpi .s { font-size: 12px; color: var(--muted); }
.kpi .s.up { color: var(--green); font-weight: 650; } .kpi .s.down { color: var(--red); font-weight: 650; }

/* графики */
.chart { width: 100%; height: 190px; display: block; }
.chart .b { fill: var(--blue); transition: height .7s var(--ease), y .7s var(--ease); }
.chart .b.we { fill: var(--c2); }
.chart .p { fill: var(--sky); }
.chart .ax { font-size: 10.5px; fill: var(--muted); }
.chart .grid { stroke: var(--line); stroke-dasharray: 3 4; }
.chart .now { stroke: var(--red); stroke-width: 1.5; stroke-dasharray: 3 3; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 6px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.tip { font-size: 12.5px; color: var(--soft); min-height: 18px; margin-top: 4px; }

/* рейтинг точек */
.rank { display: grid; gap: 12px; }
.rank button { all: unset; cursor: pointer; display: grid; gap: 6px; }
.rank .row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 14px; }
.rank .row b { font-weight: 650; }
.rank .row .v { font-weight: 700; white-space: nowrap; }
.rank .track { height: 9px; border-radius: 9px; background: var(--fog); overflow: hidden; }
.rank .track i { display: block; height: 100%; border-radius: 9px; background: linear-gradient(90deg, var(--blue), var(--c2)); width: 0; transition: width .9s var(--ease); }
.rank .sub { display: flex; gap: 10px; font-size: 12px; color: var(--muted); }
.up { color: var(--green); } .down { color: var(--red); }

/* категории */
.cats { display: flex; height: 14px; border-radius: 9px; overflow: hidden; gap: 2px; }
.cats i { display: block; height: 100%; transition: flex-grow .8s var(--ease); }
.catlist { display: grid; gap: 8px; margin-top: 14px; }
.catlist div { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.catlist i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.catlist span { flex: 1; } .catlist b { font-weight: 650; } .catlist em { font-style: normal; color: var(--muted); width: 44px; text-align: right; font-size: 12px; }

/* лента чеков */
.feed { display: grid; gap: 0; max-height: 420px; overflow: auto; margin: 0 -18px -8px; }
.feed div { display: grid; grid-template-columns: 46px 1fr auto; gap: 10px; padding: 10px 18px; border-top: 1px solid var(--line); align-items: start; }
.feed div:first-child { border-top: 0; }
.feed div.new { animation: flash 1.6s; }
@keyframes flash { from { background: #fff6d6; } }
.feed time { color: var(--muted); font-size: 12.5px; padding-top: 1px; }
.feed p { margin: 0; font-size: 13.5px; } .feed p small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.feed b { font-weight: 700; font-size: 14px; white-space: nowrap; }
.feed .ret b { color: var(--red); }

/* тепловая карта */
.heat { display: grid; grid-template-columns: 26px repeat(16, 1fr); gap: 3px; font-size: 10px; color: var(--muted); }
.heat i { aspect-ratio: 1; border-radius: 4px; background: var(--blue); }
.heat span { display: grid; place-items: center; }

/* списки */
.list { display: grid; }
.list .it { display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.list .it:first-child { border-top: 0; }
.list .n { width: 24px; height: 24px; border-radius: 8px; background: var(--fog); display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--soft); }
.list .t { font-size: 14px; font-weight: 550; min-width: 0; }
.list .t small { display: block; color: var(--muted); font-weight: 450; font-size: 12px; margin-top: 1px; }
.list .r { text-align: right; font-weight: 700; font-size: 14px; white-space: nowrap; }
.list .r small { display: block; color: var(--muted); font-weight: 500; font-size: 12px; }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; background: var(--fog); }
.seg button { border: 0; background: transparent; border-radius: 999px; padding: 6px 12px; font-size: 12.5px; font-weight: 650; color: var(--soft); }
.seg button[aria-pressed=true] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.1); }

/* точки */
.pts { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.pt { all: unset; cursor: pointer; background: var(--paper); border-radius: var(--r); padding: 16px 18px; box-shadow: 0 1px 2px rgba(20,26,51,.04), 0 6px 24px rgba(20,26,51,.04); display: grid; gap: 10px; transition: transform .15s; }
.pt:active { transform: scale(.985); }
.pt .top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pt .place { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15.5px; }
.pt .place i { width: 34px; height: 34px; border-radius: 11px; background: var(--fog); color: var(--blue); display: grid; place-items: center; font-style: normal; font-weight: 800; font-size: 14px; }
.pt .rev { font-size: 26px; font-weight: 750; letter-spacing: -.02em; }
.pt .meta { display: flex; gap: 14px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.pt .meta b { color: var(--ink); font-weight: 650; }
.pt svg { width: 100%; height: 44px; }
.pt svg path.l { fill: none; stroke: var(--blue); stroke-width: 2; }
.pt svg path.a { fill: url(#g); }
.crown { font-size: 11px; font-weight: 700; color: var(--amber); background: var(--amber-bg); padding: 3px 8px; border-radius: 99px; }

/* кухня */
.plan-total { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.plan-total div { background: var(--fog); border-radius: 14px; padding: 12px; }
.plan-total b { display: block; font-size: 24px; font-weight: 750; }
.plan-total span { font-size: 12.5px; color: var(--soft); }
.acc { border-top: 1px solid var(--line); }
.acc summary { list-style: none; display: flex; justify-content: space-between; align-items: center; padding: 13px 0; cursor: pointer; font-weight: 650; }
.acc summary::-webkit-details-marker { display: none; }
.acc summary em { font-style: normal; font-weight: 600; font-size: 13px; color: var(--muted); }
.acc table { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 12px; }
.acc th { text-align: right; font-weight: 550; color: var(--muted); font-size: 11.5px; padding: 0 0 6px 6px; }
.acc th:first-child, .acc td:first-child { text-align: left; padding-left: 0; }
.acc td { text-align: right; padding: 7px 0 7px 6px; border-top: 1px solid var(--line); white-space: nowrap; }
.acc td:first-child { white-space: normal; }
.acc td.plan { font-weight: 750; color: var(--blue); font-size: 14px; }
.neg { color: var(--red); font-weight: 650; }
.note { font-size: 12.5px; color: var(--muted); line-height: 1.5; }

/* учёт */
.issue { display: grid; grid-template-columns: 44px 1fr; gap: 14px; }
.issue .ic { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-weight: 800; font-size: 18px; }
.issue.bad .ic { background: var(--red-bg); color: var(--red); }
.issue.warn .ic { background: var(--amber-bg); color: var(--amber); }
.issue.ok .ic { background: var(--green-bg); color: var(--green); }
.issue h4 { margin: 0 0 4px; font-size: 15.5px; }
.issue p { margin: 0; font-size: 13.5px; color: var(--soft); }
.issue .fix { margin-top: 10px; font-size: 13px; background: var(--fog); border-radius: 12px; padding: 10px 12px; color: var(--ink); }
.issue .fix b { color: var(--blue); }
.chipsline { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chipsline span { background: var(--fog); border-radius: 99px; padding: 4px 10px; font-size: 12px; font-weight: 600; }
.chipsline span.r { background: var(--red-bg); color: var(--red); }
.score { display: flex; align-items: center; gap: 16px; }
.score .ring { width: 86px; height: 86px; flex: none; }
.score h4 { margin: 0; font-size: 17px; }

/* шторка выбора точки */
#sheet[hidden] { display: none; }
#sheet { position: fixed; inset: 0; z-index: 50; background: rgba(20,26,51,.35); display: flex; align-items: flex-end; justify-content: center; animation: fadein .2s; }
@keyframes fadein { from { opacity: 0; } }
#sheet .box { background: var(--paper); width: min(520px, 100%); border-radius: 22px 22px 0 0; padding: 10px 16px calc(18px + env(safe-area-inset-bottom)); animation: sheetup .3s var(--ease); max-height: 80vh; overflow: auto; }
@keyframes sheetup { from { transform: translateY(100%); } }
#sheet .grab { width: 40px; height: 5px; border-radius: 9px; background: var(--line); margin: 0 auto 12px; }
#sheet h4 { margin: 0 0 8px; font-size: 16px; padding: 0 4px; }
#sheet button.opt { display: flex; justify-content: space-between; width: 100%; border: 0; background: transparent; text-align: left; padding: 14px 6px; border-top: 1px solid var(--line); font-size: 15px; font-weight: 550; }
#sheet button.opt[aria-pressed=true] { color: var(--blue); font-weight: 750; }
#sheet button.opt span { color: var(--muted); font-weight: 500; font-size: 13px; }
#toast { position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px); opacity: 0; z-index: 60; background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 999px; font-size: 13px; font-weight: 600; transition: all .25s var(--ease); pointer-events: none; }
#toast.on { opacity: 1; transform: translateX(-50%); }
.skel { background: linear-gradient(90deg, var(--fog) 0%, #f7f8fa 50%, var(--fog) 100%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: var(--r); }
@keyframes sk { to { background-position: -200% 0; } }
.empty { padding: 30px 10px; text-align: center; color: var(--muted); font-size: 14px; }

@media (max-width: 860px) {
  .shell { display: block; }
  .side { display: none; }
  main { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: rgba(255,255,255,.94); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar button { border: 0; background: transparent; display: grid; justify-items: center; gap: 3px; font-size: 10.5px; font-weight: 650; color: var(--muted); padding: 4px 0; position: relative; }
  .tabbar button[aria-current=page] { color: var(--blue); }
  .tabbar svg { width: 23px; height: 23px; }
  .tabbar .badge { position: absolute; top: -1px; left: 55%; height: 17px; min-width: 17px; font-size: 10px; }
  .head { padding: calc(10px + env(safe-area-inset-top)) 16px 6px; }
  .head .mini-brand { display: inline-flex; width: 30px; height: 30px; border-radius: 10px; background: var(--blue); align-items: center; justify-content: center; flex: none; }
  .head .mini-brand svg { width: 20px; height: 20px; }
  .head .ttl { display: flex; align-items: center; gap: 10px; min-width: 0; }
  .chips { margin: 10px -16px 0; padding: 0 16px 4px; }
  .wrap { padding: 4px 12px 16px; gap: 12px; }
  .grid2 { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .card { padding: 16px; }
  .feed { margin: 0 -16px -6px; } .feed div { padding: 10px 16px; }
}
