/* COSMOdesk — рабочая версия (из прототипа v4 (22.11.26): серый фон, белые карточки, чёрные главные кнопки, синий для мелких действий, яркий лаймовый акцент; Manrope */

@font-face { font-family: "Manrope"; src: url("assets/fonts/Manrope-400.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("assets/fonts/Manrope-500.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("assets/fonts/Manrope-600.ttf") format("truetype"); font-weight: 600 700; font-display: swap; }

:root {
  --bg: #F2F2F5;
  --surface: #FFFFFF;
  --fill: #E7E7EC;
  --line: #E3E3E8;
  --line-2: #C7C7CE;
  --muted: #8E8E96;
  --text-2: #6B6B73;
  --ink: #111113;
  --primary: #111113;
  --on-primary: #FFFFFF;
  --link: #0A84FF;
  /* яркий лаймовый акцент: главная карточка, сегодня, подтверждённые записи; текст на нём — чёрный */
  --accent: #C6F04F;
  --accent-soft: #EEFBCB;
  --accent-strong: #9BD21C;
  --accent-ink: #18210A;
  --danger: #E5483D;
  --danger-bg: #FDECEB;
  --ok: #23936A;
  --ok-bg: #E3F3EC;

  --st-planned: #C7C7CE;
  --st-confirmed: var(--accent-strong);
  --st-done: #111113;
  --st-cancelled: #E3E3E8;
  --st-noshow: #E5483D;

  --r-card: 22px;
  --r-btn: 28px;
  --r-sheet: 30px;
  --gap: 16px;

  --display: "Manrope", -apple-system, "SF Pro Display", system-ui, sans-serif;
  --sans: "Manrope", -apple-system, "SF Pro Text", system-ui, sans-serif;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bot: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.4;
  color: var(--ink);
  background: #DEDEE4;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea { outline: none; }
svg.i { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.i.s { width: 18px; height: 18px; }
svg.i.xs { width: 15px; height: 15px; }

/* ---------- устройство на компьютере, полный экран на телефоне ---------- */
.stage { min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 16px; }
.device {
  width: 390px; height: 844px; border-radius: 52px; background: var(--ink); padding: 10px; flex: none;
}
.app {
  position: relative; width: 100%; height: 100%; overflow: hidden;
  background: var(--bg); border-radius: 42px; display: flex; flex-direction: column;
}
.statusbar { height: 46px; flex: none; display: flex; align-items: center; justify-content: space-between; padding: 6px 30px 0 34px; font-weight: 600; font-size: 15px; position: relative; z-index: 6; }
.statusbar .notch { position: absolute; left: 50%; top: 10px; width: 120px; height: 34px; border-radius: 20px; background: var(--ink); transform: translateX(-50%); }
.statusbar .sb-right { display: flex; gap: 6px; align-items: center; }
.statusbar .bat { width: 25px; height: 12px; border-radius: 4px; border: 1.5px solid var(--ink); position: relative; }
.statusbar .bat::after { content: ""; position: absolute; inset: 1.5px 5px 1.5px 1.5px; background: var(--ink); border-radius: 1.5px; }

@media (max-width: 500px) {
  body { background: var(--bg); }
  .stage { padding: 0; height: 100dvh; }
  .device { width: 100%; height: 100%; border-radius: 0; padding: 0; background: var(--bg); }
  .app { border-radius: 0; padding-top: var(--safe-top); }
  .statusbar { display: none; }
}

/* ---------- экраны ---------- */
.screens { flex: 1; position: relative; overflow: hidden; }
.screen {
  position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; padding: 4px 16px calc(120px + var(--safe-bot));
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.screen::-webkit-scrollbar { display: none; }
.screen.pushed { background: var(--bg); z-index: 3; animation: push .32s cubic-bezier(.2,.8,.2,1); }
@keyframes push { from { transform: translateX(100%); } to { transform: none; } }

.bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; min-height: 44px; margin: 2px 0 14px; }
.bar .bl, .bar .br { display: flex; align-items: center; gap: 8px; min-width: 0; }
.bar .br { justify-content: flex-end; }
.bar .avatar, .top .avatar { background: var(--surface); color: var(--ink); }
.ptitle { height: 44px; padding: 0 20px; border-radius: 22px; background: var(--surface); display: flex; align-items: center; font-size: 17px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; }
.monthnav { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--text-2); margin: -4px 0 6px; }
.monthnav button { width: 32px; height: 32px; display: grid; place-items: center; color: var(--muted); }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; margin-bottom: 6px; }
.h1 { font-family: var(--display); font-weight: 700; font-size: 30px; line-height: 1.1; letter-spacing: -.025em; margin: 6px 0 18px; }
.h2 { font-size: 18px; font-weight: 600; letter-spacing: -.01em; margin: 30px 0 12px; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.h2 small { font-size: 14px; font-weight: 500; color: var(--text-2); }
.muted { color: var(--text-2); }
.t13 { font-size: 13px; font-weight: 500; }

.iconbtn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: var(--ink); background: var(--surface); flex: none; }
.iconbtn.ghost { background: transparent; }
.avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--fill); display: grid; place-items: center; font-weight: 600; font-size: 15px; color: var(--text-2); flex: none; }
.avatar.sm { width: 40px; height: 40px; font-size: 14px; }
.avatar.lg { width: 64px; height: 64px; font-size: 22px; background: var(--surface); }

