/* Customer Cabinet — TG theme adaptation + Fotofactor accent
 *
 * Цветовая стратегия:
 * 1. Telegram задаёт --tg-theme-* через themeParams → используем их.
 * 2. Если TG не задал (preview без TG, sandbox) — fallback по prefers-color-scheme.
 * 3. На некоторых TG-клиентах bg/text задаются, а secondary_bg/hint — нет:
 *    дополнительный fallback через computed свойства.
 */

:root {
  /* default: dark fallbacks (используются если TG не задал и system → dark) */
  --bg: var(--tg-theme-bg-color, #1a1a1a);
  --fg: var(--tg-theme-text-color, #f2f2f2);
  --muted: var(--tg-theme-hint-color, #9aa0a6);
  --card: var(--tg-theme-secondary-bg-color, #232323);
  --accent: var(--tg-theme-button-color, #2ea7e0);
  --on-accent: var(--tg-theme-button-text-color, #ffffff);
  --link: var(--tg-theme-link-color, #2ea7e0);
  --border: rgba(255, 255, 255, 0.06);

  --ff-orange: #ff7a00;
  --ff-amber: #ffb000;
  --ok: #2fbf71;
  --warn: #ffb000;
  --err: #d65a5a;

  --radius: 8px;
  --tap: 44px;
}

/* Light theme fallback: если TG не задал bg-color и system предпочитает light */
@media (prefers-color-scheme: light) {
  :root {
    --bg: var(--tg-theme-bg-color, #ffffff);
    --fg: var(--tg-theme-text-color, #14161a);
    --muted: var(--tg-theme-hint-color, #6b7280);
    --card: var(--tg-theme-secondary-bg-color, #f3f4f6);
    --border: rgba(0, 0, 0, 0.08);
  }
}

/* Явный override через body[data-theme="light"] (если кто-то ставит вручную) */
body[data-theme="light"] {
  --bg: #ffffff;
  --fg: #14161a;
  --muted: #6b7280;
  --card: #f3f4f6;
  --border: rgba(0, 0, 0, 0.08);
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--fg);
  font: 14px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: contain;
}

.app {
  min-height: 100vh;
  padding: 0 0 56px 0; /* tab-bar offset */
  max-width: 720px;
  margin: 0 auto;
}

.head {
  position: sticky;
  top: 0; z-index: 10;
  background: var(--bg);
  padding: 10px 14px 8px;
  border-bottom: 1px solid var(--border);
}
.head .title { font-size: 16px; font-weight: 600; line-height: 1.2; }
.head .sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.head .menu { position: absolute; top: 8px; right: 10px;
  background: transparent; border: none; color: var(--fg); font-size: 18px;
  width: 36px; height: 36px; cursor: pointer; }

.section { padding: 10px 14px 0; }
.section h2 { font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px;
  color: var(--muted); margin: 14px 0 6px; padding-left: 4px; font-weight: 600; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 6px;
  border: 1px solid var(--border);
}
.card.tappable { cursor: pointer; }
.card.tappable:active { transform: scale(0.99); opacity: 0.85; }

.alert {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--card);
  border-left: 3px solid var(--accent);
  padding: 10px 12px;
  border-radius: var(--radius);
  margin-bottom: 6px;
  cursor: pointer;
}
.alert.high { border-left-color: var(--err); }
.alert.medium { border-left-color: var(--warn); }
.alert.low { border-left-color: var(--accent); }
.alert .icon { font-size: 18px; flex-shrink: 0; }
.alert .content { flex: 1; min-width: 0; }
.alert .title { font-size: 13px; font-weight: 600; }
.alert .body { font-size: 12px; color: var(--muted); margin-top: 2px; }
.alert .arrow { color: var(--muted); flex-shrink: 0; }

.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  background: var(--card);
  padding: 8px;
  border-radius: var(--radius);
}
.kpi {
  text-align: center;
  padding: 6px 4px;
  border-right: 1px solid var(--border);
}
.kpi:last-child { border-right: none; }
.kpi .value { font-size: 17px; font-weight: 700; line-height: 1.1; }
.kpi .label { font-size: 10px; color: var(--muted); margin-top: 3px; text-transform: lowercase; }
.kpi .delta { font-size: 10px; margin-top: 2px; }
.kpi .delta.pos { color: var(--ok); }
.kpi .delta.neg { color: var(--err); }
.kpi .delta.neutral { color: var(--muted); }

.hypothesis { background: var(--card); border-radius: var(--radius); padding: 10px 12px; }
.hypothesis .title { font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.hypothesis .summary { color: var(--muted); font-size: 12px; }
.hypothesis .actions { margin-top: 8px; }

.calendar-event {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); padding: 10px 12px;
  border-radius: var(--radius); margin-bottom: 6px;
}
.calendar-event .when { font-weight: 600; font-size: 12px; color: var(--accent); min-width: 70px; }
.calendar-event .what { flex: 1; font-size: 13px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: var(--on-accent);
  border: none; border-radius: var(--radius);
  padding: 10px 14px; font-size: 14px; font-weight: 600;
  min-height: var(--tap); width: 100%;
  cursor: pointer; touch-action: manipulation;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.secondary { background: var(--card); color: var(--fg); border: 1px solid var(--border); }
.btn.danger { background: var(--err); }
.btn.ff { background: var(--ff-orange); }
.btn-row { display: flex; gap: 6px; padding: 10px 14px 14px; }
.btn-row .btn { flex: 1; }

.tab-bar {
  position: fixed; bottom: 0; left: 0; right: 0;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--card);
  border-top: 1px solid var(--border);
  z-index: 20;
  padding-bottom: env(safe-area-inset-bottom);
}
.tab {
  display: flex; flex-direction: column; align-items: center;
  padding: 6px 0 8px; cursor: pointer; color: var(--muted);
  border: none; background: transparent;
  min-height: 56px;
}
.tab.active { color: var(--accent); }
.tab .icon { font-size: 20px; }
.tab .label { font-size: 10px; margin-top: 2px; }

.deal {
  background: var(--card);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 6px;
  cursor: pointer;
}
.deal .title { font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.deal .stages { display: flex; gap: 2px; margin-bottom: 4px; }
.deal .stage-pip {
  flex: 1; height: 4px; border-radius: 2px;
  background: var(--border);
}
.deal .stage-pip.done { background: var(--ok); }
.deal .stage-pip.active { background: var(--accent); }
.deal .stage-labels { display: flex; gap: 2px; font-size: 10px; color: var(--muted); }
.deal .stage-labels .lbl { flex: 1; text-align: center; }
.deal .stage-labels .lbl.done { color: var(--ok); }
.deal .stage-labels .lbl.active { color: var(--accent); font-weight: 600; }
.deal .meta { font-size: 11px; color: var(--muted); margin-top: 4px; }
.deal .meta .open { float: right; color: var(--accent); }

.card-row {
  display: flex; gap: 10px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 8px 10px;
  margin-bottom: 6px;
  cursor: pointer;
  align-items: center;
}
.card-row .photo {
  width: 44px; height: 44px; border-radius: 6px;
  background: var(--border); flex-shrink: 0;
  background-size: cover; background-position: center;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.card-row .info { flex: 1; min-width: 0; }
.card-row .title { font-weight: 600; font-size: 13px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-row .meta { font-size: 11px; color: var(--muted); }
.card-row .metrics { font-size: 11px; margin-top: 2px; }
.card-row .badge { font-size: 11px; flex-shrink: 0; }
.card-row .badge.ok { color: var(--ok); }
.card-row .badge.problem { color: var(--err); }
.card-row .badge.new { color: var(--accent); }

.filter-pills { display: flex; gap: 6px; padding: 0 14px 8px;
  overflow-x: auto; white-space: nowrap; }
.filter-pill {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 16px; padding: 4px 12px; font-size: 12px;
  color: var(--fg); cursor: pointer; flex-shrink: 0;
}
.filter-pill.active { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }

.ticket-row {
  background: var(--card); border-radius: var(--radius);
  padding: 10px 12px; margin-bottom: 6px; cursor: pointer;
}
.ticket-row .top { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.ticket-row .meta { font-size: 11px; color: var(--muted); margin-top: 3px; }
.ticket-row .last { font-size: 12px; color: var(--muted); margin-top: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ticket-row .status-tag { font-size: 10px; padding: 1px 6px; border-radius: 3px;
  text-transform: uppercase; letter-spacing: 0.4px; flex-shrink: 0; }
.ticket-row .status-tag.open { background: rgba(214,90,90,.15); color: var(--err); }
.ticket-row .status-tag.in_progress { background: rgba(255,176,0,.15); color: var(--warn); }
.ticket-row .status-tag.closed { background: rgba(108,108,108,.20); color: var(--muted); }

.bottomsheet-bg {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex; align-items: flex-end; justify-content: center;
  z-index: 50;
}
.bottomsheet {
  background: var(--bg); width: 100%; max-width: 720px;
  border-radius: 14px 14px 0 0;
  padding: 14px 14px 22px;
  max-height: 90vh; overflow-y: auto;
  border-top: 1px solid var(--border);
}
.bottomsheet h3 { margin: 0 0 10px; font-size: 16px; }
.bottomsheet .close { position: absolute; right: 14px; top: 14px;
  background: transparent; border: none; color: var(--muted); font-size: 20px;
  width: 32px; height: 32px; cursor: pointer; }

.cat-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.cat-item {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 12px;
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; font-size: 14px;
}
.cat-item.active { border-color: var(--accent); }

textarea, input[type="text"] {
  width: 100%; background: var(--card); color: var(--fg);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px 12px; font-size: 14px; font-family: inherit;
  resize: vertical; min-height: 80px;
}

.thread-msg { margin-bottom: 8px; }
.thread-msg .who { font-size: 11px; color: var(--muted); margin-bottom: 2px; }
.thread-msg .bubble {
  background: var(--card); padding: 8px 12px; border-radius: 12px;
  font-size: 13px; max-width: 85%; word-wrap: break-word;
}
.thread-msg.client { text-align: right; }
.thread-msg.client .bubble { display: inline-block; background: var(--accent); color: var(--on-accent); border-bottom-right-radius: 4px; }
.thread-msg.team .bubble { background: var(--card); border-bottom-left-radius: 4px; }
.thread-input {
  position: sticky; bottom: 0; background: var(--bg);
  display: flex; gap: 6px; padding: 8px 0 0; align-items: flex-end;
}
.thread-input textarea { min-height: 38px; max-height: 120px; }
.thread-input .send {
  width: var(--tap); height: var(--tap); background: var(--accent);
  color: var(--on-accent); border: none; border-radius: var(--radius);
  font-size: 18px; cursor: pointer; flex-shrink: 0;
}

/* Skeleton — два класса (.skel + .skeleton) для совместимости с QA-probes */
.skel, .skeleton { background: var(--card); border-radius: var(--radius);
  height: 60px; margin-bottom: 6px;
  animation: pulse 1.4s ease-in-out infinite; }
.skeleton.tall { height: 120px; }
.skeleton.chart { height: 180px; background: linear-gradient(180deg, var(--card) 0%, rgba(46,167,224,0.08) 100%); }
@keyframes pulse { 0%, 100% { opacity: 0.6; } 50% { opacity: 1; } }

.empty { text-align: center; padding: 30px 14px; color: var(--muted); font-size: 13px; }
.empty .cta { margin-top: 12px; }

.error-banner {
  background: rgba(214,90,90,.15); border: 1px solid var(--err);
  border-radius: var(--radius); padding: 10px 12px;
  margin: 10px 14px; color: var(--err); font-size: 12px;
}

/* Onboarding */
.ob-bg { position: fixed; inset: 0; background: var(--bg); z-index: 100;
  display: flex; flex-direction: column; }
.ob-skip { position: absolute; top: 14px; right: 14px;
  background: transparent; border: none; color: var(--muted); font-size: 13px; cursor: pointer; }
.ob-content { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0 24px; text-align: center; }
.ob-icon { font-size: 56px; margin-bottom: 16px; }
.ob-title { font-size: 22px; font-weight: 700; margin-bottom: 10px; }
.ob-body { font-size: 14px; color: var(--muted); line-height: 1.5; }
/* W2 hourly onboarding — длиннее тексты, нужна wider content */
.ob-content.w2-text { max-width: 360px; }
.ob-content.w2-text .ob-body { text-align: left; font-size: 13px; line-height: 1.5; }
.ob-perks { margin-top: 18px; display: flex; flex-direction: column; gap: 4px;
  background: var(--card); padding: 8px 14px; border-radius: var(--radius);
  width: 100%; max-width: 280px; }
.ob-perk { font-size: 12px; padding: 4px 0; display: flex; align-items: center; gap: 8px; color: var(--fg); }
.ob-dots { display: flex; gap: 6px; justify-content: center; margin: 16px 0; }
.ob-dots .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border); }
.ob-dots .dot.active { background: var(--accent); width: 18px; border-radius: 4px; }
.ob-nav { display: flex; gap: 8px; padding: 14px; }
.ob-nav .btn { flex: 1; }

/* Modal full-screen для detail (deal/card) */
.modal-bg { position: fixed; inset: 0; background: var(--bg); z-index: 30;
  overflow-y: auto; padding-bottom: 80px; }
.modal-back {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 11;
}
.modal-back button { background: transparent; border: none; color: var(--fg); font-size: 18px; cursor: pointer; }
.modal-back .title { font-size: 16px; font-weight: 600; }
.modal-back .sub { font-size: 11px; color: var(--muted); }

.slide-frame {
  background: var(--card); border-radius: var(--radius);
  margin: 10px 14px;
  aspect-ratio: 16 / 20;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 14px;
}
.slide-controls { display: flex; justify-content: space-between; align-items: center;
  padding: 0 14px 10px; color: var(--muted); font-size: 12px; }

.diag-list { padding: 0 14px; }
.diag-list .item {
  background: var(--card); padding: 8px 12px;
  border-radius: var(--radius); margin-bottom: 4px; font-size: 13px;
  border-left: 3px solid var(--ff-amber);
}

.sticky-bottom {
  position: sticky; bottom: 0; background: var(--bg);
  padding: 10px 14px 14px;
  border-top: 1px solid var(--border);
}

/* === v2 evidence-based components === */

/* StageTracker — 5-этапный progress */
.stage-tracker { background: var(--card); padding: 12px; border-radius: var(--radius); }
.stage-pips { display: flex; gap: 4px; margin-bottom: 8px; }
.stage-pip-v2 { flex: 1; height: 6px; border-radius: 3px; background: var(--border); transition: background 0.3s; }
.stage-pip-v2.done { background: var(--ok); }
.stage-pip-v2.active { background: var(--accent); animation: pulse-pip 1.6s ease-in-out infinite; }
.stage-pip-v2.pending { background: var(--border); }
.stage-pip-v2.blocked { background: var(--err); }
@keyframes pulse-pip { 0%, 100% { opacity: 0.6; } 50% { opacity: 1; } }
.stage-labels-v2 { display: flex; gap: 4px; }
.stage-labels-v2 .lbl { flex: 1; text-align: center; font-size: 10px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stage-labels-v2 .lbl.done { color: var(--ok); }
.stage-labels-v2 .lbl.active { color: var(--accent); font-weight: 600; }

/* ActionRequiredBanner */
.action-banner {
  background: rgba(255,176,0,0.10); border-left: 4px solid var(--warn);
  border-radius: var(--radius); padding: 12px;
}
.action-banner .action-title { font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--warn); margin-bottom: 8px; font-weight: 600; }
.action-banner .action-body { margin-bottom: 10px; font-size: 14px; }

/* MoneyCard на E_Order_Active */
.money-card { background: var(--card); padding: 12px; border-radius: var(--radius); }
.money-line { font-size: 14px; margin-bottom: 8px; }
.money-progress { margin-bottom: 8px; }
.money-progress .bar { background: var(--border); height: 6px; border-radius: 3px; overflow: hidden; }
.money-progress .bar .fill { background: var(--ok); height: 100%; transition: width 0.4s; }
.money-progress .meta { font-size: 11px; color: var(--muted); margin-top: 4px; }
.money-schedule { font-size: 12px; color: var(--muted); margin-bottom: 10px; }

/* Meta row */
.meta-row { display: flex; justify-content: space-between; padding: 8px 12px;
  background: var(--card); border-radius: var(--radius); font-size: 13px;
  margin-bottom: 8px; }

/* Sticky banner — например missing logotype */
.sticky-banner {
  background: rgba(255,122,0,0.15); border: 1px solid var(--ff-orange);
  color: var(--ff-orange); padding: 10px 14px; border-radius: var(--radius);
  margin: 10px 14px; font-size: 13px; display: flex; align-items: center;
  gap: 10px; justify-content: space-between;
}
.btn-inline { background: var(--card); border: 1px solid var(--border);
  padding: 4px 10px; border-radius: 4px; color: var(--accent); font-size: 12px;
  cursor: pointer; text-decoration: none; }
.btn-inline.ff { color: var(--ff-orange); border-color: var(--ff-orange); }
.btn-inline:hover { background: var(--bg); }

/* E_Money */
.invoice-card { background: var(--card); padding: 12px; border-radius: var(--radius); }
.inv-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.inv-head .muted { font-size: 11px; color: var(--muted); margin-top: 2px; }
.inv-amounts { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px;
  margin-bottom: 12px; padding: 8px; background: var(--bg); border-radius: 6px; }
.inv-amounts > div { font-size: 12px; }
.method-card { background: var(--card); padding: 10px 12px; border-radius: var(--radius); margin-bottom: 6px; }
.m-head { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.badge-primary { font-size: 9px; padding: 2px 6px; background: var(--accent);
  color: var(--on-accent); border-radius: 3px; text-transform: uppercase; }
.m-value { font-size: 13px; font-family: ui-monospace, monospace; word-break: break-all; }
.m-hint { font-size: 11px; color: var(--muted); margin: 4px 0 6px; }
.m-actions { display: flex; gap: 6px; }
.history-row { display: flex; justify-content: space-between; align-items: center;
  background: var(--card); padding: 8px 12px; border-radius: var(--radius); margin-bottom: 4px; }
.history-row .muted { font-size: 11px; color: var(--muted); }
.status-tag { font-size: 10px; padding: 1px 6px; border-radius: 3px;
  text-transform: uppercase; letter-spacing: 0.4px; flex-shrink: 0; }
.status-tag.paid { background: rgba(47,191,113,.18); color: var(--ok); }
.status-tag.partial { background: rgba(255,176,0,.18); color: var(--warn); }
.status-tag.awaiting_payment { background: rgba(214,90,90,.18); color: var(--err); }
.status-tag.overdue { background: rgba(214,90,90,.18); color: var(--err); }
.status-tag.open { background: rgba(214,90,90,.15); color: var(--err); }
.status-tag.in_progress { background: rgba(255,176,0,.15); color: var(--warn); }
.status-tag.closed { background: rgba(108,108,108,.20); color: var(--muted); }

/* E_Archive */
.archive-card { display: flex; gap: 10px; background: var(--card); padding: 10px 12px;
  border-radius: var(--radius); margin-bottom: 6px; }
.ar-photo { width: 48px; height: 48px; border-radius: 6px; background: var(--border);
  display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
.ar-info { flex: 1; min-width: 0; }
.ar-title { font-weight: 600; font-size: 13px; }
.ar-meta { font-size: 11px; color: var(--muted); margin: 2px 0 6px; }
.ar-actions { display: flex; gap: 6px; }

/* Order Detail tabs (3 internal) */
.detail-tabs { display: flex; background: var(--bg); border-bottom: 1px solid var(--border);
  position: sticky; top: 56px; z-index: 9; }
.dtab { flex: 1; background: transparent; border: none; color: var(--muted);
  padding: 10px 8px; font-size: 13px; cursor: pointer; border-bottom: 2px solid transparent;
  font-family: inherit; }
.dtab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

/* Brief tab */
.brief-row { display: flex; gap: 10px; padding: 10px 12px;
  background: var(--card); border-radius: var(--radius); margin-bottom: 4px; }
.brief-row .check { flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; }
.brief-row .check.ok { background: rgba(47,191,113,.18); color: var(--ok); }
.brief-row .check.miss { background: rgba(214,90,90,.18); color: var(--err); }
.brief-row .brief-info { flex: 1; min-width: 0; }
.brief-row .brief-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.3px; }
.brief-row .brief-value { font-size: 13px; margin-top: 2px; word-wrap: break-word; }

/* Preview tab */
.format-switcher { display: flex; gap: 6px; padding: 8px 14px;
  border-bottom: 1px solid var(--border); }
.file-card { display: flex; gap: 10px; background: var(--card); padding: 10px 12px;
  border-radius: var(--radius); margin-bottom: 6px; align-items: center; }
.file-preview { width: 48px; height: 48px; border-radius: 6px; background-color: var(--border);
  background-size: cover; background-position: center; flex-shrink: 0; }
.file-info { flex: 1; min-width: 0; }
.file-info .muted { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* Adaptive blocks (Vidar segmentation extension) */
.sticky-banner.adaptive {
  background: rgba(160,112,224,0.12); border-color: var(--purple); color: var(--purple);
}
.footer-card { background: var(--card); border-left: 3px solid var(--purple);
  padding: 10px 12px; border-radius: var(--radius); display: flex; gap: 10px;
  align-items: center; }
.footer-card .fc-text { flex: 1; font-size: 13px; }
.upsell-card { background: linear-gradient(135deg, var(--card), rgba(255,122,0,0.08));
  border: 1px solid var(--ff-orange); border-radius: var(--radius); padding: 14px; }
.upsell-card .us-title { font-weight: 700; font-size: 14px; margin-bottom: 6px; color: var(--ff-orange); }
.upsell-card .us-body { font-size: 12px; color: var(--muted); margin-bottom: 10px; line-height: 1.4; }

/* Revision Loop sub-status на E_Order_Active */
.rev-substatus { background: rgba(46,167,224,0.08); border-left: 3px solid var(--accent);
  border-radius: var(--radius); padding: 10px 12px; display: flex; gap: 10px; }
.rev-substatus .rev-icon { font-size: 22px; flex-shrink: 0; }
.rev-substatus .rev-title { font-weight: 600; color: var(--accent); }
.rev-substatus .rev-body { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* Version bar в Превью */
.version-bar { display: flex; justify-content: space-between; align-items: center;
  padding: 8px 14px; background: var(--card); font-size: 12px;
  border-bottom: 1px solid var(--border); }
.version-bar .version-status { color: var(--ok); font-weight: 600; }

/* PreviewApprovalBanner */
.preview-banner { background: rgba(255,176,0,0.10); border: 1px solid var(--warn);
  border-radius: var(--radius); padding: 14px; }
.preview-banner .pb-head { font-weight: 700; font-size: 14px; margin-bottom: 6px; color: var(--warn); }
.preview-banner .pb-countdown { font-size: 13px; margin-bottom: 12px; }
.preview-banner .pb-actions { display: flex; gap: 6px; flex-direction: column; }
.preview-banner .pb-actions .btn { width: 100%; }

/* Service Catalog */
.catalog-cat { margin-bottom: 16px; }
.catalog-cat .cat-head { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--muted); margin: 0 0 6px; padding-left: 4px; font-weight: 600; }
.service-card { background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px; margin-bottom: 6px; }
.service-card .svc-title { font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.service-card .svc-desc { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.service-card .svc-pricing { display: flex; justify-content: space-between;
  font-size: 12px; margin-bottom: 8px; }

/* NewOrderForm wizard */
.field-label { display: block; font-size: 12px; color: var(--muted);
  margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.4px; }
input[type="number"], input[type="date"], input[type="range"] {
  width: 100%; background: var(--card); color: var(--fg);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px 12px; font-size: 14px; font-family: inherit;
}
input[type="range"] { padding: 0; height: 32px; }
.confirm-summary { background: var(--card); padding: 12px; border-radius: var(--radius);
  font-size: 13px; line-height: 1.6; }
.wiz-nav { display: flex; gap: 6px; margin-top: 14px; }
.wiz-nav .btn { flex: 1; }
.wiz-welcome h4 { margin: 0 0 10px; font-size: 16px; }
.wiz-welcome p { font-size: 13px; line-height: 1.5; margin: 0 0 10px; color: var(--fg); }
.wiz-welcome strong { color: var(--ff-orange); }
.live-calc { background: var(--card); padding: 8px 12px; border-radius: 6px;
  font-size: 13px; margin-top: 8px; border-left: 3px solid var(--accent); }
.live-calc > div + div { margin-top: 2px; }
.urgent-hint { background: rgba(255,176,0,0.10); border: 1px solid var(--warn);
  border-radius: 6px; padding: 8px 10px; font-size: 12px; color: var(--warn);
  margin-top: 8px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.reschedule-note { background: var(--card); padding: 10px 12px; border-radius: 6px;
  font-size: 12px; margin-top: 8px; border-left: 3px solid var(--ff-orange);
  line-height: 1.4; }
.step-progress { display: flex; align-items: center; gap: 8px; margin-top: 14px;
  font-size: 11px; color: var(--muted); }
.step-progress .sp-track { flex: 1; background: var(--border); height: 3px; border-radius: 2px; overflow: hidden; }
.step-progress .sp-fill { background: var(--accent); height: 100%; transition: width 0.3s; }

/* Profile setting row + switch */
.setting-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.switch input { display: none; }
.switch .slider { position: absolute; inset: 0; background: var(--border);
  border-radius: 24px; cursor: pointer; transition: background 0.2s; }
.switch .slider:before { content: ""; position: absolute; left: 3px; top: 3px;
  width: 18px; height: 18px; background: var(--fg); border-radius: 50%;
  transition: transform 0.2s; }
.switch input:checked + .slider { background: var(--ok); }
.switch input:checked + .slider:before { transform: translateX(20px); background: #fff; }

/* Radio stack для wizard */
.radio-stack { display: flex; flex-direction: column; gap: 6px; }
.radio-row { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px;
  background: var(--card); border-radius: var(--radius); cursor: pointer;
  border: 1px solid var(--border); font-size: 13px; }
.radio-row input[type="radio"] { margin-top: 2px; flex-shrink: 0; accent-color: var(--accent); }

/* FAB '+ Заказать услугу' над tab-bar */
.fab-order { position: fixed; bottom: 64px; right: 14px; z-index: 25;
  background: var(--ff-orange); color: #fff; border: none;
  padding: 10px 16px; border-radius: 22px; font-weight: 600;
  font-size: 13px; cursor: pointer;
  box-shadow: 0 4px 12px rgba(255,122,0,0.4); }
.fab-order:active { transform: scale(0.96); }

/* Toast (после order submit) */
.toast { position: fixed; bottom: 80px; left: 14px; right: 14px; z-index: 30;
  background: var(--card); border: 1px solid var(--ok); color: var(--ok);
  padding: 12px 14px; border-radius: var(--radius); font-size: 13px;
  text-align: center; max-width: 720px; margin: 0 auto;
  animation: toast-slide 0.3s ease-out; }
.toast.err { border-color: var(--err); color: var(--err); }
@keyframes toast-slide {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Logistics tab */
.logistics-card { background: var(--card); padding: 14px; border-radius: var(--radius); }
.logistics-card h3 { margin: 0 0 10px; font-size: 15px; }
.log-row { font-size: 13px; margin-bottom: 6px; }
.log-row .muted { color: var(--muted); }
.log-instructions { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border);
  font-size: 12px; color: var(--muted); line-height: 1.4; }

/* R3-2: SlotPicker (W2 hourly wizard step 3) */
.slot-day-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 12px; }
.slot-day { background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  padding: 8px 4px; text-align: center; cursor: pointer; transition: all 0.15s;
  color: var(--fg); font-family: inherit; }
.slot-day:hover:not(.disabled) { border-color: var(--accent); }
.slot-day.active { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.slot-day.disabled { opacity: 0.35; cursor: not-allowed; }
.slot-day .sd-dow { font-size: 10px; color: var(--muted); margin-bottom: 2px; }
.slot-day.active .sd-dow { color: var(--on-accent); opacity: 0.8; }
.slot-day .sd-day { font-size: 12px; font-weight: 600; }

.slot-hour-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 6px; }
.slot-hour { background: var(--card); border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 6px; cursor: pointer; transition: all 0.15s; color: var(--fg);
  font-size: 13px; font-family: inherit; }
.slot-hour:hover:not(.disabled) { border-color: var(--accent); }
.slot-hour.active { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.slot-hour.disabled { opacity: 0.35; cursor: not-allowed; text-decoration: line-through; }

/* R4-3: компактная сводка по счёту под заголовком Active Order */
.money-summary { display: flex; gap: 6px; align-items: center; flex-wrap: wrap;
  padding: 8px 12px; margin: 4px 0 12px; background: var(--card);
  border: 1px solid var(--border); border-radius: 10px; font-size: 13px; }
.money-summary .ms-label { color: var(--muted); font-size: 12px; }
.money-summary strong { color: var(--fg); }
.money-summary .muted { color: var(--muted); }

/* Gate-form (Variant A — new client lead) */
.gate-form-content { padding: 28px 20px; max-width: 420px; margin: 0 auto; }
.gate-form-content .ob-icon { font-size: 44px; margin-bottom: 12px; text-align: center; }
.gate-form-content .ob-title { text-align: center; margin-bottom: 10px; }
.gate-form-content .ob-body { text-align: center; color: var(--muted); font-size: 13px; }

/* DeliveryMemoCard (Vidar): expandable памятка */
.memo-card { background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; }
.memo-header { display: flex; justify-content: space-between; align-items: center;
  width: 100%; padding: 12px 14px; background: transparent; border: 0;
  color: var(--fg); font-family: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer; text-align: left; }
.memo-header:hover { background: var(--bg-hover, rgba(255,255,255,0.03)); }
.memo-body { padding: 0 14px 14px; font-size: 13px; line-height: 1.5; color: var(--fg);
  max-height: 60vh; overflow-y: auto; }
.memo-body p { margin: 0 0 10px; }
.memo-body p:last-child { margin: 0; }

.memo-preview { background: var(--card); border-left: 3px solid var(--accent);
  padding: 10px 12px; border-radius: 8px; }

/* Услуги в заказе card (Roman msg #305) */
.services-card { background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; }
.services-header { display: flex; justify-content: space-between; align-items: center;
  width: 100%; padding: 12px 14px; background: transparent; border: 0;
  color: var(--fg); font-family: inherit; font-size: 13px; cursor: pointer; text-align: left; }
.services-header:hover { background: var(--bg-hover, rgba(255,255,255,0.03)); }
.services-table { width: 100%; border-collapse: collapse; padding: 0; }
.services-table th { padding: 8px 12px; font-size: 11px; font-weight: 600;
  color: var(--muted); text-transform: uppercase; text-align: left;
  border-bottom: 1px solid var(--border); background: rgba(0,0,0,0.05); }
.services-table th:nth-child(2),
.services-table th:nth-child(3),
.services-table th:nth-child(4) { text-align: right; }
.services-table td { padding: 10px 12px; font-size: 13px; color: var(--fg);
  border-bottom: 1px solid var(--border); }
.services-table td:nth-child(2),
.services-table td:nth-child(3),
.services-table td:nth-child(4) { text-align: right; }
.services-table tr:last-child td { border-bottom: 0; }

/* WOLF24-CABINET-AUTH-UI: 4 экрана auth */
.auth-screen { background: var(--bg); }
.auth-screen input[type="email"],
.auth-screen input[type="text"],
.auth-screen input[type="number"] {
  width: 100%; padding: 12px; font-size: 14px;
  background: var(--card); color: var(--fg);
  border: 1px solid var(--border); border-radius: 10px;
}

/* Multi-Company Switcher */
.company-card { background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 14px; margin-bottom: 8px; cursor: pointer;
  transition: border-color 0.15s; }
.company-card:hover { border-color: var(--accent); }
.company-card.active { border-color: var(--accent); background: rgba(255, 100, 0, 0.05); }
.cc-name { font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.cc-role { display: flex; align-items: center; gap: 8px; }
.cc-active { color: var(--accent); font-size: 12px; font-weight: 600; }

/* Role badges */
.role-badge { display: inline-block; padding: 2px 8px; border-radius: 10px;
  font-size: 11px; font-weight: 600; text-transform: uppercase; }
.role-owner { background: rgba(255, 100, 0, 0.15); color: var(--accent); }
.role-manager { background: rgba(100, 150, 255, 0.15); color: #6495ff; }
.role-buyer { background: rgba(100, 200, 100, 0.15); color: #5fb95f; }
.role-finance { background: rgba(200, 150, 50, 0.15); color: #c89632; }

/* Settings → Users */
.users-list { display: flex; flex-direction: column; gap: 8px; }
.user-row { display: flex; justify-content: space-between; align-items: center;
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 12px; }
.user-info { flex: 1; }
.user-name { font-weight: 600; font-size: 13px; }
.user-meta { display: flex; gap: 8px; font-size: 11px; margin: 2px 0 4px; }
.btn-inline.danger { color: var(--err); }

/* Invite form */
.invite-form { background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px; margin-top: 14px; }
.invite-link-card { background: rgba(0,0,0,0.1); padding: 10px; border-radius: 8px;
  margin-top: 12px; }

/* V2 Wave 1: Archive filters bar */
.archive-filters { position: sticky; top: 0; z-index: 5;
  background: var(--bg); padding: 8px 12px; border-bottom: 1px solid var(--border); }
.af-row { display: flex; gap: 6px; flex-wrap: nowrap; overflow-x: auto;
  padding-bottom: 6px; scrollbar-width: none; }
.af-row::-webkit-scrollbar { display: none; }
.af-search { width: 100%; padding: 8px 12px; font-size: 13px;
  background: var(--card); color: var(--fg);
  border: 1px solid var(--border); border-radius: 8px; }
.af-chip { background: var(--card); border: 1px solid var(--border);
  border-radius: 16px; padding: 4px 10px; font-size: 12px; color: var(--fg);
  cursor: pointer; flex-shrink: 0; white-space: nowrap; font-family: inherit; }
.af-chip:hover { border-color: var(--accent); }
.af-chip.active { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.af-sep { color: var(--muted); font-size: 12px; padding: 4px 2px; }

/* Order card (Архив) */
.order-card { background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px; margin-bottom: 10px; }
.oc-head { display: flex; gap: 10px; cursor: pointer; }
.oc-icon { font-size: 24px; flex-shrink: 0; }
.oc-main { flex: 1; min-width: 0; }
.oc-title { font-weight: 600; font-size: 14px; margin-bottom: 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oc-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center;
  font-size: 12px; margin-top: 2px; }

/* Status badges */
.status-badge { display: inline-block; padding: 2px 8px; border-radius: 8px;
  font-size: 11px; font-weight: 600; text-transform: uppercase; }
.status-badge.st-active { background: rgba(100, 200, 100, 0.15); color: #5fb95f; }
.status-badge.st-completed { background: rgba(100, 100, 100, 0.15); color: var(--muted); }
.status-badge.st-archived { background: rgba(150, 150, 150, 0.15); color: var(--muted); }
.status-badge.st-cancelled { background: rgba(200, 80, 80, 0.15); color: #c85050; }

/* Document download buttons на order card */
.oc-docs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px;
  padding-top: 10px; border-top: 1px solid var(--border); }
.doc-btn { display: flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.03); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 10px; font-size: 12px; color: var(--fg);
  cursor: pointer; font-family: inherit; }
.doc-btn:hover:not(.disabled) { border-color: var(--accent); background: rgba(255, 100, 0, 0.05); }
.doc-btn.disabled { opacity: 0.4; cursor: not-allowed; }
.doc-icon { font-size: 14px; }

/* Финансы → Документы по компании */
.company-doc-row { display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 12px; margin-bottom: 6px; cursor: pointer; }
.company-doc-row:hover:not(.disabled) { border-color: var(--accent); }
.company-doc-row.disabled { opacity: 0.5; cursor: not-allowed; }
.cd-icon { font-size: 18px; }
.cd-main { flex: 1; min-width: 0; }
.cd-label { font-size: 13px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cd-action { font-size: 16px; color: var(--accent); }

/* Vidar V2: Onboarding tour overlay + tooltip */
.tour-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  z-index: 100; background: rgba(0,0,0,0.7); pointer-events: auto; }
.tour-tooltip { position: absolute; bottom: 80px; left: 50%; transform: translateX(-50%);
  background: var(--card); color: var(--fg);
  border-radius: 14px; padding: 16px; max-width: 280px; width: calc(100% - 40px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  animation: tt-slide-up 200ms ease-out; }
@keyframes tt-slide-up { from { opacity: 0; transform: translateX(-50%) translateY(20px); }
                          to   { opacity: 1; transform: translateX(-50%) translateY(0); } }
.tour-tooltip::after { content: ''; position: absolute; bottom: -8px; left: 50%;
  transform: translateX(-50%); width: 0; height: 0;
  border-left: 8px solid transparent; border-right: 8px solid transparent;
  border-top: 8px solid var(--card); }
.tour-arrow-0::after { left: 12.5%; }
.tour-arrow-1::after { left: 37.5%; }
.tour-arrow-2::after { left: 62.5%; }
.tour-arrow-3::after { left: 87.5%; }
.tt-title { font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.tt-body { font-size: 13px; color: var(--muted); margin-bottom: 12px; line-height: 1.4; }
.tt-meta { font-size: 11px; margin-bottom: 12px; }
.tt-actions { display: flex; gap: 8px; }
.tt-actions .btn { flex: 1; min-height: 44px; }
.tt-skip { display: block; width: 100%; margin-top: 10px; padding: 8px;
  background: transparent; color: var(--muted); border: 0; font-size: 12px;
  cursor: pointer; font-family: inherit; }
.tt-skip:hover { color: var(--fg); }

.tour-final { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: var(--card); color: var(--fg); border-radius: 14px;
  padding: 30px 24px; max-width: 320px; width: calc(100% - 40px); text-align: center; }
.tf-icon { font-size: 48px; color: var(--accent); margin-bottom: 12px; }
.tf-title { font-size: 18px; font-weight: 600; margin-bottom: 10px; }
.tf-body { font-size: 13px; color: var(--muted); margin-bottom: 20px; line-height: 1.5; }

/* Vidar V2: NPS form */
.nps-modal { z-index: 90; }
.nps-content { background: var(--bg); min-height: 100vh; }
.nps-prompt-banner { display: flex; gap: 12px; align-items: center;
  background: var(--card); border: 1px solid var(--accent);
  border-radius: 12px; padding: 12px; margin: 8px 0; }
.npb-icon { font-size: 28px; flex-shrink: 0; }
.npb-main { flex: 1; min-width: 0; }
.npb-title { font-weight: 600; font-size: 14px; }
.npb-body { font-size: 12px; color: var(--muted); margin-top: 2px; }
.npb-actions { display: flex; flex-direction: column; gap: 4px; flex-shrink: 0; }
.npb-actions .btn { padding: 6px 12px; font-size: 12px; min-height: 32px; }

.nps-question { font-size: 14px; font-weight: 600; margin: 12px 0 16px; }
.nps-slider-grid { display: grid; grid-template-columns: repeat(11, 1fr);
  gap: 4px; margin: 16px 0; }
.nps-dot { display: flex; align-items: center; justify-content: center;
  min-height: 44px; aspect-ratio: 1;
  background: var(--card); border: 1.5px solid var(--border); border-radius: 50%;
  font-size: 13px; font-weight: 600; color: var(--fg);
  cursor: pointer; font-family: inherit; transition: all 150ms;
  padding: 0; }
.nps-dot:hover { transform: scale(1.05); }
.nps-dot.active { transform: scale(1.15); border-width: 2.5px; box-shadow: 0 2px 8px rgba(0,0,0,0.3); }
.nps-dot.nps-bucket-detractor { border-color: #c85050; }
.nps-dot.nps-bucket-detractor.active { background: #c85050; color: #fff; }
.nps-dot.nps-bucket-neutral { border-color: #d49a3a; }
.nps-dot.nps-bucket-neutral.active { background: #d49a3a; color: #fff; }
.nps-dot.nps-bucket-promoter { border-color: #5fb95f; }
.nps-dot.nps-bucket-promoter.active { background: #5fb95f; color: #fff; }
.nps-zones { display: flex; justify-content: space-between; flex-wrap: wrap;
  font-size: 11px; color: var(--muted); margin-top: 8px; gap: 6px; }
.zone-detractor { color: #c85050; }
.zone-neutral { color: #d49a3a; }
.zone-promoter { color: #5fb95f; }
.nps-current { background: var(--card); border-radius: 10px; padding: 12px;
  margin-top: 16px; text-align: center; font-size: 14px; }
.nps-emoji { font-size: 20px; margin-right: 8px; }
.nps-emoji-big { font-size: 56px; margin-bottom: 12px; }

/* V2 Wave 2: Preview annotation session */
.preview-modal { z-index: 95; background: var(--bg); }
.preview-stage { position: relative; padding: 12px; }
.ps-counter { position: absolute; top: 16px; right: 16px; z-index: 2;
  background: rgba(0,0,0,0.6); color: #fff; font-size: 11px;
  padding: 4px 10px; border-radius: 12px; }
.ps-slide-wrap { position: relative; width: 100%; aspect-ratio: 1;
  background: var(--card); border-radius: 12px; overflow: hidden;
  user-select: none; touch-action: pan-y; }
.ps-slide-wrap.annotating { cursor: crosshair; }
.ps-slide-img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.ann-marker { position: absolute; pointer-events: none; }
.ann-marker.point { width: 24px; height: 24px; transform: translate(-50%, -50%);
  background: rgba(255, 100, 0, 0.9); border: 3px solid #fff;
  border-radius: 50%; box-shadow: 0 2px 6px rgba(0,0,0,0.4); }
.ann-marker.rect { border: 3px solid rgba(255, 100, 0, 0.9);
  background: rgba(255, 100, 0, 0.15); border-radius: 4px; }
.ann-marker.pending.point { background: rgba(220, 50, 50, 0.9); animation: pulse-pin 800ms ease-in-out infinite; }
.ann-marker.pending.rect { border-color: rgba(220, 50, 50, 0.9); }
@keyframes pulse-pin { 0%,100% { transform: translate(-50%, -50%) scale(1); }
                       50% { transform: translate(-50%, -50%) scale(1.3); } }

.ps-nav { display: flex; justify-content: space-between; padding: 8px 12px; }
.ps-nav-btn { background: var(--card); border: 1px solid var(--border);
  width: 44px; height: 44px; border-radius: 50%; font-size: 18px; cursor: pointer;
  color: var(--fg); font-family: inherit; }
.ps-nav-btn:disabled { opacity: 0.3; cursor: not-allowed; }

.ps-controls { padding: 8px 12px; }
.ps-mode-hint { background: rgba(255,100,0,0.1); color: var(--accent);
  padding: 10px 12px; border-radius: 8px; font-size: 13px; text-align: center; }
.ps-pending { background: var(--card); border: 1px solid var(--accent);
  border-radius: 10px; padding: 12px; }

.ps-annotations-list { padding: 8px 12px; }
.ann-toggle { width: 100%; background: transparent; border: 0;
  color: var(--muted); font-size: 12px; padding: 6px 0; text-align: left;
  cursor: pointer; font-family: inherit; }
.ann-list { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.ann-item { display: flex; gap: 8px; align-items: center; padding: 8px 10px;
  background: var(--card); border-radius: 8px; font-size: 12px; }
.ann-loc { color: var(--muted); flex-shrink: 0; }
.ann-comment { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; }

.ps-decisions { display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 8px; padding: 12px; position: sticky; bottom: 0;
  background: var(--bg); border-top: 1px solid var(--border); }
.ps-decisions .btn.approve { background: #5fb95f; color: #fff; border: 0; }
.ps-decisions .btn.revisions { background: #d49a3a; color: #fff; border: 0; }
.ps-decisions .btn.reject { background: #c85050; color: #fff; border: 0; }

/* V2 Wave 2: CTR dashboard */
.ctr-card { background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px; }
.ctr-head { display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 10px; }
.ctr-title { font-weight: 600; font-size: 14px; margin-bottom: 2px; }
.ctr-delta { font-size: 18px; font-weight: 700; padding: 4px 10px; border-radius: 8px; }
.ctr-delta.pos { background: rgba(95, 185, 95, 0.15); color: #5fb95f; }
.ctr-delta.neg { background: rgba(200, 80, 80, 0.15); color: #c85050; }
.ctr-sparkline { display: block; margin: 8px 0; }
.ctr-stats { display: flex; align-items: center; justify-content: space-around;
  margin: 8px 0 12px; }
.ctr-stat { text-align: center; }
.cs-label { font-size: 11px; }
.cs-value { font-size: 16px; font-weight: 600; margin-top: 2px; }
.ctr-arrow { font-size: 18px; color: var(--accent); padding: 0 14px; }
.ctr-table { width: 100%; border-collapse: collapse; font-size: 12px;
  margin-top: 10px; }
.ctr-table th { padding: 6px 4px; font-size: 11px; color: var(--muted);
  text-align: left; border-bottom: 1px solid var(--border); }
.ctr-table td { padding: 8px 4px; border-bottom: 1px solid var(--border); }
.ctr-table td.pos { color: #5fb95f; font-weight: 600; }
.ctr-table td.neg { color: #c85050; font-weight: 600; }

/* V2 Wave 3: Self-service swatches / moodboard / opts */
.swatch-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.swatch { position: relative; aspect-ratio: 1; border: 2px solid var(--border);
  border-radius: 12px; cursor: pointer; min-height: 60px;
  display: flex; align-items: flex-end; padding: 6px;
  font-family: inherit; }
.swatch:hover { border-color: var(--accent); }
.swatch.active { border-color: var(--accent); border-width: 3px; box-shadow: 0 0 0 2px rgba(255,100,0,0.3); }
.swatch-label { font-size: 10px; color: rgba(0,0,0,0.7); background: rgba(255,255,255,0.85);
  padding: 2px 6px; border-radius: 4px; }

.moodboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.moodboard-card { background: var(--card); border: 1.5px solid var(--border);
  border-radius: 10px; padding: 10px; cursor: pointer; transition: border-color 150ms; }
.moodboard-card:hover { border-color: var(--accent); }
.moodboard-card.active { border-color: var(--accent); background: rgba(255,100,0,0.05); }
.mb-label { font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.mb-desc { font-size: 11px; color: var(--muted); line-height: 1.4; }

.opt-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  background: var(--card); border: 1px solid var(--border); border-radius: 8px;
  margin-bottom: 6px; cursor: pointer; }
.opt-row input[type="checkbox"] { width: 18px; height: 18px; flex-shrink: 0; }
.opt-row span { font-size: 13px; }

.content-type-grid { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.ct-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  background: var(--card); border: 1px solid var(--border); border-radius: 8px;
  cursor: pointer; }
.ct-row input[type="radio"] { width: 18px; height: 18px; flex-shrink: 0; }
.ct-row span { font-size: 13px; }

/* Roman msg #520: bank requisites fallback (online-pay deferred) */
.online-pay-disabled { background: var(--card); color: var(--muted);
  border: 1px dashed var(--border); }
.requisites-card { padding: 14px; }
.requisites-list { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.req-row { font-size: 13px; line-height: 1.5; word-break: break-word; }
.req-row .muted { font-size: 11px; text-transform: uppercase; display: block; }
.req-row strong { display: block; margin-top: 2px; }

/* P1 launch: desktop layout (min-width: 1024px) — sidebar + main + центрирование контента */
@media (min-width: 1024px) {
  body { background: var(--bg); }
  /* Контейнер всего контента — центрируем, ограничиваем ширину */
  .ob-bg, .modal-bg { display: flex; align-items: center; justify-content: center; }
  .ob-content { max-width: 480px; width: 100%; padding: 40px 32px; border-radius: 16px;
    background: var(--card); box-shadow: 0 4px 24px rgba(0,0,0,0.2); }

  /* Main app container с sidebar nav */
  body[x-data] > .app-shell, body[x-data] {
    max-width: 1200px; margin: 0 auto; padding: 0 24px;
  }

  /* Tab bar превращается в side-rail слева на desktop */
  nav.tab-bar { position: fixed; top: 0; left: 0; bottom: 0; width: 220px;
    flex-direction: column; align-items: stretch; padding: 24px 12px;
    border-right: 1px solid var(--border); border-top: 0;
    background: var(--card); }
  nav.tab-bar .tab { flex-direction: row; gap: 12px; padding: 14px 16px;
    border-radius: 10px; margin-bottom: 4px; justify-content: flex-start; }
  nav.tab-bar .tab .icon { font-size: 18px; }
  nav.tab-bar .tab .label { font-size: 14px; }
  nav.tab-bar .tab.active { background: rgba(255,100,0,0.1); }

  /* Main content shifted, full-width */
  body { padding-left: 220px; }
  body[x-cloak] { padding-left: 0; }

  /* Tabs content: 2-column grid (info + actions) */
  template[x-if*="state.tab"] > div { display: grid; grid-template-columns: 1fr 360px;
    gap: 24px; align-items: start; padding: 32px 0; }
  template[x-if*="state.tab"] .head { grid-column: 1 / -1; padding: 16px 0; }
  template[x-if*="state.tab"] .section { padding: 0; }

  /* Card-like sections */
  .order-card, .archive-card, .method-card, .ctr-card, .services-card, .memo-card, .ticket-row {
    padding: 20px;
  }
  .stage-tracker { padding: 16px 0; }

  /* FAB → fixed btn в правом нижнем но абсолютнее */
  .fab-order { right: 32px; bottom: 32px; padding: 14px 22px; font-size: 14px; }

  /* Bottom-sheets превращаются в центрированные modals */
  .bottomsheet-bg { display: flex; align-items: center; justify-content: center; }
  .bottomsheet { position: relative; max-width: 560px; width: 100%;
    border-radius: 16px; max-height: 80vh; }
}

/* Variant B lead form modal (Alsvid msg #530) */
.lead-form-overlay {
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.lead-form-content {
  position: relative;
  background: var(--bg, #fff);
  border-radius: 14px;
  padding: 28px 22px 22px;
  width: 100%;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}
.lead-form-close:hover { color: var(--fg, #111); }
.lead-cta-block .btn.secondary {
  background: transparent;
  border: 1px solid var(--border, #d1d5db);
  color: var(--fg, #111);
  font-weight: 600;
}
.lead-cta-block .btn.secondary:hover {
  background: var(--bg-hover, #f3f4f6);
}
.lead-privacy-row a:hover { text-decoration: underline; }
