/* Vintage Coach Hunter — dashboard/detail/admin stylesheet.
   Plain CSS, no build step, no framework. */

:root {
  --bg: #f6f4f0;
  --panel: #ffffff;
  --ink: #2a2420;
  --ink-soft: #6b6259;
  --line: #e2ddd4;
  --accent: #7a4b2a;
  --accent-soft: #f0e4d8;
  --good: #2f7a3d;
  --bad: #a33636;
  --warn: #9a6b12;
  --shadow: 0 1px 2px rgba(30, 20, 10, 0.06), 0 1px 1px rgba(30, 20, 10, 0.04);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
}

a { color: var(--accent); }

.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 20px 48px;
}

.site-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 20px;
  padding: 14px 0 18px;
  border-bottom: 2px solid var(--line);
  margin-bottom: 18px;
}

.site-header h1 {
  font-size: 20px;
  margin: 0;
}

.site-header .tagline {
  color: var(--ink-soft);
  font-size: 12.5px;
}

.site-nav a {
  margin-left: 14px;
  text-decoration: none;
  font-size: 13px;
  color: var(--ink-soft);
}

.site-nav a:hover { color: var(--accent); }

.disclaimer {
  background: #fbf1e0;
  border: 1px solid #e6cf9e;
  color: #6b4a10;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 12.5px;
  margin-bottom: 18px;
}

/* ---- filter form ---- */

.filters {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.filters form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: flex-end;
}

.filters .field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--ink-soft);
}

.filters label { font-weight: 600; }

.filters input[type="number"],
.filters input[type="text"],
.filters select {
  font-size: 13px;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
  min-width: 9em;
}

.filters .checkfield {
  flex-direction: row;
  align-items: center;
  gap: 6px;
}

.filters .checkfield label { font-weight: 500; }

.filters .actions {
  display: flex;
  gap: 8px;
}

.btn {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 5px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.2;
}

.btn.secondary {
  background: #fff;
  color: var(--accent);
}

.btn.reject {
  background: #fff;
  border-color: var(--bad);
  color: var(--bad);
}

.btn:disabled { opacity: .5; cursor: default; }

/* ---- listing grid / cards ---- */

.result-meta {
  color: var(--ink-soft);
  font-size: 12.5px;
  margin-bottom: 10px;
}

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

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: opacity .15s ease;
}

.card.is-dimmed { opacity: .45; }

.card .thumb {
  aspect-ratio: 4 / 3;
  background: #ece6dc;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

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

.card .thumb .placeholder {
  color: var(--ink-soft);
  font-size: 12px;
}

/* .thumb sits flush with the card's edges (matches its rounded top
   corners); the slider below it gets the same 14px horizontal inset as
   .card-body so it lines up with the rest of the card's content instead of
   also running edge-to-edge. */
.card .gallery-slider {
  width: calc(100% - 28px);
  margin: 8px 14px 0;
}

.card .gallery-counter {
  margin: 4px 14px 0;
}

.card-body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.card .badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.coach-pct {
  font-size: 20px;
  font-weight: 800;
  color: var(--accent);
}

.coach-pct .label {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--ink-soft);
  letter-spacing: .04em;
  margin-left: 4px;
}

.opp-score {
  font-size: 12px;
  color: var(--ink-soft);
  text-align: right;
}

.opp-score strong { color: var(--ink); }

.card h3 {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.3;
}

.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a:hover { text-decoration: underline; }

.source-favicon {
  width: 14px;
  height: 14px;
  vertical-align: -2px;
  margin-right: 5px;
  border-radius: 2px;
}

.card .source-line {
  font-size: 11.5px;
  color: var(--ink-soft);
}

.price-row {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
}

.price-row .ends {
  font-weight: 600;
}

.price-row .ends.ending-soon { color: var(--bad); }

.model-line {
  font-size: 12.5px;
}
.model-line .label { color: var(--ink-soft); }

.evidence-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 10px;
  font-size: 12px;
}

.evidence-cols ul {
  margin: 2px 0 0;
  padding-left: 0;
  list-style: none;
}

.evidence-cols li { margin-bottom: 2px; }

.evidence-cols .head {
  font-weight: 700;
  font-size: 10.5px;
  letter-spacing: .03em;
  color: var(--ink-soft);
}

.ev-pos::before { content: "✓ "; color: var(--good); }
.ev-neg::before { content: "✗ "; color: var(--bad); }
.ev-missing::before { content: "? "; color: var(--warn); }

.missing-line, .valuation-line {
  font-size: 12px;
}
.missing-line .label, .valuation-line .label { color: var(--ink-soft); }

