/* Deposit Mini App v2 — следует теме Telegram, статусы несут цвет */
:root {
  --bg: var(--tg-theme-bg-color, #0f1419);
  --bg2: var(--tg-theme-secondary-bg-color, #1a2230);
  --text: var(--tg-theme-text-color, #e9edf3);
  --hint: var(--tg-theme-hint-color, #8e9bb0);
  --link: var(--tg-theme-link-color, #6cb6ff);
  --btn: var(--tg-theme-button-color, #2aabee);
  --btn-text: var(--tg-theme-button-text-color, #ffffff);
  --danger: #e5484d;
  --ok: #2fa56f;
  --warn: #e8a317;
  --info: #3e8ef7;
  --violet: #8e4ec6;
  --teal: #12a594;
  --border: color-mix(in srgb, var(--hint) 26%, transparent);
  --soft: color-mix(in srgb, var(--hint) 14%, transparent);
  --r-card: 14px;
  --r-field: 12px;
  --r-sheet: 22px;
  --nav-h: 62px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: var(--tg-theme-bg-color, #ffffff);
    --bg2: var(--tg-theme-secondary-bg-color, #f1f3f7);
    --text: var(--tg-theme-text-color, #14181f);
    --hint: var(--tg-theme-hint-color, #6b7686);
    --link: var(--tg-theme-link-color, #1a73d9);
  }
}
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; font-family: var(--font); font-size: 15px; line-height: 1.4;
  background: var(--bg); color: var(--text); min-height: 100%;
  -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%;
}
body { padding-bottom: calc(var(--nav-h) + var(--safe-b) + 12px); }
#app { max-width: 560px; margin: 0 auto; min-height: 100vh; }
button { font-family: inherit; }
:focus-visible { outline: 2px solid var(--btn); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }

/* ── шапка ── */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo {
  flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  background: var(--btn); color: var(--btn-text); font-weight: 800; font-size: 17px;
}
.brand-txt { display: flex; flex-direction: column; min-width: 0; }
.brand-mark { font-weight: 700; font-size: 16px; line-height: 1.2; }
.brand-sub { font-size: 12.5px; color: var(--hint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn {
  flex: none; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--bg2); color: var(--text); cursor: pointer; display: grid; place-items: center;
}
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:active { opacity: .65; }
.icon-btn.spin svg { animation: spin .7s linear; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── экраны, заголовки ── */
.screen { display: none; padding: 18px 16px 28px; }
.screen.active { display: block; }
.screen-title { margin: 0 0 4px; font-size: 24px; font-weight: 750; letter-spacing: -.01em; line-height: 1.2; }
.title-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.title-row .screen-title { margin: 0; }
.hint { margin: 0 0 16px; color: var(--hint); font-size: 13.5px; line-height: 1.45; }
.hint.center { text-align: center; margin-top: 10px; }
.section-title { font-size: 14px; font-weight: 700; margin: 22px 0 10px; }

/* ── прогресс заполнения формы ── */
.fill { margin: 0 0 18px; }
.fill-bar { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.fill-bar i { height: 4px; border-radius: 4px; background: var(--soft); transition: background .25s; }
.fill-bar i.on { background: var(--btn); }
.fill-txt { font-size: 12.5px; color: var(--hint); margin-top: 6px; }

/* ── поля ── */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; position: relative; }
.field-label { font-size: 13px; font-weight: 600; color: var(--text); }
.field-help { font-size: 12.5px; color: var(--hint); line-height: 1.4; }
.field input, .field textarea, .field select, .filters input, .filters select, .mini-field input {
  width: 100%; border: 1px solid var(--border); background: var(--bg2); color: var(--text);
  border-radius: var(--r-field); padding: 12px 14px; font-size: 16px; outline: none; font-family: inherit;
  -webkit-appearance: none; appearance: none; min-height: 48px;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field textarea:focus, .field select:focus, .filters input:focus, .filters select:focus, .mini-field input:focus {
  border-color: var(--btn); box-shadow: 0 0 0 3px color-mix(in srgb, var(--btn) 22%, transparent);
}
.field input[type="date"] { color-scheme: light dark; }
.field textarea { resize: vertical; min-height: 76px; }
.select-wrap { position: relative; }
.select-wrap::after {
  content: ""; position: absolute; right: 16px; top: 50%; width: 8px; height: 8px; margin-top: -6px;
  border-right: 2px solid var(--hint); border-bottom: 2px solid var(--hint); transform: rotate(45deg); pointer-events: none;
}
.select-wrap select { padding-right: 38px; }
.field-err { font-size: 12.5px; color: var(--danger); min-height: 0; }
.field-err:empty { display: none; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--danger); }
.field.is-valid input, .field.is-valid select { border-color: color-mix(in srgb, var(--ok) 60%, var(--border)); }
.field .ok-mark {
  position: absolute; right: 12px; bottom: 14px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--ok); display: none; pointer-events: none;
}
.field .ok-mark::after {
  content: ""; position: absolute; left: 7px; top: 3px; width: 5px; height: 10px;
  border-right: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(45deg);
}
.field.is-valid .ok-mark { display: block; }
.field .ok-mark.sel { right: 40px; }
.card-input, .amount-input { position: relative; }
.card-input input { letter-spacing: .06em; font-variant-numeric: tabular-nums; padding-right: 92px; }
.card-state { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-size: 12.5px; font-weight: 700; }
.card-state.ok { color: var(--ok); } .card-state.bad { color: var(--danger); } .card-state.neutral { color: var(--hint); }
.amount-input input { padding-right: 38px; font-variant-numeric: tabular-nums; font-weight: 600; }
.amount-input .suffix { position: absolute; right: 15px; top: 50%; transform: translateY(-50%); color: var(--hint); font-weight: 600; }

/* ── срок с последней смены ── */
.days-panel {
  border-radius: var(--r-card); padding: 14px 14px 12px; margin: 0 0 18px;
  border: 1px solid var(--border); background: var(--bg2); transition: background .2s, border-color .2s;
}
.days-panel.bad { border-color: color-mix(in srgb, var(--danger) 50%, transparent); background: color-mix(in srgb, var(--danger) 9%, var(--bg2)); }
.days-panel.good { border-color: color-mix(in srgb, var(--ok) 50%, transparent); background: color-mix(in srgb, var(--ok) 9%, var(--bg2)); }
.days-top { display: flex; align-items: center; gap: 14px; }
.days-num { font-size: 36px; font-weight: 800; min-width: 62px; text-align: center; font-variant-numeric: tabular-nums; line-height: 1; }
.days-panel.bad .days-num { color: var(--danger); } .days-panel.good .days-num { color: var(--ok); }
.days-title { font-weight: 650; font-size: 14.5px; }
.days-sub { font-size: 13.5px; color: var(--hint); margin-top: 2px; line-height: 1.4; }
.days-panel.bad .days-sub { color: var(--danger); } .days-panel.good .days-sub { color: var(--ok); }
.progress { height: 6px; background: var(--soft); border-radius: 99px; margin: 12px 0 10px; overflow: hidden; }
.progress-bar { height: 100%; width: 0; border-radius: 99px; background: var(--warn); transition: width .3s; }
.days-panel.good .progress-bar { background: var(--ok); } .days-panel.bad .progress-bar { background: var(--danger); }
.rule { font-size: 13px; color: var(--hint); line-height: 1.4; }
.rule b { color: var(--text); }

/* ── кнопки ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px;
  border: none; border-radius: var(--r-field); padding: 11px 16px; font-size: 15px; font-weight: 650;
  cursor: pointer; transition: transform .08s, opacity .15s; color: var(--text);
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--btn); color: var(--btn-text); width: 100%; margin-top: 4px; min-height: 52px; font-size: 16px; }
.btn.ghost { background: transparent; border: 1px solid var(--border); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.ok { background: var(--ok); color: #fff; }
.btn.info { background: var(--info); color: #fff; }
.btn.violet { background: var(--violet); color: #fff; }
.btn.teal { background: var(--teal); color: #fff; }
.btn.small { padding: 8px 12px; font-size: 13.5px; min-height: 40px; }
.btn.full-w { width: 100%; margin-top: 8px; min-height: 48px; }
.btn.warn-btn { border-color: var(--warn); }

/* ── карточка заявки ── */
.s-new { --st: var(--info); } .s-accepted { --st: var(--violet); } .s-in_work { --st: var(--warn); }
.s-partial { --st: var(--teal); } .s-done { --st: var(--ok); } .s-cancelled { --st: var(--danger); }
.card-list { display: flex; flex-direction: column; gap: 10px; }
.req {
  position: relative; background: var(--bg2); border: 1px solid var(--border); border-radius: var(--r-card);
  padding: 13px 14px 13px 18px; cursor: pointer; overflow: hidden; transition: transform .08s;
}
.req::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--st, var(--hint)); }
.req:active { transform: scale(.992); }
.req-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.req-who { min-width: 0; }
.req-id { color: var(--hint); font-weight: 600; font-size: 13px; }
.req-fio { font-weight: 700; font-size: 16px; line-height: 1.25; overflow-wrap: anywhere; }
.req-dept { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--hint); margin-top: 1px; }
.req-dept time { white-space: nowrap; font-variant-numeric: tabular-nums; font-size: 12.5px; }
.req-money { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: 10px; }
.req-amt { font-size: 21px; font-weight: 780; letter-spacing: -.01em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.req-of { font-size: 12.5px; color: var(--hint); text-align: right; font-variant-numeric: tabular-nums; }
.paybar { height: 6px; border-radius: 99px; background: var(--soft); overflow: hidden; margin: 8px 0 2px; }
.paybar > div { height: 100%; border-radius: 99px; background: var(--st, var(--ok)); transition: width .3s; }
.paybar.mini { height: 4px; }
.req-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--hint); padding: 3px 8px; border-radius: 999px; background: var(--soft); white-space: nowrap; }
.tag svg { width: 12px; height: 12px; }
.tag.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); }
.tag.warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 17%, transparent); }
.tag.crit { color: var(--danger); background: color-mix(in srgb, var(--danger) 15%, transparent); }
.tag.dup { color: var(--violet); background: color-mix(in srgb, var(--violet) 15%, transparent); }
.quick { display: flex; gap: 8px; margin-top: 12px; }
.quick .btn { flex: 1; }
.badge { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; white-space: nowrap; color: var(--st, var(--hint)); background: color-mix(in srgb, var(--st, var(--hint)) 16%, transparent); }
.note-cancel, .note-done, .note-el, .note-dup {
  margin-top: 10px; padding: 10px 12px; border-radius: var(--r-field); font-size: 13.5px; line-height: 1.4; overflow-wrap: anywhere;
}
.note-cancel { background: color-mix(in srgb, var(--danger) 11%, var(--bg2)); }
.note-done { background: color-mix(in srgb, var(--ok) 11%, var(--bg2)); }
.note-el { background: color-mix(in srgb, var(--info) 11%, var(--bg2)); }
.note-el.fail { background: color-mix(in srgb, var(--warn) 17%, var(--bg2)); }
.note-el .btn { margin-top: 8px; }
.note-dup { background: color-mix(in srgb, var(--violet) 12%, var(--bg2)); }

/* лента статусов у сотрудника */
.steps { list-style: none; display: flex; margin: 14px 0 2px; padding: 0; }
.steps li { position: relative; flex: 1; text-align: center; font-size: 11.5px; color: var(--hint); padding-top: 18px; line-height: 1.2; }
.steps li::before { content: ""; position: absolute; top: 5px; left: 0; right: 0; height: 2px; background: var(--soft); }
.steps li:first-child::before { left: 50%; } .steps li:last-child::before { right: 50%; }
.steps li::after {
  content: ""; position: absolute; top: 0; left: 50%; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%;
  background: var(--bg2); border: 2px solid var(--soft); box-sizing: border-box;
}
.steps li.done { color: var(--text); }
.steps li.done::before, .steps li.cur::before { background: var(--st); }
.steps li.done::after { background: var(--st); border-color: var(--st); }
.steps li.cur { color: var(--text); font-weight: 700; }
.steps li.cur::after { border-color: var(--st); box-shadow: 0 0 0 4px color-mix(in srgb, var(--st) 22%, transparent); }
.steps li.cur:last-child::before { background: var(--st); }
.steps.stopped li.cur::after { background: var(--danger); border-color: var(--danger); box-shadow: none; }
.upd { font-size: 12.5px; color: var(--hint); margin-top: 8px; }

/* группы в очереди */
.group-h { display: flex; align-items: center; gap: 8px; margin: 18px 0 8px; font-size: 14px; font-weight: 700; }
.group-h:first-child { margin-top: 4px; }
.group-h i { width: 10px; height: 10px; border-radius: 3px; background: var(--st); }
.group-h span { color: var(--hint); font-weight: 600; }
.group-h .old { margin-left: auto; font-size: 12.5px; font-weight: 600; }

/* ── пустые состояния и скелетоны ── */
.empty { text-align: center; color: var(--hint); padding: 36px 12px; font-size: 14px; }
.empty-state { text-align: center; padding: 40px 20px 24px; }
.empty-ico { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 50%; background: var(--soft); display: grid; place-items: center; color: var(--hint); }
.empty-ico svg { width: 30px; height: 30px; }
.empty-state h2 { margin: 0 0 6px; font-size: 18px; }
.empty-state p { margin: 0 0 16px; color: var(--hint); font-size: 14px; }
.empty-state .btn { min-width: 200px; }
.sk { border-radius: var(--r-card); height: 112px; background: var(--bg2); border: 1px solid var(--border); position: relative; overflow: hidden; }
.sk::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--hint) 14%, transparent), transparent); animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }

