/* mintSketch — admin portal (admin.html). Builds on styles.css + live.css. */

.admin {
  padding: 28px 0 60px;
  min-height: calc(100dvh - var(--header));
}

.admin .demo-note {
  margin: 0 auto 22px;
}

.admin-center {
  display: grid;
  place-items: center;
  padding-top: 40px;
}

.muted {
  color: var(--muted);
}

code {
  font-size: 0.9em;
  background: var(--paper);
  padding: 1px 5px;
}

/* ── Panels + forms ─────────────────────────────────────────────────── */

.panel {
  width: min(440px, 100%);
  background: var(--white);
  border: 1px solid var(--hair);
  border-top: 4px solid var(--green);
  padding: 30px 28px 32px;
  display: grid;
  gap: 16px;
}

.panel-title {
  font-size: 2.2rem;
  letter-spacing: -0.04em;
  line-height: 1;
}

.field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.field > span {
  font-size: 0.86rem;
  font-weight: 600;
}

.field em {
  font-style: normal;
  font-weight: 400;
  color: var(--muted);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--hair);
  border-radius: 0;
  background: var(--white);
  color: var(--ink);
  font: inherit;
  font-size: 16px; /* stops iOS zooming into fields */
}

.field textarea {
  resize: vertical;
  line-height: 1.45;
}

.field select {
  appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%23121820' stroke-width='1.6' d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 2px solid var(--green);
  outline-offset: -1px;
  border-color: var(--green);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.hint {
  color: var(--muted);
  font-size: 0.86rem;
}

.form-error {
  padding: 10px 12px;
  background: #fef3f2;
  border: 1px solid #fecdca;
  color: #b42318;
  font-size: 0.92rem;
}

/* ── Buttons ────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--green);
  color: var(--white);
}

.btn-primary:not(:disabled):hover {
  background: var(--green-deep);
}

.btn-ghost {
  background: var(--white);
  border-color: var(--hair);
  color: var(--ink);
}

.btn-ghost:not(:disabled):hover {
  border-color: var(--green);
  color: var(--green);
}

.btn-danger-ghost {
  background: none;
  border-color: #fecdca;
  color: #b42318;
}

.btn-danger-ghost:hover {
  background: #fef3f2;
}

.btn-sm {
  min-height: 38px;
  padding: 6px 14px;
  font-size: 0.88rem;
}

.btn-block {
  width: 100%;
}

/* ── Dashboard ──────────────────────────────────────────────────────── */

.dash-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 22px;
}

.dash-title {
  margin-top: 8px;
  font-size: clamp(2.4rem, 5vw, 3.4rem);
}

.dash-head .kicker span {
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink);
  font-weight: 600;
}

.admin-list {
  display: grid;
  gap: 10px;
}

.admin-row {
  display: grid;
  grid-template-columns: 76px 1fr auto auto;
  gap: 18px;
  align-items: center;
  padding: 12px 14px;
  background: var(--white);
  border: 1px solid var(--line);
}

.admin-row .thumb-sm {
  width: 76px;
  height: 76px;
  object-fit: cover;
  display: block;
  background: var(--paper);
}

.admin-row .lot-placeholder {
  width: 76px;
  height: 76px;
}

.admin-row .lot-placeholder .mark {
  width: 26px;
  height: 34px;
}

.admin-row .lot-placeholder em {
  display: none;
}

.row-main {
  min-width: 0;
}

.row-main h3 {
  font-size: 1.08rem;
  letter-spacing: -0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.86rem;
}

.row-meta .badge {
  background: var(--paper);
}

.row-meta .timer {
  display: inline;
  margin: 0;
}

.row-price {
  text-align: right;
}

.row-price strong {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.row-actions {
  display: flex;
  gap: 8px;
}

/* ── Dialogs ────────────────────────────────────────────────────────── */

.admin-dialog {
  width: min(640px, calc(100% - 24px));
}

.dlg-pad {
  display: grid;
  gap: 16px;
  padding: 30px 28px 28px;
}

.dlg-pad h2 {
  margin: 0;
  max-width: none;
  padding-right: 40px;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
}

.dlg-pad .dlg-price {
  margin: 4px 0 0;
}

.dlg-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.spacer {
  flex: 1;
}

/* Photos */

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
}

.photo-grid:empty {
  display: none;
}

.photo {
  position: relative;
  aspect-ratio: 1;
  background: var(--paper);
  border: 1px solid var(--line);
}

.photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo.cover {
  outline: 2px solid var(--green);
  outline-offset: -2px;
}

.photo .cover-tag {
  position: absolute;
  left: 4px;
  bottom: 4px;
  padding: 1px 6px;
  background: var(--green);
  color: var(--white);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.photo-btns {
  position: absolute;
  top: 4px;
  right: 4px;
  display: flex;
  gap: 4px;
}

.photo-btns button {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: rgba(18, 24, 32, 0.75);
  color: var(--white);
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
}

.photo-btns button:hover {
  background: var(--ink);
}

.photo.uploading {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.8rem;
}

.photo-drop {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 14px;
  border: 1.5px dashed var(--hair);
  background: var(--paper);
}

.photo-drop.over {
  border-color: var(--green);
  background: #eef7f2;
}

/* Hidden file picker, opened by its button. Kept in the page (not
 * display:none) so every browser allows opening it. */
.file-hidden,
.field input.file-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  pointer-events: none;
}

/* Bids */

.bid-form {
  display: grid;
  gap: 12px;
  padding: 18px;
  background: var(--paper);
}

.quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.bid-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dlg-pad .dlg-h3 {
  margin: 8px 0 0;
}

.dlg-h3 .muted {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
}

.admin-bids {
  max-height: 300px;
}

.admin-bids li {
  grid-template-columns: auto 1fr auto;
}

.admin-bids .who {
  color: var(--ink);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-bids .who a {
  color: var(--green);
  text-decoration: none;
}

.admin-bids .who small {
  color: var(--muted);
  font-size: 0.85em;
}

/* ── Responsive ─────────────────────────────────────────────────────── */

@media (max-width: 760px) {
  .admin-row {
    grid-template-columns: 64px 1fr;
    gap: 12px 14px;
  }

  .admin-row .thumb-sm,
  .admin-row .lot-placeholder {
    width: 64px;
    height: 64px;
  }

  .row-price {
    grid-column: 1 / 2;
    text-align: left;
  }

  .row-price strong {
    font-size: 1rem;
  }

  .row-actions {
    grid-column: 2 / 3;
    justify-content: flex-end;
  }
}

@media (max-width: 560px) {
  .field-row {
    grid-template-columns: 1fr;
  }

  .dlg-pad {
    padding: 24px 18px 22px;
  }

  .dash-head {
    align-items: start;
    flex-direction: column;
  }

  .row-actions {
    grid-column: 1 / -1;
  }

  .row-actions .btn {
    flex: 1;
  }
}

/* ── Bidders ────────────────────────────────────────────────────────── */

.table-wrap {
  overflow-x: auto;
  background: var(--white);
  border: 1px solid var(--line);
}

.bidder-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.bidder-table th,
.bidder-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.bidder-table th {
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.bidder-table tr:last-child td {
  border-bottom: 0;
}

.bidder-table a {
  color: var(--green);
  text-decoration: none;
}

.bidder-table a:hover {
  text-decoration: underline;
}

.winner {
  display: inline-block;
  padding: 1px 7px;
  margin-right: 2px;
  background: var(--green);
  color: var(--white);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  vertical-align: 1px;
}

/* ── Buyer account (account.html) ───────────────────────────────────── */

.auth-panel {
  width: min(460px, 100%);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--hair);
}

.auth-tab {
  min-height: 46px;
  border: 0;
  background: var(--white);
  font-weight: 600;
  cursor: pointer;
}

.auth-tab[aria-selected="true"] {
  background: var(--green);
  color: var(--white);
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-form .linkish {
  justify-self: center;
  min-height: 44px;
}

.form-ok {
  padding: 10px 12px;
  background: #ecfdf3;
  border: 1px solid #abefc6;
  color: #067647;
  font-size: 0.92rem;
}

.me-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 16px;
  align-items: start;
}

.me-details {
  width: 100%;
}

.me-details .btn {
  justify-self: start;
}

.me-h2 {
  margin: 0;
  max-width: none;
  font-size: 1.4rem;
  letter-spacing: -0.03em;
}

.me-bids {
  display: grid;
  gap: 14px;
}

.my-bids {
  display: grid;
  gap: 10px;
}

.my-bid {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 10px 14px 10px 10px;
  background: var(--white);
  border: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
}

.my-bid:hover {
  border-color: var(--green);
}

.my-bid .thumb-sm,
.my-bid .lot-placeholder {
  width: 64px;
  height: 64px;
  object-fit: cover;
  display: flex;
}

.my-bid .lot-placeholder .mark {
  width: 24px;
  height: 32px;
}

.my-bid .lot-placeholder em {
  display: none;
}

.my-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.my-main strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.my-main span {
  color: var(--muted);
  font-size: 0.88rem;
}

.my-tag {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--paper);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  text-transform: capitalize;
}

