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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f0f2f5;
    color: #1a1a2e;
    line-height: 1.5;
}

header {
    background: #1a1a2e;
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 { font-size: 1.2rem; font-weight: 600; }
#status { font-size: 0.8rem; opacity: 0.7; }

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* ─── Stat cards ──────────────────────────────────────── */

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

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.stat-card h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #666;
    margin-bottom: 0.5rem;
}

.stat-card .value {
    font-size: 2rem;
    font-weight: 700;
    color: #1a1a2e;
}

/* ─── Table ───────────────────────────────────────────── */

h2 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #1a1a2e;
}

.runs-table {
    width: 100%;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border-collapse: collapse;
}

.runs-table th,
.runs-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #eee;
    font-size: 0.9rem;
}

.runs-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.03em;
}

.runs-table tr:last-child td { border-bottom: none; }
.runs-table tr:hover td { background: #f8f9fa; }

.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-ok { background: #d4edda; color: #155724; }
.badge-err { background: #f8d7da; color: #721c24; }

.errors-cell {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #999;
    font-size: 0.8rem;
}

/* ─── Login ────────────────────────────────────────────── */

.login-box {
    max-width: 360px;
    margin: 4rem auto;
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.login-box h2 {
    text-align: center;
    margin-bottom: 1.5rem;
}

.login-box input {
    width: 100%;
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.15s;
}

.login-box input:focus { border-color: #1a1a2e; }

.login-box button {
    width: 100%;
    padding: 0.75rem;
    background: #1a1a2e;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s;
}

.login-box button:hover { opacity: 0.85; }

/* ─── Logout ───────────────────────────────────────────── */

.btn-logout {
    margin-top: 2rem;
    padding: 0.5rem 1rem;
    background: transparent;
    color: #999;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}

.btn-logout:hover { color: #c0392b; border-color: #c0392b; }

/* ─── Loading / Error ─────────────────────────────────── */

.loading { color: #999; padding: 3rem; text-align: center; }
.error { color: #c0392b; padding: 2rem; text-align: center; }

/* ─── Responsive ──────────────────────────────────────── */

@media (max-width: 600px) {
    main { padding: 1rem; }
    .stats { grid-template-columns: repeat(2, 1fr); }
    .stat-card .value { font-size: 1.5rem; }
    .runs-table { font-size: 0.8rem; }
    .runs-table th, .runs-table td { padding: 0.5rem; }
}
