:root {
    --bg: linear-gradient(180deg, #f8fafc 0%, #e2e8f0 100%);
    --card: #ffffff;
    --muted: #1e293b;
    --accent: #0d9488;
    --accent2: #d97706;
    --glass: rgba(255, 255, 255, 0.8);
    --radius: 12px;
    --maxw: 1200px;
    --shadow:
        0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}
* {
    box-sizing: border-box;
}
body {
    margin: 0;
    min-height: 100vh;
    font-family:
        Inter,
        system-ui,
        -apple-system,
        "Segoe UI",
        Roboto,
        Arial;
    background: var(--bg);
    color: var(--muted);
    -webkit-font-smoothing: antialiased;
}
.wrap {
    max-width: var(--maxw);
    margin: 28px auto;
    padding: 20px;
}

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}
.brand {
    display: flex;
    gap: 12px;
    align-items: center;
}
.logo {
    background: var(--teal);
    color: #fff;
    font-weight: 800;
    padding: 12px 18px;
    border-radius: 10px;
    font-size: 18px;
    letter-spacing: 1px;
}
h1 {
    margin: 0;
    font-size: 20px;
}
p.sub {
    margin: 0;
    color: #64748b;
    font-size: 13px;
}

.controls {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}
select,
input[type="search"],
.btn {
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    background: transparent;
    color: var(--muted);
    font-weight: 600;
}
.btn {
    cursor: pointer;
    background: #0ea5a4;
    /* linear-gradient(90deg, var(--accent), var(--accent2)); */
    color: #ffffff;
}
.panel {
    background: #ffffff;
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow);
    border: 1px solid #e2e8f0;
}

/* grid of states */
.grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 18px;
}
.state-card {
    background: var(--card);
    padding: 12px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    cursor: pointer;
    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease;
}
.state-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow);
}
.state-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.state-name {
    font-weight: 700;
}
.state-meta {
    font-size: 12px;
    color: #64748b;
}
.lead-candidate {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}
.bar {
    height: 8px;
    border-radius: 6px;
    background: #e2e8f0;
    overflow: hidden;
    margin-top: 8px;
}
.bar > i {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    width: 30%;
}

/* modal */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 50;
}
.modal {
    background: #ffffff;
    padding: 18px;
    border-radius: 12px;
    max-width: 800px;
    width: 100%;
    color: var(--muted);
    border: 1px solid #e2e8f0;
}
.modal h3 {
    margin: 0 0 8px 0;
}
.modal .close {
    position: absolute;
    right: 14px;
    top: 12px;
    background: transparent;
    border: 0;
    color: var(--muted);
    font-weight: 700;
    cursor: pointer;
}

/* responsive */
@media (max-width: 1000px) {
    .grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (max-width: 760px) {
    .grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
}
@media (max-width: 420px) {
    .grid {
        grid-template-columns: 1fr;
    }
    header {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
}

/* utilities */
.muted {
    color: #64748b;
}
.small {
    font-size: 13px;
    color: #64748b;
}
.loader {
    height: 6px;
    background: #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
}
.loader > i {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #0ea5a4, #f59e0b);
    width: 0%;
    transition: width 0.8s ease;
}
