/* ============================================================
   Nawigator lokali — motyw JASNY / premium real-estate
   Display: Fraunces (serif) · Body: DM Sans
   ============================================================ */
:root {
  --paper:    #f4f0e8;   /* ciepła piaskowa biel (tło) */
  --paper-2:  #fcfaf5;   /* karty */
  --paper-3:  #efe9dd;   /* delikatne wypełnienia */
  --ink:      #1f2b26;   /* atramentowa zieleń (tekst) */
  --ink-soft: #6a736c;   /* tekst drugorzędny */
  --line:     rgba(31, 43, 38, 0.11);
  --line-2:   rgba(31, 43, 38, 0.06);

  --clay:     #bf5b3a;   /* akcent (terracotta) */
  --clay-2:   #a64a2d;
  --sand:     #e8dcc6;

  --green:    #2f9e6b;
  --amber:    #d39021;
  --red:      #c2473b;

  --radius:   18px;
  --radius-sm:12px;
  --shadow:   0 1px 2px rgba(31,43,38,0.04), 0 12px 30px rgba(31,43,38,0.08);
  --shadow-lg:0 2px 6px rgba(31,43,38,0.05), 0 30px 60px rgba(31,43,38,0.12);
  font-synthesis: none;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  background:
    radial-gradient(900px 520px at 88% -8%, rgba(191,91,58,0.07), transparent 60%),
    radial-gradient(800px 600px at -5% 105%, rgba(47,158,107,0.07), transparent 55%),
    var(--paper);
  font-family: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  letter-spacing: 0.1px;
}

h1, h2, h3, .serif { font-family: "Fraunces", Georgia, "Times New Roman", serif; }

