
:root{
    --bg: #f5f6fa;
    --ink: #2c3e50;
    --muted: #7f8c8d;
    --primaryA: #3498db;
    --primaryB: #8e44ad;
    --good: #27ae60;
    --bad: #c0392b;
    --card: rgba(255,255,255,0.96);
}
* {
    box-sizing: border-box;
}
body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #f8f9fb, #edf1f5);
    margin: 0;
    color: var(--ink);
}
h1 {
    text-align: center;
    margin: 0 0 22px;
    font-size: 2.1rem;
    letter-spacing: .2px;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
}
.toolbar {
    display:flex;
    justify-content:center;
    align-items:center;
    gap:12px;
    margin-bottom:8px;
}
.seg {
    display:inline-flex;
    overflow:hidden;
    border-radius:999px;
    box-shadow:0 2px 6px rgba(0,0,0,.08);
}
.seg a {
    padding:8px 14px;
    text-decoration:none;
    font-weight:600;
    font-size:14px;
    color:#fff;
}
.seg .on {
    background: var(--good);
}
.seg .off {
    background: #bdc3c7;
}
.badge-total {
    display:inline-block;
    padding:6px 14px;
    background: var(--primaryA);
    color:#fff;
    border-radius:20px;
    font-weight:700;
    font-size:14px;
    box-shadow:0 2px 6px rgba(0,0,0,0.15);
}