.card { background: var(--surface); border-radius: var(--r-card); padding: 16px; }
.card + .card { margin-top: 10px; }
.cream { background: var(--fill); }

.btn {
  height: 54px; border-radius: var(--r-btn); padding: 0 20px; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-weight: 600; font-size: 16px; background: var(--primary); color: var(--on-primary); width: 100%; white-space: nowrap; transition: background .2s;
}
.btn:active { background: #3A3A40; }
.btn.second { background: var(--surface); color: var(--ink); }
.btn.second:active { background: var(--fill); }
.btn.danger { background: transparent; color: var(--danger); height: 48px; }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* сегменты — лёгкие, не как главные кнопки */
.seg { display: flex; background: var(--fill); border-radius: 22px; padding: 4px; gap: 2px; }
.seg button { flex: 1; height: 36px; border-radius: 18px; font-size: 14px; font-weight: 600; color: var(--text-2); white-space: nowrap; transition: background .2s, color .2s; }
.seg button.on { background: var(--surface); color: var(--ink); }

.chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px; padding: 0 16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { height: 38px; padding: 0 16px; border-radius: 19px; background: var(--fill); font-size: 14px; font-weight: 600; color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; flex: none; }
.chip.on { background: var(--link); color: #FFFFFF; }

.search { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 16px; border-radius: 24px; background: var(--surface); color: var(--text-2); }
.search input { flex: 1; border: 0; background: transparent; font-size: 16px; color: var(--ink); min-width: 0; }
.search input::placeholder { color: var(--muted); }

.row { display: flex; align-items: center; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.h1, .sheet-head h3, .hero-num, .big-stock b, .brand { font-feature-settings: "lnum" 1, "pnum" 1; font-variant-numeric: lining-nums; }
.ell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.list { background: var(--surface); border-radius: var(--r-card); }
.li { display: flex; align-items: center; gap: 12px; padding: 14px 16px; width: 100%; text-align: left; position: relative; }
.li + .li::before { content: ""; position: absolute; left: 16px; right: 16px; top: 0; height: 1px; background: var(--line); }
.li .t { font-weight: 600; font-size: 15px; }
.li .s { font-size: 13px; font-weight: 500; color: var(--text-2); margin-top: 2px; }
.li .r { text-align: right; font-size: 14px; font-weight: 600; white-space: nowrap; }
.li .r .s { font-weight: 500; }
.li .r.cl { max-width: 44%; }
.li .r.cl .s { overflow: hidden; text-overflow: ellipsis; }
.li > svg.i:last-child { color: var(--line-2); }

.badge { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 10px; border-radius: 12px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--fill); color: var(--text-2); }
.badge.warn { background: var(--danger-bg); color: var(--danger); }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.dark { background: var(--primary); color: var(--on-primary); }

/* ---------- нижняя навигация ---------- */
.tabbar {
  position: absolute; left: 10px; right: 10px; bottom: calc(10px + var(--safe-bot)); z-index: 5;
}
.device .tabbar { bottom: 20px; }
.tabbar .pill {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); padding: 5px; border-radius: 34px;
  background: rgba(255, 255, 255, .92); -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid var(--line);
}
/* выбор — горизонтальный овал на всю ширину пункта: подпись помещается целиком */
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 0; height: 56px; padding: 0 2px;
  border-radius: 28px; color: #3A3A40; transition: background .2s, color .2s;
}
.tab svg.i { width: 25px; height: 25px; }
.tab span { font-size: 11px; font-weight: 600; line-height: 1.1; letter-spacing: -.02em; white-space: nowrap; }
.tab.on { color: var(--ink); background: var(--fill); }
.tab-add { width: 66px; height: 66px; border-radius: 50%; background: var(--primary); color: var(--on-primary); display: grid; place-items: center; flex: none; }
.tab-add svg.i { width: 26px; height: 26px; }

