/* Toronto Dogs & Cats Dashboard */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: #f0f2f5;
    color: #1a1a2e;
    line-height: 1.5;
}

a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }

/* Header */
header {
    background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
    color: #fff;
    text-align: center;
    padding: 2rem 1rem 1.5rem;
}
header h1 { font-size: 1.8rem; font-weight: 700; }
header .subtitle { opacity: 0.85; margin-top: 0.3rem; font-size: 0.95rem; }
header .subtitle a { color: #93c5fd; }

/* Summary Cards */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    max-width: 1200px;
    margin: -1.5rem auto 1.5rem;
    padding: 0 1rem;
    position: relative;
    z-index: 10;
}
.card {
    background: #fff;
    border-radius: 12px;
    padding: 1.2rem 1rem;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.15s;
}
.card:hover { transform: translateY(-2px); }
.card-icon { font-size: 2rem; margin-bottom: 0.3rem; }
.card-value { font-size: 1.8rem; font-weight: 700; }
.card-label { font-size: 0.85rem; color: #6b7280; text-transform: uppercase; letter-spacing: 0.05em; }
.card-dogs .card-value { color: #2563eb; }
.card-cats .card-value { color: #f59e0b; }
.card-total .card-value { color: #059669; }
.card-fsa .card-value { color: #7c3aed; }

/* Panels */
.panel {
    background: #fff;
    border-radius: 12px;
    padding: 1.2rem 1.5rem 1.5rem;
    margin: 0 auto 1.5rem;
    max-width: 1200px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.panel h2 { font-size: 1.1rem; margin-bottom: 0.8rem; color: #1e3a5f; }

/* Map */
#map { height: 480px; border-radius: 8px; border: 1px solid #e5e7eb; }
.map-controls {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}
.map-btn {
    padding: 0.4rem 1.2rem;
    border: 2px solid #2563eb;
    border-radius: 6px;
    background: #fff;
    color: #2563eb;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.15s;
}
.map-btn.active, .map-btn:hover {
    background: #2563eb;
    color: #fff;
}

/* Chart rows */
.chart-row {
    display: flex;
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto 1.5rem;
    padding: 0 1rem;
}
.chart-row .panel { margin: 0; }
.chart-row .half { flex: 1; min-width: 0; }
.chart-row .full { flex: 1; }

/* Map legend */
.map-legend {
    background: #fff;
    padding: 10px 14px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    font-size: 0.8rem;
    line-height: 1.6;
}
.map-legend i {
    width: 18px;
    height: 14px;
    display: inline-block;
    margin-right: 6px;
    border-radius: 2px;
    vertical-align: middle;
}
.map-legend .legend-title {
    font-weight: 600;
    margin-bottom: 4px;
}

/* Info popup */
.info-popup { font-size: 0.85rem; line-height: 1.6; }
.info-popup b { color: #1e3a5f; }

/* Footer */
footer {
    text-align: center;
    padding: 2rem 1rem;
    font-size: 0.85rem;
    color: #6b7280;
}
footer code {
    background: #e5e7eb;
    padding: 0.15em 0.4em;
    border-radius: 4px;
    font-size: 0.82rem;
}

/* Responsive */
@media (max-width: 768px) {
    .chart-row { flex-direction: column; }
    #map { height: 350px; }
    header h1 { font-size: 1.3rem; }
    .cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .cards { grid-template-columns: 1fr; }
}

/* Panel outside chart-row needs horizontal margin */
section.panel {
    margin-left: auto;
    margin-right: auto;
    max-width: 1200px;
    margin-left: 1rem;
    margin-right: 1rem;
}
@media (min-width: 1232px) {
    section.panel {
        margin-left: auto;
        margin-right: auto;
    }
}
