/* ============================================
   Parteispendenwatch – CSS Stylesheet
   ============================================ */

/* --- CSS Variables / Theming --- */
:root {
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    /* Light Theme */
    --bg: #f0f2f5;
    --bg-card: #ffffff;
    --bg-header: rgba(255, 255, 255, 0.85);
    --bg-hero: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    --bg-hover: #f7f8fa;
    --bg-input: #ffffff;
    --border: #e2e5ea;
    --border-input: #d1d5db;
    --text: #1a1a2e;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --text-on-hero: #ffffff;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 6px;
}

[data-theme="dark"] {
    --bg: #0f1117;
    --bg-card: #1a1d27;
    --bg-header: rgba(15, 17, 23, 0.9);
    --bg-hero: linear-gradient(135deg, #0f1117 0%, #1a1d27 50%, #0f3460 100%);
    --bg-hover: #22252f;
    --bg-input: #22252f;
    --border: #2a2d37;
    --border-input: #3a3d47;
    --text: #e8eaed;
    --text-secondary: #8b92a5;
    --text-muted: #5a6177;
    --text-on-hero: #e8eaed;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
}

/* --- Party Colors --- */
.party-CDU { --party-color: #000000; --party-bg: #1a1a1a; --party-text: #ffffff; }
[data-theme="dark"] .party-CDU { --party-color: #a0aec0; --party-bg: #2d3748; --party-text: #ffffff; }
.party-CSU { --party-color: #008ac5; --party-bg: #e6f4fb; --party-text: #ffffff; }
.party-SPD { --party-color: #e3000f; --party-bg: #fde8e9; --party-text: #ffffff; }
.party-FDP { --party-color: #ffed00; --party-bg: #fffde6; --party-text: #000000; }
.party-GRUENE { --party-color: #46962b; --party-bg: #eaf5e6; --party-text: #ffffff; }
.party-AfD { --party-color: #009ee0; --party-bg: #e6f6fd; --party-text: #ffffff; }
.party-LINKE { --party-color: #be3075; --party-bg: #f8e6ef; --party-text: #ffffff; }
.party-BSW { --party-color: #7b2d8e; --party-bg: #f2e6f5; --party-text: #ffffff; }
.party-SSW { --party-color: #003c8f; --party-bg: #e6ecf5; --party-text: #ffffff; }
.party-MLPD { --party-color: #cc0000; --party-bg: #f5e6e6; --party-text: #ffffff; }
.party-Volt { --party-color: #502379; --party-bg: #ede6f5; --party-text: #ffffff; }
.party-PARTEI { --party-color: #b5152b; --party-bg: #f5e6e9; --party-text: #ffffff; }
.party-NPD { --party-color: #8b4513; --party-bg: #f5efe6; --party-text: #ffffff; }
.party-DVU { --party-color: #555555; --party-bg: #efefef; --party-text: #ffffff; }
.party-DKP { --party-color: #cc0000; --party-bg: #f5e6e6; --party-text: #ffffff; }
.party-FREIEWAEHLER { --party-color: #f58220; --party-bg: #fef3e6; --party-text: #ffffff; }
.party-TeamTodenhoefer { --party-color: #1a237e; --party-bg: #e6e7f5; --party-text: #ffffff; }
.party-WerteUnion { --party-color: #c41e3a; --party-bg: #f5e6ea; --party-text: #ffffff; }
.party-dieBasis { --party-color: #e67e22; --party-bg: #fef5e6; --party-text: #ffffff; }
.party-AGFG { --party-color: #2e7d32; --party-bg: #e6f5e7; --party-text: #ffffff; }
.party-OTHER { --party-color: #78909c; --party-bg: #eceff1; --party-text: #ffffff; }

/* --- Reset & Base --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    transition: background 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* --- Loading Overlay --- */
.loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    transition: opacity 0.4s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-content {
    text-align: center;
    color: var(--text-secondary);
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* --- Header --- */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-header);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 32px;
    line-height: 1;
}

.logo-title {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.logo-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.source-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--radius-xs);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.source-link:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-xs);
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.theme-toggle:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: block; }

/* --- Hero Stats --- */
.hero {
    background: var(--bg-hero);
    padding: 48px 0;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    backdrop-filter: blur(8px);
}

.stat-card.stat-highlight {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.3);
}

.stat-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 8px;
}

.stat-value {
    display: block;
    font-size: 28px;
    font-weight: 800;
    color: var(--text-on-hero);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.stat-sub {
    display: block;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.45);
    margin-top: 4px;
}

.hero-note {
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
    font-size: 12px;
    margin-top: 20px;
}

/* --- Main Content --- */
.main {
    padding: 32px 0 64px;
}

/* --- Cards --- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    transition: background 0.3s, border-color 0.3s;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text);
}

.card-title svg {
    color: var(--accent);
    flex-shrink: 0;
}

/* --- Dashboard Row --- */
.dashboard-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.dashboard-row .card {
    margin-bottom: 0;
}

/* --- Chart Containers --- */
.chart-container {
    position: relative;
    height: 360px;
}

.chart-wide {
    height: 300px;
}

/* --- Top Donors --- */
.donors-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 360px;
    overflow-y: auto;
}

.donor-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    background: var(--bg-hover);
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.donor-item:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.donor-rank {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
    background: var(--accent);
    color: #fff;
}

.donor-rank.gold { background: linear-gradient(135deg, #f59e0b, #d97706); }
.donor-rank.silver { background: linear-gradient(135deg, #9ca3af, #6b7280); }
.donor-rank.bronze { background: linear-gradient(135deg, #d97706, #92400e); }

.donor-info {
    flex: 1;
    min-width: 0;
}

.donor-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.donor-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.donor-amount {
    font-size: 16px;
    font-weight: 700;
    color: var(--accent);
    white-space: nowrap;
}

/* --- Filters --- */
.filters-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.filter-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.filter-group select,
.filter-group input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-input);
    border-radius: var(--radius-xs);
    background: var(--bg-input);
    color: var(--text);
    font-size: 14px;
    font-family: var(--font);
    transition: all 0.2s;
    appearance: none;
    -webkit-appearance: none;
}

.filter-group select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.filter-group select:focus,
.filter-group input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.filter-stats {
    display: flex;
    gap: 24px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    font-size: 14px;
    color: var(--text-secondary);
}

.filter-stats span {
    font-weight: 600;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-xs);
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: rgba(59, 130, 246, 0.05);
}

/* --- Donations Table --- */
.table-card {
    padding: 0;
    overflow: hidden;
}

.table-wrapper {
    overflow-x: auto;
}

.donations-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.donations-table thead {
    background: var(--bg-hover);
    position: sticky;
    top: 0;
    z-index: 1;
}

.donations-table th {
    padding: 14px 18px;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
    user-select: none;
}

.donations-table th.sortable {
    cursor: pointer;
    transition: color 0.2s;
}

.donations-table th.sortable:hover {
    color: var(--accent);
}

.sort-icon {
    display: inline-block;
    margin-left: 4px;
    font-size: 10px;
    opacity: 0.3;
    transition: opacity 0.2s;
}

.sorted-asc .sort-icon,
.sorted-desc .sort-icon {
    opacity: 1;
    color: var(--accent);
}

.sorted-asc .sort-icon {
    transform: rotate(180deg);
}

.donations-table td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.donations-table tbody tr {
    transition: background 0.15s;
}

.donations-table tbody tr:hover {
    background: var(--bg-hover);
}

.donations-table tbody tr:last-child td {
    border-bottom: none;
}

/* Party Badge in Table */
.party-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.party-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.amount-cell {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    text-align: right;
}

.donor-cell {
    max-width: 320px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.date-cell {
    white-space: nowrap;
    color: var(--text-secondary);
}

.doc-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--accent);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
}

.doc-link:hover {
    text-decoration: underline;
}

/* --- Pagination --- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 16px 18px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

.page-btn {
    min-width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    border-radius: var(--radius-xs);
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.2s;
}

.page-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.page-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #ffffff;
}

.page-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.page-ellipsis {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 14px;
}

/* --- Footer --- */
.footer {
    padding: 32px 0;
    border-top: 1px solid var(--border);
    background: var(--bg-card);
}

.footer-inner {
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.8;
}

.footer-inner a {
    color: var(--accent);
    text-decoration: none;
}

.footer-inner a:hover {
    text-decoration: underline;
}

.footer-meta {
    margin-top: 8px;
    font-size: 12px;
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .dashboard-row {
        grid-template-columns: 1fr;
    }

    .hero-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .filters-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .container {
        padding: 0 16px;
    }

    .header-inner {
        padding: 10px 0;
    }

    .source-link span {
        display: none;
    }

    .hero {
        padding: 32px 0;
    }

    .hero-stats {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-value {
        font-size: 22px;
    }

    .filters-grid {
        grid-template-columns: 1fr;
    }

    .card {
        padding: 16px;
        border-radius: var(--radius-sm);
    }

    .donations-table th,
    .donations-table td {
        padding: 10px 12px;
    }

    .donor-cell {
        max-width: 180px;
    }

    .dashboard-row {
        gap: 16px;
    }

    .logo-title {
        font-size: 17px;
    }

    .card-title {
        font-size: 16px;
    }

    .chart-container {
        height: 280px;
    }

    .filter-stats {
        flex-direction: column;
        gap: 8px;
    }
}

/* --- Animations --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeInUp 0.4s ease both;
}

.dashboard-row .card:nth-child(2) {
    animation-delay: 0.1s;
}

/* --- Modal Overlay --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    padding: 24px;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 800px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    position: relative;
    transform: translateY(20px) scale(0.97);
    transition: transform 0.25s ease;
}

.modal-overlay.active .modal {
    transform: translateY(0) scale(1);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10;
}

.modal-close:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--bg-hover);
}

.modal-header {
    padding: 28px 28px 0;
    flex-shrink: 0;
}

.modal-header-title {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 8px;
}

.modal-header-title h2 {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text);
}

.modal-header-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 800;
    flex-shrink: 0;
}

.modal-header-sub {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.modal-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.modal-stat {
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px;
    text-align: center;
}

.modal-stat-value {
    display: block;
    font-size: 20px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.02em;
}

.modal-stat-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-top: 2px;
}

.modal-body {
    padding: 0 28px 28px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.modal-section-title {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.modal-donation-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.modal-donation-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: var(--bg-hover);
    border: 1px solid var(--border);
    transition: all 0.15s;
}

.modal-donation-item:hover {
    border-color: var(--accent);
}

.modal-donation-date {
    font-size: 13px;
    color: var(--text-muted);
    min-width: 85px;
    flex-shrink: 0;
}

.modal-donation-info {
    flex: 1;
    min-width: 0;
}

.modal-donation-donor {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.modal-donation-party {
    font-size: 12px;
    color: var(--text-muted);
}

.modal-donation-amount {
    font-size: 15px;
    font-weight: 700;
    color: var(--accent);
    white-space: nowrap;
    flex-shrink: 0;
}

.modal-donation-link {
    flex-shrink: 0;
}

.modal-chart-container {
    height: 200px;
    margin-bottom: 20px;
}

/* Clickable elements */
.clickable {
    cursor: pointer;
}

.donor-cell.clickable:hover {
    color: var(--accent);
    text-decoration: underline;
}

.party-badge.clickable:hover {
    filter: brightness(1.15);
    box-shadow: 0 0 0 2px var(--accent);
}

.donor-item.clickable:hover {
    border-color: var(--accent);
    cursor: pointer;
}

@media (max-width: 640px) {
    .modal-overlay {
        padding: 12px;
    }

    .modal {
        max-height: 90vh;
    }

    .modal-header {
        padding: 20px 18px 0;
    }

    .modal-body {
        padding: 0 18px 20px;
    }

    .modal-stats {
        grid-template-columns: 1fr;
    }

    .modal-header-title h2 {
        font-size: 18px;
    }
}

/* --- Tab Navigation --- */
.tab-nav {
    display: flex;
    gap: 4px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 5px;
    margin-bottom: 24px;
    width: fit-content;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.tab-btn:hover {
    color: var(--text);
    background: var(--bg);
}

.tab-btn.active {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

.tab-btn svg {
    flex-shrink: 0;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* --- Map Styles --- */
.map-card {
    overflow: hidden;
}

.map-header {
    flex-wrap: wrap;
    gap: 12px;
}

.map-container {
    height: 600px;
    border-radius: 0 0 16px 16px;
    z-index: 1;
}

.map-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
}

.map-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    background: var(--bg);
    border-radius: 20px;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 11px;
}

.map-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.map-info {
    padding: 14px 24px;
    font-size: 12px;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
}

.leaflet-popup-content {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    line-height: 1.5;
    min-width: 200px;
}

.popup-title {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 6px;
    color: #1a1a2e;
}

.popup-party {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 6px;
}

.popup-amount {
    font-size: 16px;
    font-weight: 800;
    color: #1a1a2e;
    margin: 6px 0;
}

.popup-date {
    font-size: 11px;
    color: #666;
}

.popup-address {
    font-size: 11px;
    color: #888;
    margin-top: 4px;
    border-top: 1px solid #eee;
    padding-top: 6px;
}

@media (max-width: 640px) {
    .tab-nav {
        width: 100%;
    }
    .tab-btn {
        flex: 1;
        justify-content: center;
        padding: 10px 14px;
        font-size: 13px;
    }
    .map-container {
        height: 450px;
    }
}

/* --- No-results state --- */
.no-results {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.no-results-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.no-results-text {
    font-size: 16px;
    font-weight: 500;
}
