/* Админка */

body { min-height: 100vh; }

/* ---------- вход ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login form {
  width: min(380px, 100%); display: grid; gap: 16px;
  padding: 28px; background: var(--panel); border: 1px solid var(--line-soft); border-radius: 8px;
}
.login h1 { font-size: 26px; }
.login p { color: var(--muted); margin: -8px 0 4px; font-size: 14px; }
.form-error { color: #ff9f99; font-size: 14px; margin: 0; }
.form-error:empty { display: none; }

/* ---------- каркас ---------- */
.adm-top {
  height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 20px; background: var(--bg-sunk); border-bottom: 1px solid var(--line-soft);
  position: sticky; top: 0; z-index: 20;
}
.adm-brand { display: flex; align-items: baseline; gap: 10px; text-decoration: none; color: var(--text); }
.adm-brand b { font: 700 18px/1 var(--font-display); }
.adm-brand span { color: var(--muted); font-size: 14px; }
.adm-top-actions { display: flex; gap: 8px; align-items: center; }
.adm-user { color: var(--faint); font-size: 13px; margin-right: 6px; }

.adm-body { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: calc(100vh - 56px); }
.adm-side {
  border-right: 1px solid var(--line-soft); padding: 18px 12px;
  position: sticky; top: 56px; align-self: start; max-height: calc(100vh - 56px); overflow: auto;
}
.adm-side .btn { width: 100%; justify-content: center; margin-bottom: 18px; }
.adm-group + .adm-group { margin-top: 16px; }
.adm-group h2 { font: 500 13px/1 var(--font-body); color: var(--faint); margin: 0 8px 8px; }
.adm-maps { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.adm-maps a {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 10px; border-radius: var(--r-md);
  color: var(--muted); text-decoration: none; font-weight: 500;
}
.adm-maps a:hover { background: var(--panel); color: var(--text); }
.adm-maps a[aria-current="true"] { background: var(--panel-hi); color: var(--text); }
.adm-maps .n { font: 500 12px/1 var(--font-display); color: var(--faint); }
.tag {
  display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 10px;
  font-size: 12px; font-weight: 500; background: var(--bg-sunk); color: var(--muted); border: 1px solid var(--line);
}
.tag-draft { color: var(--flash); border-color: #5c5530; }
.tag-ok { color: var(--ok); border-color: #2f5a3f; }

.adm-main { padding: 24px 28px 120px; min-width: 0; }
.adm-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 20px; }
.adm-head-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.adm-head-title img { width: 32px; height: 32px; object-fit: contain; }
.adm-head-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.adm-sub { color: var(--muted); font-size: 14px; margin-top: 4px; }

.welcome { max-width: 620px; }
.welcome p { color: var(--muted); }
.welcome ol { color: var(--muted); padding-left: 20px; }
.welcome li { margin-bottom: 6px; }

/* ---------- карта: радар + таблица ---------- */
.map-work { display: grid; grid-template-columns: minmax(280px, 500px) minmax(0, 1fr); gap: 28px; align-items: start; }
.map-work .radar-box { position: sticky; top: 76px; }
.map-work .radar-pins { cursor: copy; }
.radar-hint { color: var(--faint); font-size: 13px; margin-top: 10px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.toolbar .input { width: 220px; height: 36px; }

.ntable { width: 100%; border-collapse: collapse; font-size: 14px; }
.ntable th { text-align: left; font-weight: 500; color: var(--faint); font-size: 13px; padding: 0 10px 8px; }
.ntable td { padding: 8px 10px; border-top: 1px solid var(--line-soft); vertical-align: middle; }
.ntable tr.is-hot td { background: var(--panel); }
.ntable .thumb-sm { width: 72px; max-width: none; aspect-ratio: 16/9; border-radius: var(--r-sm); background: var(--bg-sunk); object-fit: cover; display: grid; place-items: center; }
.ntable td:first-child { width: 88px; }
.ntable .t-title { min-width: 180px; }
.ntable .t-title a { display: inline-block; }
.ntable .thumb-sm .ico { width: 22px; height: 22px; opacity: 0.6; }
.ntable .t-title a { color: var(--text); font-weight: 600; text-decoration: none; }
.ntable .t-title a:hover { text-decoration: underline; }
.ntable .t-sub { color: var(--faint); font-size: 12px; margin-top: 2px; }
.ntable .t-num { font-family: var(--font-display); color: var(--muted); text-align: right; }
.ntable .t-actions { text-align: right; white-space: nowrap; }
.warn-ico { color: var(--flash); font-size: 12px; }
.btn-del { background: transparent; border-color: transparent; color: var(--faint); }
.btn-del:hover { color: #ff8b84; border-color: #5a3434; background: #2e2223; }

/* ---------- формы ---------- */
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 520px); gap: 28px; align-items: start; }
.form-col { display: grid; gap: 18px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.fieldset legend { font-size: 13px; color: var(--muted); padding: 0; margin-bottom: 6px; }
.slug-row { display: flex; align-items: center; gap: 0; }
.slug-row .prefix {
  height: 38px; display: inline-flex; align-items: center; padding: 0 10px;
  background: var(--panel); border: 1px solid var(--line); border-right: 0;
  border-radius: var(--r-md) 0 0 var(--r-md); color: var(--faint); font-size: 14px; white-space: nowrap;
}
.slug-row .input { border-radius: 0 var(--r-md) var(--r-md) 0; }
.checks { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.fieldset .seg { justify-self: start; }
.toast-host { bottom: 84px; }

/* сегменты на radio */
.seg-radio label { position: relative; }
.seg-radio input { position: absolute; opacity: 0; pointer-events: none; }
.seg-radio span {
  display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px; border-radius: 4px;
  color: var(--muted); font-weight: 500; font-size: 14px; cursor: pointer;
}
.seg-radio span:hover { color: var(--text); }
.seg-radio input:checked + span { background: var(--panel-hi); color: var(--text); }
.seg-radio input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 1px; }

/* загрузка файлов */
.drops { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.drop {
  position: relative; display: grid; gap: 8px; padding: 10px;
  border: 1px dashed var(--line); border-radius: var(--r-md); background: var(--bg-sunk);
}
.drop:focus { outline: none; border-color: var(--focus); border-style: solid; }
.drop.is-over { border-color: var(--focus); background: #1f2b33; }
.drop-preview {
  aspect-ratio: 16 / 9; border-radius: var(--r-sm); overflow: hidden;
  background: var(--panel); display: grid; place-items: center; color: var(--faint); font-size: 13px; text-align: center; padding: 0;
}
.drop.is-square .drop-preview { aspect-ratio: 1; }
.drop-preview img, .drop-preview video { width: 100%; height: 100%; object-fit: contain; }
.drop-label { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; }
.drop-label small { color: var(--faint); font-weight: 400; font-size: 12px; }
.drop-buttons { display: flex; gap: 6px; flex-wrap: wrap; }
.drop-note { font-size: 12px; color: var(--faint); min-height: 1em; }
.drop-note.is-new { color: var(--ok); }

/* выбор точек */
.picker { position: sticky; top: 76px; display: grid; gap: 12px; }
.picker .radar-pins { cursor: crosshair; touch-action: none; }
.picker .pin { cursor: grab; touch-action: none; }
.picker .pin:active { cursor: grabbing; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.dot-throw { background: var(--t); }
.dot-land { background: var(--smoke); box-shadow: 0 0 0 2px var(--bg-sunk), 0 0 0 3px var(--smoke); }
.coords { display: grid; grid-template-columns: auto 1fr 1fr auto; gap: 8px 8px; align-items: center; font-size: 14px; }
.coords .input { height: 32px; font-size: 14px; padding: 0 8px; }
.coords .lbl { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }

/* нижняя панель сохранения */
.savebar {
  position: fixed; left: 250px; right: 0; bottom: 0; z-index: 15;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 28px; background: rgba(23, 32, 38, 0.96); border-top: 1px solid var(--line);
  backdrop-filter: blur(6px);
}
.savebar .spacer { flex: 1; }
.progress { width: 160px; height: 6px; border-radius: 3px; background: var(--line-soft); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--ok); transition: width 120ms linear; }
.progress[hidden] { display: none; }

.danger { margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--line-soft); }
.danger h2 { font-size: 16px; margin-bottom: 6px; }
.danger p { color: var(--muted); font-size: 14px; }

@media (max-width: 1100px) {
  .map-work, .form-grid { grid-template-columns: 1fr; }
  .map-work .radar-box, .picker { position: static; }
  .map-work .radar-box, .picker { max-width: 560px; }
}
@media (max-width: 760px) {
  .adm-body { grid-template-columns: 1fr; }
  .adm-side { position: static; max-height: none; border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .adm-main { padding: 20px 16px 140px; }
  .savebar { left: 0; padding: 12px 16px; }
  .ntable .hide-sm { display: none; }
}
