/* ============================================================
   Tabellen: Angreifer-IPs, Top-Länder, Layout
   ============================================================ */

.attacks-row {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.attacks-section {
    flex: 3 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.top-countries-section {
    flex: 1 1 0;
    min-width: 14rem;
    max-width: 22rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.attacks-row .section-title__hint {
    display: block;
}

.attacks-row .section-title {
    min-height: 2.6rem;
}

.section-title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--text-strong);
}

.section-title__hint {
    font-weight: 400;
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    color: var(--text-dim);
}

.th-filter {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    overflow: visible;
}

.source-filter__select {
    padding: 0.35rem 0.7rem;
    background: var(--bg-panel);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.source-filter__select:hover        { border-color: var(--border-light); color: var(--text-strong); }
.source-filter__select:focus-visible { outline: 2px solid var(--accent-yellow); outline-offset: 1px; }

.table-container {
    max-height: 26rem;
    overflow: auto;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 6px;
}

.attacks-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: 0.82rem;
}

/* Spaltenbreiten der IP-Tabelle – fix, damit Aufklappen keine Verschiebung auslöst */
.attacks-section .attacks-table th:nth-child(1) { width: 2.4rem; }  /* Flagge */
.attacks-section .attacks-table th:nth-child(2) { width: 13%;     }  /* Land   */
.attacks-section .attacks-table th:nth-child(3) { width: 10rem;   }  /* IP     */
.attacks-section .attacks-table th:nth-child(4) { width: 7rem;    }  /* Quelle */
.attacks-section .attacks-table th:nth-child(5) { width: 8rem;    }  /* Verweildauer */
.attacks-section .attacks-table th:nth-child(6) { width: 9rem;    }  /* Zuletzt gesehen */

.attacks-table th,
.attacks-table td {
    padding: 0.55rem 0.9rem;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-bottom: 1px solid var(--border);
}

.attacks-table thead th {
    position: sticky;
    top: 0;
    background: var(--bg-panel);
    color: var(--text-dim);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 600;
}

.attacks-table tbody tr:last-child td { border-bottom: none; }
.attacks-table tbody tr:hover          { background: var(--overlay-hover); }

.flag-icon {
    display: inline-block;
    width: 1.5rem;
    height: 1.125rem;
    object-fit: cover;
    vertical-align: middle;
    border-radius: 2px;
    border: 1px solid var(--border-light);
}

.attacks-table .ip-cell {
    font-weight: 600;
    color: var(--text-strong);
    letter-spacing: 0.02em;
}

.attacks-table .empty-row td {
    text-align: center;
    color: var(--text-dim);
    font-style: italic;
    white-space: normal;
}

.rank-cell {
    width: 2rem;
    text-align: right;
    color: var(--text-dim);
    font-variant-numeric: tabular-nums;
}

.attacks-count {
    font-weight: 700;
    color: var(--accent-fail2ban);
    font-variant-numeric: tabular-nums;
}

.country-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.source-badge {
    display: inline-block;
    padding: 0.1em 0.55em;
    border-radius: 3px;
    font-weight: 700;
    font-size: 0.78rem;
}

.source-badge--fail2ban {
    background: rgba(255, 34, 34, 0.18);
    color: var(--accent-fail2ban);
}

.source-badge--endlessh {
    background: rgba(255, 153, 0, 0.18);
    color: var(--accent-endlessh);
}

.source-badge--nextcloud {
    background: rgba(0, 130, 201, 0.18);
    color: var(--accent-nextcloud);
}

.source-badge--ssh {
    background: rgba(168, 85, 247, 0.18);
    color: var(--accent-ssh);
}

.source-badge--npm {
    background: rgba(249, 115, 22, 0.18);
    color: var(--accent-npm);
}