/* ── очередь: переключатель, фильтры ── */
.segmented { display: inline-flex; background: var(--bg2); border: 1px solid var(--border); border-radius: 12px; padding: 3px; }
.seg { border: none; background: transparent; color: var(--hint); font: 600 13.5px var(--font); padding: 8px 14px; min-height: 36px; border-radius: 9px; cursor: pointer; }
.seg.active { background: var(--btn); color: var(--btn-text); }
.stats { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 6px; margin: 0 -16px 8px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; }
.stats::-webkit-scrollbar { display: none; }
.stat {
  flex: 0 0 auto; min-width: 86px; min-height: 52px; border: 1px solid var(--border); background: var(--bg2);
  border-radius: 12px; padding: 8px 12px; cursor: pointer; text-align: left; color: var(--text);
}
.stat .n { font-size: 20px; font-weight: 780; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat .t { font-size: 12px; color: var(--hint); font-weight: 600; white-space: nowrap; }
.stat.active { border-color: var(--btn); background: color-mix(in srgb, var(--btn) 12%, var(--bg2)); }
.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.filters.one { grid-template-columns: 1fr; }
.filters select, .filters input, .mini-field input { font-size: 15px; padding: 10px 12px; min-height: 44px; }
.filters .select-wrap select { padding-right: 34px; }
.mini-field { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--hint); font-weight: 600; }
.pager { display: flex; justify-content: center; gap: 10px; align-items: center; margin-top: 14px; color: var(--hint); font-size: 13px; }

