:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --text: #13161c;
  --muted: #5f6675;
  --line: #e4e7ec;
  --brand: #0f766e;
  --brand-dark: #0b5e58;
  --brand-soft: #e6f4f2;
  --star: #f5a524;
  --bad: #dc3d3d;
  --bad-soft: #fdecec;
  --mid: #e0a100;
  --mid-soft: #fff6dc;
  --good: #1f9d55;
  --good-soft: #e7f6ed;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.5 var(--font); color: var(--text); background: var(--bg); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.narrow-wrap { max-width: 760px; }

/* ---------- Кнопки и формы ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px; border-radius: 10px; border: 1px solid var(--brand);
  background: var(--brand); color: #fff; font: inherit; font-weight: 600; cursor: pointer;
  text-decoration: none; white-space: nowrap; transition: background .15s;
}
.btn:hover { background: var(--brand-dark); text-decoration: none; }
.btn-ghost { background: #fff; color: var(--brand); border-color: var(--line); }
.btn-ghost:hover { background: var(--brand-soft); }
.btn-sm { padding: 6px 12px; font-size: .875rem; }
.btn-lg { padding: 14px 24px; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn-link { background: none; border: 0; padding: 0; color: var(--brand); font: inherit; cursor: pointer; }
.btn-link:hover { text-decoration: underline; }
.danger { color: var(--bad); }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 6px; font-weight: 500; font-size: .95rem; }
input, select, textarea {
  font: inherit; color: inherit; width: 100%; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: -1px; border-color: transparent; }
textarea { resize: vertical; }
.form label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { width: 18px; height: 18px; margin-top: 2px; flex: none; }
.fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px 16px; display: grid; gap: 12px; }
.fieldset legend { padding: 0 6px; font-weight: 600; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; }
.alert-err { background: var(--bad-soft); color: #8d1f1f; }
.alert-warn { background: var(--mid-soft); color: #6b4d00; }
.alert-ok { background: var(--good-soft); color: #145c33; }

.tag { display: inline-block; padding: 2px 10px; border-radius: 999px; background: #eef0f3; font-size: .8rem; font-weight: 600; color: var(--muted); }
.tag-ok { background: var(--good-soft); color: var(--good); }
.tag-bad { background: var(--bad-soft); color: var(--bad); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 16px; }

/* ---------- Шапка ---------- */
.topbar { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.topbar-in { display: flex; align-items: center; gap: 20px; min-height: 60px; }
.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.15rem; color: var(--text); }
.logo:hover { text-decoration: none; }
.logo-mark { color: var(--brand); display: inline-flex; }
.nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav a { padding: 8px 12px; border-radius: 8px; color: var(--muted); font-weight: 500; white-space: nowrap; }
.nav a:hover { background: var(--bg); text-decoration: none; color: var(--text); }
.nav a.on { color: var(--brand); background: var(--brand-soft); }
.logout { display: flex; gap: 12px; align-items: center; margin-left: auto; }
.banner { background: var(--brand-soft); color: var(--brand-dark); padding: 10px 0; font-size: .925rem; }
.banner-warn { background: var(--mid-soft); color: #6b4d00; }
.banner a { font-weight: 600; }

.main { padding-top: 24px; padding-bottom: 48px; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h1 { margin: 0; }
.section-title { margin-top: 24px; }

/* ---------- Дашборд ---------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.filters select { width: auto; min-width: 140px; padding: 8px 10px; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.kpi-label { color: var(--muted); font-size: .85rem; }
.kpi-value { font-size: 1.75rem; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi-star { color: var(--star); font-size: 1.2rem; margin-left: 4px; }
.kpi-alert { border-color: #f3b4b4; background: var(--bad-soft); }
.kpi-alert .kpi-value { color: var(--bad); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-2 > .card { margin-bottom: 0; }
.grid-2 + * { margin-top: 16px; }
.grid-top { align-items: start; }

.spark { display: flex; align-items: flex-end; gap: 4px; height: 140px; }
.spark-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; }
.spark-col span { font-size: .7rem; color: var(--muted); }
.spark-bar { width: 100%; min-height: 2px; background: var(--brand); border-radius: 4px 4px 0 0; opacity: .85; }
.spark-bad { background: var(--bad); }
.dist { display: grid; gap: 10px; }
.dist-row { display: grid; grid-template-columns: 32px 1fr 40px; gap: 10px; align-items: center; }
.dist-label { font-weight: 600; }
.dist-track { background: var(--bg); border-radius: 6px; height: 14px; overflow: hidden; }
.dist-fill { height: 100%; border-radius: 6px; }
.dist-fill.r-good { background: var(--good); }
.dist-fill.r-mid { background: var(--mid); }
.dist-fill.r-bad { background: var(--bad); }
.dist-num { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .925rem; }
.table th, .table td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table th { color: var(--muted); font-weight: 500; font-size: .85rem; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.inline-form { display: flex; gap: 4px; }
.inline-form select, .inline-form input { padding: 4px 6px; font-size: .85rem; width: auto; }
.inline-form input[name=months] { width: 52px; }
.inline-form input[name=amount] { width: 80px; }
.inline-form input[name=note] { width: 100px; }

.feed { display: grid; gap: 10px; }
.fb { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--good); border-radius: 12px; padding: 14px 16px; }
.fb.r-bad { border-left-color: var(--bad); }
.fb.r-mid { border-left-color: var(--mid); }
.fb.fb-done { opacity: .7; }
.fb-head { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.fb-stars { color: var(--star); letter-spacing: 1px; }
.fb-loc { font-weight: 600; }
.fb-date { margin-left: auto; }
.fb-text { margin: 8px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.fb-contact { margin: 0 0 8px; font-weight: 500; }
.fb-actions { display: flex; gap: 12px; align-items: center; }
.empty { text-align: center; padding: 40px 20px; }

/* ---------- Точки ---------- */
.loc-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin-bottom: 16px; }
.loc-item { display: flex; align-items: center; gap: 14px; color: var(--text); margin: 0; }
.loc-item:hover { text-decoration: none; border-color: var(--brand); }
.loc-item > div { flex: 1; }
.loc-item img { border-radius: 8px; border: 1px solid var(--line); }
.loc-name { font-weight: 600; }
.qr-card { text-align: center; }
.qr-card img { max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 12px; }
.copy-row { display: flex; gap: 8px; margin: 14px 0; }
.copy-row input { font-size: .85rem; }
.qr-card .btn-row { justify-content: center; margin-bottom: 12px; }
.danger-zone { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.steps-card { background: linear-gradient(135deg, var(--brand-soft), #fff); }
.steps { margin: 0; padding-left: 22px; display: grid; gap: 8px; }
.steps li.done { color: var(--muted); text-decoration: line-through; }
.list { list-style: none; padding: 0; margin: 0 0 16px; }
.list li { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }

/* ---------- Тарифы ---------- */
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 16px; }
.plan { position: relative; display: flex; flex-direction: column; gap: 8px; margin: 0; }
.plan form { margin: 0; }
.plan .ticks { flex: 1; }
.plan-hl { border: 2px solid var(--brand); }
.plan-badge { position: absolute; top: -12px; left: 20px; background: var(--brand); color: #fff; font-size: .75rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.plan-price { font-size: 2rem; font-weight: 800; }
.plan-price span { font-size: 1rem; font-weight: 500; color: var(--muted); }
.ticks { list-style: none; padding: 0; margin: 4px 0 8px; display: grid; gap: 6px; }
.ticks li::before { content: "✓"; color: var(--good); font-weight: 700; margin-right: 8px; }

/* ---------- Вход ---------- */
.center-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.auth { width: 100%; max-width: 420px; display: grid; gap: 16px; }
.auth > .logo { justify-self: center; }
.auth .card { margin: 0; padding: 28px; }
.narrow { max-width: 460px; }

/* ---------- Публичная форма гостя ---------- */
.guest { background: linear-gradient(180deg, var(--brand-soft) 0, var(--bg) 320px); }
.guest-wrap { max-width: 480px; margin: 0 auto; padding: 24px 16px 32px; min-height: 100vh; display: flex; flex-direction: column; }
.guest-card { background: #fff; border-radius: 20px; padding: 28px 22px; box-shadow: 0 8px 30px rgba(15, 118, 110, .12); }
.guest-company { font-size: .85rem; font-weight: 700; color: var(--brand); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.guest-card h1 { font-size: 1.6rem; }
.guest-foot { margin-top: auto; padding-top: 24px; text-align: center; font-size: .8rem; color: var(--muted); }
.star-input { display: flex; flex-direction: row-reverse; justify-content: center; gap: 6px; margin: 8px 0 0; }
.star-input input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.star-input label { font-size: 2.9rem; line-height: 1; color: #d6d9df; cursor: pointer; transition: transform .1s, color .1s; display: block; }
.star-input label:hover, .star-input label:hover ~ label,
.star-input input:checked ~ label { color: var(--star); }
.star-input label:active { transform: scale(.9); }
.star-input input:focus-visible + label { outline: 2px solid var(--brand); border-radius: 6px; }
.star-hint { text-align: center; margin-top: -6px; }
.thanks-icon { font-size: 3rem; margin-bottom: 8px; }
.map-links { display: grid; gap: 10px; margin-top: 8px; }
.map-links-quiet { margin-top: 20px; }

/* ---------- Лендинг ---------- */
.landing .topbar { position: sticky; }
.landing .topbar-in .btn-row { margin-left: auto; }
.hero { padding: 64px 0 56px; background: radial-gradient(1000px 400px at 80% 0, var(--brand-soft), transparent), #fff; border-bottom: 1px solid var(--line); }
.hero-in { display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(2rem, 4.2vw, 3rem); letter-spacing: -.025em; }
.eyebrow { color: var(--brand); font-weight: 700; font-size: .875rem; text-transform: uppercase; letter-spacing: .06em; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 560px; }
.hero .btn-row { margin: 24px 0 12px; }
.hero-demo { position: relative; height: 420px; }
.phone { position: absolute; left: 0; top: 0; width: 240px; height: 400px; border-radius: 34px; background: #1b1e24; padding: 10px; box-shadow: 0 20px 50px rgba(0, 0, 0, .18); }
.phone-in { background: #fff; border-radius: 26px; height: 100%; padding: 36px 18px 18px; display: flex; flex-direction: column; gap: 10px; }
.demo-q { font-weight: 800; font-size: 1.3rem; }
.demo-stars { color: var(--star); font-size: 1.9rem; letter-spacing: 2px; }
.demo-text { border: 1px solid var(--line); border-radius: 10px; padding: 10px; font-size: .85rem; flex: 1; }
.demo-btn { background: var(--brand); color: #fff; border-radius: 10px; padding: 10px; text-align: center; font-weight: 700; }
.tg-bubble { position: absolute; right: 0; bottom: 20px; width: 290px; background: #fff; border-radius: 16px 16px 16px 4px; padding: 14px 16px; box-shadow: 0 16px 40px rgba(0, 0, 0, .14); font-size: .9rem; display: grid; gap: 6px; border: 1px solid var(--line); }
.tg-meta { color: var(--muted); font-size: .8rem; }
.tg-btn { text-align: center; background: #eef6ff; color: #2a7bd5; border-radius: 8px; padding: 6px; font-weight: 600; }

.section { padding: 64px 0; }
.section-alt { background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); text-align: center; margin-bottom: 32px; }
.cards-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.cards-3 .card { margin: 0; }
.step-n { width: 36px; height: 36px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 800; margin-bottom: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 40px; }
.chip { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-weight: 500; }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px 32px; }
.features p { margin: 0; }
details { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; margin-bottom: 10px; }
summary { font-weight: 600; cursor: pointer; }
details p { margin: 10px 0 0; color: var(--muted); }
.cta-final { background: var(--brand); color: #fff; }
.cta-final .lead { color: rgba(255, 255, 255, .85); margin: 0 auto 24px; }
.cta-final .btn { background: #fff; color: var(--brand); border-color: #fff; }
.footer { padding: 32px 0; background: #fff; border-top: 1px solid var(--line); }
.footer-in { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: center; }
.footer .logo-text { font-weight: 800; }
.legal { padding-top: 32px; padding-bottom: 64px; }
.legal h2 { font-size: 1.1rem; margin-top: 1.6em; }

/* ---------- Печать табличек ---------- */
.print-page { background: #e9ebef; }
.print-bar { display: flex; gap: 16px; align-items: center; padding: 16px; max-width: 210mm; margin: 0 auto; flex-wrap: wrap; }
.sheet { width: 210mm; height: 297mm; margin: 0 auto 24px; background: #fff; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.tent { border: 1px dashed #c4c8cf; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 10mm; gap: 3mm; }
.tent-company { font-size: 11pt; font-weight: 700; color: var(--brand); text-transform: uppercase; letter-spacing: .08em; }
.tent-title { font-size: 24pt; font-weight: 800; line-height: 1.1; }
.tent-sub { font-size: 11pt; color: #444; max-width: 80mm; }
.tent-qr svg { width: 55mm; height: 55mm; display: block; }
.tent-hint { font-size: 10pt; font-weight: 600; }
.tent-url { font-size: 7.5pt; color: #777; }
@page { size: A4; margin: 0; }
@media print {
  .no-print { display: none !important; }
  .print-page { background: #fff; }
  .sheet { margin: 0; }
}

/* ---------- Мобильные ---------- */
@media (max-width: 900px) {
  .hero-in { grid-template-columns: 1fr; }
  .hero-demo { height: 400px; max-width: 420px; width: 100%; margin: 0 auto; }
  .cards-3, .features, .plans { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .hide-sm { display: none !important; }
  h1 { font-size: 1.45rem; }
  .topbar-in { gap: 8px; flex-wrap: wrap; padding-top: 6px; padding-bottom: 6px; }
  .app .nav { order: 3; flex-basis: 100%; }
  .kpi-value { font-size: 1.4rem; }
  .filters select { flex: 1 1 45%; min-width: 0; }
  .fb-date { margin-left: 0; width: 100%; }
  .hero { padding: 40px 0; }
  .section { padding: 44px 0; }
  .phone { width: 210px; height: 360px; }
  .tg-bubble { width: 250px; bottom: 0; }
  .landing .topbar-in .btn-row .btn { padding: 8px 12px; font-size: .9rem; }
}
