/* ==========================================================================
   Monitor rynku nieruchomości — warstwa wizualna
   --------------------------------------------------------------------------
   Założenie: to nie jest panel administracyjny, tylko narzędzie do czytania
   ofert. Stąd górna nawigacja zamiast ciemnego paska z boku, dużo światła
   i typografia, w której cena jest pierwszą rzeczą, jaką widać.
   ========================================================================== */

:root {
  /* Zieleń zamiast korporacyjnego błękitu — kolor się nie kojarzy z panelem
     administracyjnym, a przy okazji zostawia błękit na linki. */
  --brand:        #15654a;
  --brand-soft:   #e7f2ec;
  --brand-ink:    #0d4433;

  --bg:           #f7f6f3;   /* ciepła biel, nie zimny szary */
  --surface:      #ffffff;
  --surface-alt:  #fbfaf8;
  --line:         #e4e1da;
  --line-strong:  #cfcabf;

  --ink:          #1b1a17;
  --ink-soft:     #5c574e;
  --ink-faint:    #8b857a;

  --link:         #1d4ed8;
  --ok:           #15654a;
  --warn:         #a8630a;
  --alert:        #b3261e;
  --auction:      #5b3fa8;

  --radius:       12px;
  --radius-sm:    8px;
  --shadow:       0 1px 2px rgba(27,26,23,.05), 0 2px 10px rgba(27,26,23,.04);
  --shadow-lift:  0 2px 6px rgba(27,26,23,.07), 0 10px 28px rgba(27,26,23,.07);

  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 650; letter-spacing: -.01em; }

/* ----------------------------------------------------------- nawigacja --- */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar__inner {
  max-width: 1360px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; gap: 22px; min-height: 60px;
}
.brand {
  display: flex; align-items: baseline; gap: 9px;
  font-size: 19px; font-weight: 700; color: var(--ink); letter-spacing: -.02em;
  white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand__mark {
  width: 11px; height: 11px; border-radius: 3px; background: var(--brand);
  display: inline-block; transform: rotate(45deg);
}
.brand__where { font-size: 12.5px; font-weight: 500; color: var(--ink-faint); }

.mainnav { display: flex; gap: 2px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.mainnav::-webkit-scrollbar { display: none; }
.mainnav a {
  padding: 8px 13px; border-radius: var(--radius-sm); color: var(--ink-soft);
  font-size: 14.5px; font-weight: 500; white-space: nowrap;
}
.mainnav a:hover { background: var(--surface-alt); color: var(--ink); text-decoration: none; }
.mainnav a.is-active { background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }

.topbar__meta { margin-left: auto; font-size: 13px; color: var(--ink-faint); white-space: nowrap; }

.burger {
  display: none; background: none; border: 1px solid var(--line);
  border-radius: var(--radius-sm); width: 38px; height: 38px; font-size: 17px;
  cursor: pointer; color: var(--ink);
}

/* -------------------------------------------------------------- układ --- */
.page { max-width: 1360px; margin: 0 auto; padding: 22px 20px 72px; }
.page__head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.page__head h1 { font-size: 24px; }
.page__count { color: var(--ink-faint); font-size: 14.5px; }
.page__actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.card--pad { padding: 18px 20px; }
.card + .card { margin-top: 14px; }

/* --------------------------------------------------------------- liczby --- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(178px, 1fr)); gap: 12px; }
.stat {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 15px 17px; box-shadow: var(--shadow);
}
.stat__label {
  font-size: 12px; font-weight: 600; color: var(--ink-faint);
  text-transform: uppercase; letter-spacing: .06em;
}
.stat__value { font-size: 27px; font-weight: 680; margin-top: 5px; letter-spacing: -.02em; }
.stat__hint { font-size: 13px; color: var(--ink-faint); margin-top: 2px; }

/* -------------------------------------------------------------- filtry --- */
.filters { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
           padding: 16px 18px; box-shadow: var(--shadow); }
.filters__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); gap: 12px 14px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
.field input, .field select {
  width: 100%; padding: 9px 11px; font-size: 14.5px; font-family: inherit;
  color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
}
.field input::placeholder { color: var(--ink-faint); }
.field input:focus, .field select:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft);
}
.field__pair { display: flex; gap: 7px; }
.filters__actions { display: flex; align-items: center; gap: 9px; margin-top: 14px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 17px; font-size: 14.5px; font-weight: 600; font-family: inherit;
  border-radius: var(--radius-sm); border: 1px solid var(--brand);
  background: var(--brand); color: #fff; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--brand-ink); border-color: var(--brand-ink); text-decoration: none; }
.btn--ghost { background: var(--surface); color: var(--brand-ink); }
.btn--ghost:hover { background: var(--brand-soft); }
.btn--quiet { background: var(--surface); color: var(--ink-soft); border-color: var(--line-strong); }
.btn--quiet:hover { background: var(--surface-alt); color: var(--ink); border-color: var(--line-strong); }
.btn--sm { padding: 6px 12px; font-size: 13.5px; }

.toggle {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: var(--surface); font-size: 13.5px; color: var(--ink-soft); user-select: none;
}
.toggle:hover { border-color: var(--ink-faint); }
.toggle.is-on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }

