:root {
  --bg: #f3f5f9;
  --panel: #ffffff;
  --line: #d9e0ea;
  --text: #172133;
  --muted: #5b6579;
  --brand: #0f766e;
  --brand-soft: #ccfbf1;
  --warn: #b45309;
  --error: #b91c1c;
  --radius: 12px;
  --shadow: 0 8px 28px rgba(20, 26, 40, 0.08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "SUIT", "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 15% 20%, #e6eefb 0%, #f3f5f9 40%, #f7f8fb 100%);
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 250px 1fr;
}

.sidebar {
  border-right: 1px solid var(--line);
  background: #f8fbff;
  padding: 20px 14px;
}

.brand {
  font-weight: 700;
  font-size: 18px;
  margin: 4px 8px 18px;
}

.nav-title {
  color: var(--muted);
  font-size: 12px;
  margin: 18px 8px 8px;
}

.nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-list a {
  display: block;
  text-decoration: none;
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
  margin: 4px 0;
  font-size: 14px;
}

.nav-list a:hover,
.nav-list a.active {
  background: var(--brand-soft);
  color: #115e59;
}

.main {
  padding: 24px;
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.page-head h1 {
  margin: 0;
  font-size: 24px;
}

.page-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 14px;
  cursor: pointer;
}

.btn.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
}

.card .label {
  color: var(--muted);
  font-size: 12px;
}

.card .value {
  font-size: 26px;
  font-weight: 700;
  margin-top: 8px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.panel-head h2 {
  margin: 0;
  font-size: 16px;
}

.input {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  min-width: 220px;
}

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

th, td {
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid #ecf0f5;
  font-size: 14px;
}

th {
  background: #f7f9fc;
  font-size: 12px;
  color: var(--muted);
}

.badge {
  display: inline-block;
  padding: 4px 8px;
  font-size: 12px;
  border-radius: 999px;
  background: #eef2f7;
  color: #334155;
}

.badge.error {
  background: #fee2e2;
  color: var(--error);
}

.badge.warn {
  background: #ffedd5;
  color: var(--warn);
}

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

.meta-row {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfdff;
}

.meta-row .k {
  font-size: 12px;
  color: var(--muted);
}

.meta-row .v {
  margin-top: 4px;
  font-weight: 600;
}

.preview {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 14px;
}

.thumb {
  background: #dbe6f7;
  border-radius: 10px;
  min-height: 240px;
  display: grid;
  place-items: center;
  color: #334155;
  font-size: 14px;
}

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

.log-box {
  background: #0f172a;
  color: #cbd5e1;
  border-radius: 10px;
  padding: 12px;
  min-height: 160px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  overflow: auto;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.54);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal.open { display: flex; }

.modal-card {
  background: #fff;
  width: min(900px, 100%);
  border-radius: 14px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.modal-head {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-body {
  padding: 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 1024px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .preview { grid-template-columns: 1fr; }
  .meta { grid-template-columns: 1fr; }
  .modal-body { grid-template-columns: 1fr; }
}
