/* ==========================================================================
   EMINERE · Admin shell — shared styles
   --------------------------------------------------------------------------
   Used by every page under /admin/. Same brand palette as the public site
   (cream/gold/ink) but with a tighter, denser layout — admin UI optimises
   for "see and click many things fast", not editorial reading.
   ========================================================================== */

:root {
  --ink:        #1a1a1a;
  --navy:       #08162d;
  --navy-deep:  #050f21;
  --ink-dim:    #5a5a55;
  --mute:       #8a8578;
  --line:       rgba(26,26,26,.12);
  --line-soft:  rgba(26,26,26,.06);
  --cream-bg:   #ede6d6;
  --cream:      #f2ece0;
  --gold:       #c9a84c;
  --gold-deep:  #9a7e33;
  --status-live: #2e7d4f;
  --status-hidden: #6b6b6b;
  --status-reserved: #b88a2e;
  --status-sold: #b85c5c;
  --serif: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --sans:  "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono:  "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--cream-bg); color: var(--ink);
  font-family: var(--sans); font-size: 14px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

/* ============ Top tabs ============================================== */
/* Sub-nav under the .admin-bar. Each tab is a page-level link (not a
   client-side switch). The active tab is the one whose href matches
   the current location's path. Designed to grow — adding new tabs is
   just another <a class="admin-tab"> in mountTabs(). */
.admin-tabs {
  position: sticky; top: 56px; z-index: 49;
  background: var(--cream-bg);
  border-bottom: 1px solid var(--line);
  padding: 0 24px;
  display: flex; gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.admin-tabs::-webkit-scrollbar { display: none; }
.admin-tab {
  padding: 14px 16px;
  font-family: var(--mono); font-size: 10px; letter-spacing: .22em;
  color: var(--ink-dim); text-transform: uppercase;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer; white-space: nowrap;
  transition: color .2s, border-color .2s;
}
.admin-tab:hover { color: var(--ink); }
.admin-tab.active {
  color: var(--ink); border-bottom-color: var(--ink);
}

/* ============ Top bar ============================================== */
.admin-bar {
  position: sticky; top: 0; z-index: 50;
  background: var(--cream-bg);
  border-bottom: 1px solid var(--line);
  padding: 14px 24px;
  display: grid; grid-template-columns: auto 1fr auto; gap: 24px; align-items: center;
}
.admin-bar .mark {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  background: var(--navy); color: var(--gold);
}
.admin-bar .mark svg { width: 18px; height: 18px; display: block; }
.admin-bar .crumb {
  font-family: var(--mono); font-size: 11px; letter-spacing: .22em;
  color: var(--ink-dim); text-transform: uppercase;
}
.admin-bar .crumb a { color: var(--gold-deep); transition: color .2s; }
.admin-bar .crumb a:hover { color: var(--ink); }
.admin-bar .signout {
  font-family: var(--mono); font-size: 10px; letter-spacing: .22em;
  color: var(--ink-dim); text-transform: uppercase; padding: 6px 0;
  transition: color .2s;
}
.admin-bar .signout:hover { color: var(--ink); }

/* ============ Page frame =========================================== */
.admin-page {
  max-width: 1400px; margin: 0 auto; padding: 32px 24px 80px;
}
.admin-h1 {
  font-family: var(--serif); font-size: clamp(28px, 3.4vw, 42px);
  font-weight: 500; letter-spacing: -.02em; line-height: 1.05;
  margin-bottom: 4px;
}
.admin-h1 em { font-style: italic; color: var(--gold-deep); font-weight: 500; }
.admin-sub {
  font-family: var(--mono); font-size: 10px; letter-spacing: .22em;
  color: var(--gold-deep); text-transform: uppercase; margin-bottom: 28px;
}

/* ============ Empty / loading / error states ======================== */
.admin-state {
  padding: 80px 20px; text-align: center;
  font-family: var(--mono); font-size: 11px; letter-spacing: .22em;
  color: var(--ink-dim); text-transform: uppercase;
}
.admin-spinner {
  width: 24px; height: 24px; margin: 0 auto 18px;
  border: 2px solid rgba(26,26,26,.15); border-top-color: var(--gold);
  border-radius: 50%; animation: admin-spin 1s linear infinite;
}
@keyframes admin-spin { to { transform: rotate(360deg); } }

/* ============ Status badge ========================================= */
.status-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 9px; letter-spacing: .2em;
  text-transform: uppercase; padding: 3px 7px;
  background: rgba(26,26,26,.06); color: var(--ink-dim);
}
.status-badge::before {
  content: ""; width: 5px; height: 5px; display: inline-block;
  background: currentColor;
}
.status-badge.live     { color: var(--status-live);     background: rgba(46,125,79,.10); }
.status-badge.hidden   { color: var(--status-hidden);   background: rgba(107,107,107,.10); }
.status-badge.reserved { color: var(--status-reserved); background: rgba(184,138,46,.12); }
.status-badge.sold     { color: var(--status-sold);     background: rgba(184,92,92,.10); }

