/* =============================================================
   Owner panel styles (builds on styles.css tokens)
   ============================================================= */
body.admin { background: var(--cream); }

/* ---------- lock screen ---------- */
.lock { min-height: 100svh; display: grid; place-items: center; padding: 20px; }
.lock-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 40px; width: 100%; max-width: 360px; text-align: center;
  display: grid; gap: 10px; justify-items: center;
}
.lock-card .brand-mark { width: 56px; height: 56px; font-size: 22px; margin-bottom: 6px; }
.lock-card h1 { font-size: 26px; }
.lock-card p { color: var(--ink-soft); font-size: 14px; margin-bottom: 8px; }
.lock-card input {
  font: inherit; text-align: center; letter-spacing: .4em; font-size: 22px; width: 100%;
  padding: 12px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--cream);
}
.lock-card input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,154,59,.2); }
.back-link { color: var(--ink-soft); font-size: 14px; margin-top: 4px; }
.back-link:hover { color: var(--maroon); }

/* ---------- top bar ---------- */
.admin-bar {
  position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 20px;
  justify-content: space-between; padding: 12px clamp(16px,3vw,32px);
  background: rgba(251,244,233,.9); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
}
.admin-tabs { display: flex; gap: 6px; }
.tab {
  border: 0; background: transparent; font: inherit; font-weight: 600; font-size: 15px; color: var(--ink-soft);
  padding: 8px 16px; border-radius: 999px; cursor: pointer; transition: .2s; display: inline-flex; align-items: center; gap: 8px;
}
.tab:hover { color: var(--maroon); }
.tab.active { background: var(--maroon); color: #fff; }
.tab .count { background: rgba(255,255,255,.25); border-radius: 999px; padding: 1px 8px; font-size: 12px; }
.tab:not(.active) .count { background: var(--maroon); color: #fff; }
.admin-actions { display: flex; gap: 8px; }
.btn-sm { padding: 8px 14px; font-size: 14px; }

/* ---------- panels ---------- */
.admin-main { max-width: 1100px; margin: 0 auto; padding: clamp(20px,3vw,40px); }
.panel { display: none; }
.panel.active { display: block; animation: fade .3s ease; }
.panel-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.panel-head h2 { font-size: 30px; }
.muted { color: var(--ink-soft); font-size: 14px; }

/* ---------- product cards ---------- */
.admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.acard {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm); display: flex; flex-direction: column;
}
.acard-media { aspect-ratio: 16/10; background: var(--cream-2); position: relative; }
.acard-media img { width: 100%; height: 100%; object-fit: cover; }
.acard.out .acard-media img { filter: grayscale(.5); opacity: .8; }
.acard-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.acard h3 { font-size: 18px; }
.acard .row { display: flex; align-items: center; justify-content: space-between; }
.acard .price { font-size: 20px; }
.acard-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 6px; }
.acard-actions .btn { flex: 1; padding: 9px; font-size: 14px; }

/* stock pill toggle */
.stock-toggle { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; font-weight: 600; user-select: none; }
.switch {
  -webkit-appearance: none; appearance: none; width: 40px; height: 22px; border-radius: 999px;
  background: #cdb79b; position: relative; cursor: pointer; transition: background .2s; flex: none;
}
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: var(--shadow-sm); }
.switch:checked { background: var(--ok); }
.switch:checked::after { transform: translateX(18px); }

