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

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

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

header {
    background: #1e293b;
    color: #fff;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

header h1 { font-size: 1.4rem; }

header nav { display: flex; gap: 1.2rem; align-items: center; }

header nav a { color: #94a3b8; font-size: 0.9rem; }
header nav a:hover { color: #fff; text-decoration: none; }

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

h2 { margin-bottom: 1rem; font-size: 1.3rem; }

.subtitle { color: #64748b; margin-bottom: 1.5rem; }

/* --- Forms --- */
label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.3rem;
    font-size: 0.9rem;
}

input[type="text"],
input[type="url"],
input[type="password"] {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.95rem;
    margin-bottom: 1rem;
    background: #fff;
}

select {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.95rem;
    margin-bottom: 1rem;
    background: #fff;
    cursor: pointer;
}

input:focus, select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}

button, .btn-small, .btn-cancel {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    background: #2563eb;
    color: #fff;
}

button:hover { background: #1d4ed8; }

.btn-small {
    padding: 0.35rem 0.7rem;
    font-size: 0.8rem;
    background: #e2e8f0;
    color: #333;
}

.btn-small:hover { background: #cbd5e1; text-decoration: none; }

.btn-danger { background: #dc2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; }

.btn-cancel {
    background: #e2e8f0;
    color: #333;
}

.btn-cancel:hover { background: #cbd5e1; text-decoration: none; }

.form-actions {
    display: flex;
    gap: 0.8rem;
    align-items: center;
    margin-top: 0.5rem;
}

.site-form { max-width: 500px; }

/* --- Alerts --- */
.alert {
    padding: 0.8rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

/* --- Tables --- */
table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

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

th {
    background: #f8fafc;
    font-weight: 600;
    color: #475569;
}

tr:last-child td { border-bottom: none; }

code {
    background: #f1f5f9;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.85rem;
    word-break: break-all;
}

/* --- Badges --- */
.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-up   { background: #dcfce7; color: #166534; }
.badge-down { background: #fef2f2; color: #991b1b; }
.badge-pending { background: #fef9c3; color: #854d0e; }

.error-msg { color: #991b1b; }
.error-cell { max-width: 300px; word-break: break-word; }

/* --- Pagination --- */
.pagination {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: center;
    margin-top: 1.5rem;
    font-size: 0.9rem;
}

.pagination span { color: #64748b; }

/* --- Inline form --- */
.inline-form {
    display: flex;
    gap: 0.6rem;
    margin-bottom: 1.5rem;
    max-width: 450px;
}

.inline-form input[type="text"] { margin-bottom: 0; flex: 1; }

.dimmed { color: #94a3b8; font-size: 0.85rem; }

/* --- Empty state --- */
.empty {
    text-align: center;
    color: #64748b;
    padding: 3rem 0;
    font-size: 1rem;
}

/* --- Login page --- */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: #1e293b;
}

.login-box {
    background: #fff;
    padding: 2.5rem 2rem;
    border-radius: 12px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    text-align: center;
}

.login-box h1 { margin-bottom: 0.2rem; font-size: 1.6rem; }

.login-box .subtitle {
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
}

.login-box label { text-align: left; }

.login-box button { width: 100%; margin-top: 0.5rem; }
