* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    background: #0a0a1a;
    color: #eee;
    overflow-x: hidden;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: #16213e;
    border-bottom: 1px solid #1a1a3e;
}
.header h1 { font-size: 18px; color: #e94560; }
.header-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    font-size: 13px;
}
.header-controls a { color: #e94560; text-decoration: none; }
.header-controls a:hover { text-decoration: underline; }
.update-time { color: #888; font-size: 12px; }

/* Tab Switch */
.tab-switch { display: flex; gap: 4px; }
.tab-btn {
    padding: 6px 14px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    background: #1a1a2e;
    color: #aaa;
    transition: all 0.2s;
}
.tab-btn.active { background: #e94560; color: #fff; }
.tab-btn:hover:not(.active) { background: #2a2a4e; color: #eee; }

/* Tab Content */
.tab-content { display: none; padding: 16px 20px; }
.tab-content.active { display: block; }

/* KPI Grid */
.kpi-grid {
    display: grid;
    gap: 10px;
    margin-bottom: 20px;
}
.kpi-12 { grid-template-columns: repeat(6, 1fr); }
.kpi-10 { grid-template-columns: repeat(5, 1fr); }
.kpi-card {
    background: #16213e;
    border-radius: 6px;
    padding: 14px 16px;
    border: 1px solid #1a1a3e;
}
.kpi-value {
    font-size: 26px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
}
.kpi-label {
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Daily Body: Chart + Summary */
.daily-body {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 16px;
    margin-bottom: 20px;
}
.chart-section, .summary-section {
    background: #16213e;
    border-radius: 6px;
    padding: 16px;
    border: 1px solid #1a1a3e;
}
.chart-section h3, .summary-section h3, .table-section h3, .ip-dist-section h3 {
    font-size: 14px;
    color: #e94560;
    margin-bottom: 12px;
}
.chart-section canvas { width: 100% !important; max-height: 260px; }

/* Summary List */
.summary-list { display: flex; flex-direction: column; gap: 10px; }
.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid #1a1a3e;
}
.summary-label { font-size: 13px; color: #aaa; }
.summary-value { font-size: 14px; font-weight: 600; color: #4ecca3; }

/* Tables */
.tables-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.table-section {
    background: #16213e;
    border-radius: 6px;
    padding: 16px;
    border: 1px solid #1a1a3e;
}
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
th {
    text-align: left;
    padding: 8px 10px;
    background: #1a1a2e;
    color: #aaa;
    font-weight: 600;
    border-bottom: 1px solid #2a2a4e;
}
td {
    padding: 7px 10px;
    border-bottom: 1px solid #1a1a3e;
    color: #ccc;
}
tr:hover td { background: #1a1a2e; }

/* nms3: IP Bar List */
.ip-dist-section {
    background: #16213e;
    border-radius: 6px;
    padding: 20px;
    border: 1px solid #1a1a3e;
    max-width: 600px;
}
.ip-bar-item {
    margin-bottom: 14px;
}
.ip-bar-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
    font-size: 13px;
}
.ip-bar-ip { color: #eee; }
.ip-bar-count { color: #aaa; }
.ip-bar-track {
    width: 100%;
    height: 8px;
    background: #1a1a2e;
    border-radius: 4px;
    overflow: hidden;
}
.ip-bar-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, #4ecca3, #38b2ac);
    transition: width 0.4s ease;
}

/* No Data */
.no-data {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 14px;
}

/* Responsive */
@media (max-width: 1200px) {
    .kpi-12 { grid-template-columns: repeat(4, 1fr); }
    .kpi-10 { grid-template-columns: repeat(5, 1fr); }
}
@media (max-width: 900px) {
    .kpi-12, .kpi-10 { grid-template-columns: repeat(3, 1fr); }
    .daily-body { grid-template-columns: 1fr; }
    .tables-row { grid-template-columns: 1fr; }
    .header { flex-direction: column; gap: 8px; }
}