.stats {
    display:flex;
    flex-wrap:wrap;
    justify-content:center;
    gap:20px;
    margin:24px 0 32px;
}
.stat-card {
    flex:1;
    min-width:220px;
    padding:20px;
    border-radius:18px;
    color:#fff;
    text-align:center;
    box-shadow:0 8px 18px rgba(0,0,0,.12);
    position:relative;
    overflow:hidden;
    transition:transform .25s ease;
}
.stat-card:hover {
    transform: translateY(0px);
}
.stat-green {
    background: linear-gradient(135deg, #1fa25a, #2ecc71);
}
.stat-blue  {
    background: linear-gradient(135deg, #2d7db3, #3498db);
}
.stat-purple{
    background: linear-gradient(135deg, #7b3fa1, #9b59b6);
}
.stat-orange {
    background: linear-gradient(135deg, #f39c12, #f5b041);
}

.stat-gold {
    background: linear-gradient(135deg, #d4af37, #b8860b);
    color: white;
}

.stat-card i {
    font-size:1.6rem;
    margin-bottom:8px;
    opacity:.95;
}
.stat-card h3{
    margin:6px 0 0;
    font-size:1.7rem;
}
.stat-card p {
    margin:4px 0 0;
    font-size:.95rem;
    opacity:.9;
}

.grid {
    display:grid;
    grid-template-columns:repeat(3, 1fr);
    gap:22px;
}
@media (max-width:1024px){
    .grid{
        grid-template-columns:repeat(2, 1fr);
    }
}
@media (max-width:640px){
    .grid{
        grid-template-columns:1fr;
    }
}

.card {
    background: var(--card);
    backdrop-filter: blur(10px);
    border-radius:16px;
    box-shadow:0 8px 20px rgba(0,0,0,.08);
    overflow:hidden;
    transition: transform .25s ease, box-shadow .25s ease, border .25s ease;
    position:relative;
    display:flex;
    flex-direction:column;
    border:1px solid rgba(0,0,0,.04);
}
.card:hover {
    transform:translateY(-4px);
    box-shadow:0 14px 28px rgba(0,0,0,.14);
    border-color:#3498db40;
}
.card img {
    width:100%;
    height:260px;
    object-fit:cover;
    display:block;
}

.badge {
    position:absolute;
    top:14px;
    left:14px;
    color:#fff;
    padding:6px 12px;
    border-radius:12px;
    font-size:.8rem;
    font-weight:700;
    box-shadow:0 2px 6px rgba(0,0,0,.25);
    background: var(--good);
}
.badge.inactive {
    background: var(--bad);
}

.card-content {
    padding:16px 16px 18px;
    display:flex;
    flex-direction:column;
    gap:10px;
    flex-grow:1;
}
.price {
    font-size:1.25rem;
    font-weight:800;
    color:#1f2d3a;
}
.address {
    font-weight:600;
    color:#34495e;
}
.meta {
    font-size:.92rem;
    color:var(--muted);
    line-height:1.45;
    display: flex;
    gap: 15px;
    margin-bottom: 12px;
}

.heatbar-container{
    position:relative;
    display:flex;
    align-items:center;
    gap:6px;
    margin:12px 4px;
}
.heatbar {
    display:grid;
    grid-template-columns:repeat(7, 1fr);
    gap:3px;
    height:14px;
    width:100%;
}
.heatbar .cell {
    border-radius:3px;
    background:#e5e7eb;
    border:1px solid #dcdfe3;
    box-shadow:inset 0 0 2px rgba(0,0,0,.12);
    transition:transform .25s ease, box-shadow .25s ease;
}
.heatbar .cell.filled {
    transform:scaleY(1.08);
    box-shadow:inset 0 0 3px rgba(0,0,0,.18);
}
.tooltip-btn{
    background:transparent;
    border:none;
    cursor:pointer;
    font-size:16px;
    line-height:1;
}
.tooltip-box{
    position:absolute;
    bottom:calc(100% + 6px);
    left:50%;
    transform:translateX(-50%);
    background:rgba(0,0,0,.85);
    color:#fff;
    font-size:12px;
    line-height:1.4;
    padding:6px 8px;
    border-radius:6px;
    display:none;
    white-space:pre;
    z-index:200;
}
.tooltip-box::before{
    content:"";
    position:absolute;
    top:100%;
    left:50%;
    transform:translateX(-50%);
    border:6px solid transparent;
    border-top-color:rgba(0,0,0,.85);
}

.details {
    margin-top:6px;
}
@media(max-width:800px){
    .details{
        grid-template-columns:1fr;
    }
}
.actions-table {
    width:100%;
    border-collapse:collapse;
    font-size:.88rem;
    border-radius:8px;
    overflow:hidden;
    box-shadow:0 1px 2px rgba(0,0,0,.04);
}
.actions-table th, .actions-table td {
    padding:8px 10px;
    border-bottom:1px solid #eef0f3;
    text-align:left;
    white-space:nowrap;
}
.actions-table th {
    background:#ecf0f1;
    font-weight:600;
    color:#334155;
}
.actions-table tr:nth-child(even) {
    background:#f7f8fa;
}
.actions-empty {
    font-size:.88rem;
    color:var(--muted);
    padding:6px 0;
}

.view-link {
    display:inline-flex;
    align-items:center;
    justify-content:center;
    margin-top:8px;
    padding:10px 32px;
    background:var(--primaryA);
    color:#fff;
    border-radius:6px;
    text-decoration:none;
    font-weight:600;
    transition:background .25s ease;
}
.view-link:hover {
    background:#2980b9;
}
.price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}
.days-on-market {
    font-size: 0.9em;
    color: #777;
}

.hero-header {
  background: linear-gradient(135deg, #2d7db3, #3498db);
  color: white;
  padding: 1rem 1rem;
  text-align: center;
  border-radius: 0 0 0 0;
  box-shadow: 0 4px 30px rgba(0,0,0,0.2);
  margin-bottom: 16px;
}

.hero-header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.hero-header h2 {
  font-weight: 700;
  margin-bottom: 6px;
}

.hero-header p {
  font-size: 1.2rem;
  max-width: 600px;
  margin: 0 auto 1rem;
}

.hero-actions .btn-primary,
.hero-actions .btn-secondary {
  display: inline-block;
  margin: 0 0.5rem;
  padding: 0.8rem 1.5rem;
  border-radius: 9999px;
  font-weight: 600;
  text-decoration: none;
}

.btn-primary {
  background: white;
  color: #3b82f6;
}

.btn-secondary {
  background: rgba(255,255,255,0.2);
  color: white;
}

.lifecycle-label {
    display: inline-block;
    margin: 0px 0;
    padding: 4px 8px;
    border-radius: 0px;
    background: #eef2ff;
    color: #374151;
    font-size: 0.85em;
    font-weight: 600;
    width: 100%
}
.lifecycle-label i {
    margin-right: 5px;
    color: #6366f1;
}

#scrollTopBtn {
  display: flex;
  position: fixed;
  width: 64px;
  height: 64px;
  font-size: 20px;
  bottom: 40px;
  right: 48px;
  z-index: 99;
  outline: none;
  background: linear-gradient(135deg, #2d7db3, #3498db);
  border: none;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  padding: 16px;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.25);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

  #scrollTopBtn:hover {
    background-color: #555;
  }
  
 .market-sentiment-container {
 width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
}

.market-heatbar {
  position: relative;
  width: 100%;
  max-width: 500px;
  height: 24px;
  border-radius: 999px;
  background: linear-gradient(to right,
    #0A47A6 0%,
    #06b6d4 25%,
    #6CD65A 50%,
    #f97316 75%,
    #dc2626 100%
  );
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25), 
              inset 0 1px 3px rgba(255, 255, 255, 0.3);
}


.heat-fill {
  width: 100%;
  height: 100%;
}

.heat-marker {
  position: absolute;
  left: 60%;
  top: 50%;
  transform: translate(-50%, -50%);
  
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
  border: 2px solid #333;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}


.heatbar-label {
  margin-top: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: #444;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.meta {
  display: flex;
  gap: 1rem;
  align-items: center;
  font-size: 0.95rem;
  color: #999;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.meta-item i {
  font-size: 1rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}

.meta-text { line-height: 1; display: inline-flex; align-items: center; gap: .15rem; }

.unit sup {
  --sup-size: 0.62;
  --sup-rise: -0.22em;
  display: inline-block;
  font-size: calc(var(--sup-size) * 1em);
  line-height: 1;
  transform: translateY(var(--sup-rise));
  transform-origin: center;
}


.card-active {
    border: 1px solid rgba(46, 204, 113, 0.5); 
    box-shadow: 0 0 8px rgba(46, 204, 113, 0.2); 
    transition: box-shadow 0.3s, transform 0.2s;
}

.card-active:hover {
    box-shadow: 0 0 12px rgba(46, 204, 113, 0.3);
    transform: translateY(-2px);
}

.card-inactive {
    border: 1px solid rgba(245, 73, 39, 0.5); 
    box-shadow: 0 0 8px rgba(245, 73, 39, 0.2); 
    transition: box-shadow 0.3s, transform 0.2s;
}

.card-inactive:hover {
    box-shadow: 0 0 12px rgba(245, 73, 39, 0.3); 
    transform: translateY(-2px);
}

.city-filter {
    display: inline-block;
    margin-left: 20px;
    font-family: 'Inter', sans-serif;
    position: relative;
}

.city-filter label {
    margin-right: 8px;
    font-weight: 600;
    color: #333;
}

.city-filter select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding: 6px 30px 6px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background-color: #fff;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg width='10' height='6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='%23333' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 10px 6px;
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.city-filter select:focus {
    outline: none;
    border-color: #2ecc71;
    box-shadow: 0 0 4px rgba(46, 204, 113, 0.4);
}


.dom-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
}

.dom-badge.fresh {
  background: #2ecc71;
}

.dom-badge.medium {
  background: #f1c40f;
  color: #333;
}

.dom-badge.stale {
  background: #e74c3c;
}

.dom-badge.danger {
  background: #A61F00;
}

.skeleton-card {
  width: 100%;
  height: 350px;
  border-radius: 12px;
  background: linear-gradient(
    90deg,
    #e5e7eb 25%,
    #f3f4f6 50%,
    #e5e7eb 75%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.2s infinite;
  margin-bottom: 1rem;
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.actions-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.75rem;
  font-size: 0.9rem;
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 0 0 1px #e5e7eb;
}

.actions-table thead {
  background: #f9fafb;
}

.actions-table th,
.actions-table td {
  padding: 0.6rem 0.75rem;
  text-align: left;
}

.actions-table th {
  font-weight: 600;
  color: #374151;
  border-bottom: 1px solid #e5e7eb;
  font-size: 0.85rem;
}

.actions-table tbody tr {
  transition: background 0.2s;
}

.actions-table tbody tr:nth-child(even) {
  background: #f9fafb;
}

.actions-table tbody tr:hover {
  background: #f1f5f9;
}

.actions-table .value-cell {
  text-align: right;
  color: #111827;
  font-weight: 500;
}

.actions-empty {
  padding: 0.75rem;
  font-style: italic;
  color: #6b7280;
  background: #f9fafb;
  border-radius: 0.5rem;
  text-align: center;
}

.actions-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.action-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  padding: 0.5rem 0.75rem;
  transition: transform 0.15s, box-shadow 0.15s;
}

.action-item:hover {

}

.action-date {
  font-size: 0.75rem;
  color: #6b7280;
}

.action-name {
  justify-self: start;
  padding: 0.2rem 0.5rem;
  border-radius: 9999px;
  background: #e0f2fe;
  color: #0369a1;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.action-value {
  justify-self: end;
  font-weight: 600;
  color: #111827;
}

.actions-empty {
  padding: 0.75rem;
  text-align: center;
  color: #6b7280;
  font-style: italic;
  background: #f9fafb;
  border-radius: 0.5rem;
}

.image-container {
    position: relative;
    display: block;
    overflow: hidden;
}

.overpriced-ribbon {
    position: absolute;
    top: 120px;
    left: -20px;
    background-color: #f87171;
    color: white;
    font-weight: 600;
    font-size: 0.8rem;
    text-align: center;
    white-space: nowrap;
    padding: 0.25rem 0.75rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    z-index: 10;
    pointer-events: none;

    transform: rotate(-45deg);
    transform-origin: 0 0;

    display: inline-block;
    min-width: 200px;
}

.filter-btn.disabled {
    opacity: 0.5;
    pointer-events: none;
    cursor: default;
}


.pagination-container {
    display: flex;
    justify-content: center;
    margin: 30px 0;
    gap: 6px;
    flex-wrap: wrap;
}

.pagination-container .page {
    display: inline-block;
    padding: 8px 14px;
    font-size: 14px;
    text-decoration: none;
    color: #555;
    border: 1px solid #ddd;
    border-radius: 6px;
    background-color: #f9f9f9;
    transition: all 0.2s ease;
}

.pagination-container .page:hover {
    background-color: #e2e8f0;
    border-color: #bbb;
    color: #333;
}

.pagination-container .page.current {
    background-color: #4f46e5;
    color: #fff;
    border-color: #4f46e5;
    font-weight: bold;
    pointer-events: none;
}

.page-tabs {
    margin-top: 15px;
    display: flex;
    gap: 20px;
}

.page-tabs a {
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 5px;
    color: #333;
    background-color: #f1f1f1;
    font-weight: 600;
    transition: background-color 0.2s, color 0.2s;
}

.page-tabs a:hover {
    background-color: #e0e0e0;
}

.page-tabs a.active {
    background-color: #4a90e2;
    color: #fff;
}

.hero-tabs {
    display: inline-flex;
    gap: 5px;
}

.hero-tabs a {
    padding: 10px 25px;
    border-radius: 8px;
    font-weight: bold;
    color: #fff;
    text-decoration: none;
    background-color: rgba(255, 255, 255, 0.3);
    transition: all 0.2s ease;
}

.hero-tabs a.active {
    background-color: #fff;
    color: #4a90e2;
}

.hero-tabs a:hover {
    background-color: rgba(255, 255, 255, 0.5);
}

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 1rem;
    margin-bottom: 4px;
}

.price {
    font-weight: 700;
    font-size: 1.1rem;
    color: #222;
}

.price-per-m2 {
    font-weight: 500;
    color: #555;
    font-size: 0.9rem;
}

.action-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.action-icon {
    width: 1.5rem;
    text-align: center;
}

.days-on-market {
    text-align: right;
    font-size: 0.9rem;
    color: #0D98D6;
    margin-top: 0.5rem;
    display: flex;
    justify-content: flex-end;
    width: 100%;
    align-items: center;
    gap: 0.25rem;
    padding-right: 12px;
    text-decoration: none;
}

.days-on-market-badge {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    background-color: rgba(0, 0, 0, 0.75);
    color: #fff;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    pointer-events: none;
}

.hero-logo {
    height: 96px;
    width: auto;
}