/* «Трубка» — общие стили лендинга, кабинета и приложения в Битрикс24 */
:root {
  --navy: #0B2545;
  --navy-2: #13315C;
  --green: #13C27A;
  --green-d: #0E9F63;
  --green-l: #E6FAF0;
  --ink: #0B2545;
  --muted: #5B6B82;
  --line: #E3E8EF;
  --bg: #FFFFFF;
  --bg-2: #F5F8FA;
  --danger: #D64545;
  --danger-l: #FDECEC;
  --warn: #B7791F;
  --warn-l: #FFF6E0;
  --radius: 14px;
  --shadow: 0 8px 30px rgba(11, 37, 69, .08);
  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 16px; line-height: 1.55; }
a { color: var(--green-d); }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -.02em; margin: 0 0 .5em; }
h1 { font-size: clamp(32px, 5vw, 54px); font-weight: 800; }
h2 { font-size: clamp(26px, 3.4vw, 38px); font-weight: 800; }
h3 { font-size: 19px; font-weight: 700; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.container { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* Кнопки и поля */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; padding: 13px 22px;
  font: 700 16px/1.2 var(--font); cursor: pointer; text-decoration: none; transition: background .15s, transform .05s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-d); }
.btn-dark { background: var(--navy); color: #fff; }
.btn-dark:hover { background: var(--navy-2); }
.btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn-ghost:hover { box-shadow: inset 0 0 0 1.5px var(--navy); }
.btn-danger { background: var(--danger-l); color: var(--danger); }
.btn-sm { padding: 8px 14px; font-size: 14px; border-radius: 10px; }
.btn[disabled] { opacity: .55; cursor: default; }

label { display: block; font-weight: 600; font-size: 14px; margin: 0 0 6px; }
input, select, textarea { width: 100%; font: 500 16px/1.4 var(--font); color: var(--ink); background: #fff; border: 1.5px solid var(--line);
  border-radius: 10px; padding: 11px 13px; outline: none; transition: border-color .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--green); }