/* ---------- Header ---------- */
.topbar {
  display: flex; align-items: center; gap: 22px;
  padding: 18px 30px;
  background: rgba(252, 250, 245, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 30;
}
.brand { display: flex; align-items: center; gap: 13px; }
.brand .logo {
  width: 42px; height: 42px; border-radius: 13px;
  background: linear-gradient(140deg, var(--clay), #d77a4f);
  display: grid; place-items: center; font-weight: 800; color: #fff;
  font-family: "Fraunces", serif; font-size: 20px;
  box-shadow: 0 8px 18px rgba(191,91,58,0.35);
}
.brand h1 { font-size: 19px; margin: 0; font-weight: 600; letter-spacing: 0; }
.brand p { margin: 2px 0 0; font-size: 12px; color: var(--ink-soft); letter-spacing: 0.3px; }

.tabs { display: flex; gap: 4px; background: var(--paper-3); padding: 5px; border-radius: 13px; border: 1px solid var(--line-2); }
.tab {
  border: 0; background: transparent; color: var(--ink-soft);
  font: inherit; font-weight: 600; font-size: 13px;
  padding: 9px 17px; border-radius: 9px; cursor: pointer; transition: 0.18s;
}
.tab:hover { color: var(--ink); }
.tab.active { background: var(--ink); color: #fff; box-shadow: 0 6px 16px rgba(31,43,38,0.2); }

.spacer { flex: 1; }
.contact { font-size: 12px; color: var(--ink-soft); text-align: right; line-height: 1.5; }
.contact b { color: var(--ink); font-weight: 700; }

/* ---------- Layout ---------- */
.view { display: none; }
.view.active { display: block; animation: fade 0.4s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.client-grid {
  display: grid; grid-template-columns: 1fr 372px; gap: 24px;
  padding: 26px 30px 40px; max-width: 1520px; margin: 0 auto; align-items: start;
}
@media (max-width: 1080px) { .client-grid { grid-template-columns: 1fr; } }

/* ---------- Stage (SVG) ---------- */
.stage-wrap {
  position: relative; overflow: hidden;
  background:
    linear-gradient(180deg, #eaf1f4 0%, #e9efe7 55%, #e4ebdf 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
.stage-head { display: flex; align-items: flex-start; justify-content: space-between; padding: 22px 26px 6px; }
.stage-head h2 { margin: 0; font-size: 27px; font-weight: 600; letter-spacing: -0.3px; }
.stage-head .sub { font-size: 13px; color: var(--ink-soft); margin-top: 3px; }
.stage-head .kicker {
  font-size: 11px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--clay); margin-bottom: 4px;
}
#stage { width: 100%; height: auto; display: block; }

.hotspot { cursor: pointer; }
.hotspot polygon {
  fill: rgba(31, 43, 38, 0.05);
  stroke: rgba(31, 43, 38, 0.30);
  stroke-width: 1.2; stroke-linejoin: round;
  transition: fill 0.18s, stroke 0.18s, filter 0.18s;
}
.hotspot:hover polygon {
  stroke: #ffffff; stroke-width: 4;
  filter: brightness(1.15) saturate(1.35) drop-shadow(0 0 12px rgba(255,255,255,0.65));
}
.hotspot.is-dostepny polygon      { fill: rgba(47, 158, 107, 0.42); stroke: #1f7a51; }
.hotspot.is-zarezerwowany polygon { fill: rgba(211, 144, 33, 0.48); stroke: #9c6810; }
.hotspot.is-sprzedany polygon     { fill: rgba(194, 71, 59, 0.44);  stroke: #9c352b; }
.hotspot.is-dostepny:hover polygon      { fill: rgba(47, 158, 107, 0.66); }
.hotspot.is-zarezerwowany:hover polygon { fill: rgba(211, 144, 33, 0.70); }
.hotspot.is-sprzedany:hover polygon     { fill: rgba(194, 71, 59, 0.66); }
.hotspot.is-dimmed { opacity: 0.16; pointer-events: none; }
.hotspot.is-selected polygon { stroke: var(--ink); stroke-width: 2.6; }
.hotspot.is-selected { filter: drop-shadow(0 4px 10px rgba(31,43,38,0.35)); }

.unit-label {
  font-size: 11px; font-weight: 700; fill: #14201b; font-family: "DM Sans", sans-serif;
  paint-order: stroke; stroke: rgba(255,255,255,0.75); stroke-width: 3px;
  text-anchor: middle; pointer-events: none; user-select: none;
}
.unit-label--sm { font-size: 9px; opacity: 0.9; }

/* ---------- Tooltip ---------- */
.tooltip {
  position: fixed; z-index: 50; pointer-events: none;
  background: var(--paper-2); color: var(--ink);
  border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px;
  box-shadow: var(--shadow-lg); min-width: 190px;
  transform: translate(-50%, calc(-100% - 16px));
  opacity: 0; transition: opacity 0.12s;
}
.tooltip.show { opacity: 1; }
.tooltip .t-name { font-weight: 700; font-size: 14px; margin-bottom: 5px; }
.tooltip .t-row { display: flex; justify-content: space-between; gap: 14px; font-size: 12.5px; color: var(--ink-soft); }
.tooltip .t-row b { color: var(--ink); }
.tooltip .t-status { margin-top: 8px; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }

/* ---------- Filters ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 16px 26px 22px; border-top: 1px solid var(--line); background: rgba(252,250,245,0.5); }
.pill {
  border: 1px solid var(--line); background: var(--paper-2); color: var(--ink-soft);
  font: inherit; font-size: 12.5px; font-weight: 600; padding: 8px 14px; border-radius: 999px;
  cursor: pointer; transition: 0.16s; display: inline-flex; align-items: center; gap: 7px;
}
.pill:hover { color: var(--ink); border-color: rgba(31,43,38,0.22); }
.pill.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.pill.active .dot { box-shadow: 0 0 0 2px rgba(255,255,255,0.25); }
.filters select {
  background: var(--paper-2); border: 1px solid var(--line); color: var(--ink);
  font: inherit; font-size: 12.5px; padding: 8px 11px; border-radius: 10px; cursor: pointer;
}
.filters .f-label { font-size: 12px; color: var(--ink-soft); margin-left: 8px; font-weight: 600; }

/* ---------- Side / detail panel ---------- */
.side { display: flex; flex-direction: column; gap: 18px; }
.card { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card .card-h { padding: 18px 20px 0; }
.card .card-h h3 { margin: 0 0 2px; font-size: 17px; font-weight: 600; }
.card .card-h p { margin: 0; font-size: 12px; color: var(--ink-soft); }
.card .card-b { padding: 16px 20px 20px; }

.legend { display: grid; gap: 11px; }
.legend .li { display: flex; align-items: center; justify-content: space-between; font-size: 13.5px; }
.legend .li .l { display: flex; align-items: center; gap: 10px; color: var(--ink-soft); }
.legend .li b { font-variant-numeric: tabular-nums; font-size: 15px; }
.legend .bar { height: 7px; border-radius: 99px; background: var(--paper-3); overflow: hidden; margin-top: 4px; display: flex; }
.legend .bar i { display: block; height: 100%; }

.detail-empty { color: var(--ink-soft); font-size: 13.5px; line-height: 1.65; }
.detail .d-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.detail .d-name { font-family: "Fraunces", serif; font-size: 22px; font-weight: 600; }
.detail .d-seg { font-size: 12.5px; color: var(--ink-soft); margin-top: 2px; }
.badge { font-size: 11px; font-weight: 800; padding: 6px 11px; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.badge.dostepny      { background: rgba(47,158,107,0.14); color: #1f7a51; }
.badge.zarezerwowany { background: rgba(211,144,33,0.16); color: #9c6810; }
.badge.sprzedany     { background: rgba(194,71,59,0.14); color: #9c352b; }

.spec { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 18px 0; }
.spec .s { background: var(--paper-3); border: 1px solid var(--line-2); border-radius: 13px; padding: 12px 13px; }
.spec .s .k { font-size: 11px; color: var(--ink-soft); font-weight: 600; }
.spec .s .v { font-size: 16px; font-weight: 700; margin-top: 3px; }
.price { font-family: "Fraunces", serif; font-size: 28px; font-weight: 600; letter-spacing: -0.5px; }
.price small { font-family: "DM Sans", sans-serif; font-size: 12px; font-weight: 500; color: var(--ink-soft); display: block; margin-top: 2px; }

.btn { border: 0; border-radius: 13px; font: inherit; font-weight: 700; font-size: 13.5px; padding: 13px 16px; cursor: pointer; transition: 0.16s; width: 100%; }
.btn.primary { background: linear-gradient(135deg, var(--clay), #d77a4f); color: #fff; box-shadow: 0 10px 22px rgba(191,91,58,0.3); }
.btn.primary:hover { filter: brightness(1.05); transform: translateY(-1px); }
.btn.ghost { background: var(--paper-2); color: var(--ink); border: 1px solid var(--line); }
.btn.ghost:hover { border-color: rgba(31,43,38,0.25); background: var(--paper-3); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; filter: grayscale(0.4); box-shadow: none; }

/* ---------- Admin ---------- */
.admin-wrap { max-width: 1240px; margin: 0 auto; padding: 28px 30px 50px; }
.admin-head { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.admin-head h2 { margin: 0; font-size: 26px; font-weight: 600; }
.admin-note { font-size: 12.5px; color: #1f7a51; background: rgba(47,158,107,0.10); border: 1px solid rgba(47,158,107,0.28); padding: 10px 14px; border-radius: 11px; }
.stat-row { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.stat { flex: 1; min-width: 160px; background: var(--paper-2); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; box-shadow: var(--shadow); }
.stat .n { font-family: "Fraunces", serif; font-size: 32px; font-weight: 600; line-height: 1; }
.stat .t { font-size: 12.5px; color: var(--ink-soft); display: flex; align-items: center; gap: 7px; margin-top: 8px; }

.table-card { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
table.units { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.units th, table.units td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--line-2); }
table.units th { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.7px; color: var(--ink-soft); background: var(--paper-3); font-weight: 700; }
table.units tr:last-child td { border-bottom: 0; }
table.units tbody tr:hover td { background: rgba(31,43,38,0.025); }
table.units td.num { font-variant-numeric: tabular-nums; }
.seg-tag { font-weight: 700; }
.statusSelect { font: inherit; font-size: 12.5px; font-weight: 700; padding: 8px 11px; border-radius: 10px; border: 1px solid var(--line); background: var(--paper-2); color: var(--ink); cursor: pointer; transition: 0.15s; }
.statusSelect.dostepny      { color: #1f7a51; border-color: rgba(47,158,107,0.4); background: rgba(47,158,107,0.07); }
.statusSelect.zarezerwowany { color: #9c6810; border-color: rgba(211,144,33,0.4); background: rgba(211,144,33,0.08); }
.statusSelect.sprzedany     { color: #9c352b; border-color: rgba(194,71,59,0.4); background: rgba(194,71,59,0.07); }

/* ---------- Lista mieszkań (oferta) ---------- */
.offer-wrap { max-width: 1520px; margin: 0 auto; padding: 6px 30px 36px; }
.offer-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 14px; }
.offer-head h2 { margin: 2px 0 0; font-size: 24px; font-weight: 600; }
.offer-cols { display: grid; grid-template-columns: 2fr 0.9fr 1.1fr 1fr 200px; gap: 16px; padding: 0 18px 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--ink-soft); font-weight: 700; }
.offer-table { display: flex; flex-direction: column; gap: 10px; }
.offer-row { display: grid; grid-template-columns: 2fr 0.9fr 1.1fr 1fr 200px; gap: 16px; align-items: center; background: var(--paper-2); border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px; box-shadow: var(--shadow); cursor: pointer; transition: border-color .15s, transform .15s, box-shadow .15s; }
.offer-row:hover { border-color: var(--ink); transform: translateY(-1px); }
.offer-row.is-selected { border-color: var(--clay); box-shadow: 0 0 0 2px rgba(191,91,58,.25), var(--shadow); }
.o-name { font-weight: 700; font-size: 14.5px; }
.o-name .o-sub { display: block; font-size: 12px; color: var(--ink-soft); font-weight: 500; margin-top: 3px; }
.o-area { font-variant-numeric: tabular-nums; font-weight: 600; }
.o-price { font-weight: 700; font-variant-numeric: tabular-nums; }
.o-price .o-ppm { display: block; font-size: 12px; color: var(--ink-soft); font-weight: 500; margin-top: 2px; }
.o-status { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.btn.small { width: auto; padding: 10px 14px; font-size: 12.5px; }
@media (max-width: 900px) {
  .offer-cols { display: none; }
  .offer-row { grid-template-columns: 1fr 1fr; gap: 10px 16px; }
  .offer-row .o-cta { grid-column: 1 / -1; }
  .btn.small { width: 100%; }
}

.footer { text-align: center; color: var(--ink-soft); font-size: 12.5px; padding: 26px; border-top: 1px solid var(--line); }
.footer b { color: var(--ink); }

.flash { animation: flash 1s ease; }
@keyframes flash { 0% { background: rgba(191,91,58,0.22) !important; } 100% { background: transparent; } }

/* ---------- Polish: live indicator, paski postępu, toolbar ---------- */
.stage-wrap::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  box-shadow: inset 0 0 140px rgba(31,43,38,0.07); border-radius: var(--radius);
}

.live { display: inline-flex; align-items: center; gap: 9px; font-size: 12.5px; color: var(--ink-soft); font-weight: 600; }
.live .pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--green); position: relative; }
.live .pulse::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--green); animation: pulse 1.8s ease-out infinite; }
@keyframes pulse { 0% { transform: scale(.6); opacity: .8; } 100% { transform: scale(2); opacity: 0; } }

.progress { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: var(--paper-3); box-shadow: inset 0 1px 2px rgba(31,43,38,0.06); }
.progress i { height: 100%; transition: width .6s cubic-bezier(.22,1,.36,1); }
.progress i:first-child { border-radius: 99px 0 0 99px; }
.progress i:last-child  { border-radius: 0 99px 99px 0; }
.progress-legend { display: flex; gap: 16px; margin-top: 11px; font-size: 12px; color: var(--ink-soft); flex-wrap: wrap; }
.progress-legend span { display: inline-flex; align-items: center; gap: 7px; }
.progress-legend b { color: var(--ink); }

.avail-cap { font-size: 12px; color: var(--ink-soft); margin: 12px 0 4px; display: flex; justify-content: space-between; }
.avail-cap b { color: var(--ink); font-weight: 700; }

.sales-card { background: var(--paper-2); border: 1px solid var(--line); border-radius: 16px; padding: 18px 22px; box-shadow: var(--shadow); margin-bottom: 22px; }
.sales-card .top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 13px; }
.sales-card .top h3 { margin: 0; font-size: 17px; font-weight: 600; }
.sales-card .top .pct { font-family: "Fraunces", serif; font-size: 24px; font-weight: 600; }

.admin-note-bar { font-size: 12.5px; color: #1f7a51; background: rgba(47,158,107,0.09); border: 1px solid rgba(47,158,107,0.25); padding: 11px 15px; border-radius: 12px; margin-bottom: 22px; display: flex; align-items: center; gap: 9px; }

.toolbar { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.search { flex: 1; min-width: 220px; display: flex; align-items: center; gap: 9px; background: var(--paper-3); border: 1px solid var(--line); border-radius: 11px; padding: 10px 13px; transition: .16s; }
.search:focus-within { border-color: var(--clay); background: var(--paper-2); }
.search input { border: 0; background: transparent; font: inherit; font-size: 13px; color: var(--ink); width: 100%; outline: none; }
.tb-count { font-size: 12.5px; color: var(--ink-soft); white-space: nowrap; }

.table-scroll { max-height: 62vh; overflow: auto; }
table.units thead th { position: sticky; top: 0; z-index: 2; }

.stat, .sales-card { transition: box-shadow .2s, transform .2s; }
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.empty-ico { width: 40px; height: 40px; margin-bottom: 12px; opacity: .5; }

button:focus-visible, select:focus-visible, input:focus-visible { outline: 2px solid var(--clay); outline-offset: 2px; }
.hotspot:focus-visible polygon { stroke: var(--ink); stroke-width: 2.6; }

::selection { background: rgba(191,91,58,0.18); }
