@import url("https://cdn.jsdelivr.net/npm/pretendard@1.3.9/dist/web/static/pretendard.css");

:root {
  color-scheme: light;
  --bg-canvas: #f6f8fa;
  --bg-surface: #ffffff;
  --bg-subtle: #f9fafb;
  --text-primary: #1f2328;
  --text-secondary: #57606a;
  --text-muted: #6e7781;
  --border-default: #d0d7de;
  --border-muted: #eaeef2;
  --blue: #0969da;
  --blue-soft: #ddf4ff;
  --green: #1a7f37;
  --green-soft: #dafbe1;
  --red: #d1242f;
  --red-soft: #ffebe9;
  --gray: #afb8c1;
  --gray-soft: #f0f3f6;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 10px;
  --shadow-soft: 0 8px 28px rgba(31, 35, 40, 0.07);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Pretendard Variable", "Pretendard", "SUIT Variable", "SUIT", "Noto Sans KR",
    -apple-system, sans-serif;
  color: var(--text-primary);
  background: var(--bg-canvas);
  line-height: 1.45;
}

.bg-layer {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 8% 10%, rgba(9, 105, 218, 0.08), transparent 34%),
    radial-gradient(circle at 90% 78%, rgba(31, 35, 40, 0.07), transparent 38%),
    linear-gradient(180deg, #fdfefe 0%, #f5f8fb 100%);
}

.layout {
  width: min(1180px, 94vw);
  margin: 1.25rem auto 2.2rem;
}