.my-tag.win {
  background: #ecfdf3;
  color: #067647;
}

.my-tag.out {
  background: #fef3f2;
  color: #b42318;
}

@media (max-width: 760px) {
  .me-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .my-bid {
    grid-template-columns: 52px 1fr;
  }

  .my-bid .thumb-sm,
  .my-bid .lot-placeholder {
    width: 52px;
    height: 52px;
  }

  .my-tag {
    grid-column: 2;
    justify-self: start;
  }
}

/* ── Avatars ────────────────────────────────────────────────────────── */

.avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--green);
  color: var(--white);
  font-size: 0.8rem;
  font-weight: 700;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.avatar-lg {
  width: 84px;
  height: 84px;
  font-size: 1.6rem;
}

.avatar-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.avatar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.92rem;
  cursor: pointer;
}

.check input {
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  accent-color: var(--green);
  flex: none;
}

.bidder-table .avatar,
.admin-bids .avatar {
  width: 32px;
  height: 32px;
  font-size: 0.72rem;
}

.admin-bids li.has-avatar .who {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  white-space: normal;
}

.person {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Save / Cancel stay visible at the bottom of the lot window, however
 * short the screen; the fields scroll underneath. */
#edit-dlg .dlg-pad {
  padding-bottom: 0;
}

#edit-dlg .dlg-actions {
  position: sticky;
  bottom: 0;
  z-index: 1;
  margin: 0 -28px;
  padding: 14px 28px 16px;
  background: var(--white);
  box-shadow: 0 -8px 16px rgba(18, 24, 32, 0.06);
}

@media (max-width: 560px) {
  #edit-dlg .dlg-actions {
    margin: 0 -18px;
    padding: 12px 18px 14px;
  }

  #edit-dlg .dlg-actions .spacer {
    display: none;
  }

  #edit-dlg .dlg-actions .btn {
    flex: 1;
  }
}

