/*
 * Backend-style CSS for the DealCheck clone.
 *
 * This stylesheet defines the layout for the property dashboard and
 * individual property pages. The look loosely follows the DealCheck app
 * with a focus on usability and clarity. Colors are inspired by the
 * marketing site but kept simple to maintain readability.
 */

/* CSS variables for color palette */
:root {
  --primary: #1677ff;
  --primary-dark: #0c56b0;
  --secondary: #16c25e;
  --bg-light: #f7f9fc;
  --bg-card: #ffffff;
  --text-dark: #333333;
  --text-muted: #666666;
  --border: #e0e6ef;
  --success: #26a269;
  --danger: #d24545;
}

body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background: var(--bg-light);
  color: var(--text-dark);
}

/* Top bar shared across pages */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  background: var(--primary);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.topbar .app-title {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
.topbar-nav {
  display: flex;
  gap: 24px;
}
.topbar-nav .nav-link {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  position: relative;
}
.topbar-nav .nav-link.active::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  height: 2px;
  width: 100%;
  background: #fff;
}
.topbar-actions button {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 0.9rem;
  cursor: pointer;
  margin-left: 16px;
  padding: 6px 10px;
  border-radius: 4px;
  transition: background 0.2s ease;
}
.topbar-actions button:hover {
  background: rgba(255, 255, 255, 0.15);
}
.add-btn {
  background: var(--secondary);
  color: #fff;
  font-weight: 600;
}
.add-btn:hover {
  background: #12a550;
}

/* Dashboard layout */
.dashboard {
  padding: 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.category {
    margin-bottom: 32px;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);

}
.category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.category-header h2 {
  margin: 0;
  font-size: 1.3rem;
  color: var(--primary-dark);
}.category-header .add-new {
  font-size: 0.85rem;
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  padding: 6px 10px;
  border: 1px solid var(--primary);
  border-radius: 4px;
  transition: background 0.2s ease, color 0.2s ease;
}

.category-header .add-new:hover {
  background: var(--primary);
  color: #fff;
  text-decoration: none;
}

}
.card-list {
  display: flex;
    flex-direction: column;
  gap: 24px;
}
.property-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  width: calc(50% - 12px);
  min-width: 280px;
}
.property-card a {
  display: block;
  color: inherit;
}
.property-card .property-thumb {
  width: 100%;
  height: 140px;
  object-fit: cover;
}
.property-info {
  padding: 16px;
}
.property-info h3 {
  margin: 0;
  font-size: 1.1rem;
  margin-bottom: 4px;
}
.property-info .address,
.property-info .details {
  margin: 2px 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.metrics {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
}
.metric-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.metric-value {
  font-size: 0.9rem;
  font-weight: 600;
}
.metric-value.positive {
  color: var(--success);
}
.metric-value.negative {
  color: var(--danger);
}

/* Footer */
.footer {
  text-align: center;
  padding: 24px;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  margin-top: 48px;
}

/* Property page layout */
.property-container {
  display: flex;
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
  gap: 24px;
}
.side-nav {
  flex: 0 0 220px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  height: fit-content;
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}
.side-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.side-nav li {
  margin-bottom: 8px;
}
.side-nav a {
  color: var(--text-dark);
  text-decoration: none;
  font-size: 0.9rem;
  display: block;
  padding: 6px 8px;
  border-radius: 4px;
  transition: background 0.2s ease;
}
.side-nav a:hover {
  background: var(--bg-light);
}
.side-nav a.active {
  background: var(--primary);
  color: #fff;
}

.property-content {
  flex: 1 1 auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
}
.property-header {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}
.property-header .info {
  flex: 1 1 300px;
}
.property-header h2 {
  margin: 0;
  font-size: 1.6rem;
  color: var(--primary-dark);
}
.property-header .subinfo {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.property-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 16px;
}
.property-metric {
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 16px;
  min-width: 120px;
  flex: 1 1 150px;
}
.property-metric .label {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.property-metric .value {
  font-size: 1rem;
  font-weight: 600;
  margin-top: 4px;
}

/* Section headings */
.section-block {
  margin-bottom: 32px;
}
.section-block h3 {
  margin: 0 0 12px;
  font-size: 1.3rem;
  color: var(--primary-dark);
}
.section-block table {
  width: 100%;
  border-collapse: collapse;
}
.section-block table th,
.section-block table td {
  padding: 8px 12px;
  border: 1px solid var(--border);
  font-size: 0.85rem;
}
.section-block table th {
  background: var(--bg-light);
  text-align: left;
}
.chart-container {
  max-width: 400px;
  margin: 20px auto;
}

/* Responsive adjustments */
@media (max-width: 800px) {
  .property-card {
    width: 100%;
  }
  .property-container {
    flex-direction: column;
  }
  .side-nav {
    position: static;
    max-height: none;
    margin-bottom: 24px;
  }
}