:root {
    --bg: #0f1115;
    --card: #171a21;
    --border: #262b35;
    --text: #e7eaf0;
    --muted: #8a93a3;
    --accent: #4f7cff;
    --green: #2ecc71;
    --red: #e5533d;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.wrap {
    max-width: 780px;
    margin: 0 auto;
    padding: 32px 20px 60px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

h1 { font-size: 1.4rem; margin: 0; }

.logout {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.9rem;
}
.logout:hover { color: var(--text); }

.muted { color: var(--muted); font-size: 0.9rem; }

code {
    background: #1f2430;
    padding: 2px 6px;
    border-radius: 4px;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 8px;
    margin-top: 20px;
}

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

.site-table th {
    text-align: left;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    padding: 10px 12px;
}

.site-table td {
    padding: 12px;
    border-top: 1px solid var(--border);
    font-size: 0.92rem;
}

.site-table a {
    color: var(--accent);
    text-decoration: none;
    word-break: break-all;
}
.site-table a:hover { text-decoration: underline; }

.toggle-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.switch {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 24px;
    flex-shrink: 0;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #3a4050;
    border-radius: 999px;
    transition: 0.2s;
}
.slider::before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    top: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.2s;
}
.switch input:checked + .slider { background: var(--green); }
.switch input:checked + .slider::before { transform: translateX(18px); }

.status-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 999px;
}
.status-badge.on { background: rgba(46,204,113,0.15); color: var(--green); }
.status-badge.off { background: rgba(229,83,61,0.15); color: var(--red); }

.save-btn {
    margin-top: 20px;
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 10px;
    background: var(--accent);
    color: white;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
}
.save-btn:hover { filter: brightness(1.08); }

.alert {
    margin-top: 16px;
    padding: 10px 14px;
    border-radius: 8px;
    background: rgba(229,83,61,0.15);
    color: var(--red);
    font-size: 0.9rem;
}
.alert.success {
    background: rgba(46,204,113,0.15);
    color: var(--green);
}

.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.login-card {
    width: 100%;
    max-width: 340px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: center;
}
.login-card input[type="password"] {
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #0f1115;
    color: var(--text);
    font-size: 0.95rem;
}
.login-card button {
    padding: 12px;
    border: none;
    border-radius: 8px;
    background: var(--accent);
    color: white;
    font-weight: 600;
    cursor: pointer;
}