.field { margin-bottom: 16px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }
.check input { width: auto; margin-top: 4px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.grow { flex: 1 1 220px; }

.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.note { border-radius: 12px; padding: 14px 16px; background: var(--bg-2); font-size: 15px; }
.note.ok { background: var(--green-l); }
.note.warn { background: var(--warn-l); color: #6b4a10; }
.note.err { background: var(--danger-l); color: #8a2323; }
.warn { color: var(--warn); }
.badge { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 13px; font-weight: 700; background: var(--bg-2); color: var(--muted); }
.badge.ok { background: var(--green-l); color: var(--green-d); }
.badge.err { background: var(--danger-l); color: var(--danger); }
.badge.warn { background: var(--warn-l); color: var(--warn); }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px; }
.copy { display: flex; gap: 8px; align-items: center; }
.copy input { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px; background: var(--bg-2); }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 13px; }
.table-wrap { overflow-x: auto; }

/* ---------- Лендинг ---------- */
.site-header { position: sticky; top: 0; z-index: 10; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 16px; }
.site-header nav { display: flex; gap: 22px; align-items: center; }
.site-header nav a { color: var(--ink); text-decoration: none; font-weight: 600; font-size: 15px; }
.site-header nav a.btn { color: #fff; }
.logo img { height: 36px; display: block; }
@media (max-width: 760px) { .site-header nav a:not(.btn) { display: none; } }

.hero { padding: 72px 0 56px; background: radial-gradient(1200px 500px at 85% -10%, var(--green-l), transparent 60%); }
.hero .container { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.hero p.lead { font-size: 20px; color: var(--muted); max-width: 560px; }
.hero .row { margin-top: 28px; }
.hero-points { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 22px; color: var(--muted); font-weight: 600; font-size: 15px; }
.hero-points span::before { content: '✓'; color: var(--green); margin-right: 6px; font-weight: 800; }
@media (max-width: 900px) { .hero .container { grid-template-columns: 1fr; } .hero { padding-top: 40px; } }

/* Телефон с перепиской — иллюстрация из CSS */
.mock { justify-self: center; width: 300px; max-width: 100%; background: var(--navy); border-radius: 40px; padding: 14px; box-shadow: var(--shadow); }
.mock-screen { background: #F2F6F9; border-radius: 28px; padding: 18px 14px 22px; min-height: 440px; display: flex; flex-direction: column; gap: 10px; }
.mock-top { text-align: center; font-weight: 700; font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.bubble { max-width: 82%; padding: 10px 13px; border-radius: 16px; font-size: 14px; line-height: 1.4; }
.bubble.out { align-self: flex-end; background: var(--green); color: #fff; border-bottom-right-radius: 5px; }
.bubble.in { align-self: flex-start; background: #fff; border-bottom-left-radius: 5px; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.bubble small { display: block; opacity: .75; font-size: 11px; margin-top: 3px; }

section { padding: 72px 0; }
section.alt { background: var(--bg-2); }
.section-head { max-width: 700px; margin-bottom: 36px; }
.section-head p { color: var(--muted); font-size: 18px; }
.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }
.step-num { width: 40px; height: 40px; border-radius: 12px; background: var(--green-l); color: var(--green-d); font-weight: 800; display: grid; place-items: center; margin-bottom: 14px; }
.feature .ic { width: 44px; height: 44px; border-radius: 12px; background: var(--navy); color: #fff; display: grid; place-items: center; margin-bottom: 14px; font-size: 22px; }

.prices { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.price { display: flex; flex-direction: column; }
.price.featured { border: 2px solid var(--green); box-shadow: var(--shadow); }
.price .amount { font-size: 38px; font-weight: 800; margin: 6px 0 2px; }
.price ul { padding: 0; margin: 16px 0 22px; list-style: none; flex: 1; }
.price li { padding: 5px 0 5px 26px; position: relative; }
.price li::before { content: '✓'; position: absolute; left: 0; color: var(--green); font-weight: 800; }

details { border-bottom: 1px solid var(--line); padding: 16px 0; }
summary { cursor: pointer; font-weight: 700; font-size: 17px; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::after { content: '+'; float: right; color: var(--green-d); font-size: 22px; line-height: 1; }
details[open] summary::after { content: '–'; }
details p { margin: 10px 0 0; color: var(--muted); }

.cta { background: var(--navy); color: #fff; border-radius: 24px; padding: 48px; display: flex; gap: 24px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.cta p { color: #B9C6D8; margin: 0; }
footer.site-footer { padding: 36px 0 48px; color: var(--muted); font-size: 14px; border-top: 1px solid var(--line); }
footer.site-footer .container { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
footer.site-footer a { color: var(--muted); margin-right: 16px; }

/* ---------- Кабинет ---------- */
.cab { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.cab-side { background: var(--navy); color: #fff; padding: 22px 16px; display: flex; flex-direction: column; gap: 4px; }
.cab-side .logo img { height: 32px; margin: 0 8px 22px; }
.cab-side a { color: #C9D4E3; text-decoration: none; padding: 10px 12px; border-radius: 10px; font-weight: 600; }
.cab-side a.active, .cab-side a:hover { background: rgba(255,255,255,.08); color: #fff; }
.cab-side .spacer { flex: 1; }
.cab-main { background: var(--bg-2); padding: 32px clamp(16px, 4vw, 48px); min-width: 0; }
.cab-main h1 { font-size: 30px; }
.cab-main > .card + .card { margin-top: 18px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 18px; }
.stat .v { font-size: 26px; font-weight: 800; }
.stat .k { color: var(--muted); font-size: 14px; }
.steps { counter-reset: s; padding: 0; list-style: none; }
.steps > li { counter-increment: s; position: relative; padding: 0 0 18px 46px; }
.steps > li::before { content: counter(s); position: absolute; left: 0; top: -2px; width: 32px; height: 32px; border-radius: 10px; background: var(--green-l); color: var(--green-d); font-weight: 800; display: grid; place-items: center; }
@media (max-width: 820px) {
  .cab { grid-template-columns: 1fr; }
  .cab-side { flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px; }
  .cab-side .logo img { margin: 0 8px 0 4px; height: 28px; }
  .cab-side .spacer { display: none; }
  .cab-side a { padding: 7px 10px; font-size: 14px; }
}

.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(900px 400px at 50% -10%, var(--green-l), transparent 70%), var(--bg-2); }
.auth .card { width: 100%; max-width: 420px; box-shadow: var(--shadow); }
.auth .logo img { height: 38px; margin: 0 auto 22px; }
.auth .links { display: flex; justify-content: space-between; margin-top: 14px; font-size: 14px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 600; z-index: 100; box-shadow: var(--shadow); max-width: calc(100% - 32px); }
.toast.err { background: var(--danger); }
.hidden { display: none !important; }

/* ---------- Приложение в Битрикс24 ---------- */
body.b24 { background: var(--bg-2); }
.b24-wrap { max-width: 980px; margin: 0 auto; padding: 24px 16px 40px; }
.b24-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.b24-head img { height: 34px; }
.b24-wrap .card { margin-bottom: 16px; }
.b24-wrap h2 { font-size: 22px; }

/* ---------- Админка ---------- */
.adm .cab-side .tag { font-size: 11px; font-weight: 700; color: var(--green); letter-spacing: .08em; text-transform: uppercase; margin: -14px 12px 14px; }
.adm h2 { font-size: 20px; margin-bottom: 14px; }
.adm .muted.small { line-height: 1.4; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.kpi .k { color: var(--muted); font-size: 13px; font-weight: 600; }
.kpi .v { font-size: 26px; font-weight: 800; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi .s { color: var(--muted); font-size: 13px; }
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-bottom: 18px; }
.chart svg { width: 100%; height: 120px; display: block; }
.chart .bar { fill: var(--green); }
.chart .bar:hover { fill: var(--green-d); }
.chart .axis { fill: var(--muted); font-size: 10px; font-family: var(--font); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.chip { border: 1.5px solid var(--line); background: #fff; border-radius: 99px; padding: 6px 14px; font: 600 14px var(--font); cursor: pointer; color: var(--ink); }
.chip.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar input, .toolbar select { width: auto; flex: 1 1 200px; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--bg-2); }
.grid-2c { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; }
.grid-2c > .card { margin: 0 !important; }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 8px 14px; font-size: 15px; }
.kv > div:nth-child(odd) { color: var(--muted); }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.form-row .field { margin-bottom: 12px; }
.back { display: inline-block; margin-bottom: 10px; font-weight: 600; text-decoration: none; }
.plan-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.plan-card { display: flex; flex-direction: column; gap: 6px; }
.plan-card .amount { font-size: 30px; font-weight: 800; }
.plan-card s { color: var(--muted); font-weight: 600; font-size: 18px; margin-left: 6px; }
.plan-card .row { margin-top: auto; padding-top: 10px; }
.editor { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 900px) { .editor { grid-template-columns: 1fr; } }
.modal-bg { position: fixed; inset: 0; background: rgba(11, 37, 69, .45); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { background: #fff; border-radius: 18px; padding: 24px; width: 100%; max-width: 520px; max-height: calc(100vh - 32px); overflow: auto; box-shadow: var(--shadow); }
.modal h3 { margin-bottom: 14px; }
.json { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; color: var(--muted); white-space: pre-wrap; word-break: break-word; max-width: 520px; }
.pager { display: flex; gap: 10px; align-items: center; justify-content: flex-end; margin-top: 12px; }
