/* ============ DASHBOARD page styles ============ */

.dash-header {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  padding: 32px 0 40px;
}
.dash-breadcrumb {
  display: flex; gap: 8px; align-items: center;
  font-size: 13px; color: var(--muted);
  margin-bottom: 24px;
}
.dash-breadcrumb a:hover { color: var(--ink); }
.dash-breadcrumb .current { color: var(--ink); font-weight: 500; }
.dash-head-row {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 32px;
}
.property-thumb {
  width: 96px; height: 96px; border-radius: 14px;
  overflow: hidden; flex-shrink: 0;
  background:
    linear-gradient(135deg, var(--accent-soft) 0%, #F7DBCF 100%);
  position: relative;
  box-shadow: var(--shadow-sm);
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line);
}
.property-thumb img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.property-thumb-initial {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 48px;
  line-height: 1;
  color: var(--accent);
  letter-spacing: -0.03em;
}
.property-thumb-inner {
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 30% 25%, rgba(255,255,255,0.45), transparent 50%);
  pointer-events: none;
}

/* body grid */
.dash-body {
  padding: 32px 0 80px;
}
.dash-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  align-items: start;
}
.dash-col { display: flex; flex-direction: column; gap: 24px; }

/* score card */
.score-card { position: relative; overflow: hidden; }
.score-card::before {
  content: ""; position: absolute; right: -60px; top: -60px;
  width: 180px; height: 180px; border-radius: 50%;
  background: radial-gradient(circle, rgba(232,92,74,0.08), transparent 70%);
}
.score-legend {
  margin-top: 20px;
  display: flex; gap: 20px;
  font-size: 12px; color: var(--muted);
}
.score-legend em {
  display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px;
  vertical-align: middle;
}

/* kpi */
.kpi-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
}
.kpi-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.delta-pos { color: var(--good); font-size: 13px; font-weight: 500; }
.delta-neg { color: var(--bad); font-size: 13px; font-weight: 500; }

/* category list */
.cats-list { display: flex; flex-direction: column; }
.cat-row {
  padding: 20px 0;
  border-top: 1px solid var(--line);
}
.cat-row:first-child { border-top: 0; padding-top: 0; }
.cat-row:last-child { padding-bottom: 0; }

/* improvements */
.imp-progress { height: 3px; background: var(--bg-2); }
.imp-progress-fill { height: 100%; background: var(--ink); transition: width .3s ease; }
.imp-list { list-style: none; padding: 0; margin: 0; }
.imp-item {
  display: grid;
  grid-template-columns: 28px 40px 1fr auto;
  align-items: flex-start; gap: 16px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  transition: background .15s ease;
}
.imp-item:last-child { border-bottom: 0; }
.imp-item:hover { background: var(--bg); }
.imp-item.done { opacity: 0.55; }
.imp-item.done .imp-body { text-decoration: line-through; }

.imp-check {
  width: 22px; height: 22px; border-radius: 6px;
  border: 1.5px solid var(--line-2);
  background: var(--card);
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff;
  margin-top: 2px;
  transition: all .15s ease;
}
.imp-check:hover { border-color: var(--ink); }
.imp-item.done .imp-check { background: var(--good); border-color: var(--good); }
.imp-priority {
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.04em;
  padding-top: 2px;
}
.imp-impact { text-align: right; min-width: 70px; }

/* chart */
.chart-wrap {
  margin-top: 16px;
  height: 180px;
  position: relative;
}
.chart-svg {
  width: 100%; height: 100%;
  overflow: visible;
}
.chart-labels {
  display: flex; justify-content: space-between;
  margin-top: 8px;
  font-size: 10px;
  color: var(--muted);
  font-family: var(--font-mono);
}
.chart-callout {
  margin-top: 20px; padding-top: 16px;
  border-top: 1px dashed var(--line);
  display: flex; gap: 8px; align-items: center;
  font-size: 13px; color: var(--ink-2);
}
.chart-callout svg { color: var(--accent); flex-shrink: 0; }

/* comp table */
.comp-table {
  width: 100%; border-collapse: collapse;
  font-size: 13px;
}
.comp-table th, .comp-table td {
  padding: 10px 0;
  text-align: right;
  border-bottom: 1px solid var(--line);
}
.comp-table th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 500; }
.comp-table th:first-child, .comp-table td:first-child { text-align: left; }
.comp-table tr:last-child td { border-bottom: 0; }
.comp-table tr.you td { background: rgba(232,92,74,0.04); font-weight: 600; }
.comp-table tr.you td:first-child { padding-left: 8px; border-left: 2px solid var(--accent); }

/* upgrade banner */
.upgrade-banner {
  background: var(--ink);
  color: var(--bg);
  border-radius: 20px;
  padding: 32px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px; align-items: center;
  position: relative; overflow: hidden;
}
.upgrade-banner::before {
  content: ""; position: absolute;
  right: -80px; top: -80px; width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(232,92,74,0.25), transparent 70%);
  pointer-events: none;
}

@media (max-width: 900px) {
  .dash-head-row { flex-direction: column; }
  .dash-grid { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .upgrade-banner { grid-template-columns: 1fr; }
  .imp-item { grid-template-columns: 24px 32px 1fr; }
  .imp-impact { grid-column: 1 / -1; text-align: left; padding-left: 72px; }
}

/* ---------- Mobile <=640px ---------- */
@media (max-width: 640px) {
  .dash-header { padding: 28px 0 20px !important; }
  .dash-body { padding: 28px 0 !important; }
  .kpi-grid { grid-template-columns: 1fr !important; gap: 12px; }
  .kpi-card { padding: 20px !important; }
  .dash-col { gap: 16px; }
  .score-card, .imp-card, .dash-card { padding: 20px !important; }
  .upgrade-banner { padding: 24px !important; }
}

/* Premium sections collapse to single column on smaller viewports */
@media (max-width: 900px) {
  .card.card-pad > div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }
}