/* ============ Inventory toolbar ===================================== */
.inv-tools {
  display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center;
  margin-bottom: 24px; padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.inv-tools input[type="search"] {
  width: 100%; padding: 11px 14px;
  background: transparent; border: 1px solid var(--line);
  color: var(--ink); font-family: var(--sans); font-size: 14px;
  outline: 0; transition: border-color .2s;
}
.inv-tools input[type="search"]:focus { border-color: var(--gold); }
.inv-tools input[type="search"]::placeholder { color: rgba(26,26,26,.4); }
.inv-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.inv-chip {
  padding: 8px 12px; background: transparent;
  border: 1px solid var(--line); color: var(--ink-dim);
  font-family: var(--mono); font-size: 10px; letter-spacing: .16em;
  text-transform: uppercase; cursor: pointer;
  transition: border-color .2s, color .2s, background .2s;
}
.inv-chip:hover { color: var(--ink); border-color: var(--gold-deep); }
.inv-chip.on { background: var(--navy); color: var(--cream); border-color: var(--navy); }
.inv-count {
  font-family: var(--mono); font-size: 10px; letter-spacing: .2em;
  color: var(--ink-dim); text-transform: uppercase; margin-bottom: 14px;
}

/* ============ Inventory grid ======================================== */
.inv-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}
.inv-card {
  background: rgba(255,255,255,.5); border: 1px solid var(--line);
  display: grid; grid-template-rows: auto 1fr; cursor: pointer;
  transition: border-color .2s, transform .2s, background .2s;
}
.inv-card:hover {
  border-color: var(--gold); transform: translateY(-2px);
  background: rgba(255,255,255,.85);
}
.inv-card .pic {
  /* 4/5 portrait — matches the public /buy grid cards exactly so the
     framing you see in admin is the framing visitors see browsing
     the collection. The /product hero is square (1:1) and is mirrored
     by the detail sidebar tiles instead. */
  aspect-ratio: 4 / 5; background: #fff;
  display: grid; place-items: center; overflow: hidden;
  position: relative;
}
.inv-card .pic img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.inv-card .pic-empty {
  font-family: var(--mono); font-size: 11px; letter-spacing: .22em;
  color: var(--mute); text-transform: uppercase;
}
.inv-card .pic-count {
  position: absolute; top: 8px; right: 8px;
  font-family: var(--mono); font-size: 9px; letter-spacing: .12em;
  background: rgba(14,14,14,.7); color: var(--cream); padding: 3px 7px;
  text-transform: uppercase;
}
.inv-card .meta { padding: 12px 14px 14px; }
.inv-card .b {
  font-family: var(--mono); font-size: 9px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--gold-deep); margin-bottom: 6px;
}
.inv-card .m {
  font-family: var(--serif); font-size: 14px; line-height: 1.3;
  color: var(--ink); margin-bottom: 12px;
  /* Truncate long model strings so the card height stays consistent. */
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}

/* In-place status picker. A native <select> styled to look like the
   colour-coded badge it replaced, with a caret hint. Click → native
   dropdown. Stops click propagation so it doesn't trigger the card's
   navigation handler. */