/* ---------- enquiries ---------- */
.enq-list { display: grid; gap: 12px; }
.enq {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px;
  display: grid; gap: 6px;
}
.enq .top { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.enq .who { font-weight: 700; }
.enq .when { color: var(--ink-soft); font-size: 13px; }
.enq .meta { font-size: 13px; color: var(--gold-deep); font-weight: 600; }
.enq .msg { color: var(--ink-soft); }
.enq a.call { color: var(--maroon); font-weight: 600; }
.empty { text-align: center; color: var(--ink-soft); padding: 50px 20px; border: 1.5px dashed var(--line); border-radius: var(--radius); }

/* ---------- settings ---------- */
.settings-form { display: grid; gap: 16px; max-width: 560px; }
.settings-form label { display: grid; gap: 6px; font-weight: 600; font-size: 14px; }
.settings-form input, .settings-form textarea {
  font: inherit; padding: 11px 13px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--paper); font-weight: 400;
}
.settings-form input:focus, .settings-form textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,154,59,.2); }
.settings-actions { display: flex; gap: 10px; margin-top: 6px; }
.save-note { color: var(--ok); font-weight: 600; min-height: 20px; }

/* ---------- drawer ---------- */
.drawer { position: fixed; inset: 0; z-index: 100; }
.drawer[hidden] { display: none; }
.drawer-scrim { position: absolute; inset: 0; background: rgba(46,18,15,.5); backdrop-filter: blur(3px); animation: fade .25s; }
.drawer-card {
  position: absolute; top: 0; right: 0; height: 100%; width: min(460px, 100%); background: var(--paper);
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slideIn .3s cubic-bezier(.2,.8,.2,1);
}
@keyframes slideIn { from { transform: translateX(100%); } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.drawer-head h3 { font-size: 22px; }
.drawer-head .modal-close { position: static; box-shadow: none; background: var(--cream-2); }
.drawer-body { padding: 22px; overflow: auto; display: grid; gap: 14px; }
.drawer-body label { display: grid; gap: 6px; font-weight: 600; font-size: 14px; }
.drawer-body input, .drawer-body textarea, .drawer-body select {
  font: inherit; font-weight: 400; padding: 11px 13px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--cream);
}
.drawer-body input:focus, .drawer-body textarea:focus, .drawer-body select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,154,59,.2); }
.drawer-body .two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.prod-preview { aspect-ratio: 16/10; border-radius: 12px; overflow: hidden; background: var(--cream-2); border: 1px solid var(--line); }
.prod-preview img { width: 100%; height: 100%; object-fit: cover; }

/* thumbnail strip */
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.thumb { position: relative; width: 72px; height: 56px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.thumb.is-cover { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(201,154,59,.4); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .cover-tag { position: absolute; bottom: 0; left: 0; right: 0; background: var(--gold-deep); color: #fff; font-size: 9px; font-weight: 700; text-align: center; padding: 1px; letter-spacing: .04em; }
.thumb .rm, .thumb .mk-cover {
  position: absolute; top: 2px; width: 18px; height: 18px; border: 0; border-radius: 50%; cursor: pointer;
  font-size: 12px; line-height: 1; display: grid; place-items: center; padding: 0; box-shadow: var(--shadow-sm);
}
.thumb .rm { right: 2px; background: rgba(46,18,15,.85); color: #fff; }
.thumb .mk-cover { left: 2px; background: rgba(255,255,255,.92); color: var(--gold-deep); }
.thumb .rm:hover { background: var(--maroon); }
.img-count { position: absolute; bottom: 6px; right: 6px; background: rgba(46,18,15,.7); color: #fff; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; flex-direction: row !important; padding: 10px 0; }
.drawer-foot { display: flex; align-items: center; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--line); }
.drawer-foot .spacer { flex: 1; }
.btn.danger { color: var(--maroon); border-color: rgba(140,29,24,.3); }
.btn.danger:hover { background: rgba(140,29,24,.1); }

/* ---------- toast ---------- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 80px); z-index: 300;
  background: var(--ink); color: #fff; padding: 12px 22px; border-radius: 999px; box-shadow: var(--shadow-lg);
  font-weight: 600; font-size: 14px; opacity: 0; transition: transform .3s, opacity .3s; pointer-events: none;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

@media (max-width: 720px) {
  .admin-bar { flex-wrap: wrap; }
  .admin-tabs { order: 3; width: 100%; justify-content: center; }
  .drawer-body .two { grid-template-columns: 1fr; }
}
