body {
    font-family: Arial, sans-serif;
    margin: 30px;
    background: #f4f6f8;
}

.menu {
    max-width: 1200px;
    margin: 0 auto 20px auto;
    background: #1f2937;
    padding: 12px 18px;
    border-radius: 10px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    box-shadow: 0 2px 12px rgba(0,0,0,.08);
}
.menu a {
    color: #fff;
    text-decoration: none;
    background: #374151;
    padding: 10px 14px;
    border-radius: 6px;
    font-weight: bold;
}
.menu a:hover {
    background: #4b5563;
}
.menu a.active {
    background: #0b66d1;
}
.menu-user {
    margin-left: auto;
    color: #fff;
    padding: 10px 14px;
    font-weight: bold;
}

.container,
.wrap {
    max-width: 1200px;
    margin: 0 auto;
    background: #fff;
    padding: 24px;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0,0,0,.08);
}

.container {
    max-width: 900px;
}

h1, h2, h3 {
    margin-top: 0;
}

textarea,
input[type="text"],
input[type="number"],
input[type="password"],
select {
    width: 100%;
    padding: 10px;
    margin-top: 6px;
    margin-bottom: 16px;
    box-sizing: border-box;
}

.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px 20px;
    margin-bottom: 20px;
}

.msg,
.err,
.error {
    padding: 12px 14px;
    border-radius: 6px;
    margin-bottom: 18px;
}

.msg {
    background: #e9f8ec;
    color: #146c2e;
}

.err,
.error {
    background: #fdecec;
    color: #8a1f1f;
}

.small,
.muted {
    color: #555;
    font-size: 13px;
}

.small {
    margin-top: -10px;
    margin-bottom: 14px;
}

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

.top-form {
    margin-bottom: 24px;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

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

table th {
    background: #f0f3f6;
}

.buttons,
.actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn,
button {
    display: inline-block;
    text-decoration: none;
    padding: 10px 16px;
    border-radius: 6px;
    color: #fff;
    font-weight: bold;
    border: none;
    cursor: pointer;
}

.btn-add,
.btn-save {
    background: #0b66d1;
}

.btn-edit,
.btn-load {
    background: #4b5563;
}

.btn-delete {
    background: #c62828;
}

.status-ok {
    color: #146c2e;
    font-weight: bold;
}

.status-off {
    color: #8a1f1f;
    font-weight: bold;
}

.empty {
    padding: 18px;
    background: #f8fafc;
    border: 1px solid #d9dee3;
    border-radius: 6px;
}

form.inline {
    display: inline;
    margin: 0;
}

.report-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 20px;
}

.report-card {
    background: #fff;
    border: 1px solid #d9dee3;
    border-radius: 10px;
    padding: 18px;
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.summary-card {
    background: #fff;
    border: 1px solid #d9dee3;
    border-radius: 10px;
    padding: 18px;
}

.summary-card .label {
    font-size: 13px;
    color: #555;
    margin-bottom: 6px;
}

.summary-card .value {
    font-size: 28px;
    font-weight: bold;
}

.chart-wrap {
    position: relative;
    height: 360px;
}

.chart-wrap.tall {
    height: 420px;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: bold;
    color: #fff;
}
.badge-up {
    background: #16a34a;
}
.badge-down {
    background: #dc2626;
}
.badge-mixed {
    background: #f59e0b;
}

.row-up td {
    background: #ecfdf3;
}
.row-down td {
    background: #fef2f2;
}
.row-mixed td {
    background: #fff7ed;
}

.host-link {
    text-decoration: none;
    font-weight: bold;
}
.host-link:hover {
    text-decoration: underline;
}

@media (max-width: 900px) {
    .grid,
    .report-grid,
    .summary-cards {
        grid-template-columns: 1fr;
    }

    .menu-user {
        margin-left: 0;
        width: 100%;
        padding-left: 0;
    }
}