/* Dashboard Layout */
.dashboard-container {
    display: flex;
    height: 100vh;
    width: 100%;
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    font-family: 'Roboto', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
    overflow: hidden;
}

/* Sidebar Styles */
.sidebar {
    width: 250px;
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    color: #fff;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
    width: 280px;
    min-width: 280px;
    max-width: 280px;

}

.sidebar-header {
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header .logo {
    width: 60px;
    height: 60px;
    margin-bottom: 10px;
}

.sidebar-header .title-version {
    text-align: center;
}

.sidebar-header h1 {
    font-size: 1.2rem;
    margin: 0;
    color: #fff;
}

.sidebar-header .version-info {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
}

.sidebar-menu {
    padding-top: 20px;
    flex-grow: 1;
    padding: 20px 0;
}

.sidebar-menu a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    display: block;
    padding: 12px 20px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.sidebar-menu a:hover, .sidebar-menu a.active {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.sidebar-menu i {
    width: 20px;
    text-align: center;
    margin-right: 10px;
}

.sidebar-footer {
    margin-top: auto;
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.logout-btn {
    width: 100%;
    padding: 10px;
    font-size: 0.9rem;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    border: none;
    cursor: pointer;
    transition: background 0.3s;
}

.logout-btn:hover {
    background: linear-gradient(135deg, #2a5298 0%, #1e3c72 100%);
}

/* Main Content Styles */
.main-content {
    flex-grow: 1;
    padding: 30px;
    overflow-y: auto;
    background-color: rgba(255, 255, 255, 0.95);

    box-shadow: -10px 0 20px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1;
}

/* Dashboard Header */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.header-title h1 {
    font-size: 2rem;
    color: #333;
    margin: 0;
}

.header-title .subtitle {
    color: #666;
    margin-top: 5px;
}

.user-info {
    display: flex;
    align-items: center;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background-color: #3f51b5;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 10px;
}

.user-name {
    font-weight: 500;
}

/* Dashboard Stats */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background-color: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    contain: layout style;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    font-size: 2.5rem;
    color: #3f51b5;
    margin-right: 20px;
}

.stat-content h3 {
    font-size: 1rem;
    color: #666;
    margin: 0 0 5px 0;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: #333;
    margin: 0;
}

.stat-trend {
    font-size: 0.9rem;
    margin: 5px 0 0 0;
}

.stat-trend.positive {
    color: #4caf50;
}

.stat-trend.negative {
    color: #f44336;
}

/* Dashboard Charts */
.dashboard-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
}

.chart-container {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 20px;
    contain: layout style;
}

.chart-container h2 {
    font-size: 1.2rem;
    color: #333;
    margin-top: 0;
    margin-bottom: 20px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .dashboard-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
    }

    .main-content {
        padding: 20px;
    }

    .dashboard-stats {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }

    .dashboard-charts {
        grid-template-columns: 1fr;
    }
}

/* 添加响应式设计 */
@media (max-width: 768px) {
    .dashboard-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
    }

    .main-content {
        border-radius: 20px 20px 0 0;
    }
}

/* 确保侧边栏占满高度 */
.sidebar {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.sidebar-menu a.active {
    background-color: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-weight: bold;
}

.sidebar-menu a:hover, .sidebar-menu a.active {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* 新增样式 */
.dashboard-header {
    margin-bottom: 20px;
}

.dashboard-header h1 {
    font-size: 24px;
    color: #333;
}

.dashboard-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
}

.stat-card {
    flex: 1;
    background-color: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    margin: 0 10px;
    transition: transform 0.18s ease;
    contain: layout style;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-card i {
    font-size: 2.5rem;
    margin-right: 20px;
}

.stat-content h3 {
    font-size: 14px;
    color: #666;
    margin: 0;
}

.stat-content .stat-value {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    margin: 5px 0 0;
}

.dashboard-details {
    display: flex;
    margin-bottom: 30px;
}

.isp-stats, .city-stats {
    flex: 1;
    background-color: #fff;
    border-radius: 10px;
    padding: 5px 20px 20px 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin: 0 10px;
}

.isp-stats h2, .city-stats h2 {
    font-size: 18px;
    color: #333;
    margin-bottom: 15px;
}

#china-map {
    background-color: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* 为不同的统计卡片设置不同的颜色 */
.total-boxes i { color: #3498db; }
.online-boxes i { color: #2ecc71; }
.offline-boxes i { color: #e74c3c; }
.total-cities i { color: #f39c12; }

.view-all-button {
    position: absolute;
    right: 10px;
    top: 10px;
    padding: 5px 10px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.view-all-button:hover {
    background: linear-gradient(135deg, #2980b9, #3498db);
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* 模态窗口的样式 */
.modal_d {
    display: none; /* 初始隐藏 */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden; /* 禁止整个窗口的滚动 */
    background-color: rgba(0, 0, 0, 0.4); /* 背景颜色和透明度 */
}

/* 模态内容 */
.modal-content_d {
    background-color: #fefefe;
    margin:50px auto; /* 调整居中显示的位置 */
    padding: 20px;
    border: 1px solid #888;
    width: 60%;
    max-height: 80vh; /* 设置最大高度为视口高度的80% */
    overflow-y: auto; /* 内容超出时出现垂直滚动条 */
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    border-radius: 4px;
}
.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close:hover,
.close:focus {
    color: #fff;
    text-decoration: none;
    cursor: pointer;
}

#all-cities-table {
    margin-top: 20px;
    overflow-x: auto;
}

#all-cities-table table {
    width: 100%;
    border-collapse: collapse;
}

#all-cities-table th, #all-cities-table td {
    padding: 8px;
    color: #fff;
    text-align: left;
    border-bottom: 1px solid #444;
}

#all-cities-table th {
    background-color: #2c3e50;
    color: #fff;
}

#all-cities-table tr:nth-child(odd) {
    background-color: #1e1e2f;
}

#all-cities-table tr:nth-child(even) {
    background-color: #2a2a3c;
}

#all-cities-table tr:hover {
    background-color: #34495e;
}





/* 供应商活跃IP图表和表格样式 */
.vendor-active-ips {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin: 20px 0;
    padding: 20px;
    contain: layout style;
}

.vendor-active-ips h2 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.period-selector {
    display: flex;
    gap: 10px;
}

.period-btn {
    background-color: #f0f0f0;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.period-btn.active {
    background-color: #1e90ff;
    color: white;
}

.period-btn:hover:not(.active) {
    background-color: #e8e8e8;
}

/* 自定义日期范围选择器样式 */
.custom-date-range {
    display: flex;
    align-items: center;
    gap: 5px;
}

.date-input {
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.date-input:hover {
    border-color: #5470c6;
}

.date-input:focus {
    outline: none;
    border-color: #5470c6;
    box-shadow: 0 0 0 2px rgba(84, 112, 198, 0.2);
}

.apply-date-btn {
    background-color: #5470c6;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.apply-date-btn:hover {
    background-color: #4a63b3;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(84, 112, 198, 0.3);
}

.apply-date-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(84, 112, 198, 0.3);
}

/* 当前日期范围显示样式 */
.current-range-display {
    display: flex;
    align-items: center;
    gap: 5px;
    background-color: #e8f4fd;
    border: 1px solid #5470c6;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 12px;
    color: #5470c6;
    font-weight: 500;
    white-space: nowrap;
}

.current-range-display i {
    font-size: 11px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .period-selector {
        flex-wrap: wrap;
        gap: 8px;
    }

    .custom-date-range {
        flex-wrap: wrap;
        margin-left: 0 !important;
        margin-top: 8px;
        width: 100%;
    }

    .date-input {
        flex: 1;
        min-width: 120px;
    }

    .apply-date-btn {
        margin-left: 0 !important;
        margin-top: 5px;
        width: 100%;
    }
}

.vendor-ips-table-container {
    overflow-x: auto;
}

.vendor-ips-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.vendor-ips-table th, 
.vendor-ips-table td {
    padding: 10px;
    text-align: center;
    border: 1px solid #e0e0e0;
}

.vendor-ips-table th {
    background-color: #f5f5f5;
    font-weight: bold;
}

.vendor-ips-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.vendor-ips-table .total-row {
    background-color: #f0f8ff;
}

.chart-table-toggle {
    display: flex;
    justify-content: center;
    margin-top: 15px;
}

.toggle-btn {
    background-color: #1e90ff;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.toggle-btn:hover {
    background-color: #0c7cd5;
}
















/* IP去重统计样式 */
.ip-deduplication-stats {
    margin-top: 30px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    padding: 20px;
    position: relative;
    contain: layout style;
}

.ip-deduplication-stats h2 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.2rem;
    font-weight: 600;
}

.ip-deduplication-stats .period-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ip-deduplication-stats .date-selector {
    min-width: 120px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ip-deduplication-stats .date-selector:hover {
    border-color: #5470c6;
}

.ip-deduplication-stats .date-selector:focus {
    outline: none;
    border-color: #5470c6;
    box-shadow: 0 0 0 2px rgba(84, 112, 198, 0.2);
}

/* 可以添加到您的CSS文件中 */
.user-active-proxies {
    margin-top: 30px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    padding: 20px;
    position: relative;
    contain: layout style;
}

.user-active-proxies h2 {
    margin-top: 0;
    margin-bottom: 20px;

    color: #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-filter {
    margin-left: 10px;
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    font-size: 14px;
}

.chart-table-toggle {
    margin-top: 10px;
    text-align: center;
}





/* 仪表盘统计卡片样式 */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stats-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    padding: 20px;
    display: flex;
    align-items: center;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    position: relative;
    overflow: hidden;
    contain: layout style;
    will-change: transform;
}

.stats-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
}