/* -------------------------------------------------------------- oferta --- */
.offer {
  display: grid; grid-template-columns: 196px minmax(0, 1fr) 208px; gap: 18px;
  background: var(--surface); border: 1px solid var(--line);
  border-left: 3px solid var(--line-strong);
  border-radius: var(--radius); padding: 15px; margin-bottom: 13px;
  box-shadow: var(--shadow); transition: box-shadow .14s ease, border-color .14s ease;
}
.offer:hover { box-shadow: var(--shadow-lift); }
.offer--fresh { border-left-color: var(--ok); }
.offer--copy { border-left-color: var(--line-strong); background: var(--surface-alt); }
.offer--auction { border-left-color: var(--auction); }
.offer--tender { border-left-color: var(--warn); }

.offer__media { min-width: 0; }
.offer__photo {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover;
  border-radius: var(--radius-sm); background: var(--surface-alt); display: block;
}
.offer__photo--empty {
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-faint); font-size: 12.5px; border: 1px dashed var(--line-strong);
}
.offer__age { margin-top: 7px; font-size: 12.5px; color: var(--ink-faint); text-align: center; }

.offer__body { min-width: 0; }
.offer__title { font-size: 16.5px; margin-bottom: 4px; }
.offer__title a { color: var(--ink); }
.offer__title a:hover { color: var(--brand-ink); }
.offer__out { color: var(--ink-faint); font-size: 14px; margin-left: 4px; }

.offer__where { font-size: 14px; color: var(--ink-soft); margin-bottom: 9px; }
.offer__where strong { color: var(--ink); font-weight: 600; }

