/* =====================================================
   PriNet Admin — TARS-style Management Console
   ===================================================== */

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif; background: #eef1f6; }

/* ---------- Top Navbar ---------- */
.top-navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  height: 60px; background: #1d2b3a; display: flex; align-items: center;
  padding: 0 24px; color: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.25);
}
.top-navbar .logo { font-size: 20px; font-weight: 700; letter-spacing: .5px; display: flex; align-items: center; gap: 8px; }
.top-navbar .logo .diamond { color: #409EFF; font-size: 24px; }

/* ---- Module Tabs ---- */
.top-navbar .module-tabs { margin-left: 48px; display: flex; gap: 6px; }
.top-navbar .module-tabs .module-tab {
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12);
  color: rgba(255,255,255,.7); padding: 8px 22px; border-radius: 6px;
  font-size: 14px; font-weight: 500; cursor: pointer; transition: all .2s;
  display: flex; align-items: center; gap: 6px;
}
.top-navbar .module-tabs .module-tab:hover {
  color: #fff; background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.25);
}
.top-navbar .module-tabs .module-tab.active {
  color: #fff; background: rgba(64,158,255,.4); border-color: rgba(64,158,255,.6);
  box-shadow: 0 0 8px rgba(64,158,255,.3);
}
.top-navbar .module-tabs .module-tab .el-icon { font-size: 16px; }
.top-navbar .right-info { margin-left: auto; display: flex; align-items: center; gap: 16px; font-size: 13px; color: rgba(255,255,255,.65); }

/* ---------- Sidebar ---------- */
.sidebar {
  position: fixed; top: 60px; left: 0; bottom: 0; width: 220px; z-index: 900;
  background: #f5f7fa; border-right: 1px solid #dcdfe6; overflow-y: auto;
  transition: width .25s; padding-top: 8px;
}
.sidebar.collapsed { width: 0; overflow: hidden; }
.sidebar .sidebar-title { padding: 12px 16px 6px; font-size: 12px; color: #909399; text-transform: uppercase; letter-spacing: 1px; }
.sidebar .el-menu { border-right: none; background: transparent; }
.sidebar .el-menu-item, .sidebar .el-sub-menu__title { font-size: 13px; height: 40px; line-height: 40px; }

/* status dot in sidebar */
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.status-dot.online  { background: #67C23A; box-shadow: 0 0 4px #67C23A; }
.status-dot.offline { background: #F56C6C; }
.status-dot.unknown { background: #909399; }

/* ---------- Main Content ---------- */
.main-content {
  margin-left: 220px; margin-top: 60px; padding: 20px 24px; min-height: calc(100vh - 60px);
  background: #eef1f6; transition: margin-left .25s;
}
.main-content.expanded { margin-left: 0; }

/* ---------- Stat Cards Row ---------- */
.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: #fff; border-radius: 8px; padding: 20px; display: flex; align-items: center; gap: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08); transition: box-shadow .2s;
}
.stat-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.12); }
.stat-card .icon-wrap {
  width: 52px; height: 52px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 24px; color: #fff;
}
.stat-card .info .label { font-size: 13px; color: #909399; margin-bottom: 4px; }
.stat-card .info .value { font-size: 28px; font-weight: 700; color: #303133; }
.stat-card .info .suffix { font-size: 13px; color: #909399; margin-left: 4px; }

/* ---------- Content Card ---------- */
.content-card { background: #fff; border-radius: 8px; padding: 20px; margin-bottom: 20px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.content-card .card-header { font-size: 15px; font-weight: 600; color: #303133; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }

/* ---------- Page Header ---------- */
.page-header { margin-bottom: 20px; }
.page-header h2 { font-size: 20px; font-weight: 600; color: #303133; }

/* ---------- Filter Bar ---------- */
.filter-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 16px; }
.filter-bar .el-input { max-width: 280px; }

/* ---------- Log Viewer ---------- */
.log-viewer {
  background: #1e1e1e; color: #4af626; font-family: "Cascadia Code", "Fira Code", "Consolas", monospace;
  font-size: 13px; line-height: 1.7; padding: 16px; border-radius: 8px; overflow: auto;
  max-height: calc(100vh - 240px); white-space: pre-wrap; word-break: break-all;
}
.log-viewer .log-line:hover { background: rgba(255,255,255,.06); }

/* ---------- Detail Panels ---------- */
.detail-panel { margin-top: 16px; }
.detail-panel .card-header { border-bottom: 1px solid #ebeef5; padding-bottom: 12px; margin-bottom: 16px; }
.detail-panel .el-descriptions { width: 100%; }
.detail-panel .el-descriptions__label { width: 140px; font-weight: 500; background: #fafafa; }

/* ---------- Topology ---------- */
.topology-container { position: relative; height: calc(100vh - 120px); }
.topology-chart { width: 100%; height: 100%; background: #fff; border-radius: 8px; }

/* ---------- Progress Bars (system page) ---------- */
.sys-progress-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-bottom: 24px; }
.sys-progress-item .label-row { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 13px; color: #606266; }

/* ---------- YAML preview ---------- */
.yaml-preview { background: #f5f7fa; border: 1px solid #dcdfe6; border-radius: 6px; padding: 16px; font-family: monospace; font-size: 13px; line-height: 1.7; white-space: pre-wrap; color: #303133; max-height: 400px; overflow: auto; }

/* ---------- Responsive ---------- */
.sidebar-toggle { display: none; cursor: pointer; color: #fff; font-size: 20px; margin-right: 12px; }

@media (max-width: 768px) {
  .sidebar { width: 0; overflow: hidden; }
  .sidebar.show { width: 220px; }
  .main-content { margin-left: 0; }
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
  .sys-progress-grid { grid-template-columns: 1fr; }
  .sidebar-toggle { display: inline-block; }
}
