:root {
    --bg: #f4f6f8;
    --panel: #ffffff;
    --text: #1f2933;
    --muted: #52606d;
    --border: #d9e2ec;
    --blue: #1f5fbf;
    --green: #0b7a43;
    --red: #b42318;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
    color: var(--text);
    background: radial-gradient(circle at 15% 10%, #eef4ff 0%, var(--bg) 55%);
}

.app-body-green {
    background: radial-gradient(circle at 15% 10%, #edf9f0 0%, #f4f8f5 55%);
}

.shell {
    max-width: 1120px;
    margin: 24px auto;
    padding: 0 16px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

h1 {
    margin: 0 0 8px;
}

.meta {
    margin: 4px 0;
    color: var(--muted);
}

.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
}

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

th,
td {
    text-align: left;
    padding: 10px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

th {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--muted);
}

.pill {
    display: inline-block;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
}

.pill.on {
    background: var(--green);
}

.pill.off {
    background: var(--red);
}

.btn {
    display: inline-block;
    text-decoration: none;
    border: none;
    cursor: pointer;
    border-radius: 8px;
    padding: 10px 14px;
    background: var(--blue);
    color: #fff;
    font-weight: 600;
}

.btn.ghost {
    background: #fff;
    color: var(--blue);
    border: 1px solid var(--blue);
}

.top-actions {
    display: flex;
    gap: 8px;
}

.region-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 12px;
    color: #09326f;
    background: #dbeafe;
    border: 1px solid #bfdbfe;
}

.debug {
    border-left: 5px solid #7b61ff;
}

.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #c8d2dd;
    transition: .2s;
    border-radius: 999px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    top: 3px;
    background-color: white;
    transition: .2s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #137333;
}

input:checked + .slider:before {
    transform: translateX(22px);
}

@media (max-width: 900px) {
    .topbar {
        flex-direction: column;
    }

    table,
    thead,
    tbody,
    th,
    td,
    tr {
        display: block;
    }

    thead {
        display: none;
    }

    tr {
        border: 1px solid var(--border);
        border-radius: 8px;
        margin-bottom: 10px;
        background: #fff;
    }

    td {
        border: none;
        border-bottom: 1px solid var(--border);
    }
}