.stats-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background: linear-gradient(to bottom, #5470c6, #91cc75);
    opacity: 0.8;
}

.stats-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(84, 112, 198, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    color: #5470c6;
    font-size: 20px;
}

.stats-content {
    flex: 1;
}

.stats-value {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin-bottom: 5px;
    display: flex;
    align-items: baseline;
}

.stats-divider {
    margin: 0 5px;
    color: #999;
    font-size: 18px;
}

.stats-label {
    font-size: 14px;
    color: #666;
}

/* 卡片加载动画 */
.stats-card {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.5s forwards;
}

.stats-card.loaded {
    opacity: 1;
    transform: translateY(0);
}

.stats-card:nth-child(1) { animation-delay: 0.1s; }
.stats-card:nth-child(2) { animation-delay: 0.2s; }
.stats-card:nth-child(3) { animation-delay: 0.3s; }
.stats-card:nth-child(4) { animation-delay: 0.4s; }
.stats-card:nth-child(5) { animation-delay: 0.5s; }
.stats-card:nth-child(6) { animation-delay: 0.6s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 为每个卡片设置不同的强调色 */
#active-ips-card::before { background: linear-gradient(to bottom, #5470c6, #73c0de); }
#active-ips-card .stats-icon { background: rgba(84, 112, 198, 0.1); color: #5470c6; }

#user-count-card::before { background: linear-gradient(to bottom, #91cc75, #3ba272); }
#user-count-card .stats-icon { background: rgba(145, 204, 117, 0.1); color: #91cc75; }

#gateway-count-card::before { background: linear-gradient(to bottom, #fac858, #fc8452); }
#gateway-count-card .stats-icon { background: rgba(250, 200, 88, 0.1); color: #fac858; }

#active-proxies-card::before { background: linear-gradient(to bottom, #ee6666, #9a60b4); }
#active-proxies-card .stats-icon { background: rgba(238, 102, 102, 0.1); color: #ee6666; }

#realtime-devices-card::before { background: linear-gradient(to bottom, #9a60b4, #ea7ccc); }
#realtime-devices-card .stats-icon { background: rgba(154, 96, 180, 0.1); color: #9a60b4; }

#realtime-unique-ips-card::before { background: linear-gradient(to bottom, #3ba272, #5daf34); }
#realtime-unique-ips-card .stats-icon { background: rgba(59, 162, 114, 0.1); color: #3ba272; }

#ip-ratio-card::before { background: linear-gradient(to bottom, #ff7f50, #ff6347); }
#ip-ratio-card .stats-icon { background: rgba(255, 127, 80, 0.1); color: #ff7f50; }



.user-proxies-table {
    border-collapse: collapse;
    width: 100%;
}
.user-proxies-table th, .user-proxies-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: center;
}
.user-proxies-table th {
    background-color: #f8f9fa;
    position: relative;
}
.user-proxies-table tr:nth-child(even) {
    background-color: #f9f9f9;
}
.user-proxies-table .value-divider {
    color: #999;
    margin: 0 4px;
}
.user-proxies-table .avg-value {
    color: #1a73e8;
}
.user-proxies-table .max-value {
    color: #e53935;
}
.total-row {
    font-weight: bold;
    background-color: #f0f0f0 !important;
}








.user-filter-container {
    position: relative;
    display: inline-block;
    margin-left: 10px;
    margin-top:-5px;
}

.toggle-filter-btn {
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 14px;
}

.toggle-filter-btn:hover {
    background-color: #e8e8e8;
}

.user-filter-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 250px;
    max-height: 333px;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 100;
    margin-top: 5px;
}

.filter-search {
    padding: 8px;
    border-bottom: 1px solid #eee;
}

.filter-search input {
    width: 100%;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.filter-options {
    max-height: 250px;
    overflow-y: auto;
    padding: 8px;
}

.filter-option {
    display: block;
    padding: 5px 0;
    cursor: pointer;
    font-size:16px;
}

.filter-option:hover {
    background-color: #f5f5f5;
}

.user-checkbox-list {
    margin-top: 5px;
    border-top: 1px solid #eee;
    padding-top: 5px;
}

/* 客户每天使用去重IP统计样式 */
.user-daily-ips {
    margin-top: 30px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    padding: 20px;
    position: relative;
    contain: layout style;
}

.user-daily-ips h2 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.2rem;
    font-weight: 600;
}

.user-daily-ips .period-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-daily-ips .view-toggle {
    display: flex;
    gap: 0;
}

.user-daily-ips .view-btn {
    background-color: #f0f0f0;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    margin-right: 5px;
}

