/* ניהול האתר — plain, roomy forms on the same paper as the site. */

body { background: var(--paper-warm); }

.admin-top {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  padding-block: 1rem;
  position: sticky;
  top: 0;
  z-index: 20;
}
.admin-top__inner {
  width: min(1080px, 100% - 2.5rem);
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.admin-top img { height: 34px; width: auto; }
.admin-top__who { margin-inline-start: auto; color: var(--ink-soft); font-size: .93rem; }

.admin-wrap { width: min(1080px, 100% - 2.5rem); margin: 2rem auto 5rem; position: relative; z-index: 1; }

.gate {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(2rem, 5vw, 3.5rem);
  text-align: center;
  box-shadow: var(--shadow-sm);
  max-width: 560px;
  margin: 3rem auto;
}
.gate h1 { font-size: 1.7rem; margin-bottom: .8rem; }
.gate p { color: var(--ink-soft); margin: 0 0 1.6rem; }

.admin-tabs { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1.8rem; }
.admin-tabs button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-soft);
  border-radius: 999px;
  padding: .6rem 1.15rem;
  font: 600 15px/1 var(--sans);
  cursor: pointer;
}
.admin-tabs button[aria-selected='true'] { background: var(--blue-deep); color: #fff; border-color: var(--blue-deep); }
.admin-tabs .count {
  display: inline-block;
  min-width: 20px;
  margin-inline-start: .4rem;
  background: var(--gold);
  color: #fff;
  border-radius: 999px;
  font-size: 12px;
  padding: 1px 6px;
}

.panel[hidden] { display: none; }

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
  margin-bottom: 1.1rem;
  box-shadow: var(--shadow-sm);
}
.card__head {
  display: flex;
  align-items: center;
  gap: .8rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.card__head h3 { font-size: 1.12rem; margin-inline-end: auto; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.1rem; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 1.1rem; }
@media (max-width: 720px) { .grid2, .grid3 { grid-template-columns: 1fr; } }

.hint { font-size: .85rem; color: var(--ink-faint); margin: -.55rem 0 1rem; }

.chip {
  font: 600 12px/1 var(--sans);
  border-radius: 999px;
  padding: .35rem .7rem;
  background: var(--paper-deep);
  color: var(--ink-soft);
}
.chip--on { background: rgba(31,168,85,.14); color: #16723f; }
.chip--off { background: rgba(168,64,44,.12); color: #a8402c; }
.chip--new { background: rgba(201,162,75,.2); color: #8a6a1e; }

.row-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.btn--danger { background: transparent; color: #a8402c; border-color: rgba(168,64,44,.4); }
.btn--danger:hover { background: rgba(168,64,44,.08); }

.switch { display: inline-flex; align-items: center; gap: .5rem; font-weight: 600; color: var(--ink-soft); cursor: pointer; }
.switch input { width: 18px; height: 18px; accent-color: var(--blue-deep); }

.uploader {
  border: 1px dashed var(--sand);
  border-radius: 12px;
  padding: 1rem;
  background: var(--paper);
  margin-bottom: 1rem;
}
.uploader progress { width: 100%; height: 8px; margin-top: .6rem; }

.toast {
  position: fixed;
  inset-block-end: 1.4rem;
  inset-inline-start: 50%;
  transform: translateX(50%) translateY(140%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  background: var(--ink);
  color: var(--paper);
  padding: .8rem 1.4rem;
  border-radius: 999px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  transition: transform .3s, opacity .3s, visibility .3s;
  z-index: 100;
  max-width: 90vw;
  text-align: center;
}
.toast.is-on { transform: translateX(50%) translateY(0); opacity: 1; visibility: visible; }
.toast.is-err { background: #8f3324; }

.msg__meta { color: var(--ink-soft); font-size: .9rem; margin: 0 0 .7rem; }
.msg__body { white-space: pre-wrap; margin: 0; }

.thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }

.photos { display: grid; gap: 1.1rem; }
.photo {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 1.4rem;
  align-items: start;
  padding: 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}
.photo__preview {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--paper-deep);
}
.photo__body h3 { font-size: 1.05rem; }
.photo__body input[type='file'] { max-width: 100%; }

@media (max-width: 720px) {
  .photo { grid-template-columns: 1fr; }
  .photo__preview { max-width: 240px; }
}

.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }

/* ------------------------------ theme panel ------------------------------ */

.theme-layout { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: 1.4rem; align-items: start; }
.theme-controls { min-width: 0; }

.theme-preview { position: sticky; top: 90px; }
.theme-preview__bar {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: .7rem 1rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius) var(--radius) 0 0;
  border-bottom: 0;
}
.theme-preview__bar strong { font-family: var(--serif); margin-inline-end: auto; }
.theme-preview__frame {
  border: 1px solid var(--line);
  border-radius: 0 0 var(--radius) var(--radius);
  overflow: hidden;
  background: var(--paper);
  display: flex;
  justify-content: center;
}
.theme-preview iframe {
  width: 100%;
  max-width: 100%;
  height: 74vh;
  min-height: 460px;
  border: 0;
  display: block;
  transition: width .25s;
}

.swatches { display: flex; flex-wrap: wrap; gap: .6rem; }
.swatch {
  display: flex; align-items: center; gap: .55rem;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  padding: .45rem .9rem .45rem .55rem;
  font: 600 14px/1 var(--sans);
  color: var(--ink-soft);
  cursor: pointer;
  transition: border-color .2s, color .2s;
}
.swatch:hover { border-color: var(--blue); color: var(--ink); }
.swatch[aria-pressed='true'] { border-color: var(--blue-deep); color: var(--ink); box-shadow: inset 0 0 0 1px var(--blue-deep); }
.swatch__dots { display: flex; }
.swatch__dots i { width: 15px; height: 15px; border-radius: 50%; border: 1px solid rgba(0,0,0,.08); }
.swatch__dots i + i { margin-inline-start: -5px; }
.swatch__tex { width: 34px; height: 22px; border-radius: 5px; border: 1px solid var(--line); background-color: #faf6ef; }
.swatch__logo { height: 22px; width: auto; }

.colors { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .8rem; }
.color { display: flex; align-items: center; gap: .6rem; }
.color input[type='color'] {
  width: 44px; height: 38px; padding: 0; border: 1px solid var(--line);
  border-radius: 9px; background: none; cursor: pointer;
}
.color span { font: 600 14px/1.3 var(--sans); color: var(--ink-soft); }

.theme-actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: .4rem; }

input[type='range'] { width: 100%; accent-color: var(--blue-deep); }

@media (max-width: 1000px) {
  .theme-layout { grid-template-columns: 1fr; }
  .theme-preview { position: static; }
  .theme-preview iframe { height: 60vh; }
}