.status-select {
  appearance: none; -webkit-appearance: none;
  width: 100%;
  padding: 6px 26px 6px 10px;
  border: 1px solid currentColor;
  background-color: transparent;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath fill='none' stroke='currentColor' stroke-width='1.4' d='M1 1 L5 5 L9 1'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 9px;
  font-family: var(--mono); font-size: 10px; letter-spacing: .18em;
  text-transform: uppercase;
  border-radius: 0; cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s;
}
.status-select:focus { outline: 0; box-shadow: 0 0 0 2px rgba(201,168,76,.25); }
.status-select option { background: var(--cream-bg); color: var(--ink); font-family: var(--sans); }
.status-select.s-live     { color: var(--status-live);     background-color: rgba(46,125,79,.10); }
.status-select.s-hidden   { color: var(--status-hidden);   background-color: rgba(107,107,107,.10); }
.status-select.s-reserved { color: var(--status-reserved); background-color: rgba(184,138,46,.12); }
.status-select.s-sold     { color: var(--status-sold);     background-color: rgba(184,92,92,.10); }
.status-select.saving {
  opacity: .55; pointer-events: none;
}

/* ============ Watch detail ========================================== */
.watch-detail {
  display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 48px; align-items: start;
}
.watch-photos {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px;
}
.watch-photos .photo {
  aspect-ratio: 1; background: #fff;
  display: grid; place-items: center; overflow: hidden;
  border: 1px solid var(--line);
}
.watch-photos .photo img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.watch-photos .photo.placeholder {
  font-family: var(--mono); font-size: 10px; letter-spacing: .2em;
  color: var(--mute); text-transform: uppercase;
}
.watch-info dl {
  display: grid; grid-template-columns: 110px 1fr; gap: 14px 20px;
  margin: 24px 0;
  border-top: 1px solid var(--line);
  padding-top: 24px;
}
.watch-info dt {
  font-family: var(--mono); font-size: 10px; letter-spacing: .22em;
  color: var(--ink-dim); text-transform: uppercase; align-self: start;
  padding-top: 4px;
}
.watch-info dd {
  font-family: var(--serif); font-size: 15px; color: var(--ink); line-height: 1.45;
}
.watch-info dd.muted { color: var(--mute); font-style: italic; }
.watch-info .desc {
  border-top: 1px solid var(--line); padding-top: 24px; margin-top: 8px;
  white-space: pre-wrap; font-size: 14px; line-height: 1.65; color: var(--ink-dim);
}
.watch-info .desc-label {
  font-family: var(--mono); font-size: 10px; letter-spacing: .22em;
  color: var(--ink-dim); text-transform: uppercase; margin-bottom: 12px;
}

/* ============ Front 10 widget ======================================= */
/* A row of 10 numbered slots at the top of the inventory page. Each
   slot shows a watch (photo + brand · year + × remove button), or an
   empty placeholder with a + Pick-a-watch button.

   Drag-drop: HTML5 native. Slots are drop targets. Watches inside slots
   are draggable to reorder. The inventory grid cards (below) are also
   draggable INTO a slot (push-back semantics — newcomer takes the
   target slot, existing watches shift down, slot-10 watch falls off).
   The shift maths happen client-side; the bot just receives the final
   10-element order array. */

.front10-wrap {
  margin-bottom: 32px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}