.card-actions {
  margin-top: auto;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.review-state {
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}

.review-state.rejected { background: #f5dede; color: var(--bad); }

.pagination {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  margin-top: 26px;
  font-size: 13px;
}

.pagination a, .pagination span.current {
  padding: 5px 10px;
  border-radius: 5px;
  border: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
}

.pagination span.current {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 700;
}

.empty-state {
  text-align: center;
  color: var(--ink-soft);
  padding: 50px 10px;
}

/* ---- listing detail page ---- */

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

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

.gallery-main {
  aspect-ratio: 4 / 3;
  background: #ece6dc;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.gallery-main > img { width: 100%; height: 100%; object-fit: contain; background: #ece6dc; }

/* Scrubs through a listing's photos by swapping the sibling <img>'s src
   (see /assets/dashboard.js) -- shared by the Photos panel's main image
   above and each dashboard card's thumb (.card .thumb + .gallery-slider),
   so this stays a single, size-agnostic rule rather than two near-dupes. */
.gallery-slider {
  display: block;
  width: 100%;
  margin-top: 8px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* "n of N" under the Photos panel's main slider (public/listing.php);
   kept-in-sync by /assets/dashboard.js as the slider moves. */
.gallery-counter {
  display: block;
  margin-top: 4px;
  text-align: right;
  font-size: 12px;
  color: var(--ink-soft);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.panel h2 {
  font-size: 14px;
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--ink-soft);
}

.kv {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 12px;
  font-size: 13px;
}
.kv dt { color: var(--ink-soft); }
.kv dd { margin: 0; }

.tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  margin-right: 6px;
}

.ai-estimate-flag {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .04em;
  color: #fff;
  background: var(--warn);
  padding: 2px 7px;
  border-radius: 4px;
  vertical-align: middle;
  margin-left: 6px;
}

.observed-price-flag {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .04em;
  color: #fff;
  background: var(--good);
  padding: 2px 7px;
  border-radius: 4px;
  vertical-align: middle;
  margin-left: 6px;
}

.observed-features-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.observed-features-table td {
  padding: 4px 6px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.observed-features-table td:first-child {
  color: var(--ink-soft);
  white-space: nowrap;
  width: 40%;
}

textarea, .review-form input, .review-form select {
  font-family: inherit;
  font-size: 13px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  width: 100%;
}

.review-form .field { margin-bottom: 10px; }
.review-form label { display: block; font-size: 12px; font-weight: 600; color: var(--ink-soft); margin-bottom: 4px; }

.form-status { font-size: 12.5px; margin-top: 8px; }
.form-status.ok { color: var(--good); }
.form-status.err { color: var(--bad); }

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

.stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.stat-tile {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 16px;
  min-width: 120px;
  box-shadow: var(--shadow);
}

.stat-tile .n { font-size: 22px; font-weight: 800; }
.stat-tile .label { font-size: 11px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .03em; }

table.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: var(--panel);
}

table.admin-table th, table.admin-table td {
  text-align: left;
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
}

table.admin-table th { color: var(--ink-soft); font-size: 11.5px; text-transform: uppercase; }

.status-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}
.status-pending { background: #f0e4d8; color: var(--accent); }
.status-running { background: #dbe8f5; color: #1f5a8f; }
.status-done { background: #ddefe0; color: var(--good); }
.status-failed { background: #f5dede; color: var(--bad); }

/* ---- skill page (public/skill.php rendering workers/prompts/coach/SKILL.md) ---- */

.skill-doc {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 22px 26px 26px;
  box-shadow: var(--shadow);
  max-width: 900px;
  margin: 0 auto;
  font-size: 14px;
  line-height: 1.55;
}

/* The document's own frontmatter block (skill name + description). */
.skill-doc > header {
  padding: 0 0 14px;
  margin-bottom: 4px;
}
.skill-doc > header h1 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--accent);
  margin: 0 0 6px;
}
.skill-doc > header p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
}

.skill-doc hr {
  border: 0;
  border-top: 2px solid var(--line);
  margin: 0 0 18px;
}

.skill-doc h1 {
  font-size: 22px;
  line-height: 1.25;
  margin: 0 0 12px;
}

.skill-doc h2 {
  font-size: 16.5px;
  margin: 30px 0 10px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--line);
}

.skill-doc h3 {
  font-size: 14px;
  margin: 20px 0 6px;
  color: var(--accent);
}

.skill-doc p { margin: 0 0 10px; }

.skill-doc ul, .skill-doc ol {
  margin: 0 0 12px;
  padding-left: 24px;
}
.skill-doc li { margin-bottom: 4px; }
.skill-doc li > ul, .skill-doc li > ol { margin-top: 4px; margin-bottom: 4px; }

.skill-doc table {
  display: block;
  width: max-content;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 12.5px;
  margin: 0 0 14px;
}
.skill-doc th, .skill-doc td {
  text-align: left;
  vertical-align: top;
  padding: 5px 9px;
  border: 1px solid var(--line);
}
.skill-doc th {
  background: var(--accent-soft);
  color: var(--ink);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.skill-doc code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 4px;
}

.skill-doc pre {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  overflow-x: auto;
  font-size: 12px;
  line-height: 1.45;
  margin: 0 0 14px;
}
.skill-doc pre code {
  background: none;
  border: 0;
  padding: 0;
  font-size: inherit;
}

.skill-doc dl { margin: 0 0 12px; }
.skill-doc dt { font-weight: 600; margin-top: 6px; }
.skill-doc dd { margin: 2px 0 6px 18px; }

.skill-doc blockquote {
  margin: 0 0 12px;
  padding: 6px 14px;
  border-left: 3px solid var(--accent-soft);
  color: var(--ink-soft);
}

/* ---- dashboard job-queue widget (app/View/partials/job_queue_panel.php) ---- */

.job-queue {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 14px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
  font-size: 12.5px;
}

/* .job-queue-head/-types set display:flex, which would otherwise beat the
   browser's own [hidden] rule and keep a "hidden" row on screen. */
.job-queue [hidden] { display: none !important; }

.job-queue-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 16px;
}

.job-queue-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: .03em;
}

.job-queue-stat { color: var(--ink-soft); }
.job-queue-stat strong { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.job-queue-note { font-size: 11px; }

.job-queue-updated {
  margin-left: auto;
  color: var(--ink-soft);
  font-size: 11.5px;
}
.job-queue-updated.err { color: var(--bad); }

.job-queue-types {
  list-style: none;
  margin: 7px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 5px 20px;
}

.job-queue-types li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.job-queue-type {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.job-queue-type-rate {
  color: var(--ink-soft);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

.job-queue-done { color: var(--good); font-weight: 600; }
.job-queue-done a { font-weight: 700; }