/* ---------- шторки ---------- */
.scrim { position: absolute; inset: 0; background: rgba(20, 22, 27, .32); z-index: 10; opacity: 0; transition: opacity .28s; display: none; }
.scrim.show { opacity: 1; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 11; max-height: calc(100% - 54px);
  background: var(--bg); border-radius: var(--r-sheet) var(--r-sheet) 0 0; display: flex; flex-direction: column;
  transform: translateY(100%); transition: transform .34s cubic-bezier(.2,.8,.2,1);
}
.sheet.show { transform: none; }
.sheet.full { height: calc(100% - 54px); }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line-2); margin: 8px auto 2px; flex: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 16px 10px; flex: none; }
.sheet-head h3 { font-family: var(--display); font-weight: 700; font-size: 22px; line-height: 1.15; letter-spacing: -.02em; margin: 0; }
.sheet-body { overflow-y: auto; padding: 4px 16px 24px; flex: 1; scrollbar-width: none; }
.sheet-body::-webkit-scrollbar { display: none; }
.sheet-foot { padding: 12px 16px calc(16px + var(--safe-bot)); flex: none; background: var(--bg); border-top: 1px solid var(--line); }
.device .sheet-foot { padding-bottom: 30px; }

.field { margin-bottom: 18px; }
.field > label, .lbl { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 8px; }
.input { height: 50px; border-radius: 14px; background: var(--surface); border: 0; padding: 0 14px; width: 100%; font-size: 16px; display: flex; align-items: center; gap: 10px; }
textarea.input { height: 88px; padding: 14px; resize: none; }
.input-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.stepper { display: flex; align-items: center; background: var(--surface); border-radius: 14px; height: 50px; }
.stepper button { width: 48px; height: 50px; display: grid; place-items: center; color: var(--link); }
.stepper span { flex: 1; text-align: center; font-weight: 600; font-size: 16px; white-space: nowrap; }

.notice { display: flex; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--danger-bg); color: var(--danger); font-size: 14px; font-weight: 600; line-height: 1.35; }
.notice.calm { background: var(--fill); color: var(--text-2); }

/* ---------- вход ---------- */
.lock { position: absolute; inset: 0; z-index: 20; background: var(--bg); display: flex; flex-direction: column; align-items: center; padding: 120px 32px 60px; transition: opacity .4s, transform .4s; }
.lock.hide { opacity: 0; transform: scale(1.04); pointer-events: none; }
.brand { font-family: var(--display); font-size: 30px; font-weight: 700; letter-spacing: -.035em; line-height: 1; display: flex; align-items: center; gap: 10px; }
.brand .mark { width: 38px; height: 38px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-size: 19px; letter-spacing: -.04em; }
.brand b { font-weight: 700; color: var(--muted); }
.lock .hello { margin-top: 14px; color: var(--text-2); font-weight: 500; }
.dots { display: flex; gap: 16px; margin: 54px 0 40px; }
.dots i { width: 13px; height: 13px; border-radius: 50%; background: var(--line); transition: background .15s; }
.dots i.on { background: var(--primary); }
.pad { display: grid; grid-template-columns: repeat(3, 76px); gap: 16px 26px; }
.pad button { width: 76px; height: 76px; border-radius: 50%; background: var(--surface); font-size: 28px; font-weight: 500; }
.pad button:active { background: var(--fill); }
.pad .ghost { background: transparent; display: grid; place-items: center; color: var(--text-2); }
.lock .faceid { white-space: nowrap; margin-top: auto; display: flex; align-items: center; gap: 8px; color: var(--text-2); font-weight: 600; font-size: 14px; }

/* ---------- расписание ---------- */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; margin: 0 0 12px; background: var(--surface); border-radius: var(--r-card); padding: 10px 6px; }
.wd { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 2px 0 4px; color: var(--muted); position: relative; }
.wd small { font-size: 12px; font-weight: 600; }
.wd b { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-size: 18px; font-weight: 600; color: var(--ink); }
.wd.on b { background: var(--primary); color: var(--on-primary); }
.wd.today:not(.on) b { box-shadow: inset 0 0 0 2px var(--accent-strong); }
.wd .load { display: flex; gap: 2px; height: 4px; }
.wd .load i { width: 4px; height: 4px; border-radius: 50%; background: var(--line-2); }

.daysum { display: grid; grid-template-columns: repeat(3, 1fr); margin-bottom: 18px; background: var(--accent); color: var(--accent-ink); border-radius: var(--r-card); padding: 16px 18px; }
.daysum .card { background: none; padding: 0; border-radius: 0; }
.daysum .card + .card { margin: 0; }
.daysum b { display: block; font-size: 18px; font-weight: 700; white-space: nowrap; letter-spacing: -.01em; }
.daysum span { font-size: 12px; font-weight: 600; opacity: .7; }