.user-daily-ips .view-btn.active {
    background-color: #1e90ff;
    color: white;
}

.user-daily-ips .view-btn:hover:not(.active) {
    background-color: #e8e8e8;
}

.user-daily-ips .period-btn {
    background-color: #f0f0f0;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.user-daily-ips .period-btn.active {
    background-color: #1e90ff;
    color: white;
}

.user-daily-ips .period-btn:hover:not(.active) {
    background-color: #e8e8e8;
}

/* 客户流量带宽统计样式 */
.user-traffic-stats {
    margin-top: 30px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    padding: 20px;
    position: relative;
}

.user-traffic-stats h2 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.2rem;
    font-weight: 600;
    flex-wrap: nowrap;
    gap: 10px;
}

.user-traffic-stats .period-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    white-space: nowrap;
    overflow: visible;
}

.user-traffic-stats .period-selector-scroll {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    white-space: nowrap;
    overflow: visible;
    position: relative;
}

.user-traffic-stats .view-toggle {
    display: flex;
    gap: 0;
    flex-shrink: 0;
    margin-top: 0 !important;
}

.user-traffic-stats .view-btn {
    background-color: #f0f0f0;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    margin-right: 5px;
    white-space: nowrap;
}

.user-traffic-stats .view-btn.active {
    background-color: #1e90ff;
    color: white;
}

.user-traffic-stats .view-btn:hover:not(.active) {
    background-color: #e8e8e8;
}

.user-traffic-stats .period-btn {
    background-color: #f0f0f0;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.user-traffic-stats .period-btn.active {
    background-color: #1e90ff;
    color: white;
}

.user-traffic-stats .period-btn:hover:not(.active) {
    background-color: #e8e8e8;
}

.user-traffic-stats .user-filter-container {
    margin-left: 0 !important;
    margin-top: 0 !important;
}

.user-traffic-stats .user-filter-dropdown {
    z-index: 1200;
}

.user-traffic-stats .export-btn {
    white-space: nowrap;
}

/* 客户每天使用去重IP统计表格样式 */
.user-daily-ips-table-container {
    overflow-x: auto;
    max-width: 100%;
}

.user-daily-ips-table {
    border-collapse: collapse;
    width: 100%;
    min-width: 800px;
}

.user-daily-ips-table th,
.user-daily-ips-table td {
    border: 1px solid #ddd;
    padding: 10px 12px;
    text-align: center;
}

.user-daily-ips-table th {
    background-color: #f8f9fa;
    font-weight: bold;
    position: relative;
}

.user-daily-ips-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.user-daily-ips-table tr:hover {
    background-color: #f5f5f5;
}

/* 固定第一列样式 */
.user-daily-ips-table th:first-child,
.user-daily-ips-table td:first-child {
    position: sticky;
    left: 0;
    background: white;
    z-index: 2;
    border-right: 2px solid #ddd;
}

.user-daily-ips-table tr:nth-child(even) td:first-child {
    background-color: #f9f9f9;
}

.user-daily-ips-table tr:hover td:first-child {
    background-color: #f5f5f5;
}

/* 统计类型切换滑块样式 */
.stats-type-toggle {
    display: inline-block;
    position: relative;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 140px;
    height: 34px;
    cursor: pointer;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #1e90ff;
    border-radius: 17px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.toggle-slider:before {
    content: "";
    position: absolute;
    height: 26px;
    width: 62px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    border-radius: 13px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background-color: #28a745;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(70px);
}

.toggle-label-left,
.toggle-label-right {
    font-size: 12px;
    font-weight: 500;
    color: white;
    z-index: 1;
    position: relative;
    transition: all 0.3s ease;
}

.toggle-label-left {
    margin-left: 2px;
}

.toggle-label-right {
    margin-right: 2px;
}

.toggle-switch input:checked + .toggle-slider .toggle-label-left {
    color: rgba(255,255,255,0.7);
}

.toggle-switch input:not(:checked) + .toggle-slider .toggle-label-right {
    color: rgba(255,255,255,0.7);
}
.dashboard-ops-layout {
    display: flex;
    flex-direction: column;
    gap: 22px;
    margin-top: 24px;
}

.operation-card {
    background: #fff;
    border: 1px solid #e3e8f0;
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(31, 45, 61, 0.08);
    overflow: visible;
}

.operation-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 18px;
    border-bottom: 1px solid #e7ecf3;
    background: #f8fafc;
    flex-wrap: wrap;
}

.operation-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: #1f2d3d;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.35;
}

.operation-card-title i {
    color: #5470c6;
}

.operation-card-body {
    padding: 16px 18px 18px;
}

.segmented-tabs {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px;
    background: #eef2f7;
    border: 1px solid #dce3ed;
    border-radius: 8px;
    flex-wrap: wrap;
}

