/* Кератин-студия — интерфейс */

@font-face { font-family: "Prata"; font-weight: 400; font-display: swap;
  src: url(fonts/prata-cyrillic-400-normal.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Prata"; font-weight: 400; font-display: swap;
  src: url(fonts/prata-latin-400-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+20BD, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Golos"; font-weight: 400; font-display: swap;
  src: url(fonts/golos-text-cyrillic-400-normal.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Golos"; font-weight: 400; font-display: swap;
  src: url(fonts/golos-text-latin-400-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+20BD, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Golos"; font-weight: 500; font-display: swap;
  src: url(fonts/golos-text-cyrillic-500-normal.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Golos"; font-weight: 500; font-display: swap;
  src: url(fonts/golos-text-latin-500-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+20BD, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Golos"; font-weight: 600; font-display: swap;
  src: url(fonts/golos-text-cyrillic-600-normal.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Golos"; font-weight: 600; font-display: swap;
  src: url(fonts/golos-text-latin-600-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+20BD, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #F3F2F6;
  --side: #FBFAFC;
  --surface: #FFFFFF;
  --sunk: #F8F6FA;
  --ink: #231A2E;
  --ink-2: #554A61;
  --muted: #8A8194;
  --line: #E5E0EB;
  --line-2: #D8D1E1;
  --plum: #4E2161;
  --plum-hover: #5F2B75;
  --plum-soft: #EFE7F4;
  --plum-tint: #F7F2FA;
  --honey: #D99A3B;
  --honey-deep: #8A5A12;
  --honey-soft: #FBF1DF;
  --ok: #2C7A57;
  --ok-soft: #E4F3EB;
  --danger: #B3261E;
  --danger-soft: #FCEBE9;
  --warn: #9A6200;
  --warn-soft: #FFF4DA;
  --display: "Prata", Georgia, "Times New Roman", serif;
  --text: "Golos", "Segoe UI", system-ui, sans-serif;
  --r-xl: 26px;
  --r-lg: 18px;
  --r-md: 12px;
  --r-sm: 9px;
  --float: 0 14px 40px rgba(42, 23, 53, .16), 0 2px 6px rgba(42, 23, 53, .06);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.5 var(--text);
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
h1, h2, h3, h4, p { margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
svg.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--plum); outline-offset: 2px; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.num { text-align: right; white-space: nowrap; }
.nowrap { white-space: nowrap; }

/* ---------- каркас ---------- */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; background: linear-gradient(to right, var(--side) 247px, var(--line) 247px, var(--line) 248px, transparent 248px); }
.side {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 28px;
  padding: 22px 16px 18px;
  background: var(--side);
  border-right: 1px solid var(--line);
}
.side .nav a, .side .side-foot a { white-space: nowrap; }
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px; }
.brand img { border-radius: 10px; }
.brand span { font: 400 19px/1.2 var(--display); }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a, .side-foot a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 11px;
  color: var(--ink-2); font-weight: 500;
}
.nav a:hover, .side-foot a:hover { background: var(--plum-tint); color: var(--ink); }
.nav a.on, .side-foot a.on { background: var(--plum-soft); color: var(--plum); }
.side-foot { margin-top: auto; }

main { padding: 34px 44px 60px; min-width: 0; outline: none; }
.page { max-width: 1240px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; flex-wrap: wrap; }
.page-head h1 { font: 400 36px/1.15 var(--display); letter-spacing: -.01em; }
.page-head .sub { margin-top: 6px; color: var(--muted); }
.page-head .actions { display: flex; gap: 10px; flex-wrap: wrap; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 500; margin-bottom: 14px; }
.back:hover { color: var(--plum); }

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px;
  border: 1px solid transparent; border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink);
  font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.btn svg.i { width: 18px; height: 18px; }
.btn.primary { background: var(--plum); color: #fff; }
.btn.primary:hover { background: var(--plum-hover); }
.btn.honey { background: var(--honey); color: #2B1A06; }
.btn.honey:hover { background: #E2A64B; }
.btn.ghost { border-color: var(--line-2); background: var(--surface); }
.btn.ghost:hover { border-color: var(--plum); color: var(--plum); }
.btn.text { padding: 0 10px; background: transparent; color: var(--ink-2); }
.btn.text:hover { color: var(--plum); background: var(--plum-tint); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger-text { background: transparent; color: var(--danger); padding: 0 10px; }
.btn.danger-text:hover { background: var(--danger-soft); }
.btn.sm { height: 34px; padding: 0 12px; font-size: 14px; }
.btn:disabled { opacity: .55; cursor: default; }
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px;
  border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer;
}
.icon-btn:hover { background: var(--plum-tint); color: var(--plum); }
.icon-btn.danger:hover { background: var(--danger-soft); color: var(--danger); }

/* ---------- главная: две большие кнопки ---------- */
.home-date { font: 400 40px/1.1 var(--display); text-transform: none; }
.home-sub { color: var(--muted); margin-top: 6px; }
.big-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin: 28px 0 22px; }
.big {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 8px;
  min-height: 236px; padding: 30px 34px;
  border: 0; border-radius: var(--r-xl); text-align: left; cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
}
.big:hover { transform: translateY(-2px); }
.big:active { transform: translateY(0); }
.big .big-title { font: 400 58px/1 var(--display); letter-spacing: -.01em; }
.big .big-text { font-size: 16px; max-width: 32ch; }
.big .art { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; }
.big.service { background: linear-gradient(155deg, #64307D 0%, #45195A 55%, #34103F 100%); color: #fff; box-shadow: 0 18px 40px -18px rgba(62, 21, 82, .7); }
.big.service .big-text { color: rgba(255, 255, 255, .78); }
.big.service .art path { fill: none; stroke: #fff; stroke-linecap: round; transition: d .9s cubic-bezier(.2, .7, .2, 1); }
.big.sale { background: linear-gradient(155deg, #EDB45A 0%, #D99A3B 50%, #C3832A 100%); color: #2B1A06; box-shadow: 0 18px 40px -18px rgba(170, 110, 20, .7); }
.big.sale .big-text { color: rgba(43, 26, 6, .74); }
.big.sale .art path { fill: none; stroke: rgba(255, 255, 255, .5); stroke-width: 1.6; transition: transform .8s cubic-bezier(.2, .7, .2, 1); transform-box: fill-box; transform-origin: 50% 100%; }
.big.sale:hover .art path { transform: scale(1.06); }

.find-client { position: relative; margin-bottom: 30px; }
.find-client .search-input { height: 60px; font-size: 17px; padding-left: 54px; border-radius: 16px; }
.find-client .search-box { position: relative; }
.find-client .search-box svg.i { position: absolute; left: 20px; top: 20px; color: var(--muted); pointer-events: none; }
.find-label { display: block; font-weight: 500; margin-bottom: 8px; }

.home-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.home-grid > *, .client-grid > *, .day-layout > *, .rep-grid > * { min-width: 0; }

/* ---------- панели ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.panel.clip { overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px 12px; }
.panel-head h2 { font: 400 22px/1.2 var(--display); }
.panel-head .hint { color: var(--muted); font-size: 14px; }
.panel-body { padding: 4px 22px 20px; }
.empty { padding: 26px 22px 30px; color: var(--muted); text-align: center; }
.empty b { display: block; color: var(--ink-2); font-weight: 500; margin-bottom: 4px; }

.rem-list { list-style: none; margin: 0; padding: 0 10px 10px; }
.rem-list li a {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 14px; align-items: center;
  padding: 12px; border-radius: 12px;
}
.rem-list li a:hover { background: var(--sunk); }
.rem-name { font-weight: 600; }
.rem-meta { color: var(--muted); font-size: 14px; grid-column: 1; }
.rem-when { grid-row: 1 / span 2; grid-column: 2; text-align: right; font-size: 14px; }
.rem-when b { display: block; font-weight: 500; color: var(--ink); }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 13px; font-weight: 500; white-space: nowrap; }
.badge.late { background: var(--danger-soft); color: var(--danger); }
.badge.today { background: var(--honey-soft); color: var(--honey-deep); }
.badge.soon { background: var(--plum-soft); color: var(--plum); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.new { background: var(--honey-soft); color: var(--honey-deep); }

.totals { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 6px 0 12px; }
.totals > div { padding: 14px 4px; }
.totals > div + div { border-left: 1px solid var(--line); padding-left: 16px; }
.totals .t-label { color: var(--muted); font-size: 13px; }
.totals .t-val { font-size: 20px; font-weight: 600; }
.totals .t-sub { color: var(--muted); font-size: 13px; }

.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.feed li:last-child { border-bottom: 0; }
.feed .f-title { font-weight: 500; }
.feed .f-meta { color: var(--muted); font-size: 14px; }
.feed .f-sum { font-weight: 600; text-align: right; }
.feed a:hover .f-title { color: var(--plum); }

/* ---------- формы ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span, .field-label { font-size: 13.5px; font-weight: 500; color: var(--ink-2); }
.field > span em, .field-label em { font-style: normal; font-weight: 400; color: var(--muted); }
.input, .field input, .field textarea, .field select, .search-input {
  width: 100%; height: 46px; padding: 0 14px;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-sm);
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { height: auto; min-height: 64px; padding: 11px 14px; resize: vertical; line-height: 1.45; }
.input:focus, .field input:focus, .field textarea:focus, .field select:focus, .search-input:focus {
  outline: none; border-color: var(--plum); box-shadow: 0 0 0 3px var(--plum-soft);
}
.field input[readonly] { background: var(--sunk); color: var(--ink-2); }
.field input::placeholder, .field textarea::placeholder, .search-input::placeholder { color: #A89FB2; }
.field.invalid input, .field.invalid textarea { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.field .err { color: var(--danger); font-size: 13px; }
.field .help { color: var(--muted); font-size: 13px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px 18px; }
.span2 { grid-column: span 2; }
.span3 { grid-column: 1 / -1; }
.form-error { margin-top: 14px; padding: 11px 14px; border-radius: var(--r-sm); background: var(--danger-soft); color: var(--danger); font-weight: 500; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  height: 34px; padding: 0 13px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2);
  font-size: 14px; font-weight: 500; cursor: pointer;
}
.chip:hover { border-color: var(--plum); color: var(--plum); }
.chip.on { background: var(--plum); border-color: var(--plum); color: #fff; }
.date-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.date-row input { max-width: 190px; }
.date-row .rel { color: var(--muted); font-size: 14px; }

/* сегментный переключатель */
.seg { display: inline-flex; padding: 4px; gap: 4px; background: var(--sunk); border: 1px solid var(--line); border-radius: 12px; }
.seg button { height: 36px; padding: 0 16px; border: 0; border-radius: 9px; background: transparent; color: var(--ink-2); font-weight: 500; cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(42, 23, 53, .14); }

/* ---------- автодополнение ---------- */
.ac-host { position: relative; }
.ac {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 50;
  max-height: 330px; overflow: auto; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--float);
}
.ac-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; cursor: pointer; }
.ac-item.on { background: var(--plum-soft); }
.ac-item .ac-main { flex: 1; min-width: 0; }
.ac-item .ac-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-item .ac-sub { color: var(--muted); font-size: 13.5px; }
.ac-item .ac-side { color: var(--ink-2); font-size: 13.5px; text-align: right; white-space: nowrap; }
.ac-item .ac-side.warn { color: var(--danger); }
.ac-item.create .ac-title { color: var(--plum); }
.ac-note { padding: 8px 12px; color: var(--muted); font-size: 13px; }
mark { background: var(--honey-soft); color: inherit; border-radius: 3px; padding: 0 1px; }

.avatar {
  display: inline-grid; place-items: center; flex: none;
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--plum-soft); color: var(--plum); font-weight: 600; font-size: 14px;
}
.avatar.lg { width: 64px; height: 64px; font: 400 24px/1 var(--display); }

/* ---------- модальные окна ---------- */
.modal-wrap {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: start center; overflow: auto; padding: clamp(12px, 4vh, 48px) 20px;
  background: rgba(35, 26, 46, .42);
  animation: fade .16s ease;
}
.modal {
  width: 100%; max-width: 640px;
  background: var(--surface); border-radius: 22px; box-shadow: 0 30px 80px rgba(30, 12, 40, .35);
  animation: rise .2s cubic-bezier(.2, .7, .2, 1);
}
.modal.wide { max-width: 900px; }
.modal.narrow { max-width: 460px; }
.modal-wrap.closing { animation: fade .15s ease reverse forwards; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 22px 26px 6px; }
.modal-head h2 { font: 400 28px/1.2 var(--display); }
.modal-body { padding: 14px 26px 24px; }
.modal-foot {
  display: flex; align-items: center; gap: 10px; justify-content: flex-end;
  margin: 24px -26px -24px; padding: 16px 26px; border-top: 1px solid var(--line);
  background: var(--sunk); border-radius: 0 0 22px 22px;
}
.modal-foot .left { margin-right: auto; display: flex; align-items: center; gap: 10px; }
.modal-foot .grand { margin-right: auto; color: var(--ink-2); }
.modal-foot .grand b { color: var(--ink); font-size: 18px; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px) scale(.985); } }

.steps { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; color: var(--muted); font-weight: 500; font-size: 14px; }
.steps .st { display: inline-flex; align-items: center; gap: 8px; }
.steps .st i { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--line-2); font-style: normal; font-size: 13px; }
.steps .st.on { color: var(--ink); }
.steps .st.on i { background: var(--plum); border-color: var(--plum); color: #fff; }
.steps .st.done i { background: var(--plum-soft); border-color: var(--plum-soft); color: var(--plum); }
.steps .line { width: 34px; height: 1px; background: var(--line-2); }
.lead { color: var(--ink-2); margin-bottom: 18px; max-width: 68ch; }

.picked {
  display: flex; align-items: center; gap: 14px;
  margin-top: 16px; padding: 14px 16px; border-radius: 14px;
  background: var(--plum-tint); border: 1px solid var(--plum-soft);
}
.picked .p-main { flex: 1; min-width: 0; }
.picked .p-title { font-weight: 600; }
.picked .p-sub { color: var(--ink-2); font-size: 14px; }

.client-line { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 20px; border-radius: 14px; background: var(--sunk); border: 1px solid var(--line); }
.client-line .cl-main { flex: 1; min-width: 0; }
.client-line .cl-name { font-weight: 600; }
.client-line .cl-sub { color: var(--muted); font-size: 14px; }

.sales-block { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.sales-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.sales-head h3 { font: 400 22px/1.2 var(--display); }

.si-head, .si-row { display: grid; grid-template-columns: 1fr 132px 150px 36px; gap: 10px; align-items: start; }
.si-head { color: var(--muted); font-size: 13px; font-weight: 500; padding: 0 2px 6px; }
.si-row { margin-bottom: 10px; }
.si-row .si-meta { display: block; margin-top: 4px; font-size: 13px; color: var(--muted); min-height: 18px; }
.si-row .si-meta.warn { color: var(--danger); }
.si-row .si-meta.new { color: var(--honey-deep); }
.qty { display: flex; align-items: center; height: 46px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface); }
.qty:focus-within { border-color: var(--plum); box-shadow: 0 0 0 3px var(--plum-soft); }
.qty button { width: 36px; height: 100%; border: 0; background: transparent; color: var(--ink-2); font-size: 18px; cursor: pointer; border-radius: var(--r-sm); }
.qty button:hover { color: var(--plum); background: var(--plum-tint); }
.qty input { flex: 1; min-width: 0; height: 100%; border: 0 !important; box-shadow: none !important; text-align: center; padding: 0 !important; background: transparent; }
.qty input:focus { outline: none; }
.si-row .icon-btn { margin-top: 5px; }
.si-total { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }
.si-total b { font-size: 16px; }

/* ---------- таблицы ---------- */
.table-wrap { overflow: auto; }
table.t { width: 100%; border-collapse: collapse; }
.t th { text-align: left; font-size: 13px; font-weight: 500; color: var(--muted); padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface); position: sticky; top: 0; }
.t th .sort { padding: 0; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; white-space: nowrap; }
.t th .sort:hover, .t th .sort.on { color: var(--plum); }
.t td { padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr.link { cursor: pointer; }
.t tbody tr.link:hover td { background: var(--sunk); }
.t .strong { font-weight: 600; }
.t .sub { color: var(--muted); font-size: 13px; }
.t td.actions { width: 1%; white-space: nowrap; text-align: right; }
.stock { font-weight: 600; }
.stock.zero { color: var(--danger); }
.stock.low { color: var(--warn); }

.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .search-wrap { position: relative; flex: 1; min-width: 260px; max-width: 460px; }
.toolbar .search-wrap svg.i { position: absolute; left: 14px; top: 13px; color: var(--muted); }
.toolbar .search-wrap input { padding-left: 44px; }

.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 0; padding: 0 16px; }
.tabs button { height: 48px; padding: 0 14px; border: 0; background: transparent; color: var(--muted); font-weight: 500; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--plum); border-bottom-color: var(--plum); }
.period { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.period .custom { display: flex; gap: 6px; align-items: center; }
.period .custom input { height: 34px; width: 150px; padding: 0 10px; font-size: 14px; }

/* ---------- карточка клиента ---------- */
.client-head { display: flex; gap: 22px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; margin-bottom: 22px; }
.client-head .who { display: flex; gap: 18px; align-items: center; }
.client-head h1 { font: 400 40px/1.1 var(--display); }
.client-head .contacts { display: flex; gap: 6px 20px; flex-wrap: wrap; margin-top: 8px; color: var(--ink-2); }
.client-head .contacts span { display: inline-flex; align-items: center; gap: 6px; }
.client-head .contacts svg.i { width: 17px; height: 17px; color: var(--muted); }
.client-head .actions { display: flex; gap: 10px; flex-wrap: wrap; }

.facts { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); margin-bottom: 22px; }
.facts > div { padding: 16px 20px; }
.facts > div + div { border-left: 1px solid var(--line); }
.facts .f-label { color: var(--muted); font-size: 13px; }
.facts .f-val { font-size: 22px; font-weight: 600; margin-top: 2px; }
.facts .f-sub { color: var(--muted); font-size: 13px; }
.facts .next .f-val { display: flex; align-items: center; gap: 6px; }
.facts .next.late .f-val { color: var(--danger); }
.add-date {
  display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 12px 0 8px;
  border: 1px dashed var(--plum); border-radius: 999px; background: var(--plum-tint); color: var(--plum);
  font-size: 14px; font-weight: 500; cursor: pointer;
}
.add-date svg.i { width: 17px; height: 17px; }
.add-date:hover { background: var(--plum); color: #fff; border-style: solid; }

.client-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 22px; align-items: start; }
.timeline { list-style: none; margin: 0; padding: 4px 22px 14px; }
.tl-item { display: grid; grid-template-columns: 74px 1fr; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.tl-item:last-child { border-bottom: 0; }
.tl-num { text-align: center; }
.tl-num b { display: block; font: 400 34px/1 var(--display); color: var(--plum); }
.tl-num span { font-size: 12.5px; color: var(--muted); }
.tl-top { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.tl-title { font-weight: 600; font-size: 16.5px; }
.tl-price { font-weight: 600; white-space: nowrap; }
.tl-date { color: var(--muted); font-size: 14px; margin-top: 1px; }
.tl-note { margin-top: 10px; padding: 9px 12px; border-left: 3px solid var(--honey); background: var(--honey-soft); border-radius: 0 10px 10px 0; color: var(--ink-2); font-size: 14.5px; white-space: pre-wrap; }
.tl-items { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.tl-items span { padding: 4px 10px; border-radius: 999px; background: var(--sunk); border: 1px solid var(--line); font-size: 13.5px; color: var(--ink-2); }
.tl-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.tl-foot .tl-next { font-size: 13.5px; color: var(--muted); }
.tl-actions { display: flex; gap: 2px; opacity: .55; transition: opacity .15s; }
.tl-item:hover .tl-actions, .tl-actions:focus-within { opacity: 1; }

.buy-list { list-style: none; margin: 0; padding: 0 22px 16px; }
.buy-list li { display: grid; grid-template-columns: 1fr auto; gap: 0 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.buy-list li:last-child { border-bottom: 0; }
.buy-list .b-name { font-weight: 500; }
.buy-list .b-meta { color: var(--muted); font-size: 13.5px; }
.buy-list .b-sum { font-weight: 600; text-align: right; }
.note-box { padding: 0 22px 20px; color: var(--ink-2); white-space: pre-wrap; }

/* ---------- журнал ---------- */
.sumstrip { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); margin-bottom: 22px; }
.sumstrip > div { padding: 16px 20px; }
.sumstrip > div + div { border-left: 1px solid var(--line); }
.sumstrip .s-label { color: var(--muted); font-size: 13px; }
.sumstrip .s-val { font-size: 22px; font-weight: 600; }
.sumstrip .s-sub { color: var(--muted); font-size: 13px; }
.sumstrip .main .s-val { color: var(--plum); }
.day { margin-bottom: 18px; }
.day-head { display: flex; justify-content: space-between; align-items: baseline; padding: 0 4px 8px; }
.day-head h3 { font: 400 20px/1.2 var(--display); }
.day-head span { color: var(--ink-2); font-weight: 600; }
.entry { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: start; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.entry:last-child { border-bottom: 0; }
.entry .e-ico { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; }
.entry .e-ico.v { background: var(--plum-soft); color: var(--plum); }
.entry .e-ico.s { background: var(--honey-soft); color: var(--honey-deep); }
.entry .e-ico.p { background: var(--sunk); color: var(--muted); }
.entry .e-title { font-weight: 600; }
.entry .e-sub { color: var(--muted); font-size: 14px; }
.entry .e-sum { font-weight: 600; text-align: right; white-space: nowrap; }
.entry .e-sum.minus { color: var(--muted); font-weight: 500; }
.entry a:hover { color: var(--plum); }

/* ---------- уведомления ---------- */
#toasts { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 14px; background: var(--ink); color: #fff; font-weight: 500; box-shadow: var(--float); animation: rise .2s ease; }
.toast svg.i { color: #9BE0BC; }
.toast.err svg.i { color: #FFB4AB; }
.toast.out { opacity: 0; transform: translateY(6px); transition: .3s; }
#demoBar { position: relative; z-index: 90; padding: 8px 16px; text-align: center; font-size: 14px; font-weight: 500; background: var(--honey-soft); color: var(--honey-deep); border-bottom: 1px solid #F0DDB8; }
#offline { position: fixed; inset: auto 0 0 0; z-index: 300; padding: 14px; text-align: center; background: var(--danger); color: #fff; font-weight: 500; }

.settings-form { max-width: 640px; }
.settings-form .panel-body { display: grid; gap: 16px; padding-top: 6px; }
.path { font-family: Consolas, "Courier New", monospace; font-size: 13.5px; background: var(--sunk); padding: 8px 10px; border-radius: 8px; word-break: break-all; }

.loading { padding: 60px; text-align: center; color: var(--muted); }

/* ---------- общие мелочи ---------- */
.flip svg.i { transform: rotate(180deg); }
.linklike { padding: 0; border: 0; background: none; color: var(--plum); font: inherit; font-weight: 500; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.save-bar { margin-top: 16px; }
.nav .short { display: none; }
.nav .nav-settings-m { display: none; }
.badge svg.i { width: 14px; height: 14px; }
.badge.as-btn { border: 0; cursor: pointer; font: inherit; font-size: 13px; font-weight: 500; }
.badge.st-planned { background: var(--plum-soft); color: var(--plum); }
.badge.st-done { background: var(--ok-soft); color: var(--ok); }
.badge.st-cancelled, .badge.st-noshow { background: var(--danger-soft); color: var(--danger); }
.bye { padding: 80px 20px; text-align: center; font: 400 24px/1.4 var(--display); color: var(--ink-2); }
.sumstrip.five { grid-template-columns: repeat(5, 1fr); }

/* ---------- главная: записи, напоминания, дни рождения ---------- */
.appt-today { list-style: none; margin: 0; padding: 0 10px 10px; }
.appt-today li { display: flex; align-items: center; gap: 10px; padding: 4px 4px 4px 0; border-radius: 12px; }
.appt-today li + li { border-top: 1px dashed var(--line); }
.appt-main { flex: 1; display: flex; align-items: center; gap: 14px; min-width: 0; padding: 10px; border: 0; border-radius: 12px; background: none; text-align: left; cursor: pointer; }
.appt-main:hover { background: var(--sunk); }
.appt-time { display: flex; flex-direction: column; min-width: 56px; font-size: 18px; font-weight: 600; line-height: 1.1; color: var(--plum); }
.appt-time small { font-size: 12.5px; font-weight: 400; color: var(--muted); }
.appt-who { display: flex; flex-direction: column; min-width: 0; }
.appt-who b { font-weight: 600; }
.appt-who small { color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.appt-today li.st-done .appt-time, .appt-today li.st-noshow .appt-time { color: var(--muted); }
.appt-today li.st-noshow .appt-who b { text-decoration: line-through; color: var(--muted); }

.rem-list li { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px; border-radius: 12px; }
.rem-list li:hover { background: var(--sunk); }
.rem-list li a.rem-link { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px; min-width: 0; }
.rem-list li a.rem-link:hover { background: none; }
.rem-side { display: flex; align-items: center; gap: 6px; padding-right: 6px; }
.rem-btns { display: flex; gap: 0; }
.rem-btns .icon-btn { width: 34px; height: 34px; }

.bd-list { list-style: none; margin: 0; padding: 0 22px 14px; }
.bd-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; }
.bd-list li + li { border-top: 1px dashed var(--line); }
.bd-list a { display: flex; flex-direction: column; min-width: 0; }
.bd-list a b { font-weight: 600; }
.bd-list a small { color: var(--muted); font-size: 14px; }
.bd-list a:hover b { color: var(--plum); }

.booked-strip { display: flex; flex-wrap: wrap; gap: 10px; margin: -8px 0 20px; }
.booked { display: flex; align-items: center; gap: 12px; padding: 10px 16px 10px 12px; border: 1px solid var(--plum-soft); border-radius: 14px; background: var(--plum-tint); color: var(--plum); text-align: left; cursor: pointer; }
.booked:hover { border-color: var(--plum); }
.booked span { display: flex; flex-direction: column; }
.booked b { font-weight: 600; color: var(--ink); }
.booked small { color: var(--ink-2); font-size: 13.5px; }

/* ---------- запись: календарь ---------- */
.cal-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.cal-nav { display: flex; align-items: center; gap: 6px; }
.cal-title { margin-left: 8px; font: 400 22px/1.2 var(--display); }
.cal-page .page-head .sub { display: none; }

.month { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.month-head { display: grid; grid-template-columns: repeat(7, 1fr); border-bottom: 1px solid var(--line); }
.month-head span { padding: 10px 12px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.month-head span.off { color: var(--muted); }
.month-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.mday {
  position: relative; display: flex; flex-direction: column; gap: 4px; min-height: 112px; padding: 8px 10px 26px;
  border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface);
  text-align: left; cursor: pointer; font: inherit; color: inherit;
}
.mday:nth-child(7n) { border-right: 0; }
.mday:hover { background: var(--plum-tint); }
.mday-top { display: flex; align-items: center; justify-content: space-between; }
.mday-num { font-weight: 600; font-size: 15px; }
.mday.today .mday-num { display: inline-grid; place-items: center; width: 28px; height: 28px; margin: -3px 0 0 -5px; border-radius: 50%; background: var(--plum); color: #fff; }
.mday-bd { color: var(--honey-deep); }
.mday-bd svg.i { width: 16px; height: 16px; }
.mday-list { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mday-appt { font-size: 12.5px; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 1px 6px; border-radius: 6px; background: var(--plum-soft); color: var(--plum); }
.mday-appt.st-done { background: var(--ok-soft); color: var(--ok); }
.mday-appt.st-noshow { background: var(--danger-soft); color: var(--danger); text-decoration: line-through; }
.mday-more { font-size: 12px; color: var(--muted); padding-left: 6px; }
.mday-load { position: absolute; left: 10px; right: 10px; bottom: 7px; font-size: 12px; font-weight: 500; }
.mday-count { display: none; }
.mday.free .mday-load { color: var(--ok); }
.mday.part .mday-load { color: var(--ink-2); }
.mday.full .mday-load { color: var(--danger); }
.mday.free { box-shadow: inset 0 -3px 0 #9BD3B6; }
.mday.part { box-shadow: inset 0 -3px 0 #E0C9EA; }
.mday.full { box-shadow: inset 0 -3px 0 #E8A39C; }
.mday.off { background: repeating-linear-gradient(-45deg, var(--sunk), var(--sunk) 6px, #F2EFF5 6px, #F2EFF5 12px); }
.mday.off .mday-load { color: var(--muted); font-weight: 400; }
.mday.past { background: #FAF9FB; }
.mday.past .mday-num { color: var(--muted); }
.mday.other { opacity: .45; }
.cal-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 12px; color: var(--ink-2); font-size: 13.5px; }
.cal-legend .lg { display: inline-block; width: 22px; height: 10px; margin-right: -8px; border-radius: 3px; vertical-align: middle; }
.cal-legend .lg.free { background: #9BD3B6; }
.cal-legend .lg.part { background: #E0C9EA; }
.cal-legend .lg.full { background: #E8A39C; }
.cal-legend .lg.off { background: repeating-linear-gradient(-45deg, #E5E0EB, #E5E0EB 3px, #F6F4F8 3px, #F6F4F8 6px); }

.tgrid { display: grid; grid-template-columns: 56px 1fr; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.tg-hours { position: relative; margin-top: 54px; }
.tg-hour { position: absolute; right: 8px; transform: translateY(-50%); font-size: 12px; color: var(--muted); }
.tg-hour:first-child { transform: none; }
.tg-hour:last-child { transform: translateY(-100%); }
.tg-cols { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
.tg-col { border-left: 1px solid var(--line); min-width: 0; }
.tg-col.today .tg-head b { color: var(--plum); }
.tg-head { display: flex; flex-direction: column; justify-content: center; width: 100%; height: 54px; padding: 0 10px; border: 0; border-bottom: 1px solid var(--line); background: var(--surface); text-align: left; cursor: pointer; font: inherit; }
.tg-head:hover { background: var(--plum-tint); }
.tg-head b { font-weight: 600; }
.tg-head span { font-size: 12px; color: var(--muted); }
.tg-head span.free { color: var(--ok); }
.tg-head span.full { color: var(--danger); }
.tg-body { position: relative; cursor: copy; background-image: linear-gradient(to bottom, var(--line) 1px, transparent 1px); }
.tg-off { position: absolute; left: 0; right: 0; background: repeating-linear-gradient(-45deg, rgba(229, 224, 235, .45), rgba(229, 224, 235, .45) 6px, transparent 6px, transparent 12px); pointer-events: none; }
.tg-appt {
  position: absolute; display: flex; flex-direction: column; gap: 1px; overflow: hidden; padding: 5px 8px;
  border: 0; border-left: 3px solid var(--plum); border-radius: 8px; background: var(--plum-soft); color: var(--ink);
  text-align: left; cursor: pointer; font: inherit; font-size: 13px; line-height: 1.25;
}
.tg-appt:hover { filter: brightness(.97); box-shadow: 0 4px 12px rgba(42, 23, 53, .14); z-index: 2; }
.tg-appt.st-done { border-left-color: var(--ok); background: var(--ok-soft); }
.tg-appt.st-noshow { border-left-color: var(--danger); background: var(--danger-soft); text-decoration: line-through; color: var(--ink-2); }
.tg-appt.short { flex-direction: row; gap: 6px; align-items: center; padding: 2px 8px; }
.tg-time { font-weight: 600; font-size: 12px; color: var(--plum); white-space: nowrap; }
.tg-appt.st-done .tg-time { color: var(--ok); }
.tg-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tg-proc { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tg-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--danger); z-index: 3; pointer-events: none; }
.tg-now::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }

.day-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr); gap: 22px; align-items: start; }
.day-side .empty { padding: 4px 22px 18px; text-align: left; }
.gap-list { list-style: none; margin: 0; padding: 0 22px 14px; }
.gap-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; }
.gap-list li + li { border-top: 1px dashed var(--line); }
.gap-list span { display: flex; flex-direction: column; }
.gap-list small { color: var(--muted); }
.day-feed { padding: 0 22px 16px; }
.day-feed li { cursor: pointer; }
.day-feed li:hover .f-title { color: var(--plum); }
.day-feed li.st-cancelled .f-title, .day-feed li.st-noshow .f-title { text-decoration: line-through; color: var(--muted); }

.appt-info { display: grid; grid-template-columns: 120px 1fr; gap: 10px 14px; margin: 0 0 18px; }
.appt-info dt { color: var(--muted); }
.appt-info dd { margin: 0; font-weight: 500; }
.appt-actions { display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
.appt-actions .btn { justify-content: flex-start; }

/* ---------- отчёты ---------- */
.chart-panel { margin-bottom: 22px; }
.chart-legend { display: flex; align-items: center; gap: 16px; font-size: 14px; color: var(--ink-2); }
.chart-legend span { display: inline-flex; align-items: center; gap: 7px; }
.chart-legend i, .ch-tip i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.chart { position: relative; }
.chart svg { display: block; }
.ch-axis { font-size: 12px; fill: var(--muted); font-family: var(--text); }
.ch-val { font-size: 12.5px; font-weight: 600; fill: var(--ink); font-family: var(--text); }
.ch-hit { cursor: pointer; }
.ch-tip { position: absolute; z-index: 5; display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; min-width: 190px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--float); font-size: 13.5px; pointer-events: none; }
.ch-tip span { display: flex; align-items: center; gap: 7px; color: var(--ink-2); }
.ch-tip em { font-style: normal; color: var(--muted); }
.ch-tip .tot { color: var(--ink); font-weight: 600; margin-top: 2px; }
.rep-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 540px), 1fr)); gap: 22px; align-items: start; margin-bottom: 22px; }
.share { display: block; height: 6px; border-radius: 3px; background: var(--sunk); overflow: hidden; }
.share i { display: block; height: 100%; border-radius: 3px; background: #7B3F95; }
.rep-note { padding: 10px 14px 14px; font-size: 13px; }
.lost-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 18px 0 8px; }
.lost-head h3 { font: 400 20px/1.2 var(--display); }
.lost-list { list-style: none; margin: 0; padding: 0; }
.lost-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px dashed var(--line); }
.lost-main { display: flex; flex-direction: column; min-width: 0; }
.lost-main span { color: var(--muted); font-size: 14px; }
.lost-main:hover b { color: var(--plum); }
.lost-actions { display: flex; gap: 6px; flex: none; }

/* ---------- расходы и прибыль ---------- */
.money-eq { display: grid; grid-template-columns: 1fr auto 1fr auto 1.1fr; align-items: stretch; gap: 0; margin-bottom: 22px; }
.eq { display: flex; flex-direction: column; gap: 4px; padding: 18px 22px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); min-width: 0; }
.eq .eq-label { color: var(--ink-2); font-weight: 500; }
.eq b { font: 400 34px/1.1 var(--display); letter-spacing: -.01em; white-space: nowrap; }
.eq small { color: var(--muted); font-size: 13.5px; }
.eq.in b { color: var(--ink); }
.eq.out b { color: var(--ink); }
.eq.profit { border-color: transparent; }
.eq.profit.pos { background: var(--ok-soft); }
.eq.profit.pos b { color: var(--ok); }
.eq.profit.neg { background: var(--danger-soft); }
.eq.profit.neg b { color: var(--danger); }
.eq-op { align-self: center; padding: 0 12px; font: 400 34px/1 var(--display); color: var(--muted); }
.fin-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); gap: 22px; align-items: start; }
.fin-grid > * { min-width: 0; }
.fin-side { display: flex; flex-direction: column; gap: 22px; }
.fin-note { padding: 0 4px; font-size: 13.5px; }
.ex-day { padding: 0 22px; }
.ex-day + .ex-day { margin-top: 6px; }
.ex-day-head { display: flex; justify-content: space-between; padding: 10px 0 4px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); border-bottom: 1px solid var(--line); }
.ex-list { list-style: none; margin: 0 0 8px; padding: 0; }
.ex-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.ex-row:last-child { border-bottom: 0; }
.ex-ico { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--sunk); color: var(--muted); }
.ex-row.purchase .ex-ico { background: var(--honey-soft); color: var(--honey-deep); }
.ex-main { display: flex; flex-direction: column; min-width: 0; }
.ex-main b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ex-main small { color: var(--muted); font-size: 13.5px; }
.ex-sum { font-weight: 600; white-space: nowrap; }
.ex-actions { display: flex; opacity: .6; transition: opacity .15s; }
.ex-row:hover .ex-actions, .ex-actions:focus-within { opacity: 1; }
.ex-actions .icon-btn { width: 32px; height: 32px; }
.tag { display: inline-block; padding: 0 7px; border-radius: 6px; background: var(--sunk); color: var(--ink-2); font-size: 12.5px; }
.tag.honey { background: var(--honey-soft); color: var(--honey-deep); }
.ex-day:last-child { padding-bottom: 12px; }
.cat-list { list-style: none; margin: 0; padding: 0 22px 18px; display: flex; flex-direction: column; gap: 12px; }
.cat-top { display: flex; justify-content: space-between; gap: 10px; }
.cat-top b { font-weight: 600; white-space: nowrap; }
.cat-bar { display: block; height: 8px; margin: 5px 0 2px; border-radius: 4px; background: var(--sunk); overflow: hidden; }
.cat-bar i { display: block; height: 100%; border-radius: 4px; background: #7B3F95; }
.cat-bar.honey i { background: #C9862A; }
.cat-list small { color: var(--muted); font-size: 12.5px; }
.month-fin td, .month-fin th { padding: 10px 14px; }
.month-fin tr.cur td { background: var(--plum-tint); font-weight: 600; }
.neg, .t td.neg { color: var(--danger) !important; }
.day-spent { font-style: normal; font-weight: 500; color: var(--muted); margin-left: 8px; }
.stock-check { margin-top: 16px; padding: 12px 14px; border-radius: 12px; background: var(--honey-soft); width: 100%; }
.stock-extra { margin-top: 10px; padding: 0 2px; }
.stock-extra .help { margin-bottom: 10px; }
.t-sub a { color: var(--ok); font-weight: 500; }
.t-sub a.neg { color: var(--danger); }
.t-sub a:hover, .s-sub a:hover { text-decoration: underline; }
.s-sub a { color: var(--plum); }
.s-val.neg { color: var(--danger) !important; }

/* ---------- Excel ---------- */
.drop { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 26px; border: 2px dashed var(--line-2); border-radius: 16px; background: var(--sunk); color: var(--ink-2); cursor: pointer; text-align: center; }
.drop:hover, .drop.over { border-color: var(--plum); background: var(--plum-tint); color: var(--plum); }
.drop svg.i { width: 28px; height: 28px; }
.drop span { font-size: 14px; color: var(--muted); }
.imp-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 22px 0 10px; }
.imp-head h3 { font: 400 20px/1.2 var(--display); }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--plum); }
.imp-table { border: 1px solid var(--line); border-radius: 12px; max-height: 320px; }
.imp-table th { vertical-align: top; padding: 10px; }
.imp-table th select { height: 36px; min-width: 150px; padding: 0 8px; font-size: 14px; }
.imp-table th small { display: block; margin-top: 4px; font-weight: 400; color: var(--muted); }
.imp-table td { padding: 8px 10px; font-size: 14px; white-space: nowrap; }
.imp-summary { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--plum-tint); line-height: 1.6; }
.imp-summary:empty { display: none; }

/* ---------- телефон и PIN в настройках ---------- */
.phone-set { display: flex; flex-direction: column; gap: 0 !important; padding-top: 0 !important; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 0; border-top: 1px solid var(--line); }
.set-row:first-child { border-top: 0; }
.set-row p { margin-top: 2px; font-size: 14px; max-width: 62ch; }
.set-row.disabled { opacity: .55; }
.switch-row { cursor: pointer; }
.set-actions { display: flex; gap: 8px; flex: none; }
.switch { appearance: none; flex: none; width: 48px; height: 28px; border-radius: 999px; background: var(--line-2); position: relative; cursor: pointer; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .2s; }
.switch:checked { background: var(--plum); }
.switch:checked::after { transform: translateX(20px); }
.switch:disabled { cursor: default; }
.lan-box { display: flex; gap: 24px; align-items: flex-start; padding: 16px; margin-bottom: 8px; border-radius: 16px; background: var(--plum-tint); border: 1px solid var(--plum-soft); }
.qr { flex: none; width: 190px; padding: 8px; border-radius: 12px; background: #fff; }
.qr svg { display: block; width: 100%; height: auto; }
.lan-steps ol { margin: 0 0 10px; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.lan-steps p { font-size: 14px; margin-top: 6px; }
.lan-addr { margin: 6px 0 2px; font: 600 18px/1.3 Consolas, "Courier New", monospace; color: var(--plum); user-select: all; word-break: break-all; }

/* ---------- экран PIN-кода ---------- */
#login { position: fixed; inset: 0; z-index: 400; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at 30% 20%, #64307D, #34103F 70%); }
.login-box { width: 100%; max-width: 340px; padding: 30px 26px 24px; border-radius: 26px; background: var(--surface); text-align: center; box-shadow: 0 30px 80px rgba(20, 5, 30, .5); }
.login-box img { border-radius: 14px; }
.login-box h1 { margin-top: 14px; font: 400 26px/1.2 var(--display); }
.login-box p { color: var(--muted); margin-top: 4px; }
.pin-dots { display: flex; justify-content: center; gap: 12px; height: 18px; margin: 20px 0 6px; }
.pin-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-2); }
.pin-dots i.on { background: var(--plum); border-color: var(--plum); }
#pinInput { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
.pin-err { min-height: 22px; color: var(--danger); font-size: 14px; font-weight: 500; }
.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 8px; }
.pin-pad button { height: 58px; border: 0; border-radius: 16px; background: var(--sunk); font-size: 22px; font-weight: 500; cursor: pointer; }
.pin-pad button:active { background: var(--plum-soft); }
.pin-pad button.ok { background: var(--plum); color: #fff; }
.pin-pad button.ok svg.i { width: 26px; height: 26px; }
.shake { animation: shake .35s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.msg-foot { flex-wrap: wrap; }

/* ---------- мастера ---------- */
.mdot { display: inline-block; flex: none; width: 9px; height: 9px; margin-right: 6px; border-radius: 50%; vertical-align: 1px; }
.chip.on .mdot { box-shadow: 0 0 0 2px #fff; }
.master-chips { margin-top: 6px; }
.master-field { margin-bottom: 16px; }
.ms-stats > div:last-child small { font-size: 12px; }
.cal-masters { flex-wrap: wrap; gap: 6px; }
.grow { flex: 1; }
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 18px; margin-bottom: 18px; border-radius: var(--r-md); background: var(--honey-soft); color: var(--ink-2); }
.notice svg.i { flex: none; color: var(--honey-deep); margin-top: 2px; }
.ms-total { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 18px; }
.ms-total > div { display: flex; flex-direction: column; gap: 2px; padding: 16px 22px; border-left: 1px solid var(--line); }
.ms-total > div:first-child { border-left: 0; }
.ms-total span { color: var(--ink-2); font-size: 14px; }
.ms-total b { font: 400 28px/1.15 var(--display); }
.ms-total small { color: var(--muted); font-size: 13.5px; }
.ms-total .hl b { color: var(--plum); }
.ms-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 18px; }
.ms-card { display: flex; flex-direction: column; gap: 12px; padding: 18px 20px; border-top: 4px solid var(--mc, var(--plum)); }
.ms-card header { display: flex; align-items: center; gap: 12px; }
.ms-name { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.ms-name b { font-weight: 600; font-size: 17px; }
.ms-name small { color: var(--muted); font-size: 13.5px; }
.ms-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ms-stats > div { display: flex; flex-direction: column; padding: 10px 12px; border-radius: var(--r-sm); background: var(--sunk); min-width: 0; }
.ms-stats span { color: var(--muted); font-size: 12.5px; }
.ms-stats b { font-weight: 600; font-size: 18px; white-space: nowrap; }
.ms-stats small { color: var(--ink-2); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms-earn { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding-top: 4px; }
.ms-earn span { color: var(--ink-2); }
.ms-earn b { font: 400 28px/1.1 var(--display); color: var(--plum); white-space: nowrap; }
.ms-calc { font-size: 12.5px; margin-top: -8px; }
.ms-card footer { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 10px; border-top: 1px dashed var(--line); }
.ms-arch { margin-top: 22px; }
.ms-arch .feed { margin-top: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 4px 18px; }
.suffix-in, .prefix-in { display: flex; align-items: center; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface); overflow: hidden; }
.suffix-in:focus-within, .prefix-in:focus-within { border-color: var(--plum); box-shadow: 0 0 0 3px var(--plum-soft); }
.suffix-in input, .prefix-in input { flex: 1; min-width: 0; border: 0 !important; box-shadow: none !important; background: transparent; }
.suffix-in i, .prefix-in i { padding: 0 12px; font-style: normal; color: var(--muted); white-space: nowrap; }
.prefix-in i { padding-right: 0; }
.invite-box { display: flex; gap: 22px; align-items: flex-start; padding: 16px; border-radius: 16px; background: var(--plum-tint); border: 1px solid var(--plum-soft); }
.invite-box.small { margin-top: 10px; align-items: center; }
.invite-box.small .qr { width: 130px; }
.invite-box .lan-addr { font-size: 14px; margin: 10px 0; }
.steps-list { margin: 0 0 6px; padding-left: 20px; }
.steps-list li { margin: 4px 0; }
.token-row { display: flex; gap: 10px; margin-top: 8px; }
.token-row .input { flex: 1; min-width: 0; font-family: Consolas, "Courier New", monospace; }
.bot-set code { padding: 1px 6px; border-radius: 6px; background: var(--sunk); font-size: 13.5px; }
.tg-preview { margin: 6px 0 14px; padding: 16px; border-radius: 16px; background: #DCE7EF; max-width: 520px; }
.tg-bubble { padding: 10px 14px; border-radius: 14px 14px 14px 4px; background: #fff; box-shadow: 0 1px 1px rgba(0, 0, 0, .08); }
.tg-bubble b { display: block; color: #3A7BBF; font-size: 13.5px; }
.tg-bubble p { margin: 2px 0 0; white-space: pre-wrap; }
.tg-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 6px; }
.tg-btns span { padding: 8px; border-radius: 10px; background: rgba(255, 255, 255, .7); text-align: center; font-size: 14px; font-weight: 500; color: #2B5278; }
.tg-preview > .muted { margin: 10px 2px 0; font-size: 13px; color: #4F5E6B; }
.tg-on { display: inline-flex; align-items: center; gap: 4px; color: var(--ok); font-weight: 500; }
.tg-on svg.i { width: 15px; height: 15px; }
.tg-ok { color: var(--ok); font-weight: 700; }
.tg-appt.confirmed { box-shadow: inset 0 0 0 1px rgba(44, 122, 87, .25); }
@media (max-width: 860px) {
  .ms-total { grid-template-columns: 1fr; }
  .ms-total > div { border-left: 0; border-top: 1px solid var(--line); padding: 12px 16px; }
  .ms-total > div:first-child { border-top: 0; }
  .invite-box { flex-direction: column; }
  .token-row { flex-direction: column; }
  .cal-toolbar { flex-wrap: wrap; }
  .cal-masters { order: 3; width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .cal-masters .chip { flex: none; }
}
/* ---------- коммунальные услуги ---------- */
.util-list { list-style: none; margin: 0; padding: 0 22px 8px; }
.util-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px dashed var(--line); cursor: pointer; }
.util-list li:first-child { border-top: 0; }
.util-list li:hover .util-main b, .util-list li:focus-visible .util-main b { color: var(--plum); }
.util-main { display: flex; flex-direction: column; min-width: 0; }
.util-main b { font-weight: 600; }
.util-main small { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.util-list li.none .util-main small { color: var(--honey-deep); }
.util-sum { font-weight: 600; white-space: nowrap; }
.util-avg { padding: 0 22px 16px; font-size: 13.5px; }
.util-month { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 10px; }
.util-month b { font: 400 24px/1.2 var(--display); min-width: 190px; text-align: center; }
.util-rows { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 8px; }
.util-row { display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: 12px; align-items: center; }
.util-name { font-weight: 500; }
.util-row .suffix-in input { text-align: right; }
@media (max-width: 860px) {
  .util-list { padding: 0 16px 6px; }
  .util-avg { padding: 0 16px 14px; }
  .util-row { grid-template-columns: minmax(0, 1fr) 150px; }
}
@media (max-width: 1080px) {
  main { padding: 26px 24px 50px; }
  .home-grid, .client-grid, .day-layout, .rep-grid, .fin-grid { grid-template-columns: minmax(0, 1fr); }
  .sumstrip.five { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 860px) {
  body { font-size: 15px; }
  .app { grid-template-columns: 1fr; background: none; }
  /* нижняя панель разделов, как в приложениях */
  .side {
    position: fixed; top: auto; bottom: 0; left: 0; right: 0; z-index: 80; height: auto;
    flex-direction: row; padding: 0 0 env(safe-area-inset-bottom); gap: 0;
    border-right: 0; border-top: 1px solid var(--line); background: rgba(251, 250, 252, .97); backdrop-filter: blur(8px);
  }
  .brand, .side-foot { display: none; }
  .nav { flex-direction: row; width: 100%; gap: 0; overflow-x: auto; }
  .nav a { flex: 1 0 auto; min-width: 46px; flex-direction: column; gap: 2px; padding: 8px 2px 7px; border-radius: 0; font-size: 10.5px; font-weight: 500; }
  .money-eq { grid-template-columns: 1fr; gap: 8px; }
  .eq-op { display: none; }
  .eq { padding: 14px 16px; }
  .eq b { font-size: 28px; }
  .ex-day { padding: 0 14px; }
  .ex-row { grid-template-columns: 30px minmax(0, 1fr) auto; }
  .ex-actions { grid-column: 2 / -1; justify-content: flex-end; opacity: 1; margin-top: -6px; }
  .cat-list { padding: 0 16px 16px; }
  .nav a.on { background: none; }
  .nav a svg.i { width: 22px; height: 22px; }
  .nav .full { display: none; }
  .nav .short { display: inline; }
  .nav .nav-settings-m { display: flex; }
  main { padding: 18px 14px calc(86px + env(safe-area-inset-bottom)); }
  .page-head { margin-bottom: 18px; }
  .page-head h1, .client-head h1 { font-size: 28px; }
  .home-date { font-size: 28px; }
  .big-actions { grid-template-columns: 1fr 1fr; gap: 12px; margin: 18px 0 16px; }
  .big { min-height: 118px; padding: 16px; border-radius: 20px; }
  .big .big-title { font-size: 30px; }
  .big .big-text { display: none; }
  .find-client .search-input { height: 52px; }
  .facts, .sumstrip, .sumstrip.five { grid-template-columns: 1fr 1fr; }
  .facts > div:nth-child(3), .sumstrip > div:nth-child(3) { border-left: 0; }
  .facts > div, .sumstrip > div { border-top: 1px solid var(--line); }
  .facts > div:nth-child(-n+2), .sumstrip > div:nth-child(-n+2) { border-top: 0; }
  .grid3, .grid2 { grid-template-columns: 1fr; }
  .span2, .span3 { grid-column: auto; }
  .si-head { display: none; }
  .si-row { grid-template-columns: 1fr 120px 36px; }
  .si-row .si-prod { grid-column: 1 / -1; }
  .hide-sm { display: none; }
  .totals { grid-template-columns: 1fr 1fr 1fr; }
  .totals .t-val { font-size: 17px; }
  /* окна — на весь экран */
  .modal-wrap { padding: 0; place-items: stretch; }
  .modal, .modal.wide, .modal.narrow { max-width: none; min-height: 100vh; min-height: 100dvh; border-radius: 0; }
  .modal-head { padding: 16px 16px 4px; position: sticky; top: 0; z-index: 3; background: var(--surface); }
  .modal-head h2 { font-size: 23px; }
  .modal-body { padding: 10px 16px 20px; }
  .modal-foot { margin: 20px -16px -20px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-radius: 0; position: sticky; bottom: 0; flex-wrap: wrap; }
  .modal-foot .grand { width: 100%; }
  .client-head { gap: 14px; }
  .client-head .who { gap: 12px; }
  .avatar.lg { width: 48px; height: 48px; font-size: 18px; }
  .client-head .actions .btn { flex: 1 1 auto; }
  .tl-item { grid-template-columns: 44px 1fr; gap: 10px; }
  .timeline { padding: 4px 14px 10px; }
  .panel-head { padding: 16px 16px 10px; }
  .panel-body { padding: 4px 16px 16px; }
  .rem-list, .appt-today { padding: 0 4px 6px; }
  .bd-list, .buy-list, .gap-list, .day-feed { padding-left: 16px; padding-right: 16px; }
  .toolbar .search-wrap { min-width: 0; max-width: none; }
  .period .custom { width: 100%; }
  .period .custom input { flex: 1; width: auto; }
  .page-head .actions { width: 100%; }
  .page-head .actions .btn { flex: 1 1 auto; }
  /* календарь */
  .cal-title { font-size: 18px; }
  .mday { min-height: 64px; padding: 6px 4px 18px; align-items: center; }
  .mday-list, .mday-bd { display: none; }
  .mday-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--plum); color: #fff; font-size: 11.5px; font-weight: 600; }
  .mday-load { display: none; }
  .mday.today .mday-num { margin: 0; }
  .month-head span { padding: 8px 4px; text-align: center; }
  .tgrid { grid-template-columns: 44px 1fr; }
  .tgrid:not(.single) .tg-cols { overflow-x: auto; grid-auto-columns: minmax(110px, 1fr); }
  .appt-info { grid-template-columns: 100px 1fr; }
  .lan-box { flex-direction: column; }
  .lost-list li { flex-direction: column; align-items: flex-start; }
  .set-row { align-items: flex-start; }
  #toasts { bottom: calc(80px + env(safe-area-inset-bottom)); }
  #offline { bottom: calc(62px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (max-width: 860px) {
  /* 9 разделов помещаются в нижнюю панель без прокрутки */
  .nav { overflow-x: visible; }
  .nav a { flex: 1 1 0; min-width: 0; padding: 8px 0 7px; font-size: 10px; letter-spacing: -.01em; }
  .nav a .short { max-width: 100%; overflow: hidden; text-overflow: clip; white-space: nowrap; }
}
@media (max-width: 380px) {
  .nav a { font-size: 9.2px; letter-spacing: -.02em; }
}