.masthead {
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  box-shadow: var(--shadow-soft);
  padding: 1rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.brand-chip {
  border-radius: 999px;
  border: 1px solid #bfd8ff;
  background: var(--blue-soft);
  color: #0550ae;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.22rem 0.55rem;
}

.brand-overline {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.73rem;
  letter-spacing: 0.12em;
  font-weight: 700;
  text-transform: uppercase;
}

h1 {
  margin: 0.2rem 0 0;
  font-size: clamp(1.34rem, 2vw, 1.82rem);
  line-height: 1.2;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.sync-time {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.82rem;
}

button {
  appearance: none;
  border: 1px solid #0958bb;
  background: var(--blue);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.84rem;
  border-radius: var(--radius-sm);
  padding: 0.58rem 0.92rem;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

button:hover {
  background: #0550ae;
  box-shadow: 0 8px 20px rgba(9, 105, 218, 0.26);
}

button:active {
  transform: translateY(1px);
}

button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  box-shadow: none;
}

.content {
  margin-top: 0.95rem;
  display: grid;
  gap: 0.9rem;
}

.status-banner {
  border: 1px solid var(--border-default);
  border-left-width: 6px;
  border-left-color: var(--gray);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  box-shadow: var(--shadow-soft);
  padding: 0.95rem 1.1rem;
  display: grid;
  gap: 0.45rem;
  animation: fade-up 0.42s ease both;
}

.status-banner.operational {
  border-left-color: var(--green);
}

.status-banner.degraded {
  border-left-color: var(--red);
}

.status-banner.unknown {
  border-left-color: var(--gray);
}

.banner-indicator {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.status-dot {
  width: 0.78rem;
  height: 0.78rem;
  border-radius: 999px;
  background: var(--gray);
  box-shadow: 0 0 0 4px rgba(175, 184, 193, 0.26);
  flex: none;
}

.status-dot.good {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(26, 127, 55, 0.2);
}

.status-dot.bad {
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(209, 36, 47, 0.18);
}

.status-dot.unknown {
  background: var(--gray);
  box-shadow: 0 0 0 4px rgba(175, 184, 193, 0.26);
}

.banner-label {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.banner-copy h2 {
  margin: 0;
  font-size: 1.15rem;
}

.banner-copy p {
  margin: 0.34rem 0 0;
  color: var(--text-secondary);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.72rem;
}

.metric-card {
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  padding: 0.78rem 0.9rem;
  animation: fade-up 0.42s ease both;
}

.metric-grid .metric-card:nth-child(2) {
  animation-delay: 0.06s;
}

.metric-grid .metric-card:nth-child(3) {
  animation-delay: 0.12s;
}

.metric-grid .metric-card:nth-child(4) {
  animation-delay: 0.18s;
}

.metric-label {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.metric-value {
  margin: 0.3rem 0 0;
  font-size: 1.55rem;
  line-height: 1.1;
  font-weight: 700;
}

.metric-sub {
  margin: 0.26rem 0 0;
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.panel {
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  box-shadow: var(--shadow-soft);
  padding: 1rem 1.08rem;
  animation: fade-up 0.42s ease both;
}

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.8rem;
}

h3 {
  margin: 0;
  font-size: 1.02rem;
}

.panel-head p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.table-wrap {
  margin-top: 0.72rem;
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
}

thead th {
  text-align: left;
  padding: 0.72rem 0.42rem;
  border-bottom: 1px solid var(--border-default);
  color: var(--text-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

tbody td {
  padding: 0.86rem 0.42rem;
  border-bottom: 1px solid var(--border-muted);
  vertical-align: top;
  font-size: 0.84rem;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.service-main {
  font-weight: 700;
}

.service-url {
  margin-top: 0.16rem;
  color: var(--text-secondary);
  font-size: 0.78rem;
  word-break: break-all;
}

.service-time {
  margin-top: 0.14rem;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.22rem 0.56rem;
  font-size: 0.73rem;
  font-weight: 700;
}

.status-pill.good {
  background: var(--green-soft);
  color: #116329;
}

.status-pill.bad {
  background: var(--red-soft);
  color: #9a1b24;
}

.status-pill.unknown {
  background: var(--gray-soft);
  color: #4f5863;
}

.response {
  display: flex;
  align-items: center;
  gap: 0.44rem;
}

.code-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 0.16rem 0.46rem;
  font-size: 0.72rem;
  font-weight: 700;
}

.code-badge.good {
  background: var(--green-soft);
  border-color: #92d7a4;
  color: #116329;
}

.code-badge.warn {
  background: #fff8c5;
  border-color: #eac54f;
  color: #7f5f00;
}

.code-badge.bad {
  background: var(--red-soft);
  border-color: #f7b2b7;
  color: #9a1b24;
}

.code-badge.neutral {
  background: var(--gray-soft);
  border-color: #d8dee4;
  color: #4f5863;
}

.latency {
  color: var(--text-secondary);
  font-size: 0.78rem;
}

.history {
  display: flex;
  gap: 2px;
  min-width: 126px;
}

.history-cell {
  width: 4px;
  height: 17px;
  border-radius: 999px;
  background: var(--gray-soft);
}

.history-cell.up {
  background: var(--green);
}

.history-cell.down {
  background: var(--red);
}

.incident-list {
  list-style: none;
  margin: 0.8rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}

.incident-item {
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  padding: 0.74rem 0.82rem;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.62rem;
}

.incident-marker {
  width: 0.56rem;
  height: 0.56rem;
  border-radius: 999px;
  margin-top: 0.32rem;
  background: var(--text-muted);
  box-shadow: 0 0 0 4px rgba(110, 119, 129, 0.2);
}

.incident-item.active .incident-marker {
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(209, 36, 47, 0.18);
}

.incident-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.incident-title {
  margin: 0;
  font-weight: 700;
}

.incident-state {
  border-radius: 999px;
  padding: 0.14rem 0.48rem;
  font-size: 0.71rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.incident-state.active {
  background: var(--red-soft);
  color: #9a1b24;
}

.incident-state.resolved {
  background: var(--green-soft);
  color: #116329;
}

.incident-meta {
  margin: 0.22rem 0 0;
  color: var(--text-secondary);
  font-size: 0.78rem;
}

.incident-reason {
  margin: 0.3rem 0 0;
  color: var(--text-muted);
  font-size: 0.77rem;
}

.incident-empty {
  border: 1px dashed var(--border-default);
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  padding: 0.75rem 0.8rem;
  color: var(--text-secondary);
  font-size: 0.82rem;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1080px) {
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 780px) {
  .layout {
    width: min(1180px, 95vw);
    margin-top: 0.9rem;
  }

  .masthead {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  button {
    width: 100%;
  }

  .panel-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }
}
