/* ============================================
   Vanguard Dashboard — Suburban Boundary Palette
   Sky Blue #EBF3F5 bg | Suburban Lawn Green #2D5A27 headers/containers | Caution Yellow #FFCC00 high-severity only
   ============================================ */

:root {
  --bg: #EBF3F5;
  --bg-dark: #2D5A27;
  --bg-dark-hover: #234a1e;
  --fg: #1c1c1c;
  --fg-light: #f5f2eb;
  --muted: #5a6e5a;
  --border: rgba(45, 90, 39, 0.15);
  --accent: #FFCC00;
  --accent-dim: rgba(255, 204, 0, 0.15);
  --radius: 6px;
  --radius-lg: 12px;
  --shadow: 0 2px 8px rgba(45, 90, 39, 0.08), 0 1px 2px rgba(45, 90, 39, 0.06);
  --shadow-lg: 0 8px 24px rgba(45, 90, 39, 0.12), 0 2px 8px rgba(45, 90, 39, 0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Status banner */
.dash-status-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  background: var(--bg-dark);
  color: rgba(255,255,255,0.75);
  font-size: 13px;
  font-weight: 500;
}

.banner-dot {
  width: 7px;
  height: 7px;
  background: #4ade80;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(74,222,128,0.25);
  animation: pulse-dot 2s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 2px rgba(74,222,128,0.25); }
  50% { opacity: 0.7; box-shadow: 0 0 0 4px rgba(74,222,128,0.15); }
}

.banner-note {
  margin-left: 6px;
  color: rgba(255,255,255,0.4);
  font-size: 12px;
}

/* ---- NAV ---- */
.dash-nav {
  background: var(--bg-dark);
  color: var(--fg-light);
  padding: 0 32px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.dash-nav-logo {
  font-family: 'DM Serif Display', serif;
  font-size: 20px;
  color: var(--fg-light);
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.dash-nav-logo span {
  color: var(--accent);
}

.dash-nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.dash-nav-tag {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
}

/* ---- CONTAINER ---- */
.dash-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px;
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 28px;
  align-items: start;
}

/* ---- SIDEBAR ---- */
.dash-sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Address Card */
.addr-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
}

.addr-card-label {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.addr-card-value {
  font-size: 16px;
  font-weight: 500;
  color: var(--bg-dark);
  line-height: 1.4;
}

/* Sponsor Slot (Sidebar) */
.sponsor-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--bg-dark);
}

.sponsor-category {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.sponsor-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--bg-dark);
  margin-bottom: 4px;
}

.sponsor-tagline {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
  margin-bottom: 12px;
}

.sponsor-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-dark);
  color: white;
  text-decoration: none;
  padding: 8px 14px;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 500;
  transition: background 0.15s;
}

.sponsor-link:hover {
  background: var(--bg-dark-hover);
}

/* ---- MAIN CONTENT ---- */
.dash-main {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Map Card */
.map-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.map-card-header {
  background: var(--bg-dark);
  color: var(--fg-light);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.map-card-title {
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.map-card-title span {
  color: var(--accent);
}

#map {
  width: 100%;
  height: 400px;
}

/* ---- DISRUPTION CARDS ---- */
.disruption-section {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.disruption-header {
  background: var(--bg-dark);
  color: var(--fg-light);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.disruption-title {
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sort-controls {
  display: flex;
  gap: 8px;
}

.sort-btn {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.7);
  padding: 5px 12px;
  border-radius: var(--radius);
  font-size: 12px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
}

.sort-btn.active, .sort-btn:hover {
  background: var(--accent);
  color: var(--fg);
  border-color: var(--accent);
}

/* Filing List */
.filing-list {
  display: flex;
  flex-direction: column;
}

.filing-card {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 14px;
  align-items: start;
  transition: background 0.1s;
}

.filing-card:last-child {
  border-bottom: none;
}

.filing-card:hover {
  background: #f8faf8;
}

.filing-icon {
  width: 44px;
  height: 44px;
  background: var(--accent-dim);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.filing-icon svg {
  width: 22px;
  height: 22px;
  fill: var(--bg-dark);
}

.filing-info {
  min-width: 0;
}

.filing-project-type {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}

.filing-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 4px;
  line-height: 1.3;
}

.filing-desc {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 10px;
  line-height: 1.5;
}

.filing-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
}

.filing-meta-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.filing-meta-item svg {
  width: 14px;
  height: 14px;
  fill: var(--muted);
  flex-shrink: 0;
}

.filing-status {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.status-pending {
  background: rgba(255, 204, 0, 0.15);
  color: #8a6500;
}

.status-approved {
  background: rgba(45, 90, 39, 0.12);
  color: #2D5A27;
}

.status-construction {
  background: rgba(200, 60, 60, 0.12);
  color: #a03030;
}

.filing-source-link {
  font-size: 11px;
  color: var(--bg-dark);
  text-decoration: underline;
  opacity: 0.7;
}

/* Sponsor Inline Slot */
.sponsor-inline {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--bg-dark);
  display: flex;
  align-items: center;
  gap: 16px;
}

.sponsor-inline-icon {
  width: 48px;
  height: 48px;
  background: var(--accent-dim);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sponsor-inline-icon svg {
  width: 24px;
  height: 24px;
  fill: var(--bg-dark);
}

.sponsor-inline-text {
  flex: 1;
}

.sponsor-inline-category {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 2px;
}

.sponsor-inline-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--bg-dark);
}

.sponsor-inline-tagline {
  font-size: 12px;
  color: var(--muted);
}

.sponsor-inline-link {
  background: var(--bg-dark);
  color: white;
  text-decoration: none;
  padding: 10px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s;
}

.sponsor-inline-link:hover {
  background: var(--bg-dark-hover);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--muted);
}

.empty-state svg {
  width: 48px;
  height: 48px;
  fill: var(--muted);
  opacity: 0.4;
  margin-bottom: 16px;
}

.empty-state h3 {
  font-size: 18px;
  color: var(--bg-dark);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 14px;
  line-height: 1.6;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 900px) {
  .dash-container {
    grid-template-columns: 1fr;
  }

  .dash-sidebar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
}

@media (max-width: 600px) {
  .dash-container {
    padding: 20px 16px;
  }

  .dash-sidebar {
    grid-template-columns: 1fr;
  }

  .filing-card {
    grid-template-columns: 40px 1fr;
  }

  .filing-status {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  #map {
    height: 300px;
  }
}

/* ---- /ME/ALERTS PAGE ---- */
/* Single-column feed narrower than the dashboard grid (1200px) so a long
   list of card rows reads well on desktop and stacks cleanly on mobile. */
.alerts-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 24px 48px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.alerts-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.alerts-heading {
  font-family: 'DM Serif Display', serif;
  font-size: 28px;
  color: var(--bg-dark);
  line-height: 1.2;
}

.alerts-summary {
  font-size: 14px;
  color: var(--muted);
}

.alerts-source-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 14px;
  color: var(--muted);
}

