/* manage.css: styles for selling and admin. The shared system is app.css. */

/* --- the frame ------------------------------------------------------------------------------ */

.manage-main { min-width: 0; }
.manage-main > .page-head, .manage-main > div > .page-head { align-items: flex-start; }
.back-link { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-weight: 600; font-size: .9rem; margin-bottom: 8px; }
.back-link:hover { color: var(--primary); }
.back-link svg { width: 16px; height: 16px; }
.title-row { gap: 8px 12px; }
.title-row h1 { overflow-wrap: anywhere; }
/* The shared pill capitalises every word, which reads wrongly for phrases ("Waiting For Its Video"):
   here only the first letter is raised. */
.manage-main .pill:not(.test), .manage-modal .pill:not(.test) { display: inline-block; text-transform: none; }
.manage-main .pill:not(.test)::first-letter, .manage-modal .pill:not(.test)::first-letter { text-transform: uppercase; }
/* The line above a total runs unbroken across both columns. */
.manage-main .dl, .manage-modal .dl { column-gap: 0; }
.manage-main .dl dt, .manage-modal .dl dt { padding-right: 18px; }
.pos { color: var(--green); }
.neg { color: var(--danger); }
.wrap-any { overflow-wrap: anywhere; }
.show-sm { display: none; }
@media (max-width: 720px) {
  .hide-sm { display: none !important; }
  .show-sm { display: inline; }
}
.lister.reloading { opacity: .55; pointer-events: none; transition: opacity .15s; }
.card.stack > h2:first-child, .card.stack > h3:first-child, .card.form > h2:first-child, .card.form > h3:first-child { margin-bottom: 0; }
.photo-large { max-height: 76vh; margin: 0 auto; border-radius: var(--radius-sm); }

/* The buttons under a long form stay in reach while it scrolls. */
.action-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; position: sticky; bottom: 0; z-index: 5; padding: 14px 0; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-top: 1px solid var(--line); }
@media (max-width: 720px) { .action-bar .grow { display: none; } }

/* --- lists ---------------------------------------------------------------------------------- */

.thumb { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; background: var(--surface-2); flex: none; }
.thumb.blank { display: inline-grid; place-items: center; color: var(--muted); }
.thumb.blank svg { width: 22px; height: 22px; }
.card-list > .item-row { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 14px; align-items: center; width: 100%; text-align: left; }
.card-list > button.item-row { background: none; border: 0; border-bottom: 1px solid var(--line); font: inherit; color: inherit; cursor: pointer; }
.card-list > button.item-row:last-child { border-bottom: 0; }
.card-list > button.item-row:hover { background: var(--surface-2); }
.item-row .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-row .pills { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.card-list > .listing-row { grid-template-columns: 56px minmax(0, 1fr) 84px 104px minmax(170px, auto); }
@media (max-width: 720px) {
  .card-list > .item-row, .card-list > .listing-row { grid-template-columns: 56px minmax(0, 1fr); }
  .item-row .pills { grid-column: 2; justify-content: flex-start; }
}
.listing-counts > a { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px 18px; }

.filter-bar { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.filter-bar select { width: auto; min-width: 170px; }
.search-box { position: relative; flex: 1; min-width: 220px; max-width: 460px; }
.search-box svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.search-box input { padding-left: 40px; }
.table td .row { gap: 10px; }
.manage-main .table td:first-child { min-width: 170px; }
.table td.nowrap { white-space: nowrap; }
select.compact { width: auto; padding: 7px 34px 7px 11px; font-size: .9rem; }
.pay-to { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }

/* --- /sell ---------------------------------------------------------------------------------- */

.sell-hero { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, .7fr); gap: 40px; align-items: center; background: var(--surface-2); border-radius: 24px; padding: clamp(26px, 5vw, 56px); }
.eyebrow { font: 700 .8rem/1 var(--body); letter-spacing: .1em; text-transform: uppercase; color: var(--primary); margin-bottom: 14px; }
.sell-hero h1 { font-size: clamp(2rem, 1.2rem + 3.4vw, 3.4rem); }
.lead { font-size: 1.12rem; color: var(--ink-2); max-width: 54ch; margin: 16px 0 24px; }
.sell-hero-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 22px; display: flex; flex-direction: column; gap: 16px; align-items: flex-start; transform: rotate(1.5deg); }
.sell-hero-card .paper { align-self: stretch; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 18px; text-align: center; transform: rotate(-3deg); display: flex; flex-direction: column; gap: 6px; color: var(--muted); }
.sell-hero-card .paper b { font: 700 2rem/1.1 "Segoe Print", "Bradley Hand", "Marker Felt", "Comic Sans MS", cursive; color: var(--ink); letter-spacing: .04em; }
.sell-hero-card .row { color: var(--ink-2); font-size: .95rem; }
.sell-hero-card .row svg { width: 20px; height: 20px; color: var(--primary); }
.sell-points { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 28px; }
.sell-point { display: flex; flex-direction: column; gap: 8px; }
.sell-point p { font-size: .95rem; }
.sell-icon { width: 42px; height: 42px; border-radius: 12px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; margin-bottom: 4px; }
.sell-icon svg { width: 22px; height: 22px; }
.sell-how { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 40px; align-items: start; }
.sell-how h2 { margin-bottom: 20px; }
.sell-form { scroll-margin-top: 96px; }
.sell-form > h2 { margin-bottom: 6px; }
.sell-form > p { margin-bottom: 18px; }
@media (max-width: 1000px) { .sell-points { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) {
  .sell-hero, .sell-how { grid-template-columns: 1fr; }
  .sell-hero-card { max-width: 320px; }
}
@media (max-width: 520px) { .sell-points { grid-template-columns: 1fr; } }

/* Numbered steps: how selling works, how to film the making-of video. */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; display: flex; flex-direction: column; gap: 14px; }
.steps li { counter-increment: step; position: relative; padding-left: 44px; min-height: 30px; display: flex; flex-direction: column; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font: 700 .9rem/30px var(--body); text-align: center; }
.steps li span { font-size: .95rem; }

