/* ============================================================
   widget.css — 위젯 카드, KPI 博스, 배지, 그룹 레이아웃
   모든 페이지에서 공통 사용
   ============================================================ */

/* ── 기본 위젯 카드 ── */
.widget {
  background: var(--widget);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 6px rgba(0,0,0,0.3);
  width: 100%;
  min-width: 0;
  height: auto;
  min-height: 280px;
  cursor: pointer;
  transition: transform 0.2s;
  overflow: hidden;
}
.widget:hover {
  transform: translateY(-2px);
  border-color: var(--blue);
}
.widget--static { cursor: default; }  /* 클릭 불가 위젯 */

/* ── 위젯 내부 헤더 ── */
.w-header {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text-sub);
  text-transform: uppercase;
  margin-bottom: 12px;
  border-bottom: 1px solid #25282e;
  padding-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  letter-spacing: 0.5px;
}
.w-title-text::before {
  content: '';
  width: 5px;
  height: 14px;
  background: var(--purple);
  border-radius: 2px;
  margin-right: 10px;
  display: inline-block;
  vertical-align: middle;
}

/* ── 상태 배지 ── */
.badge {
  padding: 3px 8px;
  border-radius: 3px;
  font-size: var(--text-xs);
  font-weight: 700;
  white-space: nowrap;
  display: inline-block;
  letter-spacing: 0.3px;
}

/* ── 서브 타이틀 행 (■ SERVERS  [CRITICAL]) ── */
.sub-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--text-sm);
  color: var(--blue);
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: 0.3px;
}

/* ── 그룹 래퍼 (가로 배치) ── */
.group-wrap {
  display: flex;
  gap: 15px;
  flex: 1;
  min-height: 0;
  width: 100%;
  overflow: hidden;
}
.group-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  justify-content: center;
  overflow: hidden;
}
@media (max-width: 600px) {
  .group-wrap  { flex-direction: column; }
  .group-col   { width: 100%; flex: none; }
}

/* ── KPI 박스 ── */
.kpi-box {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
  min-height: 70px;
  container-type: inline-size;
}
.kpi-label {
  font-size: var(--text-sm);
  color: var(--text-sub);
  margin-bottom: 6px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.5px;
}
.kpi-val {
  font-size: clamp(1.8rem, 22cqw, 4rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -1px;
  font-family: var(--font-mono);
}

/* ── detail 페이지용 타일 공통 ── */
.common-tile {
  background: #1c1f26;
  border: 1px solid #2d3139;
  border-radius: 6px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s, transform 0.2s;
  cursor: pointer;
  min-width: 0;
  overflow: hidden;
}
.common-tile:hover {
  border-color: var(--blue);
  transform: translateY(-2px);
}

/* 큰 타일 (서버 · 보안) */
.l-tile {
  height: 110px;
  justify-content: space-between;
}
/* 작은 타일 (URL) */
.s-tile {
  height: 60px;
  justify-content: space-between;
  border-radius: 4px;
  padding: 8px;
}

.l-head { font-size: var(--text-base); font-weight: 700; color: #fff; letter-spacing: 0.3px; }
.l-sub  { font-size: var(--text-sm); color: var(--text-sub); margin-top: 5px; height: 35px; overflow: hidden; line-height: 1.4; }
.l-stat { margin-top: auto; font-size: var(--text-sm); font-weight: 700; color: var(--green); text-align: right; }

.s-head { display: flex; justify-content: space-between; align-items: center; }
.s-dot  { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.s-name { font-size: var(--text-sm); font-weight: 700; color: #eee; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: 0.2px; }
.s-cat  { font-size: var(--text-xs); color: #666; font-weight: 500; }

/* ── summary-box (detail 페이지 합계 행) ── */
.summary-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  background: rgba(0,0,0,0.3);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sum-item  { display: flex; flex-direction: column; gap: 6px; }
.sum-label { font-size: var(--text-xs); color: var(--text-sub); font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; }
.sum-val   { font-size: var(--text-3xl); font-weight: 900; color: #fff; font-family: var(--font-mono); line-height: 1; }
.val-down  { color: var(--red); text-shadow: 0 0 10px rgba(255, 23, 68, 0.4); }

/* ── network 페이지 summary card ── */
.summary-section { padding: 12px 12px 5px 12px; flex-shrink: 0; overflow: hidden; }
.summary-row     { display: flex; gap: 10px; flex-wrap: wrap; }
.summary-card {
  flex: 1 1 min(150px, 100%);
  min-width: 0;
  background: #18191d;
  border-radius: 6px;
  padding: 10px 15px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 80px;
  border: 1px solid var(--border);
}
.card-danger { border-color: var(--red); }
.card-normal { border-color: var(--border); }

/* summary-card 깜빡임 효과 */
.card-blink-critical {
  border-color: var(--red);
  animation: blink-red 1.5s infinite;
}
.card-blink-warning {
  border-color: var(--yellow);
  animation: blink-warning 1.5s infinite;
}

.sc-title  { font-size: var(--text-sm); color: var(--text-sub); font-weight: 700; margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.sc-value  { font-size: var(--text-4xl); font-weight: 900; color: #fff; line-height: 1; font-family: var(--font-mono); }
.sc-footer { text-align: right; font-size: var(--text-sm); font-weight: 700; margin-top: auto; }
.text-red   { color: var(--red); }
.text-green { color: var(--green); }
.text-gray  { color: #666; }

/* ── 스크롤 가능 콘텐츠 영역 ── */
.w-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0;
  min-height: 0;
}
.w-content::-webkit-scrollbar       { width: 6px; }
.w-content::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }
