/* ==========================================================================
   Dashboard: registration lookup, the bike card, and the Sell this bike form.
   Builds on style.css, stock.css and photos.css.
   ========================================================================== */

/* ---------- Lookup ---------- */
.lookup-card { margin-top: 4px; }
.lookup-card .card-head { margin-bottom: 20px; }
.lookup-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.lookup-form .fld { flex: 1 1 260px; }
.lookup-form input {
  text-transform: uppercase; letter-spacing: .08em; font-weight: 700; font-size: 17px;
}
.lookup-form .btn { padding: 11px 18px; }

.result-area { margin-top: 22px; }

.notice {
  padding: 16px 18px; border-radius: 14px;
  border: 1px dashed var(--line-2); background: #fff; color: var(--ink-2); font-size: 15px;
}
.notice.error { border: 1px solid #fecdd3; background: #fff1f2; color: #9f1239; font-weight: 600; }
.notice.success { border: 1px solid #a7f3d0; background: var(--mint); color: var(--green-900); font-weight: 700; margin-bottom: 14px; }

/* ---------- Bike card ---------- */
.bike-card {
  background: #fff; border: 1px solid var(--line); border-radius: 22px;
  box-shadow: var(--shadow); overflow: hidden;
  animation: cardIn .4s var(--ease) both;
}

/* Top of the card: the photo on one side, the price and actions on the other */
.bike-hero { display: grid; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .bike-hero { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); } }

.bike-media {
  position: relative; aspect-ratio: 4 / 3; overflow: hidden;
  background: linear-gradient(135deg, var(--mint) 0%, var(--mint-2) 100%);
}
.bike-media a { display: block; width: 100%; height: 100%; }
.bike-media img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .4s var(--ease); }
.bike-media a:hover img { transform: scale(1.03); }
.bike-media-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  font-size: 14px; font-weight: 700; color: var(--green-700);
}
.bike-media-empty svg { width: 96px; height: 96px; opacity: .85; }
.bike-media-empty .art-scooter { width: 170px; height: auto; }
.bike-badge { position: absolute; top: 14px; left: 14px; box-shadow: 0 6px 14px -8px rgba(6, 78, 59, .5); }
.bike-count {
  position: absolute; right: 12px; bottom: 12px; padding: 5px 11px; border-radius: 999px;
  background: rgba(13, 31, 24, .78); color: #fff; font-size: 12px; font-weight: 700;
}

.bike-info {
  display: flex; flex-direction: column; align-items: flex-start; gap: 14px;
  min-width: 0; padding: 24px;
}

/* Looks like a number plate */
.plate {
  display: inline-block; max-width: 100%; padding: 4px 12px; border-radius: 8px;
  background: #fffdf5; border: 2px solid #111827; color: #111827; overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 18px; font-weight: 800; letter-spacing: .14em;
}
.bike-title {
  font-size: clamp(1.35rem, 3vw, 1.75rem); font-weight: 800; letter-spacing: -.02em;
  line-height: 1.2; overflow-wrap: anywhere;
}

