:root {
  color-scheme: dark;
  font-family: Inter, Pretendard, "Noto Sans KR", system-ui, sans-serif;
  background: #090b10;
  color: #f4f6fb;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 0%, rgba(79, 70, 229, 0.2), transparent 34rem),
    radial-gradient(circle at 90% 10%, rgba(220, 38, 38, 0.14), transparent 30rem),
    #090b10;
}

button {
  font: inherit;
}

.container {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0 80px;
}

.hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.hero h1 {
  margin: 5px 0 8px;
  font-size: clamp(2rem, 5vw, 3.8rem);
  letter-spacing: -0.055em;
}

.subtitle,
.muted,
.action-message {
  color: #98a2b3;
}

.eyebrow {
  margin: 0;
  color: #a5b4fc;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.card {
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 20px;
  background: rgba(18, 22, 31, 0.88);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
}

.control-panel {
  padding: 18px;
  margin-bottom: 18px;
}

.button-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.button {
  min-height: 42px;
  padding: 0 17px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: #fff;
  cursor: pointer;
  transition: 150ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.button-primary {
  background: #4f46e5;
}

.button-danger {
  background: #b42318;
}

.button-secondary {
  background: #344054;
}

.button-success {
  background: #067647;
}

.button-ghost {
  border-color: rgba(255, 255, 255, 0.14);
  background: transparent;
}

.button-small {
  min-height: 34px;
  padding: 0 12px;
  font-size: 0.82rem;
}

.action-message {
  min-height: 20px;
  margin: 12px 2px 0;
  font-size: 0.88rem;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}

.metric {
  padding: 18px;
}

.metric span {
  display: block;
  margin-bottom: 10px;
  color: #98a2b3;
  font-size: 0.8rem;
}

.metric strong {
  font-size: 1rem;
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 14px;
  margin-bottom: 14px;
}

.alert-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 22px;
  margin-bottom: 18px;
  border-color: rgba(18, 183, 106, 0.5);
  background: rgba(6, 118, 71, 0.2);
}

.alert-panel[hidden] {
  display: none;
}

.alert-panel h2 {
  margin: 5px 0 7px;
}

.alert-panel p:last-child {
  margin: 0;
  color: #d1fadf;
}

.content-grid > .card,
section.card:last-child,
.targets-panel,
.system-panel,
.form-panel {
  padding: 22px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.section-heading h2 {
  margin: 4px 0 0;
  font-size: 1.15rem;
}

h3 {
  margin: 24px 0 12px;
  font-size: 0.9rem;
}

.details {
  display: grid;
  gap: 10px;
  margin: 0;
}

.details div {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 14px;
}

.details dt {
  color: #98a2b3;
}

.details dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.date-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.date-chip {
  padding: 7px 11px;
  border: 1px solid rgba(165, 180, 252, 0.26);
  border-radius: 999px;
  background: rgba(79, 70, 229, 0.14);
  color: #c7d2fe;
  font-size: 0.82rem;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 11px 9px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  text-align: left;
  font-size: 0.84rem;
}

th {
  color: #98a2b3;
  font-weight: 600;
}

.badge {
  flex: 0 0 auto;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
}

.badge-stopped {
  background: #344054;
}

.badge-running,
.badge-waiting,
.badge-checking,
.badge-starting {
  background: #067647;
}

.badge-backoff {
  background: #b54708;
}

.badge-blocked {
  background: #b42318;
}

.badge-alerting {
  background: #067647;
  box-shadow: 0 0 0 6px rgba(18, 183, 106, 0.15);
}

.target-form {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 16px;
}

.target-form label,
.fixed-target {
  display: grid;
  gap: 8px;
}

.target-form label span,
.fixed-target span {
  color: #98a2b3;
  font-size: 0.8rem;
}

.target-form input {
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 11px;
  outline: none;
  background: #0d1119;
  color: #f4f6fb;
  font: inherit;
}

.target-form input:focus {
  border-color: #818cf8;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}

.fixed-target {
  align-content: center;
}

.form-actions {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 9px;
}

.form-panel,
.targets-panel,
.system-panel {
  margin-bottom: 14px;
}

.target-list {
  display: grid;
  gap: 12px;
}

.target-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
}

.target-card.target-open {
  border-color: rgba(18, 183, 106, 0.5);
  background: rgba(6, 118, 71, 0.16);
}

.target-card.target-acknowledged {
  opacity: 0.78;
}

.target-main {
  display: grid;
  grid-template-columns: minmax(190px, 0.65fr) 1.4fr;
  gap: 22px;
}

.target-title h3 {
  margin: 12px 0 6px;
  font-size: 1.15rem;
}

.target-title > strong {
  color: #c7d2fe;
}

.target-state,
.target-enabled {
  display: inline-block;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.target-state {
  background: rgba(79, 70, 229, 0.25);
  color: #c7d2fe;
}

.target-open .target-state {
  background: rgba(18, 183, 106, 0.25);
  color: #a6f4c5;
}

.target-enabled {
  background: rgba(255, 255, 255, 0.07);
  color: #98a2b3;
}

.target-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px 20px;
  margin: 0;
}

.target-details div {
  min-width: 0;
}

.target-details dt {
  margin-bottom: 4px;
  color: #667085;
  font-size: 0.75rem;
}

.target-details dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 0.84rem;
}

.target-actions {
  display: flex;
  align-content: center;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
  max-width: 270px;
}

.details-wide {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.badge-acknowledged {
  background: #344054;
}

.event-list {
  display: grid;
  gap: 9px;
  max-height: 430px;
  overflow: auto;
}

.event {
  display: grid;
  grid-template-columns: 170px 90px 1fr;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  font-size: 0.82rem;
}

.event time,
.event-category {
  color: #98a2b3;
}

.event-success {
  border-left: 3px solid #12b76a;
}

.event-warning {
  border-left: 3px solid #f79009;
}

.event-error {
  border-left: 3px solid #f04438;
}

.empty {
  color: #667085;
  text-align: center;
}

@media (max-width: 820px) {
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .target-form {
    grid-template-columns: 1fr;
  }

  .target-card,
  .target-main {
    grid-template-columns: 1fr;
  }

  .target-actions {
    justify-content: flex-start;
    max-width: none;
  }
}

@media (max-width: 560px) {
  .container {
    width: min(100% - 20px, 1180px);
    padding-top: 28px;
  }

  .hero {
    align-items: flex-end;
  }

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

  .button {
    flex: 1 1 calc(50% - 10px);
  }

  .event {
    grid-template-columns: 1fr;
    gap: 4px;
  }

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

  .target-details,
  .details-wide {
    grid-template-columns: 1fr;
  }
}
