:root {
  --primary: #0D7377;
  --primary-dark: #054C50;
  --primary-soft: #E6F2F2;
  --accent: #F5A623;
  --accent-soft: #FEF3E0;
  --bg: #FAFAF7;
  --surface: #FFFFFF;
  --surface-muted: #F5F4F0;
  --text: #1A1A1A;
  --text-muted: #6B6B6B;
  --text-subtle: #A0A0A0;
  --border: #ECECE6;
  --success: #10B981;
  --success-soft: #D1FAE5;
  --success-fg: #065F46;
  --warning: #F59E0B;
  --warning-soft: #FEF3C7;
  --warning-fg: #92400E;
  --danger: #EF4444;
  --danger-soft: #FEE2E2;
  --danger-fg: #991B1B;
  --info: #3B82F6;
  --info-soft: #DBEAFE;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.06);
}
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); color-scheme: light; }
body {
  margin: 0; padding: 0;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  background: var(--bg); color: var(--text);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); }

/* ──────────── TOP BAR ──────────── */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px; background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand svg { width: 24px; height: 30px; }
.logo {
  font-size: 18px; font-weight: 700; letter-spacing: 1.5px;
  color: var(--primary);
}
.brand-divider { width: 1px; height: 20px; background: var(--border); }
.brand-sub {
  font-size: 13px; color: var(--text-muted); font-weight: 500;
}
.barangay-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 9999px;
  background: var(--primary-soft); color: var(--primary-dark);
  font-size: 13px; font-weight: 600;
}
.user-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px 6px 6px; border-radius: 9999px;
  background: var(--surface-muted);
  font-size: 13px; font-weight: 500;
}
.user-chip .avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--primary); color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 11px;
}

/* ──────────── LAYOUT ──────────── */
.layout { display: grid; grid-template-columns: 240px 1fr; min-height: calc(100vh - 60px); }
.sidebar {
  background: var(--surface); border-right: 1px solid var(--border);
  padding: 24px 16px;
}
.sidebar h4 {
  font-size: 11px; font-weight: 700; letter-spacing: 1.4px;
  text-transform: uppercase; color: var(--text-subtle);
  margin: 8px 12px 8px;
}
.sidebar a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--radius-md);
  font-size: 14px; font-weight: 500; color: var(--text-muted);
  text-decoration: none; margin-bottom: 2px;
}
.sidebar a:hover { background: var(--surface-muted); color: var(--text); }
.sidebar a.active {
  background: var(--primary-soft); color: var(--primary-dark);
  font-weight: 700;
}
.sidebar a svg { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar-divider {
  height: 1px; background: var(--border); margin: 16px 12px;
}

.content {
  padding: 32px;
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
}
.page-head {
  margin-bottom: 24px;
}
.eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: 1.4px;
  text-transform: uppercase; color: var(--text-subtle);
  margin-bottom: 6px;
}
h1 {
  font-size: 28px; font-weight: 800; margin: 0;
  letter-spacing: -0.4px;
}
.lede {
  font-size: 15px; color: var(--text-muted); margin: 6px 0 0;
}

/* ──────────── STAT CARDS ──────────── */
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 16px; margin-bottom: 32px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
}
.stat .label {
  font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--text-subtle);
}
.stat .num {
  font-size: 32px; font-weight: 800;
  margin-top: 6px; letter-spacing: -0.5px;
  color: var(--text);
}
.stat .delta {
  font-size: 12px; font-weight: 600; margin-top: 6px;
}
.stat .delta.up { color: var(--success); }
.stat .delta.down { color: var(--danger); }
.stat.warn { border-color: var(--warning); background: var(--warning-soft); }
.stat.warn .label { color: var(--warning-fg); }
.stat.warn .num { color: var(--warning-fg); }

/* ──────────── CARDS ──────────── */
.row-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-bottom: 16px; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
}
.card-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px;
}
.card-title {
  font-size: 16px; font-weight: 700; margin: 0;
}
.card-link {
  font-size: 13px; font-weight: 600; color: var(--primary);
  text-decoration: none;
}

/* ──────────── TABLE ──────────── */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td {
  text-align: left; padding: 12px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table th {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--text-subtle);
}
.table tr:last-child td { border-bottom: 0; }
.table .name {
  display: flex; align-items: center; gap: 10px;
  font-weight: 600;
}
.table .name .avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--primary-soft); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px;
}
.table .property { font-size: 12px; color: var(--text-muted); }

