/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #f6f5f3;
  color: #1c1917;
  font-size: 14px;
  line-height: 1.5;
}
a { color: #c2410c; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== NAVBAR ===== */
nav {
  background: #1e2d1e;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  height: 52px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.nav-brand { font-size: 15px; font-weight: 700; color: #a3d9a5; letter-spacing: -.2px; }
.nav-brand span { color: #5a8a5c; font-weight: 400; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  color: #c4dfc5;
  padding: 6px 13px;
  border-radius: 6px;
  font-size: 13px;
  transition: background .14s;
}
.nav-links a:hover { background: #2a3f2a; color: #e8f5e8; text-decoration: none; }
.nav-links a.active { background: #2a3f2a; color: #a3d9a5; }
.nav-links .btn-logout { color: #7a9e7b; margin-left: 6px; }

/* ===== LAYOUT ===== */
main { max-width: 1380px; margin: 0 auto; padding: 22px 20px 40px; }

/* ===== STATUS BAR ===== */
.status-bar {
  background: #fff;
  border: 1px solid #e5e2df;
  border-radius: 8px;
  padding: 9px 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #78716c;
  flex-wrap: wrap;
}
.status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 2px #dcfce7;
  display: inline-block; flex-shrink: 0;
}
.status-dot.stale { background: #f59e0b; box-shadow: 0 0 0 2px #fef3c7; }
.status-sep { color: #d6d3d1; margin: 0 4px; }
.status-bold { font-weight: 600; color: #44403c; }

/* ===== STATS ===== */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
@media (max-width: 680px) { .stats-row { grid-template-columns: repeat(2, 1fr); } }
.stat-card {
  background: #fff;
  border: 1px solid #e5e2df;
  border-radius: 10px;
  padding: 14px 16px;
}
.stat-val { font-size: 26px; font-weight: 700; color: #1c1917; line-height: 1; }
.stat-val.green { color: #16a34a; }
.stat-val.orange { color: #c2410c; }
.stat-lbl { font-size: 11px; color: #78716c; margin-top: 4px; text-transform: uppercase; letter-spacing: .05em; font-weight: 500; }

/* ===== FILTER TABS ===== */
.filtr-tabs-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.filtr-tab {
  text-decoration: none;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: #57534e;
  background: #fff;
  border: 1px solid #e5e2df;
  transition: all .14s;
  white-space: nowrap;
}
.filtr-tab:hover { border-color: #4a7c59; color: #2d6a4f; text-decoration: none; }
.filtr-tab.active { background: #2d6a4f; color: #fff; border-color: #2d6a4f; }

/* ===== FILTER AREA ===== */
.filter-wrap {
  background: #fff;
  border: 1px solid #e5e2df;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 14px;
}
.filter-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.fg { display: flex; flex-direction: column; gap: 3px; min-width: 100px; flex: 1; }
.fg label { font-size: 11px; color: #78716c; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.fg input, .fg select {
  padding: 7px 10px;
  border: 1px solid #e5e2df;
  border-radius: 7px;
  font-size: 13px;
  background: #fafaf9;
  color: #1c1917;
  outline: none;
  transition: border-color .14s;
  width: 100%;
}
.fg input:focus, .fg select:focus { border-color: #4a7c59; background: #fff; box-shadow: 0 0 0 3px rgba(74,124,89,.1); }
.filter-extra { margin-top: 10px; padding-top: 10px; border-top: 1px solid #f5f5f4; }
.filter-actions { display: flex; gap: 7px; align-items: flex-end; flex-shrink: 0; }
.btn-search { padding: 7px 18px; background: #2d6a4f; color: #fff; border: none; border-radius: 7px; cursor: pointer; font-size: 13px; font-weight: 600; transition: background .14s; }
.btn-search:hover { background: #1e4d38; }
.btn-reset { padding: 7px 12px; background: #f5f5f4; color: #57534e; border: 1px solid #e5e2df; border-radius: 7px; font-size: 13px; font-weight: 500; transition: background .14s; }
.btn-reset:hover { background: #ece9e5; text-decoration: none; color: #1c1917; }
.btn-more { background: none; border: none; cursor: pointer; font-size: 12px; color: #78716c; padding: 0 2px; transition: color .14s; white-space: nowrap; }
.btn-more:hover { color: #2d6a4f; }

/* ===== SORT TABS ===== */
.sort-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}
.sort-tabs { display: flex; gap: 5px; flex-wrap: wrap; }
.tab {
  text-decoration: none;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: #57534e;
  background: #fff;
  border: 1px solid #e5e2df;
  transition: all .14s;
  white-space: nowrap;
}
.tab:hover { border-color: #4a7c59; color: #2d6a4f; text-decoration: none; }
.tab.active { background: #2d6a4f; color: #fff; border-color: #2d6a4f; }
.sort-right { display: flex; align-items: center; gap: 10px; }
.count-info { font-size: 12px; color: #78716c; white-space: nowrap; }
.btn-export {
  font-size: 12px; font-weight: 500;
  padding: 5px 12px;
  background: #f5f5f4;
  border: 1px solid #e5e2df;
  border-radius: 6px;
  color: #57534e;
  transition: background .14s;
  white-space: nowrap;
}
.btn-export:hover { background: #ece9e5; text-decoration: none; color: #1c1917; }

/* ===== CARDS GRID ===== */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(275px, 1fr)); gap: 13px; }
.card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e5e2df;
  transition: transform .15s, box-shadow .15s;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(0,0,0,.1); }
.card-img { width: 100%; height: 172px; object-fit: cover; display: block; background: #f0ede9; }
.card-img-ph {
  width: 100%; height: 172px;
  background: #f0ede9;
  display: flex; align-items: center; justify-content: center;
  font-size: 34px; color: #d6d0c8;
}
.card-body { padding: 11px 13px 9px; }
.card-badges { display: flex; gap: 5px; margin-bottom: 7px; flex-wrap: wrap; }
.badge {
  font-size: 10px; font-weight: 700; padding: 2px 7px;
  border-radius: 20px; text-transform: uppercase; letter-spacing: .4px; display: inline-block;
}
.badge-new { background: #dcfce7; color: #15803d; }
.badge-drop { background: #fff7ed; color: #c2410c; }
.badge-rent { background: #ede9fe; color: #6d28d9; }
.badge-archived { background: #f1f5f9; color: #94a3b8; }
.card.inactive { opacity: 0.55; }
.card-loc { font-size: 11px; color: #78716c; margin-bottom: 3px; }
.card-title {
  font-size: 13px; font-weight: 600; color: #1c1917;
  line-height: 1.35; margin-bottom: 7px;
  overflow: hidden; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.card-title a { color: inherit; }
.card-title a:hover { color: #2d6a4f; text-decoration: none; }
.card-price { font-size: 19px; font-weight: 700; color: #1c1917; }
.card-cm2 { font-size: 11px; color: #78716c; margin-top: 1px; }
.card-tags { display: flex; gap: 5px; margin-top: 7px; flex-wrap: wrap; }
.card-tag { font-size: 11px; color: #57534e; background: #f5f5f4; padding: 2px 8px; border-radius: 20px; }
.card-footer {
  padding: 7px 13px;
  border-top: 1px solid #f5f5f4;
  display: flex; justify-content: space-between; align-items: center;
}
.card-portals a { font-size: 11px; color: #78716c; margin-right: 5px; }
.card-portals a:hover { color: #2d6a4f; text-decoration: none; }
.card-date { font-size: 11px; color: #a8a29e; }

/* ===== PAGINATION ===== */
.pagination { display: flex; justify-content: center; align-items: center; gap: 5px; margin-top: 28px; flex-wrap: wrap; }
.pg-btn {
  padding: 6px 12px; border-radius: 7px; font-size: 13px;
  border: 1px solid #e5e2df; background: #fff; color: #1c1917; transition: .14s;
}
.pg-btn:hover { border-color: #4a7c59; color: #2d6a4f; text-decoration: none; }
.pg-btn.active { background: #2d6a4f; border-color: #2d6a4f; color: #fff; }
.pg-dots { color: #a8a29e; padding: 0 3px; font-size: 13px; }

/* ===== EMPTY ===== */
.empty {
  text-align: center; padding: 56px 20px; color: #a8a29e;
  background: #fff; border-radius: 12px; border: 1px solid #e5e2df;
}
.empty .empty-icon { font-size: 38px; margin-bottom: 10px; }
.empty p { font-size: 15px; }

/* ===== DETAIL ===== */
.back-link { display: inline-flex; align-items: center; gap: 5px; color: #78716c; font-size: 13px; margin-bottom: 18px; }
.back-link:hover { color: #2d6a4f; text-decoration: none; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 780px) { .detail-grid { grid-template-columns: 1fr; } }
.detail-img { width: 100%; border-radius: 10px; max-height: 330px; object-fit: cover; margin-bottom: 14px; }
.detail-box {
  background: #fff;
  border: 1px solid #e5e2df;
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 13px;
}
.detail-box-title { font-size: 11px; font-weight: 700; color: #78716c; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 12px; }
.detail-price { font-size: 28px; font-weight: 700; color: #1c1917; }
.detail-cm2 { font-size: 13px; color: #78716c; margin-top: 2px; }
.detail-heading { font-size: 15px; font-weight: 600; color: #1c1917; margin-bottom: 10px; line-height: 1.4; }
.param-row { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid #f5f5f4; font-size: 13px; }
.param-row:last-child { border-bottom: none; }
.param-label { color: #78716c; }
.price-hist { width: 100%; border-collapse: collapse; font-size: 13px; }
.price-hist td { padding: 7px 4px; border-bottom: 1px solid #f5f5f4; }
.price-hist tr:last-child td { border-bottom: none; }
.p-drop { color: #c2410c; font-weight: 600; }
.p-up { color: #16a34a; }
.portal-chip {
  display: inline-block; background: #f0f9f2; color: #2d6a4f;
  padding: 5px 12px; border-radius: 6px; margin: 3px;
  font-size: 13px; font-weight: 500; border: 1px solid #c6e8d0;
}
.portal-chip:hover { background: #d4eedd; text-decoration: none; }
.tel-btn {
  display: inline-block; background: #2d6a4f; color: #fff;
  padding: 7px 16px; border-radius: 20px; margin: 3px;
  font-weight: 600; font-size: 13px;
}
.tel-btn:hover { background: #1e4d38; text-decoration: none; }
.detail-desc { font-size: 13px; color: #44403c; line-height: 1.7; white-space: pre-wrap; }

/* ===== FILTRY PAGE ===== */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.page-header h1 { font-size: 20px; font-weight: 700; }
.alert-info {
  background: #fef9c3; border: 1px solid #fde047; border-radius: 8px;
  padding: 9px 14px; font-size: 13px; color: #713f12; margin-bottom: 18px;
}
.filtr-card {
  background: #fff; border: 1px solid #e5e2df; border-radius: 12px;
  margin-bottom: 12px; overflow: hidden;
}
.filtr-card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; gap: 12px; flex-wrap: wrap;
}
.filtr-name { font-size: 15px; font-weight: 700; color: #1c1917; }
.filtr-type {
  display: inline-block; font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 20px; margin-left: 8px;
  background: #dcfce7; color: #15803d;
}
.filtr-type.wynajem { background: #ede9fe; color: #6d28d9; }
.filtr-card-btns { display: flex; gap: 6px; }
.btn-edit { padding: 5px 14px; background: #f5f5f4; border: 1px solid #e5e2df; border-radius: 6px; cursor: pointer; font-size: 12px; font-weight: 600; color: #57534e; transition: background .14s; }
.btn-edit:hover { background: #ece9e5; }
.btn-edit.active { background: #2d6a4f; color: #fff; border-color: #2d6a4f; }
.btn-danger { padding: 5px 12px; background: #fff5f5; border: 1px solid #fecaca; border-radius: 6px; cursor: pointer; font-size: 12px; font-weight: 600; color: #dc2626; transition: background .14s; }
.btn-danger:hover { background: #fee2e2; }
.filtr-summary { padding: 0 16px 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.filtr-pill { font-size: 12px; color: #57534e; background: #f5f5f4; padding: 3px 10px; border-radius: 20px; }
.filtr-mail-hint { font-size: 11px; color: #78716c; padding: 0 16px 10px; }
.filtr-mail-hint code { background: #f0f9f2; color: #2d6a4f; padding: 1px 6px; border-radius: 4px; font-size: 11px; }
.filtr-form-wrap { border-top: 1px solid #f0ede9; padding: 16px; background: #fafaf9; }
.filtr-form-wrap .filter-row { gap: 8px; }
.form-section-title { font-size: 11px; font-weight: 700; color: #78716c; text-transform: uppercase; letter-spacing: .05em; margin: 10px 0 6px; }
.btn-save { padding: 7px 18px; background: #2d6a4f; color: #fff; border: none; border-radius: 7px; cursor: pointer; font-size: 13px; font-weight: 600; transition: background .14s; }
.btn-save:hover { background: #1e4d38; }
.add-filtr-btn {
  display: block; width: 100%; padding: 12px;
  background: #fff; border: 2px dashed #c8c4be; border-radius: 12px;
  cursor: pointer; font-size: 14px; font-weight: 600; color: #78716c;
  text-align: center; transition: all .14s; margin-top: 4px;
}
.add-filtr-btn:hover { border-color: #4a7c59; color: #2d6a4f; background: #f0f9f2; }
.new-filtr-wrap { background: #fff; border: 1px solid #4a7c59; border-radius: 12px; padding: 16px; margin-top: 12px; }
.new-filtr-wrap h3 { font-size: 14px; font-weight: 700; color: #1c1917; margin-bottom: 14px; }

/* ===== LOGIN ===== */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: #1e2d1e;
}
.login-box {
  background: #fff; border-radius: 14px; padding: 38px 34px;
  width: 340px; box-shadow: 0 20px 50px rgba(0,0,0,.4);
}
.login-logo { font-size: 21px; font-weight: 700; color: #1e2d1e; margin-bottom: 3px; }
.login-logo span { color: #4a7c59; }
.login-sub { font-size: 13px; color: #78716c; margin-bottom: 26px; }
.login-lbl { font-size: 11px; font-weight: 700; color: #78716c; text-transform: uppercase; letter-spacing: .05em; display: block; margin-bottom: 5px; }
.login-input {
  width: 100%; padding: 9px 11px; border: 1px solid #e5e2df;
  border-radius: 8px; font-size: 14px; outline: none; margin-bottom: 12px;
  background: #fafaf9; transition: border-color .14s;
}
.login-input:focus { border-color: #4a7c59; background: #fff; }
.login-btn {
  width: 100%; background: #2d6a4f; color: #fff; border: none;
  border-radius: 8px; padding: 11px; font-size: 14px; font-weight: 600;
  cursor: pointer; margin-top: 4px; transition: background .14s;
}
.login-btn:hover { background: #1e4d38; }
.login-err {
  background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa;
  border-radius: 7px; padding: 8px 11px; font-size: 13px; margin-bottom: 12px;
}

/* ===== RYNEK ===== */
.rynek-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; padding: 18px 0 6px;
}
.rynek-title { font-size: 20px; font-weight: 700; color: #1c1917; }
.rynek-meta  { font-size: 13px; color: #78716c; margin-top: 3px; }
.rynek-chart-wrap {
  background: #fff; border: 1px solid #e7e5e4; border-radius: 10px;
  padding: 16px 20px; margin: 10px 0;
}
.rcn-table-wrap {
  overflow-x: auto; background: #fff; border: 1px solid #e7e5e4;
  border-radius: 10px; margin: 10px 0;
}
.rcn-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.rcn-table th {
  background: #f5f5f4; padding: 9px 12px; text-align: left;
  font-weight: 600; border-bottom: 1px solid #e7e5e4;
  white-space: nowrap; color: #44403c;
}
.rcn-table td {
  padding: 8px 12px; border-bottom: 1px solid #f5f5f4;
  vertical-align: middle;
}
.rcn-table tr:last-child td { border-bottom: none; }
.rcn-table tr:hover td { background: #fafaf9; }
.rcn-cena  { font-weight: 600; color: #1c1917; white-space: nowrap; }
.rcn-cm2   { font-weight: 600; color: #2563eb; white-space: nowrap; }
.rcn-adres { max-width: 200px; }
.rcn-rynek { text-transform: capitalize; }
.rcn-date  { white-space: nowrap; color: #78716c; }