.offer__price { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.offer__amount { font-size: 23px; font-weight: 700; letter-spacing: -.025em; }
.offer__perm2 { font-size: 14px; color: var(--ink-soft); }
.offer__was { font-size: 13.5px; color: var(--ink-faint); text-decoration: line-through; }

.specs { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 9px; }
.spec {
  font-size: 13.5px; color: var(--ink-soft); background: var(--surface-alt);
  border: 1px solid var(--line); border-radius: 6px; padding: 3px 9px;
}
.spec strong { color: var(--ink); font-weight: 600; }

.offer__excerpt {
  font-size: 14px; color: var(--ink-soft); display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.offer__seller { font-size: 13px; color: var(--ink-faint); margin-top: 6px; }

.offer__aside { display: flex; flex-direction: column; gap: 8px; }

/* Kontakt: numer plus skąd pochodzi. Bez tej etykiety podsuwalibyśmy numer
   centrali biura, sugerując, że stoi w ogłoszeniu. */
.contact { border: 1px solid var(--line-strong); border-radius: var(--radius-sm); overflow: hidden; }
.contact__number {
  display: block; width: 100%; padding: 9px 10px; border: 0; background: var(--surface-alt);
  font-family: var(--mono); font-size: 15.5px; font-weight: 600; color: var(--ink);
  text-align: center; cursor: pointer;
}
.contact__number:hover { background: var(--brand-soft); }
.contact__number.is-open { background: var(--brand-soft); color: var(--brand-ink); }
.contact__origin {
  display: block; padding: 4px 8px; font-size: 11.5px; text-align: center;
  color: var(--ink-faint); background: var(--surface); border-top: 1px solid var(--line);
}
.contact--none { padding: 9px; text-align: center; font-size: 13px; color: var(--ink-faint);
                 border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); }
.offer__added { font-size: 12px; color: var(--ink-faint); text-align: center; margin-top: 2px; }

/* --------------------------------------------------------------- znaczniki --- */
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.tag {
  font-size: 11.5px; font-weight: 650; padding: 3px 9px; border-radius: 5px;
  border: 1px solid transparent; letter-spacing: .01em; white-space: nowrap;
}
.tag--original { background: var(--brand-soft); color: var(--brand-ink); border-color: #c4e0d2; }
.tag--copy     { background: #f1efeb; color: var(--ink-faint); border-color: var(--line); }
.tag--agent    { background: #edeaf7; color: #4a3490; border-color: #d9d2ef; }
.tag--private  { background: #e8f1fd; color: #1c4f9c; border-color: #cfe0f7; }
.tag--dev      { background: #fdf0e6; color: #8f4c11; border-color: #f5ddc6; }
.tag--auction  { background: #efeafa; color: var(--auction); border-color: #ddd3f5; }
.tag--tender   { background: #fdf3e2; color: var(--warn); border-color: #f2e0bd; }
.tag--source   { background: var(--surface); color: var(--ink-faint); border-color: var(--line-strong); }
.tag--new      { background: var(--ok); color: #fff; }
.tag--drop     { background: #fdeceb; color: var(--alert); border-color: #f6cfcc; }
.tag--gone     { background: #f1efeb; color: var(--alert); border-color: #f0d3d1; }
.tag--age      { background: var(--surface); color: var(--ink-faint); border-color: var(--line); }

/* --------------------------------------------------------------- tabela --- */
.table { width: 100%; border-collapse: collapse; background: var(--surface);
         border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.table th, .table td { padding: 11px 13px; text-align: left; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.table th { background: var(--surface-alt); font-size: 12px; font-weight: 650;
            text-transform: uppercase; letter-spacing: .05em; color: var(--ink-faint); }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-alt); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; }
.dot--ok { background: var(--ok); } .dot--warn { background: var(--warn); }
.dot--err { background: var(--alert); } .dot--off { background: var(--line-strong); }

/* --------------------------------------------------------------- reszta --- */
.pager { display: flex; gap: 6px; justify-content: center; margin: 26px 0; flex-wrap: wrap; }
.pager a, .pager span {
  min-width: 40px; text-align: center; padding: 8px 13px; font-size: 14.5px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink-soft);
}
.pager a:hover { border-color: var(--brand); color: var(--brand-ink); text-decoration: none; }
.pager .is-current { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }

.empty { text-align: center; padding: 56px 24px; color: var(--ink-soft);
         background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.empty strong { display: block; font-size: 17px; color: var(--ink); margin-bottom: 6px; }

.note { border-radius: var(--radius); padding: 13px 16px; font-size: 14.5px; margin-bottom: 16px;
        background: var(--brand-soft); border: 1px solid #c4e0d2; color: var(--brand-ink); }
.note--plain { background: var(--surface-alt); border-color: var(--line); color: var(--ink-soft); }
.note code { font-family: var(--mono); font-size: 13px; background: rgba(0,0,0,.05);
             padding: 1px 5px; border-radius: 4px; }

.section-title { font-size: 15px; font-weight: 650; margin: 26px 0 11px; color: var(--ink); }
.muted { color: var(--ink-faint); }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }

.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ---------------------------------------------------------- responsywność --- */
@media (max-width: 1080px) {
  .offer { grid-template-columns: 150px minmax(0, 1fr); }
  .offer__aside { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .offer__aside > * { flex: 1 1 150px; }
  .cols-2 { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  body { font-size: 15.5px; }
  .page { padding: 16px 14px 56px; }
  .topbar__inner { padding: 0 14px; gap: 12px; }
  .mainnav {
    position: fixed; inset: 60px 0 auto 0; flex-direction: column; gap: 0;
    background: var(--surface); border-bottom: 1px solid var(--line);
    padding: 8px 14px 14px; display: none; box-shadow: var(--shadow-lift);
  }
  .mainnav.is-open { display: flex; }
  .mainnav a { padding: 11px 12px; font-size: 16px; }
  .burger { display: inline-flex; align-items: center; justify-content: center; }
  .topbar__meta { display: none; }
  .offer { grid-template-columns: 1fr; }
  .offer__photo { max-height: 210px; }
  .offer__amount { font-size: 21px; }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161a; --surface: #1c1f25; --surface-alt: #22262d;
    --line: #2e333c; --line-strong: #3d434e;
    --ink: #e8e6e1; --ink-soft: #a9a59c; --ink-faint: #7d7a72;
    --brand: #3f9b78; --brand-soft: #1b2d27; --brand-ink: #8fd4b6;
    --link: #7aa7ff;
    --shadow: 0 1px 2px rgba(0,0,0,.35); --shadow-lift: 0 4px 20px rgba(0,0,0,.45);
  }
  .tag--agent   { background: #272138; color: #b9a8f0; border-color: #3a3054; }
  .tag--private { background: #1a2433; color: #8cb6f0; border-color: #2a3away; }
  .tag--private { background: #1a2433; color: #8cb6f0; border-color: #2a3a52; }
  .tag--dev     { background: #2e2318; color: #e0a86a; border-color: #45341f; }
  .tag--drop    { background: #2e1b1a; color: #f0938c; border-color: #472625; }
  .tag--gone    { background: #2a2422; color: #f0938c; border-color: #43302e; }
  .note code { background: rgba(255,255,255,.08); }
}
