/* ==========================================================================
   Owner Panel — inherits the tokens and liquid glass from style.css
   ========================================================================== */

body.admin {
  min-height: 100vh;
  min-height: 100svh;
  background: var(--surface);
}

body.admin::before {
  background: radial-gradient(100vw 70vh at 50% -20%, rgba(255, 106, 31, 0.05), transparent 60%);
}

[hidden] { display: none !important; }

/* --------------------------------------------------------------------------
   Form primitives
   -------------------------------------------------------------------------- */

.field {
  display: block;
  margin-bottom: 1.15rem;
  text-align: left;
}

.field > span {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.6rem;
}

.field > span i {
  font-style: normal;
  text-transform: none;
  letter-spacing: 0.02em;
  opacity: 0.6;
}

.field input,
.field textarea {
  width: 100%;
  padding: 0.95rem 1.15rem;
  border: none;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--nm-inset-sm);
  color: var(--ink-bright);
  font-family: var(--font-body);
  font-size: 0.95rem;
  resize: vertical;
  transition: box-shadow 0.4s var(--ease-out);
}

.field input::placeholder,
.field textarea::placeholder { color: #565e6b; }

.field input:focus,
.field textarea:focus {
  outline: none;
  box-shadow: var(--nm-inset-sm), 0 0 0 2px rgba(255, 106, 31, 0.45);
}

.field em {
  display: block;
  margin-top: 0.5rem;
  font-style: normal;
  font-size: 0.74rem;
  color: var(--ink-faint);
  opacity: 0.75;
}

/* --------------------------------------------------------------------------
   Login gate
   -------------------------------------------------------------------------- */

.gate {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 2rem 1.25rem;
  position: relative;
  z-index: 1;
}

.gate-card {
  width: min(430px, 100%);
  padding: clamp(2.2rem, 5vw, 3rem);
  text-align: center;
  animation: fade-up 0.8s var(--ease-out);
}

.gate-card .brand-mark {
  width: 78px;
  height: 78px;
  margin-inline: auto;
}

.gate-card .brand-mark svg { width: 26px; height: 26px; }

.gate-card h1 {
  font-size: 1.75rem;
  margin-bottom: 0.6rem;
}

.gate-card > p {
  color: var(--ink-faint);
  font-size: 0.9rem;
  margin: 0 0 2rem;
}

.gate-error {
  margin: -0.35rem 0 1rem;
  font-size: 0.83rem;
  color: #ff9c78;
}

.gate-back {
  display: inline-block;
  margin-top: 1.6rem;
  font-size: 0.8rem;
  color: var(--ink-faint);
  transition: color 0.3s var(--ease-out);
}

.gate-back:hover { color: var(--ember); }

/* --------------------------------------------------------------------------
   Panel chrome
   -------------------------------------------------------------------------- */

.admin-bar {
  position: sticky;
  top: 0;
  z-index: 600;
  padding: 0.85rem 0;
  background: rgba(28, 31, 37, 0.78);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05), 0 14px 34px rgba(0, 0, 0, 0.35);
}

.admin-bar-inner {
  width: min(1280px, 94vw);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.admin-tabs {
  display: flex;
  gap: 0.3rem;
  padding: 0.35rem;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--nm-inset-sm);
}

.atab {
  border: none;
  background: none;
  padding: 0.62rem 1.25rem;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-faint);
  cursor: pointer;
  transition: all 0.45s var(--ease-out);
}

.atab:hover { color: var(--ink-dim); }

.atab.is-active {
  color: var(--ink-bright);
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.03));
  box-shadow:
    inset 0 1.5px 0 rgba(255, 255, 255, 0.4),
    0 6px 16px rgba(0, 0, 0, 0.4);
}

.admin-bar-actions { display: flex; gap: 0.55rem; }

.admin-main {
  width: min(1280px, 94vw);
  margin-inline: auto;
  padding: clamp(2.2rem, 5vw, 3.5rem) 0 6rem;
  position: relative;
  z-index: 1;
}

.view { display: none; }
.view.is-active { display: block; animation: fade-up 0.55s var(--ease-out); }

