/* ── Vahvuus-badget ── */
.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: capitalize;
}

.badge-korkea {
    background-color: #c0392b;
    color: #fff;
}

.badge-keskitaso {
    background-color: #e67e22;
    color: #fff;
}

.badge-matala {
    background-color: #27ae60;
    color: #fff;
}

/* ── Status-badget ── */
.badge-status {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-uusi {
    background-color: #2980b9;
    color: #fff;
}

.badge-käsitelty {
    background-color: #8e44ad;
    color: #fff;
}

.badge-hylätty {
    background-color: #7f8c8d;
    color: #fff;
}

.badge-arkistoitu {
    background-color: #2c3e50;
    color: #ccc;
}

/* ── Tilastokortit ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    text-align: center;
    padding: 1.5rem 1rem;
    border-radius: 0.5rem;
    background: var(--pico-card-background-color);
    border: 1px solid var(--pico-muted-border-color);
}

.stat-card .stat-value {
    font-size: 2.2rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
}

.stat-card .stat-label {
    font-size: 0.85rem;
    color: var(--pico-muted-color);
    margin: 0.25rem 0 0 0;
}

/* ── Suodatinrivi ── */
.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-end;
    margin-bottom: 1.5rem;
}

.filter-row label {
    margin-bottom: 0;
}

.filter-row .filter-group {
    display: flex;
    flex-direction: column;
    min-width: 140px;
    flex: 1;
}

.filter-row .filter-group input,
.filter-row .filter-group select {
    margin-bottom: 0;
}

.filter-row .filter-actions {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
}

.filter-row .filter-actions button {
    margin-bottom: 0;
    white-space: nowrap;
}

/* ── Taulukko ── */
table tbody tr {
    transition: background-color 0.15s ease;
}

table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.04);
}

/* ── Status-dropdown taulukossa ── */
.status-select {
    padding: 0.2rem 0.4rem;
    font-size: 0.8rem;
    margin: 0;
    min-width: 110px;
    height: auto;
}

/* ── Sivutus ── */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    padding: 0.4rem 0.75rem;
    border-radius: 0.25rem;
    font-size: 0.85rem;
    text-decoration: none;
}

.pagination .active {
    background: var(--pico-primary-background);
    color: var(--pico-primary-inverse);
}

/* ── Haun tila ── */
.scan-status {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.scan-status.running {
    background: rgba(41, 128, 185, 0.15);
    border: 1px solid #2980b9;
}

.scan-status.completed {
    background: rgba(39, 174, 96, 0.15);
    border: 1px solid #27ae60;
}

.scan-status.failed {
    background: rgba(192, 57, 43, 0.15);
    border: 1px solid #c0392b;
}

/* ── Kategoriat ── */
.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-list li {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--pico-muted-border-color);
    font-size: 0.9rem;
}

.category-list li:last-child {
    border-bottom: none;
}

.category-count {
    font-weight: 700;
}

/* ── Dashboard grid ── */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Misc ── */
.nav-brand {
    font-size: 1.1rem;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--pico-muted-color);
}

.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }

.section-title {
    margin-bottom: 1rem;
}

article {
    margin-bottom: 0;
}

/* Scan button area */
.scan-area {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.htmx-indicator {
    display: none;
}

.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
    display: inline-block;
}
