/* ========== Dashboard 专用样式 ========== */

/* Dashboard 整体容器 */
.dashboard-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 0;
}

/* 第一行：关键指标卡片 */
.dash-stats-row {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 15px;
}

.dash-stat-card {
    background: linear-gradient(135deg, #1a2b50 0%, #0f1c3c 100%);
    border-radius: 8px;
    padding: 20px 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s;
    border: 1px solid rgba(79, 195, 247, 0.15);
}

.dash-stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    border-color: rgba(79, 195, 247, 0.4);
}

.dash-stat-icon {
    font-size: 28px;
    min-width: 36px;
    text-align: center;
}

.dash-stat-green .dash-stat-icon { color: #4caf50; }
.dash-stat-orange .dash-stat-icon { color: #ff9800; }
.dash-stat-red .dash-stat-icon { color: #f44336; }
.dash-stat-blue .dash-stat-icon { color: #2196f3; }

.dash-stat-info {
    flex: 1;
}

.dash-stat-value {
    font-size: 28px;
    font-weight: bold;
    color: #fff;
    line-height: 1.2;
}

.dash-stat-green .dash-stat-value { color: #4caf50; }
.dash-stat-orange .dash-stat-value { color: #ff9800; }
.dash-stat-red .dash-stat-value { color: #f44336; }
.dash-stat-blue .dash-stat-value { color: #2196f3; }

.dash-stat-label {
    font-size: 13px;
    color: #b0bec5;
    margin-top: 4px;
}

/* 第二行：环境监测指标 */
.dash-env-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.dash-env-card {
    background: linear-gradient(135deg, #1a2b50 0%, #0f1c3c 100%);
    border-radius: 8px;
    padding: 15px 20px;
    border: 1px solid rgba(79, 195, 247, 0.15);
    transition: all 0.3s;
}

.dash-env-card:hover {
    border-color: rgba(79, 195, 247, 0.4);
    transform: translateY(-2px);
}

.dash-env-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #4fc3f7;
    font-weight: bold;
    margin-bottom: 8px;
}

.dash-env-header i {
    font-size: 18px;
}

.dash-env-value {
    font-size: 22px;
    font-weight: bold;
    color: #fff;
    margin-bottom: 12px;
}

.dash-env-bar {
    width: 100%;
    height: 6px;
    background-color: rgba(79, 195, 247, 0.15);
    border-radius: 3px;
    overflow: hidden;
}

.dash-env-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.dash-env-fill-green {
    background: linear-gradient(90deg, #4caf50, #8bc34a);
}

.dash-env-fill-orange {
    background: linear-gradient(90deg, #ff9800, #ffc107);
}

.dash-env-fill-red {
    background: linear-gradient(90deg, #f44336, #ff5722);
}

/* 第三行：图表区 */
.dash-charts-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.dash-card {
    background: linear-gradient(135deg, #1a2b50 0%, #0f1c3c 100%);
    border-radius: 8px;
    padding: 15px 20px;
    border: 1px solid rgba(79, 195, 247, 0.15);
}

.dash-card-title {
    font-size: 16px;
    color: #4fc3f7;
    font-weight: bold;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dash-card .chart-container {
    width: 100%;
    height: 280px;
}

/* 第四行：底部区域 */
.dash-bottom-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 15px;
}

.dash-card-wide {
    /* 继承 dash-card 样式 */
}

/* 预警信息列表 */
.dash-alert-count {
    font-size: 12px;
    background-color: rgba(244, 67, 54, 0.3);
    color: #f44336;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: normal;
}

.dash-alert-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 250px;
    overflow-y: auto;
}

.dash-alert-list::-webkit-scrollbar {
    width: 4px;
}

.dash-alert-list::-webkit-scrollbar-track {
    background: rgba(79, 195, 247, 0.1);
}

.dash-alert-list::-webkit-scrollbar-thumb {
    background: rgba(79, 195, 247, 0.3);
    border-radius: 2px;
}

.dash-alert-item {
    display: flex;
    margin-bottom: 10px;
    border-radius: 6px;
    overflow: hidden;
    background-color: rgba(26, 43, 80, 0.5);
    transition: background-color 0.2s;
}

.dash-alert-item:hover {
    background-color: rgba(26, 43, 80, 0.8);
}

.dash-alert-item:last-child {
    margin-bottom: 0;
}

.dash-alert-left-bar {
    width: 4px;
    min-height: 40px;
}

.dash-alert-urgent .dash-alert-left-bar {
    background-color: #f44336;
}

.dash-alert-warning .dash-alert-left-bar {
    background-color: #ff9800;
}

.dash-alert-info .dash-alert-left-bar {
    background-color: #2196f3;
}

.dash-alert-body {
    flex: 1;
    padding: 10px 15px;
}

.dash-alert-top {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.dash-alert-level {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

.dash-level-red {
    background-color: rgba(244, 67, 54, 0.3);
    color: #f44336;
}

.dash-level-orange {
    background-color: rgba(255, 152, 0, 0.3);
    color: #ff9800;
}

.dash-level-blue {
    background-color: rgba(33, 150, 243, 0.3);
    color: #2196f3;
}

.dash-alert-name {
    font-size: 14px;
    color: #fff;
}

.dash-alert-detail {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #b0bec5;
}

.dash-alert-val {
    color: #e0e0e0;
}

.dash-alert-time {
    color: #78909c;
}

/* 视频监控区域 */
/* === Video Grid (2x2) === */
.dash-video-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 4px;
    height: 100%;
    background: #000;
    border-radius: 4px;
}
.dash-video-item {
    position: relative;
    overflow: hidden;
    background: #111;
    border-radius: 2px;
}
.dash-video-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.dash-video-item-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 2px 6px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 11px;
    z-index: 1;
    pointer-events: none;
}
