:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --ink: #1d1d1b;
  --muted: #6b6a66;
  --line: #e2e0d8;
  --accent: #d6451b;
  --ok: #2f8f4e;
  --bad: #c0392b;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141413;
    --surface: #1f1e1c;
    --ink: #eeece6;
    --muted: #a19f97;
    --line: #34332f;
    --accent: #ff6a3d;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
}
.container { max-width: 960px; margin: 0 auto; padding: 24px 16px 48px; }
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface);
}
.topbar nav { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.brand { font-weight: 800; font-size: 20px; color: var(--ink); text-decoration: none; letter-spacing: -0.02em; }
.brand span { color: var(--accent); }
.brand.big { font-size: 40px; margin: 0; }
.muted { color: var(--muted); }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 16px 20px; margin: 16px 0;
}
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.grid .card { margin: 0; }
.stat { display: flex; flex-direction: column; }
.stat strong { font-size: 32px; }
.login { max-width: 360px; margin: 10vh auto 0; text-align: center; }
.login form { text-align: left; display: flex; flex-direction: column; gap: 12px; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
input {
  font: inherit; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--bg); color: var(--ink);
}
button {
  font: inherit; font-weight: 600; padding: 10px 14px; border-radius: 8px; border: 0;
  background: var(--accent); color: #fff; cursor: pointer;
}
button.link { background: none; color: var(--muted); padding: 0; font-weight: 400; }
.alert { background: color-mix(in srgb, var(--bad) 12%, transparent); color: var(--bad); padding: 8px 12px; border-radius: 8px; }
.status { list-style: none; padding: 0; margin: 0; }
.status li { padding: 4px 0; display: flex; align-items: center; gap: 8px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot.ok { background: var(--ok); }
.dot.bad { background: var(--bad); }
.topbar nav a { color: var(--ink); text-decoration: none; font-weight: 500; }
.topbar nav a:hover { color: var(--accent); }
a { color: var(--accent); }
h2 { font-size: 18px; margin: 0 0 12px; }
.small { font-size: 13px; }
.dot.idle { background: var(--muted); }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; align-items: end; }
.form-actions { display: flex; }
button:disabled { opacity: 0.6; cursor: default; }
button.link.danger { color: var(--bad); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; }
tr.inactive td { opacity: 0.55; }
.actions { display: flex; gap: 12px; white-space: nowrap; }
.tag { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); color: var(--muted); }
.listing-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.listing { margin: 0; padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.listing img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--bg); }
.listing-body { padding: 12px 14px 14px; }
.listing h3 { font-size: 15px; margin: 0 0 6px; line-height: 1.35; }
.listing h3 a { color: var(--ink); text-decoration: none; }
.listing h3 a:hover { color: var(--accent); }
.listing .price { font-weight: 700; margin: 0 0 4px; }
.listing p { margin: 0 0 6px; }
.listing.closed { opacity: 0.5; }

/* --- Sprint 3-4: fırsatlar, ilan detayı, analiz --- */
:root { --warn: #b7791f; --good: var(--ok); }
.good { color: var(--ok); }
.bad { color: var(--bad); }
.accent { color: var(--accent); }
a.button, button.secondary, a.button.secondary {
  display: inline-block; font: inherit; font-weight: 600; padding: 10px 14px; border-radius: 8px;
  background: var(--accent); color: #fff; text-decoration: none; border: 0; cursor: pointer; white-space: nowrap;
}
button.secondary, a.button.secondary { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.stat-link { color: inherit; text-decoration: none; }
.stat-link:hover { border-color: var(--accent); }
.stat strong.good { color: var(--ok); }
.tabs { display: flex; gap: 6px; margin: 4px 0 16px; flex-wrap: wrap; }
.tabs a { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: 14px; background: var(--surface); }
.tabs a.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.listing .thumb { position: relative; display: block; }
.badge { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; color: #fff; background: var(--muted); }
.thumb .badge { position: absolute; top: 10px; left: 10px; }
.badge.deal { background: var(--ok); }
.badge.offer { background: var(--warn); }
.badge.pass { background: #6b6a66; }
.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 6px 0 8px; }
.mini-stats dt, .deal-stats dt { font-size: 12px; color: var(--muted); }
.mini-stats dd { margin: 0; font-weight: 700; font-size: 14px; }
.deal-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 8px 0 12px; }
.deal-stats dd { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.notice { border-color: var(--accent); }
.alert.soft { background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--ink); }
.tag.warn { color: var(--warn); border-color: var(--warn); }
.tag.status-done { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 50%, transparent); }
.tag.status-review { color: var(--warn); border-color: var(--warn); }
.tag.status-error { color: var(--bad); border-color: var(--bad); }
.listing-title { font-size: 22px; line-height: 1.3; margin-bottom: 4px; overflow-wrap: anywhere; }
.card-list { list-style: none; margin: 0; padding: 0; }
.card-row { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.card-row:last-child { border-bottom: 0; }
.card-row.dup { opacity: 0.55; }
.thumbs { display: flex; gap: 4px; flex: none; }
.crop, .thumbs .ref { width: 54px; aspect-ratio: 63 / 88; border-radius: 4px; background-color: var(--bg); background-repeat: no-repeat; display: block; object-fit: cover; border: 1px solid var(--line); }
.card-info { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.card-price { font-weight: 700; white-space: nowrap; }
.links a { color: var(--accent); }
.footnote { margin: 12px 0 0; }
.photo-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.photo { display: flex; flex-direction: column; gap: 2px; text-decoration: none; }
.photo img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; background: var(--bg); }
.page-actions { margin-top: 8px; align-items: center; }
.form-grid .wide { grid-column: 1 / -1; }
input[type=file] { padding: 8px; }
@media (max-width: 520px) {
  .crop, .thumbs .ref { width: 44px; }
  .thumbs .ref { display: none; }
  .deal-stats dd { font-size: 22px; }
}
.nowrap { white-space: nowrap; }
@media (max-width: 520px) {
  .topbar { padding: 10px 12px; }
  .topbar nav { gap: 10px; }
  .topbar nav > span.muted { display: none; }
}