/* ──────────── BADGES ──────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 9999px;
  font-size: 11px; font-weight: 600;
}
.badge.success { background: var(--success-soft); color: var(--success-fg); }
.badge.warn { background: var(--warning-soft); color: var(--warning-fg); }
.badge.danger { background: var(--danger-soft); color: var(--danger-fg); }
.badge.primary { background: var(--primary-soft); color: var(--primary-dark); }
.badge.neutral { background: var(--surface-muted); color: var(--text); }

/* ──────────── ALERT BAR ──────────── */
.alert {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--warning-soft);
  border-left: 4px solid var(--warning);
  padding: 14px 16px; border-radius: var(--radius-md);
  margin-bottom: 16px;
}
.alert.danger { background: var(--danger-soft); border-left-color: var(--danger); }
.alert .icon { color: var(--warning-fg); flex-shrink: 0; }
.alert.danger .icon { color: var(--danger-fg); }
.alert h4 { margin: 0 0 4px; font-size: 14px; font-weight: 700; color: var(--warning-fg); }
.alert.danger h4 { color: var(--danger-fg); }
.alert p { margin: 0; font-size: 13px; color: var(--warning-fg); }
.alert.danger p { color: var(--danger-fg); }

/* ──────────── BUTTONS ──────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 16px;
  border-radius: var(--radius-md); border: 1px solid transparent;
  font-family: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer; text-decoration: none;
  transition: opacity 0.15s;
}
.btn.primary { background: var(--primary); color: white; }
.btn.primary:hover { opacity: 0.9; }
.btn.ghost { background: transparent; color: var(--primary); }
.btn.ghost:hover { background: var(--primary-soft); }
.btn.secondary {
  background: var(--surface); color: var(--primary);
  border-color: var(--border);
}
.btn.secondary:hover { background: var(--surface-muted); }

/* ──────────── ACTIVITY FEED ──────────── */
.activity li {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--border);
  list-style: none;
}
.activity ul { padding: 0; margin: 0; }
.activity li:last-child { border-bottom: 0; }
.activity .dot {
  width: 8px; height: 8px; border-radius: 50%;
  margin-top: 6px; flex-shrink: 0;
}
.activity .dot.success { background: var(--success); }
.activity .dot.warn { background: var(--warning); }
.activity .dot.info { background: var(--info); }
.activity .text {
  flex: 1; font-size: 13px; color: var(--text); line-height: 1.5;
}
.activity .text strong { font-weight: 700; }
.activity .time {
  font-size: 11px; color: var(--text-subtle); margin-top: 2px;
}

/* ──────────── DENSITY MAP (placeholder) ──────────── */
.map {
  background: var(--primary-soft);
  border-radius: var(--radius-lg);
  height: 280px;
  position: relative;
  overflow: hidden;
}
.map::before {
  content: ''; position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, rgba(13, 115, 119, 0.08) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(13, 115, 119, 0.08) 1px, transparent 1px);
  background-size: 24px 24px;
}
.map .legend {
  position: absolute; bottom: 12px; left: 12px;
  background: white;
  padding: 8px 12px; border-radius: 8px;
  font-size: 12px;
}
.density-dot {
  position: absolute; width: 14px; height: 14px;
  border-radius: 50%; background: var(--primary);
  box-shadow: 0 0 0 6px rgba(13, 115, 119, 0.2);
}

/* ──────────── PRICING (landing page) ──────────── */
.hero {
  text-align: center; padding: 96px 24px 64px;
  max-width: 760px; margin: 0 auto;
}
.hero h1 { font-size: 48px; letter-spacing: -0.8px; line-height: 1.1; }
.hero p { font-size: 18px; color: var(--text-muted); margin-top: 12px; line-height: 1.5; }
.hero .ctas { display: flex; gap: 12px; justify-content: center; margin-top: 28px; flex-wrap: wrap; }
.hero .btn { height: 48px; padding: 0 24px; font-size: 15px; }

.pricing-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 16px; max-width: 1080px; margin: 48px auto; padding: 0 24px;
}
.tier {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  position: relative;
}
.tier.featured { border-color: var(--primary); border-width: 2px; }
.tier .ribbon {
  position: absolute; top: -12px; right: 24px;
  background: var(--primary); color: white;
  padding: 4px 12px; border-radius: 9999px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.6px;
  text-transform: uppercase;
}
.tier h3 { margin: 0; font-size: 14px; color: var(--text-muted); letter-spacing: 1px; text-transform: uppercase; }
.tier .price { font-size: 42px; font-weight: 800; margin: 12px 0 4px; }
.tier .price-unit { font-size: 14px; color: var(--text-muted); font-weight: 500; }
.tier ul { padding: 0; margin: 20px 0; list-style: none; }
.tier li {
  padding: 6px 0; display: flex; align-items: flex-start; gap: 8px;
  font-size: 14px; color: var(--text);
}
.tier li svg { color: var(--success); flex-shrink: 0; margin-top: 3px; }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .row-2 { grid-template-columns: 1fr; }
  .pricing-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 32px; }
}