/* ── нижняя навигация ── */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: space-around;
  padding: 4px 6px calc(4px + var(--safe-b)); max-width: 560px; margin: 0 auto; min-height: var(--nav-h);
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(16px); border-top: 1px solid var(--border);
}
.nav-item {
  position: relative; flex: 1; min-width: 0; min-height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  background: transparent; border: none; color: var(--hint); font: 600 11.5px var(--font); padding: 6px 2px; cursor: pointer; border-radius: 12px;
}
.nav-item svg { width: 24px; height: 24px; }
.nav-item span.lbl { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item.active { color: var(--btn); }
.nav-item.active::before { content: ""; position: absolute; top: -5px; left: 28%; right: 28%; height: 3px; border-radius: 0 0 3px 3px; background: var(--btn); }
.nav-badge {
  position: absolute; top: 3px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
}
.nav-badge[hidden], .owner-only[hidden], .admin-only[hidden] { display: none; }

/* ── уведомления ── */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + var(--safe-b) + 14px); transform: translateX(-50%); z-index: 80;
  max-width: min(92%, 520px); background: var(--text); color: var(--bg); border-radius: 12px; padding: 11px 16px;
  font-size: 14px; font-weight: 550; box-shadow: 0 8px 28px rgba(0,0,0,.3);
}
.toast[hidden] { display: none; }
.status-bar { margin: 10px 16px 0; padding: 11px 13px; border-radius: 12px; background: color-mix(in srgb, var(--danger) 14%, var(--bg2)); color: var(--danger); font-size: 13.5px; }