.alerts-source-filter label {
  font-weight: 600;
  color: var(--bg-dark);
}

.alerts-source-filter select {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: white;
  color: var(--bg-dark);
}

.alerts-source-filter button {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  padding: 6px 12px;
  background: var(--bg-dark);
  color: white;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
}

.alerts-page .filing-card {
  /* Inherits .filing-card grid/layout; nothing to override. */
}

/* Centered CTA inside the empty state — matches .btn-search from theme.css
   but uses the dashboard palette (var(--bg-dark)) for visual cohesion. */
.alerts-cta {
  display: inline-block;
  margin-top: 20px;
  padding: 12px 22px;
  background: var(--bg-dark);
  color: white;
  text-decoration: none;
  border-radius: var(--radius);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.15s;
}

.alerts-cta:hover {
  background: var(--bg-dark-hover);
}

/* Centered "My Alerts" label between the logo and the right-side links,
   shown only on /me/alerts (the dashboard nav doesn't have one). */
.alerts-nav-title {
  font-family: 'DM Serif Display', serif;
  font-size: 18px;
  color: var(--accent);
  margin-left: 24px;
}

/* Nav links added for logged-in members on both /dashboard and /me/alerts. */
.dash-nav-link {
  font-size: 13px;
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: var(--radius);
  transition: background 0.15s;
}

.dash-nav-link:hover {
  background: rgba(255,255,255,0.08);
  color: var(--accent);
}

@media (max-width: 720px) {
  .alerts-page {
    padding: 20px 16px 32px;
  }

  .alerts-heading {
    font-size: 24px;
  }

  .alerts-nav-title {
    display: none;
  }

  .dash-nav {
    padding: 0 16px;
    gap: 8px;
  }

  .dash-nav-right {
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .dash-nav-link {
    font-size: 12px;
    padding: 4px 8px;
  }

  .dash-nav-tag {
    display: none;
  }
}

/* Filing detail link — card title anchor */
.filing-detail-link {
  color: inherit;
  text-decoration: none;
}
.filing-detail-link:hover {
  text-decoration: underline;
  color: var(--bg-dark);
}

/* Filing detail page */
.detail-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.detail-card-header {
  background: var(--bg-dark);
  color: var(--fg-light);
  padding: 16px 20px;
  font-size: 14px;
  font-weight: 600;
}
.detail-fields {
  padding: 0;
}
.detail-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  align-items: baseline;
}
.detail-row:last-child { border-bottom: none; }
.detail-label {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.detail-value {
  font-size: 14px;
  color: var(--fg);
  line-height: 1.5;
}
.detail-value.muted { color: var(--muted); font-style: italic; }
.detail-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 16px;
}
.detail-back-link:hover { color: var(--bg-dark); }
@media (max-width: 600px) {
  .detail-row { grid-template-columns: 1fr; gap: 4px; }
  .detail-label { margin-bottom: 2px; }
}