/* ================= GLOBAL ================= */
body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f4f6f9;
}

.container {
    padding: 25px;
}

.card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.card>h3 {
    margin-bottom: 15px;
}

.card {
    overflow: hidden;
}

/* FIX LOGO */
.brand img {
    height: 40px;
    width: auto;
}

/* ================= NAVBAR ================= */
.topbar {
    position: sticky;
    top: 0;
    z-index: 1000;

    display: flex;
    align-items: center;
    justify-content: space-between;

    background: #1e3a8a;
    padding: 10px 20px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-weight: bold;
}

.topbar nav a {
    color: #fff;
    margin-left: 20px;
    text-decoration: none;
}

.chart-wrapper {
    position: relative;
    height: 260px;
}


/* ================= CHART ================= */
.card canvas {
    height: 260px !important;
}

.latency-box {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.pill {
    padding: 5px 10px;
    border-radius: 20px;
    font-weight: bold;
}

.pill.green {
    background: #dcfce7;
    color: #166534;
}

.pill.yellow {
    background: #fef9c3;
    color: #854d0e;
}

.pill.red {
    background: #fee2e2;
    color: #991b1b;
}

/* SECTION CHART */
.chart-wrapper {
    position: sticky;
    top: 70px;
    /* bawah navbar */
    z-index: 10;
    background: #f4f6f9;
    padding-bottom: 10px;
}

.status {
    font-weight: bold;
    margin-top: 5px;
}

/* ONLINE */
.status.online {
    color: #16a34a;
}

/* WARNING */
.status.warning {
    color: #f59e0b;
}

/* OFFLINE */
.status.offline {
    color: #dc2626;
}


/* ================= PERFORMANCE ================= */
.performance-wrapper {
    overflow-x: auto;
}

.performance-row {
    display: flex;
    gap: 16px;
    padding: 10px 0;
}

.performance-card {
    min-width: 220px;
    background: #f9fafb;
    border-radius: 10px;
    padding: 14px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.perf-title {
    font-weight: bold;
    margin-bottom: 8px;
}

.perf-body {
    font-size: 14px;
    margin-bottom: 6px;
}


/* ================= CONNECTION LOG ================= */

/* FILTER */
.log-filter {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.log-filter input,
.log-filter select {
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid #ddd;
    font-size: 14px;
}

.log-filter button {
    padding: 8px 14px;
    border-radius: 6px;
    border: none;
    background: #1e3a8a;
    color: #fff;
    cursor: pointer;
}

.log-filter button:hover {
    opacity: 0.9;
}


/* ================= TABLE SCROLL FIX ================= */
.table-wrapper {
    height: 280px;
    /* 🔥 kecilin dikit biar keliatan scroll */
    overflow-y: auto;
    overflow-x: hidden;

    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
}

.card {
    overflow: hidden;
    /* 🔥 biar scroll tetap di dalam */
}

/* TABLE */
table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 13px;
    display: table;
}

/* HEADER */
thead th {
    position: sticky;
    top: 0;
    background: #f8fafc;
    padding: 12px;
    font-weight: 600;
    font-size: 13px;
    color: #475569;
    border-bottom: 2px solid #e5e7eb;
    text-align: center;
    z-index: 10;
}

th,
td {
    text-align: center;
    vertical-align: middle;
}

td:first-child {
    text-align: center;
    /* 🔥 biar waktu di tengah */
}

/* BODY */
tbody td {
    padding: 10px;
    border-bottom: 1px solid #eee;
    text-align: center;
}

/* WAKTU */
td:first-child {
    text-align: left;
    font-family: monospace;
}

/* BRANCH */
td:nth-child(2) {
    font-weight: 600;
}

/* ROW STYLE */
tbody tr:nth-child(even) {
    background: #fafafa;
}

tbody tr:hover {
    background: #eef2ff;
    transition: 0.2s;
}


/* ================= STATUS BADGE ================= */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;

    padding: 5px 12px;
    border-radius: 999px;

    font-size: 12px;
    font-weight: 600;
    min-width: 90px;
}

/* warna status */
.badge.online {
    background: #e6f9f0;
    color: #059669;
}

.badge.offline {
    background: #fee2e2;
    color: #dc2626;
}

.badge.warning {
    background: #fef3c7;
    color: #d97706;
}

/* dot indikator */
.badge::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}


/* ================= EMPTY DATA ================= */
.no-data {
    text-align: center;
    padding: 40px;
    color: #64748b;
    font-size: 15px;
    font-weight: 500;
}