:root {
    --bg-main: #090d16;
    --bg-card: #111827;
    --bg-sub: #0b0f19;
    --border: #1f2937;
    --tink-red: #e11d48;
    --tink-red-glow: rgba(225, 29, 72, 0.35);
    --green: #10b981;
    --cyan: #06b6d4;
    --yellow: #f59e0b;
    --danger: #ef4444;
    --text-main: #f8fafc;
    --text-muted: #9ca3af;
}
* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Inter', 'Segoe UI', system-ui, sans-serif; }
body {
    background: radial-gradient(circle at top, #1e1b2e 0%, var(--bg-main) 70%);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* NAVBAR HEADER */
.navbar {
    background: rgba(17, 24, 39, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 12px 26px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    position: sticky;
    top: 0;
    z-index: 100;
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo-box {
    background: #fff;
    padding: 5px 12px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
.logo-box img { height: 36px; width: auto; display: block; }
.brand-title h1 { font-size: 16px; font-weight: 800; letter-spacing: 0.5px; }
.brand-title span {
    font-size: 10px;
    background: var(--tink-red);
    color: #fff;
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 700;
    text-transform: uppercase;
}
.live-indicator {
    display: flex;
    align-items: center;
    gap: 7px;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #34d399;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}
.dot-pulse {
    width: 8px; height: 8px;
    background: var(--green);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--green);
    animation: pulse 1.6s infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

.nav-menu { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.nav-link {
    background: #1f2937;
    color: #cbd5e1;
    border: 1px solid #374151;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}
.nav-link:hover, .nav-link.active {
    background: var(--tink-red);
    color: #fff;
    border-color: #fb7185;
    box-shadow: 0 4px 12px var(--tink-red-glow);
}
.nav-link.btn-logout { background: #2c121e; border-color: #881337; color: #fda4af; }

/* MAIN CONTAINER */
.container { max-width: 1320px; width: 100%; margin: 22px auto; padding: 0 20px; flex: 1; }
.sec-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 22px 0 12px;
}
.sec-title {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 700;
}

/* SUMMARY TOP CARDS */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
.sum-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 10px 25px rgba(0,0,0,0.35);
}
.sum-info span { font-size: 12px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; }
.sum-info h3 { font-size: 26px; font-weight: 900; margin-top: 4px; }
.sum-icon {
    width: 46px; height: 46px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
}

/* ROUTER CARDS (CCR 1-5) */
.router-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 18px;
}
.r-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 12px 28px rgba(0,0,0,0.45);
    transition: border 0.3s;
}
.r-card.card-down { border-color: var(--danger); box-shadow: 0 0 20px rgba(239,68,68,0.25); }
.r-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.r-name { font-size: 16px; font-weight: 800; color: #fff; }
.r-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.badge-status { padding: 4px 10px; border-radius: 6px; font-size: 11px; font-weight: 800; }
.st-online { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid rgba(16,185,129,0.4); }
.st-down { background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid rgba(239,68,68,0.5); }

.metrics-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    background: var(--bg-sub);
    padding: 10px;
    border-radius: 10px;
    text-align: center;
    margin-bottom: 12px;
    border: 1px solid #1e293b;
}
.m-item span { font-size: 10px; color: var(--text-muted); display: block; text-transform: uppercase; }
.m-item strong { font-size: 13px; color: #f8fafc; margin-top: 2px; display: block; }

.traffic-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.tf-box {
    background: var(--bg-sub);
    padding: 10px 12px;
    border-radius: 10px;
    border-left: 3px solid;
}
.tf-rx { border-color: var(--green); }
.tf-tx { border-color: var(--cyan); }
.tf-lbl { font-size: 11px; color: var(--text-muted); }
.tf-val { font-size: 19px; font-weight: 800; margin-top: 2px; }
.chart-canvas { width: 100%; height: 64px; background: var(--bg-sub); border-radius: 8px; display: block; }
.uptime-foot { font-size: 11px; color: #64748b; margin-top: 8px; display: flex; justify-content: space-between; }

/* PING GRID */
.ping-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.p-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

footer {
    background: var(--bg-sub);
    border-top: 1px solid var(--border);
    text-align: center;
    padding: 16px;
    font-size: 12px;
    color: #64748b;
    margin-top: 40px;
}

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