/* QuickFind.co.ke — mobile-first, low-data */
:root {
  --green: #0f7b5f;
  --green-dark: #0a5c47;
  --ink: #16211d;
  --muted: #5d6b66;
  --line: #e2e8e5;
  --bg: #f7faf9;
  --amber: #b45309;
  --amber-bg: #fef3c7;
  --radius: 12px;
  --sidebar-w: 220px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink); background: var(--bg); line-height: 1.5; font-size: 16px;
}
a { color: var(--green); }
.hidden { display: none !important; }

/* ── Shared container ────────────────────────────────────────── */
.container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }

/* ── Sidebar (hidden on mobile) ──────────────────────────────── */
.sidebar { display: none; }

/* ── Topbar ───────────────────────────────────────────────────── */
.topbar { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar-inner { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 58px; }
.brand { font-weight: 800; font-size: 1.25rem; text-decoration: none; color: var(--ink); white-space: nowrap; }
.brand-sub { color: var(--green); }
.nav { display: flex; gap: 2px; align-items: center; flex-wrap: wrap; }
.nav-link {
  text-decoration: none; color: var(--ink); font-weight: 600; font-size: .95rem;
  padding: 8px 10px; border-radius: 8px; background: none; border: 0; font-family: inherit; cursor: pointer;
}
.nav-link:hover { background: var(--bg); }
.nav-link.is-active { color: var(--green-dark); background: #eef7f3; }
.nav-form { display: inline-flex; margin: 0; }
.nav .btn { margin-left: 6px; }

/* ── Alerts / messages ───────────────────────────────────────── */
.messages { margin: 10px 0 0; padding: 0; }
.alert { padding: 10px 14px; border-radius: 10px; margin-bottom: 8px; font-weight: 600; font-size: .95rem; }
.alert-success { background: #d1fae5; color: #065f46; }
.alert-error { background: #fee2e2; color: #b91c1c; }
.alert-warning { background: var(--amber-bg); color: var(--amber); }

/* ── Hero ─────────────────────────────────────────────────────── */
.hero { padding: 26px 0 6px; }
.hero .container { max-width: 1080px; }
.hero form { max-width: 720px; }
.hero h1 { margin: 0 0 6px; font-size: 1.7rem; line-height: 1.2; }
.hero h1 em { color: var(--green); font-style: normal; }
.hero-sub { color: var(--muted); margin: 0 0 16px; }
.search-bar { display: flex; gap: 8px; }
.search-bar input {
  flex: 1; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius);
  font-size: 16px; background: #fff;
}
.filters { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.filters select {
  padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; font-size: 14px; color: var(--ink); flex: 1; min-width: 120px;
}

/* ── Results feed ─────────────────────────────────────────────── */
.feed { padding: 20px 0 8px; }
.section-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  flex-wrap: wrap; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line);
}
.section-head h2 { margin: 0; font-size: 1.1rem; letter-spacing: -.01em; }
.section-meta { display: flex; gap: 12px; align-items: baseline; }
.section-meta .note { margin: 0; }

/* Card grid — mobile: 1-col, tablet: 2-col, desktop: 3-col */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 16px;
}
.grid .card { display: flex; flex-direction: column; }
.grid .card-body { display: flex; flex-direction: column; flex: 1; }
.grid .card-title {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; margin-bottom: 6px;
}
.grid .badges { margin-top: auto; padding-top: 8px; }
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; text-decoration: none; color: var(--ink); display: block;
  transition: border-color .15s, box-shadow .15s;
}
.card:hover { border-color: var(--green); box-shadow: 0 4px 16px rgba(15,123,95,.1); }
.thumb { position: relative; aspect-ratio: 16/10; background: #0e1513; }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .play {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 2rem; text-shadow: 0 2px 8px rgba(0,0,0,.6); pointer-events: none;
}
.thumb-empty {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #8ea3a0; font-size: .82rem; font-weight: 600; letter-spacing: .02em;
}
.card-body { padding: 10px 12px 12px; }
.price { font-weight: 800; font-size: 1.1rem; color: var(--green-dark); }
.price small { font-weight: 500; color: var(--muted); }
.card-title { font-weight: 600; margin: 2px 0; font-size: .98rem; }
.card-meta { color: var(--muted); font-size: .87rem; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.badge { font-size: .74rem; padding: 2px 8px; border-radius: 999px; font-weight: 700; }
.badge-verified { background: #d1fae5; color: #065f46; }
.badge-role { background: #eef2ff; color: #3730a3; }
.badge-warn { background: var(--amber-bg); color: var(--amber); }
.badge-live { background: #d1fae5; color: #065f46; }

.empty { grid-column: 1/-1; text-align: center; color: var(--muted); padding: 40px 10px; }

/* ── Empty state ──────────────────────────────────────────────── */
.empty-card {
  border: 1.5px dashed var(--line); border-radius: var(--radius); background: #fff;
  padding: 28px 20px; text-align: center; max-width: 560px; margin: 8px auto 0;
}
.empty-card h3 { margin: 0 0 8px; font-size: 1.15rem; }
.empty-card .note { margin: 0 auto 16px; max-width: 44ch; }
.empty-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ── Cross-link promo strip ───────────────────────────────────── */
.promo { padding: 10px 0 44px; }
.promo-strip {
  display: flex; gap: 16px; align-items: center; justify-content: space-between;
  flex-wrap: wrap; padding: 14px 16px; border: 1px solid var(--line);
  border-radius: var(--radius); background: #fff;
}
.promo-strip strong { font-size: .98rem; }
.promo-strip .note { margin: 2px 0 0; }
.promo-strip .btn { flex: 0 0 auto; }

/* ── Detail and panel pages ───────────────────────────────────── */
.detail, .panel-page, .verify-box {
  max-width: 1080px; margin: 0 auto; padding: 22px 16px 50px;
}
.detail > *, .panel-page > * { max-width: 760px; }
.verify-box > * { max-width: 620px; }
.panel-page h3 { margin: 26px 0 10px; font-size: 1.05rem; }
.panel-page > h2 { margin-top: 0; }
.detail h1 { font-size: 1.35rem; margin: 8px 0 4px; }
.video-box { background: #000; border-radius: var(--radius); overflow: hidden; margin-bottom: 10px; }
.video-box video { width: 100%; max-height: 60vh; display: block; background: #000; }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; margin: 14px 0; }
.kv div { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.kv dt { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.kv dd { margin: 2px 0 0; font-weight: 700; }
.movein { background: var(--amber-bg); border: 1px solid #fcd34d; border-radius: var(--radius); padding: 12px 14px; margin: 12px 0; }
.movein strong { color: var(--amber); }
.poster-line { display: flex; align-items: center; gap: 8px; margin: 10px 0; font-weight: 600; flex-wrap: wrap; }
.desc { white-space: pre-wrap; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.contact-row { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.contact-row .btn { flex: 1; min-width: 140px; text-align: center; }

/* ── Buttons ──────────────────────────────────────────────────── */
.btn {
  display: inline-block; padding: 12px 18px; border-radius: var(--radius); border: 0;
  font-size: 1rem; font-weight: 700; cursor: pointer; text-decoration: none; text-align: center;
}
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-dark); }
.btn-primary:disabled { opacity: .6; }
.btn-secondary { background: #fff; color: var(--green-dark); border: 1.5px solid var(--green); }
.btn-sm { padding: 8px 14px; font-size: .9rem; }
.btn-block { width: 100%; }
.btn-danger { background: #fff; color: #b91c1c; border: 1.5px solid #fca5a5; }

/* ── Forms ────────────────────────────────────────────────────── */
.form { padding: 16px; }
.form label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 12px; }
.form input, .form select, .form textarea {
  width: 100%; padding: 11px 12px; margin-top: 5px; font-size: 16px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; font-family: inherit;
}
.form .row { display: flex; gap: 12px; }
.form .row label { flex: 1; }
.check { display: flex !important; gap: 10px; align-items: flex-start; font-weight: 500 !important; }
.check input { width: auto !important; margin-top: 3px; }
.videos { border: 1.5px dashed var(--line); border-radius: var(--radius); padding: 12px; margin-bottom: 14px; }
.videos legend { font-weight: 700; padding: 0 6px; font-size: .95rem; }
.hint { font-weight: 400; color: var(--muted); font-size: .84rem; }
.warn { color: var(--amber); background: var(--amber-bg); padding: 8px 10px; border-radius: 8px; font-size: .9rem; }
.note { color: var(--muted); font-size: .9rem; }
.post-intro h2 { margin-bottom: 4px; }

.errorlist { list-style: none; padding: 0; margin: 4px 0 0; color: #b91c1c; font-size: .85rem; font-weight: 600; }

/* ── Manage ───────────────────────────────────────────────────── */
.manage-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.manage-actions form { display: inline; }
.manage-actions .btn { min-width: 130px; }

/* ── Errands ──────────────────────────────────────────────────── */
.errand-card { padding: 14px; }
.errand-bio { margin: 8px 0 0; }
.errand-head { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; }
.errand-avatar {
  flex: 0 0 auto; width: 42px; height: 42px; border-radius: 999px;
  background: #d1fae5; color: #065f46; display: flex; align-items: center;
  justify-content: center; font-weight: 800; font-size: 1.15rem;
}
.errand-avatar-lg { width: 56px; height: 56px; font-size: 1.5rem; }

/* ── Verify / auth ────────────────────────────────────────────── */
.status-pill { display: inline-block; padding: 6px 14px; border-radius: 999px; font-weight: 800; font-size: .9rem; }
.pill-verified { background: #d1fae5; color: #065f46; }
.pill-pending { background: var(--amber-bg); color: var(--amber); }
.pill-unverified { background: #fee2e2; color: #b91c1c; }

/* ── Footer ───────────────────────────────────────────────────── */
.footer { border-top: 1px solid var(--line); background: #fff; padding: 22px 0 26px; }
.footer-inner {
  display: flex; gap: 12px 24px; align-items: center; justify-content: space-between; flex-wrap: wrap;
}
.footer-links { display: flex; gap: 6px 18px; flex-wrap: wrap; }
.footer-links a { color: var(--muted); text-decoration: none; font-size: .9rem; font-weight: 600; }
.footer-links a:hover { color: var(--green-dark); }
.footer-note {
  margin: 14px auto 0; color: var(--muted); font-size: .82rem; line-height: 1.45;
  max-width: 560px; text-align: center; padding: 0 16px;
}

/* ── Offline page ─────────────────────────────────────────────── */
.offline-page {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 60dvh; text-align: center; padding: 40px 20px; gap: 12px;
}
.offline-page h1 { font-size: 1.5rem; margin: 0 0 8px; }

/* ════════════════════════════════════════════════════════════════
   RESPONSIVE — small screens (≤ 560px)
   ════════════════════════════════════════════════════════════════ */
@media (max-width: 560px) {
  .form .row { flex-direction: column; gap: 0; }
  .kv { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.45rem; }
  .manage-actions { flex-direction: column; }
  .promo-strip .btn { width: 100%; }
  .topbar-inner { min-height: auto; padding: 8px 0; flex-wrap: wrap; }
  .nav { width: 100%; justify-content: flex-start; gap: 4px; }
  .nav-link { padding: 8px 8px; font-size: .9rem; }
  .nav .btn { margin-left: auto; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .empty-actions { flex-direction: column; }
  .empty-actions .btn { width: 100%; }
}

/* ════════════════════════════════════════════════════════════════
   RESPONSIVE — large screens (≥ 900px): sidebar layout
   ════════════════════════════════════════════════════════════════ */
@media (min-width: 900px) {
  /* Body becomes a flex row: sidebar | page-body */
  body {
    display: flex;
    min-height: 100dvh;
  }

  /* ── Sidebar ─────────────────────────── */
  .sidebar {
    display: flex;
    flex-direction: column;
    width: var(--sidebar-w);
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100dvh;
    overflow-y: auto;
    background: #fff;
    border-right: 1px solid var(--line);
    padding: 18px 12px 20px;
    gap: 2px;
    scrollbar-width: thin;
    scrollbar-color: var(--line) transparent;
  }

  .sidebar-brand {
    display: block;
    font-weight: 800;
    font-size: 1.15rem;
    text-decoration: none;
    color: var(--ink);
    white-space: nowrap;
    padding: 4px 8px 16px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 10px;
  }
  .sidebar-brand .brand-sub { color: var(--green); }

  .sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
  }

  .sidebar-link {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--ink);
    font-weight: 600;
    font-size: .93rem;
    padding: 10px 10px;
    border-radius: 8px;
    background: none;
    border: 0;
    font-family: inherit;
    cursor: pointer;
    width: 100%;
    text-align: left;
    transition: background .12s;
  }
  .sidebar-link:hover { background: var(--bg); }
  .sidebar-link.is-active { color: var(--green-dark); background: #eef7f3; }

  .sidebar-form { display: contents; }

  .sidebar-divider {
    height: 1px;
    background: var(--line);
    margin: 8px 0;
  }

  .sidebar-cta {
    margin-top: 10px;
    text-align: center;
  }

  .sidebar-footer-note {
    margin-top: auto;
    padding-top: 16px;
    font-size: .78rem;
    color: var(--muted);
    line-height: 1.4;
    border-top: 1px solid var(--line);
  }

  /* ── Page body (everything right of sidebar) ── */
  .page-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 100dvh;
  }

  /* Main expands to push footer down */
  #app { flex: 1; }

  /* Topbar: hidden on desktop — sidebar handles nav */
  .topbar { display: none; }

  /* ── Hero: 2-column on desktop ────────── */
  .hero { padding: 36px 0 10px; }
  .hero .container {
    display: flex;
    align-items: flex-start;
    gap: 48px;
  }
  .hero-text { flex: 1 1 0; }
  .hero h1 { font-size: clamp(1.8rem, 2.5vw, 2.4rem); margin-bottom: 10px; }
  .hero form { flex: 1 1 0; max-width: none; margin-top: 6px; }
  .hero-sub { margin-bottom: 20px; }

  /* ── Card grid: 3-col minimum ─────────── */
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  }

  /* Detail / panel pages get a bit more breathing room */
  .detail, .panel-page, .verify-box {
    padding: 30px 24px 60px;
  }

  /* Footer brand hidden (in sidebar) */
  .footer-inner > .brand { display: none; }
}

/* ════════════════════════════════════════════════════════════════
   RESPONSIVE — extra-wide (≥ 1280px): 4-col grid
   ════════════════════════════════════════════════════════════════ */
@media (min-width: 1280px) {
  :root { --sidebar-w: 240px; }

  .grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }

  .hero h1 { font-size: 2.6rem; }
}
