* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: Segoe UI, Arial, sans-serif;
    background: #f4f6f8;
    color: #1f2937;
}

a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: #111827;
    color: #fff;
}

.topbar nav a {
    color: #d1d5db;
    margin-left: 1rem;
}

.topbar nav a.active,
.topbar nav a:hover {
    color: #fff;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
}

.card {
    background: #fff;
    border-radius: 10px;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

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

.stat {
    background: #fff;
    border-radius: 10px;
    padding: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.stat span {
    display: block;
    color: #6b7280;
    font-size: 0.9rem;
}

.stat strong {
    font-size: 1.8rem;
}

.stat.up strong { color: #059669; }
.stat.down strong { color: #dc2626; }
.stat.wp strong { color: #d97706; }

.table-wrap { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    vertical-align: top;
}

th {
    font-size: 0.85rem;
    text-transform: uppercase;
    color: #6b7280;
}

.badge {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
}

.badge-up { background: #d1fae5; color: #065f46; }
.badge-down { background: #fee2e2; color: #991b1b; }
.badge-wp { background: #fef3c7; color: #92400e; }

.form label {
    display: block;
    margin-bottom: 1rem;
}

.form input[type="text"],
.form input[type="url"],
.form input[type="email"],
.form input[type="password"],
.form input[type="file"],
.form textarea {
    width: 100%;
    margin-top: 0.35rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font: inherit;
}

.inline-form {
    display: grid;
    grid-template-columns: 1fr 2fr auto;
    gap: 1rem;
    align-items: end;
}

button {
    background: #2563eb;
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: 0.7rem 1rem;
    cursor: pointer;
    font: inherit;
}

.btn-secondary { background: #6b7280; }
.btn-danger { background: #dc2626; }

.actions {
    display: flex;
    gap: 0.5rem;
}

.test-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.test-actions form {
    margin: 0;
}

.actions form { margin: 0; }

.alert {
    padding: 0.85rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.alert-success { background: #ecfdf5; color: #065f46; }
.alert-error { background: #fef2f2; color: #991b1b; }

.muted { color: #6b7280; }

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-card {
    width: 100%;
    max-width: 460px;
}

.inline-pre {
    margin: 0;
    white-space: pre-wrap;
    font-family: inherit;
    font-size: 0.85rem;
}

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

    .topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .topbar nav a {
        margin-left: 0;
        margin-right: 1rem;
    }
}