/* --- the dashboard -------------------------------------------------------------------------- */

.stat-grid.by-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat-grid.by-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1000px) { .stat-grid.by-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .stat-grid.by-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat .value { overflow-wrap: anywhere; }

.checklist { margin-bottom: 22px; border-color: color-mix(in srgb, var(--primary) 40%, var(--line)); }
.checklist h2 { font-size: 1.3rem; }
.checklist ul { list-style: none; margin: 14px 0 0; padding: 0; }
.checklist li { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.checklist li:last-child { padding-bottom: 0; }
.checklist .tick { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); flex: none; display: grid; place-items: center; }
.checklist .tick svg { width: 15px; height: 15px; }
.checklist li.done .tick { background: var(--green); border-color: var(--green); color: var(--bg); }
.checklist li.done b { color: var(--muted); font-weight: 600; }
@media (max-width: 520px) {
  .checklist li { flex-wrap: wrap; }
  .checklist li .btn { margin-left: 40px; }
}

/* --- the listing editor and the making-of video ---------------------------------------------- */

.verify-panel { border-color: color-mix(in srgb, var(--primary) 40%, var(--line)); display: flex; flex-direction: column; gap: 14px; }
.verify-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: start; margin-top: 6px; }
@media (max-width: 1000px) { .verify-grid { grid-template-columns: 1fr; } }
.code-box { background: var(--surface-2); border: 1.5px dashed var(--primary); border-radius: var(--radius); padding: 18px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.code-box.look-for { border-style: solid; }
/* On a phone the code sits under the listing, a long way below the video: repeat it beside the player. */
.code-under-video { display: none; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.code-under-video b { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .05em; color: var(--ink); }
@media (max-width: 1000px) { .code-under-video { display: block; } }
.code-box .label { font: 600 .78rem/1.3 var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.code-box .code { font: 700 clamp(1.8rem, 1.2rem + 3vw, 2.7rem)/1.1 ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .06em; color: var(--ink); user-select: all; overflow-wrap: anywhere; }

/* --- orders and cases ------------------------------------------------------------------------ */

.order-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; margin-top: 18px; }
@media (max-width: 1080px) { .order-grid { grid-template-columns: 1fr; } }
.order-item { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.order-item:first-child { border-top: 0; padding-top: 0; }
.order-item:last-child { padding-bottom: 0; }
.order-item .title { font-weight: 600; }
.order-item .title:hover { color: var(--primary); }
.address { font-style: normal; line-height: 1.5; }
.order-note { margin-top: 14px; padding: 12px 14px; background: var(--surface-2); border-radius: var(--radius-sm); }
.order-note .label { font-size: .8rem; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
.case-link { align-items: center; }
.case-link > div { flex: 1; display: flex; flex-direction: column; }
.case-link:hover { filter: brightness(.97); }
.ship-card { border-color: var(--primary); display: flex; flex-direction: column; gap: 14px; }
.ship-card > h3:first-child { margin-bottom: 0; }
.case-thread .bubble.system { border-radius: 14px; }
.case-thread .photo-picker { margin-top: 10px; }
.choice { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.choice:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }

/* --- videos, reviews, settings --------------------------------------------------------------- */

.video-admin-card { display: flex; flex-direction: column; gap: 10px; }
.video-file { max-width: 620px; }
.pick-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; max-height: 380px; overflow-y: auto; }
.pick-listing { align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.pick-listing:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.pick-listing .thumb { width: 40px; height: 40px; border-radius: 8px; }
.pick-listing b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cover-now { width: 240px; max-width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius-sm); }

.review { display: flex; flex-direction: column; gap: 10px; }
.review-photos, .photo-strip { display: flex; gap: 8px; flex-wrap: wrap; }
.review-photos img, .photo-strip img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; cursor: zoom-in; }
.review-listing { gap: 10px; color: var(--ink-2); align-self: flex-start; }
.review-listing:hover { color: var(--primary); }
.review-listing .thumb { width: 36px; height: 36px; border-radius: 8px; }
.review-reply { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; border-top: 1px solid var(--line); padding-top: 12px; }
.review-reply textarea { min-height: 84px; }
.reply { align-self: stretch; background: var(--surface-2); border-radius: var(--radius-sm); padding: 12px 14px; }
.reply .who { font-size: .8rem; font-weight: 700; color: var(--muted); margin-bottom: 4px; }

.image-pick { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.image-pick.banner { flex-direction: column; align-items: flex-start; }
.image-pick .stack { align-items: flex-start; }
.image-pick-preview { background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; display: grid; place-items: center; color: var(--muted); flex: none; }
.image-pick-preview svg { width: 26px; height: 26px; }
.image-pick-preview img { width: 100%; height: 100%; object-fit: cover; }
.image-pick-preview.round { width: 88px; height: 88px; border-radius: 50%; }
.image-pick-preview.banner { width: min(100%, 420px); aspect-ratio: 4 / 1; border-radius: var(--radius-sm); }

/* --- admin ---------------------------------------------------------------------------------- */

.card-list > .status-row { display: flex; gap: 14px; align-items: flex-start; }
.status-dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--muted); }
.status-dot svg { width: 16px; height: 16px; }
.status-row.good .status-dot { background: var(--green-soft); color: var(--green); }
.status-row.warn .status-dot { background: var(--warn-soft); color: var(--warn); }
.status-row.info .status-dot { background: var(--info-soft); color: var(--info); }

.review-card { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 1000px) { .review-card { grid-template-columns: 1fr; } }
.review-video { display: flex; flex-direction: column; gap: 12px; }
.signals { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.signals li { display: flex; gap: 10px; align-items: flex-start; padding: 9px 12px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--ink-2); font-size: .93rem; }
.signals li svg { width: 17px; height: 17px; flex: none; margin-top: 2px; }
.signals li.good { background: var(--green-soft); color: var(--green); }
.signals li.info { background: var(--info-soft); color: var(--info); }
.signals li.warn { background: var(--warn-soft); color: var(--warn); }
.signals li.bad { background: var(--danger-soft); color: var(--danger); }
.review-title { font: 600 1.25rem/1.2 var(--display); }
.review-title:hover { color: var(--primary); }
.clamp { display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.decide { margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--line); }
.decide .btn { flex: 1; }

.report-card { display: flex; flex-direction: column; gap: 12px; }
.report-target { display: flex; flex-direction: column; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.report-target:hover { border-color: var(--primary); }
.report-card blockquote { margin: 0; padding: 4px 0 4px 14px; border-left: 3px solid var(--line); color: var(--ink-2); }

.month-card { display: flex; flex-direction: column; gap: 16px; }
.month-card > .row h3 { margin: 0; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.fact { background: var(--surface-2); border-radius: var(--radius-sm); padding: 12px 14px; }
.fact .label, .fact .sub { color: var(--muted); font-size: .84rem; }
.fact .value { font: 600 1.3rem/1.3 var(--display); font-variant-numeric: tabular-nums; }
@media (max-width: 600px) { .facts { grid-template-columns: 1fr; } }

.unit-input { position: relative; }
.unit-input input { padding-right: 58px; -moz-appearance: textfield; appearance: textfield; }
.unit-input input::-webkit-outer-spin-button, .unit-input input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.unit-input span { position: absolute; right: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
