:root {
    --bg:        #0b0c0f;
    --surface:   #13151a;
    --surface2:  #1c1f27;
    --border:    #2a2d38;
    --text:      #e8eaf0;
    --muted:     #6b7080;
    --accent:    #f89828;
    --accent2:   #42b4f5;
    --danger:    #f54260;
    --radius:    12px;
    --font-display: 'DM Serif Display', Georgia, serif;
    --font-body:    'DM Sans', sans-serif;
    --font-mono:    'DM Mono', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.6;
    min-height: 100vh;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(var(--border) 1px, transparent 1px),
        linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.2;
    pointer-events: none;
    z-index: 0;
}

/* ── Header ── */
header {
    position: relative;
    z-index: 10;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    padding: 0 2rem;
    overflow: visible;
}

.header-inner {
    max-width: 1300px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.2rem 0;
    gap: 2rem;
}

.logo { display: flex; flex-direction: column; gap: 2px; }

.logo h1 {
    font-family: var(--font-display);
    font-size: 1.4rem;
    letter-spacing: -0.02em;
    color: var(--text);
}

.logo h1 span { color: var(--accent); }

.logo small {
    font-size: 0.72rem;
    color: var(--muted);
    font-family: var(--font-mono);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

nav { display: flex; gap: 0.25rem; align-items: center;}

nav a {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.45rem 0.9rem;
    border-radius: 6px;
    transition: all 0.15s;
}

.dropdown {
    position: relative;
    display: flex;
    align-items: center;
}

.dropbtn {
    background: transparent;
    color: var(--muted);
    border: none;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.45rem 0.9rem;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    line-height: 1.2;
    display: flex;
    align-items: center;
    height: 100%;
    transition: all 0.15s;
}



.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    min-width: 180px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.35);
    overflow: hidden;
    z-index: 9999;
    padding: 0.3rem 0;
}

.dropdown-content a {
    display: block;
    padding: 0.7rem 1rem;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.82rem;
    white-space: nowrap;
}

.dropdown-content a:hover {
    background: var(--surface2);
    color: var(--text);
}

/* show menu */
.dropdown:hover .dropdown-content {
    display: block;
}

nav a:hover { color: var(--text); background: var(--surface2); }
nav a.active { color: var(--accent); background: rgba(201,245,66,0.08); }

/* ── Main ── */
main {
    position: relative;
    z-index: 1;
    max-width: 1300px;
    margin: 0 auto;
    padding: 2.5rem 2rem 4rem;
}

/* ── Page header ── */
.page-header { margin-bottom: 2.5rem; }

.page-header h2 {
    font-family: var(--font-display);
    font-size: 2.4rem;
    letter-spacing: -0.03em;
    line-height: 1.1;
    color: var(--text);
}

.page-header h2 em { font-style: italic; color: var(--accent); }

.meta-row {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-top: 0.6rem;
    flex-wrap: wrap;
}

.meta-row .badge {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--muted);
    background: var(--surface2);
    border: 1px solid var(--border);
    padding: 0.3rem 0.7rem;
    border-radius: 20px;
    letter-spacing: 0.04em;
}

.meta-row .badge span { color: var(--accent2); }

/* ── Stat cards ── */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.4rem 1.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    transition: border-color 0.2s;
}

.stat-card:hover { border-color: var(--accent); }

.stat-card .label {
    font-size: 0.72rem;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.stat-card .value {
    font-family: var(--font-display);
    font-size: 2rem;
    line-height: 1;
    color: var(--text);
}

.stat-card .sub {
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: 0.2rem;
}

.stat-card.accent-card { border-color: rgba(201,245,66,0.3); }
.stat-card.accent-card .value { color: var(--accent); }

/* ── Charts ── */
.charts-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.chart-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.6rem;
}

.chart-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.4rem;
}

.chart-card h3 {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
    margin-bottom: 0;
}

.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.3rem 0.65rem;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.btn-download:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: rgba(248,152,40,0.06);
}

.btn-download svg {
    width: 11px;
    height: 11px;
    flex-shrink: 0;
}

.chart-wrap { position: relative; }

/* ── Bottom grid ── */
.bottom-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

/* ── Table ── */
.table-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-top: 1rem;
}

.table-card-header {
    padding: 1.2rem 1.6rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.table-card-header h3 {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
}

.table-card-header .count {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--accent);
    background: rgba(201,245,66,0.08);
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
}

.donations-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.donations-table thead th {
    text-align: left;
    padding: 0.75rem 1rem;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.donations-table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background 0.1s;
}

.donations-table tbody tr:last-child { border-bottom: none; }
.donations-table tbody tr:hover { background: var(--surface2); }

.donations-table td {
    padding: 0.8rem 1rem;
    vertical-align: middle;
}

.donations-table td.amount {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--accent);
    font-weight: 500;
    white-space: nowrap;
}

.donations-table td.date {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--muted);
    white-space: nowrap;
}

.party-pill {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

/* ── Top donors ── */
.donor-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.donor-item { display: flex; align-items: center; gap: 0.8rem; }

.donor-rank {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--muted);
    width: 1.5rem;
    flex-shrink: 0;
}

.donor-bar-wrap { flex: 1; display: flex; flex-direction: column; gap: 4px; }

.donor-name-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.donor-name { font-size: 0.85rem; color: var(--text); font-weight: 500; }

.donor-amount { font-family: var(--font-mono); font-size: 0.8rem; color: var(--accent); }

.donor-bar-bg {
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
}

.donor-bar-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 1s cubic-bezier(0.4,0,0.2,1);
}

/* ── Party breakdown ── */
.party-breakdown { list-style: none; display: flex; flex-direction: column; gap: 0.7rem; }

.party-row { display: flex; align-items: center; gap: 0.8rem; }

.party-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

.party-info { flex: 1; display: flex; flex-direction: column; gap: 3px; }

.party-name-row { display: flex; justify-content: space-between; align-items: baseline; }

.party-name-text { font-size: 0.82rem; color: var(--text); }

.party-total-text { font-family: var(--font-mono); font-size: 0.8rem; color: var(--muted); }

.party-bar-bg { height: 3px; background: var(--border); border-radius: 2px; overflow: hidden; }

.party-bar-fill { height: 100%; border-radius: 2px; }

/* ── Error ── */
.error-card {
    background: rgba(245,66,96,0.1);
    border: 1px solid var(--danger);
    border-radius: var(--radius);
    padding: 1.5rem;
    color: var(--danger);
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

/* ── Animations ── */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.stat-card, .chart-card, .table-card {
    animation: fadeUp 0.4s ease both;
}

.stat-card:nth-child(1) { animation-delay: 0.05s; }
.stat-card:nth-child(2) { animation-delay: 0.10s; }
.stat-card:nth-child(3) { animation-delay: 0.15s; }
.stat-card:nth-child(4) { animation-delay: 0.20s; }

/* ── Responsive ── */
@media (max-width: 1024px) {
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .charts-grid { grid-template-columns: 1fr; }
    .bottom-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .stat-grid { grid-template-columns: 1fr 1fr; }
    .header-inner { flex-direction: column; align-items: flex-start; }
    nav { flex-wrap: wrap; }
    main { padding: 1.5rem 1rem 3rem; }
}

.seo-intro {
    font-size: 0.9rem;
    color: var(--muted);
    max-width: 680px;
    margin-bottom: 2rem;
    line-height: 1.7;
}