.front10-head {
  display: grid; grid-template-columns: 1fr auto; align-items: baseline;
  gap: 16px; margin-bottom: 14px;
}
.front10-head .label {
  font-family: var(--mono); font-size: 10px; letter-spacing: .22em;
  color: var(--gold-deep); text-transform: uppercase;
}
.front10-head h2 {
  font-family: var(--serif); font-size: 22px; font-weight: 500;
  letter-spacing: -.005em; color: var(--ink); margin-top: 2px;
}
.front10-head .hint {
  font-family: var(--mono); font-size: 9px; letter-spacing: .18em;
  color: var(--ink-dim); text-transform: uppercase; text-align: right;
}
.front10-slots {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 8px;
}
.front10-slot {
  position: relative;
  aspect-ratio: 1;
  background: rgba(255,255,255,.5);
  border: 1px dashed rgba(26,26,26,.18);
  display: grid; place-items: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  overflow: hidden;
}
.front10-slot.filled { border-style: solid; border-color: var(--line); cursor: grab; }
.front10-slot.filled:active { cursor: grabbing; }
.front10-slot.drag-over { border-color: var(--gold); background: rgba(201,168,76,.10); }
.front10-slot.dragging { opacity: .35; }
.front10-slot .num {
  position: absolute; top: 4px; left: 6px;
  font-family: var(--mono); font-size: 9px; letter-spacing: .16em;
  color: var(--gold-deep);
  background: rgba(237,230,214,.85);
  padding: 1px 5px;
  z-index: 2;
  pointer-events: none;
}
.front10-slot .pic {
  width: 100%; height: 100%; display: grid; place-items: center;
  background: #fff;
}
.front10-slot .pic img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.front10-slot .name {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 6px 8px;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,.7));
  color: var(--cream);
  font-family: var(--mono); font-size: 8.5px; letter-spacing: .12em;
  text-transform: uppercase;
  pointer-events: none;
  z-index: 2;
}
.front10-slot .remove {
  position: absolute; top: 4px; right: 4px;
  width: 22px; height: 22px;
  display: grid; place-items: center;
  background: rgba(14,14,14,.7); color: var(--cream);
  border: 0; cursor: pointer;
  font-family: var(--mono); font-size: 14px; line-height: 1;
  z-index: 3;
  opacity: 0;
  transition: opacity .2s, background .2s;
}
.front10-slot:hover .remove { opacity: 1; }
.front10-slot .remove:hover { background: var(--status-sold); }
.front10-slot .empty-cta {
  width: 100%; height: 100%; display: grid; place-items: center;
  font-family: var(--mono); font-size: 9px; letter-spacing: .2em;
  color: var(--ink-dim); text-transform: uppercase;
  background: transparent; border: 0; cursor: pointer;
  padding: 12px;
  line-height: 1.4;
}
.front10-slot.empty:hover .empty-cta { color: var(--gold-deep); }
.front10-slot.saving { opacity: .55; pointer-events: none; }
/* While a Front 10 save is in flight, block input on the whole strip
   so a second drop can't race the first. JS toggles .saving on the
   .front10-slots container; without this rule pointer-events stayed
   live and rapid drops created glitchy overlapping requests. */
.front10-slots.saving { opacity: .65; pointer-events: none; }

/* Make inventory grid cards draggable INTO front 10 slots */
.inv-card[draggable="true"] { cursor: grab; }
.inv-card.dragging { opacity: .4; }

@media (max-width: 900px) {
  .front10-slots { grid-template-columns: repeat(5, 1fr); }
}
@media (max-width: 480px) {
  .front10-slots { grid-template-columns: repeat(2, 1fr); }
}

