/* 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; }
.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; }

/* 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; }

/* 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; }
