/* VIBE STORE Helper — тёмная тема, приглушённый синий акцент */
:root {
  --bg: #0a0c10; --side: #0c0f14; --card: #11151c; --card-2: #161b24; --field: #0d1016;
  --border: #1d232e; --border-2: #283040; --pill: #161b24; --pill-h: #1d2430;
  --text: #e6eaf2; --text-2: #c3cad8; --muted: #8590a3; --dim: #586174;
  --accent: #5a86e0; --accent-h: #6b95ec; --accent-soft: rgba(90, 134, 224, .13); --accent-line: rgba(90, 134, 224, .45);
  --link: #8fb0f0; --icon: #7b93bb; --icon-on: #a9c0e8;
  --ok: #4fc48d; --ok-soft: rgba(79, 196, 141, .12); --warn: #e3b35a; --warn-soft: rgba(227, 179, 90, .12);
  --err: #ee6d75; --err-soft: rgba(238, 109, 117, .12);
  --green: #2f9b68; --green-h: #36ad75;
  --radius: 14px; --r-sm: 10px;
  --shadow: 0 1px 0 rgba(255,255,255,.02) inset, 0 10px 30px -12px rgba(0,0,0,.6);
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --blue: var(--accent); --tab-on: var(--accent-soft);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font: 14px/1.45 Inter, "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
.hidden { display: none !important; }
::selection { background: rgba(90, 134, 224, .35); }
* { scrollbar-width: thin; scrollbar-color: #252c39 transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; } ::-webkit-scrollbar-thumb { background: #232a36; border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }
a { color: var(--link); }

/* поля и кнопки */
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea { background: var(--field); border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 9px 12px; outline: none; width: 100%; transition: border-color .15s, box-shadow .15s, background .15s; }
input:hover, select:hover, textarea:hover { border-color: var(--border-2); }
input:focus, select:focus, textarea:focus { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
input::placeholder, textarea::placeholder { color: var(--dim); }
select { appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%237b93bb' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }
select option { background: #11151c; }
textarea { resize: vertical; min-height: 84px; line-height: 1.5; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--pill);
  border: 1px solid var(--border); border-radius: var(--r-sm); padding: 8px 14px; cursor: pointer; font-weight: 600;
  font-size: 13.5px; color: var(--text-2); white-space: nowrap; transition: background .15s, border-color .15s, color .15s, transform .1s; }
.btn:hover:not(:disabled) { background: var(--pill-h); border-color: var(--border-2); color: var(--text); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn.blue { background: var(--accent); border-color: transparent; color: #fff; }
.btn.blue:hover:not(:disabled) { background: var(--accent-h); border-color: transparent; color: #fff; }
.btn.green { background: var(--green); border-color: transparent; color: #fff; }
.btn.green:hover:not(:disabled) { background: var(--green-h); border-color: transparent; color: #fff; }
.btn.danger { background: transparent; border-color: rgba(238, 109, 117, .28); color: #f0939a; }
.btn.danger:hover:not(:disabled) { background: var(--err-soft); border-color: rgba(238, 109, 117, .45); color: #ffb0b5; }
.btn.small { padding: 5px 10px; font-size: 12px; border-radius: 8px; gap: 6px; }
.btn:disabled { opacity: .42; cursor: default; }
label.btn { display: inline-flex; }
.icon-btn { background: var(--pill); border: 1px solid var(--border); border-radius: var(--r-sm); width: 36px; height: 34px;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex: none; color: var(--text-2);
  transition: background .15s, border-color .15s; }
.icon-btn:hover { background: var(--pill-h); border-color: var(--border-2); } .icon-btn:hover .i { color: var(--icon-on); }

/* иконки */
.i { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round;
  stroke-linejoin: round; color: var(--icon); vertical-align: -3px; }
.btn .i { margin: -2px 0; transition: color .15s; }
.btn.small .i { width: 14px; height: 14px; }
.btn.blue .i, .btn.green .i { color: rgba(255,255,255,.9); }
.btn.danger .i { color: #d98a92; }
.btn:hover:not(:disabled) .i { color: var(--icon-on); }
.btn.blue:hover .i, .btn.green:hover .i { color: #fff; }
.icon-btn .i { width: 18px; height: 18px; }
summary .i { width: 14px; height: 14px; margin-right: 6px; vertical-align: -2px; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--icon); vertical-align: 1px; margin: 0 3px; }

/* карточки и текст */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.title { font-weight: 600; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); }
.hint, .note { color: var(--muted); font-size: 12.5px; }
.note:empty { display: none; }
.cap { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .07em; font-weight: 600; }
.brand { font-weight: 800; letter-spacing: .04em; } .brand span { font-weight: 400; color: var(--muted); }
.check { display: flex !important; align-items: center; gap: 10px; color: var(--text-2) !important; width: auto !important;
  font-size: 13.5px; cursor: pointer; }
.check input { width: 18px; height: 18px; flex: none; accent-color: var(--accent); margin: 0; cursor: pointer; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.grid2 label, .code label, .pay-settings > label:not(.check) { display: grid; gap: 6px; color: var(--muted); font-size: 12.5px; }
details summary { list-style: none; cursor: pointer; } details summary::-webkit-details-marker { display: none; }
details > summary::before { content: ''; display: inline-block; width: 6px; height: 6px; margin-right: 10px; vertical-align: 2px;
  border-right: 1.6px solid var(--icon); border-bottom: 1.6px solid var(--icon); transform: rotate(-45deg); transition: transform .15s; }
details[open] > summary::before { transform: rotate(45deg); vertical-align: 3px; }

/* ── вход ── */
.login { position: fixed; inset: 0; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(600px 400px at 50% 30%, rgba(90,134,224,.10), transparent 70%), var(--bg); }
.login-card { width: min(360px, 100%); display: grid; gap: 12px; background: var(--card); border: 1px solid var(--border);
  padding: 30px 26px 24px; border-radius: 20px; box-shadow: 0 30px 80px -30px rgba(0,0,0,.8); }
.login-mark { display: grid; place-items: center; margin-bottom: 2px; }
.login-mark .mark { width: 46px; height: 46px; }
.login-card .brand { font-size: 19px; text-align: center; }
.login-sub { margin: -6px 0 8px; text-align: center; color: var(--muted); font-size: 13px; }
.login-card .btn { padding: 10px; }
.login-error { color: var(--err); font-size: 13px; min-height: 18px; text-align: center; }
.mark { fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; }
.mark .m1 { fill: var(--accent); stroke: none; } .mark .m2 { fill: var(--icon-on); stroke: none; }

/* ── каркас: боковое меню + содержимое ── */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); height: 100%; }
.side { background: var(--side); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 18px 12px 14px;
  min-height: 0; }
.side-brand { display: flex; align-items: center; gap: 11px; padding: 2px 8px 20px; }
.side-brand .mark { width: 30px; height: 30px; flex: none; }
.side-brand b { display: block; font-size: 14px; letter-spacing: .06em; font-weight: 800; }
.side-brand small { display: block; color: var(--muted); font-size: 12px; margin-top: 1px; }
.tabs { display: flex; flex-direction: column; gap: 2px; }
.tabs button { display: flex; align-items: center; gap: 11px; border: 0; background: transparent; color: var(--muted);
  font-weight: 500; font-size: 14px; padding: 9px 11px; border-radius: 10px; cursor: pointer; white-space: nowrap; text-align: left;
  position: relative; transition: background .15s, color .15s; }
.tabs button:hover { background: #12161e; color: var(--text-2); }
.tabs button.on { background: var(--accent-soft); color: var(--text); }
.tabs button.on::before { content: ''; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0;
  background: var(--accent); }
.tabs .ico { display: inline-flex; font-style: normal; }
.tabs .i { width: 18px; height: 18px; }
.tabs button.on .i { color: var(--icon-on); }
.tabs .short { display: none; }
.badge { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 10px; background: #1e2532; color: var(--text-2);
  font-size: 11px; line-height: 19px; text-align: center; margin-left: auto; font-weight: 600; font-style: normal; }
.badge:empty { display: none; } .tabs button.on .badge { background: var(--accent); color: #fff; }
.side-foot { margin-top: auto; padding: 12px 8px 0; border-top: 1px solid var(--border); }
.conn { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; }
.conn i { width: 8px; height: 8px; border-radius: 50%; background: var(--err); box-shadow: 0 0 0 3px var(--err-soft); flex: none; }
.conn.on i { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); } .conn.on { color: var(--text-2); }

.content { display: flex; flex-direction: column; min-width: 0; min-height: 0; height: 100%; }
.topbar { display: flex; align-items: baseline; gap: 18px; padding: 20px 24px 12px; min-width: 0; }
.topbar h1 { margin: 0; font-size: 21px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; }
.statusbar { flex: 1; min-width: 0; color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-align: right; }
main { flex: 1; min-height: 0; padding: 0 24px 20px; }
.page { height: 100%; }

/* ── заказы ── */
.orders { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 14px; height: 100%; }
.list-pane { display: flex; flex-direction: column; gap: 10px; min-height: 0; padding: 14px 12px; }
.list-head { display: flex; align-items: center; justify-content: space-between; padding: 0 4px; }
.search-wrap { position: relative; }
.search-wrap .i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.search-wrap .search { width: 100%; padding-left: 36px; }
.rows { flex: 1; overflow-y: auto; min-height: 120px; display: grid; gap: 2px; align-content: start; }
.row-item { display: flex; align-items: center; gap: 11px; padding: 8px 9px; border-radius: 11px; cursor: pointer;
  border: 1px solid transparent; transition: background .12s, border-color .12s; }
.row-item:hover { background: var(--card-2); }
.row-item.on { background: var(--accent-soft); border-color: rgba(90,134,224,.25); }
.ava { width: 40px; height: 40px; border-radius: 50%; flex: none; object-fit: cover; display: grid; place-items: center;
  font-weight: 700; color: #cdd8ee; background: linear-gradient(145deg, #2a3550, #1b2233); border: 1px solid #263048; }
.row-mid { flex: 1; min-width: 0; }
.row-mid b, .row-mid small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-mid b { font-weight: 600; font-size: 14px; }
.row-mid small { color: var(--muted); font-size: 12.5px; margin-top: 1px; }
.row-side { text-align: right; font-size: 11.5px; color: var(--dim); line-height: 1.6; }
.row-side .i { width: 14px; height: 14px; vertical-align: -2px; }
.mark-sent, .mark-sent .i { color: var(--ok); } .mark-draft .dot { background: var(--accent); } .mark-sending, .mark-sending .i { color: var(--warn); }
#btn-recover { width: 100%; }
.editor { overflow-y: auto; min-height: 0; padding: 18px 20px; }
.empty { color: var(--muted); text-align: center; margin-top: 56px; }
#editor-empty { display: grid; place-items: center; height: 100%; margin: 0; color: var(--dim); }
.editor-body { display: grid; gap: 10px; }
.ed-head { display: flex; align-items: center; gap: 12px; padding-bottom: 6px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.ed-head .ava { width: 44px; height: 44px; }
.ed-head .back { display: none; }
.ed-who { flex: 1; min-width: 0; } .ed-who div { font-weight: 700; font-size: 16px; } .ed-who small { color: var(--muted); }
.status-pill { font-size: 12px; font-weight: 600; padding: 4px 11px; border-radius: 999px; background: var(--pill); color: var(--muted);
  border: 1px solid var(--border); }
.status-pill.sent { color: var(--ok); background: var(--ok-soft); border-color: transparent; }
.status-pill.draft { color: var(--link); background: var(--accent-soft); border-color: transparent; }
.status-pill.sending { color: var(--warn); background: var(--warn-soft); border-color: transparent; }
.problems { background: var(--warn-soft); color: var(--warn); border: 1px solid rgba(227,179,90,.25); border-radius: var(--r-sm);
  padding: 9px 12px; font-size: 13px; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 180px)); gap: 10px; }
.photos img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 12px; cursor: pointer; border: 1px solid var(--border);
  transition: opacity .15s; }
.photos img:hover { opacity: .8; }
.photos .add { width: 100%; aspect-ratio: 1; border-radius: 12px; border: 1.5px dashed var(--border-2); display: grid; place-items: center;
  color: var(--icon); cursor: pointer; font-size: 24px; transition: border-color .15s, background .15s; }
.photos .add:hover { border-color: var(--accent-line); background: var(--accent-soft); }
.money { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.money label { display: grid; gap: 6px; color: var(--muted); font-size: 12.5px; width: 140px; }
.money .check { padding-bottom: 9px; }
#ed-due { font-size: 13px; color: var(--text-2); }
.notes summary { color: var(--muted); font-size: 12.5px; }
.notes pre { white-space: pre-wrap; font: 12px/1.55 var(--mono); color: #a9b2c3; background: var(--field); padding: 10px 12px;
  border-radius: var(--r-sm); border: 1px solid var(--border); max-height: 260px; overflow: auto; margin: 8px 0 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 6px; }
.actions .wide { margin-left: auto; }

/* ── вторые оплаты / доставки ── */
#page-bc, #page-dl, #page-debts { overflow: hidden; }
.bc { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 14px; height: 100%; }
.bc-left { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.bc-left .row .btn { flex: 1; }
.bc-dates { flex: 1; overflow-y: auto; display: grid; gap: 4px; align-content: start; margin: 0 -4px; padding: 0 4px; }
.bc-date { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 9px 11px; border-radius: 11px;
  cursor: pointer; background: var(--field); border: 1px solid var(--border); transition: background .12s, border-color .12s; }
.bc-date:hover { background: var(--card-2); border-color: var(--border-2); }
.bc-date.on { background: var(--accent-soft); border-color: var(--accent-line); }
.bc-date b { font-weight: 600; }
.bc-date small { color: var(--muted); white-space: nowrap; } .bc-date .done { color: var(--ok); } .bc-date .bad { color: var(--err); }
.bc-date .i { width: 12px; height: 12px; vertical-align: -2px; margin-right: 2px; }
.bc-date .done .i, .bc-date .bad .i { color: inherit; } .bc-date .paid .i { color: var(--icon); }
.bc-right { overflow-y: auto; display: grid; gap: 10px; align-content: start; }
.link-row { display: flex; gap: 8px; }
.link-row input { flex: 1; min-width: 0; }
.tpl summary, .pay-settings summary { color: var(--muted); font-size: 12.5px; }
.tpl summary:hover, .pay-settings summary:hover, .notes summary:hover { color: var(--text-2); }
.tpl pre { white-space: pre-wrap; font-size: 12.5px; background: var(--field); border: 1px solid var(--border); padding: 10px 12px;
  border-radius: var(--r-sm); max-height: 220px; overflow: auto; color: var(--text-2); margin: 8px 0 0; font-family: inherit; }
.pay-settings { background: var(--field); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; display: grid; gap: 10px; }
.bc-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.legend { color: var(--dim); font-size: 11.5px; } .legend i { font-style: normal; }
.st-sent { color: var(--warn); } .st-paid { color: var(--ok); }
.recips { background: var(--field); border: 1px solid var(--border); border-radius: 12px; padding: 6px; max-height: 360px; min-height: 120px;
  overflow-y: auto; font: 13px/1.5 var(--mono); display: grid; align-content: start; gap: 1px; }
.recips > .hint { padding: 8px; font-family: Inter, system-ui, sans-serif; }
.recip { padding: 4px 8px; border-radius: 7px; cursor: pointer; display: flex; gap: 10px; align-items: baseline; }
.recip:hover { background: var(--card-2); }
.recip .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recip .s { color: var(--dim); font-size: 12px; white-space: nowrap; }
.recip .i { width: 13px; height: 13px; vertical-align: -2px; }
.recip.new { color: var(--text-2); } .recip.sent, .recip.sent .i { color: var(--warn); } .recip.paid, .recip.paid .i { color: var(--ok); }
.recip.error, .recip.bad, .recip.error .i, .recip.bad .i { color: var(--err); } .recip.bad { cursor: default; }
.recip-day { color: var(--dim); padding: 8px 8px 3px; font-size: 11.5px; letter-spacing: .04em; }
.recip .d { color: var(--dim); white-space: nowrap; font-size: 12px; }
.recip .t { font-size: 12px; color: var(--muted); }
.dl-left { overflow-y: auto; }
.dl-left .title + * { margin-top: -2px; }
.dl-rows { max-height: none; flex: 1; min-height: 240px; }
.sum-result { white-space: pre-wrap; font: 12px/1.5 var(--mono); background: var(--field); border: 1px solid var(--border); padding: 10px;
  border-radius: var(--r-sm); margin: 0; max-height: 220px; overflow-y: auto; }

/* ── должники ── */
.debts { height: 100%; display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.debt-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.debt-top .inline { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; }
.debt-top .inline input { width: 58px; text-align: center; padding: 7px 6px; }
.debt-top .sep { flex: 1; }
.debt-sections { flex: 1; min-height: 0; display: grid; grid-template-rows: repeat(3, minmax(0, 1fr)); gap: 10px; }
.debt-sec { background: var(--field); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; display: flex;
  flex-direction: column; min-height: 0; }
.debt-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-bottom: 6px; margin-bottom: 4px;
  border-bottom: 1px solid var(--border); }
.debt-head b { font-size: 13.5px; font-weight: 600; } .debt-head small { color: var(--dim); flex: 1; font-size: 12px; }
.debt-list { overflow-y: auto; flex: 1; font: 12.5px/1.6 var(--mono); }
.debt-row { display: grid; grid-template-columns: 56px 92px 96px minmax(0, 1fr); gap: 12px; padding: 3px 6px; border-radius: 7px; cursor: pointer; }
.debt-row:hover { background: var(--card-2); }
.debt-row .days, .debt-row .amt { text-align: right; }
.debt-row .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .debt-row .nm small { color: var(--dim); }
.debt-row.info { color: var(--text-2); } .debt-row.warn { color: var(--warn); } .debt-row.err { color: var(--err); }
.debt-empty { color: var(--dim); padding: 4px 6px; font-family: Inter, system-ui, sans-serif; }

/* ── логи ── */
.logs-card { height: 100%; display: flex; flex-direction: column; gap: 10px; }
.logs-head { display: flex; justify-content: space-between; align-items: center; }
.logs-head select { width: auto; min-width: 140px; }
.logs { flex: 1; overflow-y: auto; font: 12.5px/1.6 var(--mono); background: var(--field); border: 1px solid var(--border);
  border-radius: 12px; padding: 10px 12px; white-space: pre-wrap; word-break: break-word; }
.l-ts { color: #3e4657; } .l-info { color: var(--text-2); } .l-ok { color: var(--ok); } .l-warn { color: var(--warn); }
.l-err { color: var(--err); } .l-dim { color: var(--dim); }

/* ── настройки ── */
#page-settings { overflow-y: auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-content: start;
  padding-bottom: 10px; max-width: 900px; }
.settings { display: grid; gap: 12px; }
.code { display: grid; gap: 10px; max-width: 420px; }
.qr { width: 220px; height: 220px; background: #fff; border-radius: 14px; padding: 10px; image-rendering: pixelated; }
.qr-box { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.qr-box .hint { max-width: 360px; }
.progress { position: relative; height: 28px; background: var(--field); border: 1px solid var(--border); border-radius: var(--r-sm); overflow: hidden; }
.progress i { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--accent-soft); transition: width .2s; }
.progress span { position: relative; display: block; text-align: center; line-height: 26px; font-size: 12px; }

/* ── календарь ── */
.modal { position: fixed; inset: 0; background: rgba(4, 6, 10, .7); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  display: grid; place-items: center; padding: 12px; z-index: 20; }
.modal-card { background: var(--card); border: 1px solid var(--border); border-radius: 20px; width: min(980px, 100%); max-height: 100%;
  overflow-y: auto; padding: 18px; display: grid; gap: 12px; box-shadow: 0 40px 100px -30px rgba(0,0,0,.9); }
.cal-head { display: flex; align-items: center; gap: 8px; }
.cal-title { flex: 1; font-weight: 700; font-size: 17px; text-align: center; }
.cal-note { color: var(--muted); font-size: 12.5px; text-align: center; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-wd { text-align: center; color: var(--dim); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.cal-wd.we { color: #c27a82; }
.cal-cell { background: var(--field); border-radius: 12px; min-height: 76px; padding: 8px; cursor: pointer; border: 1px solid var(--border);
  display: flex; flex-direction: column; justify-content: space-between; transition: background .12s, border-color .12s; min-width: 0; }
.cal-cell:hover { background: var(--card-2); border-color: var(--border-2); }
.cal-cell.has { background: #141a24; } .cal-cell.other { opacity: .4; }
.cal-cell.today { border-color: var(--accent-line); } .cal-cell.on { background: var(--accent-soft); border-color: var(--accent); }
.cal-cell .d { font-weight: 700; } .cal-cell .c { color: var(--link); font-size: 12px; font-weight: 600; }
.cal-cell .s { color: var(--ok); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-day { display: grid; gap: 4px; }
.cal-day .title { margin: 4px 0; }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: #1a2030; color: var(--text);
  border: 1px solid var(--border-2); padding: 11px 16px; border-radius: 12px; max-width: calc(100% - 32px); z-index: 30;
  box-shadow: 0 16px 40px -10px rgba(0,0,0,.7); font-size: 13.5px; animation: toast-in .2s ease; }
.toast.err { background: #2a1519; border-color: rgba(238,109,117,.35); color: #ffc2c6; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 6px); } }

/* ── заставка ── */
.intro { position: fixed; inset: 0; z-index: 1000; background: #000; cursor: pointer; transition: opacity .55s ease; }
.intro canvas { display: block; }
.intro small { position: absolute; left: 0; right: 0; bottom: max(18px, env(safe-area-inset-bottom)); text-align: center;
  color: #2a3a66; font: 11px ui-monospace, Menlo, Consolas, monospace; letter-spacing: .5px; }
.intro.gone { opacity: 0; pointer-events: none; }

/* ── планшет ── */
@media (max-width: 1100px) and (min-width: 761px) {
  .shell { grid-template-columns: 68px minmax(0, 1fr); }
  .side { padding: 16px 10px; align-items: center; }
  .side-brand { padding: 2px 0 18px; } .side-brand div { display: none; }
  .tabs button { justify-content: center; padding: 10px; font-size: 0; }
  .tabs button > :not(.ico) { display: none; }
  .tabs .badge { display: block !important; position: absolute; top: 2px; right: 2px; margin: 0; min-width: 16px; line-height: 16px;
    font-size: 10px; padding: 0 4px; }
  .tabs .badge:empty { display: none !important; }
  .tabs button.on::before { left: -10px; }
  .side-foot { padding: 12px 0 0; } .conn span { display: none; }
  .orders { grid-template-columns: 280px minmax(0, 1fr); } .bc { grid-template-columns: 250px minmax(0, 1fr); }
}

/* ── телефон ── */
@media (max-width: 760px) {
  html, body { overflow-x: hidden; }
  input, select, textarea { font-size: 16px; max-width: 100%; min-width: 0; }
  .shell { display: flex; flex-direction: column; }
  .side { flex-direction: row; align-items: center; justify-content: space-between; border-right: 0; border-bottom: 1px solid var(--border);
    padding: max(10px, env(safe-area-inset-top)) 14px 10px; background: rgba(12, 15, 20, .92); }
  .side-brand { padding: 0; gap: 9px; } .side-brand .mark { width: 26px; height: 26px; }
  .side-brand b { font-size: 13px; } .side-brand small { font-size: 11px; }
  .side-foot { margin: 0; padding: 0; border: 0; } .conn { font-size: 12px; }
  .tabs { position: fixed; left: 10px; right: 10px; bottom: max(10px, env(safe-area-inset-bottom)); z-index: 10; flex-direction: row;
    justify-content: space-around; gap: 0; padding: 6px; border-radius: 20px; overflow-x: auto; scrollbar-width: none;
    background: rgba(17, 21, 28, .86); backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%);
    border: 1px solid var(--border-2); box-shadow: 0 14px 40px -8px rgba(0,0,0,.75); }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs button { flex: 1 0 auto; min-width: 52px; padding: 6px 4px 5px; font-size: 10.5px; font-weight: 600; flex-direction: column;
    gap: 3px; border-radius: 14px; justify-content: center; }
  .tabs button:hover { background: transparent; }
  .tabs button.on { background: var(--accent-soft); color: var(--link); }
  .tabs button.on::before { display: none; }
  .tabs .i { width: 21px; height: 21px; }
  .tabs .badge { position: absolute; top: 1px; right: 6px; margin: 0; min-width: 17px; line-height: 17px; font-size: 10px; padding: 0 5px; }
  .tabs .long { display: none; } .tabs .short { display: inline; }
  .content { height: auto; flex: 1; min-height: 0; }
  .topbar { order: 2; padding: 6px 16px 96px; }
  .topbar h1 { display: none; }
  .statusbar { text-align: left; font-size: 12px; }
  main { padding: 12px 10px 0; overflow-y: auto; }
  .page { height: auto; min-height: 100%; }
  .card { padding: 14px; border-radius: 16px; }
  .link-row { flex-wrap: wrap; } .link-row input { flex: 1 1 100%; } .link-row .btn { flex: 1; }
  .orders { grid-template-columns: minmax(0, 1fr); height: auto; }
  .list-pane { min-height: calc(100dvh - 210px); }
  .orders.editing .list-pane { display: none; }
  .orders:not(.editing) .editor { display: none; }
  .editor { padding: 14px; }
  .ed-head .back { display: inline-flex; }
  .money label { width: calc(50% - 6px); }
  .actions .btn { flex: 1 1 calc(50% - 8px); }
  .actions .wide { flex-basis: 100%; margin-left: 0; order: -1; padding: 11px; }
  .bc { display: flex; flex-direction: column; height: auto; }
  .bc > *, .orders > *, .debts > *, .card { min-width: 0; max-width: 100%; }
  #page-bc, #page-dl, #page-debts { overflow: visible; }
  .bc-left { min-height: auto; flex: none; }
  .bc-dates { max-height: 240px; flex: none; }
  .bc-right { overflow: visible; }
  .dl-left { overflow: visible; }
  #page-dl .bc-right { order: -1; } .dl-rows { min-height: 120px; max-height: 50vh; }
  .recip { flex-wrap: wrap; row-gap: 0; } .recip .n { white-space: normal; } .recip .t { width: 100%; order: 3; padding-left: 23px; }
  .debts { height: auto; } .debt-sections { display: flex; flex-direction: column; } .debt-list { max-height: 50vh; }
  .debt-top .sep { display: none; } .debt-top .btn { flex: 1 1 100%; }
  .debt-row { grid-template-columns: 44px 76px minmax(0, 1fr); gap: 8px; font-size: 12px; }
  .debt-row .dt { display: none; } .debt-row .nm { white-space: normal; }
  .logs-card { height: calc(100dvh - 200px); }
  #page-settings { max-width: none; }
  label.btn, .row .btn { white-space: normal; text-align: center; }
  .settings .row { flex-wrap: wrap; } .settings .row .btn { flex: 1 1 100%; }
  .modal { padding: 8px; align-items: end; }
  .modal-card { border-radius: 20px; padding: 14px; max-height: calc(100dvh - 16px); }
  .cal-grid { gap: 4px; }
  .cal-cell { min-height: 54px; padding: 5px 6px; border-radius: 10px; }
  .cal-cell .s { display: none; }
  .toast { bottom: 96px; }
}

/* длинные строки (ссылки, тексты, ТТН) не раздвигают карточки */
.bc-right, .editor-body, .settings, .pay-settings { grid-template-columns: minmax(0, 1fr); }
.tpl summary, .pay-settings summary, .hint, .note, .sum-result, .recip .t, .recip .s { overflow-wrap: anywhere; }
.recips { overflow-x: hidden; }
.dl-left > * { flex-shrink: 0; }
.bc-dates { grid-template-columns: minmax(0, 1fr); }
.bc-date { flex-wrap: wrap; row-gap: 2px; } .bc-date small { margin-left: auto; }

/* выбранный день из календаря — над лентой заказов */
.day-bar { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 12px; background: var(--accent-soft);
  border: 1px solid rgba(90,134,224,.28); }
.day-bar .icon-btn { width: 32px; height: 32px; background: rgba(13,16,22,.55); }
.day-bar .icon-btn:disabled { opacity: .35; cursor: default; }
.day-info { flex: 1; min-width: 0; text-align: center; line-height: 1.25; }
.day-info b { display: block; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.day-info small { color: var(--muted); font-size: 12px; }
.cal-hint { text-align: center; color: var(--dim); font-size: 12px; }
.cal-cell .d { font-size: 13.5px; }

/* фото в черновике: нажатие сразу убирает его */
.photos img[title]:not([title=""]):hover { opacity: 1; outline: 2px solid rgba(238,109,117,.6); outline-offset: -2px; filter: brightness(.75); }
.photos img.going { opacity: .25; transform: scale(.92); transition: opacity .15s, transform .15s; pointer-events: none; }

/* ── профиль клиента (телефон, в духе Telegram) ── */
.ed-open { display: none; }
.profile { position: fixed; inset: 0; z-index: 40; background: #07090c; animation: pf-in .22s ease; }
@keyframes pf-in { from { opacity: 0; transform: translateY(14px); } }
.pf-scroll { height: 100%; overflow-y: auto; padding-bottom: max(24px, env(safe-area-inset-bottom)); overscroll-behavior: contain; }
.pf-hero { position: relative; padding: max(12px, env(safe-area-inset-top)) 14px 18px; text-align: center; overflow: hidden; isolation: isolate; }
.pf-bg { position: absolute; inset: 0; z-index: -1; }
.pf-bg.photo { filter: blur(38px) saturate(130%); opacity: .55; transform: scale(1.3); }
.pf-bg::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, #07090c); }
.pf-top { display: flex; justify-content: space-between; }
.pf-round { width: 46px; height: 46px; border-radius: 50%; border: 0; background: rgba(20, 24, 32, .55); display: grid; place-items: center;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); cursor: pointer; }
.pf-round .i { width: 22px; height: 22px; color: #e6eaf2; }
.pf-ava { width: 112px; height: 112px; margin: -4px auto 14px; border-radius: 50%; overflow: hidden; box-shadow: 0 10px 40px -10px rgba(0,0,0,.7); }
.pf-ava img, .pf-ava span { width: 100%; height: 100%; object-fit: cover; display: grid; place-items: center; font-size: 46px; font-weight: 600; color: #fff; }
.pf-name { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -.01em; overflow-wrap: anywhere; }
.pf-sub { color: #8f9bb0; font-size: 15px; margin-top: 4px; }
.pf-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 20px; }
.pf-act { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px 10px; border-radius: 16px; border: 0;
  background: rgba(28, 33, 44, .82); color: #e6eaf2; text-decoration: none; font-size: 13px; font-weight: 600; cursor: pointer;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.pf-act .i { width: 24px; height: 24px; color: #a9c0e8; }
.pf-act.off { opacity: .4; }
.pf-act:active { background: rgba(40, 47, 62, .9); }
.pf-card { margin: 10px 12px 0; background: #12161d; border: 1px solid #1a202a; border-radius: 22px; padding: 4px 0; }
.pf-stats { display: grid; grid-template-columns: repeat(3, 1fr); padding: 14px 6px; }
.pf-stats > div { text-align: center; border-left: 1px solid #1f2632; }
.pf-stats > div:first-child { border-left: 0; }
.pf-stats b { display: block; font-size: 17px; font-weight: 700; }
.pf-stats small { color: var(--muted); font-size: 12.5px; }
.pf-stats .due b { color: var(--err); } .pf-stats .ok b { color: var(--ok); }
.pf-row { display: flex; align-items: center; gap: 14px; padding: 12px 16px; position: relative; cursor: default; }
.pf-row + .pf-row::before { content: ''; position: absolute; left: 54px; right: 0; top: 0; border-top: 1px solid #1f2632; }
.pf-row > .i { width: 22px; height: 22px; align-self: flex-start; margin-top: 3px; }
.pf-row[data-go], .pf-row[data-copy-id] { cursor: pointer; }
.pf-row-main { flex: 1; min-width: 0; }
.pf-val { font-size: 16.5px; line-height: 1.35; overflow-wrap: anywhere; }
.pf-val a { color: var(--link); text-decoration: none; }
.pf-row small { color: var(--muted); font-size: 13px; }
.pf-row-go .i { width: 24px; height: 24px; color: var(--link); }
.pf-tabs { display: flex; gap: 4px; margin: 14px 12px 10px; padding: 4px; background: #12161d; border: 1px solid #1a202a; border-radius: 999px;
  overflow-x: auto; scrollbar-width: none; position: sticky; top: 8px; z-index: 2; }
.pf-tabs::-webkit-scrollbar { display: none; }
.pf-tabs button { flex: 1; border: 0; background: transparent; color: var(--muted); font-size: 15px; font-weight: 600; padding: 10px 12px;
  border-radius: 999px; cursor: pointer; white-space: nowrap; }
.pf-tabs button.on { background: var(--accent-soft); color: var(--link); }
.pf-tabs button i { font-style: normal; font-size: 12px; opacity: .7; margin-left: 2px; }
.pf-body { padding: 0 12px; display: grid; gap: 8px; }
.pf-empty { text-align: center; color: var(--dim); padding: 30px 0; }
.pf-order { background: #12161d; border: 1px solid #1a202a; border-radius: 18px; padding: 12px 14px; cursor: pointer; display: grid; gap: 4px; }
.pf-order.cur { border-color: var(--accent-line); background: #131a27; }
.pf-order:active { background: #171d28; }
.pf-o-top { display: flex; justify-content: space-between; align-items: center; }
.pf-date { color: var(--muted); font-size: 13px; }
.pf-o-name { font-size: 15.5px; font-weight: 600; overflow-wrap: anywhere; }
.pf-o-money { display: flex; justify-content: space-between; font-size: 13.5px; color: var(--text-2); }
.pf-o-money .due { color: var(--err); } .pf-o-money .ok { color: var(--ok); }
.pf-chip { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--pill); color: var(--muted); white-space: nowrap; }
.pf-chip.sent { color: var(--ok); background: var(--ok-soft); } .pf-chip.draft, .pf-chip.new { color: var(--link); background: var(--accent-soft); }
.pf-chip.sending { color: var(--warn); background: var(--warn-soft); } .pf-chip.paid { color: var(--ok); background: var(--ok-soft); }
.pf-dl .pf-chip.sent { color: var(--warn); background: var(--warn-soft); }
.pf-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; border-radius: 18px; overflow: hidden; }
.pf-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: #12161d; cursor: pointer; }
.pf-dl { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: #12161d; border: 1px solid #1a202a;
  border-radius: 16px; padding: 11px 14px; }
.pf-ttn { font: 14px var(--mono); overflow-wrap: anywhere; }
.pf-dl small { color: var(--muted); font-size: 12.5px; }
.viewer { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.94); display: grid; place-items: center; padding: 10px; }
.viewer img { max-width: 100%; max-height: 100%; border-radius: 8px; }
@media (max-width: 760px) {
  .ed-who, #ed-ava { cursor: pointer; }
  .ed-open { display: inline-flex; cursor: pointer; padding: 6px 0; order: 6; }
  .ed-open .i { width: 18px; height: 18px; }
  .ed-head .status-pill { order: 5; }
}
@media (min-width: 761px) { .profile { display: none !important; } }

/* заказы из CRM */
.crm-tag { font-style: normal; font-size: 9.5px; font-weight: 700; letter-spacing: .05em; color: var(--icon); border: 1px solid #2a3344;
  border-radius: 5px; padding: 0 4px; }
.status-pill.crm { color: var(--icon-on); background: rgba(123,147,187,.12); border-color: transparent; }
.pf-chip.crm { color: var(--icon-on); background: rgba(123,147,187,.12); }
.crm-result { background: var(--field); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 10px 12px; font-size: 13px;
  color: var(--text-2); line-height: 1.6; }

.pf-row[data-copy-text] { cursor: pointer; } .pf-row[data-copy-text]:active { background: rgba(255,255,255,.03); }
.pf-link { color: var(--link); }

/* ── вторые оплаты / доставки: на виду только рабочее, настройки — в выезжающей панели ── */
.pane-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.pane-head h3 { margin: 0; font-size: 16px; font-weight: 700; }
.pane-head small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.pane-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.tpl-state { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.tpl-state .i { width: 13px; height: 13px; color: inherit; }
.tpl-state.ok { color: var(--ok); background: var(--ok-soft); }
.tpl-state.warn { color: var(--warn); background: var(--warn-soft); cursor: pointer; }
.bc-right { display: flex !important; flex-direction: column; gap: 10px; min-height: 0; overflow: hidden !important; }
.bc-list, .dl-main .dl-rows { flex: 1; max-height: none; min-height: 160px; }
.dl-main { height: 100%; display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.action-bar { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 2px; }
#bc-stop:disabled, #dl-stop:disabled { display: none; }
.legend { margin-top: -4px; }
.bc-left .pane-head { margin-bottom: 2px; }

.drawer { position: fixed; inset: 0; z-index: 35; background: rgba(4, 6, 10, 0); transition: background .2s; }
.drawer.open { background: rgba(4, 6, 10, .6); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
.drawer-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(440px, 100%); background: var(--card); border-left: 1px solid var(--border);
  display: flex; flex-direction: column; transform: translateX(100%); transition: transform .22s ease; box-shadow: -30px 0 80px -30px rgba(0,0,0,.8); }
.drawer.open .drawer-panel { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.drawer-head b { font-size: 15px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 6px 18px 24px; }
.d-sec { display: grid; gap: 9px; padding: 16px 0; border-bottom: 1px solid var(--border); grid-template-columns: minmax(0, 1fr); }
.d-sec:last-child { border-bottom: 0; }
.d-title { font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); }
.d-field { display: grid; gap: 6px; color: var(--muted); font-size: 12.5px; }
.d-sec > .btn { justify-self: start; }

@media (max-width: 760px) {
  .bc-right { overflow: visible !important; }
  .dl-main { height: auto; }
  .bc-list, .dl-main .dl-rows { max-height: 55vh; }
  .pane-tools { width: 100%; } .pane-tools .btn { flex: 1; }
  .pane-tools .tpl-state { flex: 1 1 100%; justify-content: center; }
  .drawer-panel { top: auto; left: 0; width: 100%; height: 88dvh; border-left: 0; border-top: 1px solid var(--border-2);
    border-radius: 22px 22px 0 0; transform: translateY(100%); padding-bottom: env(safe-area-inset-bottom); }
  .drawer-head { position: relative; padding-top: 22px; }
  .drawer-head::before { content: ''; position: absolute; top: 8px; left: 50%; width: 38px; height: 4px; border-radius: 4px; background: #2c3442; transform: translateX(-50%); }
  .action-bar .btn { flex: 1 1 calc(50% - 8px); }
}
.pane-head > div:first-child { flex: 1; min-width: 0; }
.bc-left .pane-head { flex-wrap: nowrap; }

/* приём заявок */
.join-card .pane-head h3 { font-size: 15px; }
.j-auto { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.j-auto .inline { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; }
.j-auto .inline input { width: 64px; text-align: center; padding: 7px 6px; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; color: var(--text-2); }
.switch input { display: none; }
.switch i { width: 40px; height: 23px; border-radius: 999px; background: #232a36; border: 1px solid var(--border-2); position: relative; transition: background .2s; }
.switch i::after { content: ''; position: absolute; top: 2px; left: 2px; width: 17px; height: 17px; border-radius: 50%; background: #8d98ab; transition: transform .2s, background .2s; }
.switch input:checked + i { background: var(--green); border-color: transparent; }
.switch input:checked + i::after { transform: translateX(17px); background: #fff; }
.j-slot { display: grid; gap: 7px; padding: 12px 0; border-top: 1px solid var(--border); grid-template-columns: minmax(0, 1fr); }
.j-slot-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.j-slot-head small { color: var(--muted); flex: 1; }
.j-slot.now .j-slot-head b { color: var(--link); }
.j-preview { font-size: 12.5px; color: var(--muted); white-space: pre-wrap; max-height: 70px; overflow: hidden; overflow-wrap: anywhere; }
.j-list { display: grid; gap: 4px; max-height: 260px; overflow-y: auto; }
.j-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 9px; background: var(--card); border: 1px solid var(--border); }
.j-row span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.j-row small { color: var(--dim); font-size: 12px; white-space: nowrap; }
.j-row.bad span { color: var(--err); }
.j-row .icon-btn { width: 28px; height: 28px; }
#j-stop:disabled { display: none; }
@media (max-width: 760px) { .j-row small { display: none; } }

/* ── вкладки: подсветка «перетекает», страница плавно появляется ── */
@media (min-width: 761px) { .tabs { position: relative; } }
.tabs button { position: relative; z-index: 1; }
.tabs button.on, .tabs button:hover { background: transparent; }
.tabs button:not(.on):hover { color: var(--text-2); }
.tabs button.on::before { display: none; }
.tab-ind { position: absolute; left: 0; top: 0; width: 0; height: 0; z-index: 0; border-radius: 10px; background: var(--accent-soft);
  pointer-events: none; will-change: transform, width, height;
  transition: transform .24s cubic-bezier(.3, .7, .2, 1), width .24s cubic-bezier(.3, .7, .2, 1), height .24s cubic-bezier(.3, .7, .2, 1); }
.tab-ind.stretch { transition-duration: .15s; transition-timing-function: cubic-bezier(.4, 0, .6, 1); }
.tab-ind::before { content: ''; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.page.enter { animation: page-in .32s cubic-bezier(.2, .7, .2, 1); }
@keyframes page-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.topbar h1.enter { animation: title-in .3s ease; }
@keyframes title-in { from { opacity: 0; transform: translateY(-4px); } }
#page-join { overflow-y: auto; max-width: 900px; }
#page-join .join-card { display: grid; gap: 12px; }
@media (max-width: 1100px) and (min-width: 761px) { .tab-ind::before { left: -10px; } }
@media (max-width: 760px) {
  .tab-ind { border-radius: 14px; }
  .tab-ind::before { display: none; }
  .tabs button.on { background: transparent; }
  .page.enter { animation-name: page-in-x; }
  @keyframes page-in-x { from { opacity: 0; transform: translateX(calc(var(--dir, 1) * 18px)); } to { opacity: 1; transform: none; } }
  #page-join { max-width: none; }
}
@media (prefers-reduced-motion: reduce) { .page.enter, .topbar h1.enter { animation: none; } .tab-ind { transition: none; } }
@media (max-width: 760px) { .debt-head small { flex: 1 1 100%; order: 3; } }

/* ── новый логотип в шапке: VIBE (синий) / STORE (белый), Montserrat Black Italic, лёгкий глитч ── */
.vlogo { display: inline-grid; line-height: .86; font-family: Montserrat, "Arial Black", Impact, sans-serif; font-style: italic;
  font-weight: 900; letter-spacing: .01em; user-select: none; position: relative; }
.vlogo b { position: relative; display: block; font-weight: 900; letter-spacing: .01em; margin: 0; transform: scaleX(1.1); transform-origin: left; }
.vlogo .vl-v { color: #2f6bff; font-size: 25px; text-shadow: 0 0 10px rgba(47,107,255,.65), 0 0 2px rgba(47,107,255,.9); padding-left: 2px; }
.vlogo .vl-s { color: #fff; font-size: 22px; text-shadow: 0 0 10px rgba(190,215,255,.45); }
.vlogo b::before, .vlogo b::after { content: attr(data-t); position: absolute; inset: 0; padding-left: inherit; opacity: 0; pointer-events: none; }
.vlogo b::before { color: #4fd0ff; animation: vl-glitch-a 7s infinite steps(1); }
.vlogo b::after { color: #ff3d7f; animation: vl-glitch-b 7s infinite steps(1); }
.vl-s::before, .vl-s::after { animation-delay: .07s !important; }
.vlogo { animation: vl-breathe 3.6s ease-in-out infinite; }
@keyframes vl-breathe { 50% { filter: brightness(1.18) drop-shadow(0 0 6px rgba(47,107,255,.45)); } }
@keyframes vl-glitch-a {
  0%, 88%, 100% { opacity: 0; transform: none; clip-path: inset(0 0 0 0); }
  89% { opacity: .85; transform: translate(-2px, 0); clip-path: inset(10% 0 55% 0); }
  91% { opacity: .85; transform: translate(2px, 0); clip-path: inset(60% 0 8% 0); }
  93% { opacity: .6; transform: translate(-1px, 0); clip-path: inset(30% 0 40% 0); }
  95% { opacity: 0; }
}
@keyframes vl-glitch-b {
  0%, 88%, 100% { opacity: 0; transform: none; clip-path: inset(0 0 0 0); }
  90% { opacity: .55; transform: translate(2px, 0); clip-path: inset(50% 0 20% 0); }
  92% { opacity: .55; transform: translate(-2px, 0); clip-path: inset(5% 0 70% 0); }
  94% { opacity: 0; }
}
.vlogo:hover b::before, .vlogo:hover b::after { animation-duration: 1.2s; }
.side-brand { gap: 12px; align-items: flex-end; }
.side-brand .vl-sub { font-family: var(--mono); font-size: 11px; color: var(--dim); letter-spacing: .12em; text-transform: uppercase; margin: 0 0 2px; }
.vlogo.big .vl-v { font-size: 46px; text-shadow: 0 0 22px rgba(47,107,255,.7), 0 0 3px rgba(47,107,255,.9); }
.vlogo.big .vl-s { font-size: 40px; }
.login-mark { margin: -4px 0 8px; }
.login-card > .brand { display: none; }
@media (max-width: 1100px) and (min-width: 761px) {
  .side-brand .vl-sub { display: none; }
  .side-brand .vl-v { font-size: 13px; } .side-brand .vl-s { font-size: 11.5px; }
}
@media (max-width: 760px) {
  .side-brand .vl-v { font-size: 17px; } .side-brand .vl-s { font-size: 15px; }
  .side-brand .vl-sub { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) { .vlogo, .vlogo b::before, .vlogo b::after { animation: none !important; } }

.side-brand .vlogo { display: inline-grid !important; }

/* ── профиль клиента справа от заказа (ПК), в духе Telegram Desktop ── */
.side-pf { display: none; }
@media (min-width: 1200px) {
  .orders { grid-template-columns: 300px minmax(0, 1fr) 320px; }
  .side-pf { display: flex; flex-direction: column; padding: 0; overflow-y: auto; overflow-x: hidden; min-height: 0; }
}
@media (min-width: 1600px) { .orders { grid-template-columns: 320px minmax(0, 1fr) 360px; } }
.side-pf.loading > * { opacity: .45; transition: opacity .2s; }
.spf-empty { margin: auto; padding: 30px; text-align: center; color: var(--dim); font-size: 13px; }
.spf-hero { position: relative; text-align: center; padding: 26px 16px 16px; overflow: hidden; isolation: isolate; border-bottom: 1px solid var(--border); }
.spf-bg { position: absolute; inset: 0; z-index: -1; }
.spf-bg.photo { filter: blur(30px) saturate(130%); opacity: .45; transform: scale(1.3); }
.spf-bg::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 30%, var(--card)); }
.spf-ava { width: 92px; height: 92px; margin: 0 auto 12px; border-radius: 50%; overflow: hidden; box-shadow: 0 10px 30px -10px rgba(0,0,0,.7); }
.spf-ava img, .spf-ava span { width: 100%; height: 100%; object-fit: cover; display: grid; place-items: center; font-size: 38px; font-weight: 600; color: #fff; }
.spf-name { font-size: 18px; font-weight: 700; overflow-wrap: anywhere; }
.spf-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.spf-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 16px; }
.spf-act { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 10px 4px 8px; border-radius: 12px; border: 0;
  background: rgba(28, 33, 44, .85); color: var(--text-2); text-decoration: none; font-size: 12px; font-weight: 600; cursor: pointer; }
.spf-act .i { width: 20px; height: 20px; color: var(--icon-on); }
.spf-act:hover { background: rgba(40, 47, 62, .95); color: var(--text); }
.spf-act.off { opacity: .4; cursor: default; }
.spf-stats { display: grid; grid-template-columns: repeat(3, 1fr); padding: 14px 6px; border-bottom: 1px solid var(--border); }
.spf-stats > div { text-align: center; border-left: 1px solid var(--border); }
.spf-stats > div:first-child { border-left: 0; }
.spf-stats b { display: block; font-size: 15px; } .spf-stats small { color: var(--muted); font-size: 12px; }
.spf-stats .due b { color: var(--err); } .spf-stats .ok b { color: var(--ok); }
.spf-sec { padding: 6px 0; border-bottom: 1px solid var(--border); }
.spf-row { display: flex; gap: 14px; padding: 9px 18px; align-items: flex-start; }
.spf-row[data-copy-text] { cursor: pointer; } .spf-row[data-copy-text]:hover { background: var(--card-2); }
.spf-row > .i { width: 20px; height: 20px; margin-top: 2px; }
.spf-row > div { min-width: 0; } .spf-val { font-size: 14px; line-height: 1.35; overflow-wrap: anywhere; } .spf-row small { color: var(--muted); font-size: 12px; }
.spf-menu { padding: 4px 0; }
.spf-item { display: flex; align-items: center; gap: 14px; width: 100%; padding: 10px 18px; border: 0; background: transparent; color: var(--text-2);
  font-size: 14px; cursor: pointer; text-align: left; }
.spf-item .i { width: 20px; height: 20px; } .spf-item span { flex: 1; } .spf-item b { color: var(--muted); font-weight: 600; font-size: 13px; }
.spf-item:hover { background: var(--card-2); } .spf-item.on { background: var(--accent-soft); color: var(--text); } .spf-item.on .i { color: var(--icon-on); }
.spf-list { padding: 10px; display: grid; gap: 6px; align-content: start; }
.spf-none { text-align: center; color: var(--dim); padding: 20px 0; font-size: 13px; }
.spf-order { background: var(--field); border: 1px solid var(--border); border-radius: 12px; padding: 9px 11px; cursor: pointer; display: grid; gap: 3px; }
.spf-order:hover { border-color: var(--border-2); } .spf-order.cur { border-color: var(--accent-line); background: #121a28; cursor: default; }
.spf-o-top { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 12px; }
.spf-o-name { font-size: 13.5px; font-weight: 600; overflow-wrap: anywhere; }
.spf-o-money { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--text-2); }
.spf-o-money .due { color: var(--err); } .spf-o-money .ok { color: var(--ok); }
.spf-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; border-radius: 12px; overflow: hidden; }
.spf-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; cursor: pointer; background: var(--field); }
.spf-dl { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--field); border: 1px solid var(--border);
  border-radius: 12px; padding: 9px 11px; }
.spf-dl small { color: var(--muted); font-size: 12px; } .spf-dl .pf-ttn { font-size: 12.5px; }
.side-pf > * { flex-shrink: 0; }
@media (min-width: 1200px) and (max-width: 1440px) { .orders { grid-template-columns: 270px minmax(0, 1fr) 300px; } }

/* ── доставки: список ТТН «консолью», как в программе ── */
.console { background: #06080c; border: 1px solid var(--border); border-radius: 12px; padding: 8px 6px; overflow-y: auto; min-height: 160px;
  font: 13px/1.65 var(--mono); box-shadow: inset 0 0 40px rgba(0,0,0,.6); }
.dl-main .console.dl-rows { flex: 1; max-height: none; }
.c-line { display: flex; align-items: flex-start; gap: 8px; padding: 0 8px; border-radius: 6px; cursor: pointer; white-space: pre-wrap; }
.c-line:hover { background: rgba(255,255,255,.035); }
.c-txt { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.c-line.info { color: #d9dee8; } .c-line.ok { color: var(--ok); } .c-line.warn { color: var(--warn); } .c-line.err { color: var(--err); }
.c-line.dim { color: var(--dim); cursor: default; }
.c-del { visibility: hidden; border: 0; background: transparent; color: var(--dim); cursor: pointer; font: inherit; padding: 0 4px; line-height: inherit; }
.c-line:hover .c-del { visibility: visible; } .c-del:hover { color: var(--err); }
.dl-add { display: grid; grid-template-columns: 1.3fr 1.3fr .9fr .8fr auto auto; gap: 8px; padding: 10px; background: var(--field);
  border: 1px solid var(--border); border-radius: 12px; }
.dl-add input { font-family: var(--mono); font-size: 13px; }
@media (max-width: 1100px) { .dl-add { grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px) {
  .console { font-size: 12px; } .c-del { visibility: visible; }
  .dl-main .console.dl-rows { max-height: 55vh; }
  .dl-add input { font-size: 16px; } .dl-add .btn { flex: 1; }
}

@media (max-width: 760px) { .photos { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } }

/* лог «откуда взята информация» + кнопки заказа внизу */
.ed-log { min-height: 0; max-height: 300px; font: 12px/1.55 var(--mono); }
.ed-log .c-line { cursor: text; user-select: text; }
.ed-actions { position: sticky; bottom: -18px; z-index: 3; margin: 4px -20px -18px; padding: 12px 20px 16px;
  background: var(--card, #11151c); border-top: 1px solid var(--border); }
@media (max-width: 760px) {
  .ed-actions { position: static; margin: 4px 0 0; padding: 12px 0 0; background: none; }
  .ed-log { max-height: 240px; }
}

/* фото: подписи на плитках, вставка из буфера, перетаскивание */
.photos .add { display: flex; flex-direction: column; gap: 4px; align-items: center; justify-content: center; text-align: center;
  background: none; font-family: inherit; padding: 8px; }
.photos .add small { font-size: 11px; color: var(--muted); line-height: 1.3; }
.photos .add .add-plus { font-size: 26px; line-height: 1; }
.editor.drop { outline: 2px dashed var(--accent); outline-offset: -8px; background: var(--accent-soft); }
/* подсветка проблем в полях */
textarea.bad { border-color: rgba(238,109,117,.65) !important; box-shadow: 0 0 0 3px rgba(238,109,117,.12); }
.f-hint:empty, .checks:empty { display: none; }
.f-hint { display: flex; flex-wrap: wrap; gap: 6px; margin-top: -4px; }
.f-hint span { color: var(--err); font-size: 12.5px; }
.f-hint span::before { content: '⚠ '; }
.checks { display: flex; flex-wrap: wrap; gap: 6px; margin-top: -4px; }
.chk { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; padding: 4px 9px; border-radius: 999px; border: 1px solid; }
.chk.ok { color: var(--ok); border-color: rgba(74,222,128,.25); background: rgba(74,222,128,.07); }
.chk.bad { color: var(--err); border-color: rgba(238,109,117,.35); background: rgba(238,109,117,.08); }

/* ── мой профиль внизу слева ── */
.me { display: flex; align-items: center; gap: 10px; padding: 8px; margin: 0 -4px; border-radius: 12px; cursor: pointer; transition: background .15s; min-width: 0; }
.me:hover { background: rgba(255,255,255,.04); }
.me-ava { position: relative; width: 38px; height: 38px; border-radius: 50%; flex: none; display: grid; place-items: center; overflow: hidden;
  background: linear-gradient(135deg, #5a86e0, #2b4f9e); color: #fff; font-weight: 700; font-size: 15px; }
.me-ava img { width: 100%; height: 100%; object-fit: cover; }
.me-txt { min-width: 0; flex: 1; display: grid; line-height: 1.25; }
.me-txt b { font-size: 13.5px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-txt small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--err); box-shadow: 0 0 0 3px var(--err-soft); }
.me.on .me-dot { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
@media (max-width: 1100px) and (min-width: 761px) {
  .me { justify-content: center; padding: 6px 0; margin: 0; position: relative; } .me-txt { display: none; }
  .me-dot { position: absolute; right: calc(50% - 22px); bottom: 6px; border: 2px solid var(--side, #0c0f14); }
}
@media (max-width: 760px) {
  .me { padding: 0; margin: 0; gap: 8px; } .me:hover { background: none; }
  .me-ava { width: 32px; height: 32px; font-size: 13px; } .me-txt b { font-size: 13px; } .me-txt small { font-size: 11.5px; }
  .me-txt { max-width: 42vw; }
}
/* список заказов на ПК — шире */
@media (min-width: 1200px) { .orders { grid-template-columns: 360px minmax(0, 1fr) 320px; } }
@media (min-width: 1200px) and (max-width: 1440px) { .orders { grid-template-columns: 330px minmax(0, 1fr) 290px; } }
@media (min-width: 1600px) { .orders { grid-template-columns: 390px minmax(0, 1fr) 360px; } }
@media (min-width: 761px) and (max-width: 1199px) { .orders { grid-template-columns: 340px minmax(0, 1fr); } }
@media (min-width: 761px) and (max-width: 1100px) { .orders { grid-template-columns: 300px minmax(0, 1fr); } }

/* отчёт за день */
.rp-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.rp-row select { width: auto; min-width: 200px; }
.rp-preview { margin: 0; min-height: 0; max-height: none; padding: 12px 14px; font: 12.5px/1.5 var(--mono); color: #d9dee8; white-space: pre-wrap; }
@media (max-width: 760px) { .rp-row select, .rp-row .btn { flex: 1 1 100%; } }