/* ── Pick-a-watch modal (for empty slots) ──────────────────────── */
.pick-bg {
  position: fixed; inset: 0;
  background: rgba(14,14,14,.55); backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none;
  transition: opacity .2s; z-index: 110;
}
.pick-bg.open { opacity: 1; pointer-events: auto; }
.pick-modal {
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(.98);
  width: min(720px, 92vw); height: min(640px, 92vh);
  background: var(--cream-bg);
  border: 1px solid var(--line);
  display: grid; grid-template-rows: auto 1fr;
  z-index: 120; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.pick-modal.open { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }
.pick-modal .head {
  display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center;
  padding: 18px 24px; border-bottom: 1px solid var(--line);
}
.pick-modal h3 {
  font-family: var(--serif); font-size: 18px; font-weight: 500;
  letter-spacing: -.005em; margin: 0;
}
.pick-modal h3 small {
  display: block; font-family: var(--mono); font-size: 10px;
  letter-spacing: .22em; color: var(--gold-deep); text-transform: uppercase;
  margin-bottom: 4px;
}
.pick-modal .close {
  width: 32px; height: 32px; display: grid; place-items: center;
  background: rgba(14,14,14,.06); border: 0; cursor: pointer;
  font-family: var(--mono); font-size: 18px; color: var(--ink);
}
.pick-modal .close:hover { background: rgba(14,14,14,.14); }
.pick-modal .body {
  overflow-y: auto; padding: 18px 24px 24px;
  scrollbar-width: thin; scrollbar-color: rgba(26,26,26,.25) transparent;
}
.pick-modal .grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

/* ── Crop modal ──────────────────────────────────────────────── */
.crop-bg {
  position: fixed; inset: 0;
  background: rgba(14,14,14,.6); backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none;
  transition: opacity .2s; z-index: 130;
}
.crop-bg.open { opacity: 1; pointer-events: auto; }
.crop-modal {
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(.98);
  width: min(720px, 94vw); height: min(800px, 94vh);
  background: var(--cream-bg);
  border: 1px solid var(--line);
  display: grid; grid-template-rows: auto 1fr auto;
  z-index: 140; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.crop-modal.open { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }
.crop-modal .head {
  display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center;
  padding: 18px 24px; border-bottom: 1px solid var(--line);
}
.crop-modal h3 {
  font-family: var(--serif); font-size: 18px; font-weight: 500;
  letter-spacing: -.005em; margin: 0;
}
.crop-modal h3 small {
  display: block; font-family: var(--mono); font-size: 10px;
  letter-spacing: .22em; color: var(--gold-deep); text-transform: uppercase;
  margin-bottom: 4px;
}
.crop-modal .close {
  width: 32px; height: 32px; display: grid; place-items: center;
  background: rgba(14,14,14,.06); border: 0; cursor: pointer;
  font-family: var(--mono); font-size: 18px; color: var(--ink);
}
.crop-modal .close:hover { background: rgba(14,14,14,.14); }
.crop-modal .body {
  overflow: hidden; padding: 18px 24px;
  min-height: 0;  /* lets the grid row shrink so the stage fits */
}
.crop-stage {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
}
/* Cropper.js needs a plain <img> as the target — it wraps and resizes
   the element on init. Before Cropper takes over (or if init fails)
   constrain the raw <img> so it fits the stage. */
.crop-stage img { max-width: 100%; max-height: 100%; display: block; }
/* Cropper inserts its own .cropper-container in place of the img;
   give it a definite size so it can lay out the canvas + crop box. */
.crop-stage .cropper-container {
  width: 100% !important;
  max-height: 100%;
}
.crop-modal .actions {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 16px 24px; background: var(--cream-bg);
  border-top: 1px solid var(--line);
}
.crop-modal .actions button {
  padding: 9px 18px;
  font-family: var(--mono); font-size: 10px; letter-spacing: .22em;
  text-transform: uppercase; cursor: pointer;
  border: 1px solid var(--line);
  background: transparent; color: var(--ink);
  transition: background .2s, color .2s, border-color .2s, opacity .2s;
}
.crop-modal .actions button:hover { border-color: var(--ink); }
.crop-modal .actions button.save {
  background: var(--navy); color: var(--cream); border-color: var(--navy);
}
.crop-modal .actions button.save:hover { background: var(--gold-deep); border-color: var(--gold-deep); }
.crop-modal .actions button:disabled { opacity: .5; cursor: default; pointer-events: none; }
.pick-modal .card {
  cursor: pointer;
  background: rgba(255,255,255,.5); border: 1px solid var(--line);
  display: grid; grid-template-rows: auto 1fr;
  transition: border-color .2s, transform .2s, background .2s;
}
.pick-modal .card:hover {
  border-color: var(--gold); transform: translateY(-2px);
  background: rgba(255,255,255,.9);
}
.pick-modal .card .pic { aspect-ratio: 1; background: #fff; }
.pick-modal .card .pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pick-modal .card .meta { padding: 8px 10px 10px; }
.pick-modal .card .b {
  font-family: var(--mono); font-size: 9px; letter-spacing: .14em;
  color: var(--gold-deep); text-transform: uppercase; margin-bottom: 4px;
}
.pick-modal .card .m {
  font-family: var(--serif); font-size: 12px; line-height: 1.3; color: var(--ink);
}
.pick-modal .card .p {
  font-family: var(--mono); font-size: 9px; letter-spacing: .1em;
  color: var(--ink-dim); margin-top: 4px;
}

/* ============ Detail sidebar ======================================== */
/* Slides in from the right when a card is clicked. Photos + structured
   fields + description for a single watch. Used in place of a full
   navigation to watch.html so the user doesn't lose their scroll /
   filter state on the inventory grid. */
.detail-bg {
  position: fixed; inset: 0; background: rgba(14,14,14,.45);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none;
  transition: opacity .25s; z-index: 90;
}
.detail-bg.open { opacity: 1; pointer-events: auto; }
.detail-side {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(640px, 100vw);
  background: var(--cream-bg);
  border-left: 1px solid var(--line);
  transform: translateX(100%);
  transition: transform .3s cubic-bezier(.2,.6,.2,1);
  z-index: 100;
  display: flex; flex-direction: column;
}
.detail-side.open { transform: translateX(0); }
.detail-close {
  position: absolute; top: 16px; right: 16px; z-index: 2;
  width: 32px; height: 32px;
  background: rgba(14,14,14,.06); border: 0;
  display: grid; place-items: center;
  font-family: var(--mono); font-size: 18px; line-height: 1;
  color: var(--ink); cursor: pointer;
  transition: background .2s;
}
.detail-close:hover { background: rgba(14,14,14,.14); }
.detail-body {
  padding: 60px 32px 32px;
  flex: 1 1 auto; min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(26,26,26,.25) transparent;
}
.detail-body::-webkit-scrollbar { width: 8px; }
.detail-body::-webkit-scrollbar-thumb { background: rgba(26,26,26,.25); }
/* Sticky action bar at bottom of the slide-in. Cancel discards
   unsaved edits, Save commits all dirty fields in one PATCH. */
.detail-actions {
  flex: 0 0 auto;
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 16px 24px; background: var(--cream-bg);
  border-top: 1px solid var(--line);
}
.detail-actions button {
  padding: 9px 18px;
  font-family: var(--mono); font-size: 10px; letter-spacing: .22em;
  text-transform: uppercase; cursor: pointer;
  border: 1px solid var(--line);
  background: transparent; color: var(--ink);
  transition: background .2s, color .2s, border-color .2s, opacity .2s;
}
.detail-actions button:hover { border-color: var(--ink); }
.detail-actions button.save {
  background: var(--navy); color: var(--cream); border-color: var(--navy);
}
.detail-actions button.save:hover { background: var(--gold-deep); border-color: var(--gold-deep); }
/* Destructive action — permanent Airtable delete. Sits far-left in
   the action row to physically separate it from the safe "Hide" /
   "Save" buttons so the user has to deliberately reach for it. */
.detail-actions button.danger {
  border-color: rgba(184,92,92,.4); color: #b85c5c;
  margin-right: auto;
}
.detail-actions button.danger:hover {
  background: #b85c5c; color: #fff; border-color: #b85c5c;
}
.detail-actions button:disabled { opacity: .5; cursor: default; pointer-events: none; }
.detail-body .head .eyebrow {
  font-family: var(--mono); font-size: 10px; letter-spacing: .22em;
  color: var(--gold-deep); text-transform: uppercase; margin-bottom: 10px;
}
.detail-body .head h2 {
  font-family: var(--serif); font-size: 28px; font-weight: 500;
  letter-spacing: -.01em; line-height: 1.1; color: var(--ink); margin-bottom: 14px;
}
.detail-body .head h2 em { font-style: italic; color: var(--gold-deep); font-weight: 500; }
.detail-body .photos {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px;
  margin: 24px 0;
}
.detail-body .photo {
  /* 1:1 + cover — matches the public product page (/product.html),
     where the main photo and thumb strip are both square. The /buy
     grid cards are 4/5 portrait, but /product is the canonical
     "view the listing" surface so we mirror its framing. */
  aspect-ratio: 1; background: #fff;
  display: grid; place-items: center; overflow: hidden;
  border: 1px solid var(--line);
  position: relative;
}
.detail-body .photo img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  pointer-events: none;  /* don't intercept drag from parent */
}
.detail-body .photo.placeholder {
  font-family: var(--mono); font-size: 10px; letter-spacing: .2em;
  color: var(--mute); text-transform: uppercase;
}
/* Draggable photo tile — hover reveals × delete button; drop targets
   show a gold border. While the photo grid is saving (reorder /
   delete / upload in flight) the whole grid is dimmed + non-interactive. */
.detail-body .photo.editable { cursor: grab; }
.detail-body .photo.editable:active { cursor: grabbing; }
.detail-body .photo.editable.dragging { opacity: .35; }
.detail-body .photo.editable.drag-over { box-shadow: inset 0 0 0 2px var(--gold); }
.detail-body .photo .photo-remove {
  position: absolute; top: 6px; right: 6px;
  width: 22px; height: 22px;
  background: rgba(14,14,14,.78); color: #fff;
  border: 0; border-radius: 50%;
  font-family: var(--mono); font-size: 14px; line-height: 1;
  display: grid; place-items: center;
  cursor: pointer;
  opacity: 0; transition: opacity .15s, background .15s;
}
.detail-body .photo:hover .photo-remove,
.detail-body .photo:focus-within .photo-remove { opacity: 1; }
.detail-body .photo .photo-remove:hover { background: rgba(184,92,92,.95); }
/* "+ Upload" tile that triggers the hidden file input. */
.detail-body .photo.uploader {
  cursor: pointer;
  background: transparent;
  border: 1px dashed rgba(26,26,26,.28);
  font-family: var(--mono); font-size: 10px; letter-spacing: .2em;
  color: var(--ink-dim); text-transform: uppercase;
  transition: border-color .2s, color .2s, background .2s;
}
.detail-body .photo.uploader:hover {
  border-color: var(--gold-deep); color: var(--gold-deep);
  background: rgba(201,168,76,.04);
}
.detail-body .photo.uploader .plus {
  font-size: 22px; letter-spacing: 0; line-height: 1; margin-bottom: 4px;
}
.detail-body .photos.saving { opacity: .55; pointer-events: none; }
/* Crop / edit overlay actions on a photo tile. The crop button sits
   on the left, × delete on the right; both fade in on hover. */
.detail-body .photo .photo-crop {
  position: absolute; top: 6px; left: 6px;
  height: 22px; padding: 0 8px;
  background: rgba(14,14,14,.78); color: #fff;
  border: 0; border-radius: 11px;
  font-family: var(--mono); font-size: 9px; letter-spacing: .14em;
  text-transform: uppercase; cursor: pointer;
  opacity: 0; transition: opacity .15s, background .15s;
}
.detail-body .photo:hover .photo-crop,
.detail-body .photo:focus-within .photo-crop { opacity: 1; }
.detail-body .photo .photo-crop:hover { background: var(--gold-deep); }
/* Mini status line below the photo grid — surfaces upload / save progress. */
.detail-body .photos-status {
  margin: -10px 0 14px;
  font-family: var(--mono); font-size: 10px; letter-spacing: .2em;
  color: var(--ink-dim); text-transform: uppercase;
  min-height: 14px;
}
.detail-body .photos-status.error { color: var(--status-sold); }
.detail-body dl {
  display: grid; grid-template-columns: 120px 1fr; gap: 6px 18px;
  margin: 24px 0 8px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}
.detail-body dt {
  font-family: var(--mono); font-size: 10px; letter-spacing: .22em;
  color: var(--ink-dim); text-transform: uppercase; padding-top: 11px;
  align-self: start;
}
.detail-body dd {
  font-family: var(--serif); font-size: 14px; color: var(--ink); line-height: 1.4;
  margin: 0;
}
.detail-body dd.muted { color: var(--mute); font-style: italic; }
.detail-body .desc-label {
  font-family: var(--mono); font-size: 10px; letter-spacing: .22em;
  color: var(--ink-dim); text-transform: uppercase; margin: 24px 0 10px;
  padding-top: 20px; border-top: 1px solid var(--line);
}
.detail-body .desc {
  white-space: pre-wrap; font-size: 13px; line-height: 1.65; color: var(--ink-dim);
}

/* Editable fields in the sidebar — text inputs / selects / textareas
   that save on blur (commit cycle below). Visually quiet at rest;
   underline appears on hover, gold underline on focus, brief green
   flash on successful save, red flash on failure. */
.side-edit {
  width: 100%;
  padding: 8px 0;
  border: 0;
  border-bottom: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  font-family: var(--serif); font-size: 14px;
  outline: 0; border-radius: 0;
  transition: border-color .2s, background .2s;
}
.side-edit:hover { border-bottom-color: rgba(26,26,26,.18); }
.side-edit:focus { border-bottom-color: var(--gold); background: rgba(201,168,76,.04); }
.side-edit::placeholder { color: rgba(26,26,26,.35); }
.side-edit.saving { opacity: .55; pointer-events: none; }
.side-edit.saved   { background: rgba(46,125,79,.10);  transition: background .8s; }
.side-edit.error   { background: rgba(184,92,92,.15); }
select.side-edit {
  appearance: none; -webkit-appearance: none;
  font-family: var(--mono); font-size: 11px; letter-spacing: .14em;
  text-transform: uppercase;
  padding-right: 18px;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath fill='none' stroke='currentColor' stroke-width='1.4' d='M1 1 L5 5 L9 1'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 2px center;
  background-size: 9px;
  cursor: pointer;
}
select.side-edit.status-live     { color: var(--status-live); }
select.side-edit.status-hidden   { color: var(--status-hidden); }
select.side-edit.status-reserved { color: var(--status-reserved); }
select.side-edit.status-sold     { color: var(--status-sold); }
textarea.side-edit {
  min-height: 100px; resize: vertical;
  padding: 10px 0; line-height: 1.55;
  font-family: var(--sans); font-size: 13px;
  border-bottom-color: rgba(26,26,26,.12);
}
textarea.side-edit:hover, textarea.side-edit:focus { border-bottom-color: var(--gold); }
.detail-body .ro-meta {
  margin-top: 28px; padding-top: 20px;
  border-top: 1px solid var(--line);
  font-family: var(--mono); font-size: 10px; letter-spacing: .2em;
  color: var(--ink-dim); text-transform: uppercase; line-height: 1.8;
}
.detail-body .full-link {
  display: inline-block; margin-top: 24px;
  font-family: var(--mono); font-size: 10px; letter-spacing: .22em;
  color: var(--gold-deep); text-transform: uppercase;
}

@media (max-width: 600px) {
  .detail-body { padding: 56px 20px 32px; }
  .detail-body dl { grid-template-columns: 90px 1fr; gap: 10px 14px; }
}

/* ============ Login page ============================================ */
.login-shell {
  min-height: 100vh; display: grid; place-items: center; padding: 40px 24px;
}
.login-card {
  width: 100%; max-width: 380px;
  display: grid; gap: 24px;
}
.login-card .mark {
  width: 48px; height: 48px;
  display: grid; place-items: center; background: var(--navy); color: var(--gold);
  margin: 0 auto;
}
.login-card .mark svg { width: 30px; height: 30px; display: block; }
.login-card h1 .brand-wordmark { height: 15px; width: auto; display: block; margin: 0 auto; color: var(--ink); }
.login-card h1 {
  font-family: var(--serif); font-size: 28px; font-weight: 500;
  letter-spacing: -.01em; text-align: center; margin-bottom: 2px;
}
.login-card .sub {
  font-family: var(--mono); font-size: 10px; letter-spacing: .26em;
  text-align: center; color: var(--gold-deep); text-transform: uppercase;
}
.login-card form { display: grid; gap: 14px; margin-top: 8px; }
.login-card input[type="password"] {
  padding: 13px 16px;
  background: transparent; border: 1px solid var(--line);
  color: var(--ink); font-family: var(--sans); font-size: 14px;
  outline: 0; transition: border-color .2s;
  font-weight: 300; letter-spacing: .05em;
}
.login-card input[type="password"]:focus { border-color: var(--gold); }
.login-card button[type="submit"] {
  padding: 13px 16px;
  background: var(--navy); color: var(--cream);
  border: 0; border-radius: 0;
  font-family: var(--mono); font-size: 11px; letter-spacing: .22em;
  text-transform: uppercase; cursor: pointer;
  transition: background .2s;
}
.login-card button[type="submit"]:hover { background: var(--gold-deep); }
.login-card button[type="submit"]:disabled {
  opacity: .5; cursor: not-allowed;
}
.login-error {
  padding: 10px 14px; background: rgba(184,92,92,.10);
  border: 1px solid rgba(184,92,92,.32); color: var(--status-sold);
  font-family: var(--mono); font-size: 10px; letter-spacing: .18em;
  text-transform: uppercase; text-align: center;
  display: none;
}
.login-error.show { display: block; }

@media (max-width: 720px) {
  .watch-detail { grid-template-columns: 1fr; gap: 32px; }
  .admin-bar { padding: 12px 16px; }
  .admin-page { padding: 24px 16px 60px; }
}

/* Cross-document view transitions: same-origin navigations between admin
   pages cross-fade instead of white-flashing. Chrome/Edge 126+; other
   browsers ignore this and keep the plain navigation. */
@view-transition { navigation: auto; }
::view-transition-old(root),
::view-transition-new(root) { animation-duration: 140ms; }