/* ── шторки и диалоги ── */
.modal { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.5); display: flex; align-items: flex-end; justify-content: center; }
.modal[hidden] { display: none !important; }
#cancelModal, #doneModal, #payModal { z-index: 70; padding: 16px; }
.modal-card {
  width: 100%; max-width: 560px; background: var(--bg); border-radius: var(--r-sheet) var(--r-sheet) 14px 14px;
  padding: 18px 16px calc(16px + var(--safe-b)); border: 1px solid var(--border); max-height: 92vh; overflow-y: auto;
  animation: sheet-up .22s cubic-bezier(.2,.8,.2,1);
}
@keyframes sheet-up { from { transform: translateY(32px); opacity: .6; } to { transform: none; opacity: 1; } }
.sheet { border-radius: var(--r-sheet) var(--r-sheet) 0 0; padding-top: 10px; }
.sheet-handle { width: 40px; height: 4px; border-radius: 4px; background: var(--border); margin: 0 auto 14px; }
.modal-card h2 { margin: 0 0 12px; font-size: 18px; }
.modal-actions { display: flex; gap: 8px; margin-top: 14px; }
.modal-actions .btn { flex: 1; }
.detail-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; }
.detail-head h2 { margin: 0; font-size: 20px; }
.detail-age { margin: -4px 0 12px; display: flex; flex-wrap: wrap; gap: 6px; }