.view-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
  margin-bottom: 2.4rem;
}

.view-head h2 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin-bottom: 0.7rem;
}

.view-head .lede { font-size: 0.92rem; max-width: 58ch; }

/* --------------------------------------------------------------------------
   Section cards
   -------------------------------------------------------------------------- */

.sections { display: grid; gap: 1.35rem; }

.sec {
  padding: 1.6rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, var(--surface-high), var(--surface-deep));
  box-shadow: var(--nm-raise);
  transition: box-shadow 0.4s var(--ease-out), opacity 0.25s, transform 0.25s;
}

.sec.dragging { opacity: 0.45; transform: scale(0.985); }
.sec.drag-over { box-shadow: var(--nm-raise), 0 0 0 2px var(--ember); }

.sec-head {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.sec-grip {
  width: 38px;
  height: 38px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--nm-inset-sm);
  color: var(--ink-faint);
  cursor: grab;
  touch-action: none;
}

.sec-grip:active { cursor: grabbing; }
.sec-grip svg { width: 16px; height: 16px; }

.sec-title { flex: 1 1 240px; min-width: 0; }

.sec-title h3 {
  font-size: 1.28rem;
  letter-spacing: -0.025em;
  color: var(--ink-bright);
  margin-bottom: 0.25rem;
}

.sec-title p {
  margin: 0;
  font-size: 0.86rem;
  color: var(--ink-faint);
  line-height: 1.55;
  max-width: 70ch;
}

.sec-title .meta {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.6rem;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  opacity: 0.7;
}

.sec-tools { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.tool {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 1rem;
  border: none;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--nm-raise-sm);
  color: var(--ink-dim);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.35s var(--ease-out);
}

.tool svg { width: 14px; height: 14px; }
.tool:hover { color: var(--ink-bright); transform: translateY(-2px); }
.tool.danger:hover { color: #ff8f66; box-shadow: var(--nm-raise-sm), 0 0 18px -6px rgba(255, 90, 40, 0.6); }

/* Drop zone */
.dropzone {
  margin-top: 1.4rem;
  padding: 1.5rem;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--nm-inset-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  flex-wrap: wrap;
  text-align: center;
  color: var(--ink-faint);
  font-size: 0.87rem;
  cursor: pointer;
  transition: all 0.35s var(--ease-out);
}

.dropzone svg { width: 20px; height: 20px; }
.dropzone:hover { color: var(--ink-dim); }

.dropzone.hot {
  color: var(--ember);
  box-shadow: var(--nm-inset-sm), inset 0 0 0 2px var(--ember);
}

.dropzone b {
  color: var(--ink);
  font-weight: 600;
}

.dropzone.busy { pointer-events: none; opacity: 0.6; }

/* Image grid */
.tiles {
  margin-top: 1.3rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 0.85rem;
}

.tile {
  position: relative;
  aspect-ratio: 1;
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface-deep);
  box-shadow: var(--nm-raise-sm);
  animation: fade-up 0.5s var(--ease-out);
}

.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease-out), filter 0.4s;
}

.tile:hover img { transform: scale(1.06); filter: brightness(0.55); }

.tile-actions {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 0.5rem;
  grid-auto-flow: column;
  opacity: 0;
  transition: opacity 0.35s var(--ease-out);
}

.tile:hover .tile-actions,
.tile:focus-within .tile-actions { opacity: 1; }

.tile-btn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, 0.45), 0 8px 20px rgba(0, 0, 0, 0.4);
  transition: transform 0.35s var(--ease-liquid), background 0.35s;
}

.tile-btn svg { width: 16px; height: 16px; }
.tile-btn:hover { transform: scale(1.12); }
.tile-btn.del:hover { background: rgba(255, 90, 40, 0.55); }

.tile-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.45rem 0.6rem;
  font-size: 0.68rem;
  color: #dfe4ea;
  background: linear-gradient(to top, rgba(10, 12, 15, 0.9), transparent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

.tiles-empty {
  grid-column: 1 / -1;
  padding: 1.6rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--ink-faint);
  opacity: 0.7;
}