/* Tap-to-pick options (used instead of pop-up dropdowns in the lot window). */
fieldset.field {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

fieldset.field legend {
  padding: 0;
  margin-bottom: 6px;
  font-size: 0.86rem;
  font-weight: 600;
}

.choice {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.choice label {
  position: relative;
  cursor: pointer;
}

.choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice span {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 8px 14px;
  border: 1px solid var(--hair);
  border-radius: 999px;
  background: var(--white);
  font-size: 0.92rem;
  font-weight: 500;
}

.choice label:hover span {
  border-color: var(--green);
}

.choice input:checked + span {
  background: var(--green);
  border-color: var(--green);
  color: var(--white);
  font-weight: 600;
}

.choice input:focus-visible + span {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

#category-other {
  margin-top: 8px;
}

/* ── Home page feature ──────────────────────────────────────────────── */

.badge-home {
  background: #fff4d6 !important;
  color: #8a5a00;
}

.btn-star.on {
  background: #f5b700;
  border-color: #f5b700;
  color: var(--ink);
}

.btn-star.on:hover {
  background: #e0a800;
}

/* ── Winners ────────────────────────────────────────────────────────── */

.winner-table td {
  vertical-align: middle;
  white-space: normal;
}

.winner-table td.num {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.winner-table .thumb-sm,
.winner-table .lot-placeholder {
  width: 48px;
  height: 48px;
  flex: none;
  object-fit: cover;
}

.winner-table .lot-placeholder .mark {
  width: 20px;
  height: 26px;
}

.winner-table .lot-placeholder em {
  display: none;
}

.winner-table small {
  font-size: 0.82rem;
}

.bid-id {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.84rem;
  cursor: pointer;
  white-space: nowrap;
}

.bid-id:hover {
  border-color: var(--green);
  color: var(--green);
}

.win-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

/* ── Small phones ───────────────────────────────────────────────────── */

.bid-id {
  min-height: 40px;
}

.win-actions .linkish,
.win-actions .btn {
  min-height: 40px;
}

.avatar-row {
  flex-wrap: wrap;
}

@media (max-width: 560px) {
  .panel {
    padding: 24px 18px 26px;
  }

  .me-details {
    min-width: 0;
  }

  .dash-title {
    font-size: 2.3rem;
  }
}

/* ── SEO tab ────────────────────────────────────────────────────────── */

.seo {
  display: grid;
  gap: 14px;
}

.panel-lite {
  background: var(--white);
  border: 1px solid var(--line);
  padding: 22px 22px 24px;
}

.seo-site .chks {
  margin: 12px 0 14px;
}

.seo-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.seo-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 24px;
}

.seo-fields {
  display: grid;
  gap: 12px;
  align-content: start;
}

.seo-fields input::placeholder,
.seo-fields textarea::placeholder {
  color: #9aa3ab;
}

.seo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.count-out {
  float: right;
  font-style: normal;
  font-variant-numeric: tabular-nums;
}

.count-out.ok { color: #067647; }
.count-out.warn { color: #b54708; }
.count-out.bad { color: #b42318; }

.gpreview {
  margin: 6px 0 14px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font-family: Arial, Helvetica, sans-serif;
}

.g-site {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  line-height: 1.3;
  color: #4d5156;
}

.g-site b {
  color: #202124;
  font-weight: 400;
  font-size: 14px;
}

.g-fav {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}

.g-title {
  margin-top: 8px;
  color: #1a0dab;
  font-size: 20px;
  line-height: 1.3;
}

.g-desc {
  margin-top: 4px;
  color: #4d5156;
  font-size: 14px;
  line-height: 1.58;
}

.chks {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 6px;
  font-size: 0.92rem;
}

.chk {
  display: flex;
  gap: 8px;
  align-items: baseline;
}

.chk > span {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
}

.chk.ok > span { background: #12b76a; }
.chk.warn > span { background: #f79009; }
.chk.bad > span { background: #d92d20; }

.chk em {
  font-style: normal;
  color: var(--muted);
}

@media (max-width: 760px) {
  .seo-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Users + payment status ─────────────────────────────────────────── */

.users-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.users-tools input {
  flex: 1 1 260px;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--hair);
  background: var(--white);
  font: inherit;
  font-size: 16px;
}

.users-tools input:focus {
  outline: 2px solid var(--green);
  outline-offset: -1px;
}

.users-summary {
  margin-bottom: 10px;
}

.users-table td,
.users-table th {
  white-space: normal;
  vertical-align: middle;
}

.users-table .num {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.users-table tr.is-disabled td {
  background: #fafafa;
  color: var(--muted);
}

.badge-active {
  background: #ecfdf3 !important;
  color: #067647;
}

.badge-disabled {
  background: #fef3f2 !important;
  color: #b42318;
}

.badge-overdue {
  background: #b42318 !important;
  color: #fff;
}

.pay-by {
  width: 100%;
  color: var(--muted);
  font-size: 0.82rem;
}

.pay-by.late {
  color: #b42318;
  font-weight: 600;
}

.warn-text {
  color: #b54708;
}

/* ── Sell requests ──────────────────────────────────────────────────── */

.consign {
  display: grid;
  gap: 12px;
}

.consign-card.is-new {
  border-left: 4px solid #f5b700;
}

.consign-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.consign-head h3 {
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}


.consign-body {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.consign-body .btn {
  justify-self: start;
}

.consign-who a {
  color: var(--green);
  text-decoration: none;
  font-weight: 600;
}

.consign-details {
  padding: 10px 12px;
  background: var(--paper);
  white-space: pre-line;
}

/* Field-level validation messages */
.field-error {
  color: #b42318;
  font-size: 0.86rem;
  font-weight: 500;
}

.field input[aria-invalid="true"],
.field textarea[aria-invalid="true"] {
  border-color: #d92d20;
  outline: 2px solid rgba(217, 45, 32, 0.25);
  outline-offset: -1px;
}