.timeline { position: relative; margin-left: 46px; }
.hour { height: 96px; position: relative; border-top: 1px solid var(--line); }
.hour > span { position: absolute; left: -46px; top: -9px; font-size: 12px; font-weight: 600; color: var(--muted); }
.appt {
  position: absolute; left: 6px; right: 0; border-radius: 12px; padding: 7px 12px 7px 14px; overflow: hidden; text-align: left;
  background: var(--surface); display: flex; flex-direction: column; justify-content: center; gap: 1px;
}
.appt::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c, var(--st-planned)); }
.appt .a1 { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; font-weight: 600; }
.appt .a2 { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.appt .a1 span:first-child, .appt .a2 span:first-child { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.appt .a1 span:last-child, .appt .a2 span:last-child { flex: none; }
.appt.planned { --c: var(--st-planned); }
.appt.confirmed { --c: var(--st-confirmed); background: var(--accent-soft); }
.appt.done { --c: var(--st-done); }
.appt.cancelled { --c: var(--st-cancelled); background: transparent; border: 1px solid var(--line); color: var(--muted); }
.appt.cancelled .a1 span:first-child { text-decoration: line-through; }
.appt.noshow { --c: var(--st-noshow); background: var(--danger-bg); }
.free {
  position: absolute; left: 6px; right: 0; border-radius: 12px; border: 1.5px dashed var(--line-2);
  display: flex; align-items: center; gap: 8px; padding: 0 14px; font-size: 13px; font-weight: 600; color: var(--text-2);
}
.nowline { position: absolute; left: -6px; right: 0; height: 2px; background: var(--danger); z-index: 2; }
.nowline::before { content: ""; position: absolute; left: -4px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); }

.legend { display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 18px 0 0; font-size: 12px; font-weight: 600; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; }

.weeklist .day { background: var(--surface); border-radius: var(--r-card); padding: 14px 16px; margin-bottom: 10px; display: block; width: 100%; text-align: left; }

.weeklist .dh { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.weeklist .dh b { font-size: 16px; font-weight: 600; }
.weeklist .dh span { font-size: 13px; font-weight: 600; color: var(--text-2); }
.weeklist .slots { display: flex; flex-wrap: wrap; gap: 6px; }
.weeklist .slot { font-size: 12.5px; font-weight: 600; padding: 5px 9px 5px 11px; border-radius: 8px; position: relative; overflow: hidden; background: var(--fill); white-space: nowrap; }
.weeklist .slot::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--c); }
.weeklist .empty { font-size: 13px; color: var(--muted); font-weight: 500; }

.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.month .wh { text-align: center; font-size: 12px; font-weight: 600; color: var(--muted); padding: 4px 0 8px; }
.mday { height: 70px; min-width: 0; border-radius: 12px; background: var(--surface); display: flex; flex-direction: column; align-items: center; padding-top: 8px; gap: 6px; font-weight: 600; font-size: 15px; }
.mday.out { background: transparent; color: var(--line-2); }
.mday.today { background: var(--primary); color: var(--on-primary); }
.mday .bars { display: flex; flex-direction: column; gap: 2px; width: 60%; }
.mday .bars i { height: 3px; border-radius: 2px; background: var(--line-2); }
.mday.today .bars i { background: var(--muted); }
.mday .sum { font-size: 10.5px; font-weight: 600; color: var(--text-2); margin-top: auto; padding-bottom: 6px; }
.mday.today .sum { color: var(--line-2); }

/* ---------- клиенты ---------- */
.client-head { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; margin: 6px 0 18px; }
.client-head .h1 { margin: 0; }
.contacts { display: flex; gap: 8px; width: 100%; }
.contacts button, .contacts a { flex: 1; height: 48px; border-radius: 14px; background: var(--surface); display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 14px; font-weight: 600; white-space: nowrap; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.stats .card { padding: 12px 12px 14px; }
.stats .card + .card { margin: 0; }
.stats b { display: block; font-size: 17px; font-weight: 600; white-space: nowrap; }
.stats span { font-size: 12px; font-weight: 500; color: var(--text-2); }
.health { background: var(--surface); border-radius: var(--r-card); padding: 16px; }
.health .hrow { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; font-weight: 500; }
.health .hrow + .hrow { margin-top: 10px; }
.health .hrow.warn { color: var(--danger); font-weight: 600; }

.tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line); margin: 26px 0 16px; }
.tabs button { padding: 10px 0 12px; font-weight: 600; font-size: 15px; color: var(--muted); position: relative; }
.tabs button.on { color: var(--ink); }
.tabs button.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--primary); border-radius: 2px; }