/* Upload progress bar */
.sec-progress {
  height: 3px;
  margin-top: 1rem;
  border-radius: 99px;
  background: var(--surface-deep);
  overflow: hidden;
}

.sec-progress i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--ember-deep), var(--ember-hot));
  transition: width 0.25s linear;
}

/* Empty state for the whole panel */
.sections-empty {
  padding: clamp(3rem, 8vw, 5rem);
  text-align: center;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--nm-inset);
  color: var(--ink-faint);
}

.sections-empty h3 { color: var(--ink); margin-bottom: 0.6rem; font-size: 1.2rem; }
.sections-empty p { margin: 0 0 1.6rem; font-size: 0.9rem; }

/* --------------------------------------------------------------------------
   Contact form
   -------------------------------------------------------------------------- */

.contact-form { padding: clamp(1.8rem, 4vw, 2.6rem); }

.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(285px, 1fr));
  gap: 0 1.5rem;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  flex-wrap: wrap;
  margin-top: 1.2rem;
  padding-top: 1.6rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.save-hint {
  font-size: 0.8rem;
  color: var(--ink-faint);
  opacity: 0;
  transition: opacity 0.4s var(--ease-out);
}

.save-hint.show { opacity: 1; color: var(--ember); }

/* --------------------------------------------------------------------------
   About view
   -------------------------------------------------------------------------- */

.about-admin {
  display: grid;
  grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
  gap: 1.15rem;
  align-items: start;
}

.about-photo-card,
.about-form { padding: clamp(1.5rem, 3vw, 2.2rem); }

.about-photo-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.4rem;
}

.about-photo-card .hint {
  font-size: 0.82rem;
  color: var(--ink-faint);
  margin: 0 0 1.2rem;
}

/* Same 4:5 crop the website uses, so what the owner sees here is what ships. */
.about-preview {
  aspect-ratio: 4 / 5;
  border-radius: 18px;
  overflow: hidden;
  background: var(--surface-deep);
  box-shadow: var(--nm-inset-sm);
  display: grid;
  place-items: center;
}

.about-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.about-preview-empty {
  font-size: 0.8rem;
  color: var(--ink-faint);
}

.about-progress {
  height: 3px;
  margin-top: 0.9rem;
  border-radius: 99px;
  background: var(--surface-deep);
  overflow: hidden;
}

.about-progress i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--ember-deep), var(--ember-hot));
  transition: width 0.25s linear;
}

.about-photo-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 1.1rem;
}

.about-photo-actions .btn { flex: 1 1 auto; }
.about-photo-actions .danger .btn-label { color: #ff8f6b; }

.about-form textarea { line-height: 1.6; }

@media (max-width: 900px) {
  .about-admin { grid-template-columns: 1fr; }
  .about-preview { max-width: 280px; }
}

/* --------------------------------------------------------------------------
   Modal
   -------------------------------------------------------------------------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: rgba(10, 11, 14, 0.72);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  animation: fade-in 0.3s var(--ease-out);
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.modal-card {
  width: min(480px, 100%);
  padding: clamp(1.8rem, 4vw, 2.4rem);
  animation: modal-in 0.5s var(--ease-liquid);
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: none; }
}

.modal-card h3 { font-size: 1.4rem; margin-bottom: 0.6rem; }

.modal-card > p {
  color: var(--ink-faint);
  font-size: 0.9rem;
  margin: 0 0 1.6rem;
  line-height: 1.6;
}

.modal-card > p:empty { display: none; }

.modal-actions {
  display: flex;
  gap: 0.7rem;
  justify-content: flex-end;
  margin-top: 1.6rem;
}

.modal-actions .btn { flex: 1 1 auto; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 760px) {
  .admin-bar-inner { justify-content: center; }
  .admin-tabs { order: 3; width: 100%; justify-content: center; }
  .view-head { align-items: flex-start; }
  .tiles { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .sec-tools { width: 100%; }
  .tool { flex: 1 1 auto; justify-content: center; }
}