.seg-tab {
    min-height: 30px;
    padding: 5px 13px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #536170;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
    transition: background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.seg-tab:hover {
    color: #1f2d3d;
}

.seg-tab.active {
    background: #fff;
    color: #1f5fbf;
    box-shadow: 0 1px 4px rgba(31, 45, 61, 0.13);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.operation-card .vendor-active-ips,
.operation-card .ip-deduplication-stats,
.operation-card .user-active-proxies,
.operation-card .user-daily-ips,
.operation-card .user-traffic-stats,
.operation-card .ip-duration-distribution {
    margin: 0;
    padding: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    position: relative;
    contain: layout style;
}

.tab-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.toolbar-left,
.toolbar-right,
.customer-ip-controls,
.date-nav-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.tab-data-container {
    min-height: 400px;
    position: relative;
    contain: layout style;
}

.view-toggle,
.period-selector {
    display: inline-flex;
    align-items: center;
    gap: 0;
}

.operation-card .view-btn,
.operation-card .period-btn,
.operation-card .toggle-filter-btn,
.operation-card .compact-action {
    min-height: 30px;
    padding: 5px 10px;
    border: 1px solid #d8dee8;
    background: #fff;
    color: #4d5b6a;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.operation-card .view-toggle .view-btn:first-child,
.operation-card .period-selector .period-btn:first-child {
    border-radius: 6px 0 0 6px;
}

.operation-card .view-toggle .view-btn:last-child,
.operation-card .period-selector .period-btn:last-child {
    border-radius: 0 6px 6px 0;
}

.operation-card .view-toggle .view-btn:not(:first-child),
.operation-card .period-selector .period-btn:not(:first-child) {
    margin-left: -1px;
}

.operation-card .date-nav-inline .period-btn {
    border-radius: 6px;
    margin-left: 0;
}

.operation-card .view-btn:hover,
.operation-card .period-btn:hover,
.operation-card .toggle-filter-btn:hover {
    background: #f6f8fb;
    color: #1f2d3d;
}

.operation-card .view-btn.active,
.operation-card .period-btn.active {
    border-color: #5470c6;
    background: #edf3ff;
    color: #1f5fbf;
    position: relative;
    z-index: 1;
}

.operation-card .toggle-filter-btn,
.operation-card .compact-action,
.operation-card .export-btn {
    border-radius: 6px;
}

.operation-card .export-btn {
    background: #2f855a;
    border-color: #2f855a;
    color: #fff;
}

.operation-card .export-btn:hover {
    background: #276749;
    border-color: #276749;
    color: #fff;
}

.operation-card .apply-date-btn {
    background: #5470c6;
    border-color: #5470c6;
    color: #fff;
}

.operation-card .apply-date-btn:hover {
    background: #455fb0;
    border-color: #455fb0;
}

.compact-field {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #647181;
    font-size: 13px;
    font-weight: 600;
}

.compact-input,
.compact-select,
.operation-card .date-input {
    height: 30px;
    padding: 4px 8px;
    border: 1px solid #d8dee8;
    border-radius: 6px;
    background: #fff;
    color: #1f2d3d;
    font-size: 13px;
    outline: none;
}

.compact-input:focus,
.compact-select:focus,
.operation-card .date-input:focus {
    border-color: #5470c6;
    box-shadow: 0 0 0 2px rgba(84, 112, 198, 0.14);
}

.min-ips-input {
    width: 92px;
}

.operation-card .custom-date-range {
    margin: 0 !important;
    gap: 6px;
}

.operation-card .user-filter-container {
    margin: 0;
}

.operation-card .user-filter-dropdown {
    right: auto;
    left: 0;
    z-index: 200;
}

.duration-summary-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    color: #1f2d3d;
    font-size: 13px;
}

.duration-summary-bar span {
    margin-left: 8px;
    color: #7b8794;
    font-weight: 500;
}

.ip-duration-chart-panel,
.ip-duration-table-panel {
    min-height: 420px;
}

.ip-duration-table-panel {
    overflow-x: auto;
}

.ip-duration-table {
    width: 100%;
    border-collapse: collapse;
}

.ip-duration-table th,
.ip-duration-table td {
    padding: 10px 12px;
    border: 1px solid #e1e6ef;
    text-align: right;
    white-space: nowrap;
}

.ip-duration-table th:first-child,
.ip-duration-table td:first-child {
    text-align: left;
}

.ip-duration-table th {
    background: #f6f8fb;
    color: #465466;
}

.ip-duration-table tfoot td {
    background: #f1f6ff;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.compact-empty {
    min-height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 10px;
    color: #7b8794;
}

.compact-empty i {
    color: #9aa7b7;
    font-size: 28px;
}

@media (max-width: 768px) {
    .operation-card-header,
    .tab-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .segmented-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        width: 100%;
    }

    .toolbar-left,
    .toolbar-right {
        width: 100%;
    }

    .duration-summary-bar {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* Customer daily-IP export controls. Supplier export styles remain in main.css. */
.export-mode-segmented {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    background: var(--app-surface-muted, #eef2f7);
    border: 1px solid var(--app-border, #dce3ed);
    border-radius: 8px;
}

.export-mode-segmented .seg-tab {
    min-height: 28px;
    padding: 4px 14px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--app-text-secondary, #536170);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
    transition: background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.export-mode-segmented .seg-tab:hover {
    color: var(--app-text, #1f2d3d);
}

.export-mode-segmented .seg-tab.active {
    background: var(--app-surface, #fff);
    color: var(--app-primary, #1f5fbf);
    box-shadow: 0 1px 4px rgba(31, 45, 61, 0.13);
}

.export-mode-view {
    display: none;
}

.export-mode-view.active {
    display: block;
}

.export-customer-toolbar {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    padding: 14px 0 10px;
    flex-wrap: wrap;
}

.export-customer-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.export-customer-field > label {
    color: var(--app-text-secondary, #465466);
    font-size: 13px;
    font-weight: 600;
}

.export-customer-field .custom-select-container {
    position: relative;
}

.export-customer-field .custom-select-header {
    align-items: center;
    box-sizing: border-box;
    display: flex;
    justify-content: space-between;
    gap: 8px;
    min-width: 220px;
    max-width: 320px;
    height: 30px;
    padding: 4px 10px;
    border: 1px solid var(--app-border-strong, #d8dee8);
    border-radius: 6px;
    background: var(--app-surface, #fff);
    color: var(--app-text, #1f2d3d);
    cursor: pointer;
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.export-customer-field .custom-select-header:hover,
.export-customer-field .custom-select-header:focus-visible {
    border-color: var(--app-primary, #5470c6);
    box-shadow: 0 0 0 2px rgba(84, 112, 198, 0.14);
}

.export-customer-field .custom-select-header.is-disabled {
    border-color: var(--app-border-strong, #d8dee8);
    background: var(--app-surface-muted, #f5f7fa);
    color: var(--app-text-muted, #9aa7b7);
    cursor: not-allowed;
    box-shadow: none;
}

.export-customer-field .custom-select-header .selected-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.export-customer-field .custom-select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 300;
    width: 100%;
    min-width: 220px;
    max-height: 320px;
    margin-top: 4px;
    border: 1px solid var(--app-border-strong, #d8dee8);
    border-radius: 6px;
    background: var(--app-surface, #fff);
    box-shadow: 0 4px 14px rgba(31, 45, 61, 0.12);
    overflow: hidden;
}

.export-customer-field .custom-select-search {
    padding: 8px;
    border-bottom: 1px solid var(--app-border, #eef2f7);
}

.export-customer-field .custom-select-search input {
    box-sizing: border-box;
    width: 100%;
    height: 28px;
    padding: 4px 8px;
    border: 1px solid var(--app-border-strong, #d8dee8);
    border-radius: 4px;
    background: var(--app-surface, #fff);
    color: var(--app-text, #1f2d3d);
    font-size: 13px;
}

.export-customer-field .custom-select-options {
    max-height: 260px;
    overflow-y: auto;
    padding: 4px 0;
}

.export-customer-field .custom-select-option {
    padding: 6px 12px;
    color: var(--app-text, #1f2d3d);
    cursor: pointer;
    font-size: 13px;
    transition: background-color 0.15s ease;
}

.export-customer-field .custom-select-option:hover {
    background: var(--app-primary-soft, #f0f4fa);
}

.export-customer-table {
    width: 100%;
    border-collapse: collapse;
}

.export-customer-table th,
.export-customer-table td {
    padding: 10px 14px;
    border: 1px solid var(--app-border, #e1e6ef);
    text-align: left;
    white-space: nowrap;
    font-size: 13px;
}

.export-customer-table th {
    background: var(--app-surface-muted, #f6f8fb);
    color: var(--app-text-secondary, #465466);
    font-weight: 600;
}

.export-customer-table tr:nth-child(even) {
    background: var(--app-surface-subtle, #fafbfd);
}

.export-customer-table .export-status-text {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.export-customer-table .daily-ip-export-status-ready {
    background: #e6f4ea;
    color: #1a7e34;
}

.export-customer-table .daily-ip-export-status-missing {
    background: #f0f0f0;
    color: var(--app-text-muted, #7b8794);
}

.export-customer-table .daily-ip-export-status-failed {
    background: #fde8e8;
    color: #c01d2e;
}

.export-customer-table .export-btn {
    align-items: center;
    display: inline-flex;
    gap: 4px;
    padding: 4px 10px;
    border: 1px solid #2f855a;
    border-radius: 5px;
    background: #2f855a;
    color: #fff;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
}

@media (max-width: 768px) {
    .export-mode-segmented {
        order: -1;
    }

    .export-customer-toolbar {
        align-items: stretch;
        flex-direction: column;
        gap: 12px;
    }

    .export-customer-field .custom-select-header,
    .export-customer-field .custom-select-dropdown {
        width: 100%;
        max-width: 100%;
    }

    .export-customer-table th,
    .export-customer-table td {
        padding: 8px 10px;
        font-size: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .export-mode-segmented .seg-tab,
    .export-customer-field .custom-select-header,
    .export-customer-field .custom-select-option {
        transition: none;
    }
}

/* Customer daily-IP export gateway detail modal. */
html.gw-modal-open,
body.gw-modal-open {
    overflow: hidden;
}

.gw-backdrop {
    align-items: center;
    background: rgba(15, 23, 42, 0.45);
    display: flex;
    inset: 0;
    justify-content: center;
    padding: 24px;
    position: fixed;
    z-index: 1200;
}

.gw-backdrop[hidden] {
    display: none;
}

.gw-modal {
    background: var(--app-surface, #fff);
    border: 1px solid var(--app-border-strong, #d8dee8);
    border-radius: 8px;
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.2);
    color: var(--app-text, #1f2d3d);
    display: flex;
    flex-direction: column;
    max-height: min(84vh, 680px);
    min-height: 0;
    outline: none;
    overflow: hidden;
    width: min(760px, 100%);
}

.gw-modal__header {
    align-items: flex-start;
    border-bottom: 1px solid var(--app-border, #e1e6ef);
    display: flex;
    flex: 0 0 auto;
    gap: 12px;
    padding: 16px 20px 14px;
}

.gw-modal__titles {
    flex: 1 1 auto;
    min-width: 0;
}

.gw-modal__title {
    color: var(--app-text, #1f2d3d);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
    margin: 0;
}

.gw-modal__meta {
    color: var(--app-text-muted, #7b8794);
    font-size: 12px;
    line-height: 1.5;
    margin: 4px 0 0;
    overflow-wrap: anywhere;
}

.gw-modal__close,
.gw-icon-btn {
    align-items: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 5px;
    color: var(--app-text-secondary, #536170);
    cursor: pointer;
    display: inline-flex;
    justify-content: center;
}

.gw-modal__close {
    flex: 0 0 30px;
    font-size: 13px;
    height: 30px;
    width: 30px;
}

.gw-modal__close:hover,
.gw-icon-btn:hover {
    background: var(--app-primary-soft, #f0f4fa);
    color: var(--app-primary, #1f5fbf);
}

.gw-modal__close:focus-visible,
.gw-icon-btn:focus-visible,
.gw-retry:focus-visible,
.gw-field input:focus-visible,
.daily-ip-export-gateway-detail:focus-visible,
.daily-ip-export-customer-download:focus-visible {
    outline: 2px solid var(--app-primary, #5470c6);
    outline-offset: 2px;
}

.gw-modal__search {
    align-items: center;
    background: var(--app-surface-muted, #f6f8fb);
    border-bottom: 1px solid var(--app-border, #e1e6ef);
    display: flex;
    flex: 0 0 auto;
    gap: 12px;
    padding: 12px 20px;
}

.gw-field {
    flex: 1 1 auto;
    min-width: 0;
    position: relative;
}

.gw-field__icon {
    color: var(--app-text-muted, #9aa7b7);
    font-size: 12px;
    left: 10px;
    pointer-events: none;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

.gw-field input {
    background: var(--app-surface, #fff);
    border: 1px solid var(--app-border-strong, #d8dee8);
    border-radius: 5px;
    box-sizing: border-box;
    color: var(--app-text, #1f2d3d);
    font: inherit;
    font-size: 13px;
    height: 34px;
    padding: 0 32px 0 30px;
    width: 100%;
}

.gw-field input:focus {
    border-color: var(--app-primary, #5470c6);
    box-shadow: 0 0 0 2px rgba(84, 112, 198, 0.14);
    outline: none;
}

.gw-field__clear {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 4px;
    color: var(--app-text-muted, #9aa7b7);
    cursor: pointer;
    display: none;
    height: 24px;
    justify-content: center;
    position: absolute;
    right: 5px;
    top: 5px;
    width: 24px;
}

.gw-field.is-filled .gw-field__clear {
    display: inline-flex;
}

.gw-count {
    color: var(--app-text-secondary, #536170);
    flex: 0 0 auto;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.gw-modal__body {
    flex: 1 1 auto;
    min-height: 220px;
    overflow: auto;
    overscroll-behavior: contain;
}

.gw-table {
    border-collapse: collapse;
    min-width: 620px;
    width: 100%;
}

.gw-table th,
.gw-table td {
    border-bottom: 1px solid var(--app-border, #e1e6ef);
    font-size: 13px;
    padding: 9px 14px;
    text-align: left;
    white-space: nowrap;
}

.gw-table thead th {
    background: var(--app-surface-muted, #f6f8fb);
    color: var(--app-text-secondary, #465466);
    font-size: 12px;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 1;
}

.gw-table tbody tr:nth-child(even) {
    background: var(--app-surface-subtle, #fafbfd);
}

.gw-table tbody tr:hover {
    background: var(--app-primary-soft, #f0f4fa);
}

.gw-col-num {
    text-align: right !important;
}

.gw-col-act {
    text-align: center !important;
    width: 92px;
}

.gw-uuid {
    align-items: center;
    display: inline-flex;
    gap: 7px;
}

.gw-uuid code {
    color: var(--app-text, #1f2d3d);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12px;
}

.gw-addr {
    color: var(--app-text-secondary, #536170);
    max-width: 270px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gw-num {
    font-variant-numeric: tabular-nums;
}

.gw-size {
    color: var(--app-text-muted, #9aa7b7);
    display: block;
    font-size: 11px;
    margin-top: 2px;
}

.gw-status-action {
    font-size: 12px;
    font-weight: 600;
}

.gw-status-action.daily-ip-export-status-failed {
    color: #c01d2e;
}

.gw-status-action.daily-ip-export-status-missing {
    color: var(--app-text-muted, #7b8794);
}

.gw-retry {
    background: var(--app-surface, #fff);
    border: 1px solid var(--app-border-strong, #d8dee8);
    border-radius: 5px;
    color: var(--app-primary, #1f5fbf);
    cursor: pointer;
    font-size: 12px;
    padding: 5px 12px;
}

.gw-state {
    align-items: center;
    color: var(--app-text-muted, #7b8794);
    display: flex;
    flex-direction: column;
    gap: 9px;
    justify-content: center;
    min-height: 220px;
    padding: 28px;
    text-align: center;
}

.gw-state i {
    font-size: 24px;
}

.gw-state p {
    line-height: 1.6;
    margin: 0;
}

.gw-skel {
    background: var(--app-surface-muted, #eef2f7);
    border-radius: 4px;
    display: block;
    height: 9px;
}

.gw-skel--wide { width: 78%; }
.gw-skel--mid { width: 58%; }
.gw-skel--thin { margin-left: auto; width: 34%; }

.gw-sr-only {
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    white-space: nowrap;
    width: 1px;
}

.daily-ip-export-row-actions {
    align-items: center;
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
}

.daily-ip-export-gateway-detail,
.daily-ip-export-customer-download {
    align-items: center;
    display: inline-flex;
    gap: 4px;
    min-height: 28px;
    white-space: nowrap;
}

.daily-ip-export-gateway-detail {
    background: var(--app-surface, #fff);
    border: 1px solid var(--app-border-strong, #d8dee8);
    border-radius: 5px;
    color: var(--app-text-secondary, #536170);
    cursor: pointer;
    font-size: 12px;
    padding: 4px 9px;
}

.daily-ip-export-gateway-detail:hover {
    border-color: var(--app-primary, #5470c6);
    color: var(--app-primary, #1f5fbf);
}

@media (max-width: 640px) {
    .gw-backdrop {
        align-items: stretch;
        padding: 0;
    }

    .gw-modal {
        border: 0;
        border-radius: 0;
        max-height: none;
        width: 100%;
    }

    .gw-modal__header,
    .gw-modal__search {
        padding-left: 16px;
        padding-right: 16px;
    }

    .gw-modal__search {
        align-items: stretch;
        flex-wrap: wrap;
    }

    .gw-count {
        width: 100%;
    }

    .gw-table th,
    .gw-table td {
        padding-left: 10px;
        padding-right: 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .gw-modal__close,
    .gw-icon-btn,
    .gw-retry,
    .gw-field input,
    .daily-ip-export-gateway-detail {
        transition: none;
    }
}

/* Dashboard toolbar final alignment pass.
   This file loads after main.css, so dashboard-specific overrides live here. */
body.logged-in .operation-card .tab-toolbar,
body.logged-in .operation-card .toolbar-left,
body.logged-in .operation-card .toolbar-right {
    align-items: center !important;
}

body.logged-in .operation-card .view-toggle,
body.logged-in .operation-card .period-selector,
body.logged-in .operation-card .user-filter-container,
body.logged-in .operation-card .custom-date-range,
body.logged-in .operation-card .compact-field {
    align-items: center !important;
    margin: 0 !important;
}

body.logged-in .operation-card .user-filter-container {
    display: inline-flex !important;
    position: relative !important;
}

body.logged-in .operation-card .view-btn,
body.logged-in .operation-card .period-btn,
body.logged-in .operation-card .toggle-filter-btn,
body.logged-in .operation-card .compact-action,
body.logged-in .operation-card .export-btn,
body.logged-in .operation-card .compact-icon-btn {
    align-items: center !important;
    box-sizing: border-box !important;
    display: inline-flex !important;
    height: var(--app-control-height, 30px) !important;
    justify-content: center !important;
    line-height: 1 !important;
    margin: 0 !important;
    min-height: var(--app-control-height, 30px) !important;
    padding: 0 9px !important;
}

body.logged-in .operation-card .compact-icon-btn {
    border-radius: 5px !important;
    flex: 0 0 30px !important;
    padding: 0 !important;
    width: 30px !important;
}

body.logged-in .operation-card .refresh-panel-btn {
    background: var(--app-surface, #fff) !important;
    border-color: var(--app-border-strong, #d8dee8) !important;
    color: var(--app-text-secondary, #4d5b6a) !important;
}

body.logged-in .operation-card .refresh-panel-btn:hover {
    background: var(--app-primary-soft, #e8f2ff) !important;
    border-color: var(--app-primary, #0969da) !important;
    color: var(--app-primary, #0969da) !important;
}

body.logged-in .operation-card .refresh-panel-btn.is-loading i {
    animation: spin 0.8s linear infinite !important;
}

body.logged-in .operation-card .toggle-filter-btn i,
body.logged-in .operation-card .view-btn i,
body.logged-in .operation-card .export-btn i,
body.logged-in .operation-card .compact-icon-btn i {
    align-items: center !important;
    display: inline-flex !important;
    height: 12px !important;
    line-height: 1 !important;
}

@media (max-width: 768px) {
    body.logged-in .operation-card .tab-toolbar,
    body.logged-in .operation-card .toolbar-left,
    body.logged-in .operation-card .toolbar-right {
        align-items: flex-start !important;
    }
}

.vendor-traffic-section {
    max-width: 100%;
    min-width: 0;
}

.vendor-traffic-toolbar {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    justify-content: space-between;
    margin: 8px 0 10px;
    min-width: 0;
}

.vendor-traffic-toolbar strong {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0;
}

.vendor-traffic-toolbar-actions {
    align-items: center;
    display: flex;
    flex: 1 1 auto;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    margin-left: auto;
    max-width: 100%;
    min-width: 0;
}

.vendor-traffic-toolbar .view-toggle {
    flex: 0 1 auto;
    margin-bottom: 0;
    max-width: 100%;
}

.vendor-traffic-toolbar .seg-tab {
    letter-spacing: 0;
}

.vendor-traffic-table-wrap {
    max-width: 100%;
    min-width: 0;
}

.vendor-traffic-table-scroll {
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    overflow-x: auto;
    width: 100%;
}

.api-supplier-source-picker {
    align-items: center;
    display: inline-flex;
    gap: 8px;
    font-size: 13px;
    color: var(--app-text-secondary, #64748b);
}

.api-supplier-source-picker .form-select {
    min-width: 160px;
    width: auto;
}

.api-supplier-source-table tr.is-selected td {
    background: var(--app-primary-soft, rgba(22, 119, 255, 0.08));
    font-weight: 600;
}

.api-supplier-source-note {
    margin: 6px 0 12px;
    font-size: 12px;
    color: var(--app-text-secondary, #64748b);
}

.vendor-traffic-table-scroll .data-table {
    min-width: 520px;
}

@media (max-width: 640px) {
    .vendor-traffic-table-scroll .data-table {
        min-width: 480px;
    }
}

@media (max-width: 390px) {
    .vendor-traffic-toolbar {
        align-items: stretch;
        gap: 8px;
        max-width: 100%;
        min-width: 0;
        width: 100%;
    }

    .vendor-traffic-toolbar strong {
        font-size: 13px;
        max-width: 100%;
        min-width: 0;
    }

    .vendor-traffic-toolbar-actions {
        box-sizing: border-box;
        flex-basis: 100%;
        flex-wrap: wrap;
        justify-content: flex-start;
        margin-left: 0;
        max-width: 100%;
        min-width: 0;
        width: 100%;
    }

    body.logged-in .vendor-traffic-toolbar .view-toggle,
    body.logged-in .vendor-traffic-toolbar .segmented-tabs {
        align-items: stretch !important;
        box-sizing: border-box !important;
        display: flex !important;
        flex: 1 1 100% !important;
        flex-wrap: wrap !important;
        gap: 4px !important;
        justify-content: flex-start !important;
        margin-left: 0 !important;
        max-width: 100% !important;
        min-width: 0 !important;
        overflow: visible !important;
        width: 100% !important;
    }

    body.logged-in .vendor-traffic-toolbar .view-btn,
    body.logged-in .vendor-traffic-toolbar .seg-tab,
    body.logged-in .vendor-traffic-toolbar .download-btn {
        box-sizing: border-box !important;
        flex: 1 1 auto !important;
        height: auto !important;
        letter-spacing: 0 !important;
        margin-left: 0 !important;
        max-width: 100% !important;
        min-width: 0 !important;
        overflow: visible !important;
        white-space: nowrap !important;
    }

    body.logged-in .vendor-traffic-toolbar .download-btn {
        flex: 1 1 100% !important;
        justify-content: center !important;
        width: 100% !important;
    }

    .vendor-traffic-table-scroll .data-table {
        min-width: 440px;
    }
}

.api-supplier-reported-traffic-section {
    box-sizing: border-box;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    justify-items: stretch;
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
    margin-top: 16px;
    padding-top: 14px;
    width: 100%;
    border-top: 1px solid var(--app-border, #e7ecf3);
}

.api-supplier-reported-traffic-header,
.api-supplier-reported-traffic-toolbar {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 12px;
    min-width: 0;
    max-width: 100%;
    width: 100%;
    margin: 0 0 8px;
}

.api-supplier-reported-traffic-title {
    margin: 0;
    min-width: 0;
    max-width: 100%;
    color: var(--app-text, rgba(0, 0, 0, 0.88));
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.api-supplier-reported-traffic-toolbar-actions {
    align-items: center;
    display: flex;
    flex: 1 1 auto;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    margin-left: auto;
    max-width: 100%;
    min-width: 0;
}

.api-supplier-reported-traffic-toolbar .view-toggle {
    flex: 0 1 auto;
    margin-bottom: 0;
    max-width: 100%;
    min-width: 0;
}

.api-supplier-reported-traffic-toolbar .seg-tab {
    align-items: center;
    display: inline-flex;
    letter-spacing: 0;
}

.api-supplier-reported-traffic-toolbar .seg-tab i {
    margin-right: 6px;
}

.api-supplier-reported-traffic-status,
.api-supplier-reported-traffic-error {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    min-width: 0;
    min-height: 40px;
    color: var(--app-text-secondary, rgba(0, 0, 0, 0.65));
    font-size: 13px;
    letter-spacing: 0;
    line-height: 1.45;
}

.api-supplier-reported-traffic-status {
    align-items: center;
}

.api-supplier-reported-traffic-status i,
.api-supplier-reported-traffic-error i {
    flex: 0 0 auto;
    margin-top: 1px;
    color: var(--app-text-muted, rgba(0, 0, 0, 0.45));
    font-size: 14px;
}

.api-supplier-reported-traffic-status i {
    color: var(--app-primary, #1677ff);
}

.api-supplier-reported-traffic-error p,
.api-supplier-reported-traffic-status p,
.api-supplier-reported-traffic-table-note {
    margin: 0;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
    letter-spacing: 0;
}

.api-supplier-reported-traffic-error-label {
    margin-right: 4px;
    color: var(--app-text, rgba(0, 0, 0, 0.88));
    font-weight: 600;
}

.api-supplier-reported-traffic-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
    min-width: 0;
    margin: 0 0 10px;
    color: var(--app-text-secondary, rgba(0, 0, 0, 0.65));
    font-size: 12px;
    letter-spacing: 0;
    line-height: 1.5;
}

.api-supplier-reported-traffic-meta-item {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.api-supplier-reported-traffic-meta-label {
    margin-right: 4px;
    color: var(--app-text-muted, rgba(0, 0, 0, 0.45));
}

.api-supplier-reported-traffic-consumers {
    flex: 1 1 220px;
    max-width: 100%;
}

.api-supplier-reported-traffic-section .chart-container {
    box-sizing: border-box;
    max-width: 100%;
    min-width: 0;
    margin-bottom: 0;
    padding: 12px 8px 8px;
    border-radius: 8px;
    width: 100%;
}

.api-supplier-reported-traffic-chart {
    height: 400px;
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

.api-supplier-reported-traffic-table-wrap {
    box-sizing: border-box;
    max-width: 100%;
    min-width: 0;
    border-radius: 8px;
    overflow: hidden;
    width: 100%;
}

.api-supplier-reported-traffic-table-scroll {
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    width: 100%;
}

.api-supplier-reported-traffic-table {
    min-width: 480px;
}

.api-supplier-reported-traffic-table .is-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.api-supplier-reported-traffic-datecell {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
    max-width: 100%;
}

.api-supplier-reported-traffic-date {
    overflow-wrap: anywhere;
}

.api-supplier-reported-traffic-badge {
    display: inline-block;
    padding: 0 6px;
    border: 1px solid var(--app-border-strong, #d9d9d9);
    border-radius: 4px;
    background: var(--app-surface-muted, #fafafa);
    color: var(--app-text-secondary, rgba(0, 0, 0, 0.65));
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0;
    line-height: 18px;
    white-space: nowrap;
}

.api-supplier-reported-traffic-total-label {
    display: inline-flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
}

.api-supplier-reported-traffic-total-source {
    color: var(--app-text-muted, rgba(0, 0, 0, 0.45));
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0;
}

.api-supplier-reported-traffic-table-note {
    margin: 8px 0 0;
    color: var(--app-text-muted, rgba(0, 0, 0, 0.45));
    font-size: 12px;
    line-height: 1.5;
}

body.logged-in .api-supplier-reported-traffic-section .chart-container,
body.logged-in .api-supplier-reported-traffic-section .table-container,
body.logged-in .api-supplier-reported-traffic-section .api-supplier-reported-traffic-table-wrap {
    box-sizing: border-box !important;
    max-width: 100% !important;
    min-width: 0 !important;
    width: 100% !important;
}

body.logged-in .api-supplier-reported-traffic-section .api-supplier-reported-traffic-table-wrap {
    overflow: hidden !important;
}

body.logged-in .api-supplier-reported-traffic-section {
    box-sizing: border-box !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-x: hidden !important;
    width: 100% !important;
}

body.logged-in .api-supplier-reported-traffic-section .table-container.api-supplier-reported-traffic-table-wrap {
    overflow: hidden !important;
}

body.logged-in .api-supplier-reported-traffic-section .api-supplier-reported-traffic-table-scroll {
    display: block !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    width: 100% !important;
}

@media (max-width: 768px) {
    .api-supplier-reported-traffic-header,
    .api-supplier-reported-traffic-toolbar {
        align-items: stretch;
        flex-direction: column;
        gap: 8px;
        max-width: 100%;
        min-width: 0;
        width: 100%;
    }

    .api-supplier-reported-traffic-toolbar-actions {
        box-sizing: border-box;
        flex-basis: 100%;
        justify-content: flex-start;
        margin-left: 0;
        max-width: 100%;
        min-width: 0;
        width: 100%;
    }

    .api-supplier-reported-traffic-toolbar .view-toggle,
    .api-supplier-reported-traffic-toolbar .segmented-tabs {
        box-sizing: border-box;
        flex: 1 1 100%;
        max-width: 100%;
        min-width: 0;
        width: 100%;
    }

    .api-supplier-reported-traffic-toolbar .seg-tab {
        flex: 1 1 0;
        justify-content: center;
        min-width: 0;
    }

    .api-supplier-reported-traffic-consumers {
        flex-basis: 100%;
    }

    body.logged-in .api-supplier-reported-traffic-section .view-toggle-toolbar.api-supplier-reported-traffic-toolbar {
        align-items: stretch !important;
        box-sizing: border-box !important;
        display: flex !important;
        flex-direction: column !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
        justify-content: flex-start !important;
        margin-bottom: 8px !important;
        max-width: 100% !important;
        min-width: 0 !important;
        width: 100% !important;
    }

    body.logged-in .api-supplier-reported-traffic-section .api-supplier-reported-traffic-title {
        flex: 0 0 auto !important;
        max-width: 100% !important;
        min-width: 0 !important;
        width: 100% !important;
    }

    body.logged-in .api-supplier-reported-traffic-section .api-supplier-reported-traffic-toolbar-actions {
        box-sizing: border-box !important;
        flex: 0 0 auto !important;
        justify-content: flex-start !important;
        margin-left: 0 !important;
        max-width: 100% !important;
        min-width: 0 !important;
        width: 100% !important;
    }

    body.logged-in .api-supplier-reported-traffic-section .api-supplier-reported-traffic-toolbar .view-toggle,
    body.logged-in .api-supplier-reported-traffic-section .api-supplier-reported-traffic-toolbar .segmented-tabs {
        align-items: stretch !important;
        box-sizing: border-box !important;
        display: flex !important;
        flex: 1 1 100% !important;
        flex-wrap: nowrap !important;
        gap: 4px !important;
        justify-content: stretch !important;
        margin-left: 0 !important;
        max-width: 100% !important;
        min-width: 0 !important;
        overflow: visible !important;
        width: 100% !important;
    }

    body.logged-in .api-supplier-reported-traffic-section .api-supplier-reported-traffic-toolbar .seg-tab {
        box-sizing: border-box !important;
        flex: 1 1 0 !important;
        height: auto !important;
        justify-content: center !important;
        letter-spacing: 0 !important;
        margin-left: 0 !important;
        max-width: 100% !important;
        min-width: 0 !important;
        overflow: visible !important;
        white-space: nowrap !important;
    }
}

@media (max-width: 390px) {
    .api-supplier-reported-traffic-title {
        font-size: 13px;
    }

    .api-supplier-reported-traffic-table {
        min-width: 440px;
    }
}

/* API supplier 0002 IP statistics (daily active / online / overlap with SDK) */
.api-supplier-ip-stats-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
    margin: 4px 0 12px;
    min-width: 0;
}

.api-supplier-ip-stats-kpi {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--app-border, #e7ecf3);
    border-radius: 8px;
    background: var(--app-surface, #fff);
}

.api-supplier-ip-stats-kpi-label {
    color: var(--app-text-secondary, rgba(0, 0, 0, 0.65));
    font-size: 12px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.api-supplier-ip-stats-kpi-value {
    color: var(--app-text, rgba(0, 0, 0, 0.88));
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.api-supplier-ip-stats-note {
    margin: 8px 0 0;
    color: var(--app-text-muted, rgba(0, 0, 0, 0.45));
    font-size: 12px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.api-supplier-ip-stats-warning {
    color: var(--app-warning, #ad6800);
}

/* API supplier 0002 host cards (live, from the server monitor) */
.api-supplier-hosts-section {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 0 0 16px;
}

.api-supplier-hosts-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 4px 12px;
    margin: 0 0 10px;
}

.api-supplier-hosts-title {
    margin: 0;
    color: var(--app-text, rgba(0, 0, 0, 0.88));
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
}

.api-supplier-hosts-summary {
    color: var(--app-text-secondary, rgba(0, 0, 0, 0.65));
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.api-supplier-hosts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.api-supplier-host-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid var(--app-border, #e7ecf3);
    border-radius: 8px;
    background: var(--app-surface, #fff);
}

.api-supplier-host-card.is-offline {
    border-color: rgba(207, 19, 34, 0.35);
}

.api-supplier-host-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
}

.api-supplier-host-name {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    margin: 0;
    color: var(--app-text, rgba(0, 0, 0, 0.88));
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.api-supplier-host-dot {
    flex: 0 0 auto;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #389e0d;
    box-shadow: 0 0 0 3px rgba(56, 158, 13, 0.15);
}

.api-supplier-host-card.is-offline .api-supplier-host-dot {
    background: #cf1322;
    box-shadow: 0 0 0 3px rgba(207, 19, 34, 0.15);
}

.api-supplier-host-state {
    flex: 0 0 auto;
    padding: 1px 8px;
    border-radius: 10px;
    background: rgba(56, 158, 13, 0.1);
    color: #237804;
    font-size: 12px;
    line-height: 18px;
    white-space: nowrap;
}

.api-supplier-host-card.is-offline .api-supplier-host-state {
    background: rgba(207, 19, 34, 0.08);
    color: #a8071a;
}

.api-supplier-host-meta {
    margin: 2px 0 0;
    color: var(--app-text-secondary, rgba(0, 0, 0, 0.65));
    font-size: 12px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.api-supplier-host-bars {
    display: grid;
    gap: 8px;
}

.api-supplier-host-bar-row {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    line-height: 1.3;
}

.api-supplier-host-bar-label {
    color: var(--app-text-secondary, rgba(0, 0, 0, 0.65));
}

.api-supplier-host-bar {
    position: relative;
    height: 6px;
    overflow: hidden;
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.06);
}

.api-supplier-host-bar > span {
    position: absolute;
    inset: 0 auto 0 0;
    border-radius: 3px;
    background: #1677ff;
    transition: width 0.4s ease;
}

.api-supplier-host-bar.is-high > span {
    background: #d46b08;
}

.api-supplier-host-bar.is-critical > span {
    background: #cf1322;
}

.api-supplier-host-bar-value {
    color: var(--app-text, rgba(0, 0, 0, 0.88));
    font-variant-numeric: tabular-nums;
    text-align: right;
    white-space: nowrap;
}

.api-supplier-host-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 12px;
    margin: 0;
    padding-top: 10px;
    border-top: 1px dashed var(--app-border, #e7ecf3);
}

.api-supplier-host-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.api-supplier-host-stat dt {
    color: var(--app-text-secondary, rgba(0, 0, 0, 0.65));
    font-size: 12px;
    line-height: 1.3;
}

.api-supplier-host-stat dd {
    margin: 0;
    color: var(--app-text, rgba(0, 0, 0, 0.88));
    font-size: 13px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.api-supplier-host-foot {
    color: var(--app-text-muted, rgba(0, 0, 0, 0.45));
    font-size: 11px;
    line-height: 1.3;
}

.api-supplier-hosts-error {
    padding: 10px 12px;
    border: 1px solid rgba(207, 19, 34, 0.25);
    border-radius: 8px;
    background: rgba(207, 19, 34, 0.04);
    color: #a8071a;
    font-size: 12px;
}

@media (prefers-reduced-motion: reduce) {
    .api-supplier-host-bar > span {
        transition: none;
    }
}
