* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #f5f7fa;
    color: #1d2733;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

main {
    width: min(1120px, calc(100% - 32px));
    margin: 32px auto;
}

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

h1, h2, p {
    margin: 0;
}

h1 {
    font-size: 32px;
}

h2 {
    font-size: 18px;
    margin-bottom: 16px;
}

p {
    margin-top: 8px;
    color: #627082;
}

.nav-actions, .section-head {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
}

.nav-actions a {
    white-space: nowrap;
}

.section-head {
    margin-bottom: 16px;
}

.section-head h2 {
    margin-bottom: 0;
}

.summary, .muted {
    color: #627082;
    font-size: 14px;
}

.panel, .notice {
    background: #fff;
    border: 1px solid #dde4ec;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.notice {
    color: #8a1f11;
    border-color: #ffc9bf;
    background: #fff4f1;
}

.success {
    color: #0f5f3f;
    border-color: #bdeccb;
    background: #effaf3;
}

.monitor-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.settings-form {
    display: grid;
    grid-template-columns: minmax(180px, 240px) minmax(280px, 1fr) auto;
    gap: 16px;
    align-items: end;
    margin-top: 16px;
}

.auth-panel {
    max-width: 420px;
}

.auth-form, .credentials-form {
    display: grid;
    gap: 16px;
}

.credentials-form {
    grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
    align-items: end;
}

.is-hidden {
    display: none;
}

label {
    display: grid;
    gap: 6px;
    color: #536170;
    font-size: 14px;
}

input, select, button, .button {
    min-height: 40px;
    border-radius: 6px;
    border: 1px solid #c8d2de;
    font: inherit;
}

input, select {
    width: 100%;
    padding: 8px 10px;
    color: #182330;
    background: #fff;
}

.check {
    display: flex;
    gap: 8px;
    align-items: center;
}

.check input {
    width: auto;
}

.actions {
    display: flex;
    gap: 10px;
    align-items: end;
}

button, .button {
    padding: 0 16px;
    background: #16794c;
    color: #fff;
    border-color: #16794c;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.secondary, button.secondary {
    background: #fff;
    color: #314154;
    border-color: #c8d2de;
}

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

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

th, td {
    padding: 12px 10px;
    border-bottom: 1px solid #edf1f5;
    text-align: left;
    vertical-align: middle;
}

th {
    font-size: 13px;
    color: #627082;
    font-weight: 600;
}

.badge {
    display: inline-block;
    min-width: 72px;
    padding: 4px 8px;
    border-radius: 999px;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
}

.up {
    color: #0f5f3f;
    background: #dcf7e8;
}

.down {
    color: #982818;
    background: #ffe2dc;
}

.pending {
    color: #65521c;
    background: #fff0bf;
}

.row-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.row-actions form {
    margin: 0;
}

.link-button {
    min-height: auto;
    padding: 0;
    background: transparent;
    border: 0;
    color: #a12a1a;
}

a {
    color: #1b6fc9;
}

.empty {
    color: #627082;
    text-align: center;
}

@media (max-width: 820px) {
    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .monitor-form, .credentials-form {
        grid-template-columns: 1fr;
    }

    .settings-form {
        grid-template-columns: 1fr;
    }

    .section-head {
        align-items: flex-start;
        flex-direction: column;
    }
}