.bike-price {
  display: flex; flex-direction: column; gap: 2px; width: 100%;
  padding: 16px 18px; border-radius: 16px;
  background: linear-gradient(135deg, var(--green-900), var(--green-700)); color: #fff;
}
.bike-price span { font-size: 13px; font-weight: 700; letter-spacing: .02em; opacity: .85; }
.bike-price strong { font-size: 32px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

.btn-sell {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px; border-radius: 14px; font-size: 16px; font-weight: 800;
}
.btn-sell svg { width: 20px; height: 20px; flex: 0 0 auto; }

.sold-note {
  width: 100%; padding: 12px 14px; border-radius: 12px;
  background: #e2e8f0; color: #334155; font-size: 14px; font-weight: 700;
}

/* Four key facts in tiles, under the photo */
.bike-facts {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px;
  margin: 0; padding: 16px 24px; border-top: 1px solid var(--line);
}
@media (min-width: 640px) { .bike-facts { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.fact {
  min-width: 0; padding: 12px 14px; border-radius: 14px;
  background: #f7faf8; border: 1px solid var(--line);
}
.fact dt { font-size: 11px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.fact dd { margin: 3px 0 0; font-size: 15px; font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }

.detail-grid { display: grid; grid-template-columns: 1fr; margin: 0; }
@media (min-width: 640px) { .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.detail { min-width: 0; padding: 12px 0; border-bottom: 1px solid var(--line); }
.detail:nth-child(odd) { padding-right: 14px; }
.detail dt { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.detail dd { margin: 3px 0 0; font-size: 15px; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }

.bike-section { padding: 18px 24px; border-top: 1px solid var(--line); }
.bike-section h3 { margin-bottom: 12px; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.bike-section .muted { font-size: 14px; color: var(--muted); }
.buyer-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 15px; }
.buyer-list li { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 10px; align-items: baseline; overflow-wrap: anywhere; }
.buyer-list .buyer-name { font-size: 17px; font-weight: 800; color: var(--ink); }
.buyer-list .k { font-size: 12px; font-weight: 700; color: var(--muted); }
.buyer-list a { color: var(--green-700); font-weight: 700; text-decoration: none; }
.buyer-list a:hover { text-decoration: underline; }
.pre { white-space: pre-line; color: var(--ink-2); overflow-wrap: anywhere; }

.bike-actions { display: flex; flex-wrap: wrap; gap: 10px; padding: 16px 24px 22px; border-top: 1px solid var(--line); }

/* ---------- Sale record (after a sale) ---------- */
.sale-record { background: #fbfdfc; }
.sale-grid { display: grid; gap: 18px; }
@media (min-width: 760px) { .sale-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.sale-name { font-size: 19px; font-weight: 800; letter-spacing: -.01em; overflow-wrap: anywhere; }
.sale-grid .buyer-list { margin-top: 10px; }
.sale-grid .buyer-list li { grid-template-columns: 108px minmax(0, 1fr); }
.sale-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; }
.id-line { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; font-size: 14px; }
.id-type { padding: 3px 10px; border-radius: 999px; background: var(--mint); color: var(--green-900); font-size: 12px; font-weight: 800; }
.sub-head { margin: 20px 0 10px; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.doc-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.doc-tile {
  display: flex; flex-direction: column; min-width: 0; overflow: hidden;
  background: #fff; border: 1px solid var(--line); border-radius: 14px; color: inherit; text-decoration: none;
  transition: box-shadow .2s var(--ease), transform .2s var(--ease);
}
.doc-tile:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.doc-tile img, .doc-pdf { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--mint); }
.doc-pdf {
  display: flex; align-items: center; justify-content: center;
  background: #fff1f2; color: #9f1239; font-size: 22px; font-weight: 800; letter-spacing: .04em;
}
.doc-label { padding: 10px 12px 0; font-size: 13px; font-weight: 800; color: var(--ink); }
.doc-meta { padding: 2px 12px 12px; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.sale-notes { margin-top: 16px; }

/* ---------- Sell this bike form ---------- */
.sell-dialog { width: min(760px, calc(100vw - 24px)); }
.sell-dialog .eyebrow { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--green-700); }
.sell-bike {
  display: flex; gap: 14px; align-items: center; margin-bottom: 8px;
  padding: 14px 16px; border-radius: 14px; background: var(--mint);
}
.sell-bike strong { display: block; font-size: 16px; font-weight: 800; overflow-wrap: anywhere; }
.sell-bike .sell-listed { font-size: 13px; font-weight: 700; color: var(--green-700); }
.sell-hint { margin: 0 0 14px; font-size: 13px; color: var(--muted); }

.doc-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; align-items: center;
  padding: 12px 0; border-bottom: 1px dashed var(--line-2);
}
.doc-row:last-of-type { border-bottom: 0; }
.doc-info { min-width: 0; }
.doc-info strong { display: block; font-size: 14px; font-weight: 800; color: var(--ink); }
.doc-info span { display: block; font-size: 12.5px; color: var(--muted); }
.doc-add { white-space: nowrap; }
.doc-list {
  grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px;
  margin: 0; padding: 0; list-style: none;
}
.doc-list:empty { display: none; }
.doc-chip {
  display: inline-flex; align-items: center; gap: 8px; max-width: 100%;
  padding: 4px 4px 4px 12px; border-radius: 999px;
  background: var(--mint); border: 1px solid var(--mint-2); font-size: 13px;
}
.doc-name {
  min-width: 0; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-weight: 700; color: var(--ink-2);
}
.doc-size { font-size: 12px; color: var(--muted); white-space: nowrap; }
.doc-remove {
  appearance: none; border: 0; cursor: pointer; width: 24px; height: 24px; border-radius: 50%;
  background: #fff; color: var(--ink-2); font-size: 16px; line-height: 1;
}
.doc-remove:hover { background: #fff1f2; color: #9f1239; }
.doc-count { margin: 6px 0 0; font-size: 13px; font-weight: 700; color: var(--muted); text-align: right; }
.doc-msg { min-height: 1.3em; margin: 6px 0 0; font-size: 13px; font-weight: 600; color: var(--muted); }
.doc-msg.error { color: #9f1239; }

/* ---------- Summary card (after a registration search) ---------- */
.bike-summary {
  display: flex; flex-direction: column; min-width: 0; overflow: hidden;
  background: #fff; border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow);
  animation: cardIn .4s var(--ease) both;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
/* Prebook, Sell and View Details */
.action-row { display: flex; flex-wrap: wrap; gap: 10px; width: 100%; margin-top: 4px; }
.action-row .btn { flex: 1 1 110px; justify-content: center; padding: 12px 16px; font-weight: 800; white-space: nowrap; }
.btn-book { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.btn-book:hover { background: #fde68a; }
.action-row .btn:disabled, .action-row .btn:disabled:hover { opacity: .45; cursor: not-allowed; }
.action-row .btn-primary:disabled, .action-row .btn-primary:disabled:hover { background: var(--green); }
.action-row .btn-book:disabled, .action-row .btn-book:disabled:hover { background: #fef3c7; }
.booking-note { margin-top: 8px; font-size: 14px; font-weight: 700; color: #92400e; }
.summary-art {
  display: flex; align-items: center; justify-content: center; padding: 28px 24px;
  background: linear-gradient(135deg, var(--mint) 0%, var(--mint-2) 100%);
}
.summary-art svg { width: min(220px, 70%); height: auto; }
.summary-body { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 22px 24px 24px; }
.summary-title { font-size: clamp(1.35rem, 3vw, 1.75rem); font-weight: 800; letter-spacing: -.02em; line-height: 1.2; overflow-wrap: anywhere; }
.summary-price { display: flex; flex-direction: column; gap: 2px; }
.summary-price span { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.summary-price strong { font-size: clamp(1.6rem, 4vw, 2.1rem); font-weight: 800; letter-spacing: -.02em; color: var(--green-700); }
.summary-open { margin-top: 4px; }
@media (min-width: 640px) {
  .bike-summary { flex-direction: row; align-items: stretch; }
  .summary-art { flex: 0 0 46%; }
  .summary-body { flex: 1 1 auto; justify-content: center; padding: 28px 30px; }
}

.details-bar { margin-bottom: 14px; }
.details-bar .btn { padding: 9px 16px; }

/* ---------- Phone ---------- */
@media (max-width: 560px) {
  .bike-info { padding: 18px; }
  .bike-facts { padding: 14px 16px; }
  .bike-price strong { font-size: 26px; }
  .bike-section, .bike-actions { padding-left: 16px; padding-right: 16px; }
  .plate { font-size: 16px; }
  .detail:nth-child(odd) { padding-right: 0; }
  .buyer-list li, .sale-grid .buyer-list li { grid-template-columns: 62px minmax(0, 1fr); }
  .sale-grid .buyer-list li { grid-template-columns: 100px minmax(0, 1fr); }
  .doc-name { max-width: 170px; }
  .sell-bike { padding: 12px; }
}
