/* Дополнения к дизайн-системе для рабочей CRM: формы, проверки */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-section { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin: 18px 0 10px; grid-column: 1 / -1; }
.form-section:first-child { margin-top: 0; }
.field textarea { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); outline: none; min-height: 70px; resize: vertical; }
.field .hint { font-size: 11px; color: var(--faint); margin-top: 4px; }
.field.check { display: flex; align-items: center; gap: 10px; }
.field.check label { margin: 0; }
.modal.wide { width: min(820px, 100%); }
.error-box { background: var(--danger-soft); color: var(--danger); padding: 10px 12px; border-radius: 10px; font-weight: 700; font-size: 13px; margin-bottom: 12px; }
.warn-box { background: var(--warning-soft); color: var(--warning); padding: 10px 12px; border-radius: 10px; font-size: 13px; margin-bottom: 12px; }
.warn-box.bad { background: var(--danger-soft); color: var(--danger); }
.warn-box a { text-decoration: underline; font-weight: 700; }
.note svg, .warn-box svg, .error-box svg, .empty > svg, .card-head h3 svg { width: 16px; height: 16px; vertical-align: -3px; flex: none; }

.checks { display: flex; flex-direction: column; }
.chk { display: grid; grid-template-columns: 1fr auto; gap: 8px 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); }
.chk:last-child { border-bottom: 0; }
.chk .t { font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chk .s { font-size: 12px; color: var(--muted); margin-top: 2px; }
.chk .btns { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.chk .btn.on-ok { background: var(--success-soft); border-color: var(--success); color: var(--success); }
.chk .btn.on-bad { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.copy { cursor: pointer; border-bottom: 1px dashed var(--faint); }
.copy:hover { color: var(--accent); }
.empty-state { text-align: center; padding: 50px 20px; }
.empty-state h3 { margin: 10px 0 6px; font-size: 18px; }
.empty-state p { color: var(--muted); margin: 0 0 18px; }
.empty-state svg { width: 46px; height: 46px; color: var(--faint); }
/* Фотоакт */
.photo-wrap { position: relative; aspect-ratio: 4/3; border-radius: 10px; overflow: hidden; background: var(--surface-3); }
.photo-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-del { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(0,0,0,.55); color: #fff; display: grid; place-items: center; cursor: pointer; padding: 0; }
.photo-del svg { width: 14px; height: 14px; }
label.btn input[type=file] { display: none; }

/* Вход */
body.logged-out .sidebar, body.logged-out .topbar { display: none; }
body.logged-out .app { grid-template-columns: 1fr; }
/* Экран входа занимает всё окно — форма ровно по центру по горизонтали и вертикали */
.login-wrap { position: fixed; inset: 0; display: grid; place-items: center; padding: 16px; overflow-y: auto; background: var(--bg); }
.login-card { width: min(400px, 100%); padding: 28px; }
.login-card h2 { margin: 14px 0 4px; font-size: 22px; }
.login-card p { margin: 0 0 18px; }
.login-logo { display: flex; align-items: center; gap: 10px; color: var(--text); }
.login-logo .logo-word { color: var(--text); }
.sidebar-foot #me { display: block; margin-top: 2px; }
/* isolation: слои Leaflet (z-index до 1000) остаются внутри карты и не перекрывают окна и подсказки */
#leaflet { height: 520px; border-radius: 12px; overflow: hidden; background: var(--surface-2); position: relative; z-index: 0; isolation: isolate; }
.btn.success { color: var(--success); border-color: var(--success); background: var(--success-soft); }
.btn.success:hover { background: var(--success); color: #fff; }
.leaflet-tooltip.map-label { background: #2B211B; color: #FBF3E9; border: 0; font-weight: 700; font-size: 11px; padding: 2px 6px; box-shadow: none; }
.leaflet-tooltip.map-label::before { display: none; }
td select { padding: 6px 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); }

@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
  .chk { grid-template-columns: 1fr; }
  .chk .btns { justify-content: flex-start; }
}
