@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('fonts/manrope-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('fonts/manrope-cyrillic-ext.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('fonts/manrope-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('fonts/manrope-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg: #f3f6f4;
  --card: #ffffff;
  --ink: #0f1b16;
  --muted: #5d6b64;
  --muted-2: #8b978f;
  --line: #e2e8e4;
  --line-strong: #cfd8d2;
  --brand: #0f6b4f;
  --brand-700: #0b5640;
  --brand-50: #e8f3ee;
  --brand-100: #d3e9df;
  --accent: #ef9d35;
  --accent-50: #fdf3e3;
  --ok: #1e8a5b;
  --ok-50: #e6f5ed;
  --warn: #a8690b;
  --warn-50: #fdf2df;
  --danger: #c0392b;
  --danger-50: #fbecea;
  --info: #2f6fb3;
  --info-50: #e9f1fa;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 27, 22, .05), 0 1px 3px rgba(15, 27, 22, .06);
  --shadow-md: 0 6px 24px rgba(15, 27, 22, .08);
  --shadow-lg: 0 18px 48px rgba(15, 27, 22, .18);
  --sidebar: #0d201a;
  --sidebar-2: #123027;
  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-700); }
img { max-width: 100%; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 23px; line-height: 1.2; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p { margin: 0; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- каркас ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 268px; flex: none; background: var(--sidebar); color: #dfeee7;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
  padding: 22px 16px 16px;
}
.brand { display: flex; align-items: center; gap: 12px; color: #fff; padding: 4px 8px 22px; }
.brand:hover { color: #fff; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(145deg, #1c8a68, #0f6b4f);
  display: grid; place-items: center; color: #eafff6; box-shadow: 0 6px 16px rgba(15, 107, 79, .35);
}
.brand-mark svg { width: 26px; height: 26px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text b { font-size: 16px; letter-spacing: -.01em; }
.brand-text small { color: #86a396; font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; margin-top: 3px; }
.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-label {
  font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: #6d8a7d;
  padding: 20px 12px 8px;
}
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px;
  color: #c4d7cd; font-weight: 600; font-size: 14px; border: 0; background: none;
  cursor: pointer; width: 100%; text-align: left; font-family: inherit;
}
.nav-item .i { width: 19px; height: 19px; opacity: .85; }
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-item.is-active { background: var(--sidebar-2); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .05); }
.nav-item.is-active .i { color: #5fd3a7; opacity: 1; }
.nav-out { color: #94ab9f; }
.sidebar-foot { border-top: 1px solid rgba(255, 255, 255, .08); padding-top: 12px; display: flex; flex-direction: column; gap: 4px; }
.user-card { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; color: #e9f5ef; }
.user-card:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.user-card .i { width: 17px; height: 17px; color: #7e9a8c; margin-left: auto; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; background: #1d4a39; color: #b8f0d5;
  display: grid; place-items: center; font-size: 13px; font-weight: 700; letter-spacing: .02em; flex: none;
}
.user-meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.user-meta b { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-meta small { font-size: 11.5px; color: #86a396; }
.logout-form { margin: 0; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 16px; padding: 18px 30px; background: rgba(243, 246, 244, .86);
  backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 30; border-bottom: 1px solid rgba(226, 232, 228, .7);
}
.page-head { min-width: 0; }
.page-head h1 { font-size: 22px; }
.page-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.topbar-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.burger { display: none; }
.content { padding: 24px 30px 64px; width: 100%; max-width: 1280px; margin: 0 auto; }
.content--wide { max-width: 100%; padding: 0; }

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: inherit; font-size: 14px; font-weight: 650; line-height: 1;
  padding: 11px 16px; border-radius: 10px; border: 1px solid transparent;
  background: var(--brand); color: #fff; cursor: pointer; white-space: nowrap;
  transition: transform .06s ease, background .15s ease, box-shadow .15s ease;
  text-decoration: none;
}
.btn:hover { background: var(--brand-700); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn .i { width: 18px; height: 18px; }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.btn-ghost:hover { background: #f7faf8; color: var(--ink); border-color: #b9c6bf; }
.btn-soft { background: var(--brand-50); color: var(--brand-700); }
.btn-soft:hover { background: var(--brand-100); color: var(--brand-700); }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #a43325; }
.btn-danger-soft { background: var(--danger-50); color: var(--danger); }
.btn-danger-soft:hover { background: #f7ddd9; color: var(--danger); }
.btn-sm { padding: 8px 12px; font-size: 13px; border-radius: 9px; }
.btn-lg { padding: 14px 22px; font-size: 15px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.icon-btn {
  width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 10px;
  border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer;
}
.icon-btn:hover { background: rgba(15, 27, 22, .05); color: var(--ink); }
.icon-btn .i { width: 19px; height: 19px; }
.link-btn { background: none; border: 0; color: var(--brand); font: inherit; font-weight: 650; cursor: pointer; padding: 0; }
.link-btn:hover { text-decoration: underline; }
.danger-link { color: var(--danger); }

/* ---------- карточки ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad { padding: 20px 22px; }
.card-head { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.card-head h2 { font-size: 16px; }
.card-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.section + .section { margin-top: 18px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.nowrap { white-space: nowrap; }
.mono { font-variant-numeric: tabular-nums; }
.right { margin-left: auto; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.grid { display: grid; gap: 16px; }

/* ---------- статистика ---------- */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; box-shadow: var(--shadow-sm); }
.stat b { display: block; font-size: 27px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.stat span { color: var(--muted); font-size: 12.5px; }
.stat--warn b { color: var(--warn); }

/* ---------- фильтры ---------- */
.filters {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap; background: var(--card);
  border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin-bottom: 14px; box-shadow: var(--shadow-sm);
}
.search { position: relative; flex: 1 1 260px; min-width: 200px; }
.search .i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted-2); }
.search input { width: 100%; padding-left: 38px; }
.select-wrap { position: relative; }
select, input[type="text"], input[type="password"], input[type="number"], input[type="date"], input[type="tel"], input[type="search"], textarea {
  font-family: inherit; font-size: 14px; color: var(--ink); background: #fff;
  border: 1px solid var(--line-strong); border-radius: 10px; padding: 10px 12px; width: 100%;
  transition: border-color .12s ease, box-shadow .12s ease; min-height: 42px;
}
select { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%235d6b64' stroke-width='1.8'%3E%3Cpath d='m3 5 4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.search input { padding-left: 38px; }
select:focus, input:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(15, 107, 79, .12); }
textarea { min-height: 92px; resize: vertical; }
input[type="file"] { font-size: 13px; padding: 8px; background: #f7faf8; }
.filters select { width: auto; min-width: 150px; }

/* ---------- список точек ---------- */
.list { display: flex; flex-direction: column; }
.list-row {
  display: grid; grid-template-columns: 54px minmax(0, 1fr) 190px 150px 90px 24px; gap: 16px; align-items: center;
  padding: 14px 18px; border-bottom: 1px solid var(--line); color: var(--ink);
}
.list-row:last-child { border-bottom: 0; }
.list-row:hover { background: #f8fbf9; color: var(--ink); }
.thumb { width: 54px; height: 54px; border-radius: 12px; object-fit: cover; background: var(--brand-50); }
.thumb-ph { width: 54px; height: 54px; border-radius: 12px; background: var(--brand-50); display: grid; place-items: center; color: var(--brand); }
.list-title { font-weight: 700; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-sub { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.list-cell { font-size: 13px; }
.list-cell .lbl { display: block; color: var(--muted-2); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 3px; }
.list-row .chev { color: var(--muted-2); display: grid; place-items: center; }
.list-head { display: grid; grid-template-columns: 54px minmax(0, 1fr) 190px 150px 90px 24px; gap: 16px; padding: 10px 18px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted-2); border-bottom: 1px solid var(--line); background: #fafcfb; border-radius: var(--radius) var(--radius) 0 0; }

/* ---------- бейджи ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 650;
  padding: 4px 9px; border-radius: 999px; background: #f1f4f2; color: var(--muted); white-space: nowrap;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.badge.no-dot::before { display: none; }
.badge-success { background: var(--ok-50); color: var(--ok); }
.badge-no_contact { background: #f1f4f2; color: #64726b; }
.badge-refused { background: var(--danger-50); color: var(--danger); }
.badge-repeat { background: var(--warn-50); color: var(--warn); }
.badge-agreement { background: var(--info-50); color: var(--info); }
.badge-other { background: #efeaf7; color: #6b4fa3; }
.badge-draft { background: #f1f4f2; color: #64726b; }
.badge-active { background: var(--ok-50); color: var(--ok); }
.badge-archived { background: #f1f4f2; color: var(--muted); }
.badge-admin { background: var(--brand-50); color: var(--brand); }
.badge-blocked { background: var(--danger-50); color: var(--danger); }

/* ---------- карточка точки ---------- */
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .9fr); gap: 18px; align-items: start; }
.point-hero { overflow: hidden; }
.hero-map { height: 210px; background: var(--brand-50); }
.hero-map .leaflet-container { height: 100%; font-family: var(--font); }
.hero-body { padding: 20px 22px; }
.hero-title { display: flex; gap: 12px; align-items: flex-start; }
.hero-title h1 { font-size: 24px; }
.hero-addr { color: var(--muted); margin-top: 6px; display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; }
.hero-addr .i { width: 17px; height: 17px; margin-top: 2px; color: var(--brand); }
.meta-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.meta { background: #f8faf9; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.meta span { display: block; color: var(--muted-2); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.meta b { font-size: 14px; font-weight: 700; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); padding: 0 14px; overflow-x: auto; scrollbar-width: none; background: #fafcfb; }
.tabs::-webkit-scrollbar { display: none; }
.tab-link {
  appearance: none; border: 0; background: none; font: inherit; font-weight: 650; font-size: 13.5px; color: var(--muted);
  padding: 14px 12px 12px; border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap;
}
.tab-link:hover { color: var(--ink); }
.tab-link.is-active { color: var(--brand); border-bottom-color: var(--brand); }
.tab-panel { padding: 20px 22px; }
.tab-panel[hidden] { display: none; }

/* ---------- фото ---------- */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; }
.photo { position: relative; border-radius: 12px; overflow: hidden; aspect-ratio: 4/3; background: #eef2ef; border: 1px solid var(--line); }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo .del { position: absolute; top: 6px; right: 6px; background: rgba(15, 27, 22, .72); color: #fff; border: 0; border-radius: 8px; width: 30px; height: 30px; display: grid; place-items: center; cursor: pointer; opacity: 0; transition: opacity .15s; }
.photo:hover .del { opacity: 1; }
.photo .del .i { width: 16px; height: 16px; }
.upload-tile { border: 1.5px dashed var(--line-strong); border-radius: 12px; display: grid; place-items: center; aspect-ratio: 4/3; color: var(--muted); cursor: pointer; gap: 6px; text-align: center; font-size: 12.5px; background: #fbfdfc; }
.upload-tile:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-50); }
.upload-tile .i { width: 22px; height: 22px; }

/* ---------- контакты ---------- */
.contact { display: flex; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.contact:last-child { border-bottom: 0; }
.contact .avatar { width: 38px; height: 38px; background: var(--brand-50); color: var(--brand); font-size: 12px; }
.contact b { font-size: 14px; }
.contact .meta-line { color: var(--muted); font-size: 12.5px; margin-top: 1px; }
.contact .comment { color: var(--muted); font-size: 12.5px; margin-top: 4px; }

/* ---------- таймлайн ---------- */
.timeline { position: relative; padding-left: 18px; }
.timeline::before { content: ''; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 1px; background: var(--line-strong); }
.tl-item { position: relative; padding: 0 0 18px 8px; }
.tl-item::before { content: ''; position: absolute; left: -17px; top: 5px; width: 9px; height: 9px; border-radius: 50%; background: #fff; border: 2px solid var(--line-strong); }
.tl-item.is-now::before { border-color: var(--brand); background: var(--brand); }
.tl-title { font-weight: 650; font-size: 13.5px; }
.tl-time { color: var(--muted-2); font-size: 12px; }
.tl-text { color: var(--muted); font-size: 13px; margin-top: 3px; }
.diff { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 13px; margin-top: 4px; }
.diff .old { color: var(--danger); text-decoration: line-through; text-decoration-thickness: 1px; opacity: .8; }
.diff .new { color: var(--ok); font-weight: 650; }

/* ---------- формы ---------- */
.field { margin-bottom: 16px; }
.field > label, .label { display: block; font-size: 12.5px; font-weight: 650; color: var(--muted); margin-bottom: 6px; }
.field .hint { color: var(--muted-2); font-size: 12px; margin-top: 5px; }
.req { color: var(--danger); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-grid .span2 { grid-column: span 2; }
.form-actions { display: flex; gap: 10px; align-items: center; padding-top: 8px; flex-wrap: wrap; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--brand); min-height: 0; }
.radio-cards { display: flex; gap: 8px; flex-wrap: wrap; }
.radio-cards label { position: relative; cursor: pointer; }
.radio-cards input { position: absolute; opacity: 0; pointer-events: none; }
.radio-cards span { display: inline-flex; align-items: center; gap: 9px; padding: 10px 16px; border: 1px solid var(--line-strong); border-radius: 10px; font-size: 13.5px; font-weight: 600; background: #fff; }
.radio-cards span::before { content: ''; width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid currentColor; opacity: .45; flex: none; }
.radio-cards input:checked + span::before { opacity: 1; background: currentColor; box-shadow: inset 0 0 0 3px #fff; }
.visit-results { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.visit-results label { display: block; }
.visit-results span { display: flex; width: 100%; }
.radio-cards input:checked + span { border-color: var(--brand); background: var(--brand-50); color: var(--brand-700); box-shadow: 0 0 0 1px var(--brand) inset; }
.radio-cards input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line-strong); background: #fff; border-radius: 999px; padding: 8px 14px; font: inherit; font-size: 13px; cursor: pointer; color: var(--ink); }
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.is-on { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ---------- анкеты ---------- */
.question-list { display: flex; flex-direction: column; gap: 12px; }
.q-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.q-card.dragging { opacity: .5; }
.q-head { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.q-num { width: 26px; height: 26px; border-radius: 8px; background: var(--brand-50); color: var(--brand-700); display: grid; place-items: center; font-size: 12px; font-weight: 800; }
.q-tools { margin-left: auto; display: flex; gap: 2px; }
.q-input { font-weight: 650; }
.option-row { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.option-row input { min-height: 38px; }
.fill-q { padding: 16px 0; border-bottom: 1px solid var(--line); }
.fill-q:last-child { border-bottom: 0; }
.fill-q .q-label { font-weight: 650; margin-bottom: 8px; display: flex; gap: 8px; }
.fill-q .q-help { color: var(--muted); font-size: 12.5px; margin: -4px 0 8px; }
.opt-list { display: flex; flex-direction: column; gap: 8px; }
.opt { display: flex; gap: 10px; align-items: center; padding: 11px 13px; border: 1px solid var(--line-strong); border-radius: 10px; cursor: pointer; font-size: 14px; }
.opt:hover { border-color: var(--brand); background: #fafdfb; }
.opt input { width: 17px; height: 17px; accent-color: var(--brand); min-height: 0; }
.opt.is-checked { border-color: var(--brand); background: var(--brand-50); }
.scale { display: flex; gap: 6px; flex-wrap: wrap; }
.scale label { cursor: pointer; }
.scale input { position: absolute; opacity: 0; pointer-events: none; }
.scale span { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 10px; font-weight: 650; background: #fff; }
.scale input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
.draft-bar { position: sticky; bottom: 0; background: rgba(255, 255, 255, .94); backdrop-filter: blur(8px); border-top: 1px solid var(--line); padding: 12px 0; display: flex; gap: 10px; align-items: center; z-index: 5; margin-top: 16px; }

/* ---------- таблица результатов ---------- */
.table-wrap { overflow-x: auto; border-radius: 0 0 var(--radius) var(--radius); }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 920px; }
table.data th { text-align: left; font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted-2); padding: 10px 14px; border-bottom: 1px solid var(--line); background: #fafcfb; white-space: nowrap; }
table.data td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tr:hover td { background: #f9fcfa; }

/* ---------- карта ---------- */
.map-page { position: relative; height: calc(100dvh - 76px); }
.map-canvas { position: absolute; inset: 0; }
.map-canvas .leaflet-container { height: 100%; font-family: var(--font); }
.map-panel {
  position: absolute; z-index: 500; top: 16px; left: 16px; width: 330px; max-width: calc(100% - 32px);
  display: flex; flex-direction: column; gap: 10px;
}
.map-card { background: rgba(255, 255, 255, .96); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-md); padding: 12px; backdrop-filter: blur(8px); }
.map-search { display: flex; gap: 8px; }
.map-search input { min-height: 38px; }
.map-legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); padding: 4px 2px; }
.legend-dot { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.pin { width: 26px; height: 26px; border-radius: 50% 50% 50% 2px; transform: rotate(-45deg); border: 3px solid #fff; box-shadow: 0 3px 8px rgba(15, 27, 22, .3); }
.pin > span { display: block; width: 100%; height: 100%; transform: rotate(45deg); }
.leaflet-popup-content { margin: 12px 14px; font-family: var(--font); }
.popup-title { font-weight: 800; font-size: 14px; margin-bottom: 2px; }
.popup-addr { color: var(--muted); font-size: 12.5px; margin-bottom: 8px; }
.popup-link { font-weight: 650; font-size: 12.5px; }
.map-list { max-height: 34vh; overflow-y: auto; display: flex; flex-direction: column; }
.map-list a { display: flex; gap: 8px; padding: 8px 6px; border-radius: 8px; color: var(--ink); font-size: 13px; align-items: center; }
.map-list a:hover { background: var(--brand-50); }
.map-list .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }

/* ---------- логин ---------- */
.login-page { min-height: 100vh; display: grid; grid-template-columns: 1.1fr .9fr; background: #0d201a; }
.login-art { position: relative; overflow: hidden; padding: 48px; color: #e8f5ee; display: flex; flex-direction: column; justify-content: space-between; background: radial-gradient(1200px 600px at 10% 10%, #174434, #0d201a 60%); }
.login-art::after { content: ''; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px); background-size: 44px 44px; mask-image: radial-gradient(600px 400px at 60% 40%, #000, transparent 75%); }
.login-art > * { position: relative; z-index: 1; }
.login-art h2 { font-size: 34px; line-height: 1.18; max-width: 460px; letter-spacing: -.02em; }
.login-art p { color: #9fb8ac; max-width: 420px; margin-top: 14px; font-size: 15px; }
.login-features { display: grid; gap: 10px; margin-top: 34px; max-width: 460px; }
.login-feature { display: flex; gap: 10px; align-items: center; font-size: 13.5px; color: #c6d9cf; }
.login-feature .i { color: #5fd3a7; width: 18px; height: 18px; }
.login-form-side { background: var(--bg); display: flex; align-items: center; justify-content: center; padding: 32px; }
.login-card { width: 100%; max-width: 400px; }
.login-card h1 { font-size: 26px; margin-bottom: 6px; }
.login-card .muted { margin-bottom: 24px; }
.login-hint { margin-top: 18px; background: #fff; border: 1px dashed var(--line-strong); border-radius: 12px; padding: 12px 14px; font-size: 12.5px; color: var(--muted); }
.login-hint b { color: var(--ink); }
.login-hint button { background: none; border: 0; color: var(--brand); font: inherit; font-weight: 700; cursor: pointer; padding: 0 2px; }
.login-error { background: var(--danger-50); color: var(--danger); border: 1px solid #f3d3cf; border-radius: 10px; padding: 10px 12px; font-size: 13px; margin-bottom: 14px; }

/* ---------- разное ---------- */
.flash-stack { position: fixed; top: 18px; right: 18px; z-index: 900; display: flex; flex-direction: column; gap: 8px; max-width: 420px; }
.flash { background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--brand); border-radius: 10px; padding: 11px 14px; box-shadow: var(--shadow-md); font-size: 13.5px; animation: slide-in .18s ease; display: flex; gap: 10px; align-items: flex-start; }
.flash-error { border-left-color: var(--danger); }
.flash-x { margin-left: auto; background: none; border: 0; font-size: 18px; line-height: 1; color: var(--muted-2); cursor: pointer; padding: 0 2px; }
@keyframes slide-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.offline-banner { margin: 0 30px; margin-top: 12px; background: var(--warn-50); color: var(--warn); border: 1px solid #f0d9ac; border-radius: 10px; padding: 10px 14px; font-size: 13px; display: flex; gap: 8px; align-items: center; }
.toast-stack { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 950; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: #10231c; color: #fff; border-radius: 10px; padding: 10px 16px; font-size: 13.5px; box-shadow: var(--shadow-lg); animation: toast-in .2s ease; }
.toast.err { background: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.empty { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty .i { width: 34px; height: 34px; color: var(--line-strong); margin-bottom: 10px; }
.empty b { display: block; color: var(--ink); margin-bottom: 4px; }
.page-section-title { font-size: 15px; font-weight: 750; margin: 22px 0 10px; display: flex; align-items: center; gap: 8px; }
.page-section-title .badge { font-weight: 650; }

.tabbar { display: none; }
.sheet { position: fixed; inset: 0; z-index: 800; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(9, 18, 14, .48); }
.sheet-panel { position: absolute; left: 0; right: 0; bottom: 0; background: #fff; border-radius: 18px 18px 0 0; padding: 12px 12px calc(18px + env(safe-area-inset-bottom)); box-shadow: var(--shadow-lg); animation: sheet-up .2s ease; }
@keyframes sheet-up { from { transform: translateY(20px); opacity: .6; } to { transform: none; opacity: 1; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 10px; }
.sheet-link { display: flex; gap: 12px; align-items: center; padding: 13px 10px; border-radius: 10px; color: var(--ink); font-weight: 600; width: 100%; background: none; border: 0; font: inherit; font-size: 14.5px; text-align: left; cursor: pointer; }
.sheet-link:hover { background: var(--brand-50); }
.sheet-link .i { width: 19px; height: 19px; color: var(--muted); }

.modal { position: fixed; inset: 0; z-index: 700; display: grid; place-items: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(9, 18, 14, .5); }
.modal-panel { position: relative; background: #fff; border-radius: 16px; box-shadow: var(--shadow-lg); width: 100%; max-width: 460px; padding: 22px; }
.modal-panel h3 { margin-bottom: 6px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }

.tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; background: #f3f6f4; border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; color: var(--muted); }
.kv { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 10px 18px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; }
.divider { height: 1px; background: var(--line); margin: 16px 0; }
.note { background: var(--brand-50); border-radius: 12px; padding: 12px 14px; font-size: 13px; color: var(--brand-700); }
.note-warn { background: var(--warn-50); color: var(--warn); }
.note-danger { background: var(--danger-50); color: var(--danger); }

/* ---------- адаптив ---------- */
@media (max-width: 1100px) {
  .detail-grid { grid-template-columns: 1fr; }
  .list-row, .list-head { grid-template-columns: 48px minmax(0, 1fr) 150px 110px 22px; }
  .list-head .col-owner, .list-row .col-owner { display: none; }
}
@media (max-width: 900px) {
  .sidebar {
    position: fixed; z-index: 600; left: 0; top: 0; bottom: 0; transform: translateX(-100%);
    transition: transform .22s ease; box-shadow: var(--shadow-lg); height: 100dvh;
  }
  .sidebar.is-open { transform: none; }
  .shell { display: block; }
  .topbar { padding: 14px 16px; }
  .burger { display: inline-grid; }
  .content { padding: 16px 16px 96px; }
  .page-head h1 { font-size: 19px; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; bottom: 0; left: 0; right: 0; z-index: 500;
    background: rgba(255, 255, 255, .97); backdrop-filter: blur(10px); border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .tab { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 0 7px; font-size: 10.5px; color: var(--muted); background: none; border: 0; font-family: inherit; font-weight: 600; }
  .tab .i { width: 21px; height: 21px; }
  .tab.is-active { color: var(--brand); }
  .stats { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .stat { padding: 12px; }
  .stat b { font-size: 22px; }
  .stat span { font-size: 11px; }
  .list-head { display: none; }
  .list-row {
    grid-template-columns: 46px minmax(0, 1fr); gap: 6px 12px; padding: 13px 14px;
    grid-template-areas: "thumb main" "last last"; align-items: center;
  }
  .list-row .thumb, .list-row .thumb-ph { grid-area: thumb; }
  .list-row .grow { grid-area: main; }
  .list-row .col-last {
    grid-area: last; text-align: left; padding-left: 58px; display: flex;
    align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 2px;
  }
  .list-row .col-last .tiny { margin-top: 0 !important; }
  .list-row .col-owner, .list-row .col-count { display: none; }
  .list-row .chev { display: none; }
  .filters .search, .filters select { flex: 1 1 100%; width: 100%; min-width: 0; }
  .filters .btn { flex: 1 1 auto; }
  .page-head h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .list-row .col-last { text-align: right; }
  .thumb, .thumb-ph { width: 46px; height: 46px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span2 { grid-column: auto; }
  .meta-grid { grid-template-columns: repeat(2, 1fr); }
  .login-page { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .login-form-side { min-height: 100dvh; align-items: flex-start; padding-top: 12vh; }
  .map-page { height: calc(100dvh - 60px - 58px); }
  .map-panel { top: 10px; left: 10px; right: 10px; width: auto; }
  .map-list { max-height: 24vh; }
  .kv { grid-template-columns: 1fr; gap: 4px 0; }
  .kv dt { margin-top: 8px; }
  .hero-title h1 { font-size: 20px; }
  .flash-stack { top: 10px; left: 10px; right: 10px; max-width: none; }
  .offline-banner { margin: 10px 16px 0; }
  .draft-bar { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
}
@media (max-width: 520px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .stats .stat:last-child { grid-column: span 2; }
  .radio-cards span { padding: 8px 12px; font-size: 13px; }
  .page-sub { display: none; }
  .topbar-actions .btn span { display: none; }
  .topbar-actions .btn { padding: 11px 12px; }
  .topbar-actions .btn .i { width: 20px; height: 20px; }
  .page-head h1 { font-size: 18px; }
}

/* --- уточнения для узких экранов (идут последними, перекрывают базовые) --- */
@media (max-width: 900px) {
  .page-head h1 {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.22;
  }
}
@media (max-width: 600px) {
  .hide-sm { display: none !important; }
  .topbar { gap: 10px; }
  .topbar-actions { gap: 4px; }
}

/* --- защита от горизонтального переполнения в сетках --- */
.detail-grid > * { min-width: 0; }
.tabs { max-width: 100%; }
.card { max-width: 100%; }

@media (max-width: 600px) {
  .draft-bar { flex-wrap: wrap; }
  .draft-bar .btn { flex: 1 1 auto; }
  .draft-bar .small { flex: 1 1 100%; }
  .q-head { flex-wrap: wrap; }
  .q-head select { flex: 1 1 130px; min-width: 0; }
  .q-card input, .q-card select, .q-card textarea { max-width: 100%; }
  .row.wrap select { min-width: 0; max-width: 100%; }
  .fill-q input, .fill-q select, .fill-q textarea { max-width: 100%; }
}

@media (max-width: 600px) {
  .visit-results { grid-template-columns: 1fr; }
}
