body {
    margin: 0;
    background: #f3f4f6;
    color: #111827;
    font-family: Arial, Helvetica, sans-serif;
}

a {
    color: #1d4ed8;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.wrap {
    max-width: 1400px;
    margin: 0 auto;
    padding: 18px;
}

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

.topbar h1 {
    margin: 0;
    font-size: 20px;
}

.subhead {
    margin-top: 6px;
    color: #6b7280;
    font-size: 14px;
}

.menu {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #1f2937;
    color: #fff;
    padding: 12px 18px;
    border-radius: 10px;
    margin-bottom: 18px;
}

.menu a {
    color: #fff;
    background: #374151;
    padding: 8px 12px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
}

.menu a:hover,
.menu a.active {
    background: #2563eb;
}

.menu .menu-user {
    margin-left: auto;
    color: #d1d5db;
    font-size: 14px;
    font-weight: 600;
}

.toolbar-row {
    margin-bottom: 14px;
}

.container,
.report-card {
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 18px;
}

.report-card h3,
.container h2 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 16px;
}

.report-topbar {
    margin-bottom: 16px;
}

.search-wrap {
    position: relative;
}

.search-box,
input[type="text"],
input[type="number"],
input[type="password"],
select,
textarea {
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 8px 10px;
    box-sizing: border-box;
    font-size: 14px;
}

.search-box {
    width: 300px;
}

textarea {
    width: 100%;
    min-height: 120px;
    resize: vertical;
}

label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
}

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

.report-grid-top,
.report-grid-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-bottom: 18px;
}

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

.summary-strip {
    display: grid;
    gap: 14px;
    margin-bottom: 18px;
}

.summary-strip-3 {
    grid-template-columns: repeat(3, 1fr);
}

.summary-strip-4 {
    grid-template-columns: repeat(4, 1fr);
}

.summary-box {
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    padding: 14px;
}

.summary-box .label {
    color: #6b7280;
    font-size: 12px;
    margin-bottom: 6px;
}

.summary-box .value {
    font-size: 26px;
    font-weight: 700;
}

.value-up {
    color: #16a34a;
}

.value-down {
    color: #dc2626;
}

.legend-inline {
    display: flex;
    gap: 14px;
    align-items: center;
    margin-top: 10px;
    font-size: 13px;
    color: #4b5563;
    flex-wrap: wrap;
}

.legend-dot {
    width: 12px;
    height: 12px;
    display: inline-block;
    border-radius: 50%;
    margin-right: 6px;
}

.dot-up {
    background: #16a34a;
}

.dot-down {
    background: #dc2626;
}

.dot-availability {
    background: #2563eb;
}

.dot-outage {
    background: rgba(239, 68, 68, 0.35);
}

.dot-sla99 {
    background: #f59e0b;
}

.dot-sla9999 {
    background: #7c3aed;
}

.dot-heat2 {
    background: #f97316;
}

.dot-heat4 {
    background: #7f1d1d;
}

.dot-none {
    background: #e5e7eb;
}

.suggestions {
    position: absolute;
    background: #fff;
    border: 1px solid #cbd5e1;
    max-height: 220px;
    overflow-y: auto;
    width: 300px;
    z-index: 1000;
    box-shadow: 0 4px 14px rgba(0,0,0,0.08);
}

.suggestions div {
    padding: 8px 10px;
    cursor: pointer;
}

.suggestions div:hover {
    background: #f3f4f6;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

th,
td {
    border: 1px solid #d1d5db;
    padding: 10px 8px;
    text-align: left;
    vertical-align: top;
    font-size: 14px;
}

th {
    background: #f9fafb;
    font-weight: 700;
}

.row-up {
    background: #e6ffed;
}

.row-down {
    background: #ffe6e6;
}

.row-warn {
    background: #fff6e0;
}

.owner-empty {
    color: #6b7280;
    font-style: italic;
}

.latency-warn {
    background: #fde68a;
}

.latency-high {
    background: #fdba74;
    font-weight: 600;
}

.latency-critical {
    background: #fca5a5;
    font-weight: 700;
}

.mini-chart-cell {
    width: 140px;
    min-width: 140px;
}

.mini-chart-wrap {
    position: relative;
    height: 38px;
    width: 130px;
}

.heatmap-card {
    margin-bottom: 18px;
}

.heatmap-canvas {
    width: 100%;
    height: 90px;
    border: 1px solid #e5e7eb;
    display: block;
}

.status-ok {
    color: #15803d;
    font-weight: 700;
}

.status-off {
    color: #b91c1c;
    font-weight: 700;
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.badge-up {
    background: #dcfce7;
    color: #166534;
}

.badge-down {
    background: #fee2e2;
    color: #991b1b;
}

.badge-mixed {
    background: #fef3c7;
    color: #92400e;
}

.btn {
    display: inline-block;
    background: #4b5563;
    color: #fff;
    border: 0;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
}

.btn:hover {
    filter: brightness(1.05);
    text-decoration: none;
}

.btn-add {
    background: #2563eb;
}

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

.btn-delete {
    background: #dc2626;
}

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

.inline {
    display: inline;
}

.msg,
.error,
.empty {
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 16px;
}

.msg {
    border-left: 4px solid #2563eb;
}

.error {
    border-left: 4px solid #dc2626;
}

.empty {
    color: #374151;
}

@media (max-width: 1100px) {
    .report-grid-top,
    .report-grid-detail,
    .summary-strip-3,
    .summary-strip-4 {
        grid-template-columns: 1fr;
    }

    .search-box,
    .suggestions {
        width: 100%;
        min-width: 0;
    }

    .topbar,
    .report-topbar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
}