:root {
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.3, 1.3, .5, 1);
  --green: #0B7A53;
  --green-dark: #0A5E40;
  --green-soft: #E3F3EB;
  --kaspi: #C8312A;
  --kaspi-dark: #A3261F;
  --kaspi-soft: #FCE9E7;
  --bg: #F2F7F4;
  --surface: #FFFFFF;
  --ink: #12201A;
  --muted: #4E6259;
  --line: #DCE8E1;
  --line-soft: #E6EEE9;
  --field: #C9D9D0;
  --radius: 24px;
  --shadow: 0 12px 32px rgba(11, 60, 40, 0.06);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: not-allowed; }
:focus-visible { outline: 3px solid #7CC9A6; outline-offset: 2px; }
[hidden] { display: none !important; }
.ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* Шапка */
.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.top .wrap { padding-top: 14px; padding-bottom: 14px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 12px; }
.logo { width: 42px; height: 42px; border-radius: 12px; background: var(--green); display: grid; place-items: center; }
.logo svg { width: 22px; height: 22px; fill: #fff; }
.brand b { display: block; font-size: 18px; font-weight: 800; letter-spacing: -0.01em; }
.brand small { display: block; font-size: 13px; color: var(--muted); font-weight: 600; }
.date { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: var(--green-soft); color: var(--green-dark); font-size: 14px; font-weight: 700; }
.date .ico { width: 16px; height: 16px; stroke-width: 2.2; }

main { padding-top: 20px; padding-bottom: 48px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.narrow { max-width: 640px; margin: 0 auto; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card.lift { box-shadow: var(--shadow); }
h1, h2 { margin: 0; font-weight: 800; letter-spacing: -0.02em; }
h1 { font-size: 28px; line-height: 1.15; }
h2 { font-size: 20px; }
p { margin: 0; }
.muted { color: var(--muted); }
label, .legend { font-size: 14px; font-weight: 700; display: block; }
.opt { font-weight: 600; color: var(--muted); }

.pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: #F2F4F3; color: var(--muted); font-size: 13px; font-weight: 700; }
.dot { width: 8px; height: 8px; border-radius: 999px; background: #8A9A92; }

.field { width: 100%; height: 52px; padding: 0 16px; border: 2px solid var(--field); border-radius: 14px; background: #fff; font-size: 16px; font-weight: 600; color: var(--ink); }
.field:focus { border-color: var(--green); outline: none; box-shadow: 0 0 0 4px rgba(11, 122, 83, 0.15); }
.field.error { border-color: var(--kaspi); }
.field.big { height: 72px; border-radius: 18px; font-size: 34px; font-weight: 800; letter-spacing: -0.01em; padding: 0 18px; }
.field::placeholder { color: #7D8C85; font-weight: 600; }

.btn { height: 56px; padding: 0 20px; border: 0; border-radius: 16px; font-size: 17px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; gap: 10px; transition: transform .08s ease, background-color .15s ease, opacity .15s ease; }
.btn:active:not(:disabled) { transform: scale(0.98); }
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--green-dark); }
.btn-ghost { background: #fff; color: var(--ink); border: 1.5px solid var(--field); }
.btn-ghost:hover { background: #F7FAF8; }
.btn-danger { background: var(--kaspi); color: #fff; }

.row-wrap { display: flex; flex-wrap: wrap; gap: 10px; }
.grow { flex: 1 1 220px; min-width: 0; }
.grow-sm { flex: 1 1 180px; }
.err { font-size: 14px; font-weight: 700; color: var(--kaspi-dark); }

/* Смена открыта */
.banner { background: var(--green); color: #fff; border-radius: var(--radius); padding: 20px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.banner .who { display: flex; align-items: center; gap: 14px; min-width: 0; }
.avatar { width: 52px; height: 52px; border-radius: 999px; background: rgba(255,255,255,.16); display: grid; place-items: center; flex-shrink: 0; }
.avatar .ico { width: 26px; height: 26px; }
.live { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #D9F2E6; }
.live .dot { background: #7CF0B8; box-shadow: 0 0 0 0 rgba(124,240,184,.7); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(124,240,184,.6); } 70% { box-shadow: 0 0 0 8px rgba(124,240,184,0); } 100% { box-shadow: 0 0 0 0 rgba(124,240,184,0); } }
@media (prefers-reduced-motion: reduce) { .live .dot { animation: none; } }
.banner .name { display: block; font-size: 26px; font-weight: 800; line-height: 1.15; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.banner .since { display: block; font-size: 14px; font-weight: 600; color: #D9F2E6; }
.btn-white { height: 50px; border-radius: 14px; background: #fff; color: var(--green-dark); font-size: 16px; }
.btn-white:hover { background: #F0FAF5; }

.cols { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 16px; }
.col-form { flex: 1 1 340px; min-width: 0; }
.col-data { flex: 999 1 420px; min-width: 0; }

.form { display: flex; flex-direction: column; gap: 16px; }
.group { display: flex; flex-direction: column; gap: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { height: 44px; padding: 0 14px; border: 1.5px solid var(--field); border-radius: 999px; background: #F7FAF8; font-size: 15px; font-weight: 700; }
.chip:hover { border-color: var(--green); }
.chip.link { border: 0; background: transparent; color: var(--muted); text-decoration: underline; }

fieldset { margin: 0; padding: 0; border: 0; }

.submit { height: 60px; font-size: 18px; }
.submit .ico { width: 22px; height: 22px; stroke-width: 2.6; }
.submit.kaspi { background: var(--kaspi); }
.submit.kaspi:hover:not(:disabled) { background: var(--kaspi-dark); }
.submit:disabled { background: #E1E8E4; color: var(--muted); }

/* Итоги */
.totals { display: flex; flex-wrap: wrap; gap: 12px; }
.tile { flex: 1 1 150px; background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.tile.sum { flex: 1 1 100%; background: var(--ink); border-color: var(--ink); color: #fff; padding: 18px 20px; flex-direction: row; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 16px; }
.tile.sum small { display: block; font-size: 14px; font-weight: 700; color: #C8DDD2; }
.tile.sum strong { display: block; font-size: 36px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.tile-head { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; }
.badge { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; }
.badge .ico { width: 18px; height: 18px; }
.tone-cash .badge, .tone-cash.badge { background: var(--green-soft); color: var(--green); }
.tone-kaspi .badge, .tone-kaspi.badge { background: var(--kaspi-soft); color: var(--kaspi); }
.tone-cash .tile-head { color: var(--green-dark); }
.tone-kaspi .tile-head { color: var(--kaspi-dark); }
.tile .val { font-size: 24px; font-weight: 800; letter-spacing: -0.01em; }

/* Список */
@keyframes slide { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.entry .badge { width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0; }
.entry .badge .ico { width: 22px; height: 22px; }
.entry .info { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.entry .info b { font-size: 16px; font-weight: 800; }
.entry .info span { font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entry .amt { font-size: 18px; font-weight: 800; white-space: nowrap; }
.icon-btn { width: 44px; height: 44px; flex-shrink: 0; border: 0; border-radius: 12px; background: transparent; color: var(--muted); display: grid; place-items: center; }
.icon-btn:hover { background: var(--kaspi-soft); color: var(--kaspi); }
.confirm { display: flex; gap: 6px; flex-shrink: 0; }
.confirm .btn { height: 44px; padding: 0 12px; border-radius: 12px; font-size: 14px; }
.empty { padding: 28px 12px; border-radius: 16px; background: #F7FAF8; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.empty .ico { width: 28px; height: 28px; stroke: #8A9A92; }
.empty b { font-size: 16px; }
.empty span { font-size: 14px; color: var(--muted); }

/* История и итоги закрытой смены */
.done-head { display: flex; align-items: center; gap: 12px; }
.check { width: 40px; height: 40px; border-radius: 999px; background: var(--green-soft); color: var(--green); display: grid; place-items: center; flex-shrink: 0; }
.check .ico { stroke-width: 2.6; }
.mini { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.mini > div { flex: 1 1 140px; border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.mini small { font-size: 13px; font-weight: 700; }
.mini strong { font-size: 20px; font-weight: 800; }
.mini .c { background: var(--green-soft); } .mini .c small { color: var(--green-dark); }
.mini .k { background: var(--kaspi-soft); } .mini .k small { color: var(--kaspi-dark); }
.mini .t { flex-basis: 100%; background: var(--ink); color: #fff; flex-direction: row; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.mini .t small { font-size: 14px; color: #C8DDD2; }
.mini .t strong { font-size: 24px; }
.hist { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; padding: 12px 0; border-top: 1px solid var(--line-soft); }
.hist b { display: block; font-size: 16px; font-weight: 800; }
.hist span { display: block; font-size: 13px; color: var(--muted); font-weight: 600; }
.hist .r { text-align: right; }
.hist .r b { font-size: 17px; }
.hist-foot { display: flex; justify-content: flex-end; margin-top: 8px; }

/* Окно закрытия */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(10,30,20,.5); display: flex; align-items: center; justify-content: center; padding: 16px; animation: fade .15s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.dialog { width: 100%; max-width: 420px; background: #fff; border-radius: 24px; padding: 24px 20px 20px; display: flex; flex-direction: column; gap: 16px; box-shadow: 0 24px 60px rgba(0,0,0,.25); }
.dialog h2 { font-size: 22px; }
.sumtable { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.sumtable div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 12px 16px; }
.sumtable div + div { border-top: 1px solid var(--line-soft); }
.sumtable span { font-weight: 700; }
.sumtable b { font-weight: 800; }
.sumtable .last { background: var(--bg); padding: 14px 16px; }
.sumtable .last b { font-size: 22px; }

.toast { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 14px; font-weight: 700; font-size: 15px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 60; max-width: calc(100% - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media print {
  .top .date, .top-right, .col-form, .banner button, .seg, .icon-btn { display: none !important; }
  body { background: #fff; }
}

/* ================= Анимации и общие элементы ================= */
.enter { animation: viewIn .5s var(--ease) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.stagger > * { animation: viewIn .5s var(--ease) both; }
.stagger > *:nth-child(2) { animation-delay: .05s; }
.stagger > *:nth-child(3) { animation-delay: .1s; }
.stagger > *:nth-child(4) { animation-delay: .15s; }
.stagger > *:nth-child(5) { animation-delay: .2s; }
.stagger > *:nth-child(n+6) { animation-delay: .25s; }

/* Сегмент со скользящим индикатором (фильтры, вкладки, периоды) */
.list-head { display: flex; flex-direction: column; align-items: stretch; gap: 12px; margin-bottom: 12px; }
.seg { position: relative; display: flex; width: 100%; padding: 4px; border-radius: 999px; background: #EEF3F0; isolation: isolate; }
.seg > button { position: relative; z-index: 1; flex: 1 1 0; min-width: 0; height: 44px; padding: 0 10px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-size: 15px; font-weight: 800; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: color .3s var(--ease), transform .12s ease; }
.seg > button:hover { color: var(--ink); }
.seg > button:active { transform: scale(.96); }
.seg > button[aria-pressed="true"] { color: var(--ink); }
.seg > button .ico { width: 18px; height: 18px; }
.seg-ind { position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 0; width: 0; border-radius: 999px; background: #fff; box-shadow: 0 1px 2px rgba(11,60,40,.16), 0 6px 16px rgba(11,60,40,.10); transition: transform .45s var(--spring), width .45s var(--spring), background-color .35s var(--ease), box-shadow .35s var(--ease), opacity .2s; pointer-events: none; }
.no-anim > .seg-ind { transition: none !important; }
.seg[data-tone="cash"] > button[aria-pressed="true"] { color: var(--green-dark); }
.seg[data-tone="kaspi"] > button[aria-pressed="true"] { color: var(--kaspi-dark); }
.sdot { width: 8px; height: 8px; border-radius: 999px; flex-shrink: 0; transition: transform .3s var(--spring); }
.sdot.cash { background: var(--green); }
.sdot.kaspi { background: var(--kaspi); }
.seg > button[aria-pressed="true"] .sdot { transform: scale(1.35); }

/* Переключатель «Наличные / Kaspi» */
.methods { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 8px; padding: 5px; border: 2px solid #BFE0CF; border-radius: 20px; background: #F7FAF8; isolation: isolate; transition: border-color .35s var(--ease); }
.methods[data-tone="kaspi"] { border-color: #F0C9C5; }
.methods .seg-ind { top: 5px; bottom: 5px; border-radius: 15px; background: var(--green); box-shadow: 0 6px 18px rgba(11,122,83,.30); }
.methods[data-tone="kaspi"] .seg-ind { background: var(--kaspi); box-shadow: 0 6px 18px rgba(200,49,42,.30); }
.method { position: relative; z-index: 1; height: 56px; border: 0; border-radius: 15px; background: transparent; color: var(--ink); font-size: 17px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; gap: 10px; transition: color .3s var(--ease), transform .12s ease; }
.method:active { transform: scale(.97); }
.method .ico { width: 22px; height: 22px; }
.method[aria-pressed="true"] { color: #fff; }
.method[aria-pressed="true"] .ico { animation: pop .5s var(--spring); }
@keyframes pop { 0% { transform: scale(.55) rotate(-14deg); } 60% { transform: scale(1.18) rotate(4deg); } 100% { transform: none; } }

/* Список продаж */
.entry { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line-soft); }
.entry.in { animation: entryIn .45s var(--ease) both; animation-delay: calc(var(--i, 0) * 35ms); }
@keyframes entryIn { from { opacity: 0; transform: translateY(-8px) scale(.98); } to { opacity: 1; transform: none; } }
.entry.out { animation: entryOut .24s ease forwards; }
@keyframes entryOut { to { opacity: 0; transform: translateX(24px); } }
.hist.in { animation: entryIn .45s var(--ease) both; animation-delay: calc(var(--i, 0) * 40ms); }
.tile .val, .tile.sum strong { font-variant-numeric: tabular-nums; }
.submit { transition: background-color .35s var(--ease), transform .08s ease, opacity .15s; }
.empty.enter { animation-duration: .35s; }

/* Окна */
.overlay.enter { animation: fade .2s ease both; }
.overlay.enter .dialog { animation: dialogIn .35s var(--spring) both; }
.overlay.leave { animation: fadeOut .16s ease forwards; }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes dialogIn { from { opacity: 0; transform: translateY(16px) scale(.96); } to { opacity: 1; transform: none; } }
.toast.error { background: var(--kaspi-dark); }

/* ================= Шапка ================= */
.top { position: sticky; top: 0; z-index: 30; background: rgba(255,255,255,.92); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); }
.top-right { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.navlink { height: 40px; padding: 0 14px; border-radius: 999px; background: var(--green-soft); color: var(--green-dark); font-size: 14px; font-weight: 800; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; transition: background-color .2s, transform .12s; }
.navlink:hover { background: #D3EDE0; }
.navlink:active { transform: scale(.97); }
.navlink .ico { width: 18px; height: 18px; }
.userchip { display: inline-flex; align-items: center; gap: 10px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: #fff; max-width: 100%; }
.initials { width: 34px; height: 34px; border-radius: 999px; background: var(--green); color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 800; flex-shrink: 0; }
.initials.admin { background: var(--ink); }
.initials.lg { width: 44px; height: 44px; font-size: 15px; }
.userchip b { font-size: 14px; font-weight: 800; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.userchip form { margin: 0; display: flex; }
.round-btn { width: 34px; height: 34px; border: 0; border-radius: 999px; background: #F2F4F3; color: var(--muted); display: grid; place-items: center; transition: background-color .2s, color .2s; }
.round-btn:hover { background: var(--kaspi-soft); color: var(--kaspi); }
.round-btn .ico { width: 17px; height: 17px; }
@media (max-width: 560px) { .top .date { display: none; } }

/* ================= Вход ================= */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background:
  radial-gradient(900px 500px at 10% -10%, #D7EFE3 0%, transparent 60%),
  radial-gradient(700px 400px at 110% 110%, #FBE3E0 0%, transparent 55%), var(--bg); }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: 28px; padding: 32px 24px 24px; box-shadow: 0 24px 60px rgba(11,60,40,.10); display: flex; flex-direction: column; gap: 20px; }
.auth-card .logo { width: 56px; height: 56px; border-radius: 16px; animation: pop .7s var(--spring) .1s both; }
.auth-card .logo svg { width: 28px; height: 28px; }
.auth-card h1 { font-size: 26px; }
.pw-wrap { position: relative; }
.pw-wrap .field { padding-right: 56px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 42px; height: 42px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); display: grid; place-items: center; }
.pw-toggle:hover { background: #F2F4F3; color: var(--ink); }
.pw-toggle .eye-off { display: none; }
.pw-toggle[aria-pressed="true"] .eye-on { display: none; }
.pw-toggle[aria-pressed="true"] .eye-off { display: block; }
.form-err { padding: 12px 14px; border-radius: 14px; background: var(--kaspi-soft); color: var(--kaspi-dark); font-size: 14px; font-weight: 700; animation: shake .4s ease; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.btn-block { width: 100%; }
.hello-btn { width: 100%; height: 60px; font-size: 18px; }

/* ================= Панель ================= */
.panel-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.eyebrow { display: block; font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--green); margin-bottom: 4px; }
.ptabs { background: #fff; border: 1px solid var(--line); padding: 5px; }
.ptabs > button { height: 48px; font-size: 15px; }
.ptabs .seg-ind { top: 5px; bottom: 5px; background: var(--ink); box-shadow: 0 6px 18px rgba(18,32,26,.25); }
.ptabs > button[aria-pressed="true"] { color: #fff; }
.ptabs > button[aria-pressed="true"] .ico { animation: pop .5s var(--spring); }
@media (max-width: 520px) { .ptabs > button { font-size: 13px; gap: 6px; padding: 0 6px; } .ptabs > button .ico { display: none; } }
.period > button { font-size: 14px; }

.tile.sum .share { flex-basis: 100%; display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.split { display: flex; gap: 2px; height: 10px; border-radius: 999px; overflow: hidden; background: rgba(255,255,255,.12); }
.split span { display: block; height: 100%; transition: flex-grow .8s var(--ease); flex-basis: 0; min-width: 0; }
.split .c { background: #2FB57F; }
.split .k { background: #E5544B; }
.split.light { background: var(--line-soft); height: 8px; }
.split.light .c { background: var(--green); }
.split.light .k { background: var(--kaspi); }
.share-legend { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; font-size: 13px; font-weight: 700; color: #C8DDD2; }
.share-legend i, .legend-key i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.tile .sub { font-size: 13px; font-weight: 700; color: var(--muted); }
.tone-neutral .badge { background: #EEF3F0; color: var(--ink); }

/* График */
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-bottom: 16px; }
.card-head h2 { font-size: 18px; }
.legend-key { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 13px; font-weight: 700; color: var(--muted); }
.legend-key i.c { background: var(--green); } .legend-key i.k { background: var(--kaspi); }
.share-legend i.c { background: #2FB57F; } .share-legend i.k { background: #E5544B; }
.chip.sm { height: 36px; font-size: 13px; padding: 0 12px; }
.chart { position: relative; padding-left: 52px; user-select: none; -webkit-user-select: none; }
.chart-grid { position: absolute; left: 0; right: 0; top: 0; height: 220px; pointer-events: none; }
.gl { position: absolute; left: 52px; right: 0; border-top: 1px solid var(--line-soft); }
.gl span { position: absolute; right: calc(100% + 8px); top: -8px; font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.gl.zero { border-top-color: var(--field); }
.chart-cols { position: relative; display: flex; }
.ccol { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; }
.cplot { position: relative; width: 100%; height: 220px; display: flex; align-items: flex-end; justify-content: center; border-radius: 10px 10px 0 0; transition: background-color .15s; }
.ccol.hover .cplot { background: rgba(11,122,83,.07); }
.cbar { width: min(24px, 64%); display: flex; flex-direction: column; gap: 2px; transform-origin: bottom; }
.cbar span { display: block; flex: 1 1 0; min-height: 2px; }
.cbar span:first-child { border-radius: 4px 4px 0 0; }
.cbar .sc { background: var(--green); }
.cbar .sk { background: var(--kaspi); }
.chart.animate .cbar { transform: scaleY(0); }
.chart.animate.ready .cbar { transform: scaleY(1); transition: transform .7s var(--ease); transition-delay: calc(var(--i, 0) * 16ms); }
.xl { height: 26px; padding-top: 8px; font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.xl.off { visibility: hidden; }
.chart-empty { position: absolute; left: 52px; right: 0; top: 0; height: 220px; display: grid; place-items: center; text-align: center; font-size: 15px; font-weight: 700; color: var(--muted); pointer-events: none; }
.tip { position: absolute; z-index: 5; min-width: 190px; padding: 12px 14px; border-radius: 14px; background: var(--ink); color: #fff; font-size: 13px; font-weight: 600; box-shadow: 0 12px 30px rgba(0,0,0,.22); pointer-events: none; transform: translate(-50%, calc(-100% - 10px)); }
.tip b { display: block; font-size: 14px; font-weight: 800; margin-bottom: 6px; }
.tip div { display: flex; justify-content: space-between; gap: 16px; line-height: 1.6; font-variant-numeric: tabular-nums; }
.tip div span i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }
.tip .t { border-top: 1px solid rgba(255,255,255,.15); margin-top: 6px; padding-top: 6px; font-weight: 800; }
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.tbl th { text-align: right; font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { text-align: right; padding: 10px; border-bottom: 1px solid var(--line-soft); font-weight: 700; white-space: nowrap; }
.tbl th:first-child, .tbl td:first-child { text-align: left; padding-left: 0; }

/* Строки списков в панели */
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 14px 0; border-top: 1px solid var(--line-soft); }
.row:first-child { border-top: 0; }
.row.in, .xrow.in { animation: entryIn .45s var(--ease) both; animation-delay: calc(var(--i, 0) * 40ms); }
.row .main, .xrow .main { flex: 1 1 200px; min-width: 0; display: flex; align-items: center; gap: 12px; }
.row .main > div, .xrow .main > div { min-width: 0; }
.row .main b, .xrow .main b { display: block; font-size: 16px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: color .2s; }
.row .main > div > span, .xrow .main > div > span { display: block; font-size: 13px; font-weight: 600; color: var(--muted); }
.num { text-align: right; margin-left: auto; }
.num b { display: block; font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.num span { display: block; font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.row .full { flex-basis: 100%; }
.rank { width: 36px; height: 36px; border-radius: 12px; background: #EEF3F0; display: grid; place-items: center; font-weight: 800; font-size: 15px; flex-shrink: 0; }
.rank.r1 { background: var(--ink); color: #fff; }
.tag { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 800; background: #EEF3F0; color: var(--muted); white-space: nowrap; }
.tag.on { background: var(--green-soft); color: var(--green-dark); }
.tag.on .dot { background: var(--green); animation: pulseG 2s infinite; }
@keyframes pulseG { 0% { box-shadow: 0 0 0 0 rgba(11,122,83,.45); } 70% { box-shadow: 0 0 0 6px rgba(11,122,83,0); } 100% { box-shadow: 0 0 0 0 rgba(11,122,83,0); } }
.tag.off { background: var(--kaspi-soft); color: var(--kaspi-dark); }
.tag.dark { background: var(--ink); color: #fff; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-sm { height: 40px; padding: 0 14px; border-radius: 12px; font-size: 14px; }
.btn-sm .ico { width: 16px; height: 16px; }
.btn-ghost.danger { color: var(--kaspi-dark); border-color: #F0C9C5; }
.btn-ghost.danger:hover { background: var(--kaspi-soft); }
.list-empty { padding: 16px 0 4px; color: var(--muted); font-size: 15px; font-weight: 600; }
.row.off .main b, .row.off .initials { opacity: .5; }
.count-pill { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 8px; margin-left: 8px; border-radius: 999px; background: var(--green-soft); color: var(--green-dark); font-size: 13px; font-weight: 800; vertical-align: 2px; }

/* Раскрывающаяся смена */
.xrow { border-top: 1px solid var(--line-soft); }
.xrow:first-child { border-top: 0; }
.xrow > button { width: 100%; border: 0; background: transparent; padding: 14px 0; text-align: left; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.xrow > button:hover .main b { color: var(--green-dark); }
.chev { width: 32px; height: 32px; border-radius: 10px; background: #F2F4F3; display: grid; place-items: center; flex-shrink: 0; transition: transform .4s var(--spring), background-color .2s, color .2s; }
.chev .ico { width: 16px; height: 16px; }
.xrow.open .chev { transform: rotate(180deg); background: var(--green-soft); color: var(--green); }
.xbody { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .4s var(--ease); }
.xrow.open .xbody { grid-template-rows: 1fr; }
.xbody > div { overflow: hidden; min-height: 0; }
.xinner { padding: 0 0 14px 46px; }
.xsale { display: flex; align-items: center; gap: 10px; padding: 8px 0; font-size: 14px; border-top: 1px dashed var(--line); }
.xsale:first-child { border-top: 0; }
.xsale .badge { width: 30px; height: 30px; border-radius: 9px; }
.xsale .badge .ico { width: 16px; height: 16px; }
.xsale .t { color: var(--muted); font-weight: 700; font-variant-numeric: tabular-nums; }
.xsale .n { flex: 1 1 auto; min-width: 0; color: var(--muted); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xsale b { font-weight: 800; white-space: nowrap; margin-left: auto; }
@media (max-width: 520px) { .xinner { padding-left: 0; } }

/* Форма в окне */
.dialog .form { gap: 14px; }
.dialog .field { height: 50px; }
.inline-btn { position: absolute; right: 52px; top: 50%; transform: translateY(-50%); height: 34px; padding: 0 10px; border: 0; border-radius: 10px; background: var(--green-soft); color: var(--green-dark); font-size: 13px; font-weight: 800; }
.inline-btn:hover { background: #D3EDE0; }
.pw-wrap.gen .field { padding-right: 168px; }
.role-seg > button { height: 44px; font-size: 14px; }
.dialog .err { margin-top: -4px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; transition-duration: .001ms !important; }
}
.form-shake { animation: shake .4s ease; }
.row.xrow { flex-wrap: wrap; }

/* Правки после проверки в браузере */
main.wrap { padding-top: 20px; padding-bottom: 48px; }
.hist .r { margin-left: auto; }
@media (max-width: 560px) {
  .top .wrap { flex-wrap: nowrap; padding-top: 10px; padding-bottom: 10px; }
  .brand { min-width: 0; }
  .brand small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .top-right { flex-wrap: nowrap; gap: 8px; }
  .userchip b { display: none; }
  .navlink { padding: 0 12px; }
  main.wrap { padding-top: 16px; }
}
.logo { flex-shrink: 0; }
.brand > div { min-width: 0; }
.brand b, .brand small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 480px) { .nl-text { display: none; } .navlink { width: 40px; padding: 0; justify-content: center; } }

/* ================= Заставка с логотипом ================= */
.intro { position: fixed; inset: 0; z-index: 100; overflow: hidden; cursor: pointer;
  animation: introFailsafe 0s linear 4s forwards; }            /* если JS не сработал — убрать через 4 с */
@keyframes introFailsafe { to { visibility: hidden; pointer-events: none; } }
.intro-base { position: absolute; inset: 0; background: var(--bg); animation: introHide 0s linear 1.02s forwards; }
@keyframes introHide { to { opacity: 0; } }
.intro-fill { position: absolute; inset: 0; clip-path: circle(0px at 50% 50%);
  animation: introFill .6s cubic-bezier(.7, 0, .25, 1) .42s forwards; }
@keyframes introFill { to { clip-path: circle(80% at 50% 50%); } }
.intro-q { position: absolute; width: calc(50% + 1px); height: calc(50% + 1px); background: var(--green);
  transition: transform .8s cubic-bezier(.7, 0, .3, 1); }
.intro-q.q1 { left: 0; top: 0; }
.intro-q.q2 { right: 0; top: 0; }
.intro-q.q3 { left: 0; bottom: 0; }
.intro-q.q4 { right: 0; bottom: 0; }
.intro.split .q1 { transform: translate(-104%, -104%); }
.intro.split .q2 { transform: translate(104%, -104%); }
.intro.split .q3 { transform: translate(-104%, 104%); }
.intro.split .q4 { transform: translate(104%, 104%); }
.intro-tile { position: absolute; left: 50%; top: 50%; width: 104px; height: 104px; margin: -52px 0 0 -52px;
  border-radius: 30px; background: var(--green); display: grid; place-items: center;
  box-shadow: 0 24px 60px rgba(11, 122, 83, .35);
  animation: introTile .65s var(--spring) both, introTileBg .3s ease .4s forwards;
  transition: transform .8s cubic-bezier(.6, 0, .2, 1), opacity .45s ease .2s; }
.intro-tile svg { width: 54px; height: 54px; fill: #fff; animation: introPulse .5s ease .62s; }
@keyframes introTile { from { transform: scale(.15) rotate(-90deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes introTileBg { to { box-shadow: 0 0 0 rgba(11, 122, 83, 0); } }
@keyframes introPulse { 50% { transform: scale(1.18); } }
.intro.split .intro-tile { transform: scale(2.6) rotate(90deg); opacity: 0; }
.intro.split { cursor: default; pointer-events: none; }

/* Страница под заставкой: проявляется, когда квадраты расходятся */
.intro-pending main, .intro-pending .top { opacity: 0; transform: scale(.965); }
.intro-reveal main, .intro-reveal .top { transition: opacity .7s var(--ease), transform .9s var(--ease); }
.intro-pending .auth-card.enter, .intro-pending .auth-card .logo { animation: none; }
@media (prefers-reduced-motion: reduce) { .intro { display: none; } .intro-pending main, .intro-pending .top { opacity: 1; transform: none; } }

/* ================= PWA: плашка установки ================= */
.install { position: fixed; z-index: 55; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom));
  max-width: 560px; margin: 0 auto; display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 14px;
  background: #fff; border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 18px 44px rgba(11, 60, 40, .18);
  animation: installIn .55s var(--spring) both; }
.install.leave { animation: installOut .25s ease forwards; }
@keyframes installIn { from { opacity: 0; transform: translateY(120%); } to { opacity: 1; transform: none; } }
@keyframes installOut { to { opacity: 0; transform: translateY(120%); } }
.install-ico { width: 46px; height: 46px; border-radius: 14px; background: var(--green); display: grid; place-items: center; flex-shrink: 0; }
.install-ico svg { width: 24px; height: 24px; fill: #fff; }
.install-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.install-text b { font-size: 15px; font-weight: 800; }
.install-text span { font-size: 13px; font-weight: 600; color: var(--muted); line-height: 1.35; }
.install-text span b { font-size: 13px; color: var(--ink); }
.install-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.install .btn-sm { height: 40px; }

/* Приложение открыто с рабочего стола телефона */
@media (display-mode: standalone) {
  .top { padding-top: env(safe-area-inset-top); }
  body { overscroll-behavior-y: none; }
}
@media (max-width: 480px) {
  .install:not(.ios) { flex-wrap: wrap; }
  .install:not(.ios) .install-text { flex: 1 1 calc(100% - 60px); }
  .install:not(.ios) .install-actions { flex-basis: 100%; }
  .install:not(.ios) #install-btn { flex: 1 1 auto; }
}
