* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #0f1115;
    color: #e6e8eb;
    min-height: 100vh;
    font-size: 14px;
}
a { color: inherit; text-decoration: none; }
code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; }

/* Top nav */
.topbar {
    background: #161a22;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #232a36;
    height: 56px;
}
.nav-left { display: flex; align-items: center; gap: 24px; }
.nav-right { display: flex; align-items: center; gap: 16px; }
.brand { font-weight: 600; font-size: 15px; margin-right: 8px; }
.nav-link { color: #9aa3b2; font-size: 14px; padding: 8px 0; }
.nav-link:hover { color: #e6e8eb; }
.nav-link.active { color: #4d9eff; border-bottom: 2px solid #4d9eff; }
.user { color: #9aa3b2; font-size: 13px; }
.logout { color: #6b7589; font-size: 13px; }
.logout:hover { color: #e6e8eb; }
.cache-info { color: #6b7589; font-size: 12px; }
.btn-refresh {
    background: #232a36; color: #e6e8eb; border: none;
    padding: 6px 12px; border-radius: 6px; cursor: pointer;
    font-size: 13px;
}
.btn-refresh:hover:not(:disabled) { background: #2d3540; }
.btn-refresh:disabled { opacity: 0.6; cursor: wait; }

/* Login */
.login-box {
    max-width: 400px; margin: 100px auto;
    background: #161a22; padding: 40px;
    border-radius: 12px; text-align: center;
    border: 1px solid #232a36;
}
.login-box h1 { margin-bottom: 8px; }
.login-box p { color: #9aa3b2; margin-bottom: 32px; }

/* Page */
main { padding: 24px; }
.page h1 { margin-bottom: 20px; font-size: 22px; }
.page h2 { margin-bottom: 12px; font-size: 16px; font-weight: 600; color: #c8d0dd; }
.count { color: #6b7589; font-size: 14px; font-weight: 400; }
.muted { color: #6b7589; }
.muted.ok { color: #5cb85c; }

/* Cards */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}
.card {
    background: #161a22;
    border: 1px solid #232a36;
    border-radius: 10px;
    padding: 16px;
    display: block;
    transition: border-color 0.15s, transform 0.15s;
}
.card:hover { border-color: #4d9eff; transform: translateY(-1px); }
.card-head { margin-bottom: 12px; }
.card-title { font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card-sub { color: #6b7589; font-size: 13px; margin-top: 2px; }
.status-dot {
    width: 8px; height: 8px; border-radius: 50%;
    display: inline-block;
}
.status-dot.green { background: #5cb85c; }
.status-dot.red { background: #d9534f; }
.card-stats { display: flex; gap: 16px; margin-bottom: 12px; }
.stat { flex: 1; }
.stat label { display: block; color: #6b7589; font-size: 11px; text-transform: uppercase; margin-bottom: 2px; }
.stat span { font-size: 14px; font-weight: 500; }
.card-foot {
    display: flex; justify-content: space-between;
    padding-top: 12px; border-top: 1px solid #232a36;
    font-size: 13px; color: #9aa3b2;
}
.card-error { color: #d9534f; font-size: 13px; }
.uptime { color: #6b7589; }

/* Blocks */
.block {
    background: #161a22;
    border: 1px solid #232a36;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 16px;
}
.redir-list { list-style: none; }
.redir-list li {
    padding: 8px 0;
    display: flex; align-items: center; gap: 12px;
    border-bottom: 1px solid #1d232c;
}
.redir-list li:last-child { border-bottom: none; }
.redir-list code { color: #c8d0dd; }
.arrow { color: #6b7589; }
.alert-list { list-style: none; }
.alert-list li {
    color: #f0ad4e; padding: 6px 0; font-size: 13px;
}

/* Sites table */
.filters {
    display: flex; gap: 12px; margin-bottom: 16px;
    flex-wrap: wrap;
}
.filters input, .filters select {
    background: #161a22; border: 1px solid #232a36;
    color: #e6e8eb; padding: 8px 12px; border-radius: 6px;
    font-size: 13px; min-width: 160px;
}
.filters input { flex: 1; min-width: 200px; }
.sites-table {
    width: 100%;
    background: #161a22;
    border: 1px solid #232a36;
    border-radius: 10px;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
}
.sites-table thead th {
    text-align: left; padding: 12px 16px;
    color: #6b7589; font-size: 12px; text-transform: uppercase;
    font-weight: 600; background: #1a1f29;
    border-bottom: 1px solid #232a36;
}
.sites-table tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid #1d232c;
}
.sites-table tbody tr:last-child td { border-bottom: none; }
.sites-table tbody tr:hover { background: #1a1f29; }
.domain-link { color: #4d9eff; font-weight: 500; }
.domain-link:hover { text-decoration: underline; }
.server-badge {
    background: #232a36; color: #9aa3b2;
    padding: 3px 8px; border-radius: 4px;
    font-size: 12px;
}
.badge {
    display: inline-block;
    padding: 3px 8px; border-radius: 4px;
    font-size: 12px; font-weight: 500;
}
.badge.ok { background: rgba(92, 184, 92, 0.15); color: #5cb85c; }
.badge.bad { background: rgba(217, 83, 79, 0.15); color: #d9534f; }
.badge.warn { background: rgba(240, 173, 78, 0.15); color: #f0ad4e; font-family: monospace; }
