/* Admin editing UI */
.admin-ui { position: relative; z-index: 200; }
.admin-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 220;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 10px 14px;
  min-height: 52px;
  background: #111827;
  color: #fff;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
}
.admin-bar.is-hidden,
.admin-modal.is-hidden,
.admin-toast.is-hidden { display: none !important; }
.admin-bar__title {
  font-weight: 800;
  margin-right: auto;
  font-size: 13px;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.admin-bar__btn {
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.08);
  color: #fff;
  border-radius: 8px;
  padding: 8px 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.admin-bar__btn--ok { background: #16a34a; border-color: #16a34a; }
.admin-bar__btn:hover { filter: brightness(1.08); }

/* В режиме редактирования шапка обычная — скроллится вместе со страницей */
body.is-admin {
  --admin-bar-h: 52px;
  padding-top: var(--admin-bar-h);
  overflow-x: visible;
}
html.is-admin {
  overflow-x: visible;
}
body.is-admin .header {
  position: relative !important;
  top: auto !important;
  left: auto;
  right: auto;
  width: 100%;
  z-index: 1;
}
body.is-admin .is-admin-block {
  outline: 1px dashed rgba(22, 163, 74, .45);
  outline-offset: 3px;
}
body.is-admin [data-edit-key] {
  outline: none;
}

@media (max-width: 1024px) {
  body.is-admin .nav {
    position: absolute;
    top: 100%;
  }
}

.admin-edit-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: #16a34a;
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  z-index: 6;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 10px rgba(0,0,0,.2);
}
.admin-edit-btn:hover { transform: scale(1.08); }

.admin-edit-fields {
  display: grid;
  gap: 12px;
  max-height: min(65vh, 560px);
  overflow: auto;
  padding-right: 4px;
}
.admin-edit-field {
  display: grid;
  gap: 6px;
}
.admin-edit-field > span {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #5a6578;
}

.admin-modal {
  position: fixed;
  inset: 0;
  z-index: 230;
  background: rgba(11,18,32,.55);
  display: grid;
  place-items: center;
  padding: 16px;
}
.admin-modal__card {
  width: min(520px, 100%);
  background: #fff;
  color: #0b1220;
  border-radius: 12px;
  padding: 18px;
  display: grid;
  gap: 10px;
}
.admin-modal__card--wide { width: min(720px, 100%); }
.admin-modal__card h3 { margin: 0 0 4px; font-size: 18px; }
.admin-modal__card label {
  display: grid;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  color: #5a6578;
}
.admin-modal__card input,
.admin-modal__card textarea {
  width: 100%;
  border: 1px solid #d8dee8;
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
  color: #0b1220;
}
.admin-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 6px;
}
.admin-modal__actions .admin-bar__btn { color: #0b1220; background: #f2f4f8; border-color: #d8dee8; }
.admin-modal__actions .admin-bar__btn--ok { color: #fff; background: #16a34a; border-color: #16a34a; }
.admin-modal__err { color: #b91c1c; font-size: 13px; font-weight: 700; margin: 0; }

.admin-calc-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.admin-calc-veh {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 8px;
  align-items: end;
  padding: 10px;
  border: 1px solid #e8edf4;
  border-radius: 8px;
}
.admin-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 240;
  background: #111827;
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
}

@media (max-width: 700px) {
  .admin-calc-grid,
  .admin-calc-veh { grid-template-columns: 1fr; }
}
