:root {
    font-family:
        Inter, Arial, Helvetica, sans-serif;
    color: #19232d;
    background: #eef2f5;
}

body {
    margin: 0;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 20px 30px;
    background: #152838;
    color: white;
}

header h1 {
    margin: 0;
}

header p {
    margin: 5px 0 0;
    color: #bed0de;
}

nav a {
    color: white;
    text-decoration: none;
    margin-left: 18px;
}

main {
    max-width: 1400px;
    margin: 22px auto;
    padding: 0 20px;
}

.summary-grid {
    display: grid;
    grid-template-columns:
        repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.card {
    background: white;
    padding: 20px;
    border-radius: 11px;
    margin-bottom: 17px;
    box-shadow: 0 2px 9px rgba(0, 0, 0, 0.07);
}

.card h2 {
    margin-top: 0;
}

.status-dot {
    display: inline-block;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    margin-right: 7px;
}

.good {
    background: #15985c;
}

.bad {
    background: #d34242;
}

.big-number {
    font-size: 44px;
    font-weight: 700;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

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

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

th {
    background: #f4f7f9;
}

input,
textarea,
button,
.button-link {
    box-sizing: border-box;
    padding: 10px;
    border: 1px solid #aeb9c2;
    border-radius: 6px;
    font: inherit;
}

button,
.button-link {
    background: #176494;
    color: white;
    text-decoration: none;
    cursor: pointer;
}

.warning-button {
    background: #a8581b;
}

.search-form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.search-form input {
    min-width: 230px;
}

.settings-grid {
    display: grid;
    grid-template-columns:
        repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
}

.settings-grid label {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.wide {
    grid-column: 1 / -1;
}

.flash {
    padding: 13px;
    margin-bottom: 14px;
    border-radius: 7px;
}

.flash.success {
    background: #dff4e8;
}

.flash.error {
    background: #f9dddd;
}

.notice {
    padding: 12px;
    background: #fff4d5;
    border-radius: 7px;
}

footer {
    padding: 25px;
    color: #65717c;
    text-align: center;
}

@media (max-width: 800px) {
    header {
        flex-direction: column;
        align-items: flex-start;
    }

    nav a {
        margin-left: 0;
        margin-right: 13px;
    }
}

.manual-message-label {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-bottom: 18px;
}

.manual-message-label input {
    width: 100%;
}

.channel-selector {
    border: 1px solid #ccd5dc;
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 16px;
}

.channel-selector legend {
    padding: 0 8px;
    font-weight: 700;
}

.channel-choice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 9px;
    margin-bottom: 7px;
    border-radius: 6px;
    background: #f4f7f9;
}

.channel-choice input {
    width: auto;
    margin-top: 3px;
}

.channel-choice small {
    display: block;
    margin-top: 3px;
    color: #687784;
}

.manual-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.mqtt-publish-choice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 13px;
    margin: 14px 0;
    background: #fff4d5;
    border: 1px solid #e3c770;
    border-radius: 7px;
}

.mqtt-publish-choice input {
    width: auto;
    margin-top: 3px;
}

.mqtt-publish-choice small {
    display: block;
    margin-top: 4px;
    color: #6d6040;
}

.channel-settings-section {
    margin-top: 18px;
}

.channel-settings-table input[type="text"] {
    width: 100%;
    min-width: 150px;
}

.channel-settings-table .checkbox-cell {
    text-align: center;
}

.channel-settings-table input[type="checkbox"] {
    width: 20px;
    height: 20px;
}

.channel-settings-table th {
    white-space: nowrap;
}

.mqtt-mirror-selector {
    border: 1px solid #e3c770;
    border-radius: 8px;
    padding: 14px;
    margin: 16px 0;
    background: #fffaf0;
}

.mqtt-mirror-selector legend {
    padding: 0 8px;
    font-weight: 700;
}

.mqtt-choice {
    background: #fff4d5;
}

.mqtt-warning {
    margin-bottom: 0;
    color: #6d6040;
    font-size: 0.92rem;
}

.channel-warning {
    color: #a8581b !important;
    font-weight: 600;
}

.channel-settings-table td {
    min-width: 130px;
}

.channel-settings-table td:first-child {
    min-width: 45px;
}

.channel-settings-table {
    min-width: 1250px;
}
