.crm-wide { max-width: 1520px; }
/* CRM «Гаджет-Точка» — интерактивная версия на сайте. Цвета берутся из темы сайта. */
.crm-stage { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
@media (max-width: 1120px) { .crm-stage { grid-template-columns: 1fr; justify-items: center; } .crm-stage > .laptop { width: 100%; } }
.laptop { border-radius: 22px; padding: 12px; background: linear-gradient(160deg, #3A3F4A, #15171C 50%, #2A2E36); box-shadow: inset 0 0 0 1px rgba(255,255,255,.1), var(--shadow); }
.laptop-bar { display: flex; align-items: center; gap: 6px; padding: 2px 6px 10px; }
.laptop-bar i { width: 9px; height: 9px; border-radius: 50%; background: #565B66; }
.laptop-bar span { margin-left: 10px; font-family: var(--mono); font-size: 11px; color: #9AA0AA; background: rgba(255,255,255,.06); border-radius: 6px; padding: 2px 10px; }

.crm { position: relative; display: grid; grid-template-columns: 184px minmax(0, 1fr); height: 700px; border-radius: 12px; overflow: hidden; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.45; }
.crm * { box-sizing: border-box; }
.crm button, .crm input, .crm select { font: inherit; color: inherit; }
.crm-side { display: flex; flex-direction: column; gap: 2px; padding: 16px 10px; background: var(--bg-2); border-right: 1px solid var(--line); overflow: auto; }
.crm-logo { display: flex; align-items: center; gap: 9px; padding: 4px 8px 16px; font-weight: 700; font-size: 15px; }
.crm-logo i { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-style: normal; font-size: 14px; background: linear-gradient(135deg, var(--brass-2), var(--brass)); color: var(--on-brass); }
.crm-group { font-size: 11px; color: var(--dim); padding: 14px 10px 4px; }
.crm-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; text-align: left; background: none; border: 0; border-radius: 10px; padding: 8px 10px; cursor: pointer; color: var(--muted); }
.crm-nav:hover { background: color-mix(in srgb, var(--text) 6%, transparent); color: var(--text); }
.crm-nav[aria-current="page"] { background: color-mix(in srgb, var(--brass) 18%, transparent); color: var(--text); font-weight: 600; }
.crm-nav .lock { font-size: 11px; opacity: .7; }
.crm-nav .cnt { min-width: 18px; padding: 0 6px; border-radius: 999px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; text-align: center; }
.crm-user { margin-top: auto; padding: 12px 10px 2px; border-top: 1px solid var(--line); display: grid; gap: 2px; }
.crm-user b { font-weight: 600; } .crm-user small { color: var(--muted); font-size: 12px; }
.crm-user button { justify-self: start; margin-top: 6px; background: none; border: 1px solid var(--line-2); border-radius: 999px; padding: 3px 12px; font-size: 12px; cursor: pointer; }
.crm-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; container-type: inline-size; }
.crm-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.crm-head h3 { font-family: var(--serif); font-weight: 400; font-size: 24px; margin: 0; }
.crm-head .sub { color: var(--muted); font-size: 13px; }
.crm-body { flex: 1; min-height: 0; overflow: auto; padding: 16px 20px 20px; }
.crm-cols { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; }
@container (max-width: 780px) { .crm-cols { grid-template-columns: 1fr; } }
.crm-card { background: var(--bg-3); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.crm-card h4 { margin: 0 0 8px; font-size: 14px; font-weight: 600; }
.crm-muted { color: var(--muted); font-size: 12.5px; }
.crm-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.crm-chip { background: none; border: 1px solid var(--line-2); border-radius: 999px; padding: 4px 12px; font-size: 13px; cursor: pointer; }
.crm-chip[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--bg); }
.crm-btn { border: 0; border-radius: 10px; padding: 9px 16px; font-weight: 600; cursor: pointer; background: linear-gradient(180deg, var(--brass-2), var(--brass)); color: var(--on-brass); }
.crm-btn.line { background: none; border: 1px solid var(--line-2); color: var(--text); font-weight: 500; }
.crm-btn:disabled { opacity: .45; cursor: not-allowed; }
.crm-btn.wide { width: 100%; padding: 12px; font-size: 15px; }
.crm-in { width: 100%; background: var(--bg); border: 1px solid var(--line-2); border-radius: 10px; padding: 8px 10px; }
.crm label.f { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.crm-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
@container (max-width: 620px) { .crm-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.crm-kpi { background: var(--bg-3); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.crm-kpi span { display: block; font-size: 12px; color: var(--muted); }
.crm-kpi b { display: block; font-family: var(--serif); font-weight: 400; font-size: 22px; line-height: 1.25; }
.crm-kpi small { font-size: 11.5px; color: var(--dim); }
.crm-t { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.crm-t th { text-align: left; font-weight: 500; font-size: 12px; color: var(--muted); padding: 7px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.crm-t td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.crm-t td.nw { white-space: nowrap; }
.crm-t td.n, .crm-t th.n { text-align: right; white-space: nowrap; }
.crm-t tr.click { cursor: pointer; } .crm-t tr.click:hover, .crm-t tr.sel { background: color-mix(in srgb, var(--brass) 10%, transparent); }
.crm-t small { display: block; color: var(--muted); font-size: 12px; }
.crm-t tr.total td { font-weight: 700; background: color-mix(in srgb, var(--text) 4%, transparent); }
.crm-t td.ind { padding-left: 22px; color: var(--muted); }
.crm .badge { white-space: nowrap; }
.crm-goods { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.crm-good { position: relative; text-align: left; background: var(--bg-3); border: 1px solid var(--line); border-radius: 12px; padding: 10px; cursor: pointer; display: grid; gap: 4px; }
.crm-good:hover { border-color: var(--line-2); }
.crm-good .ph { height: 54px; border-radius: 8px; display: grid; place-items: center; font-size: 26px; background: color-mix(in srgb, var(--brass) 12%, var(--bg-2)); }
.crm-good b { font-weight: 600; font-size: 13px; line-height: 1.3; }
.crm-good .pr { font-weight: 700; }
.crm-good.open { grid-column: 1 / -1; grid-template-columns: 70px 1fr; align-items: center; cursor: default; border-color: var(--brass); }
.crm-good.open .ph { grid-row: span 3; height: 70px; }
.crm-vars { display: flex; flex-wrap: wrap; gap: 6px; grid-column: 2; }
.crm-var { border: 1px solid var(--line-2); background: var(--bg); border-radius: 8px; padding: 5px 10px; font-size: 13px; cursor: pointer; }
.crm-var small { color: var(--muted); margin-left: 4px; }
.crm-var:disabled { opacity: .4; text-decoration: line-through; cursor: not-allowed; }
.crm-line { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.crm-line small { display: block; color: var(--muted); font-size: 12px; }
.crm-qty { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: 8px; }
.crm-qty button { background: none; border: 0; width: 26px; height: 26px; cursor: pointer; }
.crm-qty span { min-width: 18px; text-align: center; }
.crm-sum { display: flex; justify-content: space-between; padding: 4px 0; }
.crm-sum.big { font-size: 20px; font-weight: 700; padding-top: 10px; }
.crm-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.crm-seg button { border: 1px solid var(--line-2); background: none; border-radius: 8px; padding: 7px 4px; cursor: pointer; font-size: 13px; }
.crm-seg button[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.crm-bars { display: flex; align-items: flex-end; gap: 3px; height: 150px; padding-top: 8px; }
.crm-bars div { flex: 1; min-width: 3px; border-radius: 3px 3px 0 0; background: linear-gradient(180deg, var(--brass-2), var(--brass)); position: relative; }
.crm-bars div:hover::after { content: attr(data-tip); position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); white-space: nowrap; background: var(--text); color: var(--bg); font-size: 11px; padding: 2px 6px; border-radius: 4px; margin-bottom: 4px; z-index: 2; }
.crm-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--dim); margin-top: 4px; }
.crm-hbar { display: grid; grid-template-columns: 120px 1fr 90px; gap: 8px; align-items: center; font-size: 13px; padding: 3px 0; }
.crm-hbar i { display: block; height: 8px; border-radius: 4px; background: var(--brass); }
.crm-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@container (max-width: 620px) { .crm-grid2 { grid-template-columns: 1fr; } }
.crm-toast { position: absolute; right: 16px; bottom: 16px; z-index: 20; max-width: 320px; background: var(--text); color: var(--bg); padding: 10px 14px; border-radius: 12px; font-size: 13px; box-shadow: var(--shadow); opacity: 0; transform: translateY(8px); transition: .25s; pointer-events: none; }
.crm-toast.on { opacity: 1; transform: none; }
.crm-lockbox { display: grid; place-items: center; text-align: center; gap: 10px; height: 100%; padding: 30px; }
.crm-lockbox b { font-family: var(--serif); font-weight: 400; font-size: 24px; }
.crm-login { position: absolute; inset: 0; z-index: 10; display: grid; place-items: center; padding: 20px; background: radial-gradient(60% 60% at 50% 0%, color-mix(in srgb, var(--brass) 14%, transparent), transparent 70%), var(--bg); }
.crm-login-box { width: min(380px, 100%); display: grid; gap: 12px; background: var(--bg-3); border: 1px solid var(--line); border-radius: 18px; padding: 24px; }
.crm-login-box h4 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 26px; }
.crm-code { letter-spacing: .4em; font-family: var(--mono); font-size: 20px; text-align: center; }
.crm-rules { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 12px; font-size: 11.5px; color: var(--dim); text-align: center; }
.crm .flashrow { animation: flash 1.6s ease; }
.crm-empty { color: var(--muted); padding: 20px 0; text-align: center; }
.crm-vgrid td.v0 { color: var(--bad); font-weight: 700; } .crm-vgrid td.vl { color: var(--warn); font-weight: 700; }
@media (max-width: 760px) {
  .crm { grid-template-columns: 1fr; height: auto; min-height: 640px; }
  .crm-side { flex-direction: row; align-items: center; overflow-x: auto; padding: 8px; border-right: 0; border-bottom: 1px solid var(--line); gap: 4px; }
  .crm-logo, .crm-group { display: none; }
  .crm-nav { white-space: nowrap; width: auto; }
  .crm-user { margin: 0 0 0 auto; border: 0; padding: 0 6px; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
  .crm-user small { display: none; } .crm-user button { margin: 0; }
  .crm-body { max-height: 720px; }
}

/* Телефон владельца */
.owner-phone { width: 300px; }
.owner-phone .phone { width: 300px; height: 620px; }
.owner-phone .scr { background: #F4F2EE; color: #18181B; padding: 46px 16px 16px; display: flex; flex-direction: column; gap: 10px; font-size: 13px; overflow: hidden; }
.op-hello { font-weight: 700; font-size: 17px; }
.op-card { background: #fff; border-radius: 14px; padding: 12px; box-shadow: 0 6px 16px -10px rgba(0,0,0,.25); }
.op-card small { color: #6B6B75; font-size: 11.5px; }
.op-big { font-size: 26px; font-weight: 700; line-height: 1.2; }
.op-row { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; }
.op-row em { font-style: normal; color: #6B6B75; }
.op-alert { background: #FFF2DE; border: 1px solid #F2D3A0; }
.op-alert b { display: block; }
.op-alert .op-btns { display: flex; gap: 6px; margin-top: 8px; }
.op-alert button { flex: 1; border: 0; border-radius: 8px; padding: 6px; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; background: #18181B; color: #fff; }
.op-alert button + button { background: #fff; color: #A23B3B; border: 1px solid #E8C8C8; }
.op-tg { background: #2B5BD7; color: #fff; }
.op-tg small { color: #DCE6FF; }
.op-low { color: #A23B3B; font-weight: 600; }
.op-new { animation: opnew .6s ease; }
@keyframes opnew { from { transform: translateY(-8px); opacity: 0; } }
