:root {
  --bg: radial-gradient(circle at 10% 10%, #f2fff8 0%, #ecf3ff 40%, #f7f3ea 100%);
  --surface: #ffffffee;
  --line: rgba(24, 35, 44, 0.14);
  --text: #14212b;
  --muted: #586674;
  --accent: #0f6a4f;
  --accent-weak: #e2f4ec;
  --danger: #b13042;
  --shadow: 0 14px 34px rgba(20, 33, 43, 0.08);
}

* { box-sizing: border-box; }

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "IBM Plex Sans KR", sans-serif;
  color: var(--text);
  background: var(--bg);
}

.app-shell {
  width: min(1360px, calc(100vw - 28px));
  margin: 14px auto 24px;
  display: grid;
  gap: 10px;
}

.top-bar,
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px;
  gap: 10px;
}

.top-eyebrow { margin: 0; font-size: 12px; color: var(--muted); }
h1 { margin: 2px 0 0; font-size: 24px; }
h2 { margin: 0; font-size: 18px; }
h3 { margin: 0; font-size: 15px; }

.top-actions {
  display: flex;
  gap: 8px;
}

.icon-btn,
.ghost-btn,
.primary-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 10px;
  min-height: 40px;
  min-width: 40px;
  padding: 0 12px;
  font: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.icon-btn:hover,
.ghost-btn:hover,
.primary-btn:hover {
  border-color: color-mix(in srgb, var(--accent) 42%, transparent);
  color: var(--accent);
}

.primary-btn {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}

.primary-btn:hover { color: #fff; filter: brightness(0.94); }

.toolbar {
  padding: 12px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.toolbar-right {
  display: flex;
  align-items: end;
  gap: 8px;
  flex-wrap: wrap;
}

.field-wrap {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.token-wrap { min-width: 300px; }

.field {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font: inherit;
  padding: 10px;
}

.token-input { resize: vertical; min-height: 66px; }

.status-line {
  min-height: 22px;
  margin: 0 4px;
  color: var(--muted);
  font-size: 13px;
}

.status-line.error { color: var(--danger); }

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.summary-card {
  background: var(--accent-weak);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  border-radius: 12px;
  padding: 10px;
}

.summary-card p { margin: 0; font-size: 12px; color: var(--muted); }
.summary-card strong { font-size: 20px; }

.tabs-card { padding: 8px; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tab-btn {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
}
.tab-btn.active {
  border-color: color-mix(in srgb, var(--accent) 44%, transparent);
  background: #ebf7f1;
  color: #0f6a4f;
}

.layout-grid {
  display: grid;
  grid-template-columns: 1.12fr 1fr;
  gap: 10px;
}

.card { padding: 12px; }
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.detail-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chip {
  background: #eef3f7;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  color: #32404d;
}

.reports-list {
  display: grid;
  gap: 8px;
  max-height: min(72vh, 840px);
  overflow: auto;
}

.report-row {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 10px;
  cursor: pointer;
  display: grid;
  gap: 6px;
}

.report-row.selected {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  background: #f0f8f4;
}

.report-row-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.report-row-meta,
.report-row-time,
.report-row-reason {
  margin: 0;
  font-size: 13px;
}

.report-row-meta,
.report-row-time,
.muted-text {
  color: var(--muted);
}

.detail-panel {
  display: grid;
  gap: 10px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 8px;
  margin: 0;
  padding: 0;
}

.detail-grid dt,
.detail-grid dd {
  margin: 0;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
}

.detail-grid dt { font-size: 12px; color: var(--muted); }
.detail-grid dd { font-size: 13px; white-space: pre-wrap; word-break: break-word; }

.action-box {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 10px;
  display: grid;
  gap: 8px;
}

.list {
  display: grid;
  gap: 8px;
}

.list-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 8px;
}

.list-item p { margin: 4px 0; font-size: 13px; }

.empty-state {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  padding: 10px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: #fff;
}

.status-open { color: #2456b2; }
.status-in_review { color: #7e5900; }
.status-resolved { color: #0d7a37; }
.status-rejected { color: #ad2234; }
.status-withdrawn { color: #5e5e5e; }

.hidden { display: none !important; }

@media (max-width: 1080px) {
  .layout-grid { grid-template-columns: 1fr; }
  .reports-list { max-height: 42vh; }
}

@media (max-width: 760px) {
  .app-shell {
    width: calc(100vw - 14px);
    margin: 8px auto 14px;
    gap: 8px;
  }
  .top-bar,
  .card { border-radius: 12px; }
  h1 { font-size: 20px; }
  .toolbar { grid-template-columns: 1fr; }
  .summary-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
}
