/* 旭彭设备监管系统 - 管理员后台样式 */
.admin-body { background: #f0f2f5; }

/* 布局 */
.admin-layout { display: flex; min-height: 100vh; }

/* 侧边栏 */
.admin-sidebar { width: 220px; background: linear-gradient(180deg, #1a1f3a 0%, #0d1333 100%); color: #fff; position: fixed; top: 0; left: 0; height: 100vh; overflow-y: auto; z-index: 100; transition: transform 0.3s; }
.sidebar-header { padding: 20px 16px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.sidebar-logo { font-size: 18px; font-weight: 700; background: linear-gradient(135deg, #6b8cff, #00c8ff); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.sidebar-subtitle { font-size: 11px; color: rgba(255,255,255,0.4); margin-top: 4px; }
.sidebar-nav { padding: 12px 0; }
.nav-group { padding: 12px 16px 6px; font-size: 11px; color: rgba(255,255,255,0.3); text-transform: uppercase; letter-spacing: 1px; }
.nav-item { display: flex; align-items: center; padding: 10px 16px; color: rgba(255,255,255,0.7); text-decoration: none; font-size: 13px; transition: all 0.2s; border-left: 3px solid transparent; }
.nav-item:hover { background: rgba(255,255,255,0.05); color: #fff; text-decoration: none; }
.nav-item.active { background: rgba(74,108,247,0.15); color: #6b8cff; border-left-color: #4a6cf7; }
.nav-icon { margin-right: 10px; width: 18px; text-align: center; font-size: 14px; }
.nav-badge { margin-left: auto; background: #ff6b6b; color: #fff; font-size: 10px; padding: 1px 6px; border-radius: 8px; }

/* 主内容区 */
.admin-main { flex: 1; margin-left: 220px; min-height: 100vh; }
.admin-header { background: #fff; padding: 14px 24px; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 1px 4px rgba(0,0,0,0.05); position: sticky; top: 0; z-index: 50; }
.header-left { display: flex; align-items: center; gap: 12px; }
.sidebar-toggle { background: none; border: none; font-size: 18px; cursor: pointer; padding: 4px 8px; border-radius: 4px; }
.sidebar-toggle:hover { background: #f0f0f0; }
.page-title { font-size: 18px; font-weight: 600; color: #333; }
.header-right { display: flex; align-items: center; gap: 16px; }
.admin-info { font-size: 13px; color: #666; }
.logout-btn { color: #ff6b6b; font-size: 13px; text-decoration: none; }
.logout-btn:hover { text-decoration: underline; }

.admin-content { padding: 20px 24px; }

/* 工具栏 */
.page-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }
.toolbar-info { font-size: 13px; color: #999; }

/* 数据面板 */
.data-panel { background: #fff; border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); overflow: hidden; margin-bottom: 16px; }
.panel-header { padding: 14px 18px; border-bottom: 1px solid #f0f0f0; display: flex; justify-content: space-between; align-items: center; }
.panel-header h3 { font-size: 15px; font-weight: 600; color: #333; }
.panel-more { font-size: 12px; color: #4a6cf7; }
.panel-badge { background: #ff6b6b; color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 10px; }
.panel-body { padding: 0; }

/* 统计卡片 */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card { background: #fff; border-radius: 10px; padding: 18px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); position: relative; overflow: hidden; }
.stat-value { font-size: 26px; font-weight: 700; color: #333; margin-bottom: 4px; }
.stat-label { font-size: 13px; color: #999; }
.stat-icon { position: absolute; right: 14px; top: 14px; width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; }

/* 双栏布局 */
.dashboard-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.dashboard-panel { background: #fff; border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); overflow: hidden; }

/* 预警列表 */
.alert-list { padding: 8px; }
.alert-item { display: flex; align-items: center; padding: 10px; border-radius: 8px; margin-bottom: 6px; background: #fff8f0; }
.alert-icon { width: 32px; height: 32px; border-radius: 50%; background: #ff9f43; color: #fff; display: flex; align-items: center; justify-content: center; margin-right: 12px; font-size: 14px; flex-shrink: 0; }
.alert-info { flex: 1; }
.alert-title { font-size: 13px; font-weight: 600; color: #333; }
.alert-desc { font-size: 12px; color: #999; margin-top: 2px; }
.alert-action { font-size: 12px; color: #4a6cf7; white-space: nowrap; }

/* 空状态 */
.empty-state { text-align: center; padding: 30px; color: #999; }
.empty-icon { font-size: 36px; color: #00c896; margin-bottom: 8px; }

/* 上锁卡片 */
.lock-card { background: #fff; border-radius: 10px; padding: 16px; margin-bottom: 14px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.lock-card-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid #f0f0f0; }
.lock-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px; margin-bottom: 12px; }
.lock-item { display: flex; align-items: center; padding: 8px 10px; border: 1px solid #eee; border-radius: 6px; cursor: pointer; transition: all 0.2s; }
.lock-item:hover { border-color: #4a6cf7; background: #f8f9ff; }
.lock-item input[type="checkbox"] { margin-right: 8px; }
.lock-name { flex: 1; font-size: 12px; color: #555; }
.lock-state { font-size: 11px; padding: 1px 6px; border-radius: 4px; }
.lock-state.active { background: #e6f7ef; color: #00c896; }
.lock-state.inactive { background: #f5f5f5; color: #999; }

/* 策略卡片 */
.policy-card { background: #fff; border-radius: 10px; padding: 16px; margin-bottom: 14px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.policy-card-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid #f0f0f0; }
.policy-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; margin-bottom: 12px; }
.policy-item { display: flex; align-items: center; padding: 8px 10px; border: 1px solid #eee; border-radius: 6px; cursor: pointer; font-size: 12px; }
.policy-item:hover { border-color: #4a6cf7; background: #f8f9ff; }
.policy-item input { margin-right: 8px; }

/* 图表 */
.chart-container { padding: 10px; }
.chart-bar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.chart-label { width: 50px; font-size: 12px; color: #666; text-align: right; }
.chart-bar-wrap { flex: 1; height: 20px; background: #f5f5f5; border-radius: 4px; overflow: hidden; }
.chart-bar { height: 100%; background: linear-gradient(90deg, #4a6cf7, #6b8cff); border-radius: 4px; transition: width 0.3s; }
.chart-value { width: 30px; font-size: 12px; color: #666; }

/* 连接检测 */
.device-info-bar { display: flex; gap: 20px; padding: 14px; background: #f8f9fb; border-radius: 8px; margin-bottom: 16px; flex-wrap: wrap; font-size: 13px; }
.check-list { margin-bottom: 16px; }
.check-item { display: flex; align-items: center; padding: 14px; border-radius: 8px; margin-bottom: 8px; }
.check-pass { background: #f0faf5; }
.check-fail { background: #fef5f5; }
.check-icon { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-right: 14px; font-size: 14px; font-weight: 700; flex-shrink: 0; }
.check-pass .check-icon { background: #00c896; color: #fff; }
.check-fail .check-icon { background: #ff6b6b; color: #fff; }
.check-info { flex: 1; }
.check-name { font-size: 14px; font-weight: 600; color: #333; }
.check-detail { font-size: 12px; color: #888; margin-top: 2px; }
.check-summary { padding: 14px; background: #f8f9fb; border-radius: 8px; font-size: 14px; text-align: center; }
.summary-ok { color: #00c896; font-weight: 600; }
.summary-fail { color: #ff6b6b; font-weight: 600; }

/* 响应式 */
@media (max-width: 992px) {
    .admin-sidebar { transform: translateX(-100%); }
    .admin-sidebar.open { transform: translateX(0); }
    .admin-main { margin-left: 0; }
    .dashboard-row { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
    .admin-content { padding: 12px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .stat-value { font-size: 20px; }
}
