.admin-body { margin: 0; background: #eef2f7; }

/* Экран входа: фон на всю высоту окна, карточка — только по высоте контента */
.admin-body--login {
  min-height: 100vh;
  min-height: 100dvh;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.admin-body--login .admin-login-card {
  margin: 0;
  width: 100%;
  max-width: 420px;
  flex: 0 0 auto;
  box-sizing: border-box;
}
.admin-top { padding: 16px; }
.admin-label { display: block; font-weight: 800; font-size: 12px; color: #6b7280; margin: 0 0 6px; }
.admin-input { width: 100%; box-sizing: border-box; border: 1px solid #e5e7eb; border-radius: 12px; padding: 12px; }
.admin-input--sm { padding: 10px 12px; border-radius: 12px; font-size: 14px; }
.admin-hint { color: #6b7280; font-size: 13px; }
.admin-warn { background: #fff7ed; border: 1px solid #fed7aa; padding: 12px; border-radius: 12px; font-size: 13px; }
.admin-list { display: flex; flex-direction: column; gap: 8px; }
.admin-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px; border: 1px solid #e5e7eb; background: #fff; border-radius: 12px; }
.admin-title { font-weight: 800; }
.admin-sub { color: #6b7280; font-size: 12px; }
.admin-link { text-decoration: none; color: #0f172a; font-size: 13px; font-weight: 700; }

.admin-login-card {
  max-width: 400px;
  margin: 48px auto;
  padding: 24px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.12);
  border: 1px solid #e5e7eb;
}
.admin-login-title { margin: 0 0 8px; font-size: 22px; color: #0f172a; }
.admin-login-form .admin-label { margin-top: 12px; }
.admin-login-form .admin-label:first-of-type { margin-top: 0; }
.admin-panel-hidden { display: none; }
/* Перебивает глобальный .admin-btn из styles.css (градиент, width:100%) */
.admin-btn.admin-btn--ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  max-width: 100%;
  margin-bottom: 0;
  box-shadow: none;
  background: transparent;
  color: #0f172a;
  border: 1px solid #e5e7eb;
  padding: 8px 14px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  box-sizing: border-box;
}
.admin-btn.admin-btn--ghost:hover { background: #f8fafc; }
.admin-btn.admin-btn--ghost.admin-btn--block {
  width: 100%;
  display: flex;
}
textarea.admin-input { min-height: 72px; resize: vertical; font-family: inherit; }

.admin-theme-block { margin-bottom: 18px; }
.admin-theme-block .admin-btn--muted {
  margin-top: 8px;
  width: auto;
  padding: 8px 14px;
  font-size: 13px;
  background: #e5e7eb;
  color: #374151;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
}
.admin-theme-preview {
  margin-top: 8px;
  min-height: 0;
}
.admin-theme-preview img {
  display: block;
  max-width: 100%;
  max-height: 140px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  object-fit: cover;
}
input[type="file"].admin-input { padding: 10px; }

/* --- New layout (3 panels) --- */
.admin-shell {
  max-width: 1240px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 0 0 28px;
  display: flex;
  flex-direction: column;
  gap: 25px;
  box-sizing: border-box;
}
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: #fff;
  color: #0f172a;
  padding: 14px 16px;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.2);
}
.admin-header-left { display: flex; align-items: center; gap: 10px; }
.admin-header-left .admin-title { font-size: 18px; font-weight: 700; letter-spacing: 0.2px; }
.admin-subtitle { display: none; }
.admin-header-right { display: flex; align-items: center; gap: 12px; }
.admin-header-right > * { margin-bottom: 0 !important; }
.admin-hotel { min-width: 260px; }
.admin-hotel-select { width: auto; min-width: 260px; height: 40px; padding-top: 0; padding-bottom: 0; }

.admin-main {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 25px;
  margin-top: 0;
  align-items: start;
}
.admin-sidebar {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 10px;
  position: sticky;
  top: 0;
  height: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.nav-item {
  appearance: none;
  border: 1px solid transparent;
  background: #f8fafc;
  color: #0f172a;
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 800;
  cursor: pointer;
  text-align: left;
}
.nav-item:hover { background: #eef2ff; }
.nav-item.active { background: #e0e7ff; border-color: #c7d2fe; }
.sidebar-spacer { flex: 1; }
.nav-link { display:block; padding: 10px 12px; border-radius: 12px; text-decoration:none; font-weight:800; color:#0f172a; background:#f1f5f9; border: 1px solid #e5e7eb; }
.nav-link:hover { background:#e2e8f0; }

.admin-content { min-width: 0; padding: 0; }
.admin-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.panel {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  overflow-x: hidden;
  overflow-y: visible;
  min-width: 0;
}
.panel-head { padding: 12px 14px; display:flex; justify-content:space-between; align-items:center; gap:10px; border-bottom: 1px solid #e5e7eb; background: #fbfdff; }
.panel-title { font-weight: 900; color: #0f172a; }
.panel-actions { display:flex; gap:8px; align-items:center; }
.panel-actions > * { margin-bottom: 0 !important; }
.panel-body { padding: 12px 14px; }

.toolbar { display:flex; gap:8px; align-items:center; margin-bottom: 10px; flex-wrap: wrap; }
.toggle-row { display:flex; align-items:center; gap:8px; font-weight:800; color:#334155; user-select:none; }
.toggle-row input { transform: translateY(1px); }

.product-grid { display:grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
@media (max-width: 1120px) { .admin-sidebar { position: static; height:auto; } .admin-main { grid-template-columns: 1fr; } .product-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); } }
@media (max-width: 520px) { .product-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); } }

.product-card {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  overflow: hidden;
}
.product-card:hover { box-shadow: 0 10px 20px rgba(15,23,42,0.08); transform: translateY(-1px); transition: 120ms ease; }
.product-card.disabled { opacity: 0.55; }
.product-thumb { height: 110px; background: linear-gradient(135deg, #e2e8f0, #f8fafc); display:flex; align-items:center; justify-content:center; overflow:hidden; position: relative; }
.product-thumb img { width:100%; height:100%; object-fit:cover; display:block; }
.product-meta { padding: 8px 10px 10px; }
.product-name { font-weight: 900; font-size: 13px; color:#0f172a; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 32px; }
.product-sub { display:none; }
.product-price {
  position: absolute;
  right: 8px;
  bottom: 8px;
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(226,232,240,0.9);
  backdrop-filter: blur(6px);
  border-radius: 10px;
  font-weight: 900;
  font-size: 12px;
  padding: 6px 8px;
  color: #0f172a;
}
.badge { font-size: 11px; font-weight: 900; padding: 4px 8px; border-radius: 999px; border: 1px solid #e5e7eb; background: #f8fafc; color:#334155; }
.badge.off { background:#fff1f2; border-color:#fecdd3; color:#9f1239; }

.empty-hint { display: none; }
.empty-editor-hint { display: none; }

/* Categories nesting */
.admin-row.subcat {
  background: #f8fafc;
  border-color: #e2e8f0;
  padding: 8px 10px;
  margin-left: 18px;
}
.admin-row.subcat .admin-title { font-weight: 800; font-size: 13px; }
.admin-row.subcat .admin-sub { font-size: 11px; }

.admin-row { position: relative; }
.admin-row.drop-target {
  outline: 2px solid #60a5fa;
  outline-offset: 2px;
}

.admin-row.drop-before::before,
.admin-row.drop-after::after {
  content: '';
  position: absolute;
  left: 4px;
  right: 4px;
  height: 3px;
  background: #60a5fa;
  border-radius: 2px;
  pointer-events: none;
}
.admin-row.drop-before::before { top: -5px; }
.admin-row.drop-after::after { bottom: -5px; }

.product-form { display:block; }
.form-split { display:grid; grid-template-columns: 1.2fr 0.9fr; gap: 12px; align-items:start; }
@media (max-width: 1120px) { .form-split { grid-template-columns: 1fr; } }

.product-active-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.product-active-top__text {
  font-weight: 400;
  color: #0f172a;
  font-size: 14px;
  line-height: 1.35;
}

.row-2 { display:grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 520px) { .row-2 { grid-template-columns: 1fr; } }

.side-card { border: 1px solid #e5e7eb; background: #f8fafc; border-radius: 14px; padding: 12px; }
.side-row { display:flex; gap: 10px; align-items:flex-start; }
.side-title { font-weight: 900; color:#0f172a; }
.divider { height:1px; background:#e5e7eb; margin: 12px 0; }
.side-actions { display:flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

.switch { position: relative; display:inline-flex; align-items:center; }
.switch input { display:none; }
.switch-ui { width: 44px; height: 26px; border-radius: 999px; background: #e2e8f0; border: 1px solid #cbd5e1; position:relative; flex: 0 0 auto; }
.switch-ui::after { content:''; width: 22px; height: 22px; border-radius: 999px; background: #fff; position:absolute; top: 1px; left: 1px; box-shadow: 0 4px 10px rgba(15,23,42,0.18); transition: 140ms ease; }
.switch input:checked + .switch-ui { background: #c7d2fe; border-color:#a5b4fc; }
.switch input:checked + .switch-ui::after { left: 21px; }

.switch-ui.switch-ui--sm { width: 34px; height: 20px; }
.switch-ui.switch-ui--sm::after { width: 16px; height: 16px; top: 1px; left: 1px; }
.switch input:checked + .switch-ui.switch-ui--sm::after { left: 16px; }

/* Modal (used by Vite admin) */
.rs-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.rs-modal {
  width: min(860px, 100%);
  max-height: min(88vh, 900px);
  overflow: auto;
  background: #fff;
  border-radius: 16px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.35);
}
.rs-modal-head {
  position: sticky;
  top: 0;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  z-index: 2;
}
.rs-modal-title { font-weight: 900; color: #0f172a; }
.rs-modal-close {
  appearance: none;
  border: 1px solid #e5e7eb;
  background: #f8fafc;
  border-radius: 12px;
  padding: 8px 10px;
  cursor: pointer;
  font-weight: 900;
}
.rs-modal-body { padding: 12px 14px; }
.rs-modal-foot {
  position: sticky;
  bottom: 0;
  background: #fff;
  border-top: 1px solid #e5e7eb;
  padding: 12px 14px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