.proc { background: var(--surface); border-radius: var(--r-card); padding: 16px; margin-bottom: 10px; }
.proc .ph { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.proc .ph b { font-size: 16px; font-weight: 600; }
.proc .date { font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 4px; }
.proc .zone { font-size: 14px; color: var(--text-2); font-weight: 500; margin-top: 2px; }
.drugs { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.drug { display: flex; gap: 10px; align-items: center; font-size: 14px; font-weight: 500; background: var(--bg); border-radius: 10px; padding: 9px 12px; }
.drug .grow { flex: 1; min-width: 0; }
.drug .lot { font-size: 12px; color: var(--muted); font-weight: 600; }
.drug b { font-weight: 600; white-space: nowrap; }
.proc .pf { display: flex; justify-content: space-between; margin-top: 12px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.proc .thumbs { display: flex; gap: 6px; margin-top: 12px; }
.proc .thumbs .ph-img { width: 56px; height: 56px; border-radius: 10px; }

.ph-img { position: relative; border-radius: 12px; overflow: hidden; background: var(--line); }
.ph-img .face { position: absolute; inset: 0; }
.ph-img .tag { position: absolute; left: 8px; bottom: 8px; background: rgba(255,255,255,.92); color: var(--ink); font-size: 11px; font-weight: 700; padding: 3px 7px; border-radius: 7px; }
.ph-img.small .tag { display: none; }
.gallery-day { margin-bottom: 22px; }
.gallery-day .gd-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.gallery-day .gd-head b { font-size: 15px; font-weight: 600; }
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.gallery .ph-img { aspect-ratio: .8; }

/* сравнение до / после */
.compare { position: relative; aspect-ratio: .8; border-radius: 16px; overflow: hidden; touch-action: none; user-select: none; }
.compare .layer { position: absolute; inset: 0; }
.compare .tag { display: none; }
.compare .after { clip-path: inset(0 0 0 var(--x, 50%)); }
.compare .handle { position: absolute; top: 0; bottom: 0; left: var(--x, 50%); width: 2px; background: var(--bg); transform: translateX(-1px); }
.compare .handle i { position: absolute; top: 50%; left: 50%; width: 40px; height: 40px; border-radius: 50%; background: var(--bg); transform: translate(-50%, -50%); display: grid; place-items: center; color: var(--primary); }
.compare .cl { position: absolute; top: 12px; font-size: 12px; font-weight: 700; background: rgba(255,255,255,.92); padding: 4px 8px; border-radius: 8px; }

/* ---------- финансы ---------- */
.hero-num { font-family: var(--display); font-weight: 700; font-size: 40px; line-height: 1; letter-spacing: -.035em; white-space: nowrap; }
.hero-num small { font-size: 30px; color: inherit; opacity: .6; }
.card.hero { background: var(--accent); color: var(--accent-ink); }
.card.hero .muted, .card.hero .delta { color: var(--accent-ink); }
.delta { font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.delta.up { color: var(--ok); }
.delta.down { color: var(--danger); }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.kpis .card { padding: 14px; }
.kpis .card + .card { margin: 0; }
.kpis span { display: block; font-size: 13px; font-weight: 500; color: var(--text-2); margin-bottom: 4px; }
.kpis b { font-size: 19px; font-weight: 600; white-space: nowrap; letter-spacing: -.01em; }

.chart { width: 100%; display: block; }
.chart text { font-family: var(--sans); font-size: 11px; font-weight: 600; fill: var(--muted); }
.chart-legend { display: flex; gap: 16px; font-size: 12px; font-weight: 600; color: var(--text-2); margin-top: 10px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 10px; height: 10px; border-radius: 3px; }

.donut-wrap { display: flex; gap: 18px; align-items: center; }
.donut-wrap svg { width: 132px; height: 132px; flex: none; }
.donut-legend { flex: 1; display: flex; flex-direction: column; gap: 8px; font-size: 13px; font-weight: 500; }
.donut-legend div { display: flex; align-items: center; gap: 8px; }
.donut-legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.donut-legend b { margin-left: auto; font-weight: 600; white-space: nowrap; }

.hbar { margin-bottom: 14px; }
.hbar:last-child { margin-bottom: 0; }
.hbar .hl { display: flex; justify-content: space-between; font-size: 14px; font-weight: 600; margin-bottom: 6px; gap: 10px; }
.hbar .hl span:last-child { color: var(--text-2); white-space: nowrap; }
.hbar .track { height: 8px; border-radius: 4px; background: var(--fill); overflow: hidden; display: flex; }
.hbar .track i { display: block; height: 100%; }

.op-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--fill); color: var(--text-2); }
.op-ic.in { background: var(--ok-bg); color: var(--ok); }
.plus { color: var(--ok); }

/* ---------- склад ---------- */
.alert-card { background: var(--danger-bg); border-radius: var(--r-card); padding: 16px; color: var(--danger); }
.alert-card .ah { display: flex; gap: 10px; align-items: center; font-weight: 600; font-size: 15px; margin-bottom: 10px; }
.alert-card .al { display: flex; flex-wrap: wrap; gap: 6px; }
.alert-card .al span { background: var(--bg); color: var(--ink); font-size: 13px; font-weight: 600; padding: 6px 10px; border-radius: 9px; white-space: nowrap; }
.stock-ic { width: 44px; height: 44px; border-radius: 12px; background: var(--fill); display: grid; place-items: center; color: var(--text-2); flex: none; }
.lvl { display: flex; gap: 3px; margin-top: 6px; }
.lvl i { width: 14px; height: 4px; border-radius: 2px; background: var(--line); }
.lvl i.f { background: var(--muted); }
.lvl.low i.f { background: var(--danger); }
.big-stock { display: flex; align-items: baseline; gap: 8px; }
.big-stock b { font-family: var(--display); font-size: 42px; font-weight: 700; line-height: 1; letter-spacing: -.035em; }
.batch { display: flex; align-items: center; gap: 12px; }
.mov { font-size: 14px; }

/* ---------- прайс по фото ---------- */
.drop { border: 1.5px dashed var(--line-2); border-radius: 18px; padding: 34px 20px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; color: var(--text-2); font-weight: 500; width: 100%; }
.drop .ic { width: 64px; height: 64px; border-radius: 20px; background: var(--fill); display: grid; place-items: center; color: var(--primary); }
.drop b { color: var(--ink); font-size: 16px; font-weight: 600; }
.scan { position: relative; border-radius: 18px; overflow: hidden; height: 220px; background: var(--surface); padding: 18px; }
.scan .ln { height: 9px; border-radius: 4px; background: var(--line); margin-bottom: 12px; }
.scan .beam { position: absolute; left: 0; right: 0; height: 60px; background: linear-gradient(to bottom, rgba(17,17,19,0), rgba(17,17,19,.1)); border-bottom: 2px solid var(--primary); animation: beam 1.3s ease-in-out infinite alternate; }
@keyframes beam { from { top: -40px; } to { top: 170px; } }
.check { width: 24px; height: 24px; border-radius: 8px; background: var(--line); display: grid; place-items: center; color: var(--on-primary); flex: none; }
.check.on { background: var(--primary); }

/* ---------- тосты ---------- */
.toast {
  position: absolute; left: 16px; right: 16px; top: 54px; z-index: 30; background: var(--primary); color: var(--on-primary);
  border-radius: 16px; padding: 14px 16px; display: flex; gap: 12px; align-items: flex-start; font-size: 14px; font-weight: 600; line-height: 1.35;
  transform: translateY(calc(-100% - 90px)); visibility: hidden; transition: transform .4s cubic-bezier(.2,.8,.2,1), visibility 0s .4s;
}
.toast.show { transform: none; visibility: visible; transition: transform .4s cubic-bezier(.2,.8,.2,1); }
.toast span { font-weight: 500; color: var(--line-2); display: block; margin-top: 2px; }
@media (max-width: 500px) { .toast { top: calc(10px + var(--safe-top)); } }

.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }
.sp { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.total-line { display: flex; justify-content: space-between; font-size: 15px; font-weight: 500; padding: 6px 0; }
.total-line b { font-weight: 600; white-space: nowrap; }
.total-line.big { font-size: 17px; font-weight: 600; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 12px; }
.mat { background: var(--surface); border-radius: var(--r-card); padding: 12px 12px 12px 14px; margin-bottom: 8px; }
.mat .mt { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.mat .mt b { font-size: 15px; font-weight: 600; }
.mat .mt .s { font-size: 12px; font-weight: 600; color: var(--muted); margin-top: 2px; }
.mat .mq { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.mini-step { display: flex; align-items: center; background: var(--fill); border-radius: 12px; height: 40px; }
.mini-step button { width: 40px; height: 40px; display: grid; place-items: center; }
.mini-step span { min-width: 64px; text-align: center; font-weight: 600; font-size: 14px; white-space: nowrap; }
.add-row { display: flex; align-items: center; justify-content: center; gap: 8px; height: 48px; border-radius: 14px; border: 1.5px dashed var(--line-2); color: var(--text-2); font-weight: 600; font-size: 14px; width: 100%; }
.photo-slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.photo-slot { aspect-ratio: .85; border-radius: 14px; border: 1.5px dashed var(--line-2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.photo-slot.filled { border: 0; padding: 0; overflow: hidden; }
.photo-slot.filled .ph-img { width: 100%; height: 100%; border-radius: 0; }


/* ---------- главная ---------- */
.home-top { display: flex; align-items: center; gap: 12px; margin: 4px 0 16px; }
.home-top .avatar { background: var(--surface); color: var(--ink); width: 48px; height: 48px; font-size: 17px; }
.home-top .hi { font-size: 18px; font-weight: 700; letter-spacing: -.015em; }
.hero-card {
  position: relative; display: block; width: 100%; text-align: left; overflow: hidden; border-radius: 28px; padding: 20px 20px 18px;
  background: var(--accent); color: var(--accent-ink);
}
.hero-card .hc-lbl { display: block; font-size: 15px; font-weight: 600; }
.hero-card .hc-num { display: block; font-size: 64px; font-weight: 700; line-height: 1; letter-spacing: -.04em; margin-top: 8px; }
.hero-card .hc-sub { display: block; font-size: 15px; font-weight: 600; margin-top: 2px; }
.hero-card .hc-pill { position: relative; display: inline-flex; align-items: center; height: 34px; padding: 0 14px; border-radius: 17px; background: rgba(255,255,255,.55); font-size: 14px; font-weight: 700; margin-top: 16px; white-space: nowrap; }
.hero-card .hc-prog { position: relative; display: flex; align-items: center; gap: 10px; margin-top: 14px; font-size: 13px; font-weight: 600; }
.hero-card .hc-prog .tr { flex: 1; height: 6px; border-radius: 3px; background: rgba(24,33,10,.12); overflow: hidden; }
.hero-card .hc-prog .tr i { display: block; height: 100%; border-radius: 3px; background: var(--accent-ink); }

.next { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; background: var(--surface); border-radius: var(--r-card); padding: 14px 16px; margin-top: 10px; }
.next .nt { flex: none; min-width: 62px; white-space: nowrap; }
.next .nt b { display: block; font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.next .nt span { font-size: 12px; font-weight: 600; color: var(--text-2); }
.next .t { font-weight: 600; font-size: 15px; }
.next .s { font-size: 13px; font-weight: 500; color: var(--text-2); margin-top: 2px; }
.next .go { width: 40px; height: 40px; border-radius: 50%; background: var(--primary); color: var(--on-primary); display: grid; place-items: center; flex: none; }
.next .live { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent-strong); margin-right: 5px; vertical-align: 1px; }

.widgets { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.widget { background: var(--surface); border-radius: var(--r-card); padding: 14px 16px 16px; text-align: left; display: flex; flex-direction: column; min-height: 128px; }
.widget .w-ic { width: 36px; height: 36px; border-radius: 50%; background: var(--fill); display: grid; place-items: center; margin-bottom: auto; }
.widget .w-l { font-size: 13px; font-weight: 600; color: var(--text-2); margin-top: 14px; }
.widget b { font-size: 21px; font-weight: 700; letter-spacing: -.02em; white-space: nowrap; margin-top: 2px; }
.widget .w-s { font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-top: 2px; }
.widget .w-s.up { color: var(--ok); }
.widget .w-s.warn { color: var(--danger); }
.widget.alert .w-ic { background: var(--danger-bg); color: var(--danger); }
.h2 .link { font-size: 14px; font-weight: 600; color: var(--link); }

/* ---------- календарь ---------- */
.calcard { background: var(--surface); border-radius: var(--r-card); padding: 12px 8px 6px; margin-bottom: 18px; }
.calcard .week { background: none; padding: 0 0 2px; margin: 0; border-radius: 0; }
.calcard .wd .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--line-2); }
.calcard .wd .dot.no { background: transparent; }
.calcard .wd.on .dot:not(.no) { background: var(--accent-strong); }
.cal-nav { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 0; }
.cal-nav .arr { width: 40px; height: 36px; display: grid; place-items: center; color: var(--muted); }
.cal-toggle { display: inline-flex; align-items: center; gap: 4px; height: 36px; padding: 0 10px; font-size: 14px; font-weight: 600; color: var(--text-2); }
.cal-toggle .i.up { transform: rotate(180deg); }
.calcard .month { padding: 0 2px 4px; gap: 2px; }
.calcard .mday { height: 50px; background: transparent; border-radius: 14px; padding-top: 7px; gap: 4px; }
.calcard .mday .sum { display: none; }
.calcard .mday.today { background: var(--primary); }

.dayhead { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 2px 10px; }
.dayhead b { font-size: 18px; font-weight: 700; letter-spacing: -.015em; }
.dayhead span { font-size: 13px; font-weight: 600; color: var(--text-2); }
.ev { position: relative; display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; background: var(--surface); border-radius: 20px; padding: 14px 16px 14px 18px; margin-bottom: 8px; }
.ev::before { content: ""; position: absolute; left: 7px; top: 14px; bottom: 14px; width: 4px; border-radius: 2px; background: var(--c, var(--line-2)); }
.ev .ev-t { width: 46px; flex: none; }
.ev .ev-t b { display: block; font-size: 16px; font-weight: 700; }
.ev .ev-t span { font-size: 12px; font-weight: 600; color: var(--muted); }
.ev .t { font-weight: 600; font-size: 15px; }
.ev .s { font-size: 13px; font-weight: 500; color: var(--text-2); margin-top: 2px; }
.ev .ev-r { font-size: 14px; font-weight: 600; white-space: nowrap; }
.ev.planned { --c: var(--st-planned); }
.ev.confirmed { --c: var(--st-confirmed); }
.ev.done { --c: var(--st-done); }
.ev.done .t, .ev.done .ev-t b, .ev.done .ev-r { color: var(--text-2); }
.ev.cancelled { --c: transparent; background: transparent; border: 1px dashed var(--line-2); }
.ev.cancelled .t { text-decoration: line-through; color: var(--muted); }
.ev.noshow { --c: var(--st-noshow); }
.ev.noshow .s { color: var(--danger); }
.freeslot { display: flex; align-items: center; gap: 8px; width: 100%; height: 40px; padding: 0 16px; margin-bottom: 8px; border-radius: 20px; font-size: 13px; font-weight: 600; color: var(--link); }
.freeslot .i { width: 16px; height: 16px; }
.nowmark { display: flex; align-items: center; gap: 8px; margin: 2px 0 10px; font-size: 12px; font-weight: 700; color: var(--danger); }
.nowmark::after { content: ""; flex: 1; height: 2px; border-radius: 1px; background: var(--danger); }
.dayempty { text-align: center; padding: 18px 12px 8px; }
.dayempty svg { width: 150px; height: 130px; }
.dayempty b { display: block; font-size: 20px; font-weight: 700; margin-top: 8px; }
.dayempty p { margin: 6px 0 18px; color: var(--text-2); font-weight: 500; }

/* ---------- рабочая версия: вход, формы, фото ---------- */
.login-form { width: 100%; max-width: 340px; display: flex; flex-direction: column; gap: 10px; margin-top: 40px; }
.login-form .input { background: var(--surface); }
.login-form .btn { margin-top: 6px; }
.login-form .btn:disabled { opacity: .6; }
.login-msg { min-height: 20px; text-align: center; font-size: 14px; font-weight: 600; color: var(--danger); }
.link-btn { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--link); position: relative; align-self: center; }
.date-hidden { position: absolute; inset: 0; opacity: 0; width: 100%; }
.ph-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.ph-img img:not([src]) { visibility: hidden; }
.photo-slot { cursor: pointer; position: relative; }
.hedit { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.hedit .input { flex: 1; min-width: 0; }
.hedit .check { width: 32px; height: 32px; border-radius: 10px; background: var(--fill); color: var(--muted); }
.hedit .check.on.warn { background: var(--danger-bg); color: var(--danger); }
.btn:disabled { opacity: .6; }
button.notice { border: 0; }
.health button.hrow { width: 100%; }
@media (max-width: 500px) {
  .device .tabbar { bottom: calc(8px + var(--safe-bot)); }
  .device .sheet-foot { padding-bottom: calc(16px + var(--safe-bot)); }
  .screen { padding-bottom: calc(110px + var(--safe-bot)); }
  .lock { padding-top: calc(90px + var(--safe-top)); }
}
.contacts a { color: inherit; text-decoration: none; }

/* ---------- код для входа ---------- */
.pinlock { z-index: 21; }
.pinlock .dots.shake { animation: shake .4s; }
.pinlock .dots i.on { background: var(--ink); }
.pinlock .pad .ghost { font-size: 15px; font-weight: 600; color: var(--text-2); }
@keyframes shake { 0%, 100% { transform: none; } 20%, 60% { transform: translateX(-10px); } 40%, 80% { transform: translateX(10px); } }