/* ключ-значение: строки как в бухгалтерской книге */
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0 14px; font-size: 14.5px; background: var(--bg2); border-radius: var(--r-card); padding: 4px 14px; border: 1px solid var(--border); }
.kv .k, .kv .v { padding: 10px 0; border-bottom: 1px dashed var(--border); }
.kv .k:nth-last-child(2), .kv .v:last-child { border-bottom: none; }
.kv .k { color: var(--hint); }
.kv .v { font-weight: 600; text-align: right; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.card-full { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; letter-spacing: .03em; }
.card-full span { white-space: nowrap; }
.copy-row { letter-spacing: normal; }
.copy-row span { white-space: normal; text-align: right; }
.copy { white-space: nowrap; border: 1px solid var(--border); background: transparent; color: var(--link); border-radius: 8px; padding: 6px 10px; min-height: 32px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.contact-btn { margin-top: 6px; }
.actions-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.actions-grid .btn.full { grid-column: 1 / -1; }

.pay-block { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--r-card); padding: 13px 14px; margin-top: 10px; }
.pay-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; text-align: center; }
.pay-grid .n { font-weight: 780; font-size: 16px; font-variant-numeric: tabular-nums; }
.pay-grid .t { font-size: 12px; color: var(--hint); font-weight: 600; }
.pay-grid .rem .n { color: var(--warn); } .pay-grid .paid .n { color: var(--ok); }
.pay-block .paybar { height: 8px; margin: 12px 0 6px; }
.pay-nums { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--hint); }
.pay-summary { margin-bottom: 12px; }
.payments { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.payments li { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--bg2); border: 1px solid var(--border); border-radius: var(--r-field); padding: 10px 12px; font-size: 14px; }
.payments .amt { font-weight: 750; color: var(--ok); white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
.payments .meta { color: var(--hint); font-size: 12.5px; }
.payments.team li { align-items: center; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--soft); }
.timeline li { position: relative; padding: 0 0 14px 12px; font-size: 13.5px; }
.timeline li::before { content: ""; position: absolute; left: -21px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--bg); border: 2px solid var(--st, var(--btn)); }
.timeline .when { color: var(--hint); font-size: 12.5px; }
.timeline .cmt { margin-top: 3px; font-style: italic; overflow-wrap: anywhere; }
.field-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.chip-btn, .chip { border: 1px solid var(--border); background: var(--bg2); color: var(--link); border-radius: 999px; padding: 7px 12px; min-height: 36px; font: 600 13px var(--font); cursor: pointer; white-space: nowrap; }
.chip { color: var(--text); }
.chip.active { background: var(--btn); color: var(--btn-text); border-color: var(--btn); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }

/* ── отчёты ── */
.rep-period { font-weight: 700; margin: 6px 0 12px; font-size: 15px; }
.rep-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rep-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--r-card); padding: 12px 14px; min-width: 0; }
.rep-card .n { font-size: 19px; font-weight: 780; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; line-height: 1.15; }
.rep-card .t { font-size: 13px; color: var(--hint); font-weight: 600; margin-top: 3px; }
.rep-card .s { font-size: 12px; color: var(--hint); margin-top: 2px; }
.rep-card.paid .n { color: var(--ok); } .rep-card.rem .n { color: var(--warn); }
.stack { display: flex; height: 12px; border-radius: 99px; overflow: hidden; background: var(--soft); gap: 2px; }
.stack i { display: block; background: var(--st); min-width: 6px; }
.legend { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.legend li { display: flex; align-items: center; gap: 9px; font-size: 14px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--st); flex: none; }
.legend .l { flex: 1; min-width: 0; }
.legend .v { font-weight: 650; font-variant-numeric: tabular-nums; text-align: right; }
.legend .v small { display: block; color: var(--hint); font-weight: 500; font-size: 12px; }
.hbars { display: grid; gap: 14px; }
.hbar .top { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; font-weight: 600; }
.hbar .top span:last-child { color: var(--hint); font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hbar .track { height: 8px; border-radius: 99px; background: color-mix(in srgb, var(--hint) 38%, transparent); margin: 7px 0 5px; overflow: hidden; }
.cap { margin: -4px 0 12px; font-size: 12.5px; color: var(--hint); }
.hbar .track b { display: block; height: 100%; border-radius: 99px; background: var(--ok); }
.hbar .sub { font-size: 12.5px; color: var(--hint); font-variant-numeric: tabular-nums; }
.daychart { width: 100%; height: 96px; display: block; }
.daychart rect { fill: var(--btn); }
.daychart rect.zero { fill: var(--soft); }
.daychart-cap { display: flex; justify-content: space-between; font-size: 12px; color: var(--hint); margin-top: 4px; }
.sla { display: grid; gap: 8px; }
.sla-row { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--r-card); padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.sla-row .t { font-weight: 600; font-size: 14px; }
.sla-row .s { font-size: 12.5px; color: var(--hint); margin-top: 2px; }
.sla-row .n { font-size: 20px; font-weight: 780; font-variant-numeric: tabular-nums; white-space: nowrap; }
#repSend { margin-top: 18px; }
#repCustom[hidden], #inviteBox:empty { display: none; }
#btnInvite { margin-bottom: 12px; }
.invite-box { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--r-card); padding: 13px 14px; margin-bottom: 12px; }
.invite-box .meta { font-size: 13px; color: var(--hint); line-height: 1.4; }
.invite-link { margin: 8px 0 6px; padding: 9px 10px; border-radius: 10px; background: var(--bg); border: 1px dashed var(--border); font: 12px ui-monospace, SFMono-Regular, Menlo, monospace; word-break: break-all; user-select: all; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (max-width: 360px) {
  .req-amt { font-size: 19px; } .screen-title { font-size: 22px; } .nav-item { font-size: 10.5px; }
}
