* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.login-container {
    max-width: 360px;
    margin: 120px auto;
    padding: 40px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
    text-align: center;
}

.login-container h2 { margin-bottom: 24px; color: #1a1a1a; }
.login-container input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    margin-bottom: 16px;
}
.login-container button {
    width: 100%;
    padding: 10px;
    background: #4a90d9;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
}
.login-container button:hover { background: #357abd; }

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 16px 24px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.header h1 { font-size: 20px; color: #1a1a1a; }
.header a { color: #4a90d9; text-decoration: none; font-size: 14px; }

.nav {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.nav a {
    padding: 8px 16px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #555;
    font-size: 14px;
}
.nav a.active, .nav a:hover {
    background: #4a90d9;
    color: #fff;
    border-color: #4a90d9;
}

.card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    padding: 20px;
    margin-bottom: 20px;
}

.card h3 {
    margin-bottom: 16px;
    font-size: 16px;
    color: #1a1a1a;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    padding: 20px;
    text-align: center;
}
.stat-card .value { font-size: 32px; font-weight: bold; color: #4a90d9; }
.stat-card .label { font-size: 13px; color: #888; margin-top: 4px; }

.filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
    margin-bottom: 20px;
    padding: 16px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.filter-form label {
    font-size: 12px;
    color: #888;
    display: block;
    margin-bottom: 4px;
}

.filter-form input, .filter-form select {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
}

.filter-form button {
    padding: 6px 16px;
    background: #4a90d9;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

table th {
    background: #f8f9fa;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    color: #555;
    border-bottom: 2px solid #eee;
    white-space: nowrap;
}

table td {
    padding: 8px 12px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: top;
}

table tr:hover { background: #fafbfc; }

.anomaly-row { background: #fff5f5 !important; }
.anomaly-row:hover { background: #ffecec !important; }

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.badge-normal { background: #e8f5e9; color: #2e7d32; }
.badge-anomaly { background: #ffebee; color: #c62828; }

.pagination {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-top: 20px;
}

.pagination a, .pagination span {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #555;
    font-size: 13px;
}
.pagination span.current {
    background: #4a90d9;
    color: #fff;
    border-color: #4a90d9;
}

.alert { padding: 10px 16px; border-radius: 4px; margin-bottom: 16px; font-size: 14px; }
.alert-error { background: #ffebee; color: #c62828; }
.alert-info { background: #e3f2fd; color: #1565c0; }

.text-muted { color: #999; }
.text-truncate { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.dist-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.dist-bar .bar {
    height: 20px;
    background: #4a90d9;
    border-radius: 3px;
    min-width: 2px;
}
.dist-bar .name { min-width: 100px; font-size: 13px; }
.dist-bar .count { font-size: 12px; color: #888; }